i18ntk 2.3.8 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "i18ntk",
3
- "version": "2.3.8",
3
+ "version": "2.4.0",
4
4
  "description": "🚀 The fastest internationalization toolkit with 97% performance boost! Zero-dependency, enterprise-grade internationalization for React, Vue, Angular, Python, Java, PHP & more. Features PIN protection, auto framework detection, 7+ UI languages, and comprehensive translation management. Perfect for startups to enterprises.",
5
5
  "keywords": [
6
6
  "i18n",
@@ -224,9 +224,9 @@
224
224
  },
225
225
  "preferGlobal": true,
226
226
  "versionInfo": {
227
- "version": "2.3.8",
228
- "releaseDate": "13/04/2026",
229
- "lastUpdated": "13/04/2026",
227
+ "version": "2.4.0",
228
+ "releaseDate": "16/04/2026",
229
+ "lastUpdated": "16/04/2026",
230
230
  "maintainer": "Vlad Noskov",
231
231
  "changelog": "./CHANGELOG.md",
232
232
  "documentation": "./README.md",
@@ -241,12 +241,12 @@
241
241
  "SECURITY: Hardened release checks and added explicit support guidance to update from pre-2.3.5 versions.",
242
242
  "CONFIG: Added cross-process file locking for .i18ntk-config writes to prevent production rename races.",
243
243
  "CONFIG: Made autosave runtime-safe with non-throwing save failures and I18NTK_DISABLE_AUTOSAVE support.",
244
- "SECURITY: Hardened reset/backup path handling and made npm update checks explicit opt-in.",
245
- "CLI: Added npm registry version check with upgrade warning for out-of-date installs.",
244
+ "SECURITY: Hardened reset/backup path handling and disabled manager backup-route execution in current builds.",
245
+ "CLI: Removed npm registry startup update checks to eliminate outbound network calls in scanner-restricted environments.",
246
246
  "I18N: Completed internal UI locale parity and actionable untranslated-key cleanup across supported languages."
247
247
  ],
248
248
  "breakingChanges": [],
249
- "nextVersion": "2.4.0",
249
+ "nextVersion": "2.4.1",
250
250
  "supportedNodeVersions": ">=16.0.0",
251
251
  "supportedFrameworks": {
252
252
  "react-i18next": ">=11.0.0",
@@ -268,7 +268,7 @@
268
268
  "spring-boot": ">=2.5.0",
269
269
  "laravel": ">=8.0.0"
270
270
  },
271
- "supportPolicy": "Versions earlier than 2.3.8 may be unstable or insecure. Upgrade to 2.3.8 or newer."
271
+ "supportPolicy": "Versions earlier than 2.4.0 may be unstable or insecure. Upgrade to 2.4.0 or newer."
272
272
  },
273
273
  "_comment": "This package is zero-dependency and uses only native Node.js modules"
274
274
  }
@@ -1,147 +1,18 @@
1
- const https = require('https');
2
- const { compareVersions } = require('./version-utils');
1
+ 'use strict';
3
2
 
4
- const DEFAULT_TIMEOUT_MS = 1800;
5
- const NPM_REGISTRY_BASE = 'https://registry.npmjs.org';
3
+ /**
4
+ * Update checks were intentionally removed to avoid outbound network access
5
+ * during CLI startup and to reduce scanner noise in restricted environments.
6
+ *
7
+ * We keep the same exported API for backwards compatibility.
8
+ */
6
9
 
7
- function isSemverLike(version) {
8
- return typeof version === 'string' && /^\d+\.\d+\.\d+([-.][0-9A-Za-z.-]+)?$/.test(version.trim());
10
+ async function checkNpmOutdated() {
11
+ return null;
9
12
  }
10
13
 
11
- function fetchPackageMetadata(packageName, timeoutMs = DEFAULT_TIMEOUT_MS) {
12
- const safePackageName = encodeURIComponent(packageName);
13
- const requestUrl = `${NPM_REGISTRY_BASE}/${safePackageName}`;
14
-
15
- return new Promise((resolve) => {
16
- let settled = false;
17
-
18
- const finish = (value) => {
19
- if (!settled) {
20
- settled = true;
21
- resolve(value);
22
- }
23
- };
24
-
25
- const req = https.get(
26
- requestUrl,
27
- {
28
- timeout: timeoutMs,
29
- headers: {
30
- Accept: 'application/json',
31
- 'User-Agent': 'i18ntk-version-check'
32
- }
33
- },
34
- (res) => {
35
- if (res.statusCode !== 200) {
36
- res.resume();
37
- finish(null);
38
- return;
39
- }
40
-
41
- let raw = '';
42
- res.on('data', (chunk) => {
43
- raw += chunk;
44
- });
45
- res.on('end', () => {
46
- try {
47
- finish(JSON.parse(raw));
48
- } catch {
49
- finish(null);
50
- }
51
- });
52
- }
53
- );
54
-
55
- req.on('timeout', () => {
56
- req.destroy();
57
- finish(null);
58
- });
59
- req.on('error', () => finish(null));
60
- });
61
- }
62
-
63
- function getOutdatedStatus(currentVersion, metadata) {
64
- if (!isSemverLike(currentVersion) || !metadata || !metadata.versions) {
65
- return null;
66
- }
67
-
68
- const distTags = metadata['dist-tags'] || {};
69
- const taggedLatest = distTags.latest;
70
- const allPublishedVersions = Object.keys(metadata.versions).filter(isSemverLike);
71
-
72
- if (allPublishedVersions.length === 0) {
73
- return null;
74
- }
75
-
76
- const latestVersion = isSemverLike(taggedLatest)
77
- ? taggedLatest
78
- : allPublishedVersions.sort(compareVersions).at(-1);
79
-
80
- if (!latestVersion || !isSemverLike(latestVersion)) {
81
- return null;
82
- }
83
-
84
- const currentMeta = metadata.versions[currentVersion] || null;
85
- const isCurrentDeprecated = Boolean(currentMeta && currentMeta.deprecated);
86
- const isOutdated = compareVersions(currentVersion, latestVersion) < 0;
87
-
88
- const newerStableVersions = allPublishedVersions.filter((version) => (
89
- compareVersions(version, currentVersion) > 0 &&
90
- compareVersions(version, latestVersion) <= 0
91
- ));
92
-
93
- return {
94
- latestVersion,
95
- isOutdated,
96
- isCurrentDeprecated,
97
- newerStableCount: newerStableVersions.length
98
- };
99
- }
100
-
101
- async function checkNpmOutdated({ packageName, currentVersion, timeoutMs = DEFAULT_TIMEOUT_MS }) {
102
- const metadata = await fetchPackageMetadata(packageName, timeoutMs);
103
- return getOutdatedStatus(currentVersion, metadata);
104
- }
105
-
106
- async function printUpgradeWarningIfOutdated({
107
- packageName,
108
- currentVersion,
109
- timeoutMs = DEFAULT_TIMEOUT_MS
110
- }) {
111
- const enabled = String(process.env.I18NTK_ENABLE_UPDATE_CHECK || '').toLowerCase();
112
- if (!(enabled === '1' || enabled === 'true' || enabled === 'yes')) {
113
- return;
114
- }
115
-
116
- if (process.env.I18NTK_DISABLE_UPDATE_CHECK === 'true') {
117
- return;
118
- }
119
-
120
- const status = await checkNpmOutdated({ packageName, currentVersion, timeoutMs });
121
- if (!status) {
122
- return;
123
- }
124
-
125
- if (status.isCurrentDeprecated) {
126
- console.warn(
127
- `\n⚠️ Installed ${packageName}@${currentVersion} is deprecated on npm. ` +
128
- `Upgrade to ${packageName}@${status.latestVersion}:\n` +
129
- ` npm install -g ${packageName}@latest`
130
- );
131
- return;
132
- }
133
-
134
- if (status.isOutdated) {
135
- const suffix = status.newerStableCount === 1 ? '' : 's';
136
- console.warn(
137
- `\n⚠️ Update available for ${packageName}: ${currentVersion} -> ${status.latestVersion} ` +
138
- `(${status.newerStableCount} newer release${suffix}).\n` +
139
- ` Run: npm install -g ${packageName}@latest`
140
- );
141
- }
14
+ async function printUpgradeWarningIfOutdated() {
15
+ return;
142
16
  }
143
17
 
144
- module.exports = {
145
- checkNpmOutdated,
146
- printUpgradeWarningIfOutdated
147
- };
18
+ module.exports = { checkNpmOutdated, printUpgradeWarningIfOutdated };