@menapo/vi18n 0.1.1 → 0.1.2

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/{apply-Bre-lY9J.js → apply-FAHl1R6T.js} +69 -89
  2. package/dist/{captured-Bj8bO6vd.js → captured-CTjjDF5o.js} +196 -217
  3. package/dist/{check-BIKEuu6B.js → check-DwFwOB1d.js} +66 -84
  4. package/dist/cli.js +2 -3
  5. package/dist/{collect-Cx4_SKOe.js → collect-CYATDjdo.js} +1 -2
  6. package/dist/collisions-uMTuq36M.js +215 -0
  7. package/dist/compile-CEvH-6sY.js +240 -0
  8. package/dist/{compile-Cc97JaW2.js → compile-DqkofbiO.js} +376 -331
  9. package/dist/concurrency-BCY_4zcr.js +1 -0
  10. package/dist/concurrency-Dy2ny50V.js +107 -0
  11. package/dist/config.d.ts +1 -5
  12. package/dist/config.js +4 -5
  13. package/dist/{types-D3QGM8XO.js → diagnostics-1onDF6Ua.js} +26 -26
  14. package/dist/{dir-zw6bGMKQ.js → dir-TGLYuOZb.js} +34 -37
  15. package/dist/{duplicates-yuRljQ6h.js → duplicates-CsUXRX2J.js} +10 -27
  16. package/dist/engine-Bf7nVigL.js +556 -0
  17. package/dist/engine.d.ts +1 -5
  18. package/dist/engine.js +297 -168
  19. package/dist/exchange-DYG9RZoT.js +41 -0
  20. package/dist/{exclude-Du-Zd_qI.js → exclude-vMnm3lqU.js} +2 -3
  21. package/dist/{export-C9Sy6UWv.js → export-BYq0gfLd.js} +17 -38
  22. package/dist/{extract-C3S8btx0.js → extract-CYtuEo8u.js} +114 -82
  23. package/dist/{formats-9unqj_fZ.js → formats-ChV1LVH_.js} +352 -276
  24. package/dist/fs-ezCMZeDV.js +52 -0
  25. package/dist/i18next-1waHziMy.js +1 -0
  26. package/dist/i18next-D66Icz3L.js +1907 -0
  27. package/dist/{import-nANvQutw.js → import-BApbQlmm.js} +81 -75
  28. package/dist/index.d.ts +1 -13
  29. package/dist/index.js +14 -16
  30. package/dist/{init-C2ScuW6a.js → init-J7AwwA5e.js} +466 -501
  31. package/dist/{library-D5CWvTQs.js → library-BfSOBeBd.js} +975 -451
  32. package/dist/lingui-Ee2farVo.js +902 -0
  33. package/dist/lint.d.ts +0 -4
  34. package/dist/lint.js +68 -81
  35. package/dist/{load-gW-oJt1Q.js → load-BFLLqY8x.js} +272 -147
  36. package/dist/{load-CQRz4PpM.js → load-CMwhukZ4.js} +1211 -1115
  37. package/dist/{locales-DX4MOBFE.js → locales-DxLDrx-h.js} +271 -237
  38. package/dist/{lsp-RMMMc88P.js → lsp-BC7xDGON.js} +4 -5
  39. package/dist/{match-BGr8EXB3.js → match-BLDcj610.js} +11 -4
  40. package/dist/{mcp-CHVwBoRP.js → mcp-Cka8ywDF.js} +4 -5
  41. package/dist/{merge-driver-BTX87aVm.js → merge-driver-B04Apm29.js} +138 -122
  42. package/dist/migrate-D7TNl6SD.js +2169 -0
  43. package/dist/migrate-khCY8TE0.js +1 -0
  44. package/dist/{openai-CTaMDcl-.js → openai-RWw0YlAx.js} +128 -87
  45. package/dist/{output-DWE3SIUA.js → output-CF9uvk_-.js} +15 -9
  46. package/dist/parse.d.ts +1 -3
  47. package/dist/parse.js +7 -8
  48. package/dist/{pipeline-DbX6rlo5.js → pipeline-B30irGMD.js} +1 -1
  49. package/dist/{pipeline-C9Dbotkh.js → pipeline-sgl_q_op.js} +387 -359
  50. package/dist/project-DSzWKU3C.js +544 -0
  51. package/dist/{pseudo-DRv30iN5.js → pseudo-DNbNNVGP.js} +125 -3
  52. package/dist/{raw-C4Y6vyGY.js → raw-YsYZMS9n.js} +52 -29
  53. package/dist/react-intl-tzGIk6G3.js +634 -0
  54. package/dist/restore-BG_zMpSj.js +199 -0
  55. package/dist/rewrite-hAcRJwiZ.js +415 -0
  56. package/dist/{rich-DCUKl5HM.js → rich-ApY1Dm4S.js} +35 -28
  57. package/dist/rolldown-runtime-C1I3wEg2.js +43 -0
  58. package/dist/{rolldown-runtime-D7D4PA-g.js → rolldown-runtime-D8jQpDG7.js} +1 -2
  59. package/dist/run-CFzR3V93.js +647 -0
  60. package/dist/scan-worker.d.ts +2 -4
  61. package/dist/scan-worker.js +1 -1
  62. package/dist/{scoped-BMYpSthj.js → scoped-h3KE8XWW.js} +3 -4
  63. package/dist/{server-deBOq2vq.js → server-WlxZH0oX.js} +275 -330
  64. package/dist/{server-Da1Ot9IN.js → server-ceuzzkal.js} +292 -386
  65. package/dist/server.d.ts +1 -17
  66. package/dist/server.js +415 -381
  67. package/dist/{sitemap-DJXzKoza.js → sitemap-796jJKUT.js} +21 -33
  68. package/dist/{sources-D19czDSA.js → sources-DuOdM02f.js} +712 -373
  69. package/dist/{status-zr4jY59Y.js → status-CTH3qI-0.js} +30 -30
  70. package/dist/{stdio-FPOKQAgu.js → stdio-D9kTzyqB.js} +2 -4
  71. package/dist/{stdio-CVaJfxA7.js → stdio-FWIVU3P4.js} +1 -2
  72. package/dist/sync-CpL0Qsgw.js +1352 -0
  73. package/dist/{t-DC-c9zE5.js → t-gvEXx25s.js} +76 -53
  74. package/dist/test.d.ts +5 -16
  75. package/dist/test.js +77 -48
  76. package/dist/translate-BrfVRkjl.js +336 -0
  77. package/dist/{ts-BaU5yOf0.js → ts-BX6kwig5.js} +25 -14
  78. package/dist/{types-DtvQ7UdD.js → types-3kwyaCAm.js} +1 -2
  79. package/dist/{types-DsdWBG0b.d.ts → types-BaG1LboH.d.ts} +2 -6
  80. package/dist/{types-CgUCkFU1.d.ts → types-Cy2bPdSg.d.ts} +14 -20
  81. package/dist/types-Ds_vebja.js +41 -0
  82. package/dist/{units-CQ5Q99RC.js → units-VVLgQ7x7.js} +7 -16
  83. package/dist/{url-CRfCOhUI.js → url-Bpc6wLea.js} +24 -11
  84. package/dist/{url-CsBkRaJy.js → url-D2_VlEeH.js} +25 -12
  85. package/dist/{validate-D6DJepZv.js → validate-PGgMsasz.js} +3 -5
  86. package/dist/{validate-BxpupdAf.js → validate-zv4-IZyZ.js} +690 -377
  87. package/dist/{version-Byqi2guX.js → version-BFs370Ce.js} +3 -5
  88. package/dist/{vite-scan-CT_vsp4g.js → vite-scan-DFKSGVE9.js} +87 -92
  89. package/dist/vite.d.ts +2 -6
  90. package/dist/vite.js +6482 -6018
  91. package/dist/vue-i18n-CBmZqHbG.js +806 -0
  92. package/dist/{which-BOemZ5Q8.js → which-BpyJyBkX.js} +44 -37
  93. package/dist/{worker-84U6uYB3.js → worker-BjzVqJVO.js} +454 -608
  94. package/package.json +5 -5
  95. package/dist/check-HsmmpJZg.js +0 -1
  96. package/dist/codec-DuvU2VQy.js +0 -207
  97. package/dist/collisions-CfpZU8e4.js +0 -217
  98. package/dist/compile-BaDh0cHG.js +0 -245
  99. package/dist/concurrency-C9UUWuDC.js +0 -96
  100. package/dist/concurrency-DONL7t4V.js +0 -1
  101. package/dist/engine-C2ENBRJe.js +0 -531
  102. package/dist/i18next-9HAoxwUI.js +0 -1
  103. package/dist/i18next-BEJgv_S8.js +0 -1596
  104. package/dist/lingui-zUiCl9Um.js +0 -833
  105. package/dist/messages-BfjIExyB.js +0 -166
  106. package/dist/migrate-IpLDMXmq.js +0 -1484
  107. package/dist/migrate-rCQuOGsf.js +0 -1
  108. package/dist/project-Bw9UPIdx.js +0 -1046
  109. package/dist/project-C4GpaN-n.js +0 -381
  110. package/dist/react-intl-BP0u-D5m.js +0 -519
  111. package/dist/restore-CiYv-jxS.js +0 -175
  112. package/dist/rewrite-EsIw_lsq.js +0 -803
  113. package/dist/run-BEcnBbu-.js +0 -694
  114. package/dist/runtime-DTMmliT1.js +0 -64
  115. package/dist/sync-B9V2KFwb.js +0 -658
  116. package/dist/translate-CQnJfLjO.js +0 -299
  117. package/dist/types-wSh9fCBY.js +0 -11
  118. package/dist/vue-i18n-g0iGy6CZ.js +0 -651
@@ -1,166 +0,0 @@
1
- import { C as usableTranslation, S as entryKey } from "./library-D5CWvTQs.js";
2
- import { r as resolveDuplicates, t as duplicateDiagnostics } from "./duplicates-yuRljQ6h.js";
3
- import { i as rootRelative } from "./output-DWE3SIUA.js";
4
- import { createRequire } from "node:module";
5
- //#region \0rolldown/runtime.js
6
- var __create = Object.create;
7
- var __defProp = Object.defineProperty;
8
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
9
- var __getOwnPropNames = Object.getOwnPropertyNames;
10
- var __getProtoOf = Object.getPrototypeOf;
11
- var __hasOwnProp = Object.prototype.hasOwnProperty;
12
- var __esmMin = (fn, res, err) => () => {
13
- if (err) throw err[0];
14
- try {
15
- return fn && (res = fn(fn = 0)), res;
16
- } catch (e) {
17
- throw err = [e], e;
18
- }
19
- };
20
- var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod, mod.exports), cb = null), mod.exports);
21
- var __exportAll = (all, no_symbols) => {
22
- let target = {};
23
- for (var name in all) __defProp(target, name, {
24
- get: all[name],
25
- enumerable: true
26
- });
27
- if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
28
- return target;
29
- };
30
- var __copyProps = (to, from, except, desc) => {
31
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
32
- key = keys[i];
33
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
34
- get: ((k) => from[k]).bind(null, key),
35
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
36
- });
37
- }
38
- return to;
39
- };
40
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
41
- value: mod,
42
- enumerable: true
43
- }) : target, mod));
44
- var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
45
- var __require = /* #__PURE__ */ (() => createRequire(import.meta.url))();
46
- //#endregion
47
- //#region src/cli/messages.ts
48
- /**
49
- * One message across every locale (INTERNALS §2.17): its source, where the
50
- * code uses it, and each locale's own entry with the state
51
- * `usableTranslation` gives it. The read model the language server's
52
- * hovers, diagnostics and definitions and the MCP server's translation tools
53
- * share, built like `status` and `check` build theirs (a locale's own entry,
54
- * no fallbacks), so every surface reports one state for one entry.
55
- */
56
- function indexCatalog(project, locale, path, catalog, hash) {
57
- const { config, codec, layout } = project;
58
- const file = rootRelative(config.root, path);
59
- const index = {
60
- locale,
61
- path,
62
- file,
63
- hash,
64
- catalog,
65
- entries: /* @__PURE__ */ new Map(),
66
- schemeMismatch: false,
67
- diagnostics: []
68
- };
69
- if (catalog === null) return index;
70
- const resolved = resolveDuplicates(catalog, codec);
71
- index.diagnostics = duplicateDiagnostics(resolved.duplicates, file);
72
- for (const entry of resolved.catalog.entries) {
73
- const key = entryKey(entry, layout, codec);
74
- if (key !== null && !index.entries.has(key)) index.entries.set(key, entry);
75
- }
76
- index.schemeMismatch = layout !== "source" && catalog.header.idScheme !== null && catalog.header.idScheme !== codec.idScheme;
77
- return index;
78
- }
79
- /** Every configured locale's index, the source locale first. */
80
- function indexCatalogs(project, set) {
81
- const indexes = /* @__PURE__ */ new Map();
82
- for (const locale of localeOrder(project)) {
83
- const loaded = set.get(locale);
84
- if (loaded === void 0) continue;
85
- indexes.set(locale, indexCatalog(project, locale, loaded.path, loaded.catalog, loaded.hash));
86
- }
87
- return indexes;
88
- }
89
- /** The source locale, then the others in config order. */
90
- function localeOrder(project) {
91
- const { config } = project;
92
- return [config.sourceLocale, ...config.locales.filter((l) => l !== config.sourceLocale)];
93
- }
94
- /**
95
- * One locale's own entry for a message: the source locale shows the source,
96
- * a target locale the state `usableTranslation` decides (`scheme-mismatch`
97
- * and `no-entry` as `ownStatus` decides them).
98
- */
99
- function localeView(project, index, identity) {
100
- const { config, codec, layout } = project;
101
- const entry = index.entries.get(identity.id);
102
- const view = {
103
- locale: index.locale,
104
- state: "missing",
105
- text: null,
106
- fuzzy: entry?.fuzzy ?? false,
107
- file: index.file,
108
- line: entry !== void 0 && entry.line > 0 ? entry.line : null,
109
- diagnostics: []
110
- };
111
- if (index.locale === config.sourceLocale) {
112
- view.state = "source";
113
- view.text = identity.canonical;
114
- return view;
115
- }
116
- if (index.schemeMismatch && (layout === "id" || !identity.manual)) {
117
- view.reason = "scheme-mismatch";
118
- return view;
119
- }
120
- if (entry === void 0) {
121
- view.reason = "no-entry";
122
- return view;
123
- }
124
- if (entry.translation !== "") view.text = entry.translation;
125
- const usable = usableTranslation(entry, layout, identity, codec, index.locale);
126
- if (usable.ok) {
127
- view.state = entry.state === "ai" ? "ai" : "translated";
128
- return view;
129
- }
130
- view.reason = usable.reason;
131
- for (const diagnostic of usable.diagnostics) view.diagnostics.push({
132
- ...diagnostic,
133
- file: index.file
134
- });
135
- return view;
136
- }
137
- /** A message with every locale's view; `extracted` adds the code's notes and call sites. */
138
- function messageView(project, indexes, identity, extracted) {
139
- const { config } = project;
140
- let contexts = extracted?.contexts.slice() ?? [];
141
- let maxLength = extracted?.maxLength ?? null;
142
- if (extracted === void 0) for (const index of indexes.values()) {
143
- const entry = index.entries.get(identity.id);
144
- if (entry === void 0) continue;
145
- contexts = entry.contexts.slice();
146
- maxLength = entry.maxLength;
147
- break;
148
- }
149
- const locales = [];
150
- for (const locale of localeOrder(project)) {
151
- const index = indexes.get(locale);
152
- if (index !== void 0) locales.push(localeView(project, index, identity));
153
- }
154
- return {
155
- id: identity.id,
156
- manual: identity.manual,
157
- source: identity.canonical,
158
- contexts,
159
- maxLength,
160
- keep: config.extraction.keep.includes(identity.id),
161
- locations: extracted?.locations.map((l) => ({ ...l })) ?? [],
162
- locales
163
- };
164
- }
165
- //#endregion
166
- export { __commonJSMin as a, __require as c, messageView as i, __toCommonJS as l, indexCatalogs as n, __esmMin as o, localeView as r, __exportAll as s, indexCatalog as t, __toESM as u };