i18ntk 2.5.0 → 2.6.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/CHANGELOG.md +366 -0
- package/CODE_OF_CONDUCT.md +133 -0
- package/CONTRIBUTING.md +41 -0
- package/FUNDING.md +5 -0
- package/README.md +38 -16
- package/SECURITY.md +52 -0
- package/main/i18ntk-analyze.js +4 -4
- package/main/i18ntk-scanner.js +14 -12
- package/main/i18ntk-validate.js +25 -18
- package/main/manage/commands/AnalyzeCommand.js +7 -4
- package/main/manage/commands/FixerCommand.js +11 -1
- package/main/manage/commands/ScannerCommand.js +12 -10
- package/main/manage/commands/ValidateCommand.js +21 -17
- package/main/manage/index.js +6 -7
- package/package.json +12 -165
- package/runtime/enhanced.js +64 -10
- package/runtime/i18ntk.d.ts +10 -6
- package/runtime/index.js +45 -22
- package/utils/admin-auth.js +85 -21
- package/utils/config-helper.js +43 -37
- package/utils/config-manager.js +59 -49
- package/utils/config.js +13 -4
- package/utils/env-manager.js +3 -1
- package/utils/i18n-helper.js +41 -13
- package/utils/init-helper.js +23 -21
- package/utils/secure-errors.js +10 -6
- package/utils/security.js +30 -4
- package/utils/setup-enforcer.js +22 -33
- package/utils/watch-locales.js +12 -5
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
# CHANGELOG
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
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
|
+
|
|
8
|
+
## [2.6.0] - 2026-05-03
|
|
9
|
+
|
|
10
|
+
### Security
|
|
11
|
+
- **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`.
|
|
12
|
+
- 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`.
|
|
13
|
+
- Fixed path traversal checks in `security.js` and `config-manager.js` — replaced fragile `path.sep`-based comparison with robust `startsWith('..')` prefix check.
|
|
14
|
+
- Hardened `utils/i18n-helper.js` fallback `SecurityUtils` implementation with path containment checks.
|
|
15
|
+
- Fixed `SecurityUtils.safeParseJSON` reference leak — deep-clones objects instead of returning caller's reference.
|
|
16
|
+
|
|
17
|
+
### Fixed
|
|
18
|
+
- Fixed `main/i18ntk-analyze.js` `this.adminAuth` reference error (local variable was not assigned to instance property).
|
|
19
|
+
- Fixed `main/i18ntk-validate.js` `ExitCodes.CONFIG_ERROR` referenced before declaration.
|
|
20
|
+
- Fixed `main/i18ntk-scanner.js` `fs.readdirSync(projectRoot, { recursive: true })` removed (unsupported in older Node.js).
|
|
21
|
+
- Fixed `main/i18ntk-scanner.js` raw `fs.readdirSync`/`fs.statSync`/`fs.mkdirSync` in `scanDirectory` and `generateReport`.
|
|
22
|
+
- Fixed `main/i18ntk-validate.js` raw `fs.readdirSync`/`fs.mkdirSync`/`fs.unlinkSync` in `getAvailableLanguages`, `getLanguageFiles`, and validation report cleanup.
|
|
23
|
+
- Fixed `utils/secure-errors.js` `safeWriteFileSync` missing basePath and raw `fs.mkdirSync`.
|
|
24
|
+
- Fixed `main/manage/commands/FixerCommand.js` `cleanupOldBackups` using raw `fs.rmSync` without path validation.
|
|
25
|
+
- Fixed `runtime/enhanced.js` process event handler leak (multiple instances) and missing `setInterval.unref()`.
|
|
26
|
+
- Fixed `utils/setup-enforcer.js` async Promise executor anti-pattern.
|
|
27
|
+
- Fixed `utils/config-manager.js` stale `process.cwd()` capture at module load time.
|
|
28
|
+
- Fixed `utils/config-manager.js` `ensureProjectSettingsDir` being a no-op.
|
|
29
|
+
- Fixed `utils/config-helper.js` 7 `safeWriteFileSync` calls missing basePath in `initializeSourceFiles`.
|
|
30
|
+
- Fixed `utils/env-manager.js` `getBoolean` comparison against non-boolean values.
|
|
31
|
+
- Fixed `utils/admin-auth.js` `uncaughtException` handler wrong parameter format.
|
|
32
|
+
|
|
33
|
+
### Added
|
|
34
|
+
- `SecurityUtils.safeUnlinkSync(filePath, basePath)` — safely delete a file.
|
|
35
|
+
- `SecurityUtils.safeRmdirSync(dirPath, basePath)` — safely remove a directory.
|
|
36
|
+
|
|
37
|
+
### Changed
|
|
38
|
+
- `configManager.resolvePaths`, `configManager.toRelative`, and config lock path now dynamically resolve via `getUserProjectRoot()`/`getProjectConfigPath()`.
|
|
39
|
+
- `configManager.CONFIG_PATH` is now a getter that dynamically returns the project config path.
|
|
40
|
+
- `configManager.migrateLegacyIfNeeded` exported for testability.
|
|
41
|
+
|
|
42
|
+
### TypeScript
|
|
43
|
+
- Fixed `runtime/i18ntk.d.ts` `BasicI18nRuntime.translate` and `t` return types from `Promise<string>` to `string`.
|
|
44
|
+
|
|
45
|
+
### Scripts
|
|
46
|
+
- Fixed `scripts/build-public-package.js` and `scripts/reset-release-state.js` `npm_execpath` fallback for missing env var.
|
|
47
|
+
- Fixed `scripts/lint-locales.js` BOM handling and try-catch for `fs.readdirSync`.
|
|
48
|
+
|
|
49
|
+
## [2.5.1] - 2026-04-29
|
|
50
|
+
|
|
51
|
+
### Security
|
|
52
|
+
- Fixed `AdminAuth.verifyPin()` to fail closed when admin config is missing, disabled, or malformed instead of returning success.
|
|
53
|
+
- Fixed auth-required checks to fail closed when settings require admin PIN protection but the admin config is unusable.
|
|
54
|
+
- Normalized admin session expiry handling by storing both `expires` and `expiresAt` and cleaning up both formats consistently.
|
|
55
|
+
|
|
56
|
+
### Added
|
|
57
|
+
- Added regression tests for admin PIN fail-closed behavior and session expiry cleanup.
|
|
58
|
+
|
|
59
|
+
### Changed
|
|
60
|
+
- Documented the public npm package staging flow introduced after `2.5.0`.
|
|
61
|
+
|
|
62
|
+
## [2.5.0] - 2026-04-29
|
|
63
|
+
|
|
64
|
+
### Security
|
|
65
|
+
- Centralized environment-variable access behind the `utils/env-manager.js` allowlist.
|
|
66
|
+
- Hardened `SecurityUtils.safeJoin()` and path validation against sibling-prefix containment bypasses.
|
|
67
|
+
- Switched admin PIN hash verification to timing-safe comparison.
|
|
68
|
+
- Fixed expired admin session cleanup and unref'd the cleanup timer so it does not keep CLI processes alive.
|
|
69
|
+
- Expanded the release security scanner to inspect nested production source files.
|
|
70
|
+
|
|
71
|
+
### Fixed
|
|
72
|
+
- Fixed the manager fixer command so applied fixes are written to the same parsed object that is saved.
|
|
73
|
+
- Fixed fixer writes for absolute source directories outside the current working directory.
|
|
74
|
+
- Fixed debug-menu file reads to use `SecurityUtils` wrappers.
|
|
75
|
+
- Fixed `secure-errors` to import its `SecurityUtils` dependency explicitly.
|
|
76
|
+
|
|
77
|
+
### Changed
|
|
78
|
+
- Updated package and documentation metadata to `2.5.0`.
|
|
79
|
+
|
|
80
|
+
## [2.4.0] - 2026-04-16
|
|
81
|
+
|
|
82
|
+
### Changed
|
|
83
|
+
- Disabled npm registry update-check behavior in CLI startup paths.
|
|
84
|
+
- Disabled manager-route backup execution (`i18ntk --command=backup`); standalone `i18ntk-backup` remains available.
|
|
85
|
+
- Disabled setup prerequisite command probing via `PATH` inspection.
|
|
86
|
+
- Updated README/docs/migration guides/environment variable documentation to reflect the above behavior.
|
|
87
|
+
|
|
88
|
+
## [2.3.8] - 2026-04-13
|
|
89
|
+
|
|
90
|
+
### Added
|
|
91
|
+
- Added centralized structured logger with standardized prefixes and configurable levels (`error`, `warn`, `info`, `debug`).
|
|
92
|
+
- Added opt-in JSON log output for CI/build pipelines via `JSON_LOG=true`.
|
|
93
|
+
- Added missing-translation-key cache TTL (5 minutes) to prevent repeated key-miss spam.
|
|
94
|
+
- Added build/worker logging utilities for percentage progress and pooled worker activity summaries.
|
|
95
|
+
- Added test coverage for logger timing/progress/worker aggregation behavior.
|
|
96
|
+
|
|
97
|
+
### Fixed
|
|
98
|
+
- Fixed repeated default-configuration fallback output by emitting a single fallback notice per process.
|
|
99
|
+
- Fixed recursive security/i18n logging interactions that could trigger repeated warning cascades.
|
|
100
|
+
- Fixed false-positive security warnings for internal package/project absolute paths through internal root whitelisting.
|
|
101
|
+
|
|
102
|
+
### Changed
|
|
103
|
+
- Logging is now silent by default for non-critical output in production-like builds unless `DEBUG_MODE=true`.
|
|
104
|
+
- Security warning reasons now use specific detection details instead of generic "dangerous patterns".
|
|
105
|
+
- Updated package/docs/version metadata to `2.3.8`.
|
|
106
|
+
|
|
107
|
+
## [2.3.7] - 2026-04-12
|
|
108
|
+
|
|
109
|
+
### Fixed
|
|
110
|
+
- Removed false-positive path traversal warnings for safe absolute project paths during framework builds.
|
|
111
|
+
- Reduced repeated default-configuration console noise in multi-worker build environments.
|
|
112
|
+
|
|
113
|
+
### Changed
|
|
114
|
+
- Security event console logging is now fully opt-in via `I18NTK_ENABLE_SECURITY_LOGS=true` (or debug envs).
|
|
115
|
+
- Config-manager diagnostic console logging is now fully opt-in via `I18NTK_ENABLE_LOGS=true` (or debug envs).
|
|
116
|
+
- Updated docs to reflect new default-silent logging behavior and troubleshooting toggles.
|
|
117
|
+
|
|
118
|
+
## [2.3.6] - 2026-04-12
|
|
119
|
+
|
|
120
|
+
### Security
|
|
121
|
+
- **Fixed path traversal vulnerability** in temporary file creation
|
|
122
|
+
- **Added `safeJoin` function** for secure path construction
|
|
123
|
+
- **Improved path validation** throughout the codebase
|
|
124
|
+
|
|
125
|
+
### Fixed
|
|
126
|
+
- Hardened settings reset and backup cleanup paths to reduce risk of broad/deep unintended file deletion.
|
|
127
|
+
- Hardened backup command path handling to keep source/output/restore operations inside project boundaries by default.
|
|
128
|
+
- Fixed backup-class async file operations to consistently use `fs.promises` APIs.
|
|
129
|
+
|
|
130
|
+
### Changed
|
|
131
|
+
- **Silent security logging by default**: Info-level messages suppressed, warnings/errors shown
|
|
132
|
+
- **Debug mode**: Enable verbose logging with `I18N_DEBUG=true`
|
|
133
|
+
- **Centralized security logging**: All security events use `SecurityUtils.logSecurityEvent()`
|
|
134
|
+
- Made npm registry update checks explicit opt-in via `I18NTK_ENABLE_UPDATE_CHECK`.
|
|
135
|
+
- Updated package/docs/version metadata to `2.3.6`.
|
|
136
|
+
|
|
137
|
+
## [2.3.4] - 2026-04-12
|
|
138
|
+
|
|
139
|
+
### Fixed
|
|
140
|
+
- Fixed runtime autosave behavior so configuration write failures no longer hard-throw through request/render paths.
|
|
141
|
+
- Fixed config save race resilience by combining queued writes, cross-process lock files, and unique temp filenames per write.
|
|
142
|
+
|
|
143
|
+
### Added
|
|
144
|
+
- Added `I18NTK_DISABLE_AUTOSAVE` support to skip disk persistence and keep in-memory config in server/runtime environments.
|
|
145
|
+
- Added config-manager concurrency regression test covering parallel `saveConfig` calls.
|
|
146
|
+
|
|
147
|
+
### Changed
|
|
148
|
+
- Updated package/docs/version metadata to `2.3.4`.
|
|
149
|
+
- Updated support policy guidance to recommend upgrading from versions below `2.3.4`.
|
|
150
|
+
|
|
151
|
+
## [2.3.3] - 2026-04-12
|
|
152
|
+
|
|
153
|
+
### Fixed
|
|
154
|
+
- Fixed production config persistence race across multiple Node processes by adding cross-process file locking for `.i18ntk-config` writes.
|
|
155
|
+
- Fixed intermittent `ENOENT` during atomic config rename operations under concurrent production traffic.
|
|
156
|
+
|
|
157
|
+
### Changed
|
|
158
|
+
- Updated package/docs/version metadata to `2.3.3`.
|
|
159
|
+
- Updated support policy guidance to recommend upgrading from versions below `2.3.3`.
|
|
160
|
+
|
|
161
|
+
## [2.3.2] - 2026-04-12
|
|
162
|
+
|
|
163
|
+
### Added
|
|
164
|
+
- Added startup npm-registry version checks that warn when the installed CLI is behind the latest published `i18ntk` release.
|
|
165
|
+
- Added support for checking all published semver versions up to the current latest tag to improve outdated-version detection reliability.
|
|
166
|
+
|
|
167
|
+
### Fixed
|
|
168
|
+
- Fixed fatal analyze-command startup failure in manager command flow caused by missing `validateSourceDir` import.
|
|
169
|
+
|
|
170
|
+
### Changed
|
|
171
|
+
- Updated package/docs/version metadata to `2.3.2`.
|
|
172
|
+
- Updated support policy guidance to recommend upgrading from versions below `2.3.2`.
|
|
173
|
+
|
|
174
|
+
## [2.3.1] - 2026-04-12
|
|
175
|
+
|
|
176
|
+
### Fixed
|
|
177
|
+
- 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).
|
|
178
|
+
|
|
179
|
+
### Changed
|
|
180
|
+
- Updated package/docs/version metadata to `2.3.1`.
|
|
181
|
+
- Updated support policy guidance to recommend upgrading from versions below `2.3.1`.
|
|
182
|
+
|
|
183
|
+
## [2.3.0] - 2026-04-12
|
|
184
|
+
|
|
185
|
+
### Added
|
|
186
|
+
- Added validation summary report output after validation runs.
|
|
187
|
+
- Added init-time backup configuration prompt (default disabled, optional enable).
|
|
188
|
+
|
|
189
|
+
### Fixed
|
|
190
|
+
- Fixed backup recursion/pollution risk by moving automated fixer backups to a dedicated backup root.
|
|
191
|
+
- Fixed backup retention behavior to keep 1 by default with enforced bounds up to 3.
|
|
192
|
+
- Fixed language discovery in validate/fixer flows to ignore backup/report directories.
|
|
193
|
+
|
|
194
|
+
### Changed
|
|
195
|
+
- Updated package/docs/version metadata to `2.3.0`.
|
|
196
|
+
- Updated support policy guidance to recommend upgrading from versions below `2.3.0`.
|
|
197
|
+
|
|
198
|
+
## [2.2.0] - 2026-04-12
|
|
199
|
+
|
|
200
|
+
### Added
|
|
201
|
+
- Added an explicit upgrade/support notice in docs recommending upgrade from pre-`2.2.0` versions.
|
|
202
|
+
- Added migration guide for `v2.2.0`.
|
|
203
|
+
|
|
204
|
+
### Fixed
|
|
205
|
+
- Fixed critical sizing workflow regressions.
|
|
206
|
+
- Fixed critical usage-analysis workflow regressions.
|
|
207
|
+
- Fixed runtime locale optimizer dependency path after publish-surface cleanup.
|
|
208
|
+
|
|
209
|
+
### Changed
|
|
210
|
+
- Reduced publish surface by excluding internal development scripts from npm package artifacts.
|
|
211
|
+
- Excluded legacy fixed artifacts from package output (`main/manage/index-fixed.js`, `utils/security-fixed.js`).
|
|
212
|
+
- Updated package/docs/version metadata to `2.2.0`.
|
|
213
|
+
|
|
214
|
+
## [2.1.1] - 2026-04-11
|
|
215
|
+
|
|
216
|
+
### Added
|
|
217
|
+
- Version bump to 2.1.1 for release.
|
|
218
|
+
- Added `SecurityUtils.debugLog` function for consistent debugging.
|
|
219
|
+
|
|
220
|
+
### Fixed
|
|
221
|
+
- Fixed `SecurityUtils.logSecurityEvent` calls missing `level` parameter in `i18ntk-usage` and `UsageService`.
|
|
222
|
+
- Fixed `level.toLowerCase is not a function` error in usage analysis.
|
|
223
|
+
- Fixed `SecurityUtils.debugLog is not a function` error in sizing analysis.
|
|
224
|
+
|
|
225
|
+
### Changed
|
|
226
|
+
- Updated package and release metadata to `2.1.1`.
|
|
227
|
+
- Removed legacy `resources/i18n/ui-locales` path references (use `ui-locales/` instead).
|
|
228
|
+
- Updated all UI locale loading to use `ui-locales/` directory.
|
|
229
|
+
|
|
230
|
+
## [2.1.0] - 2026-04-11
|
|
231
|
+
|
|
232
|
+
### Added
|
|
233
|
+
- Added a v2.1.0 migration guide and updated release runbook references.
|
|
234
|
+
- Added stricter language-directory filtering in analysis paths to ignore backup/report folders.
|
|
235
|
+
|
|
236
|
+
### Fixed
|
|
237
|
+
- Fixed interactive menu command flow so it reliably returns to the main menu after command completion.
|
|
238
|
+
- Fixed analysis progress output to report the correct processed-language count.
|
|
239
|
+
- Fixed duplicate report-save output lines during analysis.
|
|
240
|
+
- Fixed framework detection behavior to treat setup-complete projects as internally configured i18ntk projects.
|
|
241
|
+
- Fixed false-positive security warnings for valid configuration fields like `dateFormat`, `timeFormat`, and `reportLanguage`.
|
|
242
|
+
- Fixed locale-loading path fallback behavior to avoid noisy startup errors in global installs.
|
|
243
|
+
|
|
244
|
+
### Changed
|
|
245
|
+
- Synchronized and normalized UI locale keys across `resources/i18n/ui-locales` and `ui-locales`.
|
|
246
|
+
- Updated package/release metadata to `2.1.0`.
|
|
247
|
+
|
|
248
|
+
## [2.0.0] - 2026-01-01
|
|
249
|
+
|
|
250
|
+
### Added
|
|
251
|
+
- Added missing runtime translation keys across `init`, `fixer`, `sizing`, `summary`, `usage`, and settings import/export flows.
|
|
252
|
+
- Added `SecurityUtils.safeParseJSON`, `SecurityUtils.safeReadFile`, and `SecurityUtils.safeWriteFile` compatibility APIs used by v2 command paths.
|
|
253
|
+
- Added source-locale bootstrap behavior during `init` when the source language directory exists but has no translation files.
|
|
254
|
+
|
|
255
|
+
### Fixed
|
|
256
|
+
- Fixed initialization state detection to use project `.i18ntk-config` setup metadata as the v2 source of truth.
|
|
257
|
+
- Fixed false setup-invalid states caused by BOM-encoded config files during setup checks.
|
|
258
|
+
- Fixed config persistence risk by using atomic writes in `config-manager` save flow.
|
|
259
|
+
- Fixed self-dependency metadata so the package remains zero-dependency in v2.
|
|
260
|
+
|
|
261
|
+
### Changed
|
|
262
|
+
- Updated package release metadata for the v2 line (`versionInfo`, deprecations, nextVersion).
|
|
263
|
+
|
|
264
|
+
## [1.10.2] - 2025-08-23
|
|
265
|
+
|
|
266
|
+
### 🚨 Critical Fix
|
|
267
|
+
- **Fixed projectRoot default path**: Resetting settings now correctly restores `projectRoot` to `/` instead of `./`, ensuring fresh installs work out-of-the-box
|
|
268
|
+
|
|
269
|
+
### 🆕 New Features
|
|
270
|
+
- **Centralized Environment Variable Management**: Added comprehensive environment variable support with validation and security controls
|
|
271
|
+
- **Enhanced Debug Logging**: Improved debug logging with environment variable support for better troubleshooting
|
|
272
|
+
- **Secure Plugin Loading**: Added path sanitization for module loading to prevent security issues
|
|
273
|
+
|
|
274
|
+
### 🔒 Security Enhancements
|
|
275
|
+
- **Enhanced Path Validation**: Strengthened path validation and file operations security
|
|
276
|
+
- **Secure Module Loading**: Added path sanitization for all plugin/module loading operations
|
|
277
|
+
- **Environment Variable Security**: Implemented centralized environment variable management with security filtering
|
|
278
|
+
|
|
279
|
+
### 🛠️ Improvements
|
|
280
|
+
- **Refactored Configuration Handling**: Updated config system with integrated environment variable support
|
|
281
|
+
- **Enhanced Logging System**: Improved debug logging capabilities with environment variable integration
|
|
282
|
+
- **Better Error Handling**: Enhanced error messages and debugging information
|
|
283
|
+
|
|
284
|
+
### 📚 Documentation
|
|
285
|
+
- **Environment Variables Guide**: Added comprehensive documentation for all supported environment variables
|
|
286
|
+
- **Migration Notes**: Added clear migration guidance for projectRoot path changes
|
|
287
|
+
|
|
288
|
+
### 🔧 Technical Changes
|
|
289
|
+
- **Package Version**: Updated to v1.10.2 across all files
|
|
290
|
+
- **Security Patches**: Applied security improvements to path handling and file operations
|
|
291
|
+
|
|
292
|
+
## [1.10.1] - 2025-08-22
|
|
293
|
+
|
|
294
|
+
### Added
|
|
295
|
+
- **New Terminal-Icons Utility**: Added `terminal-icons` utility for better emoji support in terminal output
|
|
296
|
+
- **Enhanced UI Text Processing**: Improved text processing with terminal-safe fallbacks for special characters
|
|
297
|
+
|
|
298
|
+
### Fixed
|
|
299
|
+
- Fixed infinite setup loop issue (Hotfix)
|
|
300
|
+
- Resolved version string update inconsistencies
|
|
301
|
+
|
|
302
|
+
### Changed
|
|
303
|
+
- Update version strings across all files from 1.9.1 to 1.10.1
|
|
304
|
+
- Remove outdated package-lock.json and backup config
|
|
305
|
+
|
|
306
|
+
## [1.10.0] - 2025-08-22
|
|
307
|
+
|
|
308
|
+
### Added
|
|
309
|
+
- **Enhanced Runtime API**: Improved framework-agnostic translation runtime with better TypeScript support
|
|
310
|
+
- **Framework Detection**: Enhanced support for Next.js, Nuxt.js, and SvelteKit projects
|
|
311
|
+
- **Reset Script**: Added `reset-for-publish.js` for clean package publishing
|
|
312
|
+
- **Documentation**: Comprehensive updates for new features and improvements
|
|
313
|
+
- **Configuration Persistence**: Fixed configuration changes not being saved to disk
|
|
314
|
+
- **Caching System**: Added configuration caching to prevent redundant initialization
|
|
315
|
+
|
|
316
|
+
### Fixed
|
|
317
|
+
- **DNR Functionality**: Fixed persistence of "Do Not Remind" settings across version updates
|
|
318
|
+
- **Settings Management**: Improved error handling and logging for settings operations
|
|
319
|
+
- **TypeScript Definitions**: Enhanced type safety and autocomplete for better developer experience
|
|
320
|
+
- **Performance**: Optimized translation lookups with reduced memory footprint
|
|
321
|
+
- **Shell Security**: Verified zero shell access vulnerabilities in setup-enforcer.js
|
|
322
|
+
- **Configuration Loading**: Fixed multiple "Initializing with default configuration" messages
|
|
323
|
+
- **Path Resolution**: Fixed source directory path handling for CLI arguments
|
|
324
|
+
|
|
325
|
+
### Security
|
|
326
|
+
- **Settings Persistence**: Secure handling of user preferences and framework settings
|
|
327
|
+
- **Error Handling**: Improved error reporting for configuration issues
|
|
328
|
+
- **Dependencies**: Maintained zero runtime dependencies for maximum security
|
|
329
|
+
- **Shell Access**: Confirmed no child_process usage in setup-enforcer.js
|
|
330
|
+
- **Input Validation**: Enhanced path validation for source and output directories
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
## [1.9.1] - 2025-08-14
|
|
335
|
+
|
|
336
|
+
### Added
|
|
337
|
+
- **Python Support**: Full support for Python frameworks including Django, Flask, FastAPI, and generic Python projects
|
|
338
|
+
- **Enhanced Framework Detection**: Improved accuracy for all supported frameworks with new Python detection algorithms
|
|
339
|
+
- **Common Locale File**: Added `locales/common.json` for shared translation keys across frameworks
|
|
340
|
+
- **Zero Shell Security**: Complete removal of `child_process` dependencies for maximum security
|
|
341
|
+
- **Exit/Cancel Option**: Added option to exit/cancel (press 0) during directory selection in fixer command
|
|
342
|
+
|
|
343
|
+
### Changed
|
|
344
|
+
- **Security Overhaul**: Replaced all `child_process` imports with native Node.js APIs
|
|
345
|
+
- **Performance**: Maintained 97% performance improvement while adding security enhancements
|
|
346
|
+
- **Framework Detection**: Updated detection patterns for JavaScript, Python, Go, Java, and PHP
|
|
347
|
+
- **File Structure**: Optimized package structure with removed outdated files
|
|
348
|
+
- **Documentation**: Comprehensive updates to reflect new features and security improvements
|
|
349
|
+
|
|
350
|
+
### Removed
|
|
351
|
+
- **Outdated Test Files**: Cleaned up test directories and removed deprecated test scripts
|
|
352
|
+
- **Debug Tools**: Removed unused benchmark and package test files
|
|
353
|
+
- **Shell Dependencies**: Eliminated all shell command dependencies
|
|
354
|
+
- **Legacy Files**: Removed outdated configuration and development files
|
|
355
|
+
|
|
356
|
+
### Security
|
|
357
|
+
- **Zero Vulnerabilities**: Successfully passed security audit with 0 vulnerabilities
|
|
358
|
+
- **Memory Safety**: Enhanced memory-safe operations throughout the codebase
|
|
359
|
+
- **Input Validation**: Improved validation for all user inputs and file operations
|
|
360
|
+
- **Dependency Cleanup**: Removed all shell-related dependencies
|
|
361
|
+
|
|
362
|
+
### Performance
|
|
363
|
+
- **Zero Overhead**: Security enhancements added zero performance overhead
|
|
364
|
+
- **Python Detection**: Minimal overhead from new Python framework detection
|
|
365
|
+
- **Memory Usage**: Maintained <2MB memory usage for all operations
|
|
366
|
+
- **Validation**: Enhanced validation with no performance impact
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our
|
|
6
|
+
community a harassment-free experience for everyone, regardless of age, body
|
|
7
|
+
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
|
8
|
+
identity and expression, level of experience, education, socio-economic status,
|
|
9
|
+
nationality, personal appearance, race, caste, color, religion, or sexual identity
|
|
10
|
+
and orientation.
|
|
11
|
+
|
|
12
|
+
We pledge to act and interact in ways that contribute to an open, welcoming,
|
|
13
|
+
diverse, inclusive, and healthy community.
|
|
14
|
+
|
|
15
|
+
## Our Standards
|
|
16
|
+
|
|
17
|
+
Examples of behavior that contributes to a positive environment for our
|
|
18
|
+
community include:
|
|
19
|
+
|
|
20
|
+
* Demonstrating empathy and kindness toward other people
|
|
21
|
+
* Being respectful of differing opinions, viewpoints, and experiences
|
|
22
|
+
* Giving and gracefully accepting constructive feedback
|
|
23
|
+
* Accepting responsibility and apologizing to those affected by our mistakes,
|
|
24
|
+
and learning from the experience
|
|
25
|
+
* Focusing on what is best not just for us as individuals, but for the overall
|
|
26
|
+
community
|
|
27
|
+
|
|
28
|
+
Examples of unacceptable behavior include:
|
|
29
|
+
|
|
30
|
+
* The use of sexualized language or imagery, and sexual attention or advances
|
|
31
|
+
of any kind
|
|
32
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
|
33
|
+
* Public or private harassment
|
|
34
|
+
* Publishing others' private information, such as a physical or email address,
|
|
35
|
+
without their explicit permission
|
|
36
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
|
37
|
+
professional setting
|
|
38
|
+
|
|
39
|
+
## Enforcement Responsibilities
|
|
40
|
+
|
|
41
|
+
Community leaders are responsible for clarifying and enforcing our standards of
|
|
42
|
+
acceptable behavior and will take appropriate and fair corrective action in
|
|
43
|
+
response to any behavior that they deem inappropriate, threatening, offensive,
|
|
44
|
+
or harmful.
|
|
45
|
+
|
|
46
|
+
Community leaders have the right and responsibility to remove, edit, or reject
|
|
47
|
+
comments, commits, code, wiki edits, issues, and other contributions that are
|
|
48
|
+
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
|
49
|
+
decisions when appropriate.
|
|
50
|
+
|
|
51
|
+
## Scope
|
|
52
|
+
|
|
53
|
+
This Code of Conduct applies within all community spaces, and also applies when
|
|
54
|
+
an individual is officially representing the community in public spaces.
|
|
55
|
+
Examples of representing our community include using an official e-mail address,
|
|
56
|
+
posting via an official social media account, or acting as an appointed
|
|
57
|
+
representative at an online or offline event.
|
|
58
|
+
|
|
59
|
+
## Enforcement
|
|
60
|
+
|
|
61
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
62
|
+
reported to the community leaders responsible for enforcement at
|
|
63
|
+
GitHub Security Advisories for sensitive reports, or GitHub issues for non-sensitive community concerns.
|
|
64
|
+
All complaints will be reviewed and investigated promptly and fairly.
|
|
65
|
+
|
|
66
|
+
All community leaders are obligated to respect the privacy and security of the
|
|
67
|
+
reporter of any incident.
|
|
68
|
+
|
|
69
|
+
## Enforcement Guidelines
|
|
70
|
+
|
|
71
|
+
Community leaders will follow these Community Impact Guidelines in determining
|
|
72
|
+
the consequences for any action they deem in violation of this Code of Conduct:
|
|
73
|
+
|
|
74
|
+
### 1. Correction
|
|
75
|
+
|
|
76
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed
|
|
77
|
+
unprofessional or unwelcome in the community.
|
|
78
|
+
|
|
79
|
+
**Consequence**: A private, written warning from community leaders, providing
|
|
80
|
+
clarity around the nature of the violation and an explanation of why the
|
|
81
|
+
behavior was inappropriate. A public apology may be requested.
|
|
82
|
+
|
|
83
|
+
### 2. Warning
|
|
84
|
+
|
|
85
|
+
**Community Impact**: A violation through a single incident or series of
|
|
86
|
+
actions.
|
|
87
|
+
|
|
88
|
+
**Consequence**: A warning with consequences for continued behavior. No
|
|
89
|
+
interaction with the people involved, including unsolicited interaction with
|
|
90
|
+
those enforcing the Code of Conduct, for a specified period of time. This
|
|
91
|
+
includes avoiding interactions in community spaces as well as external channels
|
|
92
|
+
like social media. Violating these terms may lead to a temporary or permanent
|
|
93
|
+
ban.
|
|
94
|
+
|
|
95
|
+
### 3. Temporary Ban
|
|
96
|
+
|
|
97
|
+
**Community Impact**: A serious violation of community standards, including
|
|
98
|
+
sustained inappropriate behavior.
|
|
99
|
+
|
|
100
|
+
**Consequence**: A temporary ban from any sort of interaction or public
|
|
101
|
+
communication with the community for a specified period of time. No public or
|
|
102
|
+
private interaction with the people involved, including unsolicited interaction
|
|
103
|
+
with those enforcing the Code of Conduct, is allowed during this period.
|
|
104
|
+
Violating these terms may lead to a permanent ban.
|
|
105
|
+
|
|
106
|
+
### 4. Permanent Ban
|
|
107
|
+
|
|
108
|
+
**Community Impact**: Demonstrating a pattern of violation of community
|
|
109
|
+
standards, including sustained inappropriate behavior, harassment of an
|
|
110
|
+
individual, or aggression toward or disparagement of classes of individuals.
|
|
111
|
+
|
|
112
|
+
**Consequence**: A permanent ban from any sort of public interaction within the
|
|
113
|
+
community.
|
|
114
|
+
|
|
115
|
+
## Attribution
|
|
116
|
+
|
|
117
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
|
118
|
+
version 2.1, available at
|
|
119
|
+
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
|
120
|
+
|
|
121
|
+
Community Impact Guidelines were inspired by [Mozilla's code of conduct
|
|
122
|
+
enforcement ladder][Mozilla CoC].
|
|
123
|
+
|
|
124
|
+
[homepage]: https://www.contributor-covenant.org
|
|
125
|
+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
|
126
|
+
[Mozilla CoC]: https://github.com/mozilla/diversity
|
|
127
|
+
|
|
128
|
+
For answers to common questions about this code of conduct, see the FAQ at
|
|
129
|
+
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
|
|
130
|
+
[https://www.contributor-covenant.org/translations][translations].
|
|
131
|
+
|
|
132
|
+
[FAQ]: https://www.contributor-covenant.org/faq
|
|
133
|
+
[translations]: https://www.contributor-covenant.org/translations
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Contributing to i18ntk
|
|
2
|
+
|
|
3
|
+
Thanks for helping improve i18ntk.
|
|
4
|
+
|
|
5
|
+
## Project Priorities
|
|
6
|
+
|
|
7
|
+
- Keep the npm package zero-dependency.
|
|
8
|
+
- Keep the published package minimal and free of tests, local setup state, reports, backups, logs, credentials, and generated artifacts.
|
|
9
|
+
- Preserve backward compatibility unless a breaking change is intentional and documented.
|
|
10
|
+
- Prefer small, well-tested fixes over broad refactors.
|
|
11
|
+
|
|
12
|
+
## Development Setup
|
|
13
|
+
|
|
14
|
+
Clone the repository, install with npm, and run the project validation checks before opening a pull request.
|
|
15
|
+
|
|
16
|
+
## Release Validation
|
|
17
|
+
|
|
18
|
+
Maintainer release commands are documented in the repository development guide. The package published to npm uses a stripped public manifest.
|
|
19
|
+
|
|
20
|
+
## Security
|
|
21
|
+
|
|
22
|
+
Follow the security guidance in `SECURITY.md` and `docs/development/AGENTS.md`.
|
|
23
|
+
|
|
24
|
+
Report vulnerabilities through GitHub Security Advisories. Do not open public issues for sensitive security reports.
|
|
25
|
+
|
|
26
|
+
## Translations
|
|
27
|
+
|
|
28
|
+
When editing `ui-locales/`, preserve JSON structure, placeholders, command names, file paths, and config keys.
|
|
29
|
+
|
|
30
|
+
Run:
|
|
31
|
+
|
|
32
|
+
Run the locale lint check before submitting translation changes.
|
|
33
|
+
|
|
34
|
+
## Pull Requests
|
|
35
|
+
|
|
36
|
+
Include:
|
|
37
|
+
|
|
38
|
+
- the problem being fixed
|
|
39
|
+
- the user-visible behavior change
|
|
40
|
+
- validation commands that were run
|
|
41
|
+
- any remaining risk or unverified behavior
|
package/FUNDING.md
ADDED
package/README.md
CHANGED
|
@@ -1,20 +1,35 @@
|
|
|
1
|
-
# i18ntk v2.
|
|
1
|
+
# i18ntk v2.6.0
|
|
2
2
|
|
|
3
3
|
Zero-dependency internationalization toolkit for setup, scanning, analysis, validation, usage tracking, and translation completion.
|
|
4
4
|
|
|
5
|
-

|
|
5
|
+

|
|
6
6
|
|
|
7
7
|
[](https://www.npmjs.com/package/i18ntk)
|
|
8
8
|
[](https://www.npmjs.com/package/i18ntk)
|
|
9
9
|
[](https://nodejs.org)
|
|
10
10
|
[](https://www.npmjs.com/package/i18ntk)
|
|
11
11
|
[](LICENSE)
|
|
12
|
-
[](https://socket.dev/npm/package/i18ntk/overview/2.6.0)
|
|
13
13
|
|
|
14
14
|
## Upgrade Notice
|
|
15
15
|
|
|
16
|
-
Versions earlier than `2.
|
|
17
|
-
They are considered unsupported for production use. Upgrade to `2.
|
|
16
|
+
Versions earlier than `2.6.0` may contain known stability and security issues.
|
|
17
|
+
They are considered unsupported for production use. Upgrade to `2.6.0` or newer.
|
|
18
|
+
|
|
19
|
+
## v2.6.0 — Deep-Code Audit Release
|
|
20
|
+
|
|
21
|
+
v2.6.0 is a comprehensive hardening release from a two-pass code audit fixing 35+ bugs and security issues across 18 files. Highlights:
|
|
22
|
+
|
|
23
|
+
- **Critical**: Fixed silent-write failures where `safeWriteFileSync` was called incorrectly across 4 modules.
|
|
24
|
+
- **Security**: Replaced all remaining raw `fs` calls with validated `SecurityUtils` wrappers.
|
|
25
|
+
- **Security**: Fixed path traversal bypass in the fallback `SecurityUtils` implementation.
|
|
26
|
+
- **Security**: Fixed Windows path traversal false negatives (fragile `path.sep` comparison).
|
|
27
|
+
- **Security**: Added `safeUnlinkSync` and `safeRmdirSync` for validated file/directory deletion.
|
|
28
|
+
- **Runtime**: Fixed process event handler leak, missing `setInterval.unref()`, and JSON parse error handling.
|
|
29
|
+
- **TypeScript**: Fixed `BasicI18nRuntime.translate/t` return type from `Promise<string>` to `string`.
|
|
30
|
+
- **Scripts**: Fixed `npm_execpath` fallback in build/release scripts.
|
|
31
|
+
|
|
32
|
+
For the full detailed changelog, see [CHANGELOG.md](./CHANGELOG.md). For migration notes, see [docs/migration-guide-v2.6.0.md](./docs/migration-guide-v2.6.0.md).
|
|
18
33
|
|
|
19
34
|
## What i18ntk Does
|
|
20
35
|
|
|
@@ -154,7 +169,7 @@ Example `.i18ntk-config`:
|
|
|
154
169
|
|
|
155
170
|
```json
|
|
156
171
|
{
|
|
157
|
-
"version": "2.
|
|
172
|
+
"version": "2.6.0",
|
|
158
173
|
"sourceDir": "./locales",
|
|
159
174
|
"i18nDir": "./locales",
|
|
160
175
|
"outputDir": "./i18ntk-reports",
|
|
@@ -170,16 +185,23 @@ See [docs/api/CONFIGURATION.md](docs/api/CONFIGURATION.md) for the full configur
|
|
|
170
185
|
|
|
171
186
|
## Docs
|
|
172
187
|
|
|
173
|
-
- [Documentation Index](docs/README.md)
|
|
174
|
-
- [Getting Started](docs/getting-started.md)
|
|
175
|
-
- [API Reference](docs/api/API_REFERENCE.md)
|
|
176
|
-
- [Configuration Guide](docs/api/CONFIGURATION.md)
|
|
177
|
-
- [Runtime API Guide](docs/runtime.md)
|
|
178
|
-
- [Scanner Guide](docs/scanner-guide.md)
|
|
179
|
-
- [Environment Variables](docs/environment-variables.md)
|
|
180
|
-
- [Migration Guide v2.
|
|
181
|
-
- [Migration Guide v2.
|
|
182
|
-
- [
|
|
188
|
+
- [Documentation Index](https://github.com/vladnoskv/i18ntk/blob/main/docs/README.md)
|
|
189
|
+
- [Getting Started](https://github.com/vladnoskv/i18ntk/blob/main/docs/getting-started.md)
|
|
190
|
+
- [API Reference](https://github.com/vladnoskv/i18ntk/blob/main/docs/api/API_REFERENCE.md)
|
|
191
|
+
- [Configuration Guide](https://github.com/vladnoskv/i18ntk/blob/main/docs/api/CONFIGURATION.md)
|
|
192
|
+
- [Runtime API Guide](https://github.com/vladnoskv/i18ntk/blob/main/docs/runtime.md)
|
|
193
|
+
- [Scanner Guide](https://github.com/vladnoskv/i18ntk/blob/main/docs/scanner-guide.md)
|
|
194
|
+
- [Environment Variables](https://github.com/vladnoskv/i18ntk/blob/main/docs/environment-variables.md)
|
|
195
|
+
- [Migration Guide v2.6.0](https://github.com/vladnoskv/i18ntk/blob/main/docs/migration-guide-v2.6.0.md)
|
|
196
|
+
- [Migration Guide v2.5.1](https://github.com/vladnoskv/i18ntk/blob/main/docs/migration-guide-v2.5.1.md)
|
|
197
|
+
- [Migration Guide v2.5.0](https://github.com/vladnoskv/i18ntk/blob/main/docs/migration-guide-v2.5.0.md)
|
|
198
|
+
|
|
199
|
+
## Community
|
|
200
|
+
|
|
201
|
+
- [Contributing](CONTRIBUTING.md)
|
|
202
|
+
- [Code of Conduct](CODE_OF_CONDUCT.md)
|
|
203
|
+
- [Security Policy](SECURITY.md)
|
|
204
|
+
- [Funding](FUNDING.md)
|
|
183
205
|
|
|
184
206
|
## Code of Conduct
|
|
185
207
|
|