@fluenti/vite-plugin 0.1.2 → 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 (67) hide show
  1. package/README.md +51 -117
  2. package/dist/build-transform.d.ts.map +1 -0
  3. package/dist/dev-runner.d.ts +28 -0
  4. package/dist/dev-runner.d.ts.map +1 -0
  5. package/dist/index.cjs +10 -10
  6. package/dist/index.cjs.map +1 -1
  7. package/dist/index.d.ts +11 -0
  8. package/dist/index.d.ts.map +1 -0
  9. package/dist/index.js +371 -491
  10. package/dist/index.js.map +1 -1
  11. package/dist/mode-detect.d.ts.map +1 -0
  12. package/dist/route-resolve.d.ts.map +1 -0
  13. package/dist/scope-transform.d.ts.map +1 -0
  14. package/dist/sfc-transform.cjs +2 -0
  15. package/dist/sfc-transform.cjs.map +1 -0
  16. package/dist/sfc-transform.d.ts.map +1 -0
  17. package/dist/sfc-transform.js +195 -0
  18. package/dist/sfc-transform.js.map +1 -0
  19. package/dist/trans-transform.d.ts.map +1 -0
  20. package/dist/types.d.ts +55 -0
  21. package/dist/types.d.ts.map +1 -0
  22. package/dist/virtual-modules.d.ts +16 -0
  23. package/dist/virtual-modules.d.ts.map +1 -0
  24. package/dist/vt-transform.d.ts.map +1 -0
  25. package/package.json +12 -2
  26. package/dist/src/build-transform.d.ts.map +0 -1
  27. package/dist/src/framework-detect.d.ts +0 -2
  28. package/dist/src/framework-detect.d.ts.map +0 -1
  29. package/dist/src/index.d.ts +0 -6
  30. package/dist/src/index.d.ts.map +0 -1
  31. package/dist/src/mode-detect.d.ts.map +0 -1
  32. package/dist/src/route-resolve.d.ts.map +0 -1
  33. package/dist/src/scope-transform.d.ts.map +0 -1
  34. package/dist/src/sfc-transform.d.ts.map +0 -1
  35. package/dist/src/solid-jsx-transform.d.ts +0 -6
  36. package/dist/src/solid-jsx-transform.d.ts.map +0 -1
  37. package/dist/src/trans-transform.d.ts.map +0 -1
  38. package/dist/src/types.d.ts +0 -15
  39. package/dist/src/types.d.ts.map +0 -1
  40. package/dist/src/virtual-modules.d.ts +0 -33
  41. package/dist/src/virtual-modules.d.ts.map +0 -1
  42. package/dist/src/vt-transform.d.ts.map +0 -1
  43. package/dist/tests/build-transform.test.d.ts +0 -2
  44. package/dist/tests/build-transform.test.d.ts.map +0 -1
  45. package/dist/tests/mode-detect.test.d.ts +0 -2
  46. package/dist/tests/mode-detect.test.d.ts.map +0 -1
  47. package/dist/tests/per-route-splitting.test.d.ts +0 -2
  48. package/dist/tests/per-route-splitting.test.d.ts.map +0 -1
  49. package/dist/tests/route-resolve.test.d.ts +0 -2
  50. package/dist/tests/route-resolve.test.d.ts.map +0 -1
  51. package/dist/tests/scope-transform.test.d.ts +0 -2
  52. package/dist/tests/scope-transform.test.d.ts.map +0 -1
  53. package/dist/tests/trans-transform.test.d.ts +0 -2
  54. package/dist/tests/trans-transform.test.d.ts.map +0 -1
  55. package/dist/tests/virtual-modules.test.d.ts +0 -2
  56. package/dist/tests/virtual-modules.test.d.ts.map +0 -1
  57. package/dist/tests/vite-plugin.test.d.ts +0 -2
  58. package/dist/tests/vite-plugin.test.d.ts.map +0 -1
  59. package/dist/vite.config.d.ts +0 -3
  60. package/dist/vite.config.d.ts.map +0 -1
  61. /package/dist/{src/build-transform.d.ts → build-transform.d.ts} +0 -0
  62. /package/dist/{src/mode-detect.d.ts → mode-detect.d.ts} +0 -0
  63. /package/dist/{src/route-resolve.d.ts → route-resolve.d.ts} +0 -0
  64. /package/dist/{src/scope-transform.d.ts → scope-transform.d.ts} +0 -0
  65. /package/dist/{src/sfc-transform.d.ts → sfc-transform.d.ts} +0 -0
  66. /package/dist/{src/trans-transform.d.ts → trans-transform.d.ts} +0 -0
  67. /package/dist/{src/vt-transform.d.ts → vt-transform.d.ts} +0 -0
@@ -0,0 +1,195 @@
1
+ import { hashMessage as e } from "@fluenti/core";
2
+ //#region src/sfc-transform.ts
3
+ function t(e) {
4
+ return e.replace(/\\/g, "\\\\").replace(/'/g, "\\'");
5
+ }
6
+ function n(n, r) {
7
+ return `{ id: '${t(r?.id ?? e(n, r?.context))}', message: '${t(n)}' }`;
8
+ }
9
+ function r(e) {
10
+ let t = e.match(/<template(\s[^>]*)?>/);
11
+ if (!t) return e;
12
+ let n = t.index + t[0].length, r = e.lastIndexOf("</template>");
13
+ if (r < 0) return e;
14
+ let a = e.slice(0, n), l = e.slice(n, r), u = e.slice(r), d = /\bv-t\b/.test(l), f = /<Trans[\s>]/.test(l), p = /<Plural[\s/>]/.test(l);
15
+ return !d && !f && !p ? e : (d && (l = i(l), l = o(l)), f && (l = s(l)), p && (l = c(l)), a + l + u);
16
+ }
17
+ function i(e) {
18
+ return e.replace(/<(\w+)(\s[^>]*?)\bv-t\.(\w+)\b([^>]*?)>/g, (e, t, r, i, a) => {
19
+ if (i === "plural") return e;
20
+ let o = r + a, s = RegExp(`\\b${i}="([^"]*)"`), c = o.match(s);
21
+ if (!c) return e;
22
+ let l = c[1], u = n(l), d = r.replace(/\s*\bv-t\.\w+\b/, ""), f = a.replace(/\s*\bv-t\.\w+\b/, ""), p = RegExp(`\\s*\\b${i}="[^"]*"`);
23
+ return d = d.replace(p, ""), f = f.replace(p, ""), `<${t}${d} :${i}="$t(${u})"${f}>`;
24
+ });
25
+ }
26
+ function a(e) {
27
+ let t = [];
28
+ return {
29
+ message: e.replace(/\{\{\s*([^}]+?)\s*\}\}/g, (e, n) => {
30
+ let r = n.trim(), i;
31
+ if (/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(r)) i = r;
32
+ else if (/^[a-zA-Z_$][a-zA-Z0-9_$.]*$/.test(r) && !r.endsWith(".")) {
33
+ let e = r.split(".");
34
+ i = e[e.length - 1];
35
+ } else i = String(t.length);
36
+ return t.push(`${i}: ${r}`), `{${i}}`;
37
+ }),
38
+ vars: t
39
+ };
40
+ }
41
+ function o(e) {
42
+ return e.replace(/<(\w+)(\s[^>]*?)\bv-t(?::([a-zA-Z0-9_.]+))?(?:\.plural)?(?:="([^"]*)")?\b([^>]*)>([\s\S]*?)<\/\1>/g, (e, r, i, o, s, c, l) => {
43
+ let u = e.includes("v-t.plural"), d = i.replace(/\s*\bv-t(?::[a-zA-Z0-9_.]+)?(?:\.plural)?(?:="[^"]*")?\b/, ""), f = c.replace(/\s*\bv-t(?::[a-zA-Z0-9_.]+)?(?:\.plural)?(?:="[^"]*")?\b/, "");
44
+ if (u && s) {
45
+ let e = l.trim().split("|").map((e) => e.trim());
46
+ return `<${r}${d}${f}>{{ $t(${n(`{${s}, plural, ${(e.length === 2 ? ["one", "other"] : [
47
+ "one",
48
+ "other",
49
+ "zero",
50
+ "few",
51
+ "many"
52
+ ].slice(0, e.length)).map((t, n) => `${t} {${e[n] ?? ""}}`).join(" ")}}`, { id: o })}, { ${s} }) }}</${r}>`;
53
+ }
54
+ let p = l.trim();
55
+ if (/<(\w+)(\s[^>]*)?>[\s\S]*?<\/\1>/g.test(p)) {
56
+ let e = [], i = 0;
57
+ return `<${r}${d}${f} v-html="$vtRich(${n(p.replace(/<(\w+)((?:\s[^>]*)?)>([\s\S]*?)<\/\1>/g, (t, n, r, a) => {
58
+ let o = i++, s = {}, c = /(\w+)="([^"]*)"/g, l;
59
+ for (; (l = c.exec(r)) !== null;) s[l[1]] = l[2];
60
+ return e.push({
61
+ tag: n,
62
+ attrs: s
63
+ }), `<${o}>${a}</${o}>`;
64
+ }), { id: o })}, ${`[${e.map((e) => {
65
+ let n = Object.entries(e.attrs).map(([e, n]) => `${e}: '${t(n)}'`).join(", ");
66
+ return `{ tag: '${e.tag}', attrs: { ${n} } }`;
67
+ }).join(", ")}]`})"></${r}>`;
68
+ }
69
+ let { message: m, vars: h } = a(p), g = n(m, { id: o });
70
+ return h.length > 0 ? `<${r}${d}${f}>{{ $t(${g}, { ${h.join(", ")} }) }}</${r}>` : `<${r}${d}${f}>{{ $t(${g}) }}</${r}>`;
71
+ });
72
+ }
73
+ function s(e) {
74
+ return e.replace(/<Trans(\s[^>]*)?>(?!\s*$)([\s\S]*?)<\/Trans>/g, (e, r, i) => {
75
+ let a = r ?? "";
76
+ if (/\bmessage\s*=/.test(a)) return e;
77
+ let o = l(a, "id");
78
+ if (o.kind === "dynamic") return e;
79
+ let s = l(a, "context");
80
+ if (!o.value && s.kind === "dynamic") return e;
81
+ let c = a.match(/\btag\s*=\s*"([^"]*)"/)?.[1] ?? "span", u = a.replace(/\s*\btag\s*=\s*"[^"]*"/, "").replace(/\s*\bid\s*=\s*"[^"]*"/, "").replace(/\s*:id\s*=\s*"[^"]*"/, "").replace(/\s*\bcontext\s*=\s*"[^"]*"/, "").replace(/\s*:context\s*=\s*"[^"]*"/, "").replace(/\s*\bcomment\s*=\s*"[^"]*"/, "").replace(/\s*:comment\s*=\s*"[^"]*"/, ""), d = i.trim();
82
+ if (/<(\w+)(\s[^>]*)?>[\s\S]*?<\/\1>/g.test(d)) {
83
+ let e = [], r = 0;
84
+ return `<${c}${u} v-html="$vtRich(${n(d.replace(/<(\w+)((?:\s[^>]*)?)>([\s\S]*?)<\/\1>/g, (t, n, i, a) => {
85
+ let o = r++, s = {}, c = /(\w[\w-]*)="([^"]*)"/g, l;
86
+ for (; (l = c.exec(i)) !== null;) s[l[1]] = l[2];
87
+ return e.push({
88
+ tag: n,
89
+ attrs: s
90
+ }), `<${o}>${a}</${o}>`;
91
+ }), {
92
+ id: o.value,
93
+ context: s.value
94
+ })}, ${`[${e.map((e) => {
95
+ let n = Object.entries(e.attrs).map(([e, n]) => `${e}: '${t(n)}'`).join(", ");
96
+ return `{ tag: '${e.tag}', attrs: { ${n} } }`;
97
+ }).join(", ")}]`})"></${c}>`;
98
+ }
99
+ return `<${c}${u}>{{ $t(${n(d, {
100
+ id: o.value,
101
+ context: s.value
102
+ })}) }}</${c}>`;
103
+ });
104
+ }
105
+ function c(e) {
106
+ return e = e.replace(/<Plural(\s[^>]*?)>([\s\S]*?)<\/Plural>/g, (e, r, i) => {
107
+ let a = r ?? "", o = l(a, "id"), s = l(a, "context");
108
+ if (o.kind === "dynamic" || !o.value && s.kind === "dynamic") return e;
109
+ let c = /<template\s+#(\w+)\s*>([\s\S]*?)<\/template>/g, u = [], d;
110
+ for (; (d = c.exec(i)) !== null;) u.push({
111
+ cat: d[1],
112
+ content: d[2].trim()
113
+ });
114
+ if (u.length === 0) return e;
115
+ let f = a.match(/:value\s*=\s*"([^"]*)"/);
116
+ if (!f) return e;
117
+ let p = f[1], m = a.match(/\btag\s*=\s*"([^"]*)"/)?.[1] ?? "span", h = [
118
+ "zero",
119
+ "one",
120
+ "two",
121
+ "few",
122
+ "many",
123
+ "other"
124
+ ], g = [], _ = [];
125
+ for (let e of h) {
126
+ let t = u.find((t) => t.cat === e);
127
+ if (!t) continue;
128
+ let n = t.content, r = /<(\w+)((?:\s[^>]*)?)>([\s\S]*?)<\/\1>/g, i = n;
129
+ if (r.test(n)) {
130
+ let e = g.length, t = 0;
131
+ i = n.replace(/<(\w+)((?:\s[^>]*)?)>([\s\S]*?)<\/\1>/g, (n, r, i, a) => {
132
+ let o = e + t++, s = {}, c = /(\w[\w-]*)="([^"]*)"/g, l;
133
+ for (; (l = c.exec(i)) !== null;) s[l[1]] = l[2];
134
+ return g.push({
135
+ tag: r,
136
+ attrs: s
137
+ }), `<${o}>${a}</${o}>`;
138
+ });
139
+ }
140
+ let a = e === "zero" ? "=0" : e;
141
+ _.push(`${a} {${i}}`);
142
+ }
143
+ if (_.length === 0) return e;
144
+ let v = n(`{count, plural, ${_.join(" ")}}`, {
145
+ id: o.value,
146
+ context: s.value
147
+ }), y = a;
148
+ y = y.replace(/:value\s*=\s*"[^"]*"/, ""), y = y.replace(/\btag\s*=\s*"[^"]*"/, ""), y = y.replace(/\s*\bid\s*=\s*"[^"]*"/, ""), y = y.replace(/\s*:id\s*=\s*"[^"]*"/, ""), y = y.replace(/\s*\bcontext\s*=\s*"[^"]*"/, ""), y = y.replace(/\s*:context\s*=\s*"[^"]*"/, ""), y = y.replace(/\s*\bcomment\s*=\s*"[^"]*"/, ""), y = y.replace(/\s*:comment\s*=\s*"[^"]*"/, ""), y = y.replace(/\s+/g, " ").trim();
149
+ let b = y ? ` ${y}` : "";
150
+ return g.length > 0 ? `<${m}${b} v-html="$vtRich(${v}, ${`[${g.map((e) => {
151
+ let n = Object.entries(e.attrs).map(([e, n]) => `${e}: '${t(n)}'`).join(", ");
152
+ return `{ tag: '${e.tag}', attrs: { ${n} } }`;
153
+ }).join(", ")}]`}, { count: ${p} })"></${m}>` : `<${m}${b} v-text="$t(${v}, { count: ${p} })"></${m}>`;
154
+ }), e.replace(/<Plural(\s[^>]*?)\/?>(?:<\/Plural>)?/g, (e, t) => {
155
+ let r = t ?? "", i = l(r, "id"), a = l(r, "context");
156
+ if (i.kind === "dynamic" || !i.value && a.kind === "dynamic") return e;
157
+ let o = r.match(/:value\s*=\s*"([^"]*)"/);
158
+ if (!o) return e;
159
+ let s = o[1], c = r.match(/\btag\s*=\s*"([^"]*)"/)?.[1] ?? "span", u = [
160
+ "zero",
161
+ "one",
162
+ "two",
163
+ "few",
164
+ "many",
165
+ "other"
166
+ ], d = [];
167
+ for (let e of u) {
168
+ let t = RegExp(`(?<!:)\\b${e}\\s*=\\s*"([^"]*)"`), n = r.match(t);
169
+ if (n) {
170
+ let t = e === "zero" ? "=0" : e;
171
+ d.push(`${t} {${n[1]}}`);
172
+ }
173
+ }
174
+ if (d.length === 0) return e;
175
+ let f = n(`{count, plural, ${d.join(" ")}}`, {
176
+ id: i.value,
177
+ context: a.value
178
+ }), p = r;
179
+ p = p.replace(/:value\s*=\s*"[^"]*"/, ""), p = p.replace(/\btag\s*=\s*"[^"]*"/, ""), p = p.replace(/\s*\bid\s*=\s*"[^"]*"/, ""), p = p.replace(/\s*:id\s*=\s*"[^"]*"/, ""), p = p.replace(/\s*\bcontext\s*=\s*"[^"]*"/, ""), p = p.replace(/\s*:context\s*=\s*"[^"]*"/, ""), p = p.replace(/\s*\bcomment\s*=\s*"[^"]*"/, ""), p = p.replace(/\s*:comment\s*=\s*"[^"]*"/, "");
180
+ for (let e of u) p = p.replace(RegExp(`(?<!:)\\b${e}\\s*=\\s*"[^"]*"`), "");
181
+ return p = p.replace(/\s+/g, " ").trim(), `<${c}${p ? ` ${p}` : ""} v-text="$t(${f}, { count: ${s} })"></${c}>`;
182
+ });
183
+ }
184
+ function l(e, t) {
185
+ if (RegExp(`(?:^|\\s):${t}\\s*=`).test(e)) return { kind: "dynamic" };
186
+ let n = e.match(RegExp(`\\b${t}\\s*=\\s*"([^"]*)"`));
187
+ return n ? {
188
+ kind: "static",
189
+ value: n[1] ?? ""
190
+ } : { kind: "missing" };
191
+ }
192
+ //#endregion
193
+ export { r as transformVtDirectives };
194
+
195
+ //# sourceMappingURL=sfc-transform.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sfc-transform.js","names":[],"sources":["../src/sfc-transform.ts"],"sourcesContent":["// ─── SFC pre-transform fallback for v-t ──────────────────────────────────────\n// Used when the nodeTransform can't be injected into @vitejs/plugin-vue\n\nimport { hashMessage } from '@fluenti/core'\n\nfunction escapeSingleQuotedString(value: string): string {\n return value.replace(/\\\\/g, '\\\\\\\\').replace(/'/g, \"\\\\'\")\n}\n\nfunction buildDescriptorExpression(\n message: string,\n options?: {\n id?: string | undefined\n context?: string | undefined\n },\n): string {\n const id = options?.id ?? hashMessage(message, options?.context)\n return `{ id: '${escapeSingleQuotedString(id)}', message: '${escapeSingleQuotedString(message)}' }`\n}\n\nexport function transformVtDirectives(sfc: string): string {\n const tmplOpen = sfc.match(/<template(\\s[^>]*)?>/)\n if (!tmplOpen) return sfc\n\n const tmplStart = tmplOpen.index! + tmplOpen[0].length\n const tmplCloseIdx = sfc.lastIndexOf('</template>')\n if (tmplCloseIdx < 0) return sfc\n\n const beforeTemplate = sfc.slice(0, tmplStart)\n let template = sfc.slice(tmplStart, tmplCloseIdx)\n const afterTemplate = sfc.slice(tmplCloseIdx)\n\n const hasVt = /\\bv-t\\b/.test(template)\n const hasTrans = /<Trans[\\s>]/.test(template)\n const hasPlural = /<Plural[\\s/>]/.test(template)\n\n if (!hasVt && !hasTrans && !hasPlural) return sfc\n\n if (hasVt) {\n template = transformVtAttribute(template)\n template = transformVtContent(template)\n }\n if (hasTrans) {\n template = transformTransSFC(template)\n }\n if (hasPlural) {\n template = transformPluralSFC(template)\n }\n\n return beforeTemplate + template + afterTemplate\n}\n\nfunction transformVtAttribute(template: string): string {\n const vtAttrRegex = /<(\\w+)(\\s[^>]*?)\\bv-t\\.(\\w+)\\b([^>]*?)>/g\n\n return template.replace(vtAttrRegex, (_match, tag: string, before: string, attrName: string, after: string) => {\n if (attrName === 'plural') return _match\n\n const allAttrs = before + after\n const attrRegex = new RegExp(`\\\\b${attrName}=\"([^\"]*)\"`)\n const attrMatch = allAttrs.match(attrRegex)\n if (!attrMatch) return _match\n\n const attrValue = attrMatch[1]!\n const descriptor = buildDescriptorExpression(attrValue)\n\n let newBefore = before.replace(/\\s*\\bv-t\\.\\w+\\b/, '')\n let newAfter = after.replace(/\\s*\\bv-t\\.\\w+\\b/, '')\n\n const staticAttrPattern = new RegExp(`\\\\s*\\\\b${attrName}=\"[^\"]*\"`)\n newBefore = newBefore.replace(staticAttrPattern, '')\n newAfter = newAfter.replace(staticAttrPattern, '')\n\n return `<${tag}${newBefore} :${attrName}=\"$t(${descriptor})\"${newAfter}>`\n })\n}\n\n/**\n * Extract `{{ expr }}` interpolations from v-t content.\n * Returns the message with ICU `{var}` placeholders and a list of variable entries.\n */\nfunction extractTemplateVars(content: string): { message: string; vars: string[] } {\n const vars: string[] = []\n const message = content.replace(/\\{\\{\\s*([^}]+?)\\s*\\}\\}/g, (_m, expr: string) => {\n const trimmed = expr.trim()\n // Strategy B: simple ident → {name}, property → {lastSegment}, complex → {0}\n let varName: string\n if (/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(trimmed)) {\n varName = trimmed\n } else if (/^[a-zA-Z_$][a-zA-Z0-9_$.]*$/.test(trimmed) && !trimmed.endsWith('.')) {\n const parts = trimmed.split('.')\n varName = parts[parts.length - 1]!\n } else {\n varName = String(vars.length)\n }\n vars.push(`${varName}: ${trimmed}`)\n return `{${varName}}`\n })\n return { message, vars }\n}\n\nfunction transformVtContent(template: string): string {\n const vtContentRegex = /<(\\w+)(\\s[^>]*?)\\bv-t(?::([a-zA-Z0-9_.]+))?(?:\\.plural)?(?:=\"([^\"]*)\")?\\b([^>]*)>([\\s\\S]*?)<\\/\\1>/g\n\n return template.replace(vtContentRegex, (_match, tag: string, before: string, explicitId: string | undefined, bindExpr: string | undefined, after: string, content: string) => {\n const isPlural = _match.includes('v-t.plural')\n\n let cleanBefore = before.replace(/\\s*\\bv-t(?::[a-zA-Z0-9_.]+)?(?:\\.plural)?(?:=\"[^\"]*\")?\\b/, '')\n let cleanAfter = after.replace(/\\s*\\bv-t(?::[a-zA-Z0-9_.]+)?(?:\\.plural)?(?:=\"[^\"]*\")?\\b/, '')\n\n if (isPlural && bindExpr) {\n const forms = content.trim().split('|').map((s: string) => s.trim())\n const categories = forms.length === 2\n ? ['one', 'other']\n : ['one', 'other', 'zero', 'few', 'many'].slice(0, forms.length)\n const icuParts = categories.map((cat, i) => `${cat} {${forms[i] ?? ''}}`)\n const icuMessage = `{${bindExpr}, plural, ${icuParts.join(' ')}}`\n const descriptor = buildDescriptorExpression(icuMessage, { id: explicitId })\n return `<${tag}${cleanBefore}${cleanAfter}>{{ $t(${descriptor}, { ${bindExpr} }) }}</${tag}>`\n }\n\n const rawContent = content.trim()\n\n // Check for child HTML elements → rich text with $vtRich\n const childElementRegex = /<(\\w+)(\\s[^>]*)?>[\\s\\S]*?<\\/\\1>/g\n if (childElementRegex.test(rawContent)) {\n const elements: Array<{ tag: string; attrs: Record<string, string> }> = []\n let elemIdx = 0\n const richMessage = rawContent.replace(/<(\\w+)((?:\\s[^>]*)?)>([\\s\\S]*?)<\\/\\1>/g,\n (_m, childTag: string, attrStr: string, innerContent: string) => {\n const idx = elemIdx++\n const attrs: Record<string, string> = {}\n const attrRegex = /(\\w+)=\"([^\"]*)\"/g\n let attrMatch\n while ((attrMatch = attrRegex.exec(attrStr)) !== null) {\n attrs[attrMatch[1]!] = attrMatch[2]!\n }\n elements.push({ tag: childTag, attrs })\n return `<${idx}>${innerContent}</${idx}>`\n },\n )\n const descriptor = buildDescriptorExpression(richMessage, { id: explicitId })\n // Build elements as JS array literal to avoid JSON quote conflicts with v-html=\"...\"\n const elemEntries = elements.map(el => {\n const attrEntries = Object.entries(el.attrs)\n .map(([k, v]) => `${k}: '${escapeSingleQuotedString(v)}'`)\n .join(', ')\n return `{ tag: '${el.tag}', attrs: { ${attrEntries} } }`\n })\n const elementsLiteral = `[${elemEntries.join(', ')}]`\n return `<${tag}${cleanBefore}${cleanAfter} v-html=\"$vtRich(${descriptor}, ${elementsLiteral})\"></${tag}>`\n }\n\n const { message, vars } = extractTemplateVars(rawContent)\n const descriptor = buildDescriptorExpression(message, { id: explicitId })\n\n if (vars.length > 0) {\n return `<${tag}${cleanBefore}${cleanAfter}>{{ $t(${descriptor}, { ${vars.join(', ')} }) }}</${tag}>`\n }\n\n return `<${tag}${cleanBefore}${cleanAfter}>{{ $t(${descriptor}) }}</${tag}>`\n })\n}\n\n// ─── <Trans> SFC pre-transform ────────────────────────────────────────────────\n\nfunction transformTransSFC(template: string): string {\n // Match <Trans ...>content</Trans> — skip those with a `message` prop (old API)\n const transRegex = /<Trans(\\s[^>]*)?>(?!\\s*$)([\\s\\S]*?)<\\/Trans>/g\n\n return template.replace(transRegex, (_match, attrStr: string | undefined, content: string) => {\n const attrs = attrStr ?? ''\n\n // If <Trans> has a `message` prop, don't transform (old API)\n if (/\\bmessage\\s*=/.test(attrs)) return _match\n\n const explicitId = readStaticSfcAttr(attrs, 'id')\n if (explicitId.kind === 'dynamic') return _match\n\n const context = readStaticSfcAttr(attrs, 'context')\n if (!explicitId.value && context.kind === 'dynamic') return _match\n\n // Extract tag prop (default: 'span')\n const tagMatch = attrs.match(/\\btag\\s*=\\s*\"([^\"]*)\"/)\n const wrapperTag = tagMatch?.[1] ?? 'span'\n\n // Remove Trans-only props from the generated DOM element.\n const cleanAttrs = attrs\n .replace(/\\s*\\btag\\s*=\\s*\"[^\"]*\"/, '')\n .replace(/\\s*\\bid\\s*=\\s*\"[^\"]*\"/, '')\n .replace(/\\s*:id\\s*=\\s*\"[^\"]*\"/, '')\n .replace(/\\s*\\bcontext\\s*=\\s*\"[^\"]*\"/, '')\n .replace(/\\s*:context\\s*=\\s*\"[^\"]*\"/, '')\n .replace(/\\s*\\bcomment\\s*=\\s*\"[^\"]*\"/, '')\n .replace(/\\s*:comment\\s*=\\s*\"[^\"]*\"/, '')\n\n const rawContent = content.trim()\n\n // Check for child HTML elements → rich text with $vtRich\n const childElementRegex = /<(\\w+)(\\s[^>]*)?>[\\s\\S]*?<\\/\\1>/g\n if (childElementRegex.test(rawContent)) {\n const elements: Array<{ tag: string; attrs: Record<string, string> }> = []\n let elemIdx = 0\n const richMessage = rawContent.replace(/<(\\w+)((?:\\s[^>]*)?)>([\\s\\S]*?)<\\/\\1>/g,\n (_m, childTag: string, childAttrStr: string, innerContent: string) => {\n const idx = elemIdx++\n const childAttrs: Record<string, string> = {}\n const attrRegex = /(\\w[\\w-]*)=\"([^\"]*)\"/g\n let attrMatch\n while ((attrMatch = attrRegex.exec(childAttrStr)) !== null) {\n childAttrs[attrMatch[1]!] = attrMatch[2]!\n }\n elements.push({ tag: childTag, attrs: childAttrs })\n return `<${idx}>${innerContent}</${idx}>`\n },\n )\n const descriptor = buildDescriptorExpression(richMessage, {\n id: explicitId.value,\n context: context.value,\n })\n const elemEntries = elements.map(el => {\n const attrEntries = Object.entries(el.attrs)\n .map(([k, v]) => `${k}: '${escapeSingleQuotedString(v)}'`)\n .join(', ')\n return `{ tag: '${el.tag}', attrs: { ${attrEntries} } }`\n })\n const elementsLiteral = `[${elemEntries.join(', ')}]`\n return `<${wrapperTag}${cleanAttrs} v-html=\"$vtRich(${descriptor}, ${elementsLiteral})\"></${wrapperTag}>`\n }\n\n // Plain text\n const descriptor = buildDescriptorExpression(rawContent, {\n id: explicitId.value,\n context: context.value,\n })\n return `<${wrapperTag}${cleanAttrs}>{{ $t(${descriptor}) }}</${wrapperTag}>`\n })\n}\n\n// ─── <Plural> SFC pre-transform ──────────────────────────────────────────────\n\nfunction transformPluralSFC(template: string): string {\n // First handle <Plural> with template slot children (rich text)\n const pluralSlotRegex = /<Plural(\\s[^>]*?)>([\\s\\S]*?)<\\/Plural>/g\n template = template.replace(pluralSlotRegex, (_match, attrStr: string, content: string) => {\n const attrs = attrStr ?? ''\n const explicitId = readStaticSfcAttr(attrs, 'id')\n const context = readStaticSfcAttr(attrs, 'context')\n if (explicitId.kind === 'dynamic') return _match\n if (!explicitId.value && context.kind === 'dynamic') return _match\n\n // Check if content has template slots\n const templateSlotRegex = /<template\\s+#(\\w+)\\s*>([\\s\\S]*?)<\\/template>/g\n const slots: Array<{ cat: string; content: string }> = []\n let slotMatch\n while ((slotMatch = templateSlotRegex.exec(content)) !== null) {\n slots.push({ cat: slotMatch[1]!, content: slotMatch[2]!.trim() })\n }\n\n if (slots.length === 0) return _match\n\n // Extract :value binding\n const valueMatch = attrs.match(/:value\\s*=\\s*\"([^\"]*)\"/)\n if (!valueMatch) return _match\n const valueExpr = valueMatch[1]!\n\n // Extract tag prop (default: 'span')\n const tagMatch = attrs.match(/\\btag\\s*=\\s*\"([^\"]*)\"/)\n const wrapperTag = tagMatch?.[1] ?? 'span'\n\n const PLURAL_CATS = ['zero', 'one', 'two', 'few', 'many', 'other'] as const\n const allElements: Array<{ tag: string; attrs: Record<string, string> }> = []\n const icuParts: string[] = []\n\n for (const cat of PLURAL_CATS) {\n const slot = slots.find(s => s.cat === cat)\n if (!slot) continue\n\n const slotContent = slot.content\n // Check for child HTML elements → rich text\n const childElementRegex = /<(\\w+)((?:\\s[^>]*)?)>([\\s\\S]*?)<\\/\\1>/g\n let branchMessage = slotContent\n\n if (childElementRegex.test(slotContent)) {\n const baseIndex = allElements.length\n let elemIdx = 0\n branchMessage = slotContent.replace(/<(\\w+)((?:\\s[^>]*)?)>([\\s\\S]*?)<\\/\\1>/g,\n (_m, childTag: string, childAttrStr: string, innerContent: string) => {\n const globalIdx = baseIndex + elemIdx++\n const childAttrs: Record<string, string> = {}\n const attrRegex = /(\\w[\\w-]*)=\"([^\"]*)\"/g\n let attrMatch\n while ((attrMatch = attrRegex.exec(childAttrStr)) !== null) {\n childAttrs[attrMatch[1]!] = attrMatch[2]!\n }\n allElements.push({ tag: childTag, attrs: childAttrs })\n return `<${globalIdx}>${innerContent}</${globalIdx}>`\n },\n )\n }\n\n const icuKey = cat === 'zero' ? '=0' : cat\n icuParts.push(`${icuKey} {${branchMessage}}`)\n }\n\n if (icuParts.length === 0) return _match\n\n const icuMessage = `{count, plural, ${icuParts.join(' ')}}`\n const descriptor = buildDescriptorExpression(icuMessage, {\n id: explicitId.value,\n context: context.value,\n })\n\n // Collect remaining attrs (strip Plural-specific ones)\n let cleanAttrs = attrs\n cleanAttrs = cleanAttrs.replace(/:value\\s*=\\s*\"[^\"]*\"/, '')\n cleanAttrs = cleanAttrs.replace(/\\btag\\s*=\\s*\"[^\"]*\"/, '')\n cleanAttrs = cleanAttrs.replace(/\\s*\\bid\\s*=\\s*\"[^\"]*\"/, '')\n cleanAttrs = cleanAttrs.replace(/\\s*:id\\s*=\\s*\"[^\"]*\"/, '')\n cleanAttrs = cleanAttrs.replace(/\\s*\\bcontext\\s*=\\s*\"[^\"]*\"/, '')\n cleanAttrs = cleanAttrs.replace(/\\s*:context\\s*=\\s*\"[^\"]*\"/, '')\n cleanAttrs = cleanAttrs.replace(/\\s*\\bcomment\\s*=\\s*\"[^\"]*\"/, '')\n cleanAttrs = cleanAttrs.replace(/\\s*:comment\\s*=\\s*\"[^\"]*\"/, '')\n cleanAttrs = cleanAttrs.replace(/\\s+/g, ' ').trim()\n const attrsPart = cleanAttrs ? ` ${cleanAttrs}` : ''\n\n if (allElements.length > 0) {\n const elemEntries = allElements.map(el => {\n const attrEntries = Object.entries(el.attrs)\n .map(([k, v]) => `${k}: '${escapeSingleQuotedString(v)}'`)\n .join(', ')\n return `{ tag: '${el.tag}', attrs: { ${attrEntries} } }`\n })\n const elementsLiteral = `[${elemEntries.join(', ')}]`\n return `<${wrapperTag}${attrsPart} v-html=\"$vtRich(${descriptor}, ${elementsLiteral}, { count: ${valueExpr} })\"></${wrapperTag}>`\n }\n\n return `<${wrapperTag}${attrsPart} v-text=\"$t(${descriptor}, { count: ${valueExpr} })\"></${wrapperTag}>`\n })\n\n // Then handle <Plural ... /> (self-closing) or <Plural ...></Plural> without slot content\n const pluralRegex = /<Plural(\\s[^>]*?)\\/?>(?:<\\/Plural>)?/g\n\n return template.replace(pluralRegex, (_match, attrStr: string) => {\n const attrs = attrStr ?? ''\n const explicitId = readStaticSfcAttr(attrs, 'id')\n const context = readStaticSfcAttr(attrs, 'context')\n if (explicitId.kind === 'dynamic') return _match\n if (!explicitId.value && context.kind === 'dynamic') return _match\n\n // Extract :value binding\n const valueMatch = attrs.match(/:value\\s*=\\s*\"([^\"]*)\"/)\n if (!valueMatch) return _match\n const valueExpr = valueMatch[1]!\n\n // Extract tag prop (default: 'span')\n const tagMatch = attrs.match(/\\btag\\s*=\\s*\"([^\"]*)\"/)\n const wrapperTag = tagMatch?.[1] ?? 'span'\n\n // Extract plural categories\n const PLURAL_CATEGORIES = ['zero', 'one', 'two', 'few', 'many', 'other'] as const\n const icuParts: string[] = []\n\n for (const cat of PLURAL_CATEGORIES) {\n // Match static prop only (not :zero=\"...\")\n const catRegex = new RegExp(`(?<!:)\\\\b${cat}\\\\s*=\\\\s*\"([^\"]*)\"`)\n const catMatch = attrs.match(catRegex)\n if (catMatch) {\n const icuKey = cat === 'zero' ? '=0' : cat\n icuParts.push(`${icuKey} {${catMatch[1]}}`)\n }\n }\n\n if (icuParts.length === 0) return _match\n\n const icuMessage = `{count, plural, ${icuParts.join(' ')}}`\n const descriptor = buildDescriptorExpression(icuMessage, {\n id: explicitId.value,\n context: context.value,\n })\n\n // Collect remaining attrs (strip Plural-specific ones)\n let cleanAttrs = attrs\n cleanAttrs = cleanAttrs.replace(/:value\\s*=\\s*\"[^\"]*\"/, '')\n cleanAttrs = cleanAttrs.replace(/\\btag\\s*=\\s*\"[^\"]*\"/, '')\n cleanAttrs = cleanAttrs.replace(/\\s*\\bid\\s*=\\s*\"[^\"]*\"/, '')\n cleanAttrs = cleanAttrs.replace(/\\s*:id\\s*=\\s*\"[^\"]*\"/, '')\n cleanAttrs = cleanAttrs.replace(/\\s*\\bcontext\\s*=\\s*\"[^\"]*\"/, '')\n cleanAttrs = cleanAttrs.replace(/\\s*:context\\s*=\\s*\"[^\"]*\"/, '')\n cleanAttrs = cleanAttrs.replace(/\\s*\\bcomment\\s*=\\s*\"[^\"]*\"/, '')\n cleanAttrs = cleanAttrs.replace(/\\s*:comment\\s*=\\s*\"[^\"]*\"/, '')\n for (const cat of PLURAL_CATEGORIES) {\n cleanAttrs = cleanAttrs.replace(new RegExp(`(?<!:)\\\\b${cat}\\\\s*=\\\\s*\"[^\"]*\"`), '')\n }\n cleanAttrs = cleanAttrs.replace(/\\s+/g, ' ').trim()\n const attrsPart = cleanAttrs ? ` ${cleanAttrs}` : ''\n\n return `<${wrapperTag}${attrsPart} v-text=\"$t(${descriptor}, { count: ${valueExpr} })\"></${wrapperTag}>`\n })\n}\n\ninterface StaticSfcAttrValue {\n kind: 'missing' | 'static' | 'dynamic'\n value?: string\n}\n\nfunction readStaticSfcAttr(attrs: string, name: string): StaticSfcAttrValue {\n if (new RegExp(`(?:^|\\\\s):${name}\\\\s*=`).test(attrs)) {\n return { kind: 'dynamic' }\n }\n\n const match = attrs.match(new RegExp(`\\\\b${name}\\\\s*=\\\\s*\"([^\"]*)\"`))\n if (!match) {\n return { kind: 'missing' }\n }\n\n return {\n kind: 'static',\n value: match[1] ?? '',\n }\n}\n"],"mappings":";;AAKA,SAAS,EAAyB,GAAuB;AACvD,QAAO,EAAM,QAAQ,OAAO,OAAO,CAAC,QAA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AK,OAAO,CAAC,KAAK,EAAM,CAClD,QAAO,EAAE,MAAM,WAAW;CAG5B,IAAM,IAAQ,EAAM,MAAU,OAAO,MAAM,EAAK,oBAAoB,CAAC;AAKrE,QAJK,IAIE;EACL,MAAM;EACN,OAAO,EAAM,MAAM;EACpB,GANQ,EAAE,MAAM,WAAW"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trans-transform.d.ts","sourceRoot":"","sources":["../src/trans-transform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAA;AACjE,YAAY,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA"}
@@ -0,0 +1,55 @@
1
+ /** Options passed to RuntimeGenerator methods */
2
+ export interface RuntimeGeneratorOptions {
3
+ catalogDir: string;
4
+ locales: string[];
5
+ sourceLocale: string;
6
+ defaultBuildLocale: string;
7
+ }
8
+ /** Framework-specific virtual module runtime generator */
9
+ export interface RuntimeGenerator {
10
+ /** Generate the main reactive runtime module (virtual:fluenti/runtime) */
11
+ generateRuntime(options: RuntimeGeneratorOptions): string;
12
+ /** Generate the per-route runtime module (virtual:fluenti/route-runtime) */
13
+ generateRouteRuntime(options: RuntimeGeneratorOptions): string;
14
+ }
15
+ /** User-facing plugin options (framework packages expose this to consumers) */
16
+ export interface FluentiPluginOptions {
17
+ /** Directory containing compiled message catalogs */
18
+ catalogDir?: string;
19
+ /** Source locale */
20
+ sourceLocale?: string;
21
+ /** Available locales */
22
+ locales?: string[];
23
+ /** Code splitting strategy: 'dynamic' (reactive catalog), 'static' (direct imports), false (off) */
24
+ splitting?: 'dynamic' | 'static' | false;
25
+ /** Default locale for build-time static strategy */
26
+ defaultBuildLocale?: string;
27
+ /** Source file patterns for auto extract in dev */
28
+ include?: string[];
29
+ /** Auto extract+compile in dev mode (default: true) */
30
+ devAutoCompile?: boolean;
31
+ /** Auto extract+compile before production build (default: true) */
32
+ buildAutoCompile?: boolean;
33
+ }
34
+ /** Internal options used by createFluentiPlugins (includes required framework field) */
35
+ export interface FluentiCoreOptions {
36
+ /** Directory containing compiled message catalogs */
37
+ catalogDir?: string | undefined;
38
+ /** Source locale */
39
+ sourceLocale?: string | undefined;
40
+ /** Available locales */
41
+ locales?: string[] | undefined;
42
+ /** Code splitting strategy: 'dynamic' (reactive catalog), 'static' (direct imports), false (off) */
43
+ splitting?: 'dynamic' | 'static' | false | undefined;
44
+ /** Default locale for build-time static strategy */
45
+ defaultBuildLocale?: string | undefined;
46
+ /** Source file patterns for auto extract in dev */
47
+ include?: string[] | undefined;
48
+ /** Auto extract+compile in dev mode (default: true) */
49
+ devAutoCompile?: boolean | undefined;
50
+ /** Auto extract+compile before production build (default: true) */
51
+ buildAutoCompile?: boolean | undefined;
52
+ /** Framework identifier for scope transform and runtime key */
53
+ framework: 'vue' | 'solid' | 'react';
54
+ }
55
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,MAAM,WAAW,uBAAuB;IACtC,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,YAAY,EAAE,MAAM,CAAA;IACpB,kBAAkB,EAAE,MAAM,CAAA;CAC3B;AAED,0DAA0D;AAC1D,MAAM,WAAW,gBAAgB;IAC/B,0EAA0E;IAC1E,eAAe,CAAC,OAAO,EAAE,uBAAuB,GAAG,MAAM,CAAA;IACzD,4EAA4E;IAC5E,oBAAoB,CAAC,OAAO,EAAE,uBAAuB,GAAG,MAAM,CAAA;CAC/D;AAED,+EAA+E;AAC/E,MAAM,WAAW,oBAAoB;IACnC,qDAAqD;IACrD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,oBAAoB;IACpB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,wBAAwB;IACxB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,oGAAoG;IACpG,SAAS,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,KAAK,CAAA;IACxC,oDAAoD;IACpD,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,mDAAmD;IACnD,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,uDAAuD;IACvD,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,mEAAmE;IACnE,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B;AAED,wFAAwF;AACxF,MAAM,WAAW,kBAAkB;IACjC,qDAAqD;IACrD,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/B,oBAAoB;IACpB,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACjC,wBAAwB;IACxB,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAA;IAC9B,oGAAoG;IACpG,SAAS,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,KAAK,GAAG,SAAS,CAAA;IACpD,oDAAoD;IACpD,kBAAkB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACvC,mDAAmD;IACnD,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAA;IAC9B,uDAAuD;IACvD,cAAc,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IACpC,mEAAmE;IACnE,gBAAgB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IACtC,+DAA+D;IAC/D,SAAS,EAAE,KAAK,GAAG,OAAO,GAAG,OAAO,CAAA;CACrC"}
@@ -0,0 +1,16 @@
1
+ import { RuntimeGenerator } from './types';
2
+ export interface VirtualModuleOptions {
3
+ catalogDir: string;
4
+ locales: string[];
5
+ sourceLocale: string;
6
+ defaultBuildLocale: string;
7
+ framework: 'vue' | 'solid' | 'react';
8
+ runtimeGenerator?: RuntimeGenerator | undefined;
9
+ }
10
+ export declare function resolveVirtualSplitId(id: string): string | undefined;
11
+ export declare function loadVirtualSplitModule(id: string, options: VirtualModuleOptions): string | undefined;
12
+ /**
13
+ * Generate the route runtime module for per-route splitting.
14
+ */
15
+ export declare function generateRouteRuntimeModule(options: VirtualModuleOptions): string;
16
+ //# sourceMappingURL=virtual-modules.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"virtual-modules.d.ts","sourceRoot":"","sources":["../src/virtual-modules.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAAE,gBAAgB,EAA2B,MAAM,SAAS,CAAA;AASxE,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,YAAY,EAAE,MAAM,CAAA;IACpB,kBAAkB,EAAE,MAAM,CAAA;IAC1B,SAAS,EAAE,KAAK,GAAG,OAAO,GAAG,OAAO,CAAA;IACpC,gBAAgB,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAA;CAChD;AAED,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAKpE;AAED,wBAAgB,sBAAsB,CACpC,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,oBAAoB,GAC5B,MAAM,GAAG,SAAS,CAWpB;AAwBD;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,oBAAoB,GAAG,MAAM,CAYhF"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vt-transform.d.ts","sourceRoot":"","sources":["../src/vt-transform.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,UAAU,IAAI,CAAA;AAC3B,eAAO,MAAM,OAAO,IAAI,CAAA;AACxB,eAAO,MAAM,gBAAgB,IAAI,CAAA;AACjC,eAAO,MAAM,YAAY,IAAI,CAAA;AAC7B,eAAO,MAAM,YAAY,IAAI,CAAA;AAC7B,eAAO,MAAM,oBAAoB,IAAI,CAAA;AAErC,MAAM,WAAW,OAAO;IACtB,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE;QAAE,MAAM,EA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MrF;AAWD,UAAU,cAAc;IACtB,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,CAAC,CAAA;IAC/D,WAAW,EAAE,OAAO,CAAA;CACrB;AAED,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,cAAc,CAoC/E"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluenti/vite-plugin",
3
- "version": "0.1.2",
3
+ "version": "0.2.0",
4
4
  "type": "module",
5
5
  "description": "Vite plugin for Fluenti — build-time transforms, virtual modules, code splitting",
6
6
  "homepage": "https://fluenti.dev",
@@ -41,6 +41,16 @@
41
41
  "default": "./dist/index.cjs"
42
42
  }
43
43
  },
44
+ "./sfc-transform": {
45
+ "import": {
46
+ "types": "./dist/sfc-transform.d.ts",
47
+ "default": "./dist/sfc-transform.js"
48
+ },
49
+ "require": {
50
+ "types": "./dist/sfc-transform.d.ts",
51
+ "default": "./dist/sfc-transform.cjs"
52
+ }
53
+ },
44
54
  "./client": {
45
55
  "types": "./client.d.ts"
46
56
  }
@@ -50,7 +60,7 @@
50
60
  "client.d.ts"
51
61
  ],
52
62
  "dependencies": {
53
- "@fluenti/core": "0.1.2"
63
+ "@fluenti/core": "0.2.0"
54
64
  },
55
65
  "peerDependencies": {
56
66
  "vite": "^5 || ^6 || ^8"
@@ -1 +0,0 @@
1
- {"version":3,"file":"build-transform.d.ts","sourceRoot":"","sources":["../../src/build-transform.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAA;IACZ,kBAAkB,EAAE,OAAO,CAAA;IAC3B,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CACxB;AAmID,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,oBAAoB,CAE3E;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,oBAAoB,CAE1E;AA8aD;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,GAAG,QAAQ,GAAG,WAAW,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,MAAM,CAY3H"}
@@ -1,2 +0,0 @@
1
- export declare function detectFramework(id: string, code: string): 'vue' | 'solid' | 'react';
2
- //# sourceMappingURL=framework-detect.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"framework-detect.d.ts","sourceRoot":"","sources":["../../src/framework-detect.ts"],"names":[],"mappings":"AAAA,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,OAAO,CASnF"}
@@ -1,6 +0,0 @@
1
- import { Plugin } from 'vite';
2
- import { FluentiPluginOptions } from './types';
3
- export type { FluentiPluginOptions } from './types';
4
- /** Fluenti Vite plugin */
5
- export default function fluentiPlugin(options?: FluentiPluginOptions): Plugin[];
6
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAClC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAYnD,YAAY,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAQnD,0BAA0B;AAC1B,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,OAAO,CAAC,EAAE,oBAAoB,GAAG,MAAM,EAAE,CAmQ9E"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"mode-detect.d.ts","sourceRoot":"","sources":["../../src/mode-detect.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,gEAAgE;AAChE,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAErD;AAED,oCAAoC;AACpC,wBAAgB,eAAe,IAAI,OAAO,GAAG,KAAK,CAEjD;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,WAAW,CAAC,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAWpE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"route-resolve.d.ts","sourceRoot":"","sources":["../../src/route-resolve.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAc7D;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CA6CxE;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,WAAW,CAAC,MAAM,CAAC,EAC/B,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAClC,MAAM,CAkBR;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAMxF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"scope-transform.d.ts","sourceRoot":"","sources":["../../src/scope-transform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AACvD,YAAY,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"sfc-transform.d.ts","sourceRoot":"","sources":["../../src/sfc-transform.ts"],"names":[],"mappings":"AAoBA,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CA8BzD"}
@@ -1,6 +0,0 @@
1
- export interface SolidJsxTransformResult {
2
- code: string;
3
- changed: boolean;
4
- }
5
- export declare function transformSolidJsx(code: string): SolidJsxTransformResult;
6
- //# sourceMappingURL=solid-jsx-transform.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"solid-jsx-transform.d.ts","sourceRoot":"","sources":["../../src/solid-jsx-transform.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,uBAAuB,CAEvE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"trans-transform.d.ts","sourceRoot":"","sources":["../../src/trans-transform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAA;AACjE,YAAY,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA"}
@@ -1,15 +0,0 @@
1
- export interface FluentiPluginOptions {
2
- /** Framework mode: 'vue' | 'solid' | 'react' | 'auto' */
3
- framework?: 'vue' | 'solid' | 'react' | 'auto';
4
- /** Directory containing compiled message catalogs */
5
- catalogDir?: string;
6
- /** Source locale */
7
- sourceLocale?: string;
8
- /** Available locales */
9
- locales?: string[];
10
- /** Code splitting strategy: 'dynamic' (reactive catalog), 'static' (direct imports), false (off) */
11
- splitting?: 'dynamic' | 'static' | false;
12
- /** Default locale for build-time static strategy */
13
- defaultBuildLocale?: string;
14
- }
15
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAoB;IACnC,yDAAyD;IACzD,SAAS,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAAA;IAC9C,qDAAqD;IACrD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,oBAAoB;IACpB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,wBAAwB;IACxB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,oGAAoG;IACpG,SAAS,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,KAAK,CAAA;IACxC,oDAAoD;IACpD,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAC5B"}
@@ -1,33 +0,0 @@
1
- /**
2
- * Virtual module resolution for code-splitting mode.
3
- *
4
- * Provides:
5
- * - virtual:fluenti/runtime → reactive catalog + switchLocale + preloadLocale
6
- * - virtual:fluenti/messages → re-export from static locale (for static strategy)
7
- * - virtual:fluenti/catalog → dev-mode single-object catalog (existing behavior)
8
- */
9
- export interface VirtualModuleOptions {
10
- catalogDir: string;
11
- locales: string[];
12
- sourceLocale: string;
13
- defaultBuildLocale: string;
14
- framework: 'vue' | 'solid' | 'react';
15
- }
16
- export declare function resolveVirtualSplitId(id: string): string | undefined;
17
- export declare function loadVirtualSplitModule(id: string, options: VirtualModuleOptions): string | undefined;
18
- /**
19
- * Generate the route runtime module for per-route splitting.
20
- *
21
- * At transform time, this module serves as the import target for `__catalog`.
22
- * It imports ALL messages from the default locale (same as 'dynamic') so the
23
- * build completes. The actual per-route chunk partitioning happens in
24
- * `generateBundle` which emits smaller chunk files and rewrites imports.
25
- *
26
- * At runtime, the module provides:
27
- * - `__catalog`: reactive object holding current locale messages
28
- * - `__switchLocale(locale)`: loads all route chunks for the new locale
29
- * - `__loadRoute(routeId, locale)`: loads a single route chunk
30
- * - `__currentLocale`, `__loading`, `__loadedLocales`: state refs
31
- */
32
- export declare function generateRouteRuntimeModule(options: VirtualModuleOptions): string;
33
- //# sourceMappingURL=virtual-modules.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"virtual-modules.d.ts","sourceRoot":"","sources":["../../src/virtual-modules.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAWH,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,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@@
1
- {"version":3,"file":"build-transform.test.d.ts","sourceRoot":"","sources":["../../tests/build-transform.test.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=mode-detect.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mode-detect.test.d.ts","sourceRoot":"","sources":["../../tests/mode-detect.test.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=per-route-splitting.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"per-route-splitting.test.d.ts","sourceRoot":"","sources":["../../tests/per-route-splitting.test.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=route-resolve.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"route-resolve.test.d.ts","sourceRoot":"","sources":["../../tests/route-resolve.test.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=scope-transform.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"scope-transform.test.d.ts","sourceRoot":"","sources":["../../tests/scope-transform.test.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=trans-transform.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"trans-transform.test.d.ts","sourceRoot":"","sources":["../../tests/trans-transform.test.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=virtual-modules.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"virtual-modules.test.d.ts","sourceRoot":"","sources":["../../tests/virtual-modules.test.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=vite-plugin.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vite-plugin.test.d.ts","sourceRoot":"","sources":["../../tests/vite-plugin.test.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- declare const _default: import('vite').UserConfig;
2
- export default _default;
3
- //# sourceMappingURL=vite.config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vite.config.d.ts","sourceRoot":"","sources":["../vite.config.ts"],"names":[],"mappings":";AAGA,wBA4BE"}
File without changes