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.
Files changed (86) hide show
  1. package/CHANGELOG.md +401 -0
  2. package/LICENSE +21 -0
  3. package/README.md +507 -0
  4. package/dev/README.md +37 -0
  5. package/dev/debug/README.md +30 -0
  6. package/dev/debug/complete-console-translations.js +295 -0
  7. package/dev/debug/console-key-checker.js +408 -0
  8. package/dev/debug/console-translations.js +335 -0
  9. package/dev/debug/debugger.js +408 -0
  10. package/dev/debug/export-missing-keys.js +432 -0
  11. package/dev/debug/final-normalize.js +236 -0
  12. package/dev/debug/find-extra-keys.js +68 -0
  13. package/dev/debug/normalize-locales.js +153 -0
  14. package/dev/debug/refactor-locales.js +240 -0
  15. package/dev/debug/reorder-locales.js +85 -0
  16. package/dev/debug/replace-hardcoded-console.js +378 -0
  17. package/docs/INSTALLATION.md +449 -0
  18. package/docs/README.md +222 -0
  19. package/docs/TODO_ROADMAP.md +279 -0
  20. package/docs/api/API_REFERENCE.md +377 -0
  21. package/docs/api/COMPONENTS.md +492 -0
  22. package/docs/api/CONFIGURATION.md +651 -0
  23. package/docs/api/NPM_PUBLISHING_GUIDE.md +434 -0
  24. package/docs/debug/DEBUG_README.md +30 -0
  25. package/docs/debug/DEBUG_TOOLS.md +494 -0
  26. package/docs/development/AGENTS.md +351 -0
  27. package/docs/development/DEVELOPMENT_RULES.md +165 -0
  28. package/docs/development/DEV_README.md +37 -0
  29. package/docs/release-notes/RELEASE_NOTES_v1.0.0.md +173 -0
  30. package/docs/release-notes/RELEASE_NOTES_v1.6.0.md +141 -0
  31. package/docs/release-notes/RELEASE_NOTES_v1.6.1.md +185 -0
  32. package/docs/release-notes/RELEASE_NOTES_v1.6.3.md +199 -0
  33. package/docs/reports/ANALYSIS_README.md +17 -0
  34. package/docs/reports/CONSOLE_MISMATCH_BUG_REPORT_v1.5.0.md +181 -0
  35. package/docs/reports/SIZING_README.md +18 -0
  36. package/docs/reports/SUMMARY_README.md +18 -0
  37. package/docs/reports/TRANSLATION_BUG_REPORT_v1.5.0.md +129 -0
  38. package/docs/reports/USAGE_README.md +18 -0
  39. package/docs/reports/VALIDATION_README.md +18 -0
  40. package/locales/de/auth.json +3 -0
  41. package/locales/de/common.json +16 -0
  42. package/locales/de/pagination.json +6 -0
  43. package/locales/en/auth.json +3 -0
  44. package/locales/en/common.json +16 -0
  45. package/locales/en/pagination.json +6 -0
  46. package/locales/es/auth.json +3 -0
  47. package/locales/es/common.json +16 -0
  48. package/locales/es/pagination.json +6 -0
  49. package/locales/fr/auth.json +3 -0
  50. package/locales/fr/common.json +16 -0
  51. package/locales/fr/pagination.json +6 -0
  52. package/locales/ru/auth.json +3 -0
  53. package/locales/ru/common.json +16 -0
  54. package/locales/ru/pagination.json +6 -0
  55. package/main/i18ntk-analyze.js +625 -0
  56. package/main/i18ntk-autorun.js +461 -0
  57. package/main/i18ntk-complete.js +494 -0
  58. package/main/i18ntk-init.js +686 -0
  59. package/main/i18ntk-manage.js +848 -0
  60. package/main/i18ntk-sizing.js +557 -0
  61. package/main/i18ntk-summary.js +671 -0
  62. package/main/i18ntk-usage.js +1282 -0
  63. package/main/i18ntk-validate.js +762 -0
  64. package/main/ui-i18n.js +332 -0
  65. package/package.json +152 -0
  66. package/scripts/fix-missing-translation-keys.js +214 -0
  67. package/scripts/verify-package.js +168 -0
  68. package/ui-locales/de.json +637 -0
  69. package/ui-locales/en.json +688 -0
  70. package/ui-locales/es.json +637 -0
  71. package/ui-locales/fr.json +637 -0
  72. package/ui-locales/ja.json +637 -0
  73. package/ui-locales/ru.json +637 -0
  74. package/ui-locales/zh.json +637 -0
  75. package/utils/admin-auth.js +317 -0
  76. package/utils/admin-cli.js +353 -0
  77. package/utils/admin-pin.js +409 -0
  78. package/utils/detect-language-mismatches.js +454 -0
  79. package/utils/i18n-helper.js +128 -0
  80. package/utils/maintain-language-purity.js +433 -0
  81. package/utils/native-translations.js +478 -0
  82. package/utils/security.js +384 -0
  83. package/utils/test-complete-system.js +356 -0
  84. package/utils/test-console-i18n.js +402 -0
  85. package/utils/translate-mismatches.js +571 -0
  86. 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');