i18ntk 1.10.2 → 2.0.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/LICENSE +1 -1
- package/README.md +141 -1191
- package/main/i18ntk-analyze.js +65 -84
- package/main/i18ntk-backup-class.js +420 -0
- package/main/i18ntk-backup.js +3 -3
- package/main/i18ntk-complete.js +90 -65
- package/main/i18ntk-doctor.js +123 -103
- package/main/i18ntk-fixer.js +61 -725
- package/main/i18ntk-go.js +14 -15
- package/main/i18ntk-init.js +77 -26
- package/main/i18ntk-java.js +27 -32
- package/main/i18ntk-js.js +70 -68
- package/main/i18ntk-manage.js +129 -30
- package/main/i18ntk-php.js +75 -75
- package/main/i18ntk-py.js +55 -56
- package/main/i18ntk-scanner.js +59 -57
- package/main/i18ntk-setup.js +9 -404
- package/main/i18ntk-sizing.js +6 -6
- package/main/i18ntk-summary.js +21 -18
- package/main/i18ntk-ui.js +11 -10
- package/main/i18ntk-usage.js +54 -18
- package/main/i18ntk-validate.js +13 -13
- package/main/manage/commands/AnalyzeCommand.js +1124 -0
- package/main/manage/commands/BackupCommand.js +62 -0
- package/main/manage/commands/CommandRouter.js +295 -0
- package/main/manage/commands/CompleteCommand.js +61 -0
- package/main/manage/commands/DoctorCommand.js +60 -0
- package/main/manage/commands/FixerCommand.js +624 -0
- package/main/manage/commands/InitCommand.js +62 -0
- package/main/manage/commands/ScannerCommand.js +654 -0
- package/main/manage/commands/SizingCommand.js +60 -0
- package/main/manage/commands/SummaryCommand.js +61 -0
- package/main/manage/commands/UsageCommand.js +60 -0
- package/main/manage/commands/ValidateCommand.js +978 -0
- package/main/manage/index-fixed.js +1447 -0
- package/main/manage/index.js +1462 -0
- package/main/manage/managers/DebugMenu.js +140 -0
- package/main/manage/managers/InteractiveMenu.js +177 -0
- package/main/manage/managers/LanguageMenu.js +62 -0
- package/main/manage/managers/SettingsMenu.js +53 -0
- package/main/manage/services/AuthenticationService.js +263 -0
- package/main/manage/services/ConfigurationService-fixed.js +449 -0
- package/main/manage/services/ConfigurationService.js +449 -0
- package/main/manage/services/FileManagementService.js +368 -0
- package/main/manage/services/FrameworkDetectionService.js +458 -0
- package/main/manage/services/InitService.js +1051 -0
- package/main/manage/services/SetupService.js +462 -0
- package/main/manage/services/SummaryService.js +450 -0
- package/main/manage/services/UsageService.js +1502 -0
- package/package.json +32 -29
- package/runtime/enhanced.d.ts +221 -221
- package/runtime/index.d.ts +29 -29
- package/runtime/index.full.d.ts +331 -331
- package/runtime/index.js +7 -6
- package/scripts/build-lite.js +17 -17
- package/scripts/deprecate-versions.js +23 -6
- package/scripts/export-translations.js +5 -5
- package/scripts/fix-all-i18n.js +3 -3
- package/scripts/fix-and-purify-i18n.js +3 -2
- package/scripts/fix-locale-control-chars.js +110 -0
- package/scripts/lint-locales.js +80 -0
- package/scripts/locale-optimizer.js +8 -8
- package/scripts/prepublish.js +21 -21
- package/scripts/security-check.js +117 -117
- package/scripts/sync-translations.js +4 -4
- package/scripts/sync-ui-locales.js +9 -8
- package/scripts/validate-all-translations.js +8 -7
- package/scripts/verify-deprecations.js +157 -161
- package/scripts/verify-translations.js +6 -5
- package/settings/i18ntk-config.json +282 -282
- package/settings/language-config.json +5 -5
- package/settings/settings-cli.js +9 -9
- package/settings/settings-manager.js +18 -18
- package/ui-locales/de.json +2417 -2348
- package/ui-locales/en.json +2415 -2352
- package/ui-locales/es.json +2425 -2353
- package/ui-locales/fr.json +2418 -2348
- package/ui-locales/ja.json +2463 -2361
- package/ui-locales/ru.json +2463 -2359
- package/ui-locales/zh.json +2418 -2351
- package/utils/admin-auth.js +2 -2
- package/utils/admin-cli.js +297 -297
- package/utils/admin-pin.js +9 -9
- package/utils/cli-helper.js +9 -9
- package/utils/config-helper.js +73 -104
- package/utils/config-manager.js +204 -171
- package/utils/config.js +5 -4
- package/utils/env-manager.js +249 -263
- package/utils/framework-detector.js +27 -24
- package/utils/i18n-helper.js +85 -41
- package/utils/init-helper.js +152 -94
- package/utils/json-output.js +98 -98
- package/utils/mini-commander.js +179 -0
- package/utils/missing-key-validator.js +5 -5
- package/utils/plugin-loader.js +40 -29
- package/utils/prompt.js +14 -44
- package/utils/safe-json.js +40 -0
- package/utils/secure-errors.js +3 -3
- package/utils/security-check-improved.js +390 -0
- package/utils/security-config.js +5 -5
- package/utils/security-fixed.js +607 -0
- package/utils/security.js +652 -602
- package/utils/setup-enforcer.js +136 -44
- package/utils/setup-validator.js +33 -32
- package/utils/ultra-performance-optimizer.js +11 -9
- package/utils/watch-locales.js +2 -1
- package/utils/prompt-fixed.js +0 -55
- package/utils/security-check.js +0 -454
|
@@ -1,161 +1,157 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* i18ntk Deprecation Verification Script
|
|
5
|
-
*
|
|
6
|
-
* This script verifies that versions have been properly deprecated
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
console.log('
|
|
18
|
-
console.log(
|
|
19
|
-
console.log(
|
|
20
|
-
console.log(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
console.log(
|
|
82
|
-
console.log(
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
// Run verification
|
|
161
|
-
verifyDeprecations();
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* i18ntk Deprecation Verification Script
|
|
5
|
+
*
|
|
6
|
+
* This script verifies that versions have been properly deprecated
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const fs = require('fs');
|
|
10
|
+
const path = require('path');
|
|
11
|
+
|
|
12
|
+
// Read package.json to get deprecation list
|
|
13
|
+
const packageJsonPath = path.join(__dirname, '..', 'package.json');
|
|
14
|
+
const packageJson = JSON.parse(SecurityUtils.safeReadFileSync(packageJsonPath, path.dirname(packageJsonPath), 'utf8'));
|
|
15
|
+
|
|
16
|
+
console.log('🔍 i18ntk Deprecation Verification');
|
|
17
|
+
console.log('=====================================');
|
|
18
|
+
console.log(`📦 Package: ${packageJson.name}`);
|
|
19
|
+
console.log(`🎯 Current Version: ${packageJson.version}`);
|
|
20
|
+
console.log('=====================================\n');
|
|
21
|
+
|
|
22
|
+
// Get deprecation info for all versions
|
|
23
|
+
async function getDeprecationInfo() {
|
|
24
|
+
try {
|
|
25
|
+
// Deprecation information is no longer fetched from npmjs.org
|
|
26
|
+
// This script now relies on local deprecation-config.json if available.
|
|
27
|
+
const deprecationConfigPath = path.join(__dirname, '..', 'deprecation-config.json');
|
|
28
|
+
let packageInfo = { versions: {} };
|
|
29
|
+
|
|
30
|
+
if (SecurityUtils.safeExistsSync(deprecationConfigPath)) {
|
|
31
|
+
packageInfo = JSON.parse(SecurityUtils.safeReadFileSync(deprecationConfigPath, path.dirname(deprecationConfigPath), 'utf8'));
|
|
32
|
+
} else {
|
|
33
|
+
console.warn('⚠️ deprecation-config.json not found. Cannot verify deprecations locally.');
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (packageInfo.versions) {
|
|
38
|
+
const deprecatedVersions = [];
|
|
39
|
+
const activeVersions = [];
|
|
40
|
+
|
|
41
|
+
// Check each version for deprecation
|
|
42
|
+
for (const version of Object.keys(packageInfo.versions)) {
|
|
43
|
+
const versionInfo = packageInfo.versions[version];
|
|
44
|
+
if (versionInfo.deprecated) {
|
|
45
|
+
deprecatedVersions.push({
|
|
46
|
+
version,
|
|
47
|
+
reason: versionInfo.deprecated
|
|
48
|
+
});
|
|
49
|
+
} else {
|
|
50
|
+
activeVersions.push(version);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return { deprecatedVersions, activeVersions };
|
|
55
|
+
}
|
|
56
|
+
} catch (error) {
|
|
57
|
+
console.error('❌ Failed to get deprecation info:', error.message);
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Main verification process
|
|
63
|
+
async function verifyDeprecations() {
|
|
64
|
+
console.log('📊 Checking deprecation status...\n');
|
|
65
|
+
|
|
66
|
+
const deprecationInfo = await getDeprecationInfo();
|
|
67
|
+
|
|
68
|
+
if (!deprecationInfo) {
|
|
69
|
+
console.log('❌ Could not retrieve deprecation information');
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const { deprecatedVersions, activeVersions } = deprecationInfo;
|
|
74
|
+
const currentVersion = packageJson.version;
|
|
75
|
+
const deprecationList = packageJson.versionInfo.deprecations;
|
|
76
|
+
|
|
77
|
+
console.log(`📈 Total Published Versions: ${deprecatedVersions.length + activeVersions.length}`);
|
|
78
|
+
console.log(`✅ Deprecated Versions: ${deprecatedVersions.length}`);
|
|
79
|
+
console.log(`🔄 Active Versions: ${activeVersions.length}`);
|
|
80
|
+
console.log(`🎯 Current Version: ${currentVersion}`);
|
|
81
|
+
console.log(`📋 Expected Deprecations: ${deprecationList.length}`);
|
|
82
|
+
console.log('');
|
|
83
|
+
|
|
84
|
+
// Check if current version is active
|
|
85
|
+
const currentVersionActive = activeVersions.includes(currentVersion);
|
|
86
|
+
if (currentVersionActive) {
|
|
87
|
+
console.log(`✅ Current version ${currentVersion} is active (correct)`);
|
|
88
|
+
} else {
|
|
89
|
+
console.log(`❌ Current version ${currentVersion} is not active (problem)`);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// Check deprecated versions
|
|
93
|
+
console.log('\n📋 Deprecated Versions:');
|
|
94
|
+
if (deprecatedVersions.length > 0) {
|
|
95
|
+
deprecatedVersions.forEach(({ version, reason }) => {
|
|
96
|
+
console.log(` ❌ ${version}: ${reason}`);
|
|
97
|
+
});
|
|
98
|
+
} else {
|
|
99
|
+
console.log(' (None)');
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// Check active versions (should only be current version)
|
|
103
|
+
console.log('\n🔄 Active Versions:');
|
|
104
|
+
if (activeVersions.length > 0) {
|
|
105
|
+
activeVersions.forEach(version => {
|
|
106
|
+
if (version === currentVersion) {
|
|
107
|
+
console.log(` ✅ ${version} (current version - correct)`);
|
|
108
|
+
} else {
|
|
109
|
+
console.log(` ⚠️ ${version} (should be deprecated)`);
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
} else {
|
|
113
|
+
console.log(' (None)');
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// Summary
|
|
117
|
+
console.log('\n=====================================');
|
|
118
|
+
console.log('🎯 Verification Summary');
|
|
119
|
+
console.log('=====================================');
|
|
120
|
+
|
|
121
|
+
const expectedDeprecated = deprecationList.length;
|
|
122
|
+
const actualDeprecated = deprecatedVersions.length;
|
|
123
|
+
const successRate = expectedDeprecated > 0 ? (actualDeprecated / expectedDeprecated * 100).toFixed(1) : 0;
|
|
124
|
+
|
|
125
|
+
console.log(`📊 Expected deprecated: ${expectedDeprecated}`);
|
|
126
|
+
console.log(`📊 Actually deprecated: ${actualDeprecated}`);
|
|
127
|
+
console.log(`📊 Success rate: ${successRate}%`);
|
|
128
|
+
|
|
129
|
+
if (activeVersions.length === 1 && activeVersions[0] === currentVersion) {
|
|
130
|
+
console.log('✅ Status: All previous versions deprecated, current version active');
|
|
131
|
+
} else {
|
|
132
|
+
console.log('⚠️ Status: Some versions may still need deprecation');
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
console.log('=====================================');
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// Handle command line arguments
|
|
139
|
+
const args = process.argv.slice(2);
|
|
140
|
+
if (args.includes('--help') || args.includes('-h')) {
|
|
141
|
+
console.log(`
|
|
142
|
+
i18ntk Deprecation Verification Script
|
|
143
|
+
|
|
144
|
+
Usage:
|
|
145
|
+
node scripts/verify-deprecations.js [options]
|
|
146
|
+
|
|
147
|
+
Description:
|
|
148
|
+
This script verifies that i18ntk versions have been properly deprecated.
|
|
149
|
+
|
|
150
|
+
Examples:
|
|
151
|
+
node scripts/verify-deprecations.js
|
|
152
|
+
`);
|
|
153
|
+
process.exit(0);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// Run verification
|
|
157
|
+
verifyDeprecations();
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const path = require('path');
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const SecurityUtils = require('../utils/security');
|
|
3
4
|
|
|
4
5
|
// Load all language files
|
|
5
|
-
const localesPath = path.join(__dirname, '../ui-locales');
|
|
6
|
+
const localesPath = path.join(__dirname, '../resources/i18n/ui-locales');
|
|
6
7
|
const files = fs.readdirSync(localesPath).filter(file => file.endsWith('.json') && file !== 'en.json');
|
|
7
8
|
|
|
8
9
|
// Load English as the base for comparison
|
|
9
|
-
const enContent = JSON.parse(
|
|
10
|
+
const enContent = JSON.parse(SecurityUtils.safeReadFileSync(path.join(localesPath, 'en.json'), localesPath, 'utf8'));
|
|
10
11
|
|
|
11
12
|
// Function to get all keys from an object
|
|
12
13
|
function getAllKeys(obj, prefix = '') {
|
|
@@ -28,7 +29,7 @@ console.log('\n🔍 Verifying translation keys across all language files...\n');
|
|
|
28
29
|
files.forEach(file => {
|
|
29
30
|
const langCode = path.basename(file, '.json');
|
|
30
31
|
const filePath = path.join(localesPath, file);
|
|
31
|
-
const content = JSON.parse(
|
|
32
|
+
const content = JSON.parse(SecurityUtils.safeReadFileSync(filePath, localesPath, 'utf8'));
|
|
32
33
|
const langKeys = new Set(getAllKeys(content));
|
|
33
34
|
|
|
34
35
|
// Find missing keys
|