i18nsmith 0.1.8 → 0.1.9

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 (82) 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/scaffold-adapter.d.ts +3 -0
  29. package/dist/commands/scaffold-adapter.d.ts.map +1 -0
  30. package/dist/commands/scaffold-adapter.test.d.ts +2 -0
  31. package/dist/commands/scaffold-adapter.test.d.ts.map +1 -0
  32. package/dist/commands/scan.d.ts +3 -0
  33. package/dist/commands/scan.d.ts.map +1 -0
  34. package/dist/commands/sync-seed.test.d.ts +2 -0
  35. package/dist/commands/sync-seed.test.d.ts.map +1 -0
  36. package/dist/commands/sync.d.ts +3 -0
  37. package/dist/commands/sync.d.ts.map +1 -0
  38. package/dist/commands/transform.d.ts +3 -0
  39. package/dist/commands/transform.d.ts.map +1 -0
  40. package/dist/commands/translate/csv-handler.d.ts +21 -0
  41. package/dist/commands/translate/csv-handler.d.ts.map +1 -0
  42. package/dist/commands/translate/executor.d.ts +31 -0
  43. package/dist/commands/translate/executor.d.ts.map +1 -0
  44. package/dist/commands/translate/index.d.ts +10 -0
  45. package/dist/commands/translate/index.d.ts.map +1 -0
  46. package/dist/commands/translate/reporter.d.ts +29 -0
  47. package/dist/commands/translate/reporter.d.ts.map +1 -0
  48. package/dist/commands/translate/types.d.ts +50 -0
  49. package/dist/commands/translate/types.d.ts.map +1 -0
  50. package/dist/commands/translate.d.ts +7 -0
  51. package/dist/commands/translate.d.ts.map +1 -0
  52. package/dist/commands/translate.test.d.ts +2 -0
  53. package/dist/commands/translate.test.d.ts.map +1 -0
  54. package/dist/e2e.test.d.ts +6 -0
  55. package/dist/e2e.test.d.ts.map +1 -0
  56. package/dist/index.d.ts +4 -0
  57. package/dist/index.d.ts.map +1 -0
  58. package/dist/index.js +2 -4
  59. package/dist/integration.test.d.ts +6 -0
  60. package/dist/integration.test.d.ts.map +1 -0
  61. package/dist/utils/diagnostics-exit.d.ts +12 -0
  62. package/dist/utils/diagnostics-exit.d.ts.map +1 -0
  63. package/dist/utils/diagnostics-exit.test.d.ts +2 -0
  64. package/dist/utils/diagnostics-exit.test.d.ts.map +1 -0
  65. package/dist/utils/diff-utils.d.ts +4 -0
  66. package/dist/utils/diff-utils.d.ts.map +1 -0
  67. package/dist/utils/diff-utils.test.d.ts +2 -0
  68. package/dist/utils/diff-utils.test.d.ts.map +1 -0
  69. package/dist/utils/exit-codes.d.ts +142 -0
  70. package/dist/utils/exit-codes.d.ts.map +1 -0
  71. package/dist/utils/package-manager.d.ts +4 -0
  72. package/dist/utils/package-manager.d.ts.map +1 -0
  73. package/dist/utils/pkg.d.ts +3 -0
  74. package/dist/utils/pkg.d.ts.map +1 -0
  75. package/dist/utils/provider-injector.d.ts +36 -0
  76. package/dist/utils/provider-injector.d.ts.map +1 -0
  77. package/dist/utils/provider-injector.test.d.ts +2 -0
  78. package/dist/utils/provider-injector.test.d.ts.map +1 -0
  79. package/dist/utils/scaffold.d.ts +20 -0
  80. package/dist/utils/scaffold.d.ts.map +1 -0
  81. package/package.json +3 -2
  82. 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;AAkBpC;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA8FrD"}
@@ -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;AA6DpC,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,QAoR5C"}
@@ -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;AAqEzC,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,QA8EjD"}
@@ -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;AAIH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAiBzC,cAAc,YAAY,CAAC;AAyD3B;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAwIxD"}
@@ -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,50 @@
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
+ }
21
+ export interface TranslateLocaleResult extends TranslationWriteSummary {
22
+ characters: number;
23
+ placeholderIssues: PlaceholderIssue[];
24
+ }
25
+ export interface PlaceholderIssue {
26
+ key: string;
27
+ locale: string;
28
+ type: 'missing' | 'extra';
29
+ placeholders: string[];
30
+ }
31
+ export interface TranslateSummary {
32
+ provider: string;
33
+ dryRun: boolean;
34
+ plan: TranslationPlan;
35
+ locales: TranslateLocaleResult[];
36
+ localeStats: Awaited<ReturnType<TranslationService['flush']>>;
37
+ totalCharacters: number;
38
+ }
39
+ export interface ProviderSettings {
40
+ name: string;
41
+ options?: Record<string, unknown>;
42
+ }
43
+ export interface CsvRow {
44
+ key: string;
45
+ sourceLocale: string;
46
+ sourceValue: string;
47
+ targetLocale: string;
48
+ targetValue: string;
49
+ }
50
+ //# 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;CACjB;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;AAiBpC,eAAO,MAAM,OAAO,SAAgB,CAAC"}
package/dist/index.js CHANGED
@@ -1,5 +1,4 @@
1
1
  #!/usr/bin/env node
2
- #!/usr/bin/env node
3
2
  var __defProp = Object.defineProperty;
4
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
4
  var __esm = (fn9, res) => function __init() {
@@ -61654,7 +61653,7 @@ ${e30}`;
61654
61653
  xi8.ignoredProperties = pf;
61655
61654
  yi8 = xi8;
61656
61655
  wi8 = /(?:[\u{2c7}\u{2c9}-\u{2cb}\u{2d9}\u{2ea}-\u{2eb}\u{305}\u{323}\u{1100}-\u{11ff}\u{2e80}-\u{2e99}\u{2e9b}-\u{2ef3}\u{2f00}-\u{2fd5}\u{2ff0}-\u{303f}\u{3041}-\u{3096}\u{3099}-\u{30ff}\u{3105}-\u{312f}\u{3131}-\u{318e}\u{3190}-\u{4dbf}\u{4e00}-\u{9fff}\u{a700}-\u{a707}\u{a960}-\u{a97c}\u{ac00}-\u{d7a3}\u{d7b0}-\u{d7c6}\u{d7cb}-\u{d7fb}\u{f900}-\u{fa6d}\u{fa70}-\u{fad9}\u{fe10}-\u{fe1f}\u{fe30}-\u{fe6f}\u{ff00}-\u{ffef}\u{16fe3}\u{16ff2}-\u{16ff6}\u{1aff0}-\u{1aff3}\u{1aff5}-\u{1affb}\u{1affd}-\u{1affe}\u{1b000}-\u{1b122}\u{1b132}\u{1b150}-\u{1b152}\u{1b155}\u{1b164}-\u{1b167}\u{1f200}\u{1f250}-\u{1f251}\u{20000}-\u{2a6df}\u{2a700}-\u{2b81d}\u{2b820}-\u{2cead}\u{2ceb0}-\u{2ebe0}\u{2ebf0}-\u{2ee5d}\u{2f800}-\u{2fa1d}\u{30000}-\u{3134a}\u{31350}-\u{33479}])(?:[\u{fe00}-\u{fe0f}\u{e0100}-\u{e01ef}])?/u;
61657
- Oe8 = /(?:[\u{21}-\u{2f}\u{3a}-\u{40}\u{5b}-\u{60}\u{7b}-\u{7e}]|\p{General_Category=Connector_Punctuation}|\p{General_Category=Dash_Punctuation}|\p{General_Category=Close_Punctuation}|\p{General_Category=Final_Punctuation}|\p{General_Category=Initial_Punctuation}|\p{General_Category=Other_Punctuation}|\p{General_Category=Open_Punctuation})/u;
61656
+ Oe8 = new RegExp("(?:[\\u{21}-\\u{2f}\\u{3a}-\\u{40}\\u{5b}-\\u{60}\\u{7b}-\\u{7e}]|\\p{General_Category=Connector_Punctuation}|\\p{General_Category=Dash_Punctuation}|\\p{General_Category=Close_Punctuation}|\\p{General_Category=Final_Punctuation}|\\p{General_Category=Initial_Punctuation}|\\p{General_Category=Other_Punctuation}|\\p{General_Category=Open_Punctuation})", "u");
61658
61657
  qe8 = (e30) => e30.position.start.offset;
61659
61658
  Ne7 = (e30) => e30.position.end.offset;
61660
61659
  kt9 = /* @__PURE__ */ new Set(["liquidNode", "inlineCode", "emphasis", "esComment", "strong", "delete", "wikiLink", "link", "linkReference", "image", "imageReference", "footnote", "footnoteReference", "sentence", "whitespace", "word", "break", "inlineMath"]);
@@ -61663,7 +61662,7 @@ ${e30}`;
61663
61662
  ae7 = "cj-letter";
61664
61663
  Pe7 = "k-letter";
61665
61664
  cr7 = "cjk-punctuation";
61666
- hf = /\p{Script_Extensions=Hangul}/u;
61665
+ hf = new RegExp("\\p{Script_Extensions=Hangul}", "u");
61667
61666
  Ti8 = df;
61668
61667
  fr8 = null;
61669
61668
  Ff = 10;
@@ -109381,4 +109380,3 @@ program.parse();
109381
109380
  export {
109382
109381
  program
109383
109382
  };
109384
- //# sourceMappingURL=index.js.map
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Integration tests for CLI commands
3
+ * These tests run the actual CLI commands against real file systems
4
+ */
5
+ export {};
6
+ //# sourceMappingURL=integration.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integration.test.d.ts","sourceRoot":"","sources":["../src/integration.test.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
@@ -0,0 +1,12 @@
1
+ import type { DiagnoseConflict, DiagnosisReport } from '@i18nsmith/core';
2
+ export interface DiagnosisExitSignal {
3
+ code: number;
4
+ reason: string;
5
+ }
6
+ export declare function getDiagnosisExitSignal(report: Pick<DiagnosisReport, 'conflicts'>): DiagnosisExitSignal | null;
7
+ export declare function selectExitSignal(conflicts: DiagnoseConflict[]): DiagnosisExitSignal | null;
8
+ export declare function describeDiagnosisExitCodes(): Array<{
9
+ code: number;
10
+ reason: string;
11
+ }>;
12
+ //# sourceMappingURL=diagnostics-exit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diagnostics-exit.d.ts","sourceRoot":"","sources":["../../src/utils/diagnostics-exit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGzE,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAiBD,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,WAAW,CAAC,GAAG,mBAAmB,GAAG,IAAI,CAE7G;AAED,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,gBAAgB,EAAE,GAAG,mBAAmB,GAAG,IAAI,CA2B1F;AAED,wBAAgB,0BAA0B,IAAI,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAMpF"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=diagnostics-exit.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diagnostics-exit.test.d.ts","sourceRoot":"","sources":["../../src/utils/diagnostics-exit.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import type { SyncSummary } from '@i18nsmith/core';
2
+ export declare function printLocaleDiffs(diffs: SyncSummary['diffs']): void;
3
+ export declare function writeLocaleDiffPatches(diffs: SyncSummary['diffs'], directory: string): Promise<void>;
4
+ //# sourceMappingURL=diff-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diff-utils.d.ts","sourceRoot":"","sources":["../../src/utils/diff-utils.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,QAW3D;AAED,wBAAsB,sBAAsB,CAAC,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,MAAM,iBAuB1F"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=diff-utils.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diff-utils.test.d.ts","sourceRoot":"","sources":["../../src/utils/diff-utils.test.ts"],"names":[],"mappings":""}