i18ntk 1.0.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 +401 -0
- package/LICENSE +21 -0
- package/README.md +507 -0
- package/dev/README.md +37 -0
- package/dev/debug/README.md +30 -0
- package/dev/debug/complete-console-translations.js +295 -0
- package/dev/debug/console-key-checker.js +408 -0
- package/dev/debug/console-translations.js +335 -0
- package/dev/debug/debugger.js +408 -0
- package/dev/debug/export-missing-keys.js +432 -0
- package/dev/debug/final-normalize.js +236 -0
- package/dev/debug/find-extra-keys.js +68 -0
- package/dev/debug/normalize-locales.js +153 -0
- package/dev/debug/refactor-locales.js +240 -0
- package/dev/debug/reorder-locales.js +85 -0
- package/dev/debug/replace-hardcoded-console.js +378 -0
- package/docs/INSTALLATION.md +449 -0
- package/docs/README.md +222 -0
- package/docs/TODO_ROADMAP.md +279 -0
- package/docs/api/API_REFERENCE.md +377 -0
- package/docs/api/COMPONENTS.md +492 -0
- package/docs/api/CONFIGURATION.md +651 -0
- package/docs/api/NPM_PUBLISHING_GUIDE.md +434 -0
- package/docs/debug/DEBUG_README.md +30 -0
- package/docs/debug/DEBUG_TOOLS.md +494 -0
- package/docs/development/AGENTS.md +351 -0
- package/docs/development/DEVELOPMENT_RULES.md +165 -0
- package/docs/development/DEV_README.md +37 -0
- package/docs/release-notes/RELEASE_NOTES_v1.0.0.md +173 -0
- package/docs/release-notes/RELEASE_NOTES_v1.6.0.md +141 -0
- package/docs/release-notes/RELEASE_NOTES_v1.6.1.md +185 -0
- package/docs/release-notes/RELEASE_NOTES_v1.6.3.md +199 -0
- package/docs/reports/ANALYSIS_README.md +17 -0
- package/docs/reports/CONSOLE_MISMATCH_BUG_REPORT_v1.5.0.md +181 -0
- package/docs/reports/SIZING_README.md +18 -0
- package/docs/reports/SUMMARY_README.md +18 -0
- package/docs/reports/TRANSLATION_BUG_REPORT_v1.5.0.md +129 -0
- package/docs/reports/USAGE_README.md +18 -0
- package/docs/reports/VALIDATION_README.md +18 -0
- package/locales/de/auth.json +3 -0
- package/locales/de/common.json +16 -0
- package/locales/de/pagination.json +6 -0
- package/locales/en/auth.json +3 -0
- package/locales/en/common.json +16 -0
- package/locales/en/pagination.json +6 -0
- package/locales/es/auth.json +3 -0
- package/locales/es/common.json +16 -0
- package/locales/es/pagination.json +6 -0
- package/locales/fr/auth.json +3 -0
- package/locales/fr/common.json +16 -0
- package/locales/fr/pagination.json +6 -0
- package/locales/ru/auth.json +3 -0
- package/locales/ru/common.json +16 -0
- package/locales/ru/pagination.json +6 -0
- package/main/i18ntk-analyze.js +625 -0
- package/main/i18ntk-autorun.js +461 -0
- package/main/i18ntk-complete.js +494 -0
- package/main/i18ntk-init.js +686 -0
- package/main/i18ntk-manage.js +848 -0
- package/main/i18ntk-sizing.js +557 -0
- package/main/i18ntk-summary.js +671 -0
- package/main/i18ntk-usage.js +1282 -0
- package/main/i18ntk-validate.js +762 -0
- package/main/ui-i18n.js +332 -0
- package/package.json +152 -0
- package/scripts/fix-missing-translation-keys.js +214 -0
- package/scripts/verify-package.js +168 -0
- package/ui-locales/de.json +637 -0
- package/ui-locales/en.json +688 -0
- package/ui-locales/es.json +637 -0
- package/ui-locales/fr.json +637 -0
- package/ui-locales/ja.json +637 -0
- package/ui-locales/ru.json +637 -0
- package/ui-locales/zh.json +637 -0
- package/utils/admin-auth.js +317 -0
- package/utils/admin-cli.js +353 -0
- package/utils/admin-pin.js +409 -0
- package/utils/detect-language-mismatches.js +454 -0
- package/utils/i18n-helper.js +128 -0
- package/utils/maintain-language-purity.js +433 -0
- package/utils/native-translations.js +478 -0
- package/utils/security.js +384 -0
- package/utils/test-complete-system.js +356 -0
- package/utils/test-console-i18n.js +402 -0
- package/utils/translate-mismatches.js +571 -0
- package/utils/validate-language-purity.js +531 -0
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Verify Package Script
|
|
4
|
+
*
|
|
5
|
+
* This script verifies the package structure and configuration before publishing to npm.
|
|
6
|
+
* It checks for required files, correct version numbers, and proper configuration.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const fs = require('fs');
|
|
10
|
+
const path = require('path');
|
|
11
|
+
const { execSync } = require('child_process');
|
|
12
|
+
|
|
13
|
+
const rootDir = path.resolve(__dirname, '..');
|
|
14
|
+
const packageJsonPath = path.join(rootDir, 'package.json');
|
|
15
|
+
const changelogPath = path.join(rootDir, 'CHANGELOG.md');
|
|
16
|
+
const readmePath = path.join(rootDir, 'README.md');
|
|
17
|
+
const npmignorePath = path.join(rootDir, '.npmignore');
|
|
18
|
+
|
|
19
|
+
// Check if required files exist
|
|
20
|
+
const requiredFiles = [
|
|
21
|
+
{ path: packageJsonPath, name: 'package.json' },
|
|
22
|
+
{ path: changelogPath, name: 'CHANGELOG.md' },
|
|
23
|
+
{ path: readmePath, name: 'README.md' },
|
|
24
|
+
{ path: npmignorePath, name: '.npmignore' },
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
console.log('š Verifying package structure...');
|
|
28
|
+
|
|
29
|
+
// Check required files
|
|
30
|
+
let missingFiles = false;
|
|
31
|
+
requiredFiles.forEach(file => {
|
|
32
|
+
if (!fs.existsSync(file.path)) {
|
|
33
|
+
console.error(`ā Missing required file: ${file.name}`);
|
|
34
|
+
missingFiles = true;
|
|
35
|
+
} else {
|
|
36
|
+
console.log(`ā
Found required file: ${file.name}`);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
if (missingFiles) {
|
|
41
|
+
console.error('ā Some required files are missing. Please create them before publishing.');
|
|
42
|
+
process.exit(1);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Read package.json
|
|
46
|
+
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
|
|
47
|
+
const version = packageJson.version;
|
|
48
|
+
|
|
49
|
+
// Read CHANGELOG.md
|
|
50
|
+
const changelog = fs.readFileSync(changelogPath, 'utf8');
|
|
51
|
+
|
|
52
|
+
// Read README.md
|
|
53
|
+
const readme = fs.readFileSync(readmePath, 'utf8');
|
|
54
|
+
|
|
55
|
+
// Check version consistency
|
|
56
|
+
console.log('š Checking version consistency...');
|
|
57
|
+
|
|
58
|
+
// Check if version in package.json matches version in CHANGELOG.md
|
|
59
|
+
if (!changelog.includes(`**Current Version:** ${version}`)) {
|
|
60
|
+
console.error(`ā Version mismatch: package.json (${version}) does not match CHANGELOG.md`);
|
|
61
|
+
process.exit(1);
|
|
62
|
+
} else {
|
|
63
|
+
console.log(`ā
Version in CHANGELOG.md matches package.json: ${version}`);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// Check if version in package.json matches version in README.md
|
|
67
|
+
if (!readme.includes(`**Version:** ${version}`)) {
|
|
68
|
+
console.error(`ā Version mismatch: package.json (${version}) does not match README.md`);
|
|
69
|
+
process.exit(1);
|
|
70
|
+
} else {
|
|
71
|
+
console.log(`ā
Version in README.md matches package.json: ${version}`);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Check if version in package.json matches version in versionInfo
|
|
75
|
+
if (packageJson.versionInfo && packageJson.versionInfo.version !== version) {
|
|
76
|
+
console.error(`ā Version mismatch: package.json (${version}) does not match versionInfo.version (${packageJson.versionInfo.version})`);
|
|
77
|
+
process.exit(1);
|
|
78
|
+
} else {
|
|
79
|
+
console.log(`ā
Version in versionInfo matches package.json: ${version}`);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// Check npm configuration
|
|
83
|
+
console.log('š Checking npm configuration...');
|
|
84
|
+
|
|
85
|
+
// Check if bin field is properly configured
|
|
86
|
+
if (!packageJson.bin || Object.keys(packageJson.bin).length === 0) {
|
|
87
|
+
console.error('ā Missing or empty bin field in package.json');
|
|
88
|
+
process.exit(1);
|
|
89
|
+
} else {
|
|
90
|
+
console.log(`ā
Found bin configuration with ${Object.keys(packageJson.bin).length} commands`);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// Check if main field is properly configured
|
|
94
|
+
if (!packageJson.main) {
|
|
95
|
+
console.error('ā Missing main field in package.json');
|
|
96
|
+
process.exit(1);
|
|
97
|
+
} else {
|
|
98
|
+
console.log(`ā
Found main field: ${packageJson.main}`);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// Check if files field is properly configured
|
|
102
|
+
if (!packageJson.files || packageJson.files.length === 0) {
|
|
103
|
+
console.error('ā Missing or empty files field in package.json');
|
|
104
|
+
process.exit(1);
|
|
105
|
+
} else {
|
|
106
|
+
console.log(`ā
Found files configuration with ${packageJson.files.length} entries`);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// Check if scripts field is properly configured
|
|
110
|
+
if (!packageJson.scripts || Object.keys(packageJson.scripts).length === 0) {
|
|
111
|
+
console.error('ā Missing or empty scripts field in package.json');
|
|
112
|
+
process.exit(1);
|
|
113
|
+
} else {
|
|
114
|
+
console.log(`ā
Found scripts configuration with ${Object.keys(packageJson.scripts).length} entries`);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// Check if keywords field is properly configured
|
|
118
|
+
if (!packageJson.keywords || packageJson.keywords.length === 0) {
|
|
119
|
+
console.error('ā Missing or empty keywords field in package.json');
|
|
120
|
+
process.exit(1);
|
|
121
|
+
} else {
|
|
122
|
+
console.log(`ā
Found keywords configuration with ${packageJson.keywords.length} entries`);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// Check if author field is properly configured
|
|
126
|
+
if (!packageJson.author) {
|
|
127
|
+
console.error('ā Missing author field in package.json');
|
|
128
|
+
process.exit(1);
|
|
129
|
+
} else {
|
|
130
|
+
console.log(`ā
Found author configuration`);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// Check if license field is properly configured
|
|
134
|
+
if (!packageJson.license) {
|
|
135
|
+
console.error('ā Missing license field in package.json');
|
|
136
|
+
process.exit(1);
|
|
137
|
+
} else {
|
|
138
|
+
console.log(`ā
Found license configuration: ${packageJson.license}`);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// Check if repository field is properly configured
|
|
142
|
+
if (!packageJson.repository) {
|
|
143
|
+
console.error('ā Missing repository field in package.json');
|
|
144
|
+
process.exit(1);
|
|
145
|
+
} else {
|
|
146
|
+
console.log(`ā
Found repository configuration`);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// Check if engines field is properly configured
|
|
150
|
+
if (!packageJson.engines || !packageJson.engines.node) {
|
|
151
|
+
console.error('ā Missing engines.node field in package.json');
|
|
152
|
+
process.exit(1);
|
|
153
|
+
} else {
|
|
154
|
+
console.log(`ā
Found engines configuration: node ${packageJson.engines.node}`);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// Check if publishConfig field is properly configured
|
|
158
|
+
if (!packageJson.publishConfig || !packageJson.publishConfig.access) {
|
|
159
|
+
console.error('ā Missing publishConfig.access field in package.json');
|
|
160
|
+
process.exit(1);
|
|
161
|
+
} else {
|
|
162
|
+
console.log(`ā
Found publishConfig configuration: access ${packageJson.publishConfig.access}`);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
console.log('\nā
Package verification completed successfully!');
|
|
166
|
+
console.log(`\nš¦ Ready to publish version ${version} to npm!`);
|
|
167
|
+
console.log('\nRun the following command to publish:');
|
|
168
|
+
console.log('\n npm publish\n');
|