i18ntk 2.3.8 → 2.5.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/README.md +10 -6
- package/main/i18ntk-backup-class.js +35 -423
- package/main/manage/commands/BackupCommand.js +62 -62
- package/main/manage/commands/FixerCommand.js +97 -97
- package/main/manage/managers/DebugMenu.js +10 -9
- package/main/manage/services/SetupService.js +444 -462
- package/package.json +61 -32
- package/runtime/index.js +14 -8
- package/utils/admin-auth.js +594 -576
- package/utils/config-manager.js +72 -72
- package/utils/env-manager.js +117 -26
- package/utils/i18n-helper.js +50 -49
- package/utils/json-output.js +13 -12
- package/utils/logger.js +7 -6
- package/utils/npm-version-warning.js +12 -141
- package/utils/prompt-helper.js +44 -41
- package/utils/secure-errors.js +156 -154
- package/utils/security.js +235 -233
- package/utils/setup-enforcer.js +110 -109
- package/utils/terminal-icons.js +164 -163
- package/settings/i18ntk-config.json +0 -283
- package/utils/admin-pin.js +0 -520
- package/utils/arg-parser.js +0 -40
- package/utils/cli-args.js +0 -210
- package/utils/mini-commander.js +0 -179
- package/utils/missing-key-validator.js +0 -858
- package/utils/path-utils.js +0 -33
- package/utils/performance-optimizer.js +0 -246
- package/utils/prompt-new.js +0 -55
- package/utils/promptPin.js +0 -76
- package/utils/safe-json.js +0 -40
- package/utils/secure-backup.js +0 -340
- package/utils/security-check-improved.js +0 -393
- package/utils/security-config.js +0 -239
- package/utils/setup-validator.js +0 -717
- package/utils/ultra-performance-optimizer.js +0 -352
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "i18ntk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.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",
|
|
@@ -131,9 +131,6 @@
|
|
|
131
131
|
"default": "./runtime/enhanced.js"
|
|
132
132
|
},
|
|
133
133
|
"./runtime/*": "./runtime/*",
|
|
134
|
-
"./main/*": "./main/*",
|
|
135
|
-
"./utils/*": "./utils/*",
|
|
136
|
-
"./settings/*": "./settings/*",
|
|
137
134
|
"./ui-locales/*": "./ui-locales/*",
|
|
138
135
|
"./package.json": "./package.json"
|
|
139
136
|
},
|
|
@@ -158,20 +155,57 @@
|
|
|
158
155
|
"test": "tests"
|
|
159
156
|
},
|
|
160
157
|
"files": [
|
|
161
|
-
"main/",
|
|
158
|
+
"main/i18ntk-analyze.js",
|
|
159
|
+
"main/i18ntk-backup-class.js",
|
|
160
|
+
"main/i18ntk-backup.js",
|
|
161
|
+
"main/i18ntk-complete.js",
|
|
162
|
+
"main/i18ntk-doctor.js",
|
|
163
|
+
"main/i18ntk-fixer.js",
|
|
164
|
+
"main/i18ntk-init.js",
|
|
165
|
+
"main/i18ntk-scanner.js",
|
|
166
|
+
"main/i18ntk-setup.js",
|
|
167
|
+
"main/i18ntk-sizing.js",
|
|
168
|
+
"main/i18ntk-summary.js",
|
|
169
|
+
"main/i18ntk-ui.js",
|
|
170
|
+
"main/i18ntk-usage.js",
|
|
171
|
+
"main/i18ntk-validate.js",
|
|
172
|
+
"main/manage/",
|
|
162
173
|
"runtime/",
|
|
163
|
-
"
|
|
164
|
-
"settings/",
|
|
174
|
+
"settings/language-config.json",
|
|
175
|
+
"settings/settings-cli.js",
|
|
176
|
+
"settings/settings-manager.js",
|
|
165
177
|
"ui-locales/",
|
|
166
178
|
"!main/manage/index-fixed.js",
|
|
167
|
-
"
|
|
168
|
-
"
|
|
169
|
-
"
|
|
170
|
-
"
|
|
171
|
-
"
|
|
172
|
-
"
|
|
173
|
-
"
|
|
174
|
-
"
|
|
179
|
+
"utils/admin-auth.js",
|
|
180
|
+
"utils/admin-cli.js",
|
|
181
|
+
"utils/cli-helper.js",
|
|
182
|
+
"utils/cli.js",
|
|
183
|
+
"utils/colors-new.js",
|
|
184
|
+
"utils/config-helper.js",
|
|
185
|
+
"utils/config-manager.js",
|
|
186
|
+
"utils/config.js",
|
|
187
|
+
"utils/env-manager.js",
|
|
188
|
+
"utils/exit-codes.js",
|
|
189
|
+
"utils/extractor-manager.js",
|
|
190
|
+
"utils/extractors/regex.js",
|
|
191
|
+
"utils/format-manager.js",
|
|
192
|
+
"utils/formats/json.js",
|
|
193
|
+
"utils/framework-detector.js",
|
|
194
|
+
"utils/i18n-helper.js",
|
|
195
|
+
"utils/init-helper.js",
|
|
196
|
+
"utils/json-output.js",
|
|
197
|
+
"utils/locale-optimizer.js",
|
|
198
|
+
"utils/logger.js",
|
|
199
|
+
"utils/npm-version-warning.js",
|
|
200
|
+
"utils/plugin-loader.js",
|
|
201
|
+
"utils/prompt-helper.js",
|
|
202
|
+
"utils/prompt.js",
|
|
203
|
+
"utils/secure-errors.js",
|
|
204
|
+
"utils/security.js",
|
|
205
|
+
"utils/setup-enforcer.js",
|
|
206
|
+
"utils/terminal-icons.js",
|
|
207
|
+
"utils/version-utils.js",
|
|
208
|
+
"utils/watch-locales.js",
|
|
175
209
|
"LICENSE",
|
|
176
210
|
"package.json",
|
|
177
211
|
"README.md"
|
|
@@ -203,6 +237,7 @@
|
|
|
203
237
|
"security:audit": "npm run security:check && npm run security:test",
|
|
204
238
|
"test": "npm run security:test",
|
|
205
239
|
"test:all": "npm run security:audit",
|
|
240
|
+
"release:reset": "node scripts/reset-release-state.js",
|
|
206
241
|
"prepublishOnly": "npm run security:audit",
|
|
207
242
|
"prepare": "npm run security:check",
|
|
208
243
|
"backup:create": "node main/i18ntk-backup.js create",
|
|
@@ -224,29 +259,23 @@
|
|
|
224
259
|
},
|
|
225
260
|
"preferGlobal": true,
|
|
226
261
|
"versionInfo": {
|
|
227
|
-
"version": "2.
|
|
228
|
-
"releaseDate": "
|
|
229
|
-
"lastUpdated": "
|
|
262
|
+
"version": "2.5.0",
|
|
263
|
+
"releaseDate": "29/04/2026",
|
|
264
|
+
"lastUpdated": "29/04/2026",
|
|
230
265
|
"maintainer": "Vlad Noskov",
|
|
231
266
|
"changelog": "./CHANGELOG.md",
|
|
232
267
|
"documentation": "./README.md",
|
|
233
268
|
"apiReference": "./docs/api/API_REFERENCE.md",
|
|
234
269
|
"majorChanges": [
|
|
235
|
-
"
|
|
236
|
-
"SECURITY:
|
|
237
|
-
"
|
|
238
|
-
"
|
|
239
|
-
"
|
|
240
|
-
"PACKAGING:
|
|
241
|
-
"SECURITY: Hardened release checks and added explicit support guidance to update from pre-2.3.5 versions.",
|
|
242
|
-
"CONFIG: Added cross-process file locking for .i18ntk-config writes to prevent production rename races.",
|
|
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.",
|
|
246
|
-
"I18N: Completed internal UI locale parity and actionable untranslated-key cleanup across supported languages."
|
|
270
|
+
"SECURITY: Centralized environment-variable access behind an explicit allowlist.",
|
|
271
|
+
"SECURITY: Hardened path containment checks to reject sibling-prefix traversal cases.",
|
|
272
|
+
"SECURITY: Added timing-safe admin PIN hash comparison and fixed expired-session cleanup.",
|
|
273
|
+
"SECURITY: Expanded release security scanning to nested production source files.",
|
|
274
|
+
"FIXER: Fixed translation fixer writes for absolute source directories and confirmed applied fixes persist.",
|
|
275
|
+
"PACKAGING: Updated package and documentation metadata for the 2.5.0 release."
|
|
247
276
|
],
|
|
248
277
|
"breakingChanges": [],
|
|
249
|
-
"nextVersion": "2.
|
|
278
|
+
"nextVersion": "2.5.1",
|
|
250
279
|
"supportedNodeVersions": ">=16.0.0",
|
|
251
280
|
"supportedFrameworks": {
|
|
252
281
|
"react-i18next": ">=11.0.0",
|
|
@@ -268,7 +297,7 @@
|
|
|
268
297
|
"spring-boot": ">=2.5.0",
|
|
269
298
|
"laravel": ">=8.0.0"
|
|
270
299
|
},
|
|
271
|
-
"supportPolicy": "Versions earlier than 2.
|
|
300
|
+
"supportPolicy": "Versions earlier than 2.5.0 may be unstable or insecure. Upgrade to 2.5.0 or newer."
|
|
272
301
|
},
|
|
273
302
|
"_comment": "This package is zero-dependency and uses only native Node.js modules"
|
|
274
303
|
}
|
package/runtime/index.js
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
const fs = require('fs');
|
|
7
7
|
const path = require('path');
|
|
8
8
|
const SecurityUtils = require('../utils/security');
|
|
9
|
+
const { envManager } = require('../utils/env-manager');
|
|
9
10
|
|
|
10
11
|
let configManager = null;
|
|
11
12
|
try { configManager = require('../utils/config-manager'); } catch (_) { /* optional */ }
|
|
@@ -54,15 +55,18 @@ function resolveBaseDir(explicitBaseDir) {
|
|
|
54
55
|
// 1) Highest priority: explicit option
|
|
55
56
|
if (explicitBaseDir) return path.resolve(explicitBaseDir);
|
|
56
57
|
// 2) Environment override for CI/explicit control
|
|
57
|
-
|
|
58
|
-
|
|
58
|
+
const runtimeDir = envManager.get('I18NTK_RUNTIME_DIR');
|
|
59
|
+
if (runtimeDir) {
|
|
60
|
+
return path.resolve(runtimeDir);
|
|
59
61
|
}
|
|
60
62
|
// 2b) Respect config-style env overrides, even without config-manager
|
|
61
|
-
|
|
62
|
-
|
|
63
|
+
const envI18nDir = envManager.get('I18NTK_I18N_DIR');
|
|
64
|
+
if (envI18nDir) {
|
|
65
|
+
return path.resolve(envI18nDir);
|
|
63
66
|
}
|
|
64
|
-
|
|
65
|
-
|
|
67
|
+
const envSourceDir = envManager.get('I18NTK_SOURCE_DIR');
|
|
68
|
+
if (envSourceDir) {
|
|
69
|
+
return path.resolve(envSourceDir);
|
|
66
70
|
}
|
|
67
71
|
// 3) Use config-manager if available (single source of truth: i18ntk-config.json)
|
|
68
72
|
try {
|
|
@@ -72,11 +76,13 @@ function resolveBaseDir(explicitBaseDir) {
|
|
|
72
76
|
// If config-manager resolved absolute paths, use as-is; otherwise resolve from project cwd
|
|
73
77
|
const isAbs = typeof base === 'string' && path.isAbsolute(base);
|
|
74
78
|
if (isAbs) return base;
|
|
75
|
-
const
|
|
79
|
+
const envProjectRoot = envManager.get('I18NTK_PROJECT_ROOT');
|
|
80
|
+
const root = envProjectRoot ? path.resolve(envProjectRoot) : process.cwd();
|
|
76
81
|
return path.resolve(root, base);
|
|
77
82
|
} catch (_) {
|
|
78
83
|
// 4) Fallback to conventional './locales' from project CWD
|
|
79
|
-
const
|
|
84
|
+
const envProjectRoot = envManager.get('I18NTK_PROJECT_ROOT');
|
|
85
|
+
const root = envProjectRoot ? path.resolve(envProjectRoot) : process.cwd();
|
|
80
86
|
return path.resolve(root, './locales');
|
|
81
87
|
}
|
|
82
88
|
}
|