@menapo/vi18n 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/README.md +19 -0
  2. package/dist/{apply-Bre-lY9J.js → apply-Bg-3rB2m.js} +69 -89
  3. package/dist/{captured-Bj8bO6vd.js → captured-DfLk50Ji.js} +196 -217
  4. package/dist/{check-BIKEuu6B.js → check-CunekuYs.js} +76 -85
  5. package/dist/cli.js +2 -3
  6. package/dist/{collect-Cx4_SKOe.js → collect-CYATDjdo.js} +1 -2
  7. package/dist/collisions-CDSdtLQm.js +215 -0
  8. package/dist/{compile-Cc97JaW2.js → compile-DqkofbiO.js} +376 -331
  9. package/dist/compile-hva0qjhZ.js +240 -0
  10. package/dist/concurrency-BCY_4zcr.js +1 -0
  11. package/dist/concurrency-Dy2ny50V.js +107 -0
  12. package/dist/config.d.ts +1 -5
  13. package/dist/config.js +4 -5
  14. package/dist/{types-D3QGM8XO.js → diagnostics-LgIWyeSp.js} +28 -27
  15. package/dist/{dir-zw6bGMKQ.js → dir-TGLYuOZb.js} +34 -37
  16. package/dist/{duplicates-yuRljQ6h.js → duplicates-8cudcHNj.js} +10 -27
  17. package/dist/engine-ecRD8-IE.js +556 -0
  18. package/dist/engine.d.ts +1 -5
  19. package/dist/engine.js +297 -168
  20. package/dist/exchange-DjwlrTQ9.js +41 -0
  21. package/dist/{exclude-Du-Zd_qI.js → exclude-BFETmvde.js} +2 -3
  22. package/dist/{export-C9Sy6UWv.js → export-D2tsqWIr.js} +17 -38
  23. package/dist/{extract-C3S8btx0.js → extract-BxYchVmY.js} +114 -82
  24. package/dist/{formats-9unqj_fZ.js → formats-BaryZ2N7.js} +352 -276
  25. package/dist/fs-ezCMZeDV.js +52 -0
  26. package/dist/i18next-COO6o0tX.js +1907 -0
  27. package/dist/i18next-Dr7DCQlQ.js +1 -0
  28. package/dist/{import-nANvQutw.js → import-vSC29Cn4.js} +81 -75
  29. package/dist/index.d.ts +1 -13
  30. package/dist/index.js +14 -16
  31. package/dist/{init-C2ScuW6a.js → init-Cc7A-8VX.js} +466 -501
  32. package/dist/{library-D5CWvTQs.js → library-tp_xqzSY.js} +975 -451
  33. package/dist/lingui-BnnlqGXT.js +902 -0
  34. package/dist/lint.d.ts +0 -4
  35. package/dist/lint.js +70 -82
  36. package/dist/{load-gW-oJt1Q.js → load-BSIeGJ5v.js} +275 -148
  37. package/dist/{load-CQRz4PpM.js → load-SSrAeJVB.js} +1214 -1116
  38. package/dist/{locales-DX4MOBFE.js → locales-D0U-yVRm.js} +271 -237
  39. package/dist/{lsp-RMMMc88P.js → lsp-DvC11pBZ.js} +4 -5
  40. package/dist/{match-BGr8EXB3.js → match-BLDcj610.js} +11 -4
  41. package/dist/{mcp-CHVwBoRP.js → mcp-D2zzOTBy.js} +4 -5
  42. package/dist/{merge-driver-BTX87aVm.js → merge-driver-BLI8OtAc.js} +138 -122
  43. package/dist/migrate-1r43OBfe.js +1 -0
  44. package/dist/migrate-ChDGhlC-.js +2169 -0
  45. package/dist/{openai-CTaMDcl-.js → openai-CLn4puY8.js} +128 -87
  46. package/dist/{output-DWE3SIUA.js → output-D5tAt8q4.js} +15 -9
  47. package/dist/parse.d.ts +1 -3
  48. package/dist/parse.js +7 -8
  49. package/dist/{pipeline-C9Dbotkh.js → pipeline-BJSkkRYC.js} +387 -359
  50. package/dist/{pipeline-DbX6rlo5.js → pipeline-BeCc441z.js} +1 -1
  51. package/dist/project-B5KIO0q-.js +544 -0
  52. package/dist/{pseudo-DRv30iN5.js → pseudo-B2DUpoLu.js} +126 -3
  53. package/dist/{raw-C4Y6vyGY.js → raw-YsYZMS9n.js} +52 -29
  54. package/dist/react-intl-C8JehBBL.js +634 -0
  55. package/dist/rename-ZVGq9ZG1.js +577 -0
  56. package/dist/repeated-uuI1tUGg.js +85 -0
  57. package/dist/restore-xlBIrtRt.js +199 -0
  58. package/dist/rewrite-BwzXoBiA.js +415 -0
  59. package/dist/{rich-DCUKl5HM.js → rich-ApY1Dm4S.js} +35 -28
  60. package/dist/rolldown-runtime-C1I3wEg2.js +43 -0
  61. package/dist/{rolldown-runtime-D7D4PA-g.js → rolldown-runtime-D8jQpDG7.js} +1 -2
  62. package/dist/run-CQ9pDLSa.js +674 -0
  63. package/dist/scan-worker.d.ts +2 -4
  64. package/dist/scan-worker.js +1 -1
  65. package/dist/{scoped-BMYpSthj.js → scoped-h3KE8XWW.js} +3 -4
  66. package/dist/{server-Da1Ot9IN.js → server-Br8tAuG2.js} +312 -386
  67. package/dist/{server-deBOq2vq.js → server-DJRpUQVZ.js} +1059 -333
  68. package/dist/server.d.ts +1 -17
  69. package/dist/server.js +419 -379
  70. package/dist/{sitemap-DJXzKoza.js → sitemap-CSAkm6oi.js} +21 -33
  71. package/dist/{sources-D19czDSA.js → sources-DNVbYsgs.js} +713 -373
  72. package/dist/{status-zr4jY59Y.js → status-q6M3rBrh.js} +30 -30
  73. package/dist/{stdio-FPOKQAgu.js → stdio-D9kTzyqB.js} +2 -4
  74. package/dist/{stdio-CVaJfxA7.js → stdio-FWIVU3P4.js} +1 -2
  75. package/dist/sync-BNIAwMhR.js +1352 -0
  76. package/dist/{t-DC-c9zE5.js → t-gvEXx25s.js} +76 -53
  77. package/dist/test.d.ts +5 -16
  78. package/dist/test.js +126 -56
  79. package/dist/translate-BP4iVhOR.js +336 -0
  80. package/dist/{ts-BaU5yOf0.js → ts-BX6kwig5.js} +25 -14
  81. package/dist/{types-DtvQ7UdD.js → types-3kwyaCAm.js} +1 -2
  82. package/dist/{types-DsdWBG0b.d.ts → types-B4wNX6PA.d.ts} +6 -8
  83. package/dist/{types-CgUCkFU1.d.ts → types-_4UdFhR9.d.ts} +24 -21
  84. package/dist/types-xR2exI3L.js +42 -0
  85. package/dist/{units-CQ5Q99RC.js → units-DPPfCN7j.js} +7 -16
  86. package/dist/{url-CRfCOhUI.js → url-Bpc6wLea.js} +24 -11
  87. package/dist/{url-CsBkRaJy.js → url-D2_VlEeH.js} +25 -12
  88. package/dist/{validate-BxpupdAf.js → validate-CgzaDdOY.js} +690 -377
  89. package/dist/{validate-D6DJepZv.js → validate-PGgMsasz.js} +3 -5
  90. package/dist/{version-Byqi2guX.js → version-DC-J5WvV.js} +3 -5
  91. package/dist/{vite-scan-CT_vsp4g.js → vite-scan-kM8Ta3rO.js} +87 -92
  92. package/dist/vite.d.ts +2 -6
  93. package/dist/vite.js +6500 -6032
  94. package/dist/vue-i18n-_uIXlFVh.js +806 -0
  95. package/dist/{which-BOemZ5Q8.js → which-DFWk_KwN.js} +44 -37
  96. package/dist/{worker-84U6uYB3.js → worker-zlhNj4y3.js} +454 -608
  97. package/package.json +5 -5
  98. package/dist/check-HsmmpJZg.js +0 -1
  99. package/dist/codec-DuvU2VQy.js +0 -207
  100. package/dist/collisions-CfpZU8e4.js +0 -217
  101. package/dist/compile-BaDh0cHG.js +0 -245
  102. package/dist/concurrency-C9UUWuDC.js +0 -96
  103. package/dist/concurrency-DONL7t4V.js +0 -1
  104. package/dist/engine-C2ENBRJe.js +0 -531
  105. package/dist/i18next-9HAoxwUI.js +0 -1
  106. package/dist/i18next-BEJgv_S8.js +0 -1596
  107. package/dist/lingui-zUiCl9Um.js +0 -833
  108. package/dist/messages-BfjIExyB.js +0 -166
  109. package/dist/migrate-IpLDMXmq.js +0 -1484
  110. package/dist/migrate-rCQuOGsf.js +0 -1
  111. package/dist/project-Bw9UPIdx.js +0 -1046
  112. package/dist/project-C4GpaN-n.js +0 -381
  113. package/dist/react-intl-BP0u-D5m.js +0 -519
  114. package/dist/restore-CiYv-jxS.js +0 -175
  115. package/dist/rewrite-EsIw_lsq.js +0 -803
  116. package/dist/run-BEcnBbu-.js +0 -694
  117. package/dist/runtime-DTMmliT1.js +0 -64
  118. package/dist/sync-B9V2KFwb.js +0 -658
  119. package/dist/translate-CQnJfLjO.js +0 -299
  120. package/dist/types-wSh9fCBY.js +0 -11
  121. package/dist/vue-i18n-g0iGy6CZ.js +0 -651
@@ -1,10 +1,9 @@
1
- import { s as catalogPath } from "./library-D5CWvTQs.js";
2
- import { a as table, i as rootRelative } from "./output-DWE3SIUA.js";
3
- import { t as EXIT } from "./types-wSh9fCBY.js";
4
- import { a as loadCatalogs, c as ownStatus, d as referencedMessages, f as scan, i as hasErrors, l as percent, o as loadProject, p as targetLocales } from "./project-C4GpaN-n.js";
1
+ import { a as table } from "./output-D5tAt8q4.js";
2
+ import { a as hasErrors, h as targetLocales, l as ownStatus, m as scan, n as catalogFile, o as loadCatalogs, p as referencedMessages, r as compareText, s as loadProject, u as percent } from "./project-B5KIO0q-.js";
3
+ import { r as EXIT } from "./types-xR2exI3L.js";
5
4
  import { dirname, join, relative } from "node:path";
6
5
  import { readFile, stat } from "node:fs/promises";
7
- //#region src/cli/commands/status.ts
6
+ // src/cli/commands/status.ts
8
7
  /**
9
8
  * `vi18n status [--json] [--locale l]…` (INTERNALS §2.14, PLAN §5.19): per
10
9
  * target locale, how many referenced messages (code plus `keep` ids) its own
@@ -39,7 +38,7 @@ async function status(ctx, flags) {
39
38
  missing: own.missing,
40
39
  percent: percent(own.translated + own.ai, own.total)
41
40
  });
42
- const file = rootRelative(config.root, catalog?.path ?? catalogPath(config, locale));
41
+ const file = catalogFile(config, locale, catalog);
43
42
  for (const item of own.invalid) data.invalid.push({
44
43
  locale,
45
44
  id: item.id,
@@ -49,26 +48,32 @@ async function status(ctx, flags) {
49
48
  });
50
49
  }
51
50
  const report = await readReport(ctx, project);
52
- if (report !== null) {
53
- const bundles = [];
54
- for (const locale of locales) {
55
- const coverage = report.coverage[locale];
56
- if (coverage === void 0) continue;
57
- for (const key of Object.keys(coverage).sort()) {
58
- const c = coverage[key];
59
- bundles.push({
60
- key,
61
- locale,
62
- total: c.total,
63
- translated: c.translated,
64
- ai: c.ai,
65
- missing: c.missing,
66
- percent: percent(c.translated + c.ai, c.total)
67
- });
68
- }
69
- }
70
- data.bundles = bundles;
51
+ if (report !== null) data.bundles = bundleRows(report, locales);
52
+ printStatus(ctx, data);
53
+ return {
54
+ exitCode: hasErrors(ctx.out.diagnostics) ? EXIT.failure : EXIT.ok,
55
+ data
56
+ };
57
+ }
58
+ /** One row per bundle and locale of a build report, bundles in code-unit order. */
59
+ function bundleRows(report, locales) {
60
+ const bundles = [];
61
+ for (const locale of locales) {
62
+ const coverage = report.coverage[locale];
63
+ if (coverage === void 0) continue;
64
+ for (const [key, c] of Object.entries(coverage).sort(([a], [b]) => compareText(a, b))) bundles.push({
65
+ key,
66
+ locale,
67
+ total: c.total,
68
+ translated: c.translated,
69
+ ai: c.ai,
70
+ missing: c.missing,
71
+ percent: percent(c.translated + c.ai, c.total)
72
+ });
71
73
  }
74
+ return bundles;
75
+ }
76
+ function printStatus(ctx, data) {
72
77
  const row = (r) => [
73
78
  r.locale,
74
79
  r.total,
@@ -98,10 +103,6 @@ async function status(ctx, flags) {
98
103
  ], data.bundles.map((r) => [r.key, ...row(r)])));
99
104
  }
100
105
  if (data.invalid.length > 0) ctx.out.result(`\n${data.invalid.length} entries are counted as missing because they are invalid or fuzzy; run vi18n check for details`);
101
- return {
102
- exitCode: hasErrors(ctx.out.diagnostics) ? EXIT.failure : EXIT.ok,
103
- data
104
- };
105
106
  }
106
107
  /**
107
108
  * The newest `report-client.json` under a Vite cache directory the project
@@ -145,5 +146,4 @@ async function readReport(ctx, project) {
145
146
  return null;
146
147
  }
147
148
  }
148
- //#endregion
149
149
  export { status };
@@ -1,4 +1,4 @@
1
- import { y as JSONRPCMessageSchema } from "./types-DtvQ7UdD.js";
1
+ import { y as JSONRPCMessageSchema } from "./types-3kwyaCAm.js";
2
2
  import process from "node:process";
3
3
  /**
4
4
  * Buffers a continuous stdio stream into discrete JSON-RPC messages.
@@ -32,8 +32,7 @@ function deserializeMessage(line) {
32
32
  function serializeMessage(message) {
33
33
  return JSON.stringify(message) + "\n";
34
34
  }
35
- //#endregion
36
- //#region ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.1_supports-color@10.2.2_zod@4.6.7/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
35
+ // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.1_supports-color@10.2.2_zod@4.6.7/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
37
36
  /**
38
37
  * Server transport for stdio: this communicates with an MCP client by reading from the current process' stdin and writing to stdout.
39
38
  *
@@ -91,5 +90,4 @@ var StdioServerTransport = class {
91
90
  });
92
91
  }
93
92
  };
94
- //#endregion
95
93
  export { StdioServerTransport };
@@ -1,5 +1,5 @@
1
1
  import { format } from "node:util";
2
- //#region src/cli/stdio.ts
2
+ // src/cli/stdio.ts
3
3
  /**
4
4
  * For the commands that speak a protocol on stdout (`lsp`, `mcp`): one stray
5
5
  * `console.log` (from a config module, a framework compiler, Vite) would be
@@ -25,5 +25,4 @@ function protocolConsole(output) {
25
25
  });
26
26
  };
27
27
  }
28
- //#endregion
29
28
  export { protocolConsole as t };