@fluenti/cli 0.4.0-rc.4 → 0.6.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 (118) hide show
  1. package/dist/cli/src/ai-provider.d.ts.map +1 -0
  2. package/dist/{catalog.d.ts → cli/src/catalog.d.ts} +1 -1
  3. package/dist/cli/src/catalog.d.ts.map +1 -0
  4. package/dist/cli/src/check.d.ts.map +1 -0
  5. package/dist/cli/src/cli.d.ts.map +1 -0
  6. package/dist/cli/src/codemod.d.ts +19 -0
  7. package/dist/cli/src/codemod.d.ts.map +1 -0
  8. package/dist/cli/src/compile-cache.d.ts.map +1 -0
  9. package/dist/cli/src/compile-runner.d.ts.map +1 -0
  10. package/dist/cli/src/compile-worker.d.ts.map +1 -0
  11. package/dist/cli/src/compile.d.ts.map +1 -0
  12. package/dist/cli/src/config-loader.d.ts +2 -0
  13. package/dist/cli/src/config-loader.d.ts.map +1 -0
  14. package/dist/{config.d.ts → cli/src/config.d.ts} +1 -1
  15. package/dist/cli/src/config.d.ts.map +1 -0
  16. package/dist/cli/src/doctor.d.ts +19 -0
  17. package/dist/cli/src/doctor.d.ts.map +1 -0
  18. package/dist/{extract-cache.d.ts → cli/src/extract-cache.d.ts} +1 -1
  19. package/dist/cli/src/extract-cache.d.ts.map +1 -0
  20. package/dist/cli/src/extract-runner.d.ts.map +1 -0
  21. package/dist/cli/src/glossary.d.ts.map +1 -0
  22. package/dist/{index.d.ts → cli/src/index.d.ts} +7 -3
  23. package/dist/cli/src/index.d.ts.map +1 -0
  24. package/dist/cli/src/init.d.ts.map +1 -0
  25. package/dist/cli/src/json-format.d.ts.map +1 -0
  26. package/dist/cli/src/lint.d.ts.map +1 -0
  27. package/dist/cli/src/migrate.d.ts.map +1 -0
  28. package/dist/cli/src/parallel-compile.d.ts.map +1 -0
  29. package/dist/cli/src/po-format.d.ts.map +1 -0
  30. package/dist/cli/src/stats-format.d.ts.map +1 -0
  31. package/dist/cli/src/translate-parse.d.ts.map +1 -0
  32. package/dist/cli/src/translate-prompt.d.ts.map +1 -0
  33. package/dist/cli/src/translate.d.ts.map +1 -0
  34. package/dist/{tsx-extractor.d.ts → cli/src/tsx-extractor.d.ts} +1 -1
  35. package/dist/cli/src/tsx-extractor.d.ts.map +1 -0
  36. package/dist/cli/src/validation.d.ts.map +1 -0
  37. package/dist/{vue-extractor.d.ts → cli/src/vue-extractor.d.ts} +1 -1
  38. package/dist/cli/src/vue-extractor.d.ts.map +1 -0
  39. package/dist/cli.cjs +10 -22
  40. package/dist/cli.cjs.map +1 -1
  41. package/dist/cli.js +335 -405
  42. package/dist/cli.js.map +1 -1
  43. package/dist/compile-C3VLvhUf.cjs +8 -0
  44. package/dist/{compile-kXClO6q4.cjs.map → compile-C3VLvhUf.cjs.map} +1 -1
  45. package/dist/{compile-CdA4EZ-p.js → compile-CZVpE5Md.js} +2 -2
  46. package/dist/{compile-CdA4EZ-p.js.map → compile-CZVpE5Md.js.map} +1 -1
  47. package/dist/compile-worker.cjs +1 -1
  48. package/dist/compile-worker.cjs.map +1 -1
  49. package/dist/compile-worker.js +1 -1
  50. package/dist/doctor-BqXXxyST.js +670 -0
  51. package/dist/doctor-BqXXxyST.js.map +1 -0
  52. package/dist/doctor-xp8WS8sr.cjs +24 -0
  53. package/dist/doctor-xp8WS8sr.cjs.map +1 -0
  54. package/dist/index.cjs +1 -1
  55. package/dist/index.cjs.map +1 -1
  56. package/dist/index.js +66 -65
  57. package/dist/index.js.map +1 -1
  58. package/dist/tsx-extractor-AOjsbOmp.cjs +2 -0
  59. package/dist/{tsx-extractor-B0vFXziu.cjs.map → tsx-extractor-AOjsbOmp.cjs.map} +1 -1
  60. package/dist/tsx-extractor-C-HZNobu.js.map +1 -1
  61. package/dist/vue-extractor.cjs +1 -1
  62. package/dist/vue-extractor.cjs.map +1 -1
  63. package/dist/vue-extractor.js.map +1 -1
  64. package/package.json +2 -2
  65. package/dist/ai-provider.d.ts.map +0 -1
  66. package/dist/catalog.d.ts.map +0 -1
  67. package/dist/check.d.ts.map +0 -1
  68. package/dist/cli.d.ts.map +0 -1
  69. package/dist/compile-cache.d.ts.map +0 -1
  70. package/dist/compile-kXClO6q4.cjs +0 -8
  71. package/dist/compile-runner.d.ts.map +0 -1
  72. package/dist/compile-worker.d.ts.map +0 -1
  73. package/dist/compile.d.ts.map +0 -1
  74. package/dist/config-loader.d.ts +0 -2
  75. package/dist/config-loader.d.ts.map +0 -1
  76. package/dist/config.d.ts.map +0 -1
  77. package/dist/extract-cache-BioSaoFo.cjs +0 -10
  78. package/dist/extract-cache-BioSaoFo.cjs.map +0 -1
  79. package/dist/extract-cache-C-MI1_ll.js +0 -325
  80. package/dist/extract-cache-C-MI1_ll.js.map +0 -1
  81. package/dist/extract-cache.d.ts.map +0 -1
  82. package/dist/extract-runner.d.ts.map +0 -1
  83. package/dist/glossary.d.ts.map +0 -1
  84. package/dist/index.d.ts.map +0 -1
  85. package/dist/init.d.ts.map +0 -1
  86. package/dist/json-format.d.ts.map +0 -1
  87. package/dist/lint.d.ts.map +0 -1
  88. package/dist/migrate.d.ts.map +0 -1
  89. package/dist/parallel-compile.d.ts.map +0 -1
  90. package/dist/po-format.d.ts.map +0 -1
  91. package/dist/stats-format.d.ts.map +0 -1
  92. package/dist/translate-parse.d.ts.map +0 -1
  93. package/dist/translate-prompt.d.ts.map +0 -1
  94. package/dist/translate.d.ts.map +0 -1
  95. package/dist/tsx-extractor-B0vFXziu.cjs +0 -2
  96. package/dist/tsx-extractor.d.ts.map +0 -1
  97. package/dist/validation.d.ts.map +0 -1
  98. package/dist/vue-extractor.d.ts.map +0 -1
  99. /package/dist/{ai-provider.d.ts → cli/src/ai-provider.d.ts} +0 -0
  100. /package/dist/{check.d.ts → cli/src/check.d.ts} +0 -0
  101. /package/dist/{cli.d.ts → cli/src/cli.d.ts} +0 -0
  102. /package/dist/{compile-cache.d.ts → cli/src/compile-cache.d.ts} +0 -0
  103. /package/dist/{compile-runner.d.ts → cli/src/compile-runner.d.ts} +0 -0
  104. /package/dist/{compile-worker.d.ts → cli/src/compile-worker.d.ts} +0 -0
  105. /package/dist/{compile.d.ts → cli/src/compile.d.ts} +0 -0
  106. /package/dist/{extract-runner.d.ts → cli/src/extract-runner.d.ts} +0 -0
  107. /package/dist/{glossary.d.ts → cli/src/glossary.d.ts} +0 -0
  108. /package/dist/{init.d.ts → cli/src/init.d.ts} +0 -0
  109. /package/dist/{json-format.d.ts → cli/src/json-format.d.ts} +0 -0
  110. /package/dist/{lint.d.ts → cli/src/lint.d.ts} +0 -0
  111. /package/dist/{migrate.d.ts → cli/src/migrate.d.ts} +0 -0
  112. /package/dist/{parallel-compile.d.ts → cli/src/parallel-compile.d.ts} +0 -0
  113. /package/dist/{po-format.d.ts → cli/src/po-format.d.ts} +0 -0
  114. /package/dist/{stats-format.d.ts → cli/src/stats-format.d.ts} +0 -0
  115. /package/dist/{translate-parse.d.ts → cli/src/translate-parse.d.ts} +0 -0
  116. /package/dist/{translate-prompt.d.ts → cli/src/translate-prompt.d.ts} +0 -0
  117. /package/dist/{translate.d.ts → cli/src/translate.d.ts} +0 -0
  118. /package/dist/{validation.d.ts → cli/src/validation.d.ts} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-provider.d.ts","sourceRoot":"","sources":["../../../src/ai-provider.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,OAAO,CAAA;AAE3C,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAA;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACxC,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC5C,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACvC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CACxC;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAC1B;AAiBD,wBAAsB,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC,CA0ChF"}
@@ -1,4 +1,4 @@
1
- import { ExtractedMessage } from '@fluenti/core/internal';
1
+ import { ExtractedMessage } from '../../core/src/compiler.ts';
2
2
  export interface CatalogEntry {
3
3
  message?: string | undefined;
4
4
  context?: string | undefined;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../../src/catalog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAE9D,MAAM,WAAW,YAAY;IAC3B,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC5B,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC5B,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC5B,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAChC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAA;IACtC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAC9B,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAC5B;AAED,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;AAEtD,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,oBAAoB;IACnC,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAED,mDAAmD;AACnD,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,WAAW,EACrB,SAAS,EAAE,gBAAgB,EAAE,EAC7B,OAAO,CAAC,EAAE,oBAAoB,GAC7B;IAAE,OAAO,EAAE,WAAW,CAAC;IAAC,MAAM,EAAE,YAAY,CAAA;CAAE,CAiEhD"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../../src/check.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAE5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAA;AAE5C,iCAAiC;AACjC,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,oCAAoC;AACpC,MAAM,WAAW,YAAY;IAC3B,mCAAmC;IACnC,YAAY,EAAE,MAAM,CAAA;IACpB,0CAA0C;IAC1C,WAAW,EAAE,MAAM,CAAA;IACnB,mCAAmC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,oBAAoB;IACpB,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAA;CACnC;AAED,wBAAwB;AACxB,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,WAAW,EAAE,CAAA;IACtB,MAAM,EAAE,OAAO,CAAA;IACf,WAAW,EAAE,MAAM,CAAA;IACnB,cAAc,EAAE,MAAM,CAAA;IACtB,WAAW,EAAE,cAAc,EAAE,CAAA;CAC9B;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,EACrC,OAAO,EAAE,YAAY,GACpB,WAAW,CAoFb;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAiB3D;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,WAAW,EACnB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,GAAG,IAAI,GACpB,MAAM,CAuBR;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAO3D"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../../src/cli.ts"],"names":[],"mappings":""}
@@ -0,0 +1,19 @@
1
+ export interface CodemodOptions {
2
+ cwd: string;
3
+ include?: string[];
4
+ write?: boolean;
5
+ }
6
+ export interface CodemodFileResult {
7
+ file: string;
8
+ changed: boolean;
9
+ }
10
+ export interface CodemodResult {
11
+ changedFiles: CodemodFileResult[];
12
+ changedCount: number;
13
+ }
14
+ export declare function rewriteFluentiImports(source: string): {
15
+ code: string;
16
+ changed: boolean;
17
+ };
18
+ export declare function runCodemod(options: CodemodOptions): Promise<CodemodResult>;
19
+ //# sourceMappingURL=codemod.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codemod.d.ts","sourceRoot":"","sources":["../../../src/codemod.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,CAAA;IACX,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,MAAM,WAAW,aAAa;IAC5B,YAAY,EAAE,iBAAiB,EAAE,CAAA;IACjC,YAAY,EAAE,MAAM,CAAA;CACrB;AAsED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAuFxF;AAED,wBAAsB,UAAU,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC,CA2BhF"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compile-cache.d.ts","sourceRoot":"","sources":["../../../src/compile-cache.ts"],"names":[],"mappings":"AAgBA;;;;GAIG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,IAAI,CAAkB;IAC9B,OAAO,CAAC,SAAS,CAAQ;IACzB,OAAO,CAAC,KAAK,CAAQ;gBAET,UAAU,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM;IAQlD;;;OAGG;IACH,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO;IAQ3D;;OAEG;IACH,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,IAAI;IAOjD;;OAEG;IACH,IAAI,IAAI,IAAI;IAYZ,OAAO,CAAC,IAAI;CAeb"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compile-runner.d.ts","sourceRoot":"","sources":["../../../src/compile-runner.ts"],"names":[],"mappings":"AA4BA,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED;;;;GAIG;AACH,wBAAsB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAuExF"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compile-worker.d.ts","sourceRoot":"","sources":["../../../src/compile-worker.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAE/C,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,WAAW,CAAA;IACpB,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,cAAc,GAAG,SAAS,CAAA;CACrC;AAED,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,EAAE,CAAA;KAAE,CAAA;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAA;CACf"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../../src/compile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AA4J5C;;;;GAIG;AACH,4EAA4E;AAC5E,eAAO,MAAM,eAAe,IAAI,CAAA;AAEhC,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,EAAE,CAAA;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAED,wBAAgB,cAAc,CAC5B,OAAO,EAAE,WAAW,EACpB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EAAE,EAChB,YAAY,CAAC,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE,cAAc,GACvB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,YAAY,CAAA;CAAE,CA0EvC;AA8BD;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAW3E;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,GAAG,MAAM,EAAE,CAU7E;AAID,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;CACb;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe,EAAE,CAO1E;AA8CD;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,MAAM,EAAE,EAChB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,EACrC,YAAY,EAAE,MAAM,GACnB,MAAM,CAsDR"}
@@ -0,0 +1,2 @@
1
+ export { loadConfig, loadConfigSync, DEFAULT_FLUENTI_CONFIG } from '../../core/src/config.ts';
2
+ //# sourceMappingURL=config-loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-loader.d.ts","sourceRoot":"","sources":["../../../src/config-loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAA"}
@@ -1,4 +1,4 @@
1
- import { FluentiBuildConfig } from '@fluenti/core/internal';
1
+ import { FluentiBuildConfig } from '../../core/src/compiler.ts';
2
2
  /**
3
3
  * Define a Fluenti configuration with full type inference and IDE autocompletion.
4
4
  *
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAEhE;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,kBAAkB,CAAC,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAE7F"}
@@ -0,0 +1,19 @@
1
+ import { DetectedFramework } from './init';
2
+ export type DoctorSeverity = 'error' | 'warning' | 'info';
3
+ export interface DoctorFinding {
4
+ severity: DoctorSeverity;
5
+ code: string;
6
+ message: string;
7
+ }
8
+ export interface DoctorReport {
9
+ framework: DetectedFramework['name'];
10
+ findings: DoctorFinding[];
11
+ configPath?: string;
12
+ }
13
+ export interface DoctorOptions {
14
+ cwd: string;
15
+ config?: string;
16
+ }
17
+ export declare function runDoctor(options: DoctorOptions): Promise<DoctorReport>;
18
+ export declare function formatDoctorReport(report: DoctorReport): string;
19
+ //# sourceMappingURL=doctor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../../src/doctor.ts"],"names":[],"mappings":"AAGA,OAAO,EAAmB,KAAK,iBAAiB,EAAE,MAAM,QAAQ,CAAA;AAGhE,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAA;AAEzD,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,cAAc,CAAA;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAA;IACpC,QAAQ,EAAE,aAAa,EAAE,CAAA;IACzB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAwDD,wBAAsB,SAAS,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC,CAsG7E;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAiB/D"}
@@ -1,4 +1,4 @@
1
- import { ExtractedMessage } from '@fluenti/core/internal';
1
+ import { ExtractedMessage } from '../../core/src/compiler.ts';
2
2
  /**
3
3
  * File-level extract cache that skips re-extraction for unchanged files.
4
4
  *
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extract-cache.d.ts","sourceRoot":"","sources":["../../../src/extract-cache.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAgB9D;;;;GAIG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,IAAI,CAAkB;IAC9B,OAAO,CAAC,SAAS,CAAQ;IACzB,OAAO,CAAC,KAAK,CAAQ;gBAET,UAAU,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM;IAQlD;;;OAGG;IACH,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,gBAAgB,EAAE,GAAG,SAAS;IAgBrD;;OAEG;IACH,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,gBAAgB,EAAE,GAAG,IAAI;IAczD;;OAEG;IACH,KAAK,CAAC,YAAY,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI;IAStC;;OAEG;IACH,IAAI,IAAI,IAAI;IAYZ,+BAA+B;IAC/B,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,OAAO,CAAC,IAAI;CAeb"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extract-runner.d.ts","sourceRoot":"","sources":["../../../src/extract-runner.ts"],"names":[],"mappings":"AAmBA,MAAM,WAAW,iBAAiB;IAChC,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAgCD;;;;GAIG;AACH,wBAAsB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAmExF"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"glossary.d.ts","sourceRoot":"","sources":["../../../src/glossary.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;AAIjE,wBAAgB,YAAY,CAAC,YAAY,EAAE,MAAM,GAAG,YAAY,CAuC/D;AAED,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,YAAY,EACtB,MAAM,EAAE,MAAM,GACb,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAQxB;AAWD,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAUhF"}
@@ -5,13 +5,17 @@ export { readJsonCatalog, writeJsonCatalog } from './json-format';
5
5
  export { readPoCatalog, writePoCatalog } from './po-format';
6
6
  export { compileCatalog, compileIndex, collectAllIds } from './compile';
7
7
  export type { CompileStats } from './compile';
8
- export { hashMessage } from '@fluenti/core/internal';
8
+ export { hashMessage } from '../../core/src/compiler.ts';
9
9
  export { defineConfig } from './config';
10
10
  export { loadConfig } from './config-loader';
11
11
  export { runCompile } from './compile-runner';
12
12
  export type { RunCompileOptions } from './compile-runner';
13
13
  export { runExtract } from './extract-runner';
14
14
  export type { RunExtractOptions } from './extract-runner';
15
- export type { FluentiBuildConfig } from '@fluenti/core/internal';
16
- export type { FluentiConfig } from '@fluenti/core';
15
+ export type { FluentiBuildConfig } from '../../core/src/compiler.ts';
16
+ export type { FluentiConfig } from '../../core/src/index.ts';
17
+ export { rewriteFluentiImports, runCodemod } from './codemod';
18
+ export type { CodemodOptions, CodemodResult } from './codemod';
19
+ export { runDoctor, formatDoctorReport } from './doctor';
20
+ export type { DoctorOptions, DoctorReport, DoctorFinding } from './doctor';
17
21
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AACzC,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AACjE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC3D,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AACvE,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,YAAY,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,YAAY,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACzD,YAAY,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAChE,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAClD,OAAO,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAC7D,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAC9D,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AACxD,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/init.ts"],"names":[],"mappings":"AAMA,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAKrD;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,YAAY,GAAG,OAAO,GAAG,SAAS,CAAA;IAC9E,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;CAC7B;AAeD;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,iBAAiB,CAO/E;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE;IAC1C,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,MAAM,EAAE,IAAI,GAAG,MAAM,CAAA;CACtB,GAAG,MAAM,CAaT;AAED;;GAEG;AACH,wBAAsB,OAAO,CAAC,OAAO,EAAE;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA4HrE"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json-format.d.ts","sourceRoot":"","sources":["../../../src/json-format.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAE5C,+BAA+B;AAC/B,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,CAwB5D;AAED,qCAAqC;AACrC,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CAgB7D"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lint.d.ts","sourceRoot":"","sources":["../../../src/lint.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAG5C,2CAA2C;AAC3C,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAA;AAEvD,+BAA+B;AAC/B,MAAM,WAAW,cAAc;IAC7B,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAA;IACZ,qBAAqB;IACrB,QAAQ,EAAE,YAAY,CAAA;IACtB,6BAA6B;IAC7B,OAAO,EAAE,MAAM,CAAA;IACf,0BAA0B;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,sBAAsB;IACtB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,4CAA4C;AAC5C,MAAM,WAAW,WAAW;IAC1B,qCAAqC;IACrC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,mCAAmC;IACnC,YAAY,EAAE,MAAM,CAAA;IACpB,mDAAmD;IACnD,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,EACrC,OAAO,EAAE,WAAW,GACnB,cAAc,EAAE,CAgIlB;AAGD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,cAAc,EAAE,GAAG,MAAM,CAsBvE"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../../../src/migrate.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAI7C,MAAM,MAAM,gBAAgB,GACxB,UAAU,GACV,WAAW,GACX,eAAe,GACf,WAAW,GACX,cAAc,GACd,QAAQ,CAAA;AAEZ,UAAU,WAAW;IACnB,IAAI,EAAE,gBAAgB,CAAA;IACtB,SAAS,EAAE,MAAM,CAAA;IACjB,cAAc,EAAE,MAAM,EAAE,CAAA;IACxB,cAAc,EAAE,MAAM,EAAE,CAAA;IACxB,cAAc,EAAE,MAAM,EAAE,CAAA;IACxB,cAAc,EAAE,MAAM,CAAA;CACvB;AAuDD,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS,CAGzE;AAED,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IACrD,WAAW,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IACrD,aAAa,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IACvD,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;CAChC;AAyED,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,aAAa,EACvB,cAAc,EAAE,MAAM,GACrB,MAAM,CAoIR;AA2BD,UAAU,aAAa;IACrB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,WAAW,EAAE,KAAK,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IACvD,aAAa,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IACrD,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB,eAAe,EAAE,MAAM,GAAG,SAAS,CAAA;CACpC;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,aAAa,CA2D7D;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,UAAU,CAAA;IACpB,KAAK,EAAE,OAAO,CAAA;CACf;AAED,wBAAsB,UAAU,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CA4HvE"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parallel-compile.d.ts","sourceRoot":"","sources":["../../../src/parallel-compile.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAG7D,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,WAAW,CAAA;IACpB,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,cAAc,CAAA;CACzB;AAED,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,YAAY,CAAA;CACpB;AAYD;;;;;;;;;GASG;AACH,wBAAsB,eAAe,CACnC,KAAK,EAAE,mBAAmB,EAAE,EAC5B,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,qBAAqB,EAAE,CAAC,CAqGlC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"po-format.d.ts","sourceRoot":"","sources":["../../../src/po-format.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AA0E5C,6BAA6B;AAC7B,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,CAU1D;AAED,mCAAmC;AACnC,wBAAgB,cAAc,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CA6D3D"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stats-format.d.ts","sourceRoot":"","sources":["../../../src/stats-format.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,SAAK,GAAG,MAAM,CAIjE;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAKnD;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,MAAM,GACjB,MAAM,CAKR"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"translate-parse.d.ts","sourceRoot":"","sources":["../../../src/translate-parse.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC7C,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAC5B;AAsCD;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACrC,WAAW,CAyEb"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"translate-prompt.d.ts","sourceRoot":"","sources":["../../../src/translate-prompt.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACzC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAA;IACtD,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CACtC;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,CA6BnE"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"translate.d.ts","sourceRoot":"","sources":["../../../src/translate.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAE5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAI/C,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE/C,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CASnF;AAED,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,SAAS,EAAE,MAAM,GAChB,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAa/B;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAA;IAC7B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAA;IAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACrC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAA;IACtD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CACxC;AAED,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC;IACzE,OAAO,EAAE,WAAW,CAAA;IACpB,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,MAAM,EAAE,CAAA;CACnB,CAAC,CA0DD"}
@@ -1,3 +1,3 @@
1
- import { ExtractedMessage } from '@fluenti/core/internal';
1
+ import { ExtractedMessage } from '../../core/src/compiler.ts';
2
2
  export declare function extractFromTsx(code: string, filename: string, idGenerator?: (message: string, context?: string) => string): ExtractedMessage[];
3
3
  //# sourceMappingURL=tsx-extractor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tsx-extractor.d.ts","sourceRoot":"","sources":["../../../src/tsx-extractor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAuf9D,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,MAAM,GAC1D,gBAAgB,EAAE,CAqJpB"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../src/validation.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,OAAO,CAAA;IACd,mBAAmB,EAAE,MAAM,EAAE,CAAA;IAC7B,iBAAiB,EAAE,MAAM,EAAE,CAAA;IAC3B,eAAe,EAAE,MAAM,EAAE,CAAA;IACzB,aAAa,EAAE,MAAM,EAAE,CAAA;IACvB,YAAY,EAAE,MAAM,EAAE,CAAA;CACvB;AAOD;;;8CAG8C;AAC9C,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CA8B7D;AAiBD,0EAA0E;AAC1E,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAQzD;AAED,uFAAuF;AACvF,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,gBAAgB,CAgCzF;AAED,uEAAuE;AACvE,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACnC,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAclC"}
@@ -1,4 +1,4 @@
1
- import { ExtractedMessage } from '@fluenti/core/internal';
1
+ import { ExtractedMessage } from '../../core/src/compiler.ts';
2
2
  /** Extract messages from Vue SFC files */
3
3
  export declare function extractFromVue(code: string, filename: string, idGenerator?: (message: string, context?: string) => string): ExtractedMessage[];
4
4
  //# sourceMappingURL=vue-extractor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vue-extractor.d.ts","sourceRoot":"","sources":["../../../src/vue-extractor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAiW9D,0CAA0C;AAC1C,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,MAAM,GAC1D,gBAAgB,EAAE,CA2EpB"}
package/dist/cli.cjs CHANGED
@@ -1,25 +1,13 @@
1
1
  #!/usr/bin/env node
2
- const e=require(`./extract-cache-BioSaoFo.cjs`),t=require(`./tsx-extractor-B0vFXziu.cjs`),n=require(`./compile-kXClO6q4.cjs`);let r=require(`@fluenti/core/internal`),i=require(`node:fs`),a=require(`node:path`),o=require(`node:url`),s=require(`fast-glob`);s=e.l(s);let c=require(`node:crypto`),l=require(`citty`),u=require(`consola`);u=e.l(u);let d=require(`node:child_process`),f=require(`node:util`),p=require(`node:timers/promises`),m=require(`@fluenti/core/config`);var h=`█`,g=`░`;function _(e,t=20){let n=Math.round(Math.max(0,Math.min(100,e))/100*t);return h.repeat(n)+g.repeat(t-n)}function v(e){let t=e.toFixed(1)+`%`;return e>=90?`\x1b[32m${t}\x1b[0m`:e>=70?`\x1b[33m${t}\x1b[0m`:`\x1b[31m${t}\x1b[0m`}function y(e,t,n){let r=t>0?n/t*100:0,i=t>0?v(r):`—`,a=t>0?_(r):``;return` ${e.padEnd(8)}│ ${String(t).padStart(5)} │ ${String(n).padStart(10)} │ ${a} ${i}`}var b=/\{(\w+),\s*(plural|select|selectordinal)\s*,/;function x(e){try{let t=(0,r.parse)(e),n=new Set;return S(t,n),[...n].sort()}catch{let t=new Set,n=0,r=0;for(;r<e.length;){if(e[r]===`{`){if(n++,n===1){let n=e.indexOf(`}`,r+1);if(n!==-1){let i=e.slice(r+1,n).trim(),a=/^(\w+)/.exec(i);a&&t.add(a[1])}}}else e[r]===`}`&&n--;r++}return[...t].sort()}}function S(e,t){for(let n of e)if(n.type===`variable`&&n.name!==`#`)t.add(n.name);else if(n.type===`plural`||n.type===`select`){t.add(n.variable);for(let e of Object.values(n.options))S(e,t)}else n.type===`function`&&t.add(n.variable)}function C(e){let t=new Set,n=/<\/?([a-zA-Z][\w-]*)[^>]*>/g,r;for(;(r=n.exec(e))!==null;)t.add(r[1].toLowerCase());return[...t].sort()}function ee(e,t){let n=x(e),i=x(t),a=C(e),o=C(t),s=n.filter(e=>!i.includes(e)),c=i.filter(e=>!n.includes(e)),l=a.filter(e=>!o.includes(e)),u=o.filter(e=>!a.includes(e)),d=[];if(b.test(t))try{(0,r.parse)(t)}catch(e){d.push(e.message)}return{valid:s.length===0&&c.length===0&&l.length===0&&u.length===0&&d.length===0,missingPlaceholders:s,extraPlaceholders:c,missingHtmlTags:l,extraHtmlTags:u,syntaxErrors:d}}function w(e,t){let n=[],{sourceLocale:r}=t,i=t.locales??Object.keys(e),a=e[r];if(!a)return n.push({rule:`missing-source`,severity:`error`,message:`Source locale catalog "${r}" not found`}),n;let o=Object.entries(a).filter(([,e])=>!e.obsolete).map(([e])=>e);for(let t of i){if(t===r)continue;let i=e[t];if(!i){n.push({rule:`missing-locale`,severity:`error`,message:`Catalog for locale "${t}" not found`,locale:t});continue}for(let e of o){let r=a[e],o=i[e];if(!o||!o.translation||o.translation.length===0){n.push({rule:`missing-translation`,severity:`error`,message:`Missing translation for "${e}" in locale "${t}"`,messageId:e,locale:t});continue}let s=x(r.message??e),c=x(o.translation),l=s.filter(e=>!c.includes(e)),u=c.filter(e=>!s.includes(e));l.length>0&&n.push({rule:`inconsistent-placeholders`,severity:`error`,message:`Translation for "${e}" in "${t}" is missing placeholders: ${l.map(e=>`{${e}}`).join(`, `)}`,messageId:e,locale:t}),u.length>0&&n.push({rule:`inconsistent-placeholders`,severity:`warning`,message:`Translation for "${e}" in "${t}" has extra placeholders: ${u.map(e=>`{${e}}`).join(`, `)}`,messageId:e,locale:t}),o.fuzzy&&n.push({rule:`fuzzy-translation`,severity:`warning`,message:`Translation for "${e}" in "${t}" is marked as fuzzy`,messageId:e,locale:t})}for(let[e,r]of Object.entries(i))r.obsolete||(!a[e]||a[e].obsolete)&&n.push({rule:`orphan-translation`,severity:`warning`,message:`Translation "${e}" in "${t}" has no corresponding source message`,messageId:e,locale:t})}let s=new Map;for(let[e,t]of Object.entries(a)){if(t.obsolete)continue;let n=t.message??e,r=s.get(n);r?r.push(e):s.set(n,[e])}for(let[e,t]of s)t.length>1&&n.push({rule:`duplicate-message`,severity:`info`,message:`Duplicate source message "${e.slice(0,60)}${e.length>60?`...`:``}" used by ${t.length} entries: ${t.join(`, `)}`,locale:r});return n}function T(e){if(e.length===0)return` ✓ All checks passed`;let t=[],n=te(e,e=>e.rule);for(let[e,r]of Object.entries(n)){t.push(` ${e} (${r.length}):`);for(let e of r){let n=e.severity===`error`?`✗`:e.severity===`warning`?`⚠`:`ℹ`;t.push(` ${n} ${e.message}`)}}let r=e.filter(e=>e.severity===`error`).length,i=e.filter(e=>e.severity===`warning`).length,a=e.filter(e=>e.severity===`info`).length;return t.push(``),t.push(` Summary: ${r} errors, ${i} warnings, ${a} info`),t.join(`
3
- `)}function te(e,t){let n={};for(let r of e){let e=t(r);(n[e]??(n[e]=[])).push(r)}return n}function E(e,t){let{sourceLocale:n,minCoverage:r,locale:i}=t,a=e[n];if(!a)return{results:[],passed:!1,minCoverage:r,actualCoverage:0,diagnostics:[{rule:`missing-source`,severity:`error`,message:`Source locale catalog "${n}" not found`}]};let o=Object.entries(a).filter(([,e])=>!e.obsolete).map(([e])=>e),s=o.length,c=i?[i]:Object.keys(e).filter(e=>e!==n),l=[];for(let t of c){let n=e[t];if(!n){l.push({locale:t,total:s,translated:0,missing:s,fuzzy:0,coverage:0});continue}let r=0,i=0,a=0;for(let e of o){let t=n[e];!t||!t.translation||t.translation.length===0?i++:(r++,t.fuzzy&&a++)}let c=s>0?r/s*100:100;l.push({locale:t,total:s,translated:r,missing:i,fuzzy:a,coverage:c})}let u=l.reduce((e,t)=>e+t.translated,0),d=l.reduce((e,t)=>e+t.total,0),f=d>0?u/d*100:100,p=l.every(e=>e.coverage>=r),m={sourceLocale:n};return i&&(m.locales=[n,i]),{results:l,passed:p,minCoverage:r,actualCoverage:f,diagnostics:w(e,m)}}function ne(e){let t=[];for(let n of e.results){let r=n.coverage>=e.minCoverage?`✓`:`✗`,i=n.coverage.toFixed(1),a=n.missing>0?` — ${n.missing} missing`:``,o=n.fuzzy>0?`, ${n.fuzzy} fuzzy`:``;t.push(`${r} ${n.locale}: ${i}% (${n.translated}/${n.total})${a}${o}`)}t.push(``);let n=e.actualCoverage.toFixed(1),r=e.passed?`PASSED`:`FAILED`;return t.push(`Coverage: ${n}% (min: ${e.minCoverage}%) — ${r}`),t.join(`
4
- `)}function D(e,t,n){let r=[],i=n===`json`?`.json`:`.po`;for(let n of e.results)if(n.coverage<e.minCoverage){let a=`${t}/${n.locale}${i}`;r.push(`::error file=${a}::Translation coverage ${n.coverage.toFixed(1)}% below minimum ${e.minCoverage}%`)}let a=e.diagnostics.filter(e=>e.rule===`missing-translation`);for(let e of a)if(e.locale){let n=`${t}/${e.locale}${i}`;r.push(`::warning file=${n}::${e.message}`)}return r.join(`
5
- `)}function O(e){return JSON.stringify({results:e.results,passed:e.passed,minCoverage:e.minCoverage,actualCoverage:Math.round(e.actualCoverage*10)/10},null,2)}var k=`1`,A=class{data;cachePath;dirty=!1;constructor(e,t){this.cachePath=(0,a.resolve)(t?(0,a.resolve)(e,`.cache`,t):(0,a.resolve)(e,`.cache`),`compile-cache.json`),this.data=this.load()}isUpToDate(e,t){let n=this.data.entries[e];if(!n)return!1;let r=j(t);return n.inputHash===r}set(e,t){this.data.entries[e]={inputHash:j(t)},this.dirty=!0}save(){if(this.dirty)try{(0,i.mkdirSync)((0,a.dirname)(this.cachePath),{recursive:!0}),(0,i.writeFileSync)(this.cachePath,JSON.stringify(this.data),`utf-8`),this.dirty=!1}catch{}}load(){try{if((0,i.existsSync)(this.cachePath)){let e=(0,i.readFileSync)(this.cachePath,`utf-8`),t=JSON.parse(e);if(t.version===k)return t}}catch{}return{version:k,entries:{}}}};function j(e){return(0,c.createHash)(`md5`).update(e).digest(`hex`)}var re=(0,f.promisify)(d.execFile),ie={claude:`npm install -g @anthropic-ai/claude-code`,codex:`npm install -g @openai/codex`};function ae(e,t){return e===`claude`?[`-p`,t]:[`-p`,t,`--full-auto`]}function oe(e){return e.code===`ENOENT`}async function se(e){let{provider:t,prompt:n,maxRetries:r=3,initialDelayMs:i=1e3,maxBuffer:a=10*1024*1024,timeoutMs:o=12e4}=e,s=ae(t,n),c=t===`claude`?`claude`:`codex`,l;for(let e=0;e<=r;e++)try{let t=re(c,[...s],{maxBuffer:a}),{stdout:n}=await Promise.race([t,(0,p.setTimeout)(o).then(()=>{throw Error(`AI provider timed out after ${o}ms`)})]);return{stdout:n,attempts:e+1}}catch(n){if(oe(n))throw Error(`"${t}" CLI not found. Please install it first:\n ${ie[t]}`);if(n instanceof Error&&n.message.includes(`timed out`))throw n;l=n,e<r&&await(0,p.setTimeout)(i*2**e)}throw l}var M=1048576;function N(e){if(!(0,i.existsSync)(e))return{};let t=(0,i.statSync)(e).size;if(t>M)throw Error(`Glossary file exceeds maximum size of ${M} bytes (got ${t} bytes)`);let n;try{let t=(0,i.readFileSync)(e,`utf-8`);n=JSON.parse(t)}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`Invalid glossary format: failed to parse JSON — ${t}`)}if(typeof n!=`object`||!n||Array.isArray(n))throw Error(`Invalid glossary format: root must be a plain object`);for(let[e,t]of Object.entries(n)){if(typeof t!=`object`||!t||Array.isArray(t))throw Error(`Invalid glossary format: value for "${e}" must be a plain object`);for(let[n,r]of Object.entries(t))if(typeof r!=`string`)throw Error(`Invalid glossary format: "${e}.${n}" must be a string, got ${typeof r}`)}return n}function P(e,t){let n={};for(let[r,i]of Object.entries(e))t in i&&(n[r]=i[t]);return n}function F(e){return e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`).replace(/[\n\r]/g,` `).replace(/\t/g,` `)}function I(e){let t=Object.entries(e);return t.length===0?``:`=== GLOSSARY (use these exact translations) ===\n${[...t].sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>`"${F(e)}" → "${F(t)}"`).join(`
6
- `)}`}function L(e){let{sourceLocale:t,targetLocale:n,messages:r,glossary:i,context:a}=e,o=JSON.stringify(r,null,2),s=[`You are a professional translator. Translate the following messages from "${t}" to "${n}".`,``,`Rules:`,`1. Output ONLY a valid JSON object with the same keys and translated values.`,`2. Keep ICU MessageFormat placeholders unchanged: {name}, {count, plural, ...}, {val, number}, etc.`,`3. Keep HTML tags unchanged: <b>, <a href="...">, </span>, <br/>, etc.`,`4. Keep numbered rich-text tags unchanged: <0>, </0>, <1/>, etc.`,`5. Do not add any explanation, markdown formatting, or code fences — output raw JSON only.`];if(i&&Object.keys(i).length>0){let e=I(i);e&&s.push(``,e)}return a&&s.push(``,`=== PROJECT CONTEXT ===`,a),s.push(``,`Input (JSON):`,o),s.join(`
7
- `)}function R(e){let t=e.indexOf(`{`);if(t===-1)throw Error(`No JSON object found in AI response`);let n=0,r=!1,i=!1;for(let a=t;a<e.length;a++){let o=e[a];if(i){i=!1;continue}if(o===`\\`&&r){i=!0;continue}if(o===`"`&&!i){r=!r;continue}if(!r&&(o===`{`&&n++,o===`}`&&(n--,n===0)))return e.slice(t,a+1)}throw Error(`Unterminated JSON object in AI response`)}function z(e){let t=e.match(/```(?:json)?\s*\n?([\s\S]*?)```/);return t?t[1]:e}function B(e,t){let n=[],r=R(z(e)),i;try{i=JSON.parse(r)}catch{throw Error(`Failed to parse JSON from AI response: ${r.slice(0,200)}`)}if(typeof i!=`object`||!i||Array.isArray(i))throw Error(`AI response is not a valid JSON object`);let a=i,o={},s=new Set(Object.keys(t));for(let[e,r]of Object.entries(a)){if(!s.has(e)){n.push(`Extra key in AI response (ignored): "${e}"`);continue}if(typeof r!=`string`){n.push(`Non-string value for key "${e}" (ignored)`);continue}o[e]=r;let i=t[e],a=ee(i,r);if(!a.valid){let t=[];a.missingPlaceholders.length>0&&t.push(`missing placeholders: ${a.missingPlaceholders.join(`, `)}`),a.extraPlaceholders.length>0&&t.push(`extra placeholders: ${a.extraPlaceholders.join(`, `)}`),a.missingHtmlTags.length>0&&t.push(`missing HTML tags: ${a.missingHtmlTags.join(`, `)}`),a.extraHtmlTags.length>0&&t.push(`extra HTML tags: ${a.extraHtmlTags.join(`, `)}`),a.syntaxErrors.length>0&&t.push(`ICU syntax errors: ${a.syntaxErrors.join(`; `)}`),n.push(`QA issue for "${e}": ${t.join(`; `)}`)}}for(let e of s)e in o||n.push(`Missing translation for key: "${e}"`);return{translations:o,warnings:n}}function V(e){let t={};for(let[n,r]of Object.entries(e))r.obsolete||(!r.translation||r.translation.length===0)&&(t[n]=r.message??n);return t}function H(e,t){let n=Object.keys(e),r=[];for(let i=0;i<n.length;i+=t){let a={};for(let r of n.slice(i,i+t))a[r]=e[r];r.push(a)}return r}async function U(e){let{provider:t,sourceLocale:n,targetLocale:r,catalog:i,batchSize:a,context:o,glossary:s,timeoutMs:c}=e,l=V(i),d=Object.keys(l).length;if(d===0)return{catalog:{...i},translated:0,warnings:[]};u.default.info(` ${d} untranslated messages, translating with ${t}...`);let f={...i},p=H(l,a),m=0,h=[];for(let e=0;e<p.length;e++){let i=p[e],a=Object.keys(i);p.length>1&&u.default.info(` Batch ${e+1}/${p.length} (${a.length} messages)`);try{let{stdout:e}=await se({provider:t,prompt:L({sourceLocale:n,targetLocale:r,messages:i,glossary:s,context:o}),timeoutMs:c}),{translations:l,warnings:d}=B(e,i);for(let e of d)h.push(`[${r}] ${e}`),u.default.warn(` ${e}`);for(let e of a)e in l&&(f[e]={...f[e],translation:l[e]},m++)}catch(t){let n=t instanceof Error?t.message:String(t);h.push(`[${r}] Batch ${e+1} failed: ${n}`),u.default.error(` Batch ${e+1} failed: ${n}`)}}return{catalog:f,translated:m,warnings:h}}var W=(0,f.promisify)(d.execFile),G={"vue-i18n":{name:`vue-i18n`,framework:`Vue`,configPatterns:[`i18n.ts`,`i18n.js`,`i18n/index.ts`,`i18n/index.js`,`src/i18n.ts`,`src/i18n.js`,`src/i18n/index.ts`,`src/plugins/i18n.ts`],localePatterns:[`locales/*.json`,`src/locales/*.json`,`i18n/*.json`,`src/i18n/*.json`,`lang/*.json`,`src/lang/*.json`,`locales/*.yaml`,`locales/*.yml`],sourcePatterns:[`src/**/*.vue`],migrationGuide:`vue/llms-migration.txt`},"nuxt-i18n":{name:`nuxt-i18n`,framework:`Nuxt`,configPatterns:[`nuxt.config.ts`,`nuxt.config.js`,`i18n.config.ts`,`i18n.config.js`],localePatterns:[`locales/*.json`,`lang/*.json`,`i18n/*.json`,`locales/*.yaml`,`locales/*.yml`],sourcePatterns:[`pages/**/*.vue`,`components/**/*.vue`,`layouts/**/*.vue`],migrationGuide:`nuxt/llms-migration.txt`},"react-i18next":{name:`react-i18next`,framework:`React`,configPatterns:[`i18n.ts`,`i18n.js`,`src/i18n.ts`,`src/i18n.js`,`src/i18n/index.ts`,`src/i18n/config.ts`],localePatterns:[`locales/*.json`,`src/locales/*.json`,`public/locales/**/*.json`,`translations/*.json`,`src/translations/*.json`],sourcePatterns:[`src/**/*.tsx`,`src/**/*.jsx`,`src/**/*.ts`],migrationGuide:`react/llms-migration.txt`},"next-intl":{name:`next-intl`,framework:`Next.js`,configPatterns:[`next.config.ts`,`next.config.js`,`next.config.mjs`,`i18n.ts`,`src/i18n.ts`,`i18n/request.ts`,`src/i18n/request.ts`],localePatterns:[`messages/*.json`,`locales/*.json`,`src/messages/*.json`,`src/locales/*.json`],sourcePatterns:[`app/**/*.tsx`,`src/app/**/*.tsx`,`pages/**/*.tsx`,`components/**/*.tsx`],migrationGuide:`next-plugin/llms-migration.txt`},"next-i18next":{name:`next-i18next`,framework:`Next.js`,configPatterns:[`next-i18next.config.js`,`next-i18next.config.mjs`,`next.config.ts`,`next.config.js`],localePatterns:[`public/locales/**/*.json`],sourcePatterns:[`pages/**/*.tsx`,`src/pages/**/*.tsx`,`components/**/*.tsx`,`src/components/**/*.tsx`],migrationGuide:`next-plugin/llms-migration.txt`},lingui:{name:`lingui`,framework:`React`,configPatterns:[`lingui.config.ts`,`lingui.config.js`,`.linguirc`],localePatterns:[`locales/*.po`,`src/locales/*.po`,`locales/*/messages.po`,`src/locales/*/messages.po`],sourcePatterns:[`src/**/*.tsx`,`src/**/*.jsx`,`src/**/*.ts`],migrationGuide:`react/llms-migration.txt`}},K=Object.keys(G);function ce(e){let t=e.toLowerCase().replace(/^@nuxtjs\//,`nuxt-`).replace(/^@/,``);return K.find(e=>e===t)}async function le(e){let t={configFiles:[],localeFiles:[],sampleSources:[],packageJson:void 0},n=(0,a.resolve)(`package.json`);(0,i.existsSync)(n)&&(t.packageJson=(0,i.readFileSync)(n,`utf-8`));for(let n of e.configPatterns){let e=(0,a.resolve)(n);(0,i.existsSync)(e)&&t.configFiles.push({path:n,content:(0,i.readFileSync)(e,`utf-8`)})}let r=await(0,s.default)(e.localePatterns,{absolute:!1});for(let e of r.slice(0,10)){let n=(0,i.readFileSync)((0,a.resolve)(e),`utf-8`);t.localeFiles.push({path:e,content:n.length>5e3?n.slice(0,5e3)+`
2
+ const e=require(`./doctor-xp8WS8sr.cjs`),t=require(`./tsx-extractor-AOjsbOmp.cjs`),n=require(`./compile-C3VLvhUf.cjs`);let r=require(`@fluenti/core/compiler`),i=require(`node:fs`),a=require(`node:path`),o=require(`node:url`),s=require(`fast-glob`);s=e.m(s);let c=require(`node:crypto`),l=require(`consola`);l=e.m(l);let u=require(`citty`),d=require(`node:child_process`),f=require(`node:util`),p=require(`node:timers/promises`),m=require(`@fluenti/core/config`);var h=`█`,g=`░`;function _(e,t=20){let n=Math.round(Math.max(0,Math.min(100,e))/100*t);return h.repeat(n)+g.repeat(t-n)}function v(e){let t=e.toFixed(1)+`%`;return e>=90?`\x1b[32m${t}\x1b[0m`:e>=70?`\x1b[33m${t}\x1b[0m`:`\x1b[31m${t}\x1b[0m`}function y(e,t,n){let r=t>0?n/t*100:0,i=t>0?v(r):`—`,a=t>0?_(r):``;return` ${e.padEnd(8)}│ ${String(t).padStart(5)} │ ${String(n).padStart(10)} │ ${a} ${i}`}var b=/\{(\w+),\s*(plural|select|selectordinal)\s*,/;function x(e){try{let t=(0,r.parse)(e),n=new Set;return S(t,n),[...n].sort()}catch{let t=new Set,n=0,r=0;for(;r<e.length;){if(e[r]===`{`){if(n++,n===1){let n=e.indexOf(`}`,r+1);if(n!==-1){let i=e.slice(r+1,n).trim(),a=/^(\w+)/.exec(i);a&&t.add(a[1])}}}else e[r]===`}`&&n--;r++}return[...t].sort()}}function S(e,t){for(let n of e)if(n.type===`variable`&&n.name!==`#`)t.add(n.name);else if(n.type===`plural`||n.type===`select`){t.add(n.variable);for(let e of Object.values(n.options))S(e,t)}else n.type===`function`&&t.add(n.variable)}function C(e){let t=new Set,n=/<\/?([a-zA-Z][\w-]*)[^>]*>/g,r;for(;(r=n.exec(e))!==null;)t.add(r[1].toLowerCase());return[...t].sort()}function ee(e,t){let n=x(e),i=x(t),a=C(e),o=C(t),s=n.filter(e=>!i.includes(e)),c=i.filter(e=>!n.includes(e)),l=a.filter(e=>!o.includes(e)),u=o.filter(e=>!a.includes(e)),d=[];if(b.test(t))try{(0,r.parse)(t)}catch(e){d.push(e.message)}return{valid:s.length===0&&c.length===0&&l.length===0&&u.length===0&&d.length===0,missingPlaceholders:s,extraPlaceholders:c,missingHtmlTags:l,extraHtmlTags:u,syntaxErrors:d}}function w(e,t){let n=[],{sourceLocale:r}=t,i=t.locales??Object.keys(e),a=e[r];if(!a)return n.push({rule:`missing-source`,severity:`error`,message:`Source locale catalog "${r}" not found`}),n;let o=Object.entries(a).filter(([,e])=>!e.obsolete).map(([e])=>e);for(let t of i){if(t===r)continue;let i=e[t];if(!i){n.push({rule:`missing-locale`,severity:`error`,message:`Catalog for locale "${t}" not found`,locale:t});continue}for(let e of o){let r=a[e],o=i[e];if(!o||!o.translation||o.translation.length===0){n.push({rule:`missing-translation`,severity:`error`,message:`Missing translation for "${e}" in locale "${t}"`,messageId:e,locale:t});continue}let s=x(r.message??e),c=x(o.translation),l=s.filter(e=>!c.includes(e)),u=c.filter(e=>!s.includes(e));l.length>0&&n.push({rule:`inconsistent-placeholders`,severity:`error`,message:`Translation for "${e}" in "${t}" is missing placeholders: ${l.map(e=>`{${e}}`).join(`, `)}`,messageId:e,locale:t}),u.length>0&&n.push({rule:`inconsistent-placeholders`,severity:`warning`,message:`Translation for "${e}" in "${t}" has extra placeholders: ${u.map(e=>`{${e}}`).join(`, `)}`,messageId:e,locale:t}),o.fuzzy&&n.push({rule:`fuzzy-translation`,severity:`warning`,message:`Translation for "${e}" in "${t}" is marked as fuzzy`,messageId:e,locale:t})}for(let[e,r]of Object.entries(i))r.obsolete||(!a[e]||a[e].obsolete)&&n.push({rule:`orphan-translation`,severity:`warning`,message:`Translation "${e}" in "${t}" has no corresponding source message`,messageId:e,locale:t})}let s=new Map;for(let[e,t]of Object.entries(a)){if(t.obsolete)continue;let n=t.message??e,r=s.get(n);r?r.push(e):s.set(n,[e])}for(let[e,t]of s)t.length>1&&n.push({rule:`duplicate-message`,severity:`info`,message:`Duplicate source message "${e.slice(0,60)}${e.length>60?`...`:``}" used by ${t.length} entries: ${t.join(`, `)}`,locale:r});return n}function T(e){if(e.length===0)return` ✓ All checks passed`;let t=[],n=E(e,e=>e.rule);for(let[e,r]of Object.entries(n)){t.push(` ${e} (${r.length}):`);for(let e of r){let n=e.severity===`error`?`✗`:e.severity===`warning`?`⚠`:`ℹ`;t.push(` ${n} ${e.message}`)}}let r=e.filter(e=>e.severity===`error`).length,i=e.filter(e=>e.severity===`warning`).length,a=e.filter(e=>e.severity===`info`).length;return t.push(``),t.push(` Summary: ${r} errors, ${i} warnings, ${a} info`),t.join(`
3
+ `)}function E(e,t){let n={};for(let r of e){let e=t(r);(n[e]??(n[e]=[])).push(r)}return n}function D(e,t){let{sourceLocale:n,minCoverage:r,locale:i}=t,a=e[n];if(!a)return{results:[],passed:!1,minCoverage:r,actualCoverage:0,diagnostics:[{rule:`missing-source`,severity:`error`,message:`Source locale catalog "${n}" not found`}]};let o=Object.entries(a).filter(([,e])=>!e.obsolete).map(([e])=>e),s=o.length,c=i?[i]:Object.keys(e).filter(e=>e!==n),l=[];for(let t of c){let n=e[t];if(!n){l.push({locale:t,total:s,translated:0,missing:s,fuzzy:0,coverage:0});continue}let r=0,i=0,a=0;for(let e of o){let t=n[e];!t||!t.translation||t.translation.length===0?i++:(r++,t.fuzzy&&a++)}let c=s>0?r/s*100:100;l.push({locale:t,total:s,translated:r,missing:i,fuzzy:a,coverage:c})}let u=l.reduce((e,t)=>e+t.translated,0),d=l.reduce((e,t)=>e+t.total,0),f=d>0?u/d*100:100,p=l.every(e=>e.coverage>=r),m={sourceLocale:n};return i&&(m.locales=[n,i]),{results:l,passed:p,minCoverage:r,actualCoverage:f,diagnostics:w(e,m)}}function te(e){let t=[];for(let n of e.results){let r=n.coverage>=e.minCoverage?`✓`:`✗`,i=n.coverage.toFixed(1),a=n.missing>0?` — ${n.missing} missing`:``,o=n.fuzzy>0?`, ${n.fuzzy} fuzzy`:``;t.push(`${r} ${n.locale}: ${i}% (${n.translated}/${n.total})${a}${o}`)}t.push(``);let n=e.actualCoverage.toFixed(1),r=e.passed?`PASSED`:`FAILED`;return t.push(`Coverage: ${n}% (min: ${e.minCoverage}%) — ${r}`),t.join(`
4
+ `)}function O(e,t,n){let r=[],i=n===`json`?`.json`:`.po`;for(let n of e.results)if(n.coverage<e.minCoverage){let a=`${t}/${n.locale}${i}`;r.push(`::error file=${a}::Translation coverage ${n.coverage.toFixed(1)}% below minimum ${e.minCoverage}%`)}let a=e.diagnostics.filter(e=>e.rule===`missing-translation`);for(let e of a)if(e.locale){let n=`${t}/${e.locale}${i}`;r.push(`::warning file=${n}::${e.message}`)}return r.join(`
5
+ `)}function k(e){return JSON.stringify({results:e.results,passed:e.passed,minCoverage:e.minCoverage,actualCoverage:Math.round(e.actualCoverage*10)/10},null,2)}var A=`1`,j=class{data;cachePath;dirty=!1;constructor(e,t){this.cachePath=(0,a.resolve)(t?(0,a.resolve)(e,`.cache`,t):(0,a.resolve)(e,`.cache`),`compile-cache.json`),this.data=this.load()}isUpToDate(e,t){let n=this.data.entries[e];if(!n)return!1;let r=M(t);return n.inputHash===r}set(e,t){this.data.entries[e]={inputHash:M(t)},this.dirty=!0}save(){if(this.dirty)try{(0,i.mkdirSync)((0,a.dirname)(this.cachePath),{recursive:!0}),(0,i.writeFileSync)(this.cachePath,JSON.stringify(this.data),`utf-8`),this.dirty=!1}catch{}}load(){try{if((0,i.existsSync)(this.cachePath)){let e=(0,i.readFileSync)(this.cachePath,`utf-8`),t=JSON.parse(e);if(t.version===A)return t}}catch{}return{version:A,entries:{}}}};function M(e){return(0,c.createHash)(`md5`).update(e).digest(`hex`)}var ne=(0,f.promisify)(d.execFile),re={claude:`npm install -g @anthropic-ai/claude-code`,codex:`npm install -g @openai/codex`};function ie(e,t){return e===`claude`?[`-p`,t]:[`-p`,t,`--full-auto`]}function ae(e){return e.code===`ENOENT`}async function N(e){let{provider:t,prompt:n,maxRetries:r=3,initialDelayMs:i=1e3,maxBuffer:a=10*1024*1024,timeoutMs:o=12e4}=e,s=ie(t,n),c=t===`claude`?`claude`:`codex`,l;for(let e=0;e<=r;e++)try{let t=ne(c,[...s],{maxBuffer:a}),{stdout:n}=await Promise.race([t,(0,p.setTimeout)(o).then(()=>{throw Error(`AI provider timed out after ${o}ms`)})]);return{stdout:n,attempts:e+1}}catch(n){if(ae(n))throw Error(`"${t}" CLI not found. Please install it first:\n ${re[t]}`);if(n instanceof Error&&n.message.includes(`timed out`))throw n;l=n,e<r&&await(0,p.setTimeout)(i*2**e)}throw l}var P=1048576;function F(e){if(!(0,i.existsSync)(e))return{};let t=(0,i.statSync)(e).size;if(t>P)throw Error(`Glossary file exceeds maximum size of ${P} bytes (got ${t} bytes)`);let n;try{let t=(0,i.readFileSync)(e,`utf-8`);n=JSON.parse(t)}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`Invalid glossary format: failed to parse JSON — ${t}`)}if(typeof n!=`object`||!n||Array.isArray(n))throw Error(`Invalid glossary format: root must be a plain object`);for(let[e,t]of Object.entries(n)){if(typeof t!=`object`||!t||Array.isArray(t))throw Error(`Invalid glossary format: value for "${e}" must be a plain object`);for(let[n,r]of Object.entries(t))if(typeof r!=`string`)throw Error(`Invalid glossary format: "${e}.${n}" must be a string, got ${typeof r}`)}return n}function I(e,t){let n={};for(let[r,i]of Object.entries(e))t in i&&(n[r]=i[t]);return n}function L(e){return e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`).replace(/[\n\r]/g,` `).replace(/\t/g,` `)}function R(e){let t=Object.entries(e);return t.length===0?``:`=== GLOSSARY (use these exact translations) ===\n${[...t].sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>`"${L(e)}" → "${L(t)}"`).join(`
6
+ `)}`}function z(e){let{sourceLocale:t,targetLocale:n,messages:r,glossary:i,context:a}=e,o=JSON.stringify(r,null,2),s=[`You are a professional translator. Translate the following messages from "${t}" to "${n}".`,``,`Rules:`,`1. Output ONLY a valid JSON object with the same keys and translated values.`,`2. Keep ICU MessageFormat placeholders unchanged: {name}, {count, plural, ...}, {val, number}, etc.`,`3. Keep HTML tags unchanged: <b>, <a href="...">, </span>, <br/>, etc.`,`4. Keep numbered rich-text tags unchanged: <0>, </0>, <1/>, etc.`,`5. Do not add any explanation, markdown formatting, or code fences — output raw JSON only.`];if(i&&Object.keys(i).length>0){let e=R(i);e&&s.push(``,e)}return a&&s.push(``,`=== PROJECT CONTEXT ===`,a),s.push(``,`Input (JSON):`,o),s.join(`
7
+ `)}function B(e){let t=e.indexOf(`{`);if(t===-1)throw Error(`No JSON object found in AI response`);let n=0,r=!1,i=!1;for(let a=t;a<e.length;a++){let o=e[a];if(i){i=!1;continue}if(o===`\\`&&r){i=!0;continue}if(o===`"`&&!i){r=!r;continue}if(!r&&(o===`{`&&n++,o===`}`&&(n--,n===0)))return e.slice(t,a+1)}throw Error(`Unterminated JSON object in AI response`)}function V(e){let t=e.match(/```(?:json)?\s*\n?([\s\S]*?)```/);return t?t[1]:e}function H(e,t){let n=[],r=B(V(e)),i;try{i=JSON.parse(r)}catch{throw Error(`Failed to parse JSON from AI response: ${r.slice(0,200)}`)}if(typeof i!=`object`||!i||Array.isArray(i))throw Error(`AI response is not a valid JSON object`);let a=i,o={},s=new Set(Object.keys(t));for(let[e,r]of Object.entries(a)){if(!s.has(e)){n.push(`Extra key in AI response (ignored): "${e}"`);continue}if(typeof r!=`string`){n.push(`Non-string value for key "${e}" (ignored)`);continue}o[e]=r;let i=t[e],a=ee(i,r);if(!a.valid){let t=[];a.missingPlaceholders.length>0&&t.push(`missing placeholders: ${a.missingPlaceholders.join(`, `)}`),a.extraPlaceholders.length>0&&t.push(`extra placeholders: ${a.extraPlaceholders.join(`, `)}`),a.missingHtmlTags.length>0&&t.push(`missing HTML tags: ${a.missingHtmlTags.join(`, `)}`),a.extraHtmlTags.length>0&&t.push(`extra HTML tags: ${a.extraHtmlTags.join(`, `)}`),a.syntaxErrors.length>0&&t.push(`ICU syntax errors: ${a.syntaxErrors.join(`; `)}`),n.push(`QA issue for "${e}": ${t.join(`; `)}`)}}for(let e of s)e in o||n.push(`Missing translation for key: "${e}"`);return{translations:o,warnings:n}}function U(e){let t={};for(let[n,r]of Object.entries(e))r.obsolete||(!r.translation||r.translation.length===0)&&(t[n]=r.message??n);return t}function W(e,t){let n=Object.keys(e),r=[];for(let i=0;i<n.length;i+=t){let a={};for(let r of n.slice(i,i+t))a[r]=e[r];r.push(a)}return r}async function G(e){let{provider:t,sourceLocale:n,targetLocale:r,catalog:i,batchSize:a,context:o,glossary:s,timeoutMs:c}=e,u=U(i),d=Object.keys(u).length;if(d===0)return{catalog:{...i},translated:0,warnings:[]};l.default.info(` ${d} untranslated messages, translating with ${t}...`);let f={...i},p=W(u,a),m=0,h=[];for(let e=0;e<p.length;e++){let i=p[e],a=Object.keys(i);p.length>1&&l.default.info(` Batch ${e+1}/${p.length} (${a.length} messages)`);try{let{stdout:e}=await N({provider:t,prompt:z({sourceLocale:n,targetLocale:r,messages:i,glossary:s,context:o}),timeoutMs:c}),{translations:u,warnings:d}=H(e,i);for(let e of d)h.push(`[${r}] ${e}`),l.default.warn(` ${e}`);for(let e of a)e in u&&(f[e]={...f[e],translation:u[e]},m++)}catch(t){let n=t instanceof Error?t.message:String(t);h.push(`[${r}] Batch ${e+1} failed: ${n}`),l.default.error(` Batch ${e+1} failed: ${n}`)}}return{catalog:f,translated:m,warnings:h}}var K=(0,f.promisify)(d.execFile),q={"vue-i18n":{name:`vue-i18n`,framework:`Vue`,configPatterns:[`i18n.ts`,`i18n.js`,`i18n/index.ts`,`i18n/index.js`,`src/i18n.ts`,`src/i18n.js`,`src/i18n/index.ts`,`src/plugins/i18n.ts`],localePatterns:[`locales/*.json`,`src/locales/*.json`,`i18n/*.json`,`src/i18n/*.json`,`lang/*.json`,`src/lang/*.json`,`locales/*.yaml`,`locales/*.yml`],sourcePatterns:[`src/**/*.vue`],migrationGuide:`vue/llms-migration.txt`},"nuxt-i18n":{name:`nuxt-i18n`,framework:`Nuxt`,configPatterns:[`nuxt.config.ts`,`nuxt.config.js`,`i18n.config.ts`,`i18n.config.js`],localePatterns:[`locales/*.json`,`lang/*.json`,`i18n/*.json`,`locales/*.yaml`,`locales/*.yml`],sourcePatterns:[`pages/**/*.vue`,`components/**/*.vue`,`layouts/**/*.vue`],migrationGuide:`nuxt/llms-migration.txt`},"react-i18next":{name:`react-i18next`,framework:`React`,configPatterns:[`i18n.ts`,`i18n.js`,`src/i18n.ts`,`src/i18n.js`,`src/i18n/index.ts`,`src/i18n/config.ts`],localePatterns:[`locales/*.json`,`src/locales/*.json`,`public/locales/**/*.json`,`translations/*.json`,`src/translations/*.json`],sourcePatterns:[`src/**/*.tsx`,`src/**/*.jsx`,`src/**/*.ts`],migrationGuide:`react/llms-migration.txt`},"next-intl":{name:`next-intl`,framework:`Next.js`,configPatterns:[`next.config.ts`,`next.config.js`,`next.config.mjs`,`i18n.ts`,`src/i18n.ts`,`i18n/request.ts`,`src/i18n/request.ts`],localePatterns:[`messages/*.json`,`locales/*.json`,`src/messages/*.json`,`src/locales/*.json`],sourcePatterns:[`app/**/*.tsx`,`src/app/**/*.tsx`,`pages/**/*.tsx`,`components/**/*.tsx`],migrationGuide:`next-plugin/llms-migration.txt`},"next-i18next":{name:`next-i18next`,framework:`Next.js`,configPatterns:[`next-i18next.config.js`,`next-i18next.config.mjs`,`next.config.ts`,`next.config.js`],localePatterns:[`public/locales/**/*.json`],sourcePatterns:[`pages/**/*.tsx`,`src/pages/**/*.tsx`,`components/**/*.tsx`,`src/components/**/*.tsx`],migrationGuide:`next-plugin/llms-migration.txt`},lingui:{name:`lingui`,framework:`React`,configPatterns:[`lingui.config.ts`,`lingui.config.js`,`.linguirc`],localePatterns:[`locales/*.po`,`src/locales/*.po`,`locales/*/messages.po`,`src/locales/*/messages.po`],sourcePatterns:[`src/**/*.tsx`,`src/**/*.jsx`,`src/**/*.ts`],migrationGuide:`react/llms-migration.txt`}},J=Object.keys(q);function oe(e){let t=e.toLowerCase().replace(/^@nuxtjs\//,`nuxt-`).replace(/^@/,``);return J.find(e=>e===t)}async function se(e){let t={configFiles:[],localeFiles:[],sampleSources:[],packageJson:void 0},n=(0,a.resolve)(`package.json`);(0,i.existsSync)(n)&&(t.packageJson=(0,i.readFileSync)(n,`utf-8`));for(let n of e.configPatterns){let e=(0,a.resolve)(n);(0,i.existsSync)(e)&&t.configFiles.push({path:n,content:(0,i.readFileSync)(e,`utf-8`)})}let r=await(0,s.default)(e.localePatterns,{absolute:!1});for(let e of r.slice(0,10)){let n=(0,i.readFileSync)((0,a.resolve)(e),`utf-8`);t.localeFiles.push({path:e,content:n.length>5e3?n.slice(0,5e3)+`
8
8
  ... (truncated)`:n})}let o=await(0,s.default)(e.sourcePatterns,{absolute:!1});for(let e of o.slice(0,5)){let n=(0,i.readFileSync)((0,a.resolve)(e),`utf-8`);t.sampleSources.push({path:e,content:n.length>3e3?n.slice(0,3e3)+`
9
- ... (truncated)`:n})}return t}function ue(e){let t=typeof __dirname<`u`?__dirname:(0,a.dirname)((0,o.fileURLToPath)({}.url)),n=[(0,a.resolve)(`node_modules`,`@fluenti`,`cli`,`..`,`..`,e),(0,a.join)(t,`..`,`..`,`..`,e),(0,a.join)(t,`..`,`..`,e)];for(let e of n)if((0,i.existsSync)(e))return(0,i.readFileSync)(e,`utf-8`);return``}function q(e,t,n){let r=[];if(r.push(`You are a migration tool converting a ${e.framework} project from "${e.name}" to Fluenti (@fluenti).`,``,`Tasks:`,"1. Generate a `fluenti.config.ts` based on the existing i18n configuration",`2. Convert each locale/translation file to standard gettext PO format`,`3. Generate unified diff patches for every source file that needs changes`,`4. Generate install/uninstall commands`,``,`=== TRANSLATION API RULES ===`,"Fluenti provides a compile-time `t` tagged template that does NOT require useI18n():",``,` import { t } from '@fluenti/react' // or @fluenti/vue, @fluenti/solid`,` const name = "World"`," t`Hello, ${name}!`",``,"Use `import { t }` for ALL translation calls. Only use `useI18n()` when you need:","- `d()` / `n()` for date/number formatting","- `setLocale()` for locale switching","- `locale` for reading the current locale reactively",``,`=== SOURCE CODE REWRITING RULES ===`,`Imports:`,`- ${e.name}: remove all imports from "${e.name}" (and related packages)`,`- Add: import { t } from '@fluenti/${e.framework===`Vue`?`vue`:e.framework===`Next.js`?`react`:e.framework.toLowerCase()}'`,`- Only add useI18n import if d()/n()/setLocale is needed in that file`,``,`Translation calls:`,"- t('key') → t`Source text` (tagged template with the actual source text, not the key)","- t('key', { name }) → t`Hello, ${name}` (interpolate directly in template)","- $t('key') → t`Source text` (Vue template)",`- Remove useI18n()/useTranslation()/useTranslations() destructuring if only t was used`,``,`Components:`,`- <i18n-t keypath="key"> → <Trans>Source text</Trans>`,`- <Trans i18nKey="key"> → <Trans>Source text</Trans>`,``,`ICU syntax conversion:`,`- {{variable}} (double braces) → {variable} (single braces)`,`- _one/_other suffixes → ICU {count, plural, one {...} other {...}}`,`- @:key references → inline the referenced text directly`,`- Pipe-separated plurals → ICU plural`,``,`=== PO FORMAT RULES ===`,`Each PO file must have a standard header:`,` msgid ""`,` msgstr ""`,` "Content-Type: text/plain; charset=UTF-8\\n"`,` "Content-Transfer-Encoding: 8bit\\n"`,` "Language: {locale}\\n"`,``,`Message entries: msgid is the source text (English), msgstr is the translation.`,`Flatten nested JSON keys: "home.title" → use the actual source text as msgid.`,``),n&&r.push(`=== MIGRATION GUIDE ===`,n,``),t.packageJson&&r.push(`=== package.json ===`,t.packageJson,``),t.configFiles.length>0){r.push(`=== EXISTING CONFIG FILES ===`);for(let e of t.configFiles)r.push(`--- ${e.path} ---`,e.content,``)}if(t.localeFiles.length>0){r.push(`=== EXISTING LOCALE FILES ===`);for(let e of t.localeFiles)r.push(`--- ${e.path} ---`,e.content,``)}if(t.sampleSources.length>0){r.push(`=== SAMPLE SOURCE FILES ===`);for(let e of t.sampleSources)r.push(`--- ${e.path} ---`,e.content,``)}return r.push(``,`=== OUTPUT FORMAT ===`,`Output ONLY the following sections. No explanations, no commentary.`,``,`### FLUENTI_CONFIG`,"```ts",`// Complete fluenti.config.ts`,"```",``,`### LOCALE_FILES`,`#### LOCALE: {locale_code}`,"```po",`// Complete PO file with standard header`,"```",`(repeat for each locale)`,``,`### SOURCE_PATCHES`,`#### FILE: {relative_file_path}`,"```diff",`--- a/{file_path}`,`+++ b/{file_path}`,`@@ ... @@`,` context line`,`-removed line`,`+added line`,"```",`(repeat for each file that needs changes)`,``,`### INSTALL_COMMANDS`,"```bash",`// install + uninstall commands`,"```"),r.join(`
10
- `)}async function de(e,t){let n=10*1024*1024;try{if(e===`claude`){let{stdout:e}=await W(`claude`,[`-p`,t],{maxBuffer:n});return e}else{let{stdout:e}=await W(`codex`,[`-p`,t,`--full-auto`],{maxBuffer:n});return e}}catch(t){let n=t;throw n.code===`ENOENT`||n.code===`EPERM`||n.code===`EACCES`?Error(`"${e}" CLI not found or not executable. Please install it first:\n`+(e===`claude`?` npm install -g @anthropic-ai/claude-code`:` npm install -g @openai/codex`)):t}}function fe(e){let t=5e5,n=e.length>t?e.slice(0,t):e,r={config:void 0,localeFiles:[],sourcePatches:[],steps:void 0,installCommands:void 0},i=n.match(/### FLUENTI_CONFIG[\s\S]*?```(?:ts|typescript)?\n([\s\S]*?)```/);i&&(r.config=i[1].trim());let a=n.match(/### LOCALE_FILES([\s\S]*?)(?=### SOURCE_PATCHES|### MIGRATION_STEPS|### INSTALL_COMMANDS|$)/);if(a){let e=/#### LOCALE:\s*(\S+)\s*\n```(?:po)?\n([\s\S]*?)```/g,t;for(;(t=e.exec(a[1]))!==null;)r.localeFiles.push({locale:t[1],content:t[2].trim()})}let o=n.match(/### SOURCE_PATCHES([\s\S]*?)(?=### INSTALL_COMMANDS|$)/);if(o){let e=/#### FILE:\s*(\S+)\s*\n```(?:diff)?\n([\s\S]*?)```/g,t;for(;(t=e.exec(o[1]))!==null;)r.sourcePatches.push({file:t[1],patch:t[2].trim()})}let s=n.match(/### MIGRATION_STEPS\s*\n([\s\S]*?)(?=### INSTALL_COMMANDS|$)/);s&&(r.steps=s[1].trim());let c=n.match(/### INSTALL_COMMANDS[\s\S]*?```(?:bash|sh)?\n([\s\S]*?)```/);return c&&(r.installCommands=c[1].trim()),r}async function pe(e){let{from:t,provider:n,write:r}=e,i=ce(t);if(!i){u.default.error(`Unsupported library "${t}". Supported libraries:`);for(let e of K)u.default.log(` - ${e}`);return}let o=G[i];u.default.info(`Migrating from ${o.name} (${o.framework}) to Fluenti`),u.default.info(`Scanning project for existing i18n files...`);let s=await le(o);if(s.configFiles.length===0&&s.localeFiles.length===0){u.default.warn(`No ${o.name} configuration or locale files found.`),u.default.info(`Make sure you are running this command from the project root directory.`);return}u.default.info(`Found: ${s.configFiles.length} config file(s), ${s.localeFiles.length} locale file(s), ${s.sampleSources.length} source file(s)`);let c=ue(o.migrationGuide);u.default.info(`Generating migration plan with ${n}...`);let l=fe(await de(n,q(o,s,c)));if(l.installCommands&&(u.default.log(``),u.default.box({title:`Install Commands`,message:l.installCommands})),l.config)if(r){let{writeFileSync:e}=await import(`node:fs`),t=(0,a.resolve)(`fluenti.config.ts`);e(t,l.config,`utf-8`),u.default.success(`Written: ${t}`)}else u.default.log(``),u.default.box({title:`fluenti.config.ts`,message:l.config});if(l.localeFiles.length>0)if(r){let{writeFileSync:e,mkdirSync:t}=await import(`node:fs`),n=`./locales`;t((0,a.resolve)(n),{recursive:!0});for(let t of l.localeFiles){let r=(0,a.resolve)(n,`${t.locale}.po`);e(r,t.content,`utf-8`),u.default.success(`Written: ${r}`)}}else for(let e of l.localeFiles)u.default.log(``),u.default.box({title:`locales/${e.locale}.po`,message:e.content.length>500?e.content.slice(0,500)+`
11
- ... (use --write to save full file)`:e.content});if(l.sourcePatches.length>0)if(r){u.default.log(``),u.default.info(`Generated ${l.sourcePatches.length} source patch(es). Apply with:`);for(let e of l.sourcePatches){let t=(0,a.resolve)(`.fluenti-migrate-${e.file.replace(/[/\\]/g,`-`)}.patch`),{writeFileSync:n}=await import(`node:fs`);n(t,e.patch,`utf-8`),u.default.success(`Patch written: ${t}`),u.default.log(` patch -p1 < ${t}`)}}else for(let e of l.sourcePatches)u.default.log(``),u.default.box({title:`Patch: ${e.file}`,message:e.patch.length>800?e.patch.slice(0,800)+`
12
- ... (use --write to save full patch)`:e.patch});l.steps&&l.sourcePatches.length===0&&(u.default.log(``),u.default.box({title:`Migration Steps`,message:l.steps})),!r&&(l.config||l.localeFiles.length>0||l.sourcePatches.length>0)&&(u.default.log(``),u.default.info(`Run with --write to save generated files and patches to disk:`),u.default.log(` fluenti migrate --from ${t} --write`))}var me=/^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{1,8})*$/;function J(e){if(!me.test(e))throw Error(`Invalid locale format: "${e}"`);return e}var he=[{dep:`next`,name:`nextjs`,pluginPackage:`@fluenti/next`},{dep:`nuxt`,name:`nuxt`,pluginPackage:`@fluenti/vue`},{dep:`@solidjs/start`,name:`solidstart`,pluginPackage:`@fluenti/solid`},{dep:`vue`,name:`vue`,pluginPackage:`@fluenti/vue`},{dep:`solid-js`,name:`solid`,pluginPackage:`@fluenti/solid`},{dep:`react`,name:`react`,pluginPackage:`@fluenti/react`}];function ge(e){for(let t of he)if(t.dep in e)return{name:t.name,pluginPackage:t.pluginPackage};return{name:`unknown`,pluginPackage:null}}function _e(e){let t=e.locales.map(e=>JSON.stringify(e)).join(`, `);return`import { defineConfig } from '@fluenti/cli'
13
-
14
- export default defineConfig({
15
- sourceLocale: ${JSON.stringify(e.sourceLocale)},
16
- locales: [${t}],
17
- catalogDir: './locales',
18
- format: ${JSON.stringify(e.format)},
19
- include: ['./src/**/*.{vue,tsx,jsx,ts,js}'],
20
- compileOutDir: './src/locales/compiled',
21
- })
22
- `}async function ve(e){let t=(0,a.resolve)(e.cwd,`package.json`);if(!(0,i.existsSync)(t)){u.default.error(`No package.json found in current directory.`);return}let n=JSON.parse((0,i.readFileSync)(t,`utf-8`)),r=ge({...n.dependencies,...n.devDependencies});u.default.info(`Detected framework: ${r.name}`),r.pluginPackage&&u.default.info(`Recommended plugin: ${r.pluginPackage}`);let o=(0,a.resolve)(e.cwd,`fluenti.config.ts`);if((0,i.existsSync)(o)){u.default.warn(`fluenti.config.ts already exists. Skipping config generation.`);return}let s=await u.default.prompt(`Source locale?`,{type:`text`,default:`en`,placeholder:`en`});if(typeof s==`symbol`)return;let c=await u.default.prompt(`Target locales (comma-separated)?`,{type:`text`,default:`ja,zh-CN`,placeholder:`ja,zh-CN`});if(typeof c==`symbol`)return;let l=await u.default.prompt(`Catalog format?`,{type:`select`,options:[`po`,`json`],initial:`po`});if(typeof l==`symbol`)return;let d=c.split(`,`).map(e=>e.trim()).filter(Boolean);J(s);for(let e of d)J(e);(0,i.writeFileSync)(o,_e({sourceLocale:s,locales:[s,...d.filter(e=>e!==s)],format:l}),`utf-8`),u.default.success(`Created fluenti.config.ts`);let f=(0,a.resolve)(e.cwd,`.gitignore`),p=`src/locales/compiled/`;(0,i.existsSync)(f)?(0,i.readFileSync)(f,`utf-8`).includes(p)||((0,i.appendFileSync)(f,`\n# Fluenti compiled catalogs\n${p}\n`),u.default.success(`Updated .gitignore`)):((0,i.writeFileSync)(f,`# Fluenti compiled catalogs\n${p}\n`),u.default.success(`Created .gitignore`));let m=n.scripts??{},h={},g=!1;if(m[`i18n:extract`]||(h[`i18n:extract`]=`fluenti extract`,g=!0),m[`i18n:compile`]||(h[`i18n:compile`]=`fluenti compile`,g=!0),g){let e={...n,scripts:{...m,...h}};(0,i.writeFileSync)(t,JSON.stringify(e,null,2)+`
23
- `,`utf-8`),u.default.success(`Added i18n:extract and i18n:compile scripts to package.json`)}u.default.log(``),u.default.box({title:`Next steps`,message:[r.pluginPackage?`1. Install: pnpm add -D ${r.pluginPackage} @fluenti/cli`:`1. Install: pnpm add -D @fluenti/cli`,r.name===`nextjs`?`2. Add withFluenti() to your next.config.ts`:r.name===`unknown`?`2. Configure your build tool with the framework Vite plugin or @fluenti/next`:`2. Add the Vite plugin to your vite.config.ts (e.g. fluentiVue() from @fluenti/vue/vite-plugin)`,`3. Run: npx fluenti extract`,`4. Translate your messages`,`5. Run: npx fluenti compile`].join(`
24
- `)})}function Y(e){return(0,c.createHash)(`md5`).update(e).digest(`hex`).slice(0,8)}function X(t,n){if(!(0,i.existsSync)(t))return{};let r=(0,i.readFileSync)(t,`utf-8`);return n===`json`?e.a(r):e.r(r)}function Z(t,n,r){(0,i.mkdirSync)((0,a.dirname)(t),{recursive:!0}),(0,i.writeFileSync)(t,r===`json`?e.o(n):e.i(n),`utf-8`)}async function ye(e,n,r){if((0,a.extname)(e)===`.vue`)try{let{extractFromVue:t}=await Promise.resolve().then(()=>require(`./vue-extractor.cjs`));return t(n,e,r)}catch{return u.default.warn(`Skipping ${e}: install @vue/compiler-sfc to extract from .vue files`),[]}return t.t(n,e,r)}var be=(0,l.defineCommand)({meta:{name:`extract`,description:`Extract messages from source files`},args:{config:{type:`string`,description:`Path to config file`},clean:{type:`boolean`,description:`Remove obsolete entries instead of marking them`,default:!1},"no-fuzzy":{type:`boolean`,description:`Strip fuzzy flags from all entries`,default:!1},"no-cache":{type:`boolean`,description:`Disable incremental extraction cache`,default:!1}},async run({args:t}){let n=await(0,m.loadConfig)(t.config),o=(0,r.resolveLocaleCodes)(n.locales);u.default.info(`Extracting messages from ${n.include.join(`, `)}`);let c=await(0,s.default)(n.include,{ignore:n.exclude??[]}),l=[],d=t[`no-cache`]??!1?null:new e.t(n.catalogDir,Y(process.cwd())),f=0;for(let e of c){if(d){let t=d.get(e);if(t){l.push(...t),f++;continue}}let t=await ye(e,(0,i.readFileSync)(e,`utf-8`),n.idGenerator);l.push(...t),d&&d.set(e,t)}d&&(d.prune(new Set(c)),d.save()),f>0?u.default.info(`Found ${l.length} messages in ${c.length} files (${f} cached)`):u.default.info(`Found ${l.length} messages in ${c.length} files`);let p=n.format===`json`?`.json`:`.po`,h=t.clean??!1,g=t[`no-fuzzy`]??!1;for(let t of o){let r=(0,a.resolve)(n.catalogDir,`${t}${p}`),{catalog:i,result:o}=e.s(X(r,n.format),l,{stripFuzzy:g});Z(r,h?Object.fromEntries(Object.entries(i).filter(([,e])=>!e.obsolete)):i,n.format);let s=h?`${o.obsolete} removed`:`${o.obsolete} obsolete`;u.default.success(`${t}: ${o.added} added, ${o.unchanged} unchanged, ${s}`)}for(let e of n.plugins??[])await e.onAfterExtract?.({messages:new Map(l.map(e=>[e.id,e])),sourceLocale:n.sourceLocale,targetLocales:o.filter(e=>e!==n.sourceLocale),config:n})}});function xe(e){let t={};for(let[n,r]of Object.entries(e))r.translation&&r.translation.length>0?t[n]=r.translation:r.message&&(t[n]=r.message);return t}async function Q(e,t,n){let r=xe(e);for(let e of n)e.transformMessages&&(r=await e.transformMessages(r,t));let i={};for(let[t,n]of Object.entries(e)){let e=r[t];i[t]=e===void 0?{...n}:{...n,translation:e}}return i}function $(e,t,n,r){let i={};for(let[e,n]of Object.entries(t))n.translation&&n.translation.length>0?i[e]=n.translation:n.message&&(i[e]=n.message);return{locale:e,messages:i,outDir:n,config:r}}var Se=(0,l.defineCommand)({meta:{name:`compile`,description:`Compile message catalogs to JS modules`},args:{config:{type:`string`,description:`Path to config file`},"skip-fuzzy":{type:`boolean`,description:`Exclude fuzzy entries from compilation`,default:!1},"no-cache":{type:`boolean`,description:`Disable compilation cache`,default:!1},parallel:{type:`boolean`,description:`Enable parallel compilation using worker threads`,default:!1},concurrency:{type:`string`,description:`Max number of worker threads (default: auto)`}},async run({args:t}){let o=await(0,m.loadConfig)(t.config),s=(0,r.resolveLocaleCodes)(o.locales),c=o.format===`json`?`.json`:`.po`;(0,i.mkdirSync)(o.compileOutDir,{recursive:!0});let l={},d={};for(let t of s){let n=(0,a.resolve)(o.catalogDir,`${t}${c}`);if((0,i.existsSync)(n)){let r=(0,i.readFileSync)(n,`utf-8`);d[t]=r,l[t]=o.format===`json`?e.a(r):e.r(r)}else d[t]=``,l[t]={}}let f=n.t(l);u.default.info(`Compiling ${f.length} messages across ${s.length} locales`);let p=t[`skip-fuzzy`]??!1,h=t[`no-cache`]??!1?null:new A(o.catalogDir,Y(process.cwd())),g=t.parallel??!1,_=t.concurrency?parseInt(t.concurrency,10):void 0;if(_!==void 0&&(isNaN(_)||_<1)){u.default.error(`Invalid --concurrency. Must be a positive integer.`),process.exitCode=1;return}let v=0,y=!1,b=[];for(let e of s){if(h&&h.isUpToDate(e,d[e])&&(0,i.existsSync)((0,a.resolve)(o.compileOutDir,`${e}.js`))){v++;continue}b.push(e)}if(b.length>0&&(y=!0),g&&b.length>1){let t=o.plugins??[],n={};for(let e of b){for(let n of t)await n.onBeforeCompile?.($(e,l[e],o.compileOutDir,o));n[e]=t.length>0?await Q(l[e],e,t):l[e]}let r=await e.n(b.map(e=>({locale:e,catalog:n[e],allIds:f,sourceLocale:o.sourceLocale,options:{skipFuzzy:p}})),_);for(let e of r){let t=(0,a.resolve)(o.compileOutDir,`${e.locale}.js`);if((0,i.writeFileSync)(t,e.code,`utf-8`),h&&h.set(e.locale,d[e.locale]),e.stats.missing.length>0){u.default.warn(`${e.locale}: ${e.stats.compiled} compiled, ${e.stats.missing.length} missing translations`);for(let t of e.stats.missing)u.default.warn(` ⤷ ${t}`)}else u.default.success(`Compiled ${e.locale}: ${e.stats.compiled} messages → ${t}`)}for(let e of b)for(let r of t)await r.onAfterCompile?.($(e,n[e],o.compileOutDir,o))}else{let e=o.plugins??[];for(let t of b){let r=(0,a.resolve)(o.compileOutDir,`${t}.js`);for(let n of e)await n.onBeforeCompile?.($(t,l[t],o.compileOutDir,o));let s=e.length>0?await Q(l[t],t,e):l[t],{code:c,stats:m}=n.n(s,t,f,o.sourceLocale,{skipFuzzy:p});if((0,i.writeFileSync)(r,c,`utf-8`),h&&h.set(t,d[t]),m.missing.length>0){u.default.warn(`${t}: ${m.compiled} compiled, ${m.missing.length} missing translations`);for(let e of m.missing)u.default.warn(` ⤷ ${e}`)}else u.default.success(`Compiled ${t}: ${m.compiled} messages → ${r}`);for(let n of e)await n.onAfterCompile?.($(t,s,o.compileOutDir,o))}}v>0&&u.default.info(`${v} locale(s) unchanged — skipped`),h&&h.save();let x=(0,a.resolve)(o.compileOutDir,`index.js`),S=(0,a.resolve)(o.compileOutDir,`messages.d.ts`);(y||!(0,i.existsSync)(x))&&((0,i.writeFileSync)(x,n.r(s,o.compileOutDir),`utf-8`),u.default.success(`Generated index → ${x}`)),(y||!(0,i.existsSync)(S))&&((0,i.writeFileSync)(S,n.i(f,l,o.sourceLocale),`utf-8`),u.default.success(`Generated types → ${S}`))}}),Ce=(0,l.defineCommand)({meta:{name:`stats`,description:`Show translation progress`},args:{config:{type:`string`,description:`Path to config file`}},async run({args:e}){let t=await(0,m.loadConfig)(e.config),n=(0,r.resolveLocaleCodes)(t.locales),i=t.format===`json`?`.json`:`.po`,o=[];for(let e of n){let n=X((0,a.resolve)(t.catalogDir,`${e}${i}`),t.format),r=Object.values(n).filter(e=>!e.obsolete),s=r.length,c=r.filter(e=>e.translation&&e.translation.length>0).length,l=s>0?(c/s*100).toFixed(1)+`%`:`—`;o.push({locale:e,total:s,translated:c,pct:l})}u.default.log(``),u.default.log(` Locale │ Total │ Translated │ Progress`),u.default.log(` ────────┼───────┼────────────┼─────────────────────────────`);for(let e of o)u.default.log(y(e.locale,e.total,e.translated));u.default.log(``)}}),we=(0,l.defineCommand)({meta:{name:`lint`,description:`Check translation quality (missing, inconsistent placeholders, fuzzy)`},args:{config:{type:`string`,description:`Path to config file`},strict:{type:`boolean`,description:`Treat warnings as errors`,default:!1},locale:{type:`string`,description:`Lint a specific locale only`}},async run({args:e}){let t=await(0,m.loadConfig)(e.config),n=(0,r.resolveLocaleCodes)(t.locales),i=t.format===`json`?`.json`:`.po`,o={};for(let e of n)o[e]=X((0,a.resolve)(t.catalogDir,`${e}${i}`),t.format);let s=e.locale?[e.locale]:void 0;u.default.info(`Linting ${s?s.join(`, `):`all locales`} (source: ${t.sourceLocale})`);let c={sourceLocale:t.sourceLocale,strict:e.strict??!1};s&&(c.locales=s);let l=w(o,c);u.default.log(``),u.default.log(T(l)),u.default.log(``);let d=l.filter(e=>e.severity===`error`),f=l.filter(e=>e.severity===`warning`);(d.length>0||e.strict&&f.length>0)&&(process.exitCode=1)}}),Te=(0,l.defineCommand)({meta:{name:`check`,description:`Check translation coverage for CI`},args:{config:{type:`string`,description:`Path to config file`},ci:{type:`boolean`,description:`Alias for --format github`,default:!1},"min-coverage":{type:`string`,description:`Minimum coverage percentage (0-100)`,default:`100`},format:{type:`string`,description:`Output format: text | json | github`},locale:{type:`string`,description:`Check a specific locale only`}},async run({args:e}){let t=await(0,m.loadConfig)(e.config),n=(0,r.resolveLocaleCodes)(t.locales),i=t.format===`json`?`.json`:`.po`,o={};for(let e of n)o[e]=X((0,a.resolve)(t.catalogDir,`${e}${i}`),t.format);let s=parseFloat(e[`min-coverage`]??`100`);if(isNaN(s)||s<0||s>100){u.default.error(`Invalid --min-coverage. Must be a number between 0 and 100.`),process.exitCode=1;return}let c=e.format??(e.ci?`github`:`text`),l={sourceLocale:t.sourceLocale,minCoverage:s,format:c};e.locale&&(l.locale=e.locale);let d=E(o,l);switch(c){case`json`:u.default.log(O(d));break;case`github`:u.default.log(D(d,t.catalogDir,t.format));break;default:u.default.log(``),u.default.log(ne(d)),u.default.log(``);break}d.passed||(process.exitCode=1)}});async function Ee(e,t,n){let r=Array(e.length),i=0,a=Array.from({length:Math.min(n,e.length)},async()=>{for(;i<e.length;){let n=i++;r[n]=await t(e[n])}});return await Promise.all(a),r}var De=(0,l.defineCommand)({meta:{name:`translate`,description:`Translate messages using AI (Claude Code or Codex CLI)`},args:{config:{type:`string`,description:`Path to config file`},provider:{type:`string`,description:`AI provider: claude or codex`,default:`claude`},locale:{type:`string`,description:`Translate a specific locale only`},"batch-size":{type:`string`,description:`Messages per batch`,default:`50`},"dry-run":{type:`boolean`,description:`Preview translation results without writing files`,default:!1},context:{type:`string`,description:`Project context description to improve translation quality`},glossary:{type:`string`,description:`Path to glossary JSON file`},concurrency:{type:`string`,description:`Max parallel locale translations (default: 3)`},timeout:{type:`string`,description:`AI call timeout in seconds (default: 120)`}},async run({args:e}){let t=await(0,m.loadConfig)(e.config),n=(0,r.resolveLocaleCodes)(t.locales),i=e.provider;if(i!==`claude`&&i!==`codex`){u.default.error(`Invalid provider "${i}". Use "claude" or "codex".`);return}let o=parseInt(e[`batch-size`]??`50`,10);if(isNaN(o)||o<1){u.default.error(`Invalid batch-size. Must be a positive integer.`);return}let s=e.glossary?N((0,a.resolve)(e.glossary)):void 0,c=e.concurrency?parseInt(e.concurrency,10):3;if(isNaN(c)||c<1){u.default.error(`Invalid concurrency. Must be a positive integer.`);return}let l=e.timeout?parseInt(e.timeout,10):120;if(isNaN(l)||l<1){u.default.error(`Invalid timeout. Must be a positive integer (seconds).`);return}let d=l*1e3,f=e.locale?[e.locale]:n.filter(e=>e!==t.sourceLocale);if(f.length===0){u.default.warn(`No target locales to translate.`);return}u.default.info(`Translating with ${i} (batch size: ${o})`);let p=t.format===`json`?`.json`:`.po`;await Ee(f,async n=>{u.default.info(`\n[${n}]`);let r=(0,a.resolve)(t.catalogDir,`${n}${p}`),c=X(r,t.format);if(e[`dry-run`]){let e=Object.entries(c).filter(([,e])=>!e.obsolete&&(!e.translation||e.translation.length===0));if(e.length>0){for(let[t,n]of e)u.default.log(` ${t}: ${n.message??t}`);u.default.success(` ${n}: ${e.length} messages would be translated (dry-run)`)}else u.default.success(` ${n}: already fully translated`);return}let l=s?P(s,n):void 0,{catalog:f,translated:m,warnings:h}=await U({provider:i,sourceLocale:t.sourceLocale,targetLocale:n,catalog:c,batchSize:o,glossary:l,timeoutMs:d,...e.context?{context:e.context}:{}});m>0?(Z(r,f,t.format),u.default.success(` ${n}: ${m} messages translated`)):u.default.success(` ${n}: already fully translated`),h.length>0&&u.default.warn(` ${n}: ${h.length} QA warnings`)},c)}}),Oe=(0,l.defineCommand)({meta:{name:`migrate`,description:`Migrate from another i18n library using AI`},args:{from:{type:`string`,description:`Source library: vue-i18n, nuxt-i18n, react-i18next, next-intl, next-i18next, lingui`,required:!0},provider:{type:`string`,description:`AI provider: claude or codex`,default:`claude`},write:{type:`boolean`,description:`Write generated files to disk`,default:!1}},async run({args:e}){let t=e.provider;if(t!==`claude`&&t!==`codex`){u.default.error(`Invalid provider "${t}". Use "claude" or "codex".`);return}await pe({from:e.from,provider:t,write:e.write??!1})}});(0,l.runMain)((0,l.defineCommand)({meta:{name:`fluenti`,version:`0.0.1`,description:`Compile-time i18n for modern frameworks`},subCommands:{init:(0,l.defineCommand)({meta:{name:`init`,description:`Initialize Fluenti in your project`},args:{},async run(){await ve({cwd:process.cwd()})}}),extract:be,compile:Se,stats:Ce,lint:we,check:Te,translate:De,migrate:Oe}}));
9
+ ... (truncated)`:n})}return t}function ce(e){let t=typeof __dirname<`u`?__dirname:(0,a.dirname)((0,o.fileURLToPath)({}.url)),n=[(0,a.resolve)(`node_modules`,`@fluenti`,`cli`,`..`,`..`,e),(0,a.join)(t,`..`,`..`,`..`,e),(0,a.join)(t,`..`,`..`,e)];for(let e of n)if((0,i.existsSync)(e))return(0,i.readFileSync)(e,`utf-8`);return``}function le(e,t,n){let r=[];if(r.push(`You are a migration tool converting a ${e.framework} project from "${e.name}" to Fluenti (@fluenti).`,``,`Tasks:`,"1. Generate a `fluenti.config.ts` based on the existing i18n configuration",`2. Convert each locale/translation file to standard gettext PO format`,`3. Generate unified diff patches for every source file that needs changes`,`4. Generate install/uninstall commands`,``,`=== TRANSLATION API RULES ===`,"Fluenti provides a compile-time `t` tagged template that does NOT require useI18n():",``,` import { t } from '@fluenti/react' // or @fluenti/vue, @fluenti/solid`,` const name = "World"`," t`Hello, ${name}!`",``,"Use `import { t }` for ALL translation calls. Only use `useI18n()` when you need:","- `d()` / `n()` for date/number formatting","- `setLocale()` for locale switching","- `locale` for reading the current locale reactively",``,`=== SOURCE CODE REWRITING RULES ===`,`Imports:`,`- ${e.name}: remove all imports from "${e.name}" (and related packages)`,`- Add: import { t } from '@fluenti/${e.framework===`Vue`?`vue`:e.framework===`Next.js`?`react`:e.framework.toLowerCase()}'`,`- Only add useI18n import if d()/n()/setLocale is needed in that file`,``,`Translation calls:`,"- t('key') → t`Source text` (tagged template with the actual source text, not the key)","- t('key', { name }) → t`Hello, ${name}` (interpolate directly in template)","- $t('key') → t`Source text` (Vue template)",`- Remove useI18n()/useTranslation()/useTranslations() destructuring if only t was used`,``,`Components:`,`- <i18n-t keypath="key"> → <Trans>Source text</Trans>`,`- <Trans i18nKey="key"> → <Trans>Source text</Trans>`,``,`ICU syntax conversion:`,`- {{variable}} (double braces) → {variable} (single braces)`,`- _one/_other suffixes → ICU {count, plural, one {...} other {...}}`,`- @:key references → inline the referenced text directly`,`- Pipe-separated plurals → ICU plural`,``,`=== PO FORMAT RULES ===`,`Each PO file must have a standard header:`,` msgid ""`,` msgstr ""`,` "Content-Type: text/plain; charset=UTF-8\\n"`,` "Content-Transfer-Encoding: 8bit\\n"`,` "Language: {locale}\\n"`,``,`Message entries: msgid is the source text (English), msgstr is the translation.`,`Flatten nested JSON keys: "home.title" → use the actual source text as msgid.`,``),n&&r.push(`=== MIGRATION GUIDE ===`,n,``),t.packageJson&&r.push(`=== package.json ===`,t.packageJson,``),t.configFiles.length>0){r.push(`=== EXISTING CONFIG FILES ===`);for(let e of t.configFiles)r.push(`--- ${e.path} ---`,e.content,``)}if(t.localeFiles.length>0){r.push(`=== EXISTING LOCALE FILES ===`);for(let e of t.localeFiles)r.push(`--- ${e.path} ---`,e.content,``)}if(t.sampleSources.length>0){r.push(`=== SAMPLE SOURCE FILES ===`);for(let e of t.sampleSources)r.push(`--- ${e.path} ---`,e.content,``)}return r.push(``,`=== OUTPUT FORMAT ===`,`Output ONLY the following sections. No explanations, no commentary.`,``,`### FLUENTI_CONFIG`,"```ts",`// Complete fluenti.config.ts`,"```",``,`### LOCALE_FILES`,`#### LOCALE: {locale_code}`,"```po",`// Complete PO file with standard header`,"```",`(repeat for each locale)`,``,`### SOURCE_PATCHES`,`#### FILE: {relative_file_path}`,"```diff",`--- a/{file_path}`,`+++ b/{file_path}`,`@@ ... @@`,` context line`,`-removed line`,`+added line`,"```",`(repeat for each file that needs changes)`,``,`### INSTALL_COMMANDS`,"```bash",`// install + uninstall commands`,"```"),r.join(`
10
+ `)}async function ue(e,t){let n=10*1024*1024;try{if(e===`claude`){let{stdout:e}=await K(`claude`,[`-p`,t],{maxBuffer:n});return e}else{let{stdout:e}=await K(`codex`,[`-p`,t,`--full-auto`],{maxBuffer:n});return e}}catch(t){let n=t;throw n.code===`ENOENT`||n.code===`EPERM`||n.code===`EACCES`?Error(`"${e}" CLI not found or not executable. Please install it first:\n`+(e===`claude`?` npm install -g @anthropic-ai/claude-code`:` npm install -g @openai/codex`)):t}}function de(e){let t=5e5,n=e.length>t?e.slice(0,t):e,r={config:void 0,localeFiles:[],sourcePatches:[],steps:void 0,installCommands:void 0},i=n.match(/### FLUENTI_CONFIG[\s\S]*?```(?:ts|typescript)?\n([\s\S]*?)```/);i&&(r.config=i[1].trim());let a=n.match(/### LOCALE_FILES([\s\S]*?)(?=### SOURCE_PATCHES|### MIGRATION_STEPS|### INSTALL_COMMANDS|$)/);if(a){let e=/#### LOCALE:\s*(\S+)\s*\n```(?:po)?\n([\s\S]*?)```/g,t;for(;(t=e.exec(a[1]))!==null;)r.localeFiles.push({locale:t[1],content:t[2].trim()})}let o=n.match(/### SOURCE_PATCHES([\s\S]*?)(?=### INSTALL_COMMANDS|$)/);if(o){let e=/#### FILE:\s*(\S+)\s*\n```(?:diff)?\n([\s\S]*?)```/g,t;for(;(t=e.exec(o[1]))!==null;)r.sourcePatches.push({file:t[1],patch:t[2].trim()})}let s=n.match(/### MIGRATION_STEPS\s*\n([\s\S]*?)(?=### INSTALL_COMMANDS|$)/);s&&(r.steps=s[1].trim());let c=n.match(/### INSTALL_COMMANDS[\s\S]*?```(?:bash|sh)?\n([\s\S]*?)```/);return c&&(r.installCommands=c[1].trim()),r}async function fe(e){let{from:t,provider:n,write:r}=e,i=oe(t);if(!i){l.default.error(`Unsupported library "${t}". Supported libraries:`);for(let e of J)l.default.log(` - ${e}`);return}let o=q[i];l.default.info(`Migrating from ${o.name} (${o.framework}) to Fluenti`),l.default.info(`Scanning project for existing i18n files...`);let s=await se(o);if(s.configFiles.length===0&&s.localeFiles.length===0){l.default.warn(`No ${o.name} configuration or locale files found.`),l.default.info(`Make sure you are running this command from the project root directory.`);return}l.default.info(`Found: ${s.configFiles.length} config file(s), ${s.localeFiles.length} locale file(s), ${s.sampleSources.length} source file(s)`);let c=ce(o.migrationGuide);l.default.info(`Generating migration plan with ${n}...`);let u=de(await ue(n,le(o,s,c)));if(u.installCommands&&(l.default.log(``),l.default.box({title:`Install Commands`,message:u.installCommands})),u.config)if(r){let{writeFileSync:e}=await import(`node:fs`),t=(0,a.resolve)(`fluenti.config.ts`);e(t,u.config,`utf-8`),l.default.success(`Written: ${t}`)}else l.default.log(``),l.default.box({title:`fluenti.config.ts`,message:u.config});if(u.localeFiles.length>0)if(r){let{writeFileSync:e,mkdirSync:t}=await import(`node:fs`),n=`./locales`;t((0,a.resolve)(n),{recursive:!0});for(let t of u.localeFiles){let r=(0,a.resolve)(n,`${t.locale}.po`);e(r,t.content,`utf-8`),l.default.success(`Written: ${r}`)}}else for(let e of u.localeFiles)l.default.log(``),l.default.box({title:`locales/${e.locale}.po`,message:e.content.length>500?e.content.slice(0,500)+`
11
+ ... (use --write to save full file)`:e.content});if(u.sourcePatches.length>0)if(r){l.default.log(``),l.default.info(`Generated ${u.sourcePatches.length} source patch(es). Apply with:`);for(let e of u.sourcePatches){let t=(0,a.resolve)(`.fluenti-migrate-${e.file.replace(/[/\\]/g,`-`)}.patch`),{writeFileSync:n}=await import(`node:fs`);n(t,e.patch,`utf-8`),l.default.success(`Patch written: ${t}`),l.default.log(` patch -p1 < ${t}`)}}else for(let e of u.sourcePatches)l.default.log(``),l.default.box({title:`Patch: ${e.file}`,message:e.patch.length>800?e.patch.slice(0,800)+`
12
+ ... (use --write to save full patch)`:e.patch});u.steps&&u.sourcePatches.length===0&&(l.default.log(``),l.default.box({title:`Migration Steps`,message:u.steps})),!r&&(u.config||u.localeFiles.length>0||u.sourcePatches.length>0)&&(l.default.log(``),l.default.info(`Run with --write to save generated files and patches to disk:`),l.default.log(` fluenti migrate --from ${t} --write`))}function Y(e){return(0,c.createHash)(`md5`).update(e).digest(`hex`).slice(0,8)}function X(t,n){if(!(0,i.existsSync)(t))return{};let r=(0,i.readFileSync)(t,`utf-8`);return n===`json`?e.u(r):e.c(r)}function Z(t,n,r){(0,i.mkdirSync)((0,a.dirname)(t),{recursive:!0}),(0,i.writeFileSync)(t,r===`json`?e.d(n):e.l(n),`utf-8`)}async function pe(e,n,r){if((0,a.extname)(e)===`.vue`)try{let{extractFromVue:t}=await Promise.resolve().then(()=>require(`./vue-extractor.cjs`));return t(n,e,r)}catch{return l.default.warn(`Skipping ${e}: install @vue/compiler-sfc to extract from .vue files`),[]}return t.t(n,e,r)}var me=(0,u.defineCommand)({meta:{name:`extract`,description:`Extract messages from source files`},args:{config:{type:`string`,description:`Path to config file`},clean:{type:`boolean`,description:`Remove obsolete entries instead of marking them`,default:!1},"no-fuzzy":{type:`boolean`,description:`Strip fuzzy flags from all entries`,default:!1},"no-cache":{type:`boolean`,description:`Disable incremental extraction cache`,default:!1}},async run({args:t}){let n=await(0,m.loadConfig)(t.config),o=(0,r.resolveLocaleCodes)(n.locales);l.default.info(`Extracting messages from ${n.include.join(`, `)}`);let c=await(0,s.default)(n.include,{ignore:n.exclude??[],absolute:!1}),u=[],d=t[`no-cache`]??!1?null:new e.o(n.catalogDir,Y(process.cwd())),f=0;for(let e of c){if(d){let t=d.get(e);if(t){u.push(...t),f++;continue}}let t=await pe(e,(0,i.readFileSync)(e,`utf-8`),n.idGenerator);u.push(...t),d&&d.set(e,t)}d&&(d.prune(new Set(c)),d.save()),f>0?l.default.info(`Found ${u.length} messages in ${c.length} files (${f} cached)`):l.default.info(`Found ${u.length} messages in ${c.length} files`);let p=n.format===`json`?`.json`:`.po`,h=t.clean??!1,g=t[`no-fuzzy`]??!1;for(let t of o){let r=(0,a.resolve)(n.catalogDir,`${t}${p}`),{catalog:i,result:o}=e.f(X(r,n.format),u,{stripFuzzy:g});Z(r,h?Object.fromEntries(Object.entries(i).filter(([,e])=>!e.obsolete)):i,n.format);let s=h?`${o.obsolete} removed`:`${o.obsolete} obsolete`;l.default.success(`${t}: ${o.added} added, ${o.unchanged} unchanged, ${s}`)}for(let e of n.plugins??[])await e.onAfterExtract?.({messages:new Map(u.map(e=>[e.id,e])),sourceLocale:n.sourceLocale,targetLocales:o.filter(e=>e!==n.sourceLocale),config:n})}});function he(e){let t={};for(let[n,r]of Object.entries(e))r.translation&&r.translation.length>0?t[n]=r.translation:r.message&&(t[n]=r.message);return t}async function Q(e,t,n){let r=he(e);for(let e of n)e.transformMessages&&(r=await e.transformMessages(r,t));let i={};for(let[t,n]of Object.entries(e)){let e=r[t];i[t]=e===void 0?{...n}:{...n,translation:e}}return i}function $(e,t,n,r){let i={};for(let[e,n]of Object.entries(t))n.translation&&n.translation.length>0?i[e]=n.translation:n.message&&(i[e]=n.message);return{locale:e,messages:i,outDir:n,config:r}}var ge=(0,u.defineCommand)({meta:{name:`compile`,description:`Compile message catalogs to JS modules`},args:{config:{type:`string`,description:`Path to config file`},"skip-fuzzy":{type:`boolean`,description:`Exclude fuzzy entries from compilation`,default:!1},"no-cache":{type:`boolean`,description:`Disable compilation cache`,default:!1},parallel:{type:`boolean`,description:`Enable parallel compilation using worker threads`,default:!1},concurrency:{type:`string`,description:`Max number of worker threads (default: auto)`}},async run({args:t}){let o=await(0,m.loadConfig)(t.config),s=(0,r.resolveLocaleCodes)(o.locales),c=o.format===`json`?`.json`:`.po`;(0,i.mkdirSync)(o.compileOutDir,{recursive:!0});let u={},d={};for(let t of s){let n=(0,a.resolve)(o.catalogDir,`${t}${c}`);if((0,i.existsSync)(n)){let r=(0,i.readFileSync)(n,`utf-8`);d[t]=r,u[t]=o.format===`json`?e.u(r):e.c(r)}else d[t]=``,u[t]={}}let f=n.t(u);l.default.info(`Compiling ${f.length} messages across ${s.length} locales`);let p=t[`skip-fuzzy`]??!1,h=t[`no-cache`]??!1?null:new j(o.catalogDir,Y(process.cwd())),g=t.parallel??!1,_=t.concurrency?parseInt(t.concurrency,10):void 0;if(_!==void 0&&(isNaN(_)||_<1)){l.default.error(`Invalid --concurrency. Must be a positive integer.`),process.exitCode=1;return}let v=0,y=!1,b=[];for(let e of s){if(h&&h.isUpToDate(e,d[e])&&(0,i.existsSync)((0,a.resolve)(o.compileOutDir,`${e}.js`))){v++;continue}b.push(e)}if(b.length>0&&(y=!0),g&&b.length>1){let t=o.plugins??[],n={};for(let e of b){for(let n of t)await n.onBeforeCompile?.($(e,u[e],o.compileOutDir,o));n[e]=t.length>0?await Q(u[e],e,t):u[e]}let r=await e.s(b.map(e=>({locale:e,catalog:n[e],allIds:f,sourceLocale:o.sourceLocale,options:{skipFuzzy:p}})),_);for(let e of r){let t=(0,a.resolve)(o.compileOutDir,`${e.locale}.js`);if((0,i.writeFileSync)(t,e.code,`utf-8`),h&&h.set(e.locale,d[e.locale]),e.stats.missing.length>0){l.default.warn(`${e.locale}: ${e.stats.compiled} compiled, ${e.stats.missing.length} missing translations`);for(let t of e.stats.missing)l.default.warn(` ⤷ ${t}`)}else l.default.success(`Compiled ${e.locale}: ${e.stats.compiled} messages → ${t}`)}for(let e of b)for(let r of t)await r.onAfterCompile?.($(e,n[e],o.compileOutDir,o))}else{let e=o.plugins??[];for(let t of b){let r=(0,a.resolve)(o.compileOutDir,`${t}.js`);for(let n of e)await n.onBeforeCompile?.($(t,u[t],o.compileOutDir,o));let s=e.length>0?await Q(u[t],t,e):u[t],{code:c,stats:m}=n.n(s,t,f,o.sourceLocale,{skipFuzzy:p});if((0,i.writeFileSync)(r,c,`utf-8`),h&&h.set(t,d[t]),m.missing.length>0){l.default.warn(`${t}: ${m.compiled} compiled, ${m.missing.length} missing translations`);for(let e of m.missing)l.default.warn(` ⤷ ${e}`)}else l.default.success(`Compiled ${t}: ${m.compiled} messages → ${r}`);for(let n of e)await n.onAfterCompile?.($(t,s,o.compileOutDir,o))}}v>0&&l.default.info(`${v} locale(s) unchanged — skipped`),h&&h.save();let x=(0,a.resolve)(o.compileOutDir,`index.js`),S=(0,a.resolve)(o.compileOutDir,`messages.d.ts`);(y||!(0,i.existsSync)(x))&&((0,i.writeFileSync)(x,n.r(s,o.compileOutDir),`utf-8`),l.default.success(`Generated index → ${x}`)),(y||!(0,i.existsSync)(S))&&((0,i.writeFileSync)(S,n.i(f,u,o.sourceLocale),`utf-8`),l.default.success(`Generated types → ${S}`))}}),_e=(0,u.defineCommand)({meta:{name:`stats`,description:`Show translation progress`},args:{config:{type:`string`,description:`Path to config file`}},async run({args:e}){let t=await(0,m.loadConfig)(e.config),n=(0,r.resolveLocaleCodes)(t.locales),i=t.format===`json`?`.json`:`.po`,o=[];for(let e of n){let n=X((0,a.resolve)(t.catalogDir,`${e}${i}`),t.format),r=Object.values(n).filter(e=>!e.obsolete),s=r.length,c=r.filter(e=>e.translation&&e.translation.length>0).length,l=s>0?(c/s*100).toFixed(1)+`%`:`—`;o.push({locale:e,total:s,translated:c,pct:l})}l.default.log(``),l.default.log(` Locale │ Total │ Translated │ Progress`),l.default.log(` ────────┼───────┼────────────┼─────────────────────────────`);for(let e of o)l.default.log(y(e.locale,e.total,e.translated));l.default.log(``)}}),ve=(0,u.defineCommand)({meta:{name:`lint`,description:`Check translation quality (missing, inconsistent placeholders, fuzzy)`},args:{config:{type:`string`,description:`Path to config file`},strict:{type:`boolean`,description:`Treat warnings as errors`,default:!1},locale:{type:`string`,description:`Lint a specific locale only`}},async run({args:e}){let t=await(0,m.loadConfig)(e.config),n=(0,r.resolveLocaleCodes)(t.locales),i=t.format===`json`?`.json`:`.po`,o={};for(let e of n)o[e]=X((0,a.resolve)(t.catalogDir,`${e}${i}`),t.format);let s=e.locale?[e.locale]:void 0;l.default.info(`Linting ${s?s.join(`, `):`all locales`} (source: ${t.sourceLocale})`);let c={sourceLocale:t.sourceLocale,strict:e.strict??!1};s&&(c.locales=s);let u=w(o,c);l.default.log(``),l.default.log(T(u)),l.default.log(``);let d=u.filter(e=>e.severity===`error`),f=u.filter(e=>e.severity===`warning`);(d.length>0||e.strict&&f.length>0)&&(process.exitCode=1)}}),ye=(0,u.defineCommand)({meta:{name:`check`,description:`Check translation coverage for CI`},args:{config:{type:`string`,description:`Path to config file`},ci:{type:`boolean`,description:`Alias for --format github`,default:!1},"min-coverage":{type:`string`,description:`Minimum coverage percentage (0-100)`,default:`100`},format:{type:`string`,description:`Output format: text | json | github`},locale:{type:`string`,description:`Check a specific locale only`}},async run({args:e}){let t=await(0,m.loadConfig)(e.config),n=(0,r.resolveLocaleCodes)(t.locales),i=t.format===`json`?`.json`:`.po`,o={};for(let e of n)o[e]=X((0,a.resolve)(t.catalogDir,`${e}${i}`),t.format);let s=parseFloat(e[`min-coverage`]??`100`);if(isNaN(s)||s<0||s>100){l.default.error(`Invalid --min-coverage. Must be a number between 0 and 100.`),process.exitCode=1;return}let c=e.format??(e.ci?`github`:`text`),u={sourceLocale:t.sourceLocale,minCoverage:s,format:c};e.locale&&(u.locale=e.locale);let d=D(o,u);switch(c){case`json`:l.default.log(k(d));break;case`github`:l.default.log(O(d,t.catalogDir,t.format));break;default:l.default.log(``),l.default.log(te(d)),l.default.log(``);break}d.passed||(process.exitCode=1)}});async function be(e,t,n){let r=Array(e.length),i=0,a=Array.from({length:Math.min(n,e.length)},async()=>{for(;i<e.length;){let n=i++;r[n]=await t(e[n])}});return await Promise.all(a),r}var xe=(0,u.defineCommand)({meta:{name:`translate`,description:`Translate messages using AI (Claude Code or Codex CLI)`},args:{config:{type:`string`,description:`Path to config file`},provider:{type:`string`,description:`AI provider: claude or codex`,default:`claude`},locale:{type:`string`,description:`Translate a specific locale only`},"batch-size":{type:`string`,description:`Messages per batch`,default:`50`},"dry-run":{type:`boolean`,description:`Preview translation results without writing files`,default:!1},context:{type:`string`,description:`Project context description to improve translation quality`},glossary:{type:`string`,description:`Path to glossary JSON file`},concurrency:{type:`string`,description:`Max parallel locale translations (default: 3)`},timeout:{type:`string`,description:`AI call timeout in seconds (default: 120)`}},async run({args:e}){let t=await(0,m.loadConfig)(e.config),n=(0,r.resolveLocaleCodes)(t.locales),i=e.provider;if(i!==`claude`&&i!==`codex`){l.default.error(`Invalid provider "${i}". Use "claude" or "codex".`);return}let o=parseInt(e[`batch-size`]??`50`,10);if(isNaN(o)||o<1){l.default.error(`Invalid batch-size. Must be a positive integer.`);return}let s=e.glossary?F((0,a.resolve)(e.glossary)):void 0,c=e.concurrency?parseInt(e.concurrency,10):3;if(isNaN(c)||c<1){l.default.error(`Invalid concurrency. Must be a positive integer.`);return}let u=e.timeout?parseInt(e.timeout,10):120;if(isNaN(u)||u<1){l.default.error(`Invalid timeout. Must be a positive integer (seconds).`);return}let d=u*1e3,f=e.locale?[e.locale]:n.filter(e=>e!==t.sourceLocale);if(f.length===0){l.default.warn(`No target locales to translate.`);return}l.default.info(`Translating with ${i} (batch size: ${o})`);let p=t.format===`json`?`.json`:`.po`;await be(f,async n=>{l.default.info(`\n[${n}]`);let r=(0,a.resolve)(t.catalogDir,`${n}${p}`),c=X(r,t.format);if(e[`dry-run`]){let e=Object.entries(c).filter(([,e])=>!e.obsolete&&(!e.translation||e.translation.length===0));if(e.length>0){for(let[t,n]of e)l.default.log(` ${t}: ${n.message??t}`);l.default.success(` ${n}: ${e.length} messages would be translated (dry-run)`)}else l.default.success(` ${n}: already fully translated`);return}let u=s?I(s,n):void 0,{catalog:f,translated:m,warnings:h}=await G({provider:i,sourceLocale:t.sourceLocale,targetLocale:n,catalog:c,batchSize:o,glossary:u,timeoutMs:d,...e.context?{context:e.context}:{}});m>0?(Z(r,f,t.format),l.default.success(` ${n}: ${m} messages translated`)):l.default.success(` ${n}: already fully translated`),h.length>0&&l.default.warn(` ${n}: ${h.length} QA warnings`)},c)}}),Se=(0,u.defineCommand)({meta:{name:`migrate`,description:`Migrate from another i18n library using AI`},args:{from:{type:`string`,description:`Source library: vue-i18n, nuxt-i18n, react-i18next, next-intl, next-i18next, lingui`,required:!0},provider:{type:`string`,description:`AI provider: claude or codex`,default:`claude`},write:{type:`boolean`,description:`Write generated files to disk`,default:!1}},async run({args:e}){let t=e.provider;if(t!==`claude`&&t!==`codex`){l.default.error(`Invalid provider "${t}". Use "claude" or "codex".`);return}await fe({from:e.from,provider:t,write:e.write??!1})}});(0,u.runMain)((0,u.defineCommand)({meta:{name:`fluenti`,version:`0.0.1`,description:`Compile-time i18n for modern frameworks`},subCommands:{init:(0,u.defineCommand)({meta:{name:`init`,description:`Initialize Fluenti in your project`},args:{},async run(){await e.r({cwd:process.cwd()})}}),doctor:(0,u.defineCommand)({meta:{name:`doctor`,description:`Diagnose Fluenti setup and vNext import issues`},args:{config:{type:`string`,description:`Optional path to fluenti config file`},strict:{type:`boolean`,description:`Treat warnings as errors`,default:!1}},async run({args:t}){let n=await e.n({cwd:process.cwd(),...t.config?{config:t.config}:{}}),r=e.t(n);l.default.log(r);let i=n.findings.some(e=>e.severity===`error`),a=n.findings.some(e=>e.severity===`warning`);(i||(t.strict??!1)&&a)&&(process.exitCode=1)}}),codemod:(0,u.defineCommand)({meta:{name:`codemod`,description:`Rewrite imports to the vNext Fluenti entry layout`},args:{write:{type:`boolean`,description:`Write modified files to disk`,default:!1},include:{type:`string`,description:`Comma-separated glob list to scan`}},async run({args:t}){let n=t.include?t.include.split(`,`).map(e=>e.trim()).filter(Boolean):void 0,r=await e.a({cwd:process.cwd(),...n?{include:n}:{},write:t.write??!1});if(r.changedCount===0){l.default.success(`No files need import rewrites.`);return}for(let e of r.changedFiles)l.default.log(`${t.write?`updated`:`would update`} ${e.file}`);l.default.success(`${t.write?`Updated`:`Detected`} ${r.changedCount} file(s) with Fluenti import rewrites.`)}}),extract:me,compile:ge,stats:_e,lint:ve,check:ye,translate:xe,migrate:Se}}));
25
13
  //# sourceMappingURL=cli.cjs.map