i18ntk 4.5.1 → 4.5.3
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/CHANGELOG.md +179 -38
- package/README.md +14 -3
- package/main/i18ntk-complete.js +18 -5
- package/main/i18ntk-scanner.js +16 -0
- package/main/i18ntk-translate.js +3 -1
- package/main/i18ntk-usage.js +1 -1
- package/main/manage/commands/ScannerCommand.js +16 -0
- package/package.json +7 -7
- package/utils/config-helper.js +1 -1
- package/utils/report-model.js +17 -0
- package/utils/usage-insights.js +16 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,11 +3,43 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
-
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
-
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [4.5.3] - 2026-06-19
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- **Usage Scanner (Critical):** Fixed `supportedExtensions` default fallback in `config-helper.js` that excluded `.tsx` and `.jsx` files from source scanning. The default was `['.json', '.js', '.ts']` — missing `.jsx` and `.tsx`. In a Next.js project with 2704 keys across 1087 files, this caused the scanner to find only 57 keys (2.1%) instead of 2702 (99.9%) because all `.tsx` component files were silently ignored. The fix adds `.jsx` and `.tsx` to the default fallback: `['.json', '.js', '.jsx', '.ts', '.tsx']`.
|
|
13
|
+
- **Usage Dead Code:** Cleaned up unreachable initializer in `i18ntk-usage.js` that was supposed to set default `includeExtensions` but never ran because `supportedExtensions` was always set by `config-helper.js`. Added `.vue` and `.svelte` to the fallback for completeness.
|
|
14
|
+
|
|
15
|
+
## [4.5.2] - 2026-06-19
|
|
16
|
+
|
|
17
|
+
### Fixed
|
|
18
|
+
|
|
19
|
+
- **Complete (Namespace Wrapper):** Fixed critical bug where missing keys were inserted at the wrong nesting level in target locale files. When a file (e.g., `auth.json`) contains a namespace wrapper matching its filename (`{ "auth": { ... } }`), the `complete` command now detects this wrapper and inserts keys inside it (`auth.panel.sign_in`) instead of at root level (`panel.sign_in`). This prevents runtime lookup failures for `t("auth.panel.sign_in")`.
|
|
20
|
+
- **Translate (--output-dir):** Fixed bug where the `--output-dir` flag wrote translated files directly to `<output-dir>/<filename>` instead of `<output-dir>/<targetLang>/<filename>`. This caused all translations (regardless of target language) to land in the same directory, silently overwriting files from other languages in multi-language projects. When `args.outputDir` is provided, `processFile()` now appends `targetLang` to construct the correct output path.
|
|
21
|
+
|
|
22
|
+
### Tests
|
|
23
|
+
|
|
24
|
+
- Added `tests/regression-v452.test.js` with 18 regression tests covering:
|
|
25
|
+
- Complete command namespace wrapper detection (parseKeyPath, setNestedValue, hasNestedKey, wrapper detection logic)
|
|
26
|
+
- Validate getAllKeys leaf-only mode and completeness calculation
|
|
27
|
+
- Runtime alias parameter support (localeDir/targetLocale/sourceLocale)
|
|
28
|
+
- Scanner source directory fallback when sourceDir equals i18nDir
|
|
29
|
+
- Doctor auto-detection of languages from i18n directory
|
|
30
|
+
- Version consistency across package files
|
|
31
|
+
- Added `--output-dir` target language subdirectory tests to `tests/regression-v452.test.js`: verifies `processFile()` places output in `<outputDir>/<targetLang>/<file>` and that CLI `--output-dir` produces the correct nested path
|
|
32
|
+
- Added 8 tests in `tests/usage-insights.test.js` for hardcoded text false-positive filtering:
|
|
33
|
+
- JS/TS built-in type name rejection (Promise, Boolean, String)
|
|
34
|
+
- Code expression operator rejection (&&, ||, ===, !==, =>)
|
|
35
|
+
- Template literal interpolation rejection (${...})
|
|
36
|
+
- Real human text still correctly detected (welcome messages, form labels)
|
|
37
|
+
|
|
8
38
|
## [4.5.1] - 2026-06-19
|
|
9
39
|
|
|
10
40
|
### Fixed
|
|
41
|
+
|
|
42
|
+
- **Complete:** Fixed wrong nesting level when adding missing keys to target locale files that have a namespace wrapper matching the file name. Previously, `parseKeyPath("auth.panel.sign_in")` returned `{ file: "auth.json", key: "panel.sign_in" }`, and `setNestedValue` inserted `panel` at the root level instead of inside the existing `auth` wrapper. The fix detects namespace wrappers (e.g., `auth.json` containing `{ "auth": { ... } }`) and prepends the namespace to the insertion path so keys go inside the wrapper.
|
|
11
43
|
- **Validate:** `getAllKeys()` no longer reports parent namespace objects (e.g., `footer`) as missing keys alongside their leaf children (`footer.copyright`). Only leaf (string) keys are now compared during structural validation.
|
|
12
44
|
- **Validate:** Completion percentage now compares against source locale total keys, not target locale self-count. A locale with 14 of 42 source keys now correctly shows 33% instead of 100%.
|
|
13
45
|
- **Doctor:** No longer flags unconfigured locales (`de`, `ru`) as "missing". Now auto-detects available languages from the i18n directory structure, only checking against actually-configured languages.
|
|
@@ -17,12 +49,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
17
49
|
## [4.5.0] - 2026-06-19
|
|
18
50
|
|
|
19
51
|
### Security — Prototype Pollution Hardened
|
|
52
|
+
|
|
20
53
|
- **safe-json.js:** Added `stripPrototypePollution()` function that recursively filters `__proto__`, `constructor`, and `prototype` keys from parsed JSON locale files. Applied to all `readJsonSafe()` calls.
|
|
21
54
|
- **runtime/index.js:** `deepMerge()` now blocks `__proto__`, `constructor`, and `prototype` keys during locale data merging. `readJsonSafe()` now applies `stripPrototypeKeys()` to all parsed JSON, ensuring prototype pollution protection at runtime data ingestion point.
|
|
22
55
|
- **settings-manager.js:** `mergeWithDefaults()` now filters prototype pollution keys from user-supplied settings before spreading into defaults.
|
|
23
56
|
- **safe-json.js:** Exported `stripPrototypePollution` for use by other modules.
|
|
24
57
|
|
|
25
58
|
### Fixed
|
|
59
|
+
|
|
26
60
|
- **Backup:** Removed duplicate `const sourceDir` declaration that caused SyntaxError at module load (was unrecoverable crash for all backup operations).
|
|
27
61
|
- **Backup:** Added `try/catch` around `JSON.parse()` in restore path to handle corrupt backup files gracefully with a descriptive error message.
|
|
28
62
|
- **Complete:** Added missing `getUnifiedConfig` import from `utils/config-helper` (was ReferenceError at runtime).
|
|
@@ -34,6 +68,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
34
68
|
- **i18n-helper:** `stripBOMAndComments()` now safely handles null/undefined inputs.
|
|
35
69
|
|
|
36
70
|
### Changed
|
|
71
|
+
|
|
37
72
|
- **Version:** Bumped to 4.5.0 (minor version due to scope and severity of security fixes).
|
|
38
73
|
- **i18n-helper deepMerge:** Synchronized with runtime `deepMerge` — now uses `Object.keys` (safe) instead of `for...in`, handles null target/fallback, and filters `__proto__`/`constructor`/`prototype` keys for consistent prototype pollution protection across all code paths.
|
|
39
74
|
- **Testing:** Added `tests/edge-case-hardening.test.js` with 33 new tests covering prototype pollution protection, SecurityUtils edge cases, backup corrupt handling, report malformed JSON resilience, validation risk detection null-safety, config manager robustness, version consistency, and deepMerge edge cases.
|
|
@@ -42,6 +77,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
42
77
|
## [4.4.5] - 2026-06-08
|
|
43
78
|
|
|
44
79
|
### Fixed
|
|
80
|
+
|
|
45
81
|
- Removed orphaned duplicate code block from `main/i18ntk-scanner.js` that caused a SyntaxError when loading the scanner CLI.
|
|
46
82
|
- Fixed `utils/safe-json.js` where a duplicate `readJsonSafe` function overwrote the SecurityUtils-based implementation with an insecure version that referenced an undefined `fs` variable.
|
|
47
83
|
- Added periodic cache eviction to `missingKeyCache` in `utils/i18n-helper.js` to prevent unbounded memory growth in long-running processes.
|
|
@@ -56,43 +92,51 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
56
92
|
- **Security:** `validateConfig` now runs `isSafePath` validation on absolute paths instead of skipping them entirely (`return` in forEach was bypassing all checks for absolute config paths).
|
|
57
93
|
|
|
58
94
|
### Added
|
|
95
|
+
|
|
59
96
|
- **Framework detection:** Added support for ngx-translate (Angular), next-intl (Next.js), nuxt-i18n (Nuxt), svelte-i18n (Svelte), and solid-i18n (Solid) framework detection via dependency lookup.
|
|
60
97
|
- `detectFramework()` now also checks the `dependencies` property as a fallback for the `deps` array, ensuring backward compatibility.
|
|
61
98
|
- Created `tests/fixtures/test.json` fixture so file system security tests validate real file reads instead of passing vacuously.
|
|
62
99
|
|
|
63
100
|
### Changed
|
|
101
|
+
|
|
64
102
|
- Removed dead `{ gte }` import from `version-utils` and unused `FRAMEWORK_COMPATIBILITY` object from `framework-detector.js`.
|
|
65
103
|
- Security test `logSecurityEvent` now properly sets `I18NTK_DEBUG` and `I18NTK_ENABLE_SECURITY_LOGS` env vars and uses try/catch to verify non-throw behavior.
|
|
66
104
|
- `validateConfig` "reject invalid configuration" test now uses `assert.strictEqual` for stronger path traversal assertions.
|
|
67
105
|
|
|
68
|
-
## [4.4.4] - 2026-06-05
|
|
69
|
-
|
|
70
|
-
### Fixed
|
|
71
|
-
|
|
72
|
-
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
106
|
+
## [4.4.4] - 2026-06-05
|
|
107
|
+
|
|
108
|
+
### Fixed
|
|
109
|
+
|
|
110
|
+
- Likely-untranslated reporting now ignores placeholder-only and symbol/dynamic values such as `{file}`, `{path}`, and icon-prefixed labels instead of treating them as untranslated English.
|
|
111
|
+
- Dynamic values with translated surrounding copy and English placeholder tokens, such as `"command": "指示: {command}"`, are no longer flagged as untranslated.
|
|
112
|
+
|
|
113
|
+
### Changed
|
|
114
|
+
|
|
115
|
+
- `.i18ntk-config` now accepts a top-level `extensions` object for VS Code Workbench and Lens settings. The CLI preserves this section during config validation and ignores unknown extension-owned nested keys.
|
|
116
|
+
- Documented shared config edge cases so editor extensions can sync workspace defaults without changing CLI behavior.
|
|
117
|
+
|
|
118
|
+
## [4.4.3] - 2026-06-04
|
|
119
|
+
|
|
120
|
+
### Fixed
|
|
121
|
+
|
|
81
122
|
- `package.public.json` now includes the `./report` export entry (`./utils/report-model.js`) that was missing, fixing the sync check during public package builds.
|
|
82
123
|
|
|
83
|
-
## [4.4.2] - 2026-06-02
|
|
84
|
-
|
|
85
|
-
### Fixed
|
|
86
|
-
|
|
87
|
-
- Auto Translate now
|
|
88
|
-
- Auto Translate
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
124
|
+
## [4.4.2] - 2026-06-02
|
|
125
|
+
|
|
126
|
+
### Fixed
|
|
127
|
+
|
|
128
|
+
- Auto Translate `processFile()` now accepts source file paths relative to the current project, matching direct CLI behavior and avoiding safe-read failures in programmatic callers.
|
|
129
|
+
- Auto Translate now treats protected product terms as allowed English when deciding whether existing target values should be kept in `only-missing` mode.
|
|
130
|
+
- Auto Translate detects and retries more visibly broken target values, including replacement-character artifacts, mojibake, repeated question marks, and target-language prefix leftovers.
|
|
131
|
+
|
|
132
|
+
### Added
|
|
133
|
+
|
|
134
|
+
- Added regression coverage for relative source paths, protected product terms, broken target values, placeholder handling, and managed Auto Translate residual checks.
|
|
135
|
+
|
|
136
|
+
## [4.4.1] - 2026-06-02
|
|
137
|
+
|
|
138
|
+
### Security
|
|
139
|
+
|
|
96
140
|
- **HIGH**: Backup operations (`create`, `restore`, `list`, `verify`) now validate all path arguments via `SecurityUtils.validatePath()`. Previously, `i18ntk-backup` accepted arbitrary `--output` and source directory paths without any validation, enabling writes outside project boundaries.
|
|
97
141
|
- **HIGH**: Backup `handleCreate`, `handleRestore` now use `SecurityUtils.safeWriteFileSync`, `safeReadFileSync`, `safeMkdirSync` instead of raw `fs.promises`/`fs` calls.
|
|
98
142
|
- **HIGH**: `i18ntk-complete` now validates `--source-dir` CLI override through `SecurityUtils.validatePath()` and sanitizes `--source-language` through `SecurityUtils.sanitizeInput()` instead of accepting raw user input.
|
|
@@ -105,11 +149,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
105
149
|
- **LOW**: i18ntk Lens `scanner.ts` now rejects custom wrapper names > 100 characters to prevent ReDoS via malicious VSCode config values.
|
|
106
150
|
|
|
107
151
|
### Added
|
|
152
|
+
|
|
108
153
|
- `SecurityUtils.MAX_JSON_SIZE`, `SecurityUtils.MAX_JSON_DEPTH`, `SecurityUtils.MAX_FILENAME_LENGTH` constants for configurable safety limits.
|
|
109
154
|
|
|
110
155
|
## [4.4.0] - 2026-06-02
|
|
111
156
|
|
|
112
157
|
### Added
|
|
158
|
+
|
|
113
159
|
- Dead-key detection now uses resolved dynamic key data from usage insights instead of crude text-overlap heuristics. Keys expanded from template literals or const arrays are properly tracked and marked with low confidence.
|
|
114
160
|
- Locale JSON import detection: `import en from '../../locales/en/foo.json'` is detected and property accesses are tracked as key usages.
|
|
115
161
|
- Confidence-split unused key reports: confirmed (≥80%), likely (40-80%), possibly used (<40%).
|
|
@@ -128,10 +174,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
128
174
|
- i18ntk Workbench and i18ntk Lens can read Auto Translate residual reports, show the affected key in the VS Code editor, and offer a quick action to add intentionally unchanged keys to Auto Translate protection.
|
|
129
175
|
- Bounded dynamic expansion suggestions in usage report with explicit-map recommendation pattern.
|
|
130
176
|
- Telemetry/event literal classification: known-key strings inside `trackEvent()`, `emitDomainEvent()`, `analytics.track()`, etc. are classified as `literal-telemetry` and excluded from translation usage counts. Non-translation calls get context notes in the report.
|
|
131
|
-
- Object-method translation calls: `input.tx("key")`, `helper.tx("key")`, and `.tx(\`key.${var}\`)`
|
|
177
|
+
- Object-method translation calls: `input.tx("key")`, `helper.tx("key")`, and `.tx(\`key.${var}\`)`are now recognized as translation calls alongside standalone`tx()`.
|
|
132
178
|
- Local wrapper resolution: functions like `const text = (key, fallback) => tx(key)` that internally call known translation runtimes are detected and their string-literal invocations resolved to keys with `local-wrapper` match type.
|
|
133
179
|
|
|
134
180
|
### Fixed
|
|
181
|
+
|
|
135
182
|
- `--source-dir` and `--i18n-dir` no longer forced to the same value when both are explicitly passed via CLI.
|
|
136
183
|
- Path display (`displayPaths`) now reflects CLI overrides instead of only config file values.
|
|
137
184
|
- Dead-key detection `_matchesDynamicPattern` replaced with `_matchesDynamicPrefix` using actual resolved data.
|
|
@@ -140,12 +187,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
140
187
|
- Object-method `tx()` calls and local wrapper functions are now included in usage analysis, preventing Lens false positives on keys used through these patterns.
|
|
141
188
|
|
|
142
189
|
### Changed
|
|
190
|
+
|
|
143
191
|
- VSCode workbench bumped to 1.1.0, lens extension to 1.1.0.
|
|
144
192
|
- Major changes list in package.json and package.public.json updated for 4.4.0.
|
|
145
193
|
|
|
146
194
|
## [4.3.3] - 2026-06-01
|
|
147
195
|
|
|
148
196
|
### Fixed
|
|
197
|
+
|
|
149
198
|
- Usage extraction no longer reports ordinary method calls such as `get("next")`, `headers.get("etag")`, `set(...)`, or `setItem(...)` as missing translation keys.
|
|
150
199
|
- Usage insights now resolve `tx(...)` wrapper calls and bounded dynamic `tx` template keys, reducing false unused-key reports for local wrappers.
|
|
151
200
|
- Key naming validation now supports hybrid dot-path plus snake_case segment keys, such as `namespace.section.snake_case_leaf`, while still rejecting malformed separators and uppercase segments.
|
|
@@ -154,12 +203,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
154
203
|
## [4.3.2] - 2026-05-31
|
|
155
204
|
|
|
156
205
|
### Changed
|
|
206
|
+
|
|
157
207
|
- Documentation, README badges, and migration guidance now reference the current 4.3.2 release.
|
|
158
208
|
- Release metadata now marks 4.3.0 for npm deprecation because its npm tarball is unavailable.
|
|
159
209
|
|
|
160
210
|
## [4.3.1] - 2026-05-31
|
|
161
211
|
|
|
162
212
|
### Fixed
|
|
213
|
+
|
|
163
214
|
- Published tarball now includes `utils/english-placeholder-checker.js`, resolving `MODULE_NOT_FOUND` at startup for `i18ntk-fixer --check-placeholders` and manager option 7.
|
|
164
215
|
- Language-specific CLI entry points (`main/i18ntk-go.js`, `main/i18ntk-java.js`, `main/i18ntk-js.js`, `main/i18ntk-php.js`, `main/i18ntk-py.js`) and their shared `utils/mini-commander.js` dependency are now included in the published package.
|
|
165
216
|
- Removed inconsistent `.js` extension suffixes from require paths in `main/i18ntk-js.js`.
|
|
@@ -167,6 +218,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
167
218
|
## [4.3.0] - 2026-05-31
|
|
168
219
|
|
|
169
220
|
### Fixed
|
|
221
|
+
|
|
170
222
|
- Auto Translate now treats single-word uppercase target-language placeholders such as `[AR] Email` and `[AR] Password` as untranslated target values, matching the existing multi-word `[AR] What We Offer` detection.
|
|
171
223
|
- Auto Translate now treats bracketed target-language placeholders case-insensitively, so `[zh] Email` and `[TR] Password` are both retried for the matching target language.
|
|
172
224
|
- Managed Auto Translate now checks every selected source file for a target language before reporting leftover failures, instead of stopping after the first failed file.
|
|
@@ -177,11 +229,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
177
229
|
## [4.2.1] - 2026-05-31
|
|
178
230
|
|
|
179
231
|
### Changed
|
|
232
|
+
|
|
180
233
|
- Auto Translate now treats uppercase target-language placeholders such as `[AR] What We Offer` as untranslated target values when the bracketed code matches the target language, so target-aware mode sends the source text for translation instead of keeping the placeholder copy.
|
|
181
234
|
- Auto Translate now performs a final pre-write leftover check and retries values that still look like placeholder-prefixed untranslated text, untranslated markers, source-language copies, or broken output.
|
|
182
235
|
- Auto Translate reports leftover values in the post-translation report and exits with validation failure when leftovers remain after the final retry, instead of reporting a clean completion.
|
|
183
236
|
|
|
184
237
|
### Fixed
|
|
238
|
+
|
|
185
239
|
- Usage analysis no longer writes its inferred app source fallback, such as `src`, back into the shared locale configuration when `sourceDir` and `i18nDir` are both the locale directory.
|
|
186
240
|
- Manager sizing now reads the configured i18n directory unless `--source-dir` is explicitly provided, so running sizing after usage no longer silently analyzes the wrong directory.
|
|
187
241
|
- Manager sizing now treats a failed sizing analysis as a command failure instead of printing a generic operation success.
|
|
@@ -190,6 +244,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
190
244
|
## [4.2.0] - 2026-05-30
|
|
191
245
|
|
|
192
246
|
### Security
|
|
247
|
+
|
|
193
248
|
- Shared path validation no longer permits artifact-like filenames such as `.lock` or `.temp-config.json` to bypass base-directory containment.
|
|
194
249
|
- Shared path validation now rejects Windows cross-drive escape cases where `path.relative()` returns an absolute path.
|
|
195
250
|
- Custom `I18NTK_INTERNAL_PATH_PREFIXES` entries can no longer mark arbitrary outside directories as internal roots.
|
|
@@ -198,6 +253,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
198
253
|
- Auto Translate provider URL validation now blocks IPv4-mapped IPv6 loopback/private hosts.
|
|
199
254
|
|
|
200
255
|
### Changed
|
|
256
|
+
|
|
201
257
|
- Main runtime now includes production-safe features from the enhanced runtime surface: per-call language overrides, synchronous `translateBatch()`, and `clearCache()` / `getCacheInfo()` helpers.
|
|
202
258
|
- `i18ntk/runtime/enhanced` remains available as a legacy public subpath for compatibility, while new production integrations should prefer the lightweight `i18ntk/runtime` API.
|
|
203
259
|
- Usage analysis now indexes known translation keys back to source files, including direct i18n calls and literal key references that were previously missed.
|
|
@@ -220,6 +276,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
220
276
|
- Updated public, root, and development package metadata for the 4.2.0 release line.
|
|
221
277
|
|
|
222
278
|
### Fixed
|
|
279
|
+
|
|
223
280
|
- Runtime JSON loading now preserves valid translation strings containing comment-like text such as `/* token */` by parsing valid JSON before using the comment-stripping fallback.
|
|
224
281
|
- Enhanced runtime now exports the top-level `translateBatch()`, `translateBatchEncrypted()`, and `tTyped()` helpers declared by its TypeScript definitions, and those declarations now reflect async return values.
|
|
225
282
|
- Usage analysis no longer scans the project root when `sourceDir` and `i18nDir` both point at the locale directory; it now uses a detected app source directory or disables usage scanning with a clear warning.
|
|
@@ -236,6 +293,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
236
293
|
## [4.1.0] - 2026-05-21
|
|
237
294
|
|
|
238
295
|
### Fixed
|
|
296
|
+
|
|
239
297
|
- Runtime: stale manifest entries (deleted files after manifest construction) no longer cause unhandled exceptions; loadedFiles set before load with try/catch guard.
|
|
240
298
|
- Runtime: `refresh()` now correctly clears the key manifest for the refreshed language, preventing stale file references.
|
|
241
299
|
- Runtime: null `baseDir` guard prevents cascading `validatePath(null)` errors in `loadKeyManifestFromDir`.
|
|
@@ -253,7 +311,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
253
311
|
- Watch: debounce `setTimeout` timers are now stored per-watcher and cleared on `emitter.stop()`, preventing memory leaks and spurious I/O after stop.
|
|
254
312
|
- Watch: `'unlink'` events are now subscribed for backward-compatible plain-function callback users.
|
|
255
313
|
- Usage: duplicate `require.main === module` block removed (caused `TypeError: Identifier 'main' has already been declared` at execution).
|
|
256
|
-
- Usage: `_keyInSourceComments` optimized from O(n
|
|
314
|
+
- Usage: `_keyInSourceComments` optimized from O(n\*m) to O(n+m) by pre-computing a `Set` of all comment strings once before the dead key loop.
|
|
257
315
|
- Usage: `--cleanup=false` and `--dry-run-delete=false` now correctly parse as falsy via `toBool()` helper.
|
|
258
316
|
- Usage: broken `detectFrameworkPatterns()` call with `undefined` arguments removed.
|
|
259
317
|
- Usage: dead `return;` in `analyze()` removed so the result object is now actually returned.
|
|
@@ -273,6 +331,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
273
331
|
- Public package metadata updated.
|
|
274
332
|
|
|
275
333
|
### Security
|
|
334
|
+
|
|
276
335
|
- Watch module: debounce timers properly cleaned up on stop and callback subscriptions corrected for object-format and unlink handlers.
|
|
277
336
|
- Runtime: loadedFiles lock-before-load pattern prevents duplicate I/O and stale manifest crash.
|
|
278
337
|
- Backup: circular parent reference detection; `--incremental=false` string truthy bypass closed.
|
|
@@ -285,6 +344,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
285
344
|
## [4.0.0] - 2026-05-21
|
|
286
345
|
|
|
287
346
|
### Added
|
|
347
|
+
|
|
288
348
|
- **Sizing Expansion Prediction**: `i18ntk-sizing` now supports `--predict-expansion` flag that computes per-key character-count expansion ratios across languages and classifies them into Safe/Warning/Critical risk tiers for UI layout planning. Includes a built-in language-pair expansion reference table (EN→DE 35%, EN→RU 50%, EN→JA -40%, etc.).
|
|
289
349
|
- **Watch Hot Reload**: `utils/watch-locales.js` rewritten as an EventEmitter-compatible watcher with debouncing (300ms default) and SHA-256 hash tracking to skip no-change saves. Returns a callable watcher object with `change`, `add`, `unlink`, `error` events and `stop()`.
|
|
290
350
|
- **Usage Dead Key Detection**: `i18ntk-usage` adds `--cleanup` and `--dry-run-delete` flags that identify unused translation keys with confidence scores (0.0–1.0) factoring dynamic access patterns, comment references, and file recency. Produces a `.dead-keys.json` report for safe review before deletion.
|
|
@@ -295,28 +355,34 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
295
355
|
- **Protection Context-Aware Rules**: `utils/translate/protection.js` extends the protection config schema to support context rules (`after:word`, `before:word`, `standalone`, `surrounded:left,right`). Plain string terms remain fully backward compatible. Total context rules capped at 100.
|
|
296
356
|
|
|
297
357
|
### Fixed
|
|
358
|
+
|
|
298
359
|
- `i18ntk/runtime` `initRuntime()` now returns independent runtime instances with separate language, fallback language, base directory, and cache state. Later `initRuntime()` calls no longer overwrite earlier returned runtimes or the module-level compatibility singleton.
|
|
299
360
|
|
|
300
361
|
### Changed
|
|
362
|
+
|
|
301
363
|
- `watchLocales()` now returns a callable watcher object with EventEmitter methods instead of only a bare `stop` function. Existing `const stop = watchLocales(...); stop();` usage remains supported. The returned object fires `change`, `add`, `unlink`, `error` events. If a callback function is passed as the second argument, it is auto-subscribed to `change` and `add` for backward compatibility.
|
|
302
364
|
- **BREAKING**: `i18ntk-sizing` JSON reports now include `expansionPredictions` at the top level when `--predict-expansion` is used. This field is additive — existing report fields are preserved.
|
|
303
365
|
|
|
304
366
|
## [3.3.0] - 2026-05-20
|
|
305
367
|
|
|
306
368
|
### Changed
|
|
369
|
+
|
|
307
370
|
- Auto Translate now supports `--provider google|deepl|libretranslate`; DeepL uses `DEEPL_API_KEY`, while LibreTranslate supports `LIBRETRANSLATE_URL` and optional `LIBRETRANSLATE_API_KEY`.
|
|
308
371
|
- Auto Translate provider networking now keeps HTTPS, host allowlist, response-size, private-network, and redacted security logging protections in place for additional providers.
|
|
309
372
|
|
|
310
373
|
### Fixed
|
|
374
|
+
|
|
311
375
|
- `i18ntk-complete` now fills missing target-language keys from the English source value with a language prefix such as `[DE] Home` instead of writing `NOT_TRANSLATED`; this works for both `locales/en/*.json` and monolith `locales/en.json` layouts.
|
|
312
376
|
|
|
313
377
|
### Security
|
|
378
|
+
|
|
314
379
|
- Eliminated all 21 dynamic `require()` calls flagged by Socket.dev: 20 `require(path.join(__dirname, ...))` patterns in `i18ntk-js.js`, `i18ntk-py.js`, `i18ntk-java.js`, `i18ntk-php.js`, and `i18ntk-go.js` converted to static string literal requires.
|
|
315
380
|
- Added `SecurityUtils.validatePath()` gate around the remaining dynamic `require()` in `i18ntk-translate.js` `loadCustomTranslateFn`.
|
|
316
381
|
- Created `utils/translate/safe-network.js` — a secure HTTPS wrapper with URL host/path allowlist validation, response size limits (100KB), suspicious query parameter detection, and security event logging. All outbound network access now flows through this validated layer.
|
|
317
382
|
- Replaced direct `https.get` call in `utils/translate/api.js` with `safeHttpGet` from the safe-network wrapper.
|
|
318
383
|
|
|
319
384
|
### Docs
|
|
385
|
+
|
|
320
386
|
- README.md updated for v3.3.0 Auto Translate providers and secure provider operations.
|
|
321
387
|
- SECURITY.md updated with Socket.dev analysis disclaimer and guidance on expected alerts for a CLI/i18n toolkit.
|
|
322
388
|
- CHANGELOG.md and `package.json` versionInfo updated for v3.3.0.
|
|
@@ -325,18 +391,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
325
391
|
|
|
326
392
|
This package is a developer CLI and runtime helper that performs file I/O, network access (translation provider APIs on user request), and environment variable access. As such, Socket.dev will flag the following alerts that are **expected and by design**:
|
|
327
393
|
|
|
328
|
-
| Alert
|
|
329
|
-
|
|
330
|
-
| Network access
|
|
331
|
-
| Environment variable access | Centralized through `env-manager.js` with a strict allowlist. Blocks `SECRET`, `PASSWORD`, `KEY`, `TOKEN`, `AWS_*`, `NPM_*`, and 15+ other patterns.
|
|
332
|
-
| Filesystem access
|
|
333
|
-
| URL strings
|
|
394
|
+
| Alert | Why it's expected |
|
|
395
|
+
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
396
|
+
| Network access | Only contacts configured translation providers via HTTPS when user invokes auto-translate. All outbound calls flow through `safe-network.js` with host/path allowlist validation, response size limits, private-network blocking, and redacted security event logging. No telemetry, no unexpected outbound calls. |
|
|
397
|
+
| Environment variable access | Centralized through `env-manager.js` with a strict allowlist. Blocks `SECRET`, `PASSWORD`, `KEY`, `TOKEN`, `AWS_*`, `NPM_*`, and 15+ other patterns. |
|
|
398
|
+
| Filesystem access | Reads/writes only project locale files and reports within validated paths. All FS operations gated by `SecurityUtils.validatePath`. |
|
|
399
|
+
| URL strings | Hardcoded default provider URLs for Google, DeepL, and LibreTranslate used only for auto-translation. No external resource loading. |
|
|
334
400
|
|
|
335
401
|
The v3.3.0 release resolves the actionable dynamic-require alert by eliminating all 21 instances.
|
|
336
402
|
|
|
337
403
|
## [3.2.0] - 2026-05-16
|
|
338
404
|
|
|
339
405
|
### Security
|
|
406
|
+
|
|
340
407
|
- **CRITICAL**: Fixed invalid `crypto.createCipherGCM`/`createDecipherGCM` API calls in `admin-pin.js` — replaced with `crypto.createCipheriv`/`createDecipheriv`.
|
|
341
408
|
- **CRITICAL**: Fixed missing `SecurityUtils` imports in `admin-pin.js`, `security-config.js`, and `scripts/security-check.js` causing `ReferenceError` at runtime.
|
|
342
409
|
- **CRITICAL**: Removed encryption key stored alongside ciphertext in `admin-pin.js`. The AES key was stored in the same JSON file as the encrypted PIN, providing zero cryptographic protection. Encryption key is now derived via HKDF from the scrypt hash.
|
|
@@ -349,6 +416,7 @@ The v3.3.0 release resolves the actionable dynamic-require alert by eliminating
|
|
|
349
416
|
- Fixed `admin-pin.js` `getPinDisplay` to use stored `pinLength` instead of decrypting the raw PIN into memory.
|
|
350
417
|
|
|
351
418
|
### Fixed
|
|
419
|
+
|
|
352
420
|
- `admin-pin.js` lockout now uses timestamp-based expiry (`lockedUntil`) instead of `setTimeout`, ensuring lockout state survives process restarts.
|
|
353
421
|
- `translate/traverse.js` `setLeaf` now correctly creates `[]` for numeric array indices (was creating `{}`).
|
|
354
422
|
- `translate/traverse.js` extracted shared `parseKeyPath` function — `setLeaf` and `getLeaf` had duplicate path-parsing logic.
|
|
@@ -368,6 +436,7 @@ The v3.3.0 release resolves the actionable dynamic-require alert by eliminating
|
|
|
368
436
|
- `admin-pin.js` scrypt→pbkdf2 fallback now emits a console warning instead of failing silently.
|
|
369
437
|
|
|
370
438
|
### Changed
|
|
439
|
+
|
|
371
440
|
- Updated all documentation to v3.2.0: README, CHANGELOG, docs/README, getting-started, runtime, auto-translate, environment-variables, scanner-guide, API_REFERENCE, COMPONENTS, and CONFIGURATION.
|
|
372
441
|
- Updated `package.json` version, `versionInfo`, `majorChanges`, and `nextVersion` for v3.2.0.
|
|
373
442
|
- Socket badge URL updated to v3.2.0.
|
|
@@ -375,31 +444,37 @@ The v3.3.0 release resolves the actionable dynamic-require alert by eliminating
|
|
|
375
444
|
## [3.1.2] - 2026-05-07
|
|
376
445
|
|
|
377
446
|
### Fixed
|
|
447
|
+
|
|
378
448
|
- Auto Translate now resolves locale roots such as `./locales` to the selected source-language folder such as `./locales/en` when JSON files are stored under language folders.
|
|
379
449
|
- Public package staging now verifies root `package.json` and `package.public.json` release metadata are synchronized before pack or publish.
|
|
380
450
|
- Added a safe `publish:public:dry-run` path for validating the exact staged npm publish flow.
|
|
381
451
|
|
|
382
452
|
### Changed
|
|
453
|
+
|
|
383
454
|
- Updated release docs, npm README metadata, and package manifests for v3.1.2.
|
|
384
455
|
- Kept generated backups, temporary benchmark datasets, local setup state, and debug repair files out of future public repo commits through `.gitignore`.
|
|
385
456
|
|
|
386
457
|
## [3.1.1] - 2026-05-07
|
|
387
458
|
|
|
388
459
|
### Added
|
|
460
|
+
|
|
389
461
|
- **Auto Translate protection file workflow**: Added user-editable `i18ntk-auto-translate.json` support for protected terms, key paths, exact values, and regex patterns.
|
|
390
462
|
- **Public package README guard**: Public package staging now verifies `README.md` is included and non-empty before publish.
|
|
391
463
|
|
|
392
464
|
### Changed
|
|
465
|
+
|
|
393
466
|
- Updated README and release documentation for the current Auto Translate protection workflow and public package contents.
|
|
394
467
|
- Removed project-specific hardcoded validation examples so users configure their own brand and domain terms.
|
|
395
468
|
|
|
396
469
|
### Fixed
|
|
470
|
+
|
|
397
471
|
- Removed provider-shaped fake secret fixtures from tests to avoid GitHub push protection false positives.
|
|
398
472
|
- Ensured public package metadata includes `readmeFilename: "README.md"` so npm can render the package README.
|
|
399
473
|
|
|
400
474
|
## [3.1.0] - 2026-05-07
|
|
401
475
|
|
|
402
476
|
### Added
|
|
477
|
+
|
|
403
478
|
- **Placeholder-preserve translation mode**: Translates text segments around dynamic placeholders and reinserts the original tokens exactly.
|
|
404
479
|
- **Auto Translate beta settings**: Added settings for placeholder mode, concurrency, batch size, progress interval, retry count, retry delay, timeout, dry-run preview, report output, and BOM output.
|
|
405
480
|
- **Large-file tuning flags**: Added `--batch-size` and `--progress-interval` to `i18ntk-translate`.
|
|
@@ -408,6 +483,7 @@ The v3.3.0 release resolves the actionable dynamic-require alert by eliminating
|
|
|
408
483
|
- **Sizing file-set analysis**: Added per-language file counts, per-file sizing statistics, and missing/extra file comparison across locale folders.
|
|
409
484
|
|
|
410
485
|
### Changed
|
|
486
|
+
|
|
411
487
|
- Automated and manager Auto Translate flows now default to placeholder `preserve` mode instead of skipping placeholder-bearing strings.
|
|
412
488
|
- `i18ntk-translate` can now be imported and run in-process by other package modules.
|
|
413
489
|
- Source JSON reads tolerate UTF-8 BOM-prefixed files.
|
|
@@ -416,17 +492,20 @@ The v3.3.0 release resolves the actionable dynamic-require alert by eliminating
|
|
|
416
492
|
- Sizing reports now include folder-level file counts and per-file key/character breakdowns for each language.
|
|
417
493
|
|
|
418
494
|
### Fixed
|
|
495
|
+
|
|
419
496
|
- Fixed false-positive validation warnings for normal product copy terms.
|
|
420
497
|
- Fixed validator handling so ordinary explanatory uses of words like `token` or `secret` are not treated as leaked credentials.
|
|
421
498
|
- Fixed distorted `i18ntk-sizing` table output by rendering aligned columns from measured values instead of fixed localized spacing.
|
|
422
499
|
- Fixed sizing language comparison output so it uses analyzed languages and the configured source language baseline.
|
|
423
500
|
|
|
424
501
|
### Security
|
|
502
|
+
|
|
425
503
|
- Removed production `child_process` usage from `main/manage/commands/TranslateCommand.js` by replacing the spawned CLI process with an in-process translator call.
|
|
426
504
|
|
|
427
505
|
## [3.0.0] - 2026-05-05
|
|
428
506
|
|
|
429
507
|
### Added
|
|
508
|
+
|
|
430
509
|
- **`i18ntk-translate`**: Zero-dependency CLI tool that converts English source JSON locale files into any target language via Google's free Translate API.
|
|
431
510
|
- **Placeholder protection**: Intelligent detection, masking, and unmasking of dynamic placeholder tokens (`{name}`, `{{count}}`, `%d`, `%s`, `:param`, `{{variable}}`, `%{name}`, `${var}`, etc.) to prevent corruption during translation.
|
|
432
511
|
- **Custom regex support**: `--custom-regex` flag to define additional placeholder patterns for detection and protection.
|
|
@@ -441,11 +520,13 @@ The v3.3.0 release resolves the actionable dynamic-require alert by eliminating
|
|
|
441
520
|
- **Deep JSON traversal**: Full support for nested objects and arrays, preserving data types, null values, and non-string leaf values.
|
|
442
521
|
|
|
443
522
|
### Changed
|
|
523
|
+
|
|
444
524
|
- Version bumped to 3.0.0 (major release with new translation tool feature).
|
|
445
525
|
|
|
446
526
|
## [2.6.0] - 2026-05-03
|
|
447
527
|
|
|
448
528
|
### Security
|
|
529
|
+
|
|
449
530
|
- **CRITICAL**: Fixed 8+ silent-write failures where `safeWriteFileSync` was called without basePath parameter across `utils/config.js`, `utils/config-helper.js`, `utils/secure-errors.js`, and `main/i18ntk-scanner.js`.
|
|
450
531
|
- Replaced all raw `fs` calls (`readdirSync`, `statSync`, `mkdirSync`, `unlinkSync`, `rmSync`) with `SecurityUtils` wrappers in `main/i18ntk-validate.js`, `main/i18ntk-scanner.js`, `main/manage/commands/FixerCommand.js`, and `utils/secure-errors.js`.
|
|
451
532
|
- Fixed path traversal checks in `security.js` and `config-manager.js` — replaced fragile `path.sep`-based comparison with robust `startsWith('..')` prefix check.
|
|
@@ -453,6 +534,7 @@ The v3.3.0 release resolves the actionable dynamic-require alert by eliminating
|
|
|
453
534
|
- Fixed `SecurityUtils.safeParseJSON` reference leak — deep-clones objects instead of returning caller's reference.
|
|
454
535
|
|
|
455
536
|
### Fixed
|
|
537
|
+
|
|
456
538
|
- Fixed `main/i18ntk-analyze.js` `this.adminAuth` reference error (local variable was not assigned to instance property).
|
|
457
539
|
- Fixed `main/i18ntk-validate.js` `ExitCodes.CONFIG_ERROR` referenced before declaration.
|
|
458
540
|
- Fixed `main/i18ntk-scanner.js` `fs.readdirSync(projectRoot, { recursive: true })` removed (unsupported in older Node.js).
|
|
@@ -469,37 +551,45 @@ The v3.3.0 release resolves the actionable dynamic-require alert by eliminating
|
|
|
469
551
|
- Fixed `utils/admin-auth.js` `uncaughtException` handler wrong parameter format.
|
|
470
552
|
|
|
471
553
|
### Added
|
|
554
|
+
|
|
472
555
|
- `SecurityUtils.safeUnlinkSync(filePath, basePath)` — safely delete a file.
|
|
473
556
|
- `SecurityUtils.safeRmdirSync(dirPath, basePath)` — safely remove a directory.
|
|
474
557
|
|
|
475
558
|
### Changed
|
|
559
|
+
|
|
476
560
|
- `configManager.resolvePaths`, `configManager.toRelative`, and config lock path now dynamically resolve via `getUserProjectRoot()`/`getProjectConfigPath()`.
|
|
477
561
|
- `configManager.CONFIG_PATH` is now a getter that dynamically returns the project config path.
|
|
478
562
|
- `configManager.migrateLegacyIfNeeded` exported for testability.
|
|
479
563
|
|
|
480
564
|
### TypeScript
|
|
565
|
+
|
|
481
566
|
- Fixed `runtime/i18ntk.d.ts` `BasicI18nRuntime.translate` and `t` return types from `Promise<string>` to `string`.
|
|
482
567
|
|
|
483
568
|
### Scripts
|
|
569
|
+
|
|
484
570
|
- Fixed `scripts/build-public-package.js` and `scripts/reset-release-state.js` `npm_execpath` fallback for missing env var.
|
|
485
571
|
- Fixed `scripts/lint-locales.js` BOM handling and try-catch for `fs.readdirSync`.
|
|
486
572
|
|
|
487
573
|
## [2.5.1] - 2026-04-29
|
|
488
574
|
|
|
489
575
|
### Security
|
|
576
|
+
|
|
490
577
|
- Fixed `AdminAuth.verifyPin()` to fail closed when admin config is missing, disabled, or malformed instead of returning success.
|
|
491
578
|
- Fixed auth-required checks to fail closed when settings require admin PIN protection but the admin config is unusable.
|
|
492
579
|
- Normalized admin session expiry handling by storing both `expires` and `expiresAt` and cleaning up both formats consistently.
|
|
493
580
|
|
|
494
581
|
### Added
|
|
582
|
+
|
|
495
583
|
- Added regression tests for admin PIN fail-closed behavior and session expiry cleanup.
|
|
496
584
|
|
|
497
585
|
### Changed
|
|
586
|
+
|
|
498
587
|
- Documented the public npm package staging flow introduced after `2.5.0`.
|
|
499
588
|
|
|
500
589
|
## [2.5.0] - 2026-04-29
|
|
501
590
|
|
|
502
591
|
### Security
|
|
592
|
+
|
|
503
593
|
- Centralized environment-variable access behind the `utils/env-manager.js` allowlist.
|
|
504
594
|
- Hardened `SecurityUtils.safeJoin()` and path validation against sibling-prefix containment bypasses.
|
|
505
595
|
- Switched admin PIN hash verification to timing-safe comparison.
|
|
@@ -507,17 +597,20 @@ The v3.3.0 release resolves the actionable dynamic-require alert by eliminating
|
|
|
507
597
|
- Expanded the release security scanner to inspect nested production source files.
|
|
508
598
|
|
|
509
599
|
### Fixed
|
|
600
|
+
|
|
510
601
|
- Fixed the manager fixer command so applied fixes are written to the same parsed object that is saved.
|
|
511
602
|
- Fixed fixer writes for absolute source directories outside the current working directory.
|
|
512
603
|
- Fixed debug-menu file reads to use `SecurityUtils` wrappers.
|
|
513
604
|
- Fixed `secure-errors` to import its `SecurityUtils` dependency explicitly.
|
|
514
605
|
|
|
515
606
|
### Changed
|
|
607
|
+
|
|
516
608
|
- Updated package and documentation metadata to `2.5.0`.
|
|
517
609
|
|
|
518
610
|
## [2.4.0] - 2026-04-16
|
|
519
611
|
|
|
520
612
|
### Changed
|
|
613
|
+
|
|
521
614
|
- Disabled npm registry update-check behavior in CLI startup paths.
|
|
522
615
|
- Disabled manager-route backup execution (`i18ntk --command=backup`); standalone `i18ntk-backup` remains available.
|
|
523
616
|
- Disabled setup prerequisite command probing via `PATH` inspection.
|
|
@@ -526,6 +619,7 @@ The v3.3.0 release resolves the actionable dynamic-require alert by eliminating
|
|
|
526
619
|
## [2.3.8] - 2026-04-13
|
|
527
620
|
|
|
528
621
|
### Added
|
|
622
|
+
|
|
529
623
|
- Added centralized structured logger with standardized prefixes and configurable levels (`error`, `warn`, `info`, `debug`).
|
|
530
624
|
- Added opt-in JSON log output for CI/build pipelines via `JSON_LOG=true`.
|
|
531
625
|
- Added missing-translation-key cache TTL (5 minutes) to prevent repeated key-miss spam.
|
|
@@ -533,11 +627,13 @@ The v3.3.0 release resolves the actionable dynamic-require alert by eliminating
|
|
|
533
627
|
- Added test coverage for logger timing/progress/worker aggregation behavior.
|
|
534
628
|
|
|
535
629
|
### Fixed
|
|
630
|
+
|
|
536
631
|
- Fixed repeated default-configuration fallback output by emitting a single fallback notice per process.
|
|
537
632
|
- Fixed recursive security/i18n logging interactions that could trigger repeated warning cascades.
|
|
538
633
|
- Fixed false-positive security warnings for internal package/project absolute paths through internal root whitelisting.
|
|
539
634
|
|
|
540
635
|
### Changed
|
|
636
|
+
|
|
541
637
|
- Logging is now silent by default for non-critical output in production-like builds unless `DEBUG_MODE=true`.
|
|
542
638
|
- Security warning reasons now use specific detection details instead of generic "dangerous patterns".
|
|
543
639
|
- Updated package/docs/version metadata to `2.3.8`.
|
|
@@ -545,10 +641,12 @@ The v3.3.0 release resolves the actionable dynamic-require alert by eliminating
|
|
|
545
641
|
## [2.3.7] - 2026-04-12
|
|
546
642
|
|
|
547
643
|
### Fixed
|
|
644
|
+
|
|
548
645
|
- Removed false-positive path traversal warnings for safe absolute project paths during framework builds.
|
|
549
646
|
- Reduced repeated default-configuration console noise in multi-worker build environments.
|
|
550
647
|
|
|
551
648
|
### Changed
|
|
649
|
+
|
|
552
650
|
- Security event console logging is now fully opt-in via `I18NTK_ENABLE_SECURITY_LOGS=true` (or debug envs).
|
|
553
651
|
- Config-manager diagnostic console logging is now fully opt-in via `I18NTK_ENABLE_LOGS=true` (or debug envs).
|
|
554
652
|
- Updated docs to reflect new default-silent logging behavior and troubleshooting toggles.
|
|
@@ -556,16 +654,19 @@ The v3.3.0 release resolves the actionable dynamic-require alert by eliminating
|
|
|
556
654
|
## [2.3.6] - 2026-04-12
|
|
557
655
|
|
|
558
656
|
### Security
|
|
657
|
+
|
|
559
658
|
- **Fixed path traversal vulnerability** in temporary file creation
|
|
560
659
|
- **Added `safeJoin` function** for secure path construction
|
|
561
660
|
- **Improved path validation** throughout the codebase
|
|
562
661
|
|
|
563
662
|
### Fixed
|
|
663
|
+
|
|
564
664
|
- Hardened settings reset and backup cleanup paths to reduce risk of broad/deep unintended file deletion.
|
|
565
665
|
- Hardened backup command path handling to keep source/output/restore operations inside project boundaries by default.
|
|
566
666
|
- Fixed backup-class async file operations to consistently use `fs.promises` APIs.
|
|
567
667
|
|
|
568
668
|
### Changed
|
|
669
|
+
|
|
569
670
|
- **Silent security logging by default**: Info-level messages suppressed, warnings/errors shown
|
|
570
671
|
- **Debug mode**: Enable verbose logging with `I18N_DEBUG=true`
|
|
571
672
|
- **Centralized security logging**: All security events use `SecurityUtils.logSecurityEvent()`
|
|
@@ -575,76 +676,92 @@ The v3.3.0 release resolves the actionable dynamic-require alert by eliminating
|
|
|
575
676
|
## [2.3.4] - 2026-04-12
|
|
576
677
|
|
|
577
678
|
### Fixed
|
|
679
|
+
|
|
578
680
|
- Fixed runtime autosave behavior so configuration write failures no longer hard-throw through request/render paths.
|
|
579
681
|
- Fixed config save race resilience by combining queued writes, cross-process lock files, and unique temp filenames per write.
|
|
580
682
|
|
|
581
683
|
### Added
|
|
684
|
+
|
|
582
685
|
- Added `I18NTK_DISABLE_AUTOSAVE` support to skip disk persistence and keep in-memory config in server/runtime environments.
|
|
583
686
|
- Added config-manager concurrency regression test covering parallel `saveConfig` calls.
|
|
584
687
|
|
|
585
688
|
### Changed
|
|
689
|
+
|
|
586
690
|
- Updated package/docs/version metadata to `2.3.4`.
|
|
587
691
|
- Updated support policy guidance to recommend upgrading from versions below `2.3.4`.
|
|
588
692
|
|
|
589
693
|
## [2.3.3] - 2026-04-12
|
|
590
694
|
|
|
591
695
|
### Fixed
|
|
696
|
+
|
|
592
697
|
- Fixed production config persistence race across multiple Node processes by adding cross-process file locking for `.i18ntk-config` writes.
|
|
593
698
|
- Fixed intermittent `ENOENT` during atomic config rename operations under concurrent production traffic.
|
|
594
699
|
|
|
595
700
|
### Changed
|
|
701
|
+
|
|
596
702
|
- Updated package/docs/version metadata to `2.3.3`.
|
|
597
703
|
- Updated support policy guidance to recommend upgrading from versions below `2.3.3`.
|
|
598
704
|
|
|
599
705
|
## [2.3.2] - 2026-04-12
|
|
600
706
|
|
|
601
707
|
### Added
|
|
708
|
+
|
|
602
709
|
- Added startup npm-registry version checks that warn when the installed CLI is behind the latest published `i18ntk` release.
|
|
603
710
|
- Added support for checking all published semver versions up to the current latest tag to improve outdated-version detection reliability.
|
|
604
711
|
|
|
605
712
|
### Fixed
|
|
713
|
+
|
|
606
714
|
- Fixed fatal analyze-command startup failure in manager command flow caused by missing `validateSourceDir` import.
|
|
607
715
|
|
|
608
716
|
### Changed
|
|
717
|
+
|
|
609
718
|
- Updated package/docs/version metadata to `2.3.2`.
|
|
610
719
|
- Updated support policy guidance to recommend upgrading from versions below `2.3.2`.
|
|
611
720
|
|
|
612
721
|
## [2.3.1] - 2026-04-12
|
|
613
722
|
|
|
614
723
|
### Fixed
|
|
724
|
+
|
|
615
725
|
- Fixed package export-path fallback in `utils/i18n-helper` that could trigger build warnings in production bundlers (`i18ntk/resources/i18n/ui-locales/en.json` not exported).
|
|
616
726
|
|
|
617
727
|
### Changed
|
|
728
|
+
|
|
618
729
|
- Updated package/docs/version metadata to `2.3.1`.
|
|
619
730
|
- Updated support policy guidance to recommend upgrading from versions below `2.3.1`.
|
|
620
731
|
|
|
621
732
|
## [2.3.0] - 2026-04-12
|
|
622
733
|
|
|
623
734
|
### Added
|
|
735
|
+
|
|
624
736
|
- Added validation summary report output after validation runs.
|
|
625
737
|
- Added init-time backup configuration prompt (default disabled, optional enable).
|
|
626
738
|
|
|
627
739
|
### Fixed
|
|
740
|
+
|
|
628
741
|
- Fixed backup recursion/pollution risk by moving automated fixer backups to a dedicated backup root.
|
|
629
742
|
- Fixed backup retention behavior to keep 1 by default with enforced bounds up to 3.
|
|
630
743
|
- Fixed language discovery in validate/fixer flows to ignore backup/report directories.
|
|
631
744
|
|
|
632
745
|
### Changed
|
|
746
|
+
|
|
633
747
|
- Updated package/docs/version metadata to `2.3.0`.
|
|
634
748
|
- Updated support policy guidance to recommend upgrading from versions below `2.3.0`.
|
|
635
749
|
|
|
636
750
|
## [2.2.0] - 2026-04-12
|
|
637
751
|
|
|
638
752
|
### Added
|
|
753
|
+
|
|
639
754
|
- Added an explicit upgrade/support notice in docs recommending upgrade from pre-`2.2.0` versions.
|
|
640
755
|
- Added migration guide for `v2.2.0`.
|
|
641
756
|
|
|
642
757
|
### Fixed
|
|
758
|
+
|
|
643
759
|
- Fixed critical sizing workflow regressions.
|
|
644
760
|
- Fixed critical usage-analysis workflow regressions.
|
|
645
761
|
- Fixed runtime locale optimizer dependency path after publish-surface cleanup.
|
|
646
762
|
|
|
647
763
|
### Changed
|
|
764
|
+
|
|
648
765
|
- Reduced publish surface by excluding internal development scripts from npm package artifacts.
|
|
649
766
|
- Excluded legacy fixed artifacts from package output (`main/manage/index-fixed.js`, `utils/security-fixed.js`).
|
|
650
767
|
- Updated package/docs/version metadata to `2.2.0`.
|
|
@@ -652,15 +769,18 @@ The v3.3.0 release resolves the actionable dynamic-require alert by eliminating
|
|
|
652
769
|
## [2.1.1] - 2026-04-11
|
|
653
770
|
|
|
654
771
|
### Added
|
|
772
|
+
|
|
655
773
|
- Version bump to 2.1.1 for release.
|
|
656
774
|
- Added `SecurityUtils.debugLog` function for consistent debugging.
|
|
657
775
|
|
|
658
776
|
### Fixed
|
|
777
|
+
|
|
659
778
|
- Fixed `SecurityUtils.logSecurityEvent` calls missing `level` parameter in `i18ntk-usage` and `UsageService`.
|
|
660
779
|
- Fixed `level.toLowerCase is not a function` error in usage analysis.
|
|
661
780
|
- Fixed `SecurityUtils.debugLog is not a function` error in sizing analysis.
|
|
662
781
|
|
|
663
782
|
### Changed
|
|
783
|
+
|
|
664
784
|
- Updated package and release metadata to `2.1.1`.
|
|
665
785
|
- Removed legacy `resources/i18n/ui-locales` path references (use `ui-locales/` instead).
|
|
666
786
|
- Updated all UI locale loading to use `ui-locales/` directory.
|
|
@@ -668,10 +788,12 @@ The v3.3.0 release resolves the actionable dynamic-require alert by eliminating
|
|
|
668
788
|
## [2.1.0] - 2026-04-11
|
|
669
789
|
|
|
670
790
|
### Added
|
|
791
|
+
|
|
671
792
|
- Added a v2.1.0 migration guide and updated release runbook references.
|
|
672
793
|
- Added stricter language-directory filtering in analysis paths to ignore backup/report folders.
|
|
673
794
|
|
|
674
795
|
### Fixed
|
|
796
|
+
|
|
675
797
|
- Fixed interactive menu command flow so it reliably returns to the main menu after command completion.
|
|
676
798
|
- Fixed analysis progress output to report the correct processed-language count.
|
|
677
799
|
- Fixed duplicate report-save output lines during analysis.
|
|
@@ -680,70 +802,84 @@ The v3.3.0 release resolves the actionable dynamic-require alert by eliminating
|
|
|
680
802
|
- Fixed locale-loading path fallback behavior to avoid noisy startup errors in global installs.
|
|
681
803
|
|
|
682
804
|
### Changed
|
|
805
|
+
|
|
683
806
|
- Synchronized and normalized UI locale keys across `resources/i18n/ui-locales` and `ui-locales`.
|
|
684
807
|
- Updated package/release metadata to `2.1.0`.
|
|
685
808
|
|
|
686
809
|
## [2.0.0] - 2026-01-01
|
|
687
810
|
|
|
688
811
|
### Added
|
|
812
|
+
|
|
689
813
|
- Added missing runtime translation keys across `init`, `fixer`, `sizing`, `summary`, `usage`, and settings import/export flows.
|
|
690
814
|
- Added `SecurityUtils.safeParseJSON`, `SecurityUtils.safeReadFile`, and `SecurityUtils.safeWriteFile` compatibility APIs used by v2 command paths.
|
|
691
815
|
- Added source-locale bootstrap behavior during `init` when the source language directory exists but has no translation files.
|
|
692
816
|
|
|
693
817
|
### Fixed
|
|
818
|
+
|
|
694
819
|
- Fixed initialization state detection to use project `.i18ntk-config` setup metadata as the v2 source of truth.
|
|
695
820
|
- Fixed false setup-invalid states caused by BOM-encoded config files during setup checks.
|
|
696
821
|
- Fixed config persistence risk by using atomic writes in `config-manager` save flow.
|
|
697
822
|
- Fixed self-dependency metadata so the package remains zero-dependency in v2.
|
|
698
823
|
|
|
699
824
|
### Changed
|
|
825
|
+
|
|
700
826
|
- Updated package release metadata for the v2 line (`versionInfo`, deprecations, nextVersion).
|
|
701
827
|
|
|
702
828
|
## [1.10.2] - 2025-08-23
|
|
703
829
|
|
|
704
830
|
### 🚨 Critical Fix
|
|
831
|
+
|
|
705
832
|
- **Fixed projectRoot default path**: Resetting settings now correctly restores `projectRoot` to `/` instead of `./`, ensuring fresh installs work out-of-the-box
|
|
706
833
|
|
|
707
834
|
### 🆕 New Features
|
|
835
|
+
|
|
708
836
|
- **Centralized Environment Variable Management**: Added comprehensive environment variable support with validation and security controls
|
|
709
837
|
- **Enhanced Debug Logging**: Improved debug logging with environment variable support for better troubleshooting
|
|
710
838
|
- **Secure Plugin Loading**: Added path sanitization for module loading to prevent security issues
|
|
711
839
|
|
|
712
840
|
### 🔒 Security Enhancements
|
|
841
|
+
|
|
713
842
|
- **Enhanced Path Validation**: Strengthened path validation and file operations security
|
|
714
843
|
- **Secure Module Loading**: Added path sanitization for all plugin/module loading operations
|
|
715
844
|
- **Environment Variable Security**: Implemented centralized environment variable management with security filtering
|
|
716
845
|
|
|
717
846
|
### 🛠️ Improvements
|
|
847
|
+
|
|
718
848
|
- **Refactored Configuration Handling**: Updated config system with integrated environment variable support
|
|
719
849
|
- **Enhanced Logging System**: Improved debug logging capabilities with environment variable integration
|
|
720
850
|
- **Better Error Handling**: Enhanced error messages and debugging information
|
|
721
851
|
|
|
722
852
|
### 📚 Documentation
|
|
853
|
+
|
|
723
854
|
- **Environment Variables Guide**: Added comprehensive documentation for all supported environment variables
|
|
724
855
|
- **Migration Notes**: Added clear migration guidance for projectRoot path changes
|
|
725
856
|
|
|
726
857
|
### 🔧 Technical Changes
|
|
858
|
+
|
|
727
859
|
- **Package Version**: Updated to v1.10.2 across all files
|
|
728
860
|
- **Security Patches**: Applied security improvements to path handling and file operations
|
|
729
861
|
|
|
730
862
|
## [1.10.1] - 2025-08-22
|
|
731
863
|
|
|
732
864
|
### Added
|
|
865
|
+
|
|
733
866
|
- **New Terminal-Icons Utility**: Added `terminal-icons` utility for better emoji support in terminal output
|
|
734
867
|
- **Enhanced UI Text Processing**: Improved text processing with terminal-safe fallbacks for special characters
|
|
735
868
|
|
|
736
869
|
### Fixed
|
|
870
|
+
|
|
737
871
|
- Fixed infinite setup loop issue (Hotfix)
|
|
738
872
|
- Resolved version string update inconsistencies
|
|
739
873
|
|
|
740
874
|
### Changed
|
|
875
|
+
|
|
741
876
|
- Update version strings across all files from 1.9.1 to 1.10.1
|
|
742
877
|
- Remove outdated package-lock.json and backup config
|
|
743
878
|
|
|
744
879
|
## [1.10.0] - 2025-08-22
|
|
745
880
|
|
|
746
881
|
### Added
|
|
882
|
+
|
|
747
883
|
- **Enhanced Runtime API**: Improved framework-agnostic translation runtime with better TypeScript support
|
|
748
884
|
- **Framework Detection**: Enhanced support for Next.js, Nuxt.js, and SvelteKit projects
|
|
749
885
|
- **Reset Script**: Added `reset-for-publish.js` for clean package publishing
|
|
@@ -752,6 +888,7 @@ The v3.3.0 release resolves the actionable dynamic-require alert by eliminating
|
|
|
752
888
|
- **Caching System**: Added configuration caching to prevent redundant initialization
|
|
753
889
|
|
|
754
890
|
### Fixed
|
|
891
|
+
|
|
755
892
|
- **DNR Functionality**: Fixed persistence of "Do Not Remind" settings across version updates
|
|
756
893
|
- **Settings Management**: Improved error handling and logging for settings operations
|
|
757
894
|
- **TypeScript Definitions**: Enhanced type safety and autocomplete for better developer experience
|
|
@@ -761,17 +898,17 @@ The v3.3.0 release resolves the actionable dynamic-require alert by eliminating
|
|
|
761
898
|
- **Path Resolution**: Fixed source directory path handling for CLI arguments
|
|
762
899
|
|
|
763
900
|
### Security
|
|
901
|
+
|
|
764
902
|
- **Settings Persistence**: Secure handling of user preferences and framework settings
|
|
765
903
|
- **Error Handling**: Improved error reporting for configuration issues
|
|
766
904
|
- **Dependencies**: Maintained zero runtime dependencies for maximum security
|
|
767
905
|
- **Shell Access**: Confirmed no child_process usage in setup-enforcer.js
|
|
768
906
|
- **Input Validation**: Enhanced path validation for source and output directories
|
|
769
907
|
|
|
770
|
-
|
|
771
|
-
|
|
772
908
|
## [1.9.1] - 2025-08-14
|
|
773
909
|
|
|
774
910
|
### Added
|
|
911
|
+
|
|
775
912
|
- **Python Support**: Full support for Python frameworks including Django, Flask, FastAPI, and generic Python projects
|
|
776
913
|
- **Enhanced Framework Detection**: Improved accuracy for all supported frameworks with new Python detection algorithms
|
|
777
914
|
- **Common Locale File**: Added `locales/common.json` for shared translation keys across frameworks
|
|
@@ -779,6 +916,7 @@ The v3.3.0 release resolves the actionable dynamic-require alert by eliminating
|
|
|
779
916
|
- **Exit/Cancel Option**: Added option to exit/cancel (press 0) during directory selection in fixer command
|
|
780
917
|
|
|
781
918
|
### Changed
|
|
919
|
+
|
|
782
920
|
- **Security Overhaul**: Replaced all `child_process` imports with native Node.js APIs
|
|
783
921
|
- **Performance**: Maintained 97% performance improvement while adding security enhancements
|
|
784
922
|
- **Framework Detection**: Updated detection patterns for JavaScript, Python, Go, Java, and PHP
|
|
@@ -786,18 +924,21 @@ The v3.3.0 release resolves the actionable dynamic-require alert by eliminating
|
|
|
786
924
|
- **Documentation**: Comprehensive updates to reflect new features and security improvements
|
|
787
925
|
|
|
788
926
|
### Removed
|
|
927
|
+
|
|
789
928
|
- **Outdated Test Files**: Cleaned up test directories and removed deprecated test scripts
|
|
790
929
|
- **Debug Tools**: Removed unused benchmark and package test files
|
|
791
930
|
- **Shell Dependencies**: Eliminated all shell command dependencies
|
|
792
931
|
- **Legacy Files**: Removed outdated configuration and development files
|
|
793
932
|
|
|
794
933
|
### Security
|
|
934
|
+
|
|
795
935
|
- **Zero Vulnerabilities**: Successfully passed security audit with 0 vulnerabilities
|
|
796
936
|
- **Memory Safety**: Enhanced memory-safe operations throughout the codebase
|
|
797
937
|
- **Input Validation**: Improved validation for all user inputs and file operations
|
|
798
938
|
- **Dependency Cleanup**: Removed all shell-related dependencies
|
|
799
939
|
|
|
800
940
|
### Performance
|
|
941
|
+
|
|
801
942
|
- **Zero Overhead**: Security enhancements added zero performance overhead
|
|
802
943
|
- **Python Detection**: Minimal overhead from new Python framework detection
|
|
803
944
|
- **Memory Usage**: Maintained <2MB memory usage for all operations
|