i18ntk 1.6.2 β†’ 1.7.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.
Files changed (42) hide show
  1. package/README.md +116 -26
  2. package/main/i18ntk-analyze.js +737 -736
  3. package/main/i18ntk-autorun.js +8 -21
  4. package/main/i18ntk-complete.js +54 -65
  5. package/main/i18ntk-init.js +124 -184
  6. package/main/i18ntk-manage.js +191 -215
  7. package/main/i18ntk-settings.js +13 -0
  8. package/main/i18ntk-sizing.js +56 -72
  9. package/main/i18ntk-summary.js +998 -1019
  10. package/main/i18ntk-ui.js +51 -27
  11. package/main/i18ntk-usage.js +158 -163
  12. package/main/i18ntk-validate.js +95 -84
  13. package/package.json +36 -9
  14. package/scripts/build-lite.js +280 -0
  15. package/scripts/locale-optimizer.js +51 -65
  16. package/scripts/prepublish.js +201 -2
  17. package/scripts/security-utils.test.js +49 -0
  18. package/scripts/smoke-pack.js +180 -30
  19. package/scripts/test-runner.js +4 -3
  20. package/settings/.i18n-admin-config.json +5 -5
  21. package/settings/admin-config.json +1 -1
  22. package/settings/i18ntk-config.json +9 -30
  23. package/settings/settings-cli.js +188 -210
  24. package/settings/settings-manager.js +17 -6
  25. package/ui-locales/de.json +4 -0
  26. package/ui-locales/en.json +4 -0
  27. package/ui-locales/es.json +4 -0
  28. package/ui-locales/fr.json +5 -1
  29. package/ui-locales/ja.json +4 -0
  30. package/ui-locales/ru.json +4 -0
  31. package/ui-locales/zh.json +4 -0
  32. package/utils/admin-auth.js +9 -6
  33. package/utils/admin-cli.js +6 -77
  34. package/utils/admin-pin.js +27 -68
  35. package/utils/cli-helper.js +156 -0
  36. package/utils/cli.js +131 -0
  37. package/utils/config-helper.js +15 -8
  38. package/utils/config-manager.js +46 -20
  39. package/utils/i18n-helper.js +118 -47
  40. package/utils/security.js +40 -13
  41. package/utils/watch-locales.js +28 -0
  42. package/ui-locales/en/common.json +0 -5
package/README.md CHANGED
@@ -2,34 +2,32 @@
2
2
 
3
3
  ![i18ntk Logo](docs/screenshots/i18ntk-logo-public.PNG)
4
4
 
5
- **Version:** 1.6.2
6
- **Last Updated:** 2025-08-09
5
+ **Version:** 1.7.0
6
+ **Last Updated:** 2025-08-10
7
7
  **GitHub Repository:** [vladnoskv/i18ntk](https://github.com/vladnoskv/i18ntk)
8
8
 
9
9
  [![npm](https://img.shields.io/npm/dt/i18ntk.svg)](https://www.npmjs.com/package/i18ntk) [![npm version](https://badge.fury.io/js/i18ntk.svg)](https://badge.fury.io/js/i18ntk) [![Node.js Version](https://img.shields.io/badge/node-%3E%3D16.0.0-brightgreen.svg)](https://nodejs.org/) [![Downloads](https://img.shields.io/npm/dm/i18ntk.svg)](https://www.npmjs.com/package/i18ntk) [![GitHub stars](https://img.shields.io/github/stars/vladnoskv/i18ntk?style=social)](https://github.com/vladnoskv/i18ntk)
10
10
 
11
- > **🚨 Latest Update (v1.6.2)**: Critical npm package installation bug resolved from 1.6.0 and 1.6.1.
12
-
13
11
  **πŸš€ The fastest way to manage translations across any framework or vanilla JavaScript projects**
14
12
 
15
13
  **Framework Support:** Auto-detects popular libraries (React i18next, Vue i18n, i18next, Nuxt i18n, Svelte i18n) or works without a framework. i18ntk manages translation files and validationβ€”it does NOT implement translations on pages.
16
14
 
17
- > **Zero dependencies** | **Optimized smaller package** | **Works with any framework** | **Enterprise-grade security**
15
+ > **Zero dependencies** | **Works with any framework** | **Enterprise-grade security**
18
16
 
19
- > **v1.6.0** - **Ultra-extreme performance improvements to the i18ntk toolkit with 97% speed improvement** ⚑ Under 30ms for 200k keys (vs 1.2 seconds), up to 86% package size reduction, zero runtime dependencies.
17
+ > **v1.7.0** – 97% speed improvement (**15.38ms** for 200k keys), new watch helper, and a lite English-only UI locale framework; up to 86% package size reduction, zero runtime dependencies, enhanced security with PIN protection, and comprehensive edge case handling.
20
18
 
21
19
  ## πŸš€ Quick Start
22
20
 
23
21
  ```bash
24
22
  # Install globally
25
- npm install -g i18ntk@1.6.0
23
+ npm i i18ntk
26
24
 
27
25
  # Interactive setup
28
- npx i18ntk init
26
+ npx i18ntk
29
27
 
30
28
  # Basic commands
31
29
  i18ntk analyze --source ./src
32
- i18ntk complete --config=extreme
30
+ i18ntk complete --source ./src
33
31
  i18ntk validate --source ./locales
34
32
  ```
35
33
 
@@ -37,18 +35,25 @@ i18ntk validate --source ./locales
37
35
 
38
36
  | Mode | Time (200k keys) | Memory | Package Size |
39
37
  |------|------------------|--------|--------------|
38
+ | **Ultra-Extreme** | **15.38ms** | 1.62MB | 115KB-830KB |
40
39
  | **Extreme** | **38.90ms** | 0.61MB | 115KB-830KB |
41
40
  | Ultra | 336.8ms | 0.64MB | Configurable |
42
41
  | Optimized | 847.9ms | 0.45MB | Full package |
43
42
 
44
43
  ## 🎯 Key Features
45
44
 
46
- - **Ultra Performance**: 97% speed improvement with extreme optimization
45
+ - **Ultra-Extreme Performance**: 97% speed improvement - **15.38ms** for 200k keys
46
+ - **Enhanced Security**: Advanced PIN protection with exponential backoff & AES-256 encryption
47
+ - **Edge Case Handling**: Robust handling of corrupt files, encoding issues, and network failures
47
48
  - **Smart Sizing**: Interactive locale optimizer (up to 86% size reduction)
48
- - **Enterprise Security**: Admin PIN protection & comprehensive validation
49
+ - **Enterprise Backup**: Automated encrypted backups with cloud integration
49
50
  - **Zero Dependencies**: Lightweight, production-ready
50
- - **7 Languages**: English, Spanish, French, German, Japanese, Russian, Chinese
51
- - **Framework Support**: Auto-detects React i18next, Vue i18n, Angular, Next i18next, Nuxt i18n, Svelte i18n
51
+ - **Watch Helper**: Optional `--watch` mode keeps translations synced in real time
52
+ - **Lite Package Framework**: Build an English-only UI locale bundle for minimal footprint
53
+ - **8 Languages**: English, Spanish, French, German, Japanese, Russian, Chinese, and more
54
+ - **Framework Support**: Auto-detects React i18next, Vue i18n, Angular, Next i18next, Nuxt i18next, Svelte i18n
55
+ - **Memory Optimization**: 67% memory reduction with streaming processing
56
+ - **Scalability**: Linear scaling up to 5M keys with ultra-extreme settings
52
57
 
53
58
  ### πŸ“Έ Screenshots
54
59
 
@@ -70,10 +75,12 @@ i18ntk validate --source ./locales
70
75
  |---------|---------|---------|
71
76
  | `init` | Setup project | `i18ntk init --interactive` |
72
77
  | `analyze` | Find missing translations | `i18ntk analyze --source ./src` |
73
- | `complete` | Generate translations | `i18ntk complete --config=extreme` |
78
+ | `complete` | Generate translations | `i18ntk complete --config=ultra-extreme` |
74
79
  | `validate` | Check translation quality | `i18ntk validate --strict` |
75
80
  | `sync` | Sync across languages | `i18ntk sync --languages en,es,fr` |
76
81
  | `usage` | Analyze usage patterns | `i18ntk usage --format=json` |
82
+ | `doctor` | Diagnose configuration issues | `i18ntk doctor` |
83
+ | `sizing` | Optimize package size | `i18ntk sizing --interactive` |
77
84
 
78
85
  ## πŸ”§ Configuration
79
86
 
@@ -81,19 +88,45 @@ Configuration is managed through the `settings/i18ntk-config.json` file:
81
88
 
82
89
  ```json
83
90
  {
84
- "version": "1.6.2",
91
+ "version": "1.7.0",
85
92
  "sourceDir": "./locales",
86
93
  "outputDir": "./i18ntk-reports",
87
94
  "defaultLanguage": "en",
88
- "supportedLanguages": ["en", "es", "fr", "de"],
95
+ "supportedLanguages": ["en", "es", "fr", "de", "ja", "ru", "zh"],
89
96
  "performance": {
90
- "mode": "extreme",
91
- "batchSize": 1000,
92
- "concurrency": 16
97
+ "mode": "ultra-extreme",
98
+ "batchSize": 2000,
99
+ "concurrency": 32,
100
+ "memoryLimit": "256MB",
101
+ "streaming": true,
102
+ "compression": "brotli"
103
+ },
104
+ "security": {
105
+ "adminPinEnabled": true,
106
+ "sessionTimeout": 30,
107
+ "maxFailedAttempts": 3
108
+ },
109
+ "backup": {
110
+ "enabled": true,
111
+ "retentionDays": 30,
112
+ "maxBackups": 100
93
113
  }
94
114
  }
95
115
  ```
96
116
 
117
+ ### Environment Variables
118
+
119
+ You can override common path settings with environment variables:
120
+
121
+ | Variable | Overrides | Description |
122
+ |----------|-----------|-------------|
123
+ | `I18NTK_PROJECT_ROOT` | `projectRoot` | Base project directory |
124
+ | `I18NTK_SOURCE_DIR` | `sourceDir` | Location of source translation files |
125
+ | `I18NTK_I18N_DIR` | `i18nDir` | Working i18n directory |
126
+ | `I18NTK_OUTPUT_DIR` | `outputDir` | Output directory for generated reports |
127
+
128
+ These values are merged into the loaded configuration at runtime.
129
+
97
130
  ## 🌍 Language Optimization
98
131
 
99
132
  ```bash
@@ -132,13 +165,20 @@ import { createI18n } from 'vue-i18n';
132
165
  const i18n = createI18n({ locale: 'en', messages: translations });
133
166
  ```
134
167
 
135
-
136
168
  ## πŸ”’ Security Features
137
169
 
138
- - **Admin PIN Protection**: File role-based access control
139
- - **Input Sanitization**: Path traversal prevention
140
- - **File Validation**: Safe file operations
141
- - **Session Management**: Automatic timeout & cleanup
170
+ - **Admin PIN Protection**: AES-256-GCM encryption with 30-min sessions
171
+ - **Advanced Input Sanitization**: Comprehensive path traversal prevention
172
+ - **Zero-Trust Architecture**: All inputs validated and sanitized
173
+ - **Session Management**: Automatic timeout & cleanup with exponential backoff
174
+ - **File Validation**: Safe file operations with permission checks
175
+ - **Edge Case Security**: Robust handling of security edge cases
176
+ - **Encrypted Backups**: AES-256 encrypted backup storage
177
+
178
+ ### 🎯 **NEW INTERACTIVE LOCALE OPTIMIZER** - up to 86% Package Size Reduction
179
+ - **Package Size**: 830.4KB β†’ 115.3KB (86% reduction for English only)
180
+ - **Smart Management**: Interactive selection with automatic backups
181
+ - **Zero Breaking Changes**: Safe restoration from backups
142
182
 
143
183
  ## πŸ“‹ Project Structure
144
184
 
@@ -159,7 +199,8 @@ your-project/
159
199
 
160
200
  - **Locale files are backed up automatically** before optimization
161
201
  - **Use interactive optimizer** for safe locale management
162
- - **Zero breaking changes** from v1.5.x to v1.6.0
202
+ - **Zero breaking changes** from v1.6.x to v1.7.0
203
+ - **All versions prior to 1.7.0 are deprecated**
163
204
  - **All improvements applied automatically** on update
164
205
 
165
206
  ## πŸ“ž Support
@@ -171,4 +212,53 @@ your-project/
171
212
 
172
213
  ---
173
214
 
174
- **Made for the global development community** ❀️
215
+ **Made for the global development community** ❀️
216
+
217
+ ## Migration Guide
218
+
219
+ ### Upgrading from Deprecated Versions
220
+
221
+ #### From any version < 1.7.0 (DEPRECATED - use latest version)
222
+ 1. **Backup your current configuration**:
223
+ ```bash
224
+ cp -r ./.i18ntk ./.i18ntk-backup-$(date +%Y%m%d)
225
+ ```
226
+
227
+ 2. **Install the latest version**:
228
+ ```bash
229
+ npm install i18ntk@1.7.0
230
+ ```
231
+
232
+ 3. **Verify installation**:
233
+ ```bash
234
+ i18ntk --version
235
+ i18ntk doctor
236
+ ```
237
+
238
+ 3. **Run configuration migration**:
239
+ ```bash
240
+ npx i18ntk@1.6.3 --migrate
241
+ ```
242
+
243
+ 4. **Verify installation**:
244
+ ```bash
245
+ npx i18ntk@1.6.3--validate
246
+ ```
247
+
248
+ #### Preserved Features from 1.6.3
249
+ - βœ… Ultra-extreme performance improvements
250
+ - βœ… Enhanced security with PIN protection
251
+ - βœ… Comprehensive backup & recovery
252
+ - βœ… Edge case handling
253
+ - βœ… Memory optimization
254
+ - βœ… Advanced configuration management
255
+
256
+ #### Breaking Changes
257
+ - **None** - 1.6.3 is fully backward compatible
258
+
259
+ ### Migration Support
260
+ If you encounter issues during migration:
261
+ 1. Check the [troubleshooting guide](docs/TROUBLESHOOTING.md)
262
+ 2. Open an issue on [GitHub](https://github.com/vladnoskv/i18ntk/issues)
263
+ 3. Join our [Discord community](https://discord.gg/i18ntk)
264
+