@menapo/vi18n 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -0
- package/dist/{apply-Bre-lY9J.js → apply-Bg-3rB2m.js} +69 -89
- package/dist/{captured-Bj8bO6vd.js → captured-DfLk50Ji.js} +196 -217
- package/dist/{check-BIKEuu6B.js → check-CunekuYs.js} +76 -85
- package/dist/cli.js +2 -3
- package/dist/{collect-Cx4_SKOe.js → collect-CYATDjdo.js} +1 -2
- package/dist/collisions-CDSdtLQm.js +215 -0
- package/dist/{compile-Cc97JaW2.js → compile-DqkofbiO.js} +376 -331
- package/dist/compile-hva0qjhZ.js +240 -0
- package/dist/concurrency-BCY_4zcr.js +1 -0
- package/dist/concurrency-Dy2ny50V.js +107 -0
- package/dist/config.d.ts +1 -5
- package/dist/config.js +4 -5
- package/dist/{types-D3QGM8XO.js → diagnostics-LgIWyeSp.js} +28 -27
- package/dist/{dir-zw6bGMKQ.js → dir-TGLYuOZb.js} +34 -37
- package/dist/{duplicates-yuRljQ6h.js → duplicates-8cudcHNj.js} +10 -27
- package/dist/engine-ecRD8-IE.js +556 -0
- package/dist/engine.d.ts +1 -5
- package/dist/engine.js +297 -168
- package/dist/exchange-DjwlrTQ9.js +41 -0
- package/dist/{exclude-Du-Zd_qI.js → exclude-BFETmvde.js} +2 -3
- package/dist/{export-C9Sy6UWv.js → export-D2tsqWIr.js} +17 -38
- package/dist/{extract-C3S8btx0.js → extract-BxYchVmY.js} +114 -82
- package/dist/{formats-9unqj_fZ.js → formats-BaryZ2N7.js} +352 -276
- package/dist/fs-ezCMZeDV.js +52 -0
- package/dist/i18next-COO6o0tX.js +1907 -0
- package/dist/i18next-Dr7DCQlQ.js +1 -0
- package/dist/{import-nANvQutw.js → import-vSC29Cn4.js} +81 -75
- package/dist/index.d.ts +1 -13
- package/dist/index.js +14 -16
- package/dist/{init-C2ScuW6a.js → init-Cc7A-8VX.js} +466 -501
- package/dist/{library-D5CWvTQs.js → library-tp_xqzSY.js} +975 -451
- package/dist/lingui-BnnlqGXT.js +902 -0
- package/dist/lint.d.ts +0 -4
- package/dist/lint.js +70 -82
- package/dist/{load-gW-oJt1Q.js → load-BSIeGJ5v.js} +275 -148
- package/dist/{load-CQRz4PpM.js → load-SSrAeJVB.js} +1214 -1116
- package/dist/{locales-DX4MOBFE.js → locales-D0U-yVRm.js} +271 -237
- package/dist/{lsp-RMMMc88P.js → lsp-DvC11pBZ.js} +4 -5
- package/dist/{match-BGr8EXB3.js → match-BLDcj610.js} +11 -4
- package/dist/{mcp-CHVwBoRP.js → mcp-D2zzOTBy.js} +4 -5
- package/dist/{merge-driver-BTX87aVm.js → merge-driver-BLI8OtAc.js} +138 -122
- package/dist/migrate-1r43OBfe.js +1 -0
- package/dist/migrate-ChDGhlC-.js +2169 -0
- package/dist/{openai-CTaMDcl-.js → openai-CLn4puY8.js} +128 -87
- package/dist/{output-DWE3SIUA.js → output-D5tAt8q4.js} +15 -9
- package/dist/parse.d.ts +1 -3
- package/dist/parse.js +7 -8
- package/dist/{pipeline-C9Dbotkh.js → pipeline-BJSkkRYC.js} +387 -359
- package/dist/{pipeline-DbX6rlo5.js → pipeline-BeCc441z.js} +1 -1
- package/dist/project-B5KIO0q-.js +544 -0
- package/dist/{pseudo-DRv30iN5.js → pseudo-B2DUpoLu.js} +126 -3
- package/dist/{raw-C4Y6vyGY.js → raw-YsYZMS9n.js} +52 -29
- package/dist/react-intl-C8JehBBL.js +634 -0
- package/dist/rename-ZVGq9ZG1.js +577 -0
- package/dist/repeated-uuI1tUGg.js +85 -0
- package/dist/restore-xlBIrtRt.js +199 -0
- package/dist/rewrite-BwzXoBiA.js +415 -0
- package/dist/{rich-DCUKl5HM.js → rich-ApY1Dm4S.js} +35 -28
- package/dist/rolldown-runtime-C1I3wEg2.js +43 -0
- package/dist/{rolldown-runtime-D7D4PA-g.js → rolldown-runtime-D8jQpDG7.js} +1 -2
- package/dist/run-CQ9pDLSa.js +674 -0
- package/dist/scan-worker.d.ts +2 -4
- package/dist/scan-worker.js +1 -1
- package/dist/{scoped-BMYpSthj.js → scoped-h3KE8XWW.js} +3 -4
- package/dist/{server-Da1Ot9IN.js → server-Br8tAuG2.js} +312 -386
- package/dist/{server-deBOq2vq.js → server-DJRpUQVZ.js} +1059 -333
- package/dist/server.d.ts +1 -17
- package/dist/server.js +419 -379
- package/dist/{sitemap-DJXzKoza.js → sitemap-CSAkm6oi.js} +21 -33
- package/dist/{sources-D19czDSA.js → sources-DNVbYsgs.js} +713 -373
- package/dist/{status-zr4jY59Y.js → status-q6M3rBrh.js} +30 -30
- package/dist/{stdio-FPOKQAgu.js → stdio-D9kTzyqB.js} +2 -4
- package/dist/{stdio-CVaJfxA7.js → stdio-FWIVU3P4.js} +1 -2
- package/dist/sync-BNIAwMhR.js +1352 -0
- package/dist/{t-DC-c9zE5.js → t-gvEXx25s.js} +76 -53
- package/dist/test.d.ts +5 -16
- package/dist/test.js +126 -56
- package/dist/translate-BP4iVhOR.js +336 -0
- package/dist/{ts-BaU5yOf0.js → ts-BX6kwig5.js} +25 -14
- package/dist/{types-DtvQ7UdD.js → types-3kwyaCAm.js} +1 -2
- package/dist/{types-DsdWBG0b.d.ts → types-B4wNX6PA.d.ts} +6 -8
- package/dist/{types-CgUCkFU1.d.ts → types-_4UdFhR9.d.ts} +24 -21
- package/dist/types-xR2exI3L.js +42 -0
- package/dist/{units-CQ5Q99RC.js → units-DPPfCN7j.js} +7 -16
- package/dist/{url-CRfCOhUI.js → url-Bpc6wLea.js} +24 -11
- package/dist/{url-CsBkRaJy.js → url-D2_VlEeH.js} +25 -12
- package/dist/{validate-BxpupdAf.js → validate-CgzaDdOY.js} +690 -377
- package/dist/{validate-D6DJepZv.js → validate-PGgMsasz.js} +3 -5
- package/dist/{version-Byqi2guX.js → version-DC-J5WvV.js} +3 -5
- package/dist/{vite-scan-CT_vsp4g.js → vite-scan-kM8Ta3rO.js} +87 -92
- package/dist/vite.d.ts +2 -6
- package/dist/vite.js +6500 -6032
- package/dist/vue-i18n-_uIXlFVh.js +806 -0
- package/dist/{which-BOemZ5Q8.js → which-DFWk_KwN.js} +44 -37
- package/dist/{worker-84U6uYB3.js → worker-zlhNj4y3.js} +454 -608
- package/package.json +5 -5
- package/dist/check-HsmmpJZg.js +0 -1
- package/dist/codec-DuvU2VQy.js +0 -207
- package/dist/collisions-CfpZU8e4.js +0 -217
- package/dist/compile-BaDh0cHG.js +0 -245
- package/dist/concurrency-C9UUWuDC.js +0 -96
- package/dist/concurrency-DONL7t4V.js +0 -1
- package/dist/engine-C2ENBRJe.js +0 -531
- package/dist/i18next-9HAoxwUI.js +0 -1
- package/dist/i18next-BEJgv_S8.js +0 -1596
- package/dist/lingui-zUiCl9Um.js +0 -833
- package/dist/messages-BfjIExyB.js +0 -166
- package/dist/migrate-IpLDMXmq.js +0 -1484
- package/dist/migrate-rCQuOGsf.js +0 -1
- package/dist/project-Bw9UPIdx.js +0 -1046
- package/dist/project-C4GpaN-n.js +0 -381
- package/dist/react-intl-BP0u-D5m.js +0 -519
- package/dist/restore-CiYv-jxS.js +0 -175
- package/dist/rewrite-EsIw_lsq.js +0 -803
- package/dist/run-BEcnBbu-.js +0 -694
- package/dist/runtime-DTMmliT1.js +0 -64
- package/dist/sync-B9V2KFwb.js +0 -658
- package/dist/translate-CQnJfLjO.js +0 -299
- package/dist/types-wSh9fCBY.js +0 -11
- package/dist/vue-i18n-g0iGy6CZ.js +0 -651
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as diagnosticError, f as isDiagnosticError, i as normalizeSource, l as positionAt, o as isMF2Form, u as quoteStarts } from "./compile-
|
|
2
|
-
|
|
1
|
+
import { d as diagnosticError, f as isDiagnosticError, i as normalizeSource, l as positionAt, o as isMF2Form, u as quoteStarts } from "./compile-DqkofbiO.js";
|
|
2
|
+
// src/core/icu/structure.ts
|
|
3
3
|
/**
|
|
4
4
|
* What a translation must keep from its source (INTERNALS §2.1.2).
|
|
5
5
|
*
|
|
@@ -79,8 +79,7 @@ function use(name, kind, inPlural, structure, required) {
|
|
|
79
79
|
function describe(kind) {
|
|
80
80
|
return kind === "argument" ? "a plain argument" : `{…, ${kind}}`;
|
|
81
81
|
}
|
|
82
|
-
|
|
83
|
-
//#region src/core/icu/validate.ts
|
|
82
|
+
// src/core/icu/validate.ts
|
|
84
83
|
/**
|
|
85
84
|
* Message validation (INTERNALS §2.1.3, PLAN §5.4), run at extract, compile,
|
|
86
85
|
* AI post-check and CI. Parse errors are thrown by the parser; everything
|
|
@@ -361,5 +360,4 @@ function positionOf(text, char) {
|
|
|
361
360
|
function hex(code) {
|
|
362
361
|
return code.toString(16).toUpperCase().padStart(4, "0");
|
|
363
362
|
}
|
|
364
|
-
//#endregion
|
|
365
363
|
export { validateTranslation as n, validateSource as t };
|
|
@@ -2,9 +2,8 @@ import "node:path";
|
|
|
2
2
|
import "node:crypto";
|
|
3
3
|
import "node:fs";
|
|
4
4
|
import "node:url";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const VERSION = "0.1.1";
|
|
5
|
+
// src/core/version.ts
|
|
6
|
+
const VERSION = "0.2.0";
|
|
8
7
|
let fingerprint;
|
|
9
8
|
let cacheVersionMemo;
|
|
10
9
|
/**
|
|
@@ -16,7 +15,7 @@ let cacheVersionMemo;
|
|
|
16
15
|
*/
|
|
17
16
|
function codeFingerprint() {
|
|
18
17
|
if (fingerprint !== void 0) return fingerprint;
|
|
19
|
-
fingerprint = "
|
|
18
|
+
fingerprint = "9m8al8863PEIiyMa";
|
|
20
19
|
return fingerprint;
|
|
21
20
|
}
|
|
22
21
|
/** `VERSION` and `codeFingerprint()`: the version every cache key and `configHash` carries. */
|
|
@@ -24,5 +23,4 @@ function cacheVersion() {
|
|
|
24
23
|
cacheVersionMemo ??= `${VERSION}+${codeFingerprint()}`;
|
|
25
24
|
return cacheVersionMemo;
|
|
26
25
|
}
|
|
27
|
-
//#endregion
|
|
28
26
|
export { cacheVersion as n, VERSION as t };
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { c as aggregateOccurrences, o as refMapper } from "./sync-BNIAwMhR.js";
|
|
2
|
+
import { n as setCollector } from "./collect-CYATDjdo.js";
|
|
3
|
+
import { I as listProjectFiles } from "./library-tp_xqzSY.js";
|
|
4
|
+
import { d as toPosix, l as mapLimit } from "./validate-CgzaDdOY.js";
|
|
5
|
+
import { t as ABORT_CODES } from "./worker-zlhNj4y3.js";
|
|
6
|
+
import { o as errorMessage } from "./output-D5tAt8q4.js";
|
|
7
|
+
import { t as findViteConfig } from "./fs-ezCMZeDV.js";
|
|
8
|
+
import { r as compareText } from "./project-B5KIO0q-.js";
|
|
4
9
|
import { createRequire } from "node:module";
|
|
5
10
|
import { join, relative } from "node:path";
|
|
6
|
-
import { existsSync } from "node:fs";
|
|
7
11
|
import { pathToFileURL } from "node:url";
|
|
8
|
-
|
|
12
|
+
// src/cli/vite-scan.ts
|
|
9
13
|
/**
|
|
10
14
|
* `vi18n extract --vite` (PLAN §4.5 P2, INTERNALS §2.5.9, §6 D234–D235):
|
|
11
15
|
* the include scan through the project's own Vite pipeline, for projects
|
|
@@ -37,7 +41,7 @@ function urlOf(root, file) {
|
|
|
37
41
|
return rel.startsWith("../") || rel === ".." || /^[a-zA-Z]:/.test(rel) ? "/@fs" + (toPosix(file).startsWith("/") ? "" : "/") + toPosix(file) : "/" + rel;
|
|
38
42
|
}
|
|
39
43
|
function messageOf(error) {
|
|
40
|
-
return (error
|
|
44
|
+
return errorMessage(error).split("\n")[0];
|
|
41
45
|
}
|
|
42
46
|
function collectorInto(collected, active) {
|
|
43
47
|
return {
|
|
@@ -68,7 +72,7 @@ function collectorInto(collected, active) {
|
|
|
68
72
|
async function transformFile(server, root, file, collected) {
|
|
69
73
|
const path = toPosix(file);
|
|
70
74
|
const url = urlOf(root, file);
|
|
71
|
-
const names = Object.keys(server.environments).sort((a, b) =>
|
|
75
|
+
const names = Object.keys(server.environments).sort((a, b) => Number(b === "client") - Number(a === "client"));
|
|
72
76
|
let firstError = null;
|
|
73
77
|
for (const name of names) {
|
|
74
78
|
const environment = server.environments[name];
|
|
@@ -116,37 +120,11 @@ async function scanWithVite(config) {
|
|
|
116
120
|
diagnostics: [],
|
|
117
121
|
failed: /* @__PURE__ */ new Set()
|
|
118
122
|
};
|
|
119
|
-
|
|
120
|
-
setCollector(collectorInto(collected, () => active));
|
|
123
|
+
const active = { value: false };
|
|
124
|
+
setCollector(collectorInto(collected, () => active.value));
|
|
121
125
|
let server;
|
|
122
126
|
try {
|
|
123
|
-
server = await vite.createServer(
|
|
124
|
-
configFile: viteConfigFile(config.root),
|
|
125
|
-
logLevel: "error",
|
|
126
|
-
clearScreen: false,
|
|
127
|
-
appType: "custom",
|
|
128
|
-
server: {
|
|
129
|
-
middlewareMode: true,
|
|
130
|
-
hmr: false,
|
|
131
|
-
ws: false,
|
|
132
|
-
watch: null,
|
|
133
|
-
preTransformRequests: false
|
|
134
|
-
},
|
|
135
|
-
optimizeDeps: {
|
|
136
|
-
noDiscovery: true,
|
|
137
|
-
include: []
|
|
138
|
-
},
|
|
139
|
-
plugins: [{
|
|
140
|
-
name: "vi18n:extract-vite",
|
|
141
|
-
enforce: "pre",
|
|
142
|
-
config: {
|
|
143
|
-
order: "pre",
|
|
144
|
-
handler(user) {
|
|
145
|
-
return user.root === void 0 ? { root: config.root } : {};
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}]
|
|
149
|
-
});
|
|
127
|
+
server = await vite.createServer(serverConfig(config.root));
|
|
150
128
|
} catch (error) {
|
|
151
129
|
setCollector(null);
|
|
152
130
|
return failedScan(leading, `the Vite config could not be loaded: ${messageOf(error)}`);
|
|
@@ -154,53 +132,25 @@ async function scanWithVite(config) {
|
|
|
154
132
|
const failures = /* @__PURE__ */ new Map();
|
|
155
133
|
try {
|
|
156
134
|
if (!server.config.plugins.some((plugin) => plugin.name === "vi18n:extract")) return failedScan(leading, "vi18n extract --vite found no vi18n() plugin in the Vite config; add it, or run vi18n extract without --vite");
|
|
157
|
-
active = true;
|
|
135
|
+
active.value = true;
|
|
158
136
|
const viteRoot = server.config.root ?? config.root;
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
const file = listed.files[next++];
|
|
164
|
-
const failure = await transformFile(server, viteRoot, file, collected);
|
|
165
|
-
if (failure !== null) failures.set(file, failure);
|
|
166
|
-
}
|
|
167
|
-
})());
|
|
168
|
-
await Promise.all(lanes);
|
|
137
|
+
await mapLimit(listed.files, CONCURRENCY, async (file) => {
|
|
138
|
+
const failure = await transformFile(server, viteRoot, file, collected);
|
|
139
|
+
if (failure !== null) failures.set(file, failure);
|
|
140
|
+
});
|
|
169
141
|
} finally {
|
|
170
|
-
active = false;
|
|
142
|
+
active.value = false;
|
|
171
143
|
setCollector(null);
|
|
172
144
|
await server.close();
|
|
173
145
|
}
|
|
174
|
-
const
|
|
175
|
-
const byRef = /* @__PURE__ */ new Map();
|
|
176
|
-
for (const diagnostic of collected.diagnostics) {
|
|
177
|
-
const key = diagnostic.file ?? "";
|
|
178
|
-
let list = byRef.get(key);
|
|
179
|
-
if (list === void 0) byRef.set(key, list = []);
|
|
180
|
-
list.push(diagnostic);
|
|
181
|
-
}
|
|
146
|
+
const byRef = diagnosticsByFile(collected.diagnostics);
|
|
182
147
|
const diagnostics = [...leading];
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
code: "extract-parse-error",
|
|
190
|
-
severity: "error",
|
|
191
|
-
message: `Cannot transform ${refFile} through the Vite config: ${failure}`,
|
|
192
|
-
file: refFile
|
|
193
|
-
});
|
|
194
|
-
const occurrences = [...(collected.modules.get(toPosix(file)) ?? /* @__PURE__ */ new Map()).entries()].sort(([a], [b]) => (a.includes("?") ? 1 : 0) - (b.includes("?") ? 1 : 0) || (a < b ? -1 : a > b ? 1 : 0)).flatMap(([, messages]) => [...messages]);
|
|
195
|
-
files.push({
|
|
196
|
-
file,
|
|
197
|
-
refFile,
|
|
198
|
-
occurrences,
|
|
199
|
-
diagnostics: fileDiagnostics,
|
|
200
|
-
fromCache: false
|
|
201
|
-
});
|
|
202
|
-
diagnostics.push(...fileDiagnostics);
|
|
203
|
-
}
|
|
148
|
+
const files = listed.files.map((file) => fileScan(file, ref(file), {
|
|
149
|
+
collected,
|
|
150
|
+
byRef,
|
|
151
|
+
failure: failures.get(file)
|
|
152
|
+
}));
|
|
153
|
+
for (const scan of files) diagnostics.push(...scan.diagnostics);
|
|
204
154
|
for (const rest of byRef.values()) diagnostics.push(...rest);
|
|
205
155
|
return {
|
|
206
156
|
files,
|
|
@@ -209,21 +159,67 @@ async function scanWithVite(config) {
|
|
|
209
159
|
aborted: diagnostics.some((diagnostic) => ABORT_CODES.has(diagnostic.code))
|
|
210
160
|
};
|
|
211
161
|
}
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
162
|
+
/** The dev server the scan transforms through: no HMR, no watcher, no dependency discovery. */
|
|
163
|
+
function serverConfig(root) {
|
|
164
|
+
return {
|
|
165
|
+
configFile: findViteConfig(root) ?? false,
|
|
166
|
+
logLevel: "error",
|
|
167
|
+
clearScreen: false,
|
|
168
|
+
appType: "custom",
|
|
169
|
+
server: {
|
|
170
|
+
middlewareMode: true,
|
|
171
|
+
hmr: false,
|
|
172
|
+
ws: false,
|
|
173
|
+
watch: null,
|
|
174
|
+
preTransformRequests: false
|
|
175
|
+
},
|
|
176
|
+
optimizeDeps: {
|
|
177
|
+
noDiscovery: true,
|
|
178
|
+
include: []
|
|
179
|
+
},
|
|
180
|
+
plugins: [{
|
|
181
|
+
name: "vi18n:extract-vite",
|
|
182
|
+
enforce: "pre",
|
|
183
|
+
config: {
|
|
184
|
+
order: "pre",
|
|
185
|
+
handler(user) {
|
|
186
|
+
return user.root === void 0 ? { root } : {};
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}]
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
function diagnosticsByFile(diagnostics) {
|
|
193
|
+
const byRef = /* @__PURE__ */ new Map();
|
|
194
|
+
for (const diagnostic of diagnostics) {
|
|
195
|
+
const key = diagnostic.file ?? "";
|
|
196
|
+
let list = byRef.get(key);
|
|
197
|
+
if (list === void 0) byRef.set(key, list = []);
|
|
198
|
+
list.push(diagnostic);
|
|
225
199
|
}
|
|
226
|
-
return
|
|
200
|
+
return byRef;
|
|
201
|
+
}
|
|
202
|
+
/** A module id's part (`?vue&type=…`) after the file's own module, then by id. */
|
|
203
|
+
function compareModuleIds(a, b) {
|
|
204
|
+
return Number(a.includes("?")) - Number(b.includes("?")) || compareText(a, b);
|
|
205
|
+
}
|
|
206
|
+
/** One file's scan; takes its diagnostics out of `byRef`, so what is left there belongs to no listed file. */
|
|
207
|
+
function fileScan(file, refFile, from) {
|
|
208
|
+
const fileDiagnostics = from.byRef.get(refFile) ?? [];
|
|
209
|
+
from.byRef.delete(refFile);
|
|
210
|
+
if (from.failure !== void 0) fileDiagnostics.push({
|
|
211
|
+
code: "extract-parse-error",
|
|
212
|
+
severity: "error",
|
|
213
|
+
message: `Cannot transform ${refFile} through the Vite config: ${from.failure}`,
|
|
214
|
+
file: refFile
|
|
215
|
+
});
|
|
216
|
+
return {
|
|
217
|
+
file,
|
|
218
|
+
refFile,
|
|
219
|
+
occurrences: [...(from.collected.modules.get(toPosix(file)) ?? /* @__PURE__ */ new Map()).entries()].sort(([a], [b]) => compareModuleIds(a, b)).flatMap(([, messages]) => [...messages]),
|
|
220
|
+
diagnostics: fileDiagnostics,
|
|
221
|
+
fromCache: false
|
|
222
|
+
};
|
|
227
223
|
}
|
|
228
224
|
function failedScan(leading, message) {
|
|
229
225
|
const diagnostics = [...leading, {
|
|
@@ -238,5 +234,4 @@ function failedScan(leading, message) {
|
|
|
238
234
|
aborted: true
|
|
239
235
|
};
|
|
240
236
|
}
|
|
241
|
-
//#endregion
|
|
242
237
|
export { scanWithVite };
|
package/dist/vite.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { n as OutputOptions } from "./types-
|
|
1
|
+
import { n as OutputOptions } from "./types-_4UdFhR9.js";
|
|
2
2
|
import { Plugin, Rolldown } from "vite";
|
|
3
|
-
//#region src/vite/types.d.ts
|
|
4
3
|
/** Options of `vi18n()`. Everything else comes from `vi18n.config.ts`. */
|
|
5
4
|
interface Vi18nPluginOptions {
|
|
6
5
|
/** Path of the config file, relative to the Vite root. Default: search upward for `vi18n.config.ts`. */
|
|
@@ -10,7 +9,7 @@ interface Vi18nPluginOptions {
|
|
|
10
9
|
/**
|
|
11
10
|
* Removed before 1.0: `vi18n()` adds its own plugins to Vite's
|
|
12
11
|
* `worker.plugins` (INTERNALS §2.9.9), so a worker build needs no second
|
|
13
|
-
* instance.
|
|
12
|
+
* instance. Any value is rejected with `config-invalid` naming that.
|
|
14
13
|
*/
|
|
15
14
|
worker?: boolean;
|
|
16
15
|
}
|
|
@@ -20,8 +19,6 @@ interface Vi18nTransformOptions {
|
|
|
20
19
|
/** Default `"build"` (ids only). */
|
|
21
20
|
mode?: "dev" | "build";
|
|
22
21
|
}
|
|
23
|
-
//#endregion
|
|
24
|
-
//#region src/vite/index.d.ts
|
|
25
22
|
export declare function vi18n(options?: Vi18nPluginOptions): Plugin[];
|
|
26
23
|
/**
|
|
27
24
|
* The extraction rewrite for a plain Rollup/Rolldown build (§2.8.3, last
|
|
@@ -30,5 +27,4 @@ export declare function vi18n(options?: Vi18nPluginOptions): Plugin[];
|
|
|
30
27
|
* Vite-built server bundle or `registerCatalogs` registered catalogs.
|
|
31
28
|
*/
|
|
32
29
|
export declare function vi18nTransform(options?: Vi18nTransformOptions): Rolldown.Plugin;
|
|
33
|
-
//#endregion
|
|
34
30
|
export { type Vi18nPluginOptions, type Vi18nTransformOptions, vi18n as default };
|