i18ntk 1.6.3 โ†’ 1.7.1

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 (43) hide show
  1. package/README.md +76 -65
  2. package/main/i18ntk-analyze.js +736 -735
  3. package/main/i18ntk-autorun.js +8 -21
  4. package/main/i18ntk-complete.js +54 -65
  5. package/main/i18ntk-init.js +144 -189
  6. package/main/i18ntk-manage.js +387 -237
  7. package/main/i18ntk-settings.js +13 -0
  8. package/main/i18ntk-sizing.js +56 -72
  9. package/main/i18ntk-summary.js +997 -1018
  10. package/main/i18ntk-ui.js +57 -27
  11. package/main/i18ntk-usage.js +156 -161
  12. package/main/i18ntk-validate.js +134 -87
  13. package/package.json +13 -12
  14. package/scripts/admin-auth.test.js +21 -0
  15. package/scripts/build-lite.js +280 -0
  16. package/scripts/locale-optimizer.js +51 -65
  17. package/scripts/security-utils.test.js +49 -0
  18. package/scripts/test-runner.js +1 -0
  19. package/settings/.i18n-admin-config.json +2 -2
  20. package/settings/i18ntk-config.json +4 -5
  21. package/settings/initialization.json +7 -0
  22. package/settings/settings-cli.js +188 -210
  23. package/settings/settings-manager.js +17 -6
  24. package/ui-locales/de.json +6 -0
  25. package/ui-locales/en.json +6 -0
  26. package/ui-locales/es.json +6 -0
  27. package/ui-locales/fr.json +7 -1
  28. package/ui-locales/ja.json +6 -0
  29. package/ui-locales/ru.json +39 -33
  30. package/ui-locales/zh.json +6 -0
  31. package/utils/admin-auth.js +95 -24
  32. package/utils/admin-cli.js +21 -80
  33. package/utils/admin-pin.js +519 -567
  34. package/utils/cli-helper.js +229 -0
  35. package/utils/cli.js +131 -0
  36. package/utils/config-helper.js +70 -10
  37. package/utils/config-manager.js +46 -20
  38. package/utils/config.js +41 -0
  39. package/utils/i18n-helper.js +20 -55
  40. package/utils/promptPin.js +76 -0
  41. package/utils/security-check.js +6 -2
  42. package/utils/security.js +40 -13
  43. package/utils/watch-locales.js +28 -0
package/README.md CHANGED
@@ -2,19 +2,18 @@
2
2
 
3
3
  ![i18ntk Logo](docs/screenshots/i18ntk-logo-public.PNG)
4
4
 
5
- **Version:** 1.6.3
6
- **Last Updated:** 2025-08-09
5
+ **Version:** 1.7.1
6
+ **Last Updated:** 2025-08-10
7
7
  **GitHub Repository:** [vladnoskv/i18ntk](https://github.com/vladnoskv/i18ntk)
8
8
 
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)
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
+ [![Socket Badge](https://socket.dev/api/badge/npm/package/i18ntk/1.7.1)](https://socket.dev/npm/package/i18ntk/overview/1.7.1)
10
11
 
11
12
  **๐Ÿš€ The fastest way to manage translations across any framework or vanilla JavaScript projects**
12
13
 
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.
14
+ **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 translation logic like i18next or Vue i18n.
14
15
 
15
- > **Zero dependencies** | **Works with any framework** | **Enterprise-grade security**
16
-
17
- > **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.
16
+ > **v1.7.1** โ€“ Enhanced security logging, flexible 4-6 digit PIN authentication, configuration stability improvements, and CI/CD silent mode support; maintains 97% speed improvement (**15.38ms** for 200k keys up to 5/M keys per second).
18
17
 
19
18
  ## ๐Ÿš€ Quick Start
20
19
 
@@ -23,11 +22,11 @@
23
22
  npm i i18ntk
24
23
 
25
24
  # Interactive setup
26
- npx i18ntk init
25
+ npx i18ntk
27
26
 
28
27
  # Basic commands
29
28
  i18ntk analyze --source ./src
30
- i18ntk complete --config=extreme
29
+ i18ntk complete --source ./src
31
30
  i18ntk validate --source ./locales
32
31
  ```
33
32
 
@@ -35,18 +34,25 @@ i18ntk validate --source ./locales
35
34
 
36
35
  | Mode | Time (200k keys) | Memory | Package Size |
37
36
  |------|------------------|--------|--------------|
37
+ | **Ultra-Extreme** | **15.38ms** | 1.62MB | 115KB-830KB |
38
38
  | **Extreme** | **38.90ms** | 0.61MB | 115KB-830KB |
39
39
  | Ultra | 336.8ms | 0.64MB | Configurable |
40
40
  | Optimized | 847.9ms | 0.45MB | Full package |
41
41
 
42
42
  ## ๐ŸŽฏ Key Features
43
43
 
44
- - **Ultra Performance**: 97% speed improvement with extreme optimization
44
+ - **Ultra-Extreme Performance**: 97% speed improvement - **15.38ms** for 200k keys
45
+ - **Enhanced Security**: Advanced PIN protection with exponential backoff & AES-256 encryption
46
+ - **Edge Case Handling**: Robust handling of corrupt files, encoding issues, and network failures
45
47
  - **Smart Sizing**: Interactive locale optimizer (up to 86% size reduction)
46
- - **Enterprise Security**: Admin PIN protection & comprehensive validation
48
+ - **Enterprise Backup**: Automated encrypted backups with cloud integration
47
49
  - **Zero Dependencies**: Lightweight, production-ready
48
- - **7 Languages**: English, Spanish, French, German, Japanese, Russian, Chinese
49
- - **Framework Support**: Auto-detects React i18next, Vue i18n, Angular, Next i18next, Nuxt i18n, Svelte i18n
50
+ - **Watch Helper**: Optional `--watch` mode keeps translations synced in real time
51
+ - **Lite Package Framework**: Build an English-only UI locale bundle for minimal footprint
52
+ - **8 Languages**: English, Spanish, French, German, Japanese, Russian, Chinese, and more
53
+ - **Framework Support**: Auto-detects React i18next, Vue i18n, Angular, Next i18next, Nuxt i18next, Svelte i18n
54
+ - **Memory Optimization**: 67% memory reduction with streaming processing
55
+ - **Scalability**: Linear scaling up to 5M keys with ultra-extreme settings
50
56
 
51
57
  ### ๐Ÿ“ธ Screenshots
52
58
 
@@ -68,10 +74,12 @@ i18ntk validate --source ./locales
68
74
  |---------|---------|---------|
69
75
  | `init` | Setup project | `i18ntk init --interactive` |
70
76
  | `analyze` | Find missing translations | `i18ntk analyze --source ./src` |
71
- | `complete` | Generate translations | `i18ntk complete --config=extreme` |
77
+ | `complete` | Generate translations | `i18ntk complete --config=ultra-extreme` |
72
78
  | `validate` | Check translation quality | `i18ntk validate --strict` |
73
79
  | `sync` | Sync across languages | `i18ntk sync --languages en,es,fr` |
74
80
  | `usage` | Analyze usage patterns | `i18ntk usage --format=json` |
81
+ | `doctor` | Diagnose configuration issues | `i18ntk doctor` |
82
+ | `sizing` | Optimize package size | `i18ntk sizing --interactive` |
75
83
 
76
84
  ## ๐Ÿ”ง Configuration
77
85
 
@@ -79,19 +87,45 @@ Configuration is managed through the `settings/i18ntk-config.json` file:
79
87
 
80
88
  ```json
81
89
  {
82
- "version": "1.6.3",
90
+ "version": "1.7.1",
83
91
  "sourceDir": "./locales",
84
92
  "outputDir": "./i18ntk-reports",
85
93
  "defaultLanguage": "en",
86
- "supportedLanguages": ["en", "es", "fr", "de"],
94
+ "supportedLanguages": ["en", "es", "fr", "de", "ja", "ru", "zh"],
87
95
  "performance": {
88
- "mode": "extreme",
89
- "batchSize": 1000,
90
- "concurrency": 16
96
+ "mode": "ultra-extreme",
97
+ "batchSize": 2000,
98
+ "concurrency": 32,
99
+ "memoryLimit": "256MB",
100
+ "streaming": true,
101
+ "compression": "brotli"
102
+ },
103
+ "security": {
104
+ "adminPinEnabled": true,
105
+ "sessionTimeout": 30,
106
+ "maxFailedAttempts": 3
107
+ },
108
+ "backup": {
109
+ "enabled": true,
110
+ "retentionDays": 30,
111
+ "maxBackups": 100
91
112
  }
92
113
  }
93
114
  ```
94
115
 
116
+ ### Environment Variables
117
+
118
+ You can override common path settings with environment variables:
119
+
120
+ | Variable | Overrides | Description |
121
+ |----------|-----------|-------------|
122
+ | `I18NTK_PROJECT_ROOT` | `projectRoot` | Base project directory |
123
+ | `I18NTK_SOURCE_DIR` | `sourceDir` | Location of source translation files |
124
+ | `I18NTK_I18N_DIR` | `i18nDir` | Working i18n directory |
125
+ | `I18NTK_OUTPUT_DIR` | `outputDir` | Output directory for generated reports |
126
+
127
+ These values are merged into the loaded configuration at runtime.
128
+
95
129
  ## ๐ŸŒ Language Optimization
96
130
 
97
131
  ```bash
@@ -130,13 +164,21 @@ import { createI18n } from 'vue-i18n';
130
164
  const i18n = createI18n({ locale: 'en', messages: translations });
131
165
  ```
132
166
 
133
-
134
167
  ## ๐Ÿ”’ Security Features
135
168
 
136
- - **Admin PIN Protection**: File role-based access control
137
- - **Input Sanitization**: Path traversal prevention
138
- - **File Validation**: Safe file operations
139
- - **Session Management**: Automatic timeout & cleanup
169
+ - **Admin PIN Protection**: AES-256-GCM encryption with 30-min sessions
170
+ - **Advanced Input Sanitization**: Comprehensive path traversal prevention
171
+ - **Zero-Trust Architecture**: All inputs validated and sanitized
172
+ - **Session Management**: Automatic timeout & cleanup with exponential backoff
173
+ - **File Validation**: Safe file operations with permission checks
174
+ - **Edge Case Security**: Robust handling of security edge cases
175
+ - **Encrypted Backups**: AES-256 encrypted backup storage
176
+
177
+ ### ๐ŸŽฏ **NEW INTERACTIVE LOCALE OPTIMIZER** - up to 86% Package Size Reduction
178
+
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
140
182
 
141
183
  ## ๐Ÿ“‹ Project Structure
142
184
 
@@ -157,44 +199,10 @@ your-project/
157
199
 
158
200
  - **Locale files are backed up automatically** before optimization
159
201
  - **Use interactive optimizer** for safe locale management
160
- - **Zero breaking changes** from v1.5.x to v1.6.3
202
+ - **Zero breaking changes** from v1.6.x to v1.7.1
203
+ - **All versions prior to 1.7.1 are deprecated**
161
204
  - **All improvements applied automatically** on update
162
205
 
163
- ## ๐Ÿ“ž Support
164
-
165
- - **Issues**: [GitHub Issues](https://github.com/vladnoskv/i18ntk/issues)
166
- - **Documentation**: [Complete docs](./docs)
167
- - **Performance**: [Benchmark results](./benchmarks/results)
168
- - **Version**: `i18ntk --version`
169
-
170
- ---
171
-
172
- **Made for the global development community** โค๏ธ
173
-
174
- ## Migration Guide
175
-
176
- ### Upgrading from Deprecated Versions
177
-
178
- #### From any version < 1.6.3 (DEPRECATED - use latest version)
179
- 1. **Backup your current configuration**:
180
- ```bash
181
- cp -r ./.i18ntk ./.i18ntk-backup-$(date +%Y%m%d)
182
- ```
183
-
184
- 2. **Install the latest version**:
185
- ```bash
186
- npm install i18ntk@1.6.3
187
- ```
188
-
189
- 3. **Run configuration migration**:
190
- ```bash
191
- npx i18ntk@1.6.3 --migrate
192
- ```
193
-
194
- 4. **Verify installation**:
195
- ```bash
196
- npx i18ntk@1.6.3--validate
197
- ```
198
206
 
199
207
  #### Preserved Features from 1.6.3
200
208
  - โœ… Ultra-extreme performance improvements
@@ -207,9 +215,12 @@ your-project/
207
215
  #### Breaking Changes
208
216
  - **None** - 1.6.3 is fully backward compatible
209
217
 
210
- ### Migration Support
211
- If you encounter issues during migration:
212
- 1. Check the [troubleshooting guide](docs/TROUBLESHOOTING.md)
213
- 2. Open an issue on [GitHub](https://github.com/vladnoskv/i18ntk/issues)
214
- 3. Join our [Discord community](https://discord.gg/i18ntk)
218
+ ## ๐Ÿ“ž Support
219
+
220
+ - **Issues**: [GitHub Issues](https://github.com/vladnoskv/i18ntk/issues)
221
+ - **Documentation**: [Complete docs](./docs)
222
+ - **Performance**: [Benchmark results](./benchmarks/results)
223
+ - **Version**: `i18ntk --version`
224
+ ---
215
225
 
226
+ **Made for the global development community** โค๏ธ