@fluenti/cli 0.5.0 → 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 +333 -406
  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 +64 -64
  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
@@ -1,325 +0,0 @@
1
- import { hashMessage as e } from "@fluenti/core/internal";
2
- import * as t from "gettext-parser";
3
- import { loadConfig as n } from "@fluenti/core/config";
4
- import { existsSync as r, mkdirSync as i, readFileSync as a, statSync as o, writeFileSync as s } from "node:fs";
5
- import { dirname as c, resolve as l } from "node:path";
6
- import { Worker as u } from "node:worker_threads";
7
- import { availableParallelism as d } from "node:os";
8
- import { fileURLToPath as f } from "node:url";
9
- //#region src/catalog.ts
10
- function p(e, t, n) {
11
- let r = new Set(t.map((e) => e.id)), i = /* @__PURE__ */ new Set(), a = {}, o = 0, s = 0, c = 0;
12
- for (let r of t) {
13
- let t = e[r.id], c = t ? void 0 : h(e, r, i), l = `${r.origin.file}:${r.origin.line}`, u = t ?? c?.entry;
14
- if (c && i.add(c.id), u) a[r.id] = {
15
- ...u,
16
- message: r.message ?? u.message,
17
- context: r.context,
18
- comment: r.comment,
19
- origin: l,
20
- obsolete: !1
21
- }, s++;
22
- else if (a[r.id]) {
23
- let e = a[r.id];
24
- a[r.id] = {
25
- ...e,
26
- origin: m(e.origin, l)
27
- };
28
- } else a[r.id] = {
29
- message: r.message,
30
- context: r.context,
31
- comment: r.comment,
32
- origin: l
33
- }, o++;
34
- if (n?.stripFuzzy) {
35
- let { fuzzy: e, ...t } = a[r.id];
36
- a[r.id] = t;
37
- }
38
- }
39
- for (let [t, i] of Object.entries(e)) if (!r.has(t)) {
40
- let { fuzzy: e, ...r } = i;
41
- a[t] = n?.stripFuzzy ? {
42
- ...r,
43
- obsolete: !0
44
- } : {
45
- ...i,
46
- obsolete: !0
47
- }, c++;
48
- }
49
- return {
50
- catalog: a,
51
- result: {
52
- added: o,
53
- unchanged: s,
54
- obsolete: c
55
- }
56
- };
57
- }
58
- function m(e, t) {
59
- if (!e) return t;
60
- let n = [...new Set([...Array.isArray(e) ? e : [e], t])];
61
- return n.length === 1 ? n[0] : n;
62
- }
63
- function h(e, t, n) {
64
- if (!t.context) return;
65
- let r = `${t.origin.file}:${t.origin.line}`;
66
- for (let [i, a] of Object.entries(e)) if (!n.has(i) && a.context === void 0 && a.message === t.message && g(a.origin, r)) return {
67
- id: i,
68
- entry: a
69
- };
70
- }
71
- function g(e, t) {
72
- return e ? (Array.isArray(e) ? e : [e]).some((e) => e === t || _(e) === _(t)) : !1;
73
- }
74
- function _(e) {
75
- return e.match(/^(.*):\d+$/)?.[1] ?? e;
76
- }
77
- //#endregion
78
- //#region src/json-format.ts
79
- function v(e) {
80
- let t = JSON.parse(e), n = {};
81
- for (let [e, r] of Object.entries(t)) if (typeof r == "object" && r) {
82
- let t = r;
83
- n[e] = {
84
- message: typeof t.message == "string" ? t.message : void 0,
85
- context: typeof t.context == "string" ? t.context : void 0,
86
- comment: typeof t.comment == "string" ? t.comment : void 0,
87
- translation: typeof t.translation == "string" ? t.translation : void 0,
88
- origin: typeof t.origin == "string" || Array.isArray(t.origin) && t.origin.every((e) => typeof e == "string") ? t.origin : void 0,
89
- obsolete: typeof t.obsolete == "boolean" ? t.obsolete : void 0,
90
- fuzzy: typeof t.fuzzy == "boolean" ? t.fuzzy : void 0
91
- };
92
- }
93
- return n;
94
- }
95
- function y(e) {
96
- let t = {};
97
- for (let [n, r] of Object.entries(e)) {
98
- let e = {};
99
- r.message !== void 0 && (e.message = r.message), r.context !== void 0 && (e.context = r.context), r.comment !== void 0 && (e.comment = r.comment), r.translation !== void 0 && (e.translation = r.translation), r.origin !== void 0 && (e.origin = r.origin), r.obsolete && (e.obsolete = !0), r.fuzzy && (e.fuzzy = !0), t[n] = e;
100
- }
101
- return JSON.stringify(t, null, 2) + "\n";
102
- }
103
- //#endregion
104
- //#region src/po-format.ts
105
- var b = "fluenti-id:";
106
- function x(t, n, r) {
107
- for (let [i, a] of Object.entries(t)) for (let [t, o] of Object.entries(a)) {
108
- if (!t) continue;
109
- let a = i || o.msgctxt || void 0, s = o.msgstr?.[0] ?? void 0, c = o.comments?.reference ?? void 0, l = c?.includes("\n") ? c.split("\n").map((e) => e.trim()).filter(Boolean) : c?.includes(" ") ? c.split(/\s+/).filter(Boolean) : c, u = Array.isArray(l) && l.length === 1 ? l[0] : l, d = !r && (o.comments?.flag?.includes("fuzzy") ?? !1), { comment: f, customId: p, sourceMessage: m } = w(o.comments?.extracted), h = m && (p !== void 0 || e(m, a) === t) ? m : void 0, g = p ?? (h ? t : e(t, a));
110
- n[g] = {
111
- message: h ?? t,
112
- ...a === void 0 ? {} : { context: a },
113
- ...f === void 0 ? {} : { comment: f },
114
- ...s ? { translation: s } : {},
115
- ...u === void 0 ? {} : { origin: u },
116
- ...d ? { fuzzy: !0 } : {},
117
- ...r ? { obsolete: !0 } : {}
118
- };
119
- }
120
- }
121
- function S(e) {
122
- let n = t.po.parse(e), r = {};
123
- return x(n.translations ?? {}, r, !1), n.obsolete && x(n.obsolete, r, !0), r;
124
- }
125
- function C(n) {
126
- let r = { "": { "": {
127
- msgid: "",
128
- msgstr: ["Content-Type: text/plain; charset=UTF-8\n"]
129
- } } }, i = {};
130
- for (let [t, a] of Object.entries(n)) {
131
- let n = {
132
- msgid: a.message !== void 0 && e(a.message, a.context) === t ? a.message ?? t : t,
133
- ...a.context === void 0 ? {} : { msgctxt: a.context },
134
- msgstr: [a.translation ?? ""]
135
- }, o = {};
136
- a.origin && !a.obsolete && (o.reference = Array.isArray(a.origin) ? a.origin.join("\n") : a.origin);
137
- let s = E(t, a.message ?? t, a.context, a.comment);
138
- if (s && (o.extracted = s), a.fuzzy && !a.obsolete && (o.flag = "fuzzy"), (o.reference || o.extracted || o.flag) && (n.comments = o), a.obsolete) {
139
- let e = a.context ?? "";
140
- i[e] ??= {}, i[e][n.msgid] = n;
141
- } else {
142
- let e = a.context ?? "";
143
- r[e] ??= {}, r[e][n.msgid] = n;
144
- }
145
- }
146
- let a = {
147
- headers: { "Content-Type": "text/plain; charset=UTF-8" },
148
- translations: r,
149
- ...Object.keys(i).length > 0 ? { obsolete: i } : {}
150
- };
151
- return t.po.compile(a).toString();
152
- }
153
- function w(e) {
154
- if (!e) return {};
155
- let t = e.split("\n").map((e) => e.trim()).filter(Boolean), n, r, i = [];
156
- for (let e of t) {
157
- if (e.startsWith(b)) {
158
- n = e.slice(11).trim() || void 0;
159
- continue;
160
- }
161
- if (e.startsWith("msg`") && e.endsWith("`")) {
162
- r = e.slice(4, -1);
163
- continue;
164
- }
165
- if (e.startsWith("Trans: ")) {
166
- r = T(e.slice(7));
167
- continue;
168
- }
169
- i.push(e);
170
- }
171
- return {
172
- ...i.length > 0 ? { comment: i.join("\n") } : {},
173
- ...n ? { customId: n } : {},
174
- ...r ? { sourceMessage: r } : {}
175
- };
176
- }
177
- function T(e) {
178
- let t = [], n = 0;
179
- return e.replace(/<\/?([a-zA-Z][\w-]*)>/g, (e, r) => {
180
- let i = r;
181
- if (e.startsWith("</")) {
182
- for (let e = t.length - 1; e >= 0; e--) {
183
- let n = t[e];
184
- if (n?.tag === i) return t = t.filter((t, n) => n !== e), `</${n.index}>`;
185
- }
186
- return e;
187
- }
188
- let a = n++;
189
- return t.push({
190
- tag: i,
191
- index: a
192
- }), `<${a}>`;
193
- });
194
- }
195
- function E(t, n, r, i) {
196
- let a = [];
197
- return i && a.push(i), t !== e(n, r) && (a.push(`${b} ${t}`), a.push(`msg\`${n}\``)), a.length > 0 ? a.join("\n") : void 0;
198
- }
199
- //#endregion
200
- //#region src/parallel-compile.ts
201
- var D = 3e4;
202
- function O() {
203
- return l(typeof __dirname < "u" ? __dirname : c(f(import.meta.url)), "compile-worker.js");
204
- }
205
- async function k(e, t) {
206
- if (e.length === 0) return [];
207
- if (e.length === 1) {
208
- let { compileCatalog: t } = await import("./compile-CdA4EZ-p.js").then((e) => e.a), n = e[0], { code: r, stats: i } = t(n.catalog, n.locale, n.allIds, n.sourceLocale, n.options);
209
- return [{
210
- locale: n.locale,
211
- code: r,
212
- stats: i
213
- }];
214
- }
215
- let n = O();
216
- if (!r(n)) return A(e);
217
- let i = t ?? Math.min(e.length, d()), a = [], o = [...e], s = !1;
218
- return new Promise((e, t) => {
219
- let r = 0;
220
- function c() {
221
- if (s) return;
222
- let i = o.shift();
223
- if (!i) {
224
- r === 0 && e(a);
225
- return;
226
- }
227
- r++;
228
- let l = new u(n), d = setTimeout(() => {
229
- s || (s = !0, r--, l.terminate(), t(/* @__PURE__ */ Error(`Worker timed out after ${D}ms compiling locale "${i.locale}"`)));
230
- }, D);
231
- l.on("message", (e) => {
232
- if (clearTimeout(d), !s) {
233
- if (e.error) {
234
- s = !0, r--, l.terminate(), t(/* @__PURE__ */ Error(`Failed to compile locale "${e.locale}": ${e.error}`));
235
- return;
236
- }
237
- a.push({
238
- locale: e.locale,
239
- code: e.code,
240
- stats: e.stats
241
- }), r--, l.terminate(), c();
242
- }
243
- }), l.on("error", (e) => {
244
- clearTimeout(d), s || (s = !0, l.terminate(), t(/* @__PURE__ */ Error(`Worker error compiling locale "${i.locale}": ${e.message}`)));
245
- }), l.on("exit", (e) => {
246
- clearTimeout(d), e !== 0 && !s && (s = !0, t(/* @__PURE__ */ Error(`Worker exited with code ${e} while compiling locale "${i.locale}"`)));
247
- });
248
- let f = {
249
- locale: i.locale,
250
- catalog: i.catalog,
251
- allIds: i.allIds,
252
- sourceLocale: i.sourceLocale,
253
- options: i.options
254
- };
255
- l.postMessage(f);
256
- }
257
- let l = Math.min(i, o.length);
258
- for (let e = 0; e < l; e++) c();
259
- });
260
- }
261
- async function A(e) {
262
- let { compileCatalog: t } = await import("./compile-CdA4EZ-p.js").then((e) => e.a);
263
- return Promise.all(e.map((e) => {
264
- let { code: n, stats: r } = t(e.catalog, e.locale, e.allIds, e.sourceLocale, e.options);
265
- return {
266
- locale: e.locale,
267
- code: n,
268
- stats: r
269
- };
270
- }));
271
- }
272
- //#endregion
273
- //#region src/extract-cache.ts
274
- var j = "1", M = class {
275
- data;
276
- cachePath;
277
- dirty = !1;
278
- constructor(e, t) {
279
- this.cachePath = l(t ? l(e, ".cache", t) : l(e, ".cache"), "extract-cache.json"), this.data = this.load();
280
- }
281
- get(e) {
282
- let t = this.data.entries[e];
283
- if (t) try {
284
- let n = o(e);
285
- if (n.mtimeMs === t.mtime && n.size === t.size) return t.messages;
286
- } catch {}
287
- }
288
- set(e, t) {
289
- try {
290
- let n = o(e);
291
- this.data.entries[e] = {
292
- mtime: n.mtimeMs,
293
- size: n.size,
294
- messages: t
295
- }, this.dirty = !0;
296
- } catch {}
297
- }
298
- prune(e) {
299
- for (let t of Object.keys(this.data.entries)) e.has(t) || (delete this.data.entries[t], this.dirty = !0);
300
- }
301
- save() {
302
- if (this.dirty) try {
303
- i(c(this.cachePath), { recursive: !0 }), s(this.cachePath, JSON.stringify(this.data), "utf-8"), this.dirty = !1;
304
- } catch {}
305
- }
306
- get size() {
307
- return Object.keys(this.data.entries).length;
308
- }
309
- load() {
310
- try {
311
- if (r(this.cachePath)) {
312
- let e = a(this.cachePath, "utf-8"), t = JSON.parse(e);
313
- if (t.version === j) return t;
314
- }
315
- } catch {}
316
- return {
317
- version: j,
318
- entries: {}
319
- };
320
- }
321
- };
322
- //#endregion
323
- export { C as a, p as c, S as i, k as n, v as o, n as r, y as s, M as t };
324
-
325
- //# sourceMappingURL=extract-cache-C-MI1_ll.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"extract-cache-C-MI1_ll.js","names":[],"sources":["../src/catalog.ts","../src/json-format.ts","../src/po-format.ts","../src/parallel-compile.ts","../src/extract-cache.ts"],"sourcesContent":["import type { ExtractedMessage } from '@fluenti/core/internal'\n\nexport interface CatalogEntry {\n message?: string | undefined\n context?: string | undefined\n comment?: string | undefined\n translation?: string | undefined\n origin?: string | string[] | undefined\n obsolete?: boolean | undefined\n fuzzy?: boolean | undefined\n}\n\nexport type CatalogData = Record<string, CatalogEntry>\n\nexport interface UpdateResult {\n added: number\n unchanged: number\n obsolete: number\n}\n\nexport interface UpdateCatalogOptions {\n stripFuzzy?: boolean\n}\n\n/** Update catalog with newly extracted messages */\nexport function updateCatalog(\n existing: CatalogData,\n extracted: ExtractedMessage[],\n options?: UpdateCatalogOptions,\n): { catalog: CatalogData; result: UpdateResult } {\n const extractedIds = new Set(extracted.map((m) => m.id))\n const consumedCarryForwardIds = new Set<string>()\n const catalog: CatalogData = {}\n let added = 0\n let unchanged = 0\n let obsolete = 0\n\n for (const msg of extracted) {\n const existingEntry = existing[msg.id]\n const carried = existingEntry\n ? undefined\n : findCarryForwardEntry(existing, msg, consumedCarryForwardIds)\n const origin = `${msg.origin.file}:${msg.origin.line}`\n const baseEntry = existingEntry ?? carried?.entry\n\n if (carried) {\n consumedCarryForwardIds.add(carried.id)\n }\n\n if (baseEntry) {\n catalog[msg.id] = {\n ...baseEntry,\n message: msg.message ?? baseEntry.message,\n context: msg.context,\n comment: msg.comment,\n origin,\n obsolete: false,\n }\n unchanged++\n } else if (catalog[msg.id]) {\n // Same ID already seen in this extraction batch — merge origin\n const existing = catalog[msg.id]!\n catalog[msg.id] = {\n ...existing,\n origin: mergeOrigins(existing.origin, origin),\n }\n } else {\n catalog[msg.id] = {\n message: msg.message,\n context: msg.context,\n comment: msg.comment,\n origin,\n }\n added++\n }\n\n if (options?.stripFuzzy) {\n const { fuzzy: _fuzzy, ...rest } = catalog[msg.id]!\n catalog[msg.id] = rest\n }\n }\n\n for (const [id, entry] of Object.entries(existing)) {\n if (!extractedIds.has(id)) {\n const { fuzzy: _fuzzy, ...rest } = entry\n const obsoleteEntry = options?.stripFuzzy\n ? { ...rest, obsolete: true }\n : { ...entry, obsolete: true }\n catalog[id] = obsoleteEntry\n obsolete++\n }\n }\n\n return { catalog, result: { added, unchanged, obsolete } }\n}\n\nfunction mergeOrigins(\n existing: string | string[] | undefined,\n newOrigin: string,\n): string | string[] {\n if (!existing) return newOrigin\n const existingArray = Array.isArray(existing) ? existing : [existing]\n const merged = [...new Set([...existingArray, newOrigin])]\n return merged.length === 1 ? merged[0]! : merged\n}\n\nfunction findCarryForwardEntry(\n existing: CatalogData,\n extracted: ExtractedMessage,\n consumedCarryForwardIds: Set<string>,\n): { id: string; entry: CatalogEntry } | undefined {\n if (!extracted.context) {\n return undefined\n }\n\n const extractedOrigin = `${extracted.origin.file}:${extracted.origin.line}`\n for (const [id, entry] of Object.entries(existing)) {\n if (consumedCarryForwardIds.has(id)) continue\n if (entry.context !== undefined) continue\n if (entry.message !== extracted.message) continue\n if (!sameOrigin(entry.origin, extractedOrigin)) continue\n return { id, entry }\n }\n\n return undefined\n}\n\nfunction sameOrigin(previous: string | string[] | undefined, next: string): boolean {\n if (!previous) return false\n const origins = Array.isArray(previous) ? previous : [previous]\n return origins.some((o) => o === next || originFile(o) === originFile(next))\n}\n\nfunction originFile(origin: string): string {\n const match = origin.match(/^(.*):\\d+$/)\n return match?.[1] ?? origin\n}\n","import type { CatalogData } from './catalog'\n\n/** Read a JSON catalog file */\nexport function readJsonCatalog(content: string): CatalogData {\n const raw = JSON.parse(content) as Record<string, unknown>\n const catalog: CatalogData = {}\n\n for (const [id, entry] of Object.entries(raw)) {\n if (typeof entry === 'object' && entry !== null) {\n const e = entry as Record<string, unknown>\n catalog[id] = {\n message: typeof e['message'] === 'string' ? e['message'] : undefined,\n context: typeof e['context'] === 'string' ? e['context'] : undefined,\n comment: typeof e['comment'] === 'string' ? e['comment'] : undefined,\n translation: typeof e['translation'] === 'string' ? e['translation'] : undefined,\n origin: typeof e['origin'] === 'string'\n ? e['origin']\n : Array.isArray(e['origin']) && (e['origin'] as unknown[]).every((v) => typeof v === 'string')\n ? (e['origin'] as string[])\n : undefined,\n obsolete: typeof e['obsolete'] === 'boolean' ? e['obsolete'] : undefined,\n fuzzy: typeof e['fuzzy'] === 'boolean' ? e['fuzzy'] : undefined,\n }\n }\n }\n\n return catalog\n}\n\n/** Write a catalog to JSON format */\nexport function writeJsonCatalog(catalog: CatalogData): string {\n const output: Record<string, Record<string, unknown>> = {}\n\n for (const [id, entry] of Object.entries(catalog)) {\n const obj: Record<string, unknown> = {}\n if (entry.message !== undefined) obj['message'] = entry.message\n if (entry.context !== undefined) obj['context'] = entry.context\n if (entry.comment !== undefined) obj['comment'] = entry.comment\n if (entry.translation !== undefined) obj['translation'] = entry.translation\n if (entry.origin !== undefined) obj['origin'] = entry.origin\n if (entry.obsolete) obj['obsolete'] = true\n if (entry.fuzzy) obj['fuzzy'] = true\n output[id] = obj\n }\n\n return JSON.stringify(output, null, 2) + '\\n'\n}\n","import type { CatalogData } from './catalog'\nimport { hashMessage } from '@fluenti/core/internal'\nimport * as gettextParser from 'gettext-parser'\n\nconst CUSTOM_ID_MARKER = 'fluenti-id:'\n\ninterface POTranslation {\n msgid: string\n msgctxt?: string\n msgstr: string[]\n comments?: {\n reference?: string\n extracted?: string\n flag?: string\n translator?: string\n previous?: string\n }\n}\n\ninterface POData {\n headers?: Record<string, string>\n translations: Record<string, Record<string, POTranslation>>\n obsolete?: Record<string, Record<string, POTranslation>>\n}\n\ninterface ParsedExtractedComment {\n comment?: string\n customId?: string\n sourceMessage?: string\n}\n\nfunction processPoEntries(\n contextMap: Record<string, Record<string, POTranslation>>,\n catalog: CatalogData,\n isObsolete: boolean,\n): void {\n for (const [contextKey, entries] of Object.entries(contextMap)) {\n for (const [msgid, entry] of Object.entries(entries)) {\n if (!msgid) continue\n\n const context = contextKey || entry.msgctxt || undefined\n const translation = entry.msgstr?.[0] ?? undefined\n const rawReference = entry.comments?.reference ?? undefined\n const origin = rawReference?.includes('\\n')\n ? rawReference.split('\\n').map((r: string) => r.trim()).filter(Boolean)\n : rawReference?.includes(' ')\n ? rawReference.split(/\\s+/).filter(Boolean)\n : rawReference\n const normalizedOrigin = Array.isArray(origin) && origin.length === 1 ? origin[0] : origin\n const isFuzzy = !isObsolete && (entry.comments?.flag?.includes('fuzzy') ?? false)\n const { comment, customId, sourceMessage } = parseExtractedComment(entry.comments?.extracted)\n // When a custom ID is present, the msgid may be the custom key (not source text),\n // so accept sourceMessage directly without requiring a hash match.\n // For hash-ID entries (no customId), verify the hash to prevent double-hashing.\n const resolvedSourceMessage = sourceMessage\n && (customId !== undefined || hashMessage(sourceMessage, context) === msgid)\n ? sourceMessage\n : undefined\n const id = customId\n ?? (resolvedSourceMessage ? msgid : hashMessage(msgid, context))\n\n catalog[id] = {\n message: resolvedSourceMessage ?? msgid,\n ...(context !== undefined ? { context } : {}),\n ...(comment !== undefined ? { comment } : {}),\n ...(translation ? { translation } : {}),\n ...(normalizedOrigin !== undefined ? { origin: normalizedOrigin } : {}),\n ...(isFuzzy ? { fuzzy: true } : {}),\n ...(isObsolete ? { obsolete: true } : {}),\n }\n }\n }\n}\n\n/** Read a PO catalog file */\nexport function readPoCatalog(content: string): CatalogData {\n const po = gettextParser.po.parse(content) as POData\n const catalog: CatalogData = {}\n\n processPoEntries(po.translations ?? {}, catalog, false)\n if (po.obsolete) {\n processPoEntries(po.obsolete, catalog, true)\n }\n\n return catalog\n}\n\n/** Write a catalog to PO format */\nexport function writePoCatalog(catalog: CatalogData): string {\n const translations: POData['translations'] = {\n '': {\n '': {\n msgid: '',\n msgstr: ['Content-Type: text/plain; charset=UTF-8\\n'],\n },\n },\n }\n const obsolete: POData['obsolete'] = {}\n\n for (const [id, entry] of Object.entries(catalog)) {\n // Use custom ID as msgid for non-hash entries to prevent collision when two\n // entries share the same source message but have different custom IDs.\n // Hash-ID entries keep source message as msgid (PO-friendly for translators).\n const isHashId = entry.message !== undefined && hashMessage(entry.message, entry.context) === id\n const msgid = isHashId ? (entry.message ?? id) : id\n const poEntry: POTranslation = {\n msgid,\n ...(entry.context !== undefined ? { msgctxt: entry.context } : {}),\n msgstr: [entry.translation ?? ''],\n }\n\n const comments: POTranslation['comments'] = {}\n if (entry.origin && !entry.obsolete) {\n comments.reference = Array.isArray(entry.origin)\n ? entry.origin.join('\\n')\n : entry.origin\n }\n const extractedComment = buildExtractedComment(id, entry.message ?? id, entry.context, entry.comment)\n if (extractedComment) {\n comments.extracted = extractedComment\n }\n if (entry.fuzzy && !entry.obsolete) {\n comments.flag = 'fuzzy'\n }\n if (comments.reference || comments.extracted || comments.flag) {\n poEntry.comments = comments\n }\n\n if (entry.obsolete) {\n const contextKey = entry.context ?? ''\n obsolete[contextKey] ??= {}\n obsolete[contextKey]![poEntry.msgid] = poEntry\n } else {\n const contextKey = entry.context ?? ''\n translations[contextKey] ??= {}\n translations[contextKey]![poEntry.msgid] = poEntry\n }\n }\n\n const poData: POData = {\n headers: {\n 'Content-Type': 'text/plain; charset=UTF-8',\n },\n translations,\n ...(Object.keys(obsolete).length > 0 ? { obsolete } : {}),\n }\n\n const buffer = gettextParser.po.compile(poData as Parameters<typeof gettextParser.po.compile>[0])\n return buffer.toString()\n}\n\nfunction parseExtractedComment(\n extracted: string | undefined,\n): ParsedExtractedComment {\n if (!extracted) {\n return {}\n }\n\n const lines = extracted.split('\\n').map((line) => line.trim()).filter(Boolean)\n let customId: string | undefined\n let sourceMessage: string | undefined\n const commentLines: string[] = []\n\n for (const line of lines) {\n if (line.startsWith(CUSTOM_ID_MARKER)) {\n customId = line.slice(CUSTOM_ID_MARKER.length).trim() || undefined\n continue\n }\n if (line.startsWith('msg`') && line.endsWith('`')) {\n sourceMessage = line.slice(4, -1)\n continue\n }\n if (line.startsWith('Trans: ')) {\n sourceMessage = normalizeRichTextComment(line.slice('Trans: '.length))\n continue\n }\n commentLines.push(line)\n }\n\n return {\n ...(commentLines.length > 0 ? { comment: commentLines.join('\\n') } : {}),\n ...(customId ? { customId } : {}),\n ...(sourceMessage ? { sourceMessage } : {}),\n }\n}\n\nfunction normalizeRichTextComment(comment: string): string {\n let stack: Array<{ tag: string; index: number }> = []\n let nextIndex = 0\n\n return comment.replace(/<\\/?([a-zA-Z][\\w-]*)>/g, (match, rawTag: string) => {\n const tag = rawTag\n if (match.startsWith('</')) {\n for (let index = stack.length - 1; index >= 0; index--) {\n const entry = stack[index]\n if (entry?.tag !== tag) continue\n stack = stack.filter((_, i) => i !== index)\n return `</${entry.index}>`\n }\n return match\n }\n\n const index = nextIndex++\n stack.push({ tag, index })\n return `<${index}>`\n })\n}\n\nfunction buildExtractedComment(\n id: string,\n message: string,\n context: string | undefined,\n comment: string | undefined,\n): string | undefined {\n const lines: string[] = []\n\n if (comment) {\n lines.push(comment)\n }\n\n if (id !== hashMessage(message, context)) {\n lines.push(`${CUSTOM_ID_MARKER} ${id}`)\n // Preserve source message so round-trip works when msgid is the custom ID (not source text)\n lines.push(`msg\\`${message}\\``)\n }\n\n return lines.length > 0 ? lines.join('\\n') : undefined\n}\n","import { Worker } from 'node:worker_threads'\nimport { availableParallelism } from 'node:os'\nimport { existsSync } from 'node:fs'\nimport { resolve, dirname } from 'node:path'\nimport { fileURLToPath } from 'node:url'\nimport type { CatalogData } from './catalog'\nimport type { CompileOptions, CompileStats } from './compile'\nimport type { CompileWorkerRequest, CompileWorkerResponse } from './compile-worker'\n\nexport interface ParallelCompileTask {\n locale: string\n catalog: CatalogData\n allIds: string[]\n sourceLocale: string\n options?: CompileOptions\n}\n\nexport interface ParallelCompileResult {\n locale: string\n code: string\n stats: CompileStats\n}\n\n/** Default timeout per worker in milliseconds (30 seconds) */\nconst WORKER_TIMEOUT_MS = 30_000\n\nfunction getWorkerPath(): string {\n const thisDir = typeof __dirname !== 'undefined'\n ? __dirname\n : dirname(fileURLToPath(import.meta.url))\n return resolve(thisDir, 'compile-worker.js')\n}\n\n/**\n * Compile multiple locales in parallel using worker threads.\n *\n * - Single task → returns result directly (no worker overhead)\n * - Multiple tasks → spawns min(tasks, availableParallelism()) workers\n * - Workers are created per-call and destroyed after completion\n *\n * Falls back to in-process compilation when the compiled worker is unavailable\n * (e.g. when running from TypeScript source in development/tests).\n */\nexport async function parallelCompile(\n tasks: ParallelCompileTask[],\n concurrency?: number,\n): Promise<ParallelCompileResult[]> {\n if (tasks.length === 0) return []\n\n // Single task: compile in-process, no worker overhead\n if (tasks.length === 1) {\n const { compileCatalog } = await import('./compile')\n const task = tasks[0]!\n const { code, stats } = compileCatalog(task.catalog, task.locale, task.allIds, task.sourceLocale, task.options)\n return [{ locale: task.locale, code, stats }]\n }\n\n const workerPath = getWorkerPath()\n\n // If compiled worker doesn't exist (dev/test), fall back to concurrent in-process compilation\n if (!existsSync(workerPath)) {\n return inProcessParallelCompile(tasks)\n }\n\n const maxWorkers = concurrency ?? Math.min(tasks.length, availableParallelism())\n const results: ParallelCompileResult[] = []\n const queue = [...tasks]\n let rejected = false\n\n return new Promise<ParallelCompileResult[]>((resolveAll, rejectAll) => {\n let activeWorkers = 0\n\n function spawnNext(): void {\n if (rejected) return\n const task = queue.shift()\n if (!task) {\n if (activeWorkers === 0) {\n resolveAll(results)\n }\n return\n }\n\n activeWorkers++\n const worker = new Worker(workerPath)\n\n const timer = setTimeout(() => {\n if (!rejected) {\n rejected = true\n activeWorkers--\n worker.terminate()\n rejectAll(new Error(`Worker timed out after ${WORKER_TIMEOUT_MS}ms compiling locale \"${task.locale}\"`))\n }\n }, WORKER_TIMEOUT_MS)\n\n worker.on('message', (response: CompileWorkerResponse) => {\n clearTimeout(timer)\n if (rejected) return\n if (response.error) {\n rejected = true\n activeWorkers--\n worker.terminate()\n rejectAll(new Error(`Failed to compile locale \"${response.locale}\": ${response.error}`))\n return\n }\n results.push({\n locale: response.locale,\n code: response.code,\n stats: response.stats,\n })\n activeWorkers--\n worker.terminate()\n spawnNext()\n })\n\n worker.on('error', (err: Error) => {\n clearTimeout(timer)\n if (!rejected) {\n rejected = true\n worker.terminate()\n rejectAll(new Error(`Worker error compiling locale \"${task.locale}\": ${err.message}`))\n }\n })\n\n worker.on('exit', (code) => {\n clearTimeout(timer)\n if (code !== 0 && !rejected) {\n rejected = true\n rejectAll(new Error(`Worker exited with code ${code} while compiling locale \"${task.locale}\"`))\n }\n })\n\n const request: CompileWorkerRequest = {\n locale: task.locale,\n catalog: task.catalog,\n allIds: task.allIds,\n sourceLocale: task.sourceLocale,\n options: task.options,\n }\n worker.postMessage(request)\n }\n\n // Start initial batch of workers\n const initialBatch = Math.min(maxWorkers, queue.length)\n for (let i = 0; i < initialBatch; i++) {\n spawnNext()\n }\n })\n}\n\n/**\n * In-process fallback for parallel compilation.\n * Uses Promise.all for concurrency when workers are unavailable.\n */\nasync function inProcessParallelCompile(\n tasks: ParallelCompileTask[],\n): Promise<ParallelCompileResult[]> {\n const { compileCatalog } = await import('./compile')\n return Promise.all(\n tasks.map((task) => {\n const { code, stats } = compileCatalog(task.catalog, task.locale, task.allIds, task.sourceLocale, task.options)\n return { locale: task.locale, code, stats }\n }),\n )\n}\n","import { readFileSync, writeFileSync, existsSync, mkdirSync, statSync } from 'node:fs'\nimport { dirname, resolve } from 'node:path'\nimport type { ExtractedMessage } from '@fluenti/core/internal'\n\n/** Cache format version — bump when the structure changes */\nconst CACHE_VERSION = '1'\n\ninterface ExtractCacheEntry {\n mtime: number\n size: number\n messages: ExtractedMessage[]\n}\n\ninterface ExtractCacheData {\n version: string\n entries: Record<string, ExtractCacheEntry>\n}\n\n/**\n * File-level extract cache that skips re-extraction for unchanged files.\n *\n * Cache is keyed by file path, with mtime + size as change detection.\n */\nexport class ExtractCache {\n private data: ExtractCacheData\n private cachePath: string\n private dirty = false\n\n constructor(catalogDir: string, projectId?: string) {\n const cacheDir = projectId\n ? resolve(catalogDir, '.cache', projectId)\n : resolve(catalogDir, '.cache')\n this.cachePath = resolve(cacheDir, 'extract-cache.json')\n this.data = this.load()\n }\n\n /**\n * Check if a file has changed since the last extraction.\n * Returns cached messages if unchanged, undefined if re-extraction needed.\n */\n get(filePath: string): ExtractedMessage[] | undefined {\n const entry = this.data.entries[filePath]\n if (!entry) return undefined\n\n try {\n const stat = statSync(filePath)\n if (stat.mtimeMs === entry.mtime && stat.size === entry.size) {\n return entry.messages\n }\n } catch {\n // File no longer exists or can't be stat'd — cache miss\n }\n\n return undefined\n }\n\n /**\n * Update the cache for a file after extraction.\n */\n set(filePath: string, messages: ExtractedMessage[]): void {\n try {\n const stat = statSync(filePath)\n this.data.entries[filePath] = {\n mtime: stat.mtimeMs,\n size: stat.size,\n messages,\n }\n this.dirty = true\n } catch {\n // File doesn't exist — skip caching\n }\n }\n\n /**\n * Remove entries for files that no longer exist in the file list.\n */\n prune(currentFiles: Set<string>): void {\n for (const filePath of Object.keys(this.data.entries)) {\n if (!currentFiles.has(filePath)) {\n delete this.data.entries[filePath]\n this.dirty = true\n }\n }\n }\n\n /**\n * Write the cache to disk if any changes were made.\n */\n save(): void {\n if (!this.dirty) return\n\n try {\n mkdirSync(dirname(this.cachePath), { recursive: true })\n writeFileSync(this.cachePath, JSON.stringify(this.data), 'utf-8')\n this.dirty = false\n } catch {\n // Cache write failure is non-fatal — next run will re-extract\n }\n }\n\n /** Number of cached entries */\n get size(): number {\n return Object.keys(this.data.entries).length\n }\n\n private load(): ExtractCacheData {\n try {\n if (existsSync(this.cachePath)) {\n const raw = readFileSync(this.cachePath, 'utf-8')\n const parsed = JSON.parse(raw) as ExtractCacheData\n if (parsed.version === CACHE_VERSION) {\n return parsed\n }\n }\n }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;;;;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"}
@@ -1 +0,0 @@
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"}
@@ -1 +0,0 @@
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"}
@@ -1 +0,0 @@
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"}
@@ -1 +0,0 @@
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"}
@@ -1 +0,0 @@
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"}
@@ -1 +0,0 @@
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,EA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E,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"}
@@ -1 +0,0 @@
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"}
@@ -1 +0,0 @@
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"}
@@ -1 +0,0 @@
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"}
@@ -1 +0,0 @@
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"}
@@ -1 +0,0 @@
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,2 +0,0 @@
1
- require(`./extract-cache-BioSaoFo.cjs`);let e=require(`@fluenti/core/transform`);var t=new Set([`@fluenti/core`,`@fluenti/react`,`@fluenti/vue`,`@fluenti/solid`,`@fluenti/next`]);function n(e){let t=e.trim();if(/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(t))return t;if(/^[a-zA-Z_$][a-zA-Z0-9_$.]*$/.test(t)&&!t.endsWith(`.`)){let e=t.split(`.`);return e[e.length-1]}let n=t.match(/^([a-zA-Z_$][a-zA-Z0-9_$.]*)\s*\(/);return n?n[1].replace(/\./g,`_`):``}function r(e,t){let r=``,i=0;for(let a=0;a<e.length;a++){if(r+=e[a],a>=t.length)continue;let o=n(t[a]);if(o===``){r+=`{arg${i}}`,i++;continue}r+=`{${o}}`}return r}function i(e,t,n){if(!e.message)return;let r=n.loc?.start.line??1,i=(n.loc?.start.column??0)+1;return{id:e.id,message:e.message,...e.context===void 0?{}:{context:e.context},...e.comment===void 0?{}:{comment:e.comment},origin:{file:t,line:r,column:i}}}function a(t,n){if(!t.message)return;let r=n??e.createMessageId;return{id:t.id??r(t.message,t.context),message:t.message,...t.context===void 0?{}:{context:t.context},...t.comment===void 0?{}:{comment:t.comment}}}function o(e,t){if(e.type===`StringLiteral`)return a({message:e.value},t);if(e.type===`TemplateLiteral`){let n=e;return n.expressions.length===0?a({message:n.quasis.map(e=>e.value.cooked??e.value.raw).join(``)},t):void 0}if(e.type!==`ObjectExpression`)return;let n={};for(let t of e.properties){if(t.type!==`ObjectProperty`)continue;let e=t;if(e.computed||!T(e.key))continue;let r=e.key.name;if(![`id`,`message`,`context`,`comment`].includes(r))continue;let i=p(e.value);i!==void 0&&(n[r]=i)}if(n.message)return a(n,t)}var s=new Set([`id`,`value`,`context`,`comment`,`options`,`other`,`tag`]);function c(e,t,n){let r=[];for(let[e,n]of Object.entries(t))r.push(`${e} {${n}}`);return r.push(`other {${n}}`),`{${e}, select, ${r.join(` `)}}`}function l(e,t){let r,i,a,o,c,l={};for(let u of e.attributes){if(u.type!==`JSXAttribute`)continue;let e=u;if(e.name.type!==`JSXIdentifier`)continue;let d=String(e.name.name);if(d===`id`){i=e.value?p(e.value):void 0;continue}if(d===`value`){let i=e.value?p(e.value)??m(e.value,t):void 0;r=i?n(i)||i:void 0;continue}if(d===`context`){a=e.value?p(e.value):void 0;continue}if(d===`comment`){o=e.value?p(e.value):void 0;continue}if(d===`other`){c=e.value?p(e.value):void 0;continue}if(s.has(d))continue;let f=e.value?p(e.value):void 0;f!==void 0&&(l[d]=f)}return{varName:r,id:i,context:a,comment:o,cases:l,other:c}}function u(e){let t=[`zero`,`one`,`two`,`few`,`many`,`other`],n=e.value??e.count??`count`,r=[],i=e.offset;for(let n of t){let t=e[n];if(t===void 0)continue;let i=n===`zero`?`=0`:n;r.push(`${i} {${t}}`)}return r.length===0?``:`{${n}, plural, ${i?`offset:${i} `:``}${r.join(` `)}}`}function d(e){let t=0;function n(e){let r=``;for(let i of e){if(i.type===`JSXText`){r+=f(i.value);continue}if(i.type===`JSXElement`){let e=t++,a=n(i.children);if(a===void 0)return;r+=`<${e}>${a}</${e}>`;continue}if(i.type===`JSXFragment`){let e=n(i.children);if(e===void 0)return;r+=e;continue}if(i.type===`JSXExpressionContainer`){let e=i.expression;if(e.type===`StringLiteral`){r+=e.value;continue}if(e.type===`NumericLiteral`){r+=String(e.value);continue}return}}return r}let r=n(e);if(r!==void 0)return r.replace(/\s+/g,` `).trim()||void 0}function f(e){return e.replace(/\s+/g,` `)}function p(e){if(e.type===`StringLiteral`)return e.value;if(e.type===`NumericLiteral`)return String(e.value);if(e.type===`JSXExpressionContainer`)return p(e.expression);if(e.type===`TemplateLiteral`){let t=e;if(t.expressions.length===0)return t.quasis.map(e=>e.value.cooked??e.value.raw).join(``)}}function m(e,t){if(!(e.start==null||e.end==null))return e.type===`JSXExpressionContainer`?m(e.expression,t):t.slice(e.start,e.end).trim()}function h(e,t){for(let n of e.attributes){if(n.type!==`JSXAttribute`)continue;let e=n;if(e.name.type===`JSXIdentifier`&&e.name.name===t)return e}}function g(e,t){let n={};for(let r of[`id`,`value`,`count`,`offset`,`zero`,`one`,`two`,`few`,`many`,`other`]){let i=h(e,r);if(!i?.value)continue;let a=p(i.value);if(a!==void 0){n[r]=a;continue}let o=m(i.value,t);o!==void 0&&(r===`value`||r===`count`||r===`offset`)&&(n[r]=o)}return n}function _(t,n,i){let a=r(n.quasi.quasis.map(e=>e.value.cooked??e.value.raw),n.quasi.expressions.map(e=>e.start==null||e.end==null?``:t.slice(e.start,e.end)));return{id:(i??e.createMessageId)(a),message:a}}function v(e){let n=new Map,r=Array.isArray(e.body)?e.body:[];for(let e of r)if(b(e)&&t.has(e.source.value))for(let t of e.specifiers){if(!x(t))continue;let e=S(t);(e===`t`||e===`msg`)&&n.set(t.local.name,e)}return n}function y(t,n,r){let a=(0,e.parseSourceModule)(t);if(!a)return console.warn(`[fluenti] Failed to parse ${n} — skipping message extraction`),[];let s=[],f=v(a);return(0,e.walkSourceAst)(a,a=>{if(a.type===`TaggedTemplateExpression`){let e=a;if(T(e.tag)&&(e.tag.name===`t`||f.has(e.tag.name))){let a=_(t,e,r);f.get(e.tag.name)===`msg`&&(a.comment=`msg tagged template`);let o=i(a,n,e);o&&s.push(o)}return}if(a.type===`CallExpression`){let e=a,t=f.get(e.callee&&T(e.callee)?e.callee.name:``);if(T(e.callee)&&(e.callee.name===`t`||f.has(e.callee.name)&&t===`t`)){if(f.has(e.callee.name)&&e.arguments[0]?.type!==`ObjectExpression`)return;let t=e.arguments[0]?o(e.arguments[0],r):void 0,a=t?i(t,n,e):void 0;a&&s.push(a)}else if(e.callee.type===`MemberExpression`&&T(e.callee.object)&&f.get(e.callee.object.name)===`msg`&&T(e.callee.property)&&e.callee.property.name===`descriptor`&&e.arguments[0]){let t=o(e.arguments[0],r),a=t?i(t,n,e):void 0;a&&s.push(a)}return}if(a.type!==`JSXElement`)return;let m=a,v=m.openingElement,y=C(v.name);if(y===`Trans`){let e=h(v,`message`),t=h(v,`id`),a=h(v,`context`),o=h(v,`comment`),c=e?.value?w({id:t?.value?p(t.value):void 0,message:p(e.value),context:a?.value?p(a.value):void 0,comment:o?.value?p(o.value):void 0},r):w({id:t?.value?p(t.value):void 0,message:d(m.children),context:a?.value?p(a.value):void 0,comment:o?.value?p(o.value):void 0},r),l=c?i(c,n,m):void 0;l&&s.push(l);return}if(y===`Plural`){let a=g(v,t),o=u(a);if(!o)return;let c=r??e.createMessageId,l=i({id:a.id??c(o),message:o},n,m);l&&s.push(l);return}if(y===`Select`){let{varName:a,id:o,context:u,comment:d,cases:f,other:p}=l(v,t);if(!a||!p||Object.keys(f).length===0)return;let h=c(a,f,p),g=i({id:o??(r??e.createMessageId)(h,u),message:h,...u===void 0?{}:{context:u},...d===void 0?{}:{comment:d}},n,m);g&&s.push(g)}}),s}function b(t){return(0,e.isSourceNode)(t)&&t.type===`ImportDeclaration`}function x(t){return(0,e.isSourceNode)(t)&&t.type===`ImportSpecifier`}function S(e){if(e.imported.type===`Identifier`)return e.imported.name;if(e.imported.type===`StringLiteral`)return e.imported.value}function C(e){if(e.type===`JSXIdentifier`)return String(e.name)}function w(e,t){let n={};return e.id!==void 0&&(n.id=e.id),e.message!==void 0&&(n.message=e.message),e.context!==void 0&&(n.context=e.context),e.comment!==void 0&&(n.comment=e.comment),a(n,t)}function T(t){return(0,e.isSourceNode)(t)&&t.type===`Identifier`}Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return y}});
2
- //# sourceMappingURL=tsx-extractor-B0vFXziu.cjs.map
@@ -1 +0,0 @@
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"}
@@ -1 +0,0 @@
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 +0,0 @@
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"}
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes