i18nsmith 0.1.8 → 0.2.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 (105) hide show
  1. package/build.mjs +16 -10
  2. package/dist/commands/audit.d.ts +3 -0
  3. package/dist/commands/audit.d.ts.map +1 -0
  4. package/dist/commands/backup.d.ts +6 -0
  5. package/dist/commands/backup.d.ts.map +1 -0
  6. package/dist/commands/check.d.ts +3 -0
  7. package/dist/commands/check.d.ts.map +1 -0
  8. package/dist/commands/config.d.ts +3 -0
  9. package/dist/commands/config.d.ts.map +1 -0
  10. package/dist/commands/debug-patterns.d.ts +3 -0
  11. package/dist/commands/debug-patterns.d.ts.map +1 -0
  12. package/dist/commands/debug-patterns.test.d.ts +2 -0
  13. package/dist/commands/debug-patterns.test.d.ts.map +1 -0
  14. package/dist/commands/diagnose.d.ts +3 -0
  15. package/dist/commands/diagnose.d.ts.map +1 -0
  16. package/dist/commands/init.d.ts +8 -0
  17. package/dist/commands/init.d.ts.map +1 -0
  18. package/dist/commands/init.test.d.ts +2 -0
  19. package/dist/commands/init.test.d.ts.map +1 -0
  20. package/dist/commands/install-hooks.d.ts +3 -0
  21. package/dist/commands/install-hooks.d.ts.map +1 -0
  22. package/dist/commands/preflight.d.ts +7 -0
  23. package/dist/commands/preflight.d.ts.map +1 -0
  24. package/dist/commands/preflight.test.d.ts +5 -0
  25. package/dist/commands/preflight.test.d.ts.map +1 -0
  26. package/dist/commands/rename.d.ts +6 -0
  27. package/dist/commands/rename.d.ts.map +1 -0
  28. package/dist/commands/review.d.ts +4 -0
  29. package/dist/commands/review.d.ts.map +1 -0
  30. package/dist/commands/review.test.d.ts +2 -0
  31. package/dist/commands/review.test.d.ts.map +1 -0
  32. package/dist/commands/scaffold-adapter.d.ts +3 -0
  33. package/dist/commands/scaffold-adapter.d.ts.map +1 -0
  34. package/dist/commands/scaffold-adapter.test.d.ts +2 -0
  35. package/dist/commands/scaffold-adapter.test.d.ts.map +1 -0
  36. package/dist/commands/scan.d.ts +3 -0
  37. package/dist/commands/scan.d.ts.map +1 -0
  38. package/dist/commands/sync-seed.test.d.ts +2 -0
  39. package/dist/commands/sync-seed.test.d.ts.map +1 -0
  40. package/dist/commands/sync.d.ts +3 -0
  41. package/dist/commands/sync.d.ts.map +1 -0
  42. package/dist/commands/transform.d.ts +3 -0
  43. package/dist/commands/transform.d.ts.map +1 -0
  44. package/dist/commands/translate/csv-handler.d.ts +21 -0
  45. package/dist/commands/translate/csv-handler.d.ts.map +1 -0
  46. package/dist/commands/translate/executor.d.ts +31 -0
  47. package/dist/commands/translate/executor.d.ts.map +1 -0
  48. package/dist/commands/translate/index.d.ts +10 -0
  49. package/dist/commands/translate/index.d.ts.map +1 -0
  50. package/dist/commands/translate/reporter.d.ts +29 -0
  51. package/dist/commands/translate/reporter.d.ts.map +1 -0
  52. package/dist/commands/translate/types.d.ts +52 -0
  53. package/dist/commands/translate/types.d.ts.map +1 -0
  54. package/dist/commands/translate.d.ts +7 -0
  55. package/dist/commands/translate.d.ts.map +1 -0
  56. package/dist/commands/translate.test.d.ts +2 -0
  57. package/dist/commands/translate.test.d.ts.map +1 -0
  58. package/dist/e2e.test.d.ts +6 -0
  59. package/dist/e2e.test.d.ts.map +1 -0
  60. package/dist/index.d.ts +4 -0
  61. package/dist/index.d.ts.map +1 -0
  62. package/dist/index.js +1121 -387
  63. package/dist/integration.test.d.ts +6 -0
  64. package/dist/integration.test.d.ts.map +1 -0
  65. package/dist/test-helpers/ensure-cli-built.d.ts +2 -0
  66. package/dist/test-helpers/ensure-cli-built.d.ts.map +1 -0
  67. package/dist/utils/diagnostics-exit.d.ts +12 -0
  68. package/dist/utils/diagnostics-exit.d.ts.map +1 -0
  69. package/dist/utils/diagnostics-exit.test.d.ts +2 -0
  70. package/dist/utils/diagnostics-exit.test.d.ts.map +1 -0
  71. package/dist/utils/diff-utils.d.ts +4 -0
  72. package/dist/utils/diff-utils.d.ts.map +1 -0
  73. package/dist/utils/diff-utils.test.d.ts +2 -0
  74. package/dist/utils/diff-utils.test.d.ts.map +1 -0
  75. package/dist/utils/exit-codes.d.ts +142 -0
  76. package/dist/utils/exit-codes.d.ts.map +1 -0
  77. package/dist/utils/package-manager.d.ts +4 -0
  78. package/dist/utils/package-manager.d.ts.map +1 -0
  79. package/dist/utils/pkg.d.ts +3 -0
  80. package/dist/utils/pkg.d.ts.map +1 -0
  81. package/dist/utils/preview.d.ts +13 -0
  82. package/dist/utils/preview.d.ts.map +1 -0
  83. package/dist/utils/provider-injector.d.ts +36 -0
  84. package/dist/utils/provider-injector.d.ts.map +1 -0
  85. package/dist/utils/provider-injector.test.d.ts +2 -0
  86. package/dist/utils/provider-injector.test.d.ts.map +1 -0
  87. package/dist/utils/scaffold.d.ts +20 -0
  88. package/dist/utils/scaffold.d.ts.map +1 -0
  89. package/package.json +3 -2
  90. package/src/commands/debug-patterns.test.ts +6 -1
  91. package/src/commands/rename.ts +35 -3
  92. package/src/commands/review.test.ts +12 -0
  93. package/src/commands/review.ts +228 -0
  94. package/src/commands/sync-seed.test.ts +9 -3
  95. package/src/commands/sync.ts +104 -10
  96. package/src/commands/transform.ts +31 -4
  97. package/src/commands/translate/index.ts +23 -3
  98. package/src/commands/translate/types.ts +2 -0
  99. package/src/commands/translate.test.ts +9 -3
  100. package/src/e2e.test.ts +3 -11
  101. package/src/index.ts +2 -0
  102. package/src/integration.test.ts +12 -1
  103. package/src/test-helpers/ensure-cli-built.ts +32 -0
  104. package/src/utils/preview.ts +126 -0
  105. package/dist/index.js.map +0 -7
package/build.mjs CHANGED
@@ -1,13 +1,19 @@
1
1
  import * as esbuild from 'esbuild';
2
- import { readFileSync } from 'fs';
2
+ import { execSync } from 'node:child_process';
3
+ import { mkdirSync, readFileSync, rmSync } from 'node:fs';
3
4
 
4
5
  const pkg = JSON.parse(readFileSync('./package.json', 'utf8'));
5
-
6
- // Externalize all runtime dependencies (chalk, commander, etc.)
7
- // Workspace dependencies (@i18nsmith/*) will be moved to devDependencies
8
- // and thus will NOT be in pkg.dependencies, so they will be bundled.
9
6
  const external = Object.keys(pkg.dependencies || {});
10
7
 
8
+ console.log('Cleaning dist/');
9
+ rmSync('dist', { recursive: true, force: true });
10
+ mkdirSync('dist', { recursive: true });
11
+
12
+ console.log('Emitting type declarations via tsc...');
13
+ execSync('pnpm exec tsc -p tsconfig.json --emitDeclarationOnly', {
14
+ stdio: 'inherit',
15
+ });
16
+
11
17
  console.log('Bundling CLI with external dependencies:', external);
12
18
 
13
19
  await esbuild.build({
@@ -15,11 +21,11 @@ await esbuild.build({
15
21
  bundle: true,
16
22
  platform: 'node',
17
23
  format: 'esm',
24
+ target: ['node18'],
18
25
  outfile: 'dist/index.js',
19
26
  external,
20
- banner: {
21
- js: '#!/usr/bin/env node',
22
- },
23
- sourcemap: true,
24
- minify: false, // Keep readable for now, or minify if preferred
27
+ sourcemap: false,
28
+ minify: false,
25
29
  });
30
+
31
+ console.log('CLI bundle built at dist/index.js');
@@ -0,0 +1,3 @@
1
+ import type { Command } from 'commander';
2
+ export declare function registerAudit(program: Command): void;
3
+ //# sourceMappingURL=audit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../src/commands/audit.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA0CzC,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,QA4L7C"}
@@ -0,0 +1,6 @@
1
+ import { Command } from 'commander';
2
+ /**
3
+ * Registers backup-related commands (backup-list, backup-restore)
4
+ */
5
+ export declare function registerBackup(program: Command): void;
6
+ //# sourceMappingURL=backup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"backup.d.ts","sourceRoot":"","sources":["../../src/commands/backup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAuFrD"}
@@ -0,0 +1,3 @@
1
+ import type { Command } from 'commander';
2
+ export declare function registerCheck(program: Command): void;
3
+ //# sourceMappingURL=check.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../src/commands/check.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAiGzC,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,QA0F7C"}
@@ -0,0 +1,3 @@
1
+ import type { Command } from 'commander';
2
+ export declare function registerConfig(program: Command): void;
3
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/commands/config.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA6GzC,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,QAsJ9C"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function registerDebugPatterns(program: Command): void;
3
+ //# sourceMappingURL=debug-patterns.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debug-patterns.d.ts","sourceRoot":"","sources":["../../src/commands/debug-patterns.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA2BpC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,QA+BrD"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=debug-patterns.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debug-patterns.test.d.ts","sourceRoot":"","sources":["../../src/commands/debug-patterns.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ import type { Command } from 'commander';
2
+ export declare function registerDiagnose(program: Command): void;
3
+ //# sourceMappingURL=diagnose.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diagnose.d.ts","sourceRoot":"","sources":["../../src/commands/diagnose.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA+FzC,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,QAqChD"}
@@ -0,0 +1,8 @@
1
+ import { Command } from 'commander';
2
+ /**
3
+ * Parse a comma-separated list of glob patterns, respecting brace expansions.
4
+ * Brace-expanded globs like `src/**\/*.{ts,tsx}` are kept as a single token.
5
+ */
6
+ export declare function parseGlobList(value: string): string[];
7
+ export declare function registerInit(program: Command): void;
8
+ //# sourceMappingURL=init.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AASpC;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAwBrD;AAyJD,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,QA+Q5C"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=init.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.test.d.ts","sourceRoot":"","sources":["../../src/commands/init.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function registerInstallHooks(program: Command): void;
3
+ //# sourceMappingURL=install-hooks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"install-hooks.d.ts","sourceRoot":"","sources":["../../src/commands/install-hooks.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAoCpC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,QA2BpD"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Preflight check command - validates environment before running i18nsmith operations.
3
+ * This is the onboarding wizard that helps users ensure their setup is correct.
4
+ */
5
+ import { Command } from 'commander';
6
+ export declare function registerPreflight(program: Command): void;
7
+ //# sourceMappingURL=preflight.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preflight.d.ts","sourceRoot":"","sources":["../../src/commands/preflight.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA0BpC,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,QAmBjD"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Tests for the preflight onboarding check command
3
+ */
4
+ export {};
5
+ //# sourceMappingURL=preflight.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preflight.test.d.ts","sourceRoot":"","sources":["../../src/commands/preflight.test.ts"],"names":[],"mappings":"AAAA;;GAEG"}
@@ -0,0 +1,6 @@
1
+ import { Command } from 'commander';
2
+ /**
3
+ * Registers rename-related commands (rename-key, rename-keys)
4
+ */
5
+ export declare function registerRename(program: Command): void;
6
+ //# sourceMappingURL=rename.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rename.d.ts","sourceRoot":"","sources":["../../src/commands/rename.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA0BpC;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAsHrD"}
@@ -0,0 +1,4 @@
1
+ import type { Command } from 'commander';
2
+ export declare function literalToRegexPattern(value: string): string;
3
+ export declare function registerReview(program: Command): void;
4
+ //# sourceMappingURL=review.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"review.d.ts","sourceRoot":"","sources":["../../src/commands/review.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAezC,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAG3D;AAyGD,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,QAgG9C"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=review.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"review.test.d.ts","sourceRoot":"","sources":["../../src/commands/review.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function registerScaffoldAdapter(program: Command): void;
3
+ //# sourceMappingURL=scaffold-adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scaffold-adapter.d.ts","sourceRoot":"","sources":["../../src/commands/scaffold-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAgCpC,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,QAkMvD"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=scaffold-adapter.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scaffold-adapter.test.d.ts","sourceRoot":"","sources":["../../src/commands/scaffold-adapter.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ import type { Command } from 'commander';
2
+ export declare function registerScan(program: Command): void;
3
+ //# sourceMappingURL=scan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scan.d.ts","sourceRoot":"","sources":["../../src/commands/scan.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA2CzC,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,QA8E5C"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=sync-seed.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sync-seed.test.d.ts","sourceRoot":"","sources":["../../src/commands/sync-seed.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function registerSync(program: Command): void;
3
+ //# sourceMappingURL=sync.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../src/commands/sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAkEpC,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,QAkU5C"}
@@ -0,0 +1,3 @@
1
+ import type { Command } from 'commander';
2
+ export declare function registerTransform(program: Command): void;
3
+ //# sourceMappingURL=transform.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../src/commands/transform.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAwEzC,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,QAsGjD"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * CSV export/import utilities for translator handoff
3
+ */
4
+ import type { TranslateCommandOptions } from './types.js';
5
+ /**
6
+ * Escape a field for CSV output
7
+ */
8
+ export declare function escapeCsvField(field: string): string;
9
+ /**
10
+ * Parse a CSV line into fields (handles quoted fields with commas and escaped quotes)
11
+ */
12
+ export declare function parseCsvLine(line: string): string[];
13
+ /**
14
+ * Export missing translations to a CSV file for external translation
15
+ */
16
+ export declare function handleCsvExport(options: TranslateCommandOptions): Promise<void>;
17
+ /**
18
+ * Import translations from a CSV file and merge into locale files
19
+ */
20
+ export declare function handleCsvImport(options: TranslateCommandOptions): Promise<void>;
21
+ //# sourceMappingURL=csv-handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"csv-handler.d.ts","sourceRoot":"","sources":["../../../src/commands/translate/csv-handler.ts"],"names":[],"mappings":"AAAA;;GAEG;AAWH,OAAO,KAAK,EAAE,uBAAuB,EAAU,MAAM,YAAY,CAAC;AAElE;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAKpD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAqCnD;AAED;;GAEG;AACH,wBAAsB,eAAe,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC,CA2DrF;AAED;;GAEG;AACH,wBAAsB,eAAe,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC,CAsKrF"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Translation execution logic with retry, batching, and placeholder validation
3
+ */
4
+ import type { PlaceholderValidator, TranslationPlan, TranslationService } from '@i18nsmith/core';
5
+ import { type TranslatorLoadOptions } from '@i18nsmith/translation';
6
+ import type { TranslateLocaleResult } from './types.js';
7
+ export interface ExecuteTranslationsInput {
8
+ plan: TranslationPlan;
9
+ translationService: TranslationService;
10
+ provider: {
11
+ name: string;
12
+ loaderOptions: TranslatorLoadOptions;
13
+ };
14
+ overwrite: boolean;
15
+ skipEmpty: boolean;
16
+ placeholderValidator: PlaceholderValidator;
17
+ strictPlaceholders: boolean;
18
+ }
19
+ export interface ExecuteTranslationsResult {
20
+ results: TranslateLocaleResult[];
21
+ stats: Awaited<ReturnType<TranslationService['flush']>>;
22
+ }
23
+ /**
24
+ * Execute translations for all locales in the plan
25
+ */
26
+ export declare function executeTranslations(input: ExecuteTranslationsInput): Promise<ExecuteTranslationsResult>;
27
+ /**
28
+ * Split an array into chunks of a given size
29
+ */
30
+ export declare function chunkTasks<T>(items: T[], size: number): T[][];
31
+ //# sourceMappingURL=executor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../src/commands/translate/executor.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,KAAK,EAAE,oBAAoB,EAAE,eAAe,EAAE,kBAAkB,EAAyB,MAAM,iBAAiB,CAAC;AACxH,OAAO,EAAmC,KAAK,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AACrG,OAAO,KAAK,EAAE,qBAAqB,EAAoB,MAAM,YAAY,CAAC;AAE1E,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,eAAe,CAAC;IACtB,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,QAAQ,EAAE;QACR,IAAI,EAAE,MAAM,CAAC;QACb,aAAa,EAAE,qBAAqB,CAAC;KACtC,CAAC;IACF,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,oBAAoB,EAAE,oBAAoB,CAAC;IAC3C,kBAAkB,EAAE,OAAO,CAAC;CAC7B;AAED,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,qBAAqB,EAAE,CAAC;IACjC,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;CACzD;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CACvC,KAAK,EAAE,wBAAwB,GAC9B,OAAO,CAAC,yBAAyB,CAAC,CAyCpC;AAoGD;;GAEG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,EAAE,EAAE,CAS7D"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Translate command - fill missing locale entries via translation adapters
3
+ */
4
+ import type { Command } from 'commander';
5
+ export * from './types.js';
6
+ /**
7
+ * Register the translate command
8
+ */
9
+ export declare function registerTranslate(program: Command): void;
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/translate/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAkBzC,cAAc,YAAY,CAAC;AAyD3B;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA0JxD"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Output formatting and reporting utilities for the translate command
3
+ */
4
+ import type { TranslationPlan } from '@i18nsmith/core';
5
+ import { type TranslatorLoadOptions } from '@i18nsmith/translation';
6
+ import type { TranslateSummary, TranslateLocaleResult, TranslateCommandOptions, ProviderSettings } from './types.js';
7
+ /**
8
+ * Emit the translation output (report file, JSON, or console)
9
+ */
10
+ export declare function emitTranslateOutput(summary: TranslateSummary, options: TranslateCommandOptions): Promise<void>;
11
+ /**
12
+ * Print a summary of the translation plan
13
+ */
14
+ export declare function printPlanSummary(plan: TranslationPlan): void;
15
+ /**
16
+ * Print the execution summary after translations are applied
17
+ */
18
+ export declare function printExecutionSummary(results: TranslateLocaleResult[]): void;
19
+ /**
20
+ * Print cost estimation if available
21
+ */
22
+ export declare function maybePrintEstimate(plan: TranslationPlan, provider: ProviderSettings & {
23
+ loaderOptions: TranslatorLoadOptions;
24
+ }): Promise<void>;
25
+ /**
26
+ * Print a generic cost estimate based on common cloud provider rates
27
+ */
28
+ export declare function printGenericEstimate(plan: TranslationPlan): void;
29
+ //# sourceMappingURL=reporter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reporter.d.ts","sourceRoot":"","sources":["../../../src/commands/translate/reporter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAkB,KAAK,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AACpF,OAAO,KAAK,EACV,gBAAgB,EAChB,qBAAqB,EACrB,uBAAuB,EACvB,gBAAgB,EACjB,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,gBAAgB,EACzB,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,IAAI,CAAC,CA2Bf;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,eAAe,GAAG,IAAI,CAqB5D;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,qBAAqB,EAAE,GAAG,IAAI,CAY5E;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,eAAe,EACrB,QAAQ,EAAE,gBAAgB,GAAG;IAAE,aAAa,EAAE,qBAAqB,CAAA;CAAE,GACpE,OAAO,CAAC,IAAI,CAAC,CAuBf;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,eAAe,GAAG,IAAI,CAShE"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Type definitions for the translate command
3
+ */
4
+ import type { TranslationWriteSummary, TranslationPlan } from '@i18nsmith/core';
5
+ import type { TranslationService } from '@i18nsmith/core';
6
+ export interface TranslateCommandOptions {
7
+ config?: string;
8
+ json?: boolean;
9
+ report?: string;
10
+ write?: boolean;
11
+ locales?: string[];
12
+ provider?: string;
13
+ force?: boolean;
14
+ estimate?: boolean;
15
+ skipEmpty?: boolean;
16
+ yes?: boolean;
17
+ strictPlaceholders?: boolean;
18
+ export?: string;
19
+ import?: string;
20
+ previewOutput?: string;
21
+ applyPreview?: string;
22
+ }
23
+ export interface TranslateLocaleResult extends TranslationWriteSummary {
24
+ characters: number;
25
+ placeholderIssues: PlaceholderIssue[];
26
+ }
27
+ export interface PlaceholderIssue {
28
+ key: string;
29
+ locale: string;
30
+ type: 'missing' | 'extra';
31
+ placeholders: string[];
32
+ }
33
+ export interface TranslateSummary {
34
+ provider: string;
35
+ dryRun: boolean;
36
+ plan: TranslationPlan;
37
+ locales: TranslateLocaleResult[];
38
+ localeStats: Awaited<ReturnType<TranslationService['flush']>>;
39
+ totalCharacters: number;
40
+ }
41
+ export interface ProviderSettings {
42
+ name: string;
43
+ options?: Record<string, unknown>;
44
+ }
45
+ export interface CsvRow {
46
+ key: string;
47
+ sourceLocale: string;
48
+ sourceValue: string;
49
+ targetLocale: string;
50
+ targetValue: string;
51
+ }
52
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/commands/translate/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,MAAM,WAAW,uBAAuB;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,qBAAsB,SAAQ,uBAAuB;IACpE,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;CACvC;AAED,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC;IAC1B,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,eAAe,CAAC;IACtB,OAAO,EAAE,qBAAqB,EAAE,CAAC;IACjC,WAAW,EAAE,OAAO,CAAC,UAAU,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC9D,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,MAAM;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;CACrB"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Translate command - re-exports from translate module
3
+ * @deprecated Import from './translate/index.js' instead
4
+ */
5
+ export { registerTranslate } from './translate/index.js';
6
+ export * from './translate/types.js';
7
+ //# sourceMappingURL=translate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"translate.d.ts","sourceRoot":"","sources":["../../src/commands/translate.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,cAAc,sBAAsB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=translate.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"translate.test.d.ts","sourceRoot":"","sources":["../../src/commands/translate.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * E2E Tests using fixture projects
3
+ * These tests run against pre-configured fixture projects to test real-world scenarios
4
+ */
5
+ export {};
6
+ //# sourceMappingURL=e2e.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"e2e.test.d.ts","sourceRoot":"","sources":["../src/e2e.test.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import { Command } from 'commander';
3
+ export declare const program: Command;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAkBpC,eAAO,MAAM,OAAO,SAAgB,CAAC"}