@menapo/vi18n 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -14
- package/dist/{apply-Bre-lY9J.js → apply-FAHl1R6T.js} +69 -89
- package/dist/{captured-Bj8bO6vd.js → captured-CTjjDF5o.js} +196 -217
- package/dist/{check-DyrAbv73.js → check-DwFwOB1d.js} +66 -84
- package/dist/cli.js +2 -3
- package/dist/{collect-Cx4_SKOe.js → collect-CYATDjdo.js} +1 -2
- package/dist/collisions-uMTuq36M.js +215 -0
- package/dist/compile-CEvH-6sY.js +240 -0
- package/dist/{compile-Cc97JaW2.js → compile-DqkofbiO.js} +376 -331
- 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-1onDF6Ua.js} +26 -26
- package/dist/{dir-zw6bGMKQ.js → dir-TGLYuOZb.js} +34 -37
- package/dist/{duplicates-yuRljQ6h.js → duplicates-CsUXRX2J.js} +10 -27
- package/dist/engine-Bf7nVigL.js +556 -0
- package/dist/engine.d.ts +1 -5
- package/dist/engine.js +297 -168
- package/dist/exchange-DYG9RZoT.js +41 -0
- package/dist/{exclude-Du-Zd_qI.js → exclude-vMnm3lqU.js} +2 -3
- package/dist/{export-DGsMbcTZ.js → export-BYq0gfLd.js} +17 -38
- package/dist/{extract-Dujlsgnk.js → extract-CYtuEo8u.js} +114 -82
- package/dist/{formats-KPIg-08V.js → formats-ChV1LVH_.js} +352 -276
- package/dist/fs-ezCMZeDV.js +52 -0
- package/dist/i18next-1waHziMy.js +1 -0
- package/dist/i18next-D66Icz3L.js +1907 -0
- package/dist/{import-Cwdhcywt.js → import-BApbQlmm.js} +81 -75
- package/dist/index.d.ts +1 -13
- package/dist/index.js +14 -16
- package/dist/{init-BecCTvKi.js → init-J7AwwA5e.js} +466 -501
- package/dist/{library-D5CWvTQs.js → library-BfSOBeBd.js} +975 -451
- package/dist/lingui-Ee2farVo.js +902 -0
- package/dist/lint.d.ts +0 -4
- package/dist/lint.js +69 -82
- package/dist/{load-gW-oJt1Q.js → load-BFLLqY8x.js} +272 -147
- package/dist/{load-CQRz4PpM.js → load-CMwhukZ4.js} +1211 -1115
- package/dist/{locales-DX4MOBFE.js → locales-DxLDrx-h.js} +271 -237
- package/dist/{lsp-Cq1Nuu-Q.js → lsp-BC7xDGON.js} +4 -5
- package/dist/{match-BGr8EXB3.js → match-BLDcj610.js} +11 -4
- package/dist/{mcp-Cf0T7qPW.js → mcp-Cka8ywDF.js} +4 -5
- package/dist/{merge-driver-CpiiSVIc.js → merge-driver-B04Apm29.js} +138 -122
- package/dist/migrate-D7TNl6SD.js +2169 -0
- package/dist/migrate-khCY8TE0.js +1 -0
- package/dist/{openai-CTaMDcl-.js → openai-RWw0YlAx.js} +128 -87
- package/dist/{output-DsaHKHEt.js → output-CF9uvk_-.js} +15 -9
- package/dist/parse.d.ts +1 -3
- package/dist/parse.js +7 -8
- package/dist/{pipeline-wxS0SApG.js → pipeline-B30irGMD.js} +1 -1
- package/dist/{pipeline-C7g11THL.js → pipeline-sgl_q_op.js} +387 -359
- package/dist/project-DSzWKU3C.js +544 -0
- package/dist/{pseudo-DRv30iN5.js → pseudo-DNbNNVGP.js} +125 -3
- package/dist/{raw-C4Y6vyGY.js → raw-YsYZMS9n.js} +52 -29
- package/dist/react-intl-tzGIk6G3.js +634 -0
- package/dist/restore-BG_zMpSj.js +199 -0
- package/dist/rewrite-hAcRJwiZ.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-CFzR3V93.js +647 -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-BDkykMjb.js → server-WlxZH0oX.js} +275 -330
- package/dist/{server-qv3mz70d.js → server-ceuzzkal.js} +292 -386
- package/dist/server.d.ts +1 -17
- package/dist/server.js +415 -381
- package/dist/{sitemap-DV3o8QD7.js → sitemap-796jJKUT.js} +21 -33
- package/dist/{sources-D19czDSA.js → sources-DuOdM02f.js} +712 -373
- package/dist/{status-DZArW5aE.js → status-CTH3qI-0.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-CpL0Qsgw.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 +77 -48
- package/dist/translate-BrfVRkjl.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-BaG1LboH.d.ts} +2 -6
- package/dist/{types-CgUCkFU1.d.ts → types-Cy2bPdSg.d.ts} +14 -20
- package/dist/types-Ds_vebja.js +41 -0
- package/dist/{units-CQ5Q99RC.js → units-VVLgQ7x7.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-D6DJepZv.js → validate-PGgMsasz.js} +3 -5
- package/dist/{validate-BxpupdAf.js → validate-zv4-IZyZ.js} +690 -377
- package/dist/{version-BlyLGlOa.js → version-BFs370Ce.js} +3 -5
- package/dist/{vite-scan-B_YW4X_a.js → vite-scan-DFKSGVE9.js} +87 -92
- package/dist/vite.d.ts +2 -6
- package/dist/vite.js +6482 -6018
- package/dist/vue-i18n-CBmZqHbG.js +806 -0
- package/dist/{which-C6PFI1Dm.js → which-BpyJyBkX.js} +44 -37
- package/dist/{worker-84U6uYB3.js → worker-BjzVqJVO.js} +454 -608
- package/package.json +8 -8
- package/dist/check-D34P-S--.js +0 -1
- package/dist/codec-DuvU2VQy.js +0 -207
- package/dist/collisions-CfpZU8e4.js +0 -217
- package/dist/compile-B5Mz6WJm.js +0 -245
- package/dist/concurrency-C9UUWuDC.js +0 -96
- package/dist/concurrency-DONL7t4V.js +0 -1
- package/dist/engine-B7p40M__.js +0 -531
- package/dist/i18next-CrUnKFfh.js +0 -1596
- package/dist/i18next-Rgo-v9l0.js +0 -1
- package/dist/lingui--PcOOYry.js +0 -833
- package/dist/messages-Cxa-5tR0.js +0 -166
- package/dist/migrate-CntqvrW4.js +0 -1
- package/dist/migrate-dPgq9uzy.js +0 -1484
- package/dist/project-Dwx7iPm6.js +0 -381
- package/dist/project-pXipT8iG.js +0 -1046
- package/dist/react-intl-CaBVwJ9u.js +0 -519
- package/dist/restore-Btq66Tid.js +0 -175
- package/dist/rewrite-CiTRAICl.js +0 -803
- package/dist/run-DYD_VXKy.js +0 -694
- package/dist/runtime-DTMmliT1.js +0 -64
- package/dist/sync-CcVzger_.js +0 -658
- package/dist/translate-DZR3MkSA.js +0 -299
- package/dist/types-wSh9fCBY.js +0 -11
- package/dist/vue-i18n-CEMnpv7k.js +0 -651
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import { t as findCollisions } from "./collisions-uMTuq36M.js";
|
|
2
|
+
import { c as assetCatalogsModule, l as serverCatalogVersion, o as serverCatalogJson, s as SERVER_FILES, t as compileLocales, u as serverCatalogsDir } from "./locales-DxLDrx-h.js";
|
|
3
|
+
import { c as toRuntimeConfig } from "./load-BFLLqY8x.js";
|
|
4
|
+
import { n as readIfExists, r as writeFileAtomic } from "./fs-ezCMZeDV.js";
|
|
5
|
+
import { a as table, i as rootRelative, r as plural } from "./output-CF9uvk_-.js";
|
|
6
|
+
import { a as hasErrors, c as occurrencesOf, f as readErrors, i as computeDrift, m as scan, o as loadCatalogs, r as compareText, s as loadProject } from "./project-DSzWKU3C.js";
|
|
7
|
+
import { r as EXIT } from "./types-Ds_vebja.js";
|
|
8
|
+
import { join, resolve } from "node:path";
|
|
9
|
+
import { mkdir, readdir, rm } from "node:fs/promises";
|
|
10
|
+
// src/cli/commands/compile.ts
|
|
11
|
+
/**
|
|
12
|
+
* `vi18n compile [--out dir] [--assets dir] [--strict] [--pseudo] [--check]`
|
|
13
|
+
* (INTERNALS §2.12, PLAN §5.3): compiled catalogs for code Vite does not
|
|
14
|
+
* build (a wrangler Worker, e-mail rendering), loaded with
|
|
15
|
+
* `registerCatalogs`. It refuses to run while `extract --check` reports
|
|
16
|
+
* drift, so what ships always matches the code. A committed `--out`
|
|
17
|
+
* directory can still lag behind the catalogs (a translation edited,
|
|
18
|
+
* `extract` run without `compile`): `--check` compares it with what would be
|
|
19
|
+
* written, for CI.
|
|
20
|
+
*
|
|
21
|
+
* `--assets` is the Workers layout of `ssr.catalogs: "assets"` (spike S12):
|
|
22
|
+
* the catalogs go to the static-assets directory under the server message
|
|
23
|
+
* set's version, and `<out>/catalogs.js` reads them through `env.ASSETS`, so
|
|
24
|
+
* the Worker bundles none and only the locales requests use take memory.
|
|
25
|
+
*/
|
|
26
|
+
async function compile(ctx, flags) {
|
|
27
|
+
const project = await loadProject(ctx);
|
|
28
|
+
const { config, codec } = project;
|
|
29
|
+
const data = {
|
|
30
|
+
out: null,
|
|
31
|
+
assets: null,
|
|
32
|
+
files: [],
|
|
33
|
+
missing: {},
|
|
34
|
+
drift: []
|
|
35
|
+
};
|
|
36
|
+
const scanned = await scan(project);
|
|
37
|
+
ctx.out.report(scanned.diagnostics.filter((d) => d.severity === "error"));
|
|
38
|
+
const loaded = await loadCatalogs(project);
|
|
39
|
+
if (await refuses(ctx, project, scanned, loaded)) return {
|
|
40
|
+
exitCode: EXIT.failure,
|
|
41
|
+
data
|
|
42
|
+
};
|
|
43
|
+
const locales = [...config.locales, ...flags.pseudo ? config.pseudoLocales : []];
|
|
44
|
+
const compiled = compileLocales({
|
|
45
|
+
config,
|
|
46
|
+
codec,
|
|
47
|
+
messages: scanned.messages,
|
|
48
|
+
keep: config.extraction.keep,
|
|
49
|
+
catalogs: loaded.set,
|
|
50
|
+
locales
|
|
51
|
+
});
|
|
52
|
+
let missingTotal = 0;
|
|
53
|
+
for (const locale of config.locales) {
|
|
54
|
+
const result = compiled.get(locale);
|
|
55
|
+
ctx.out.report(result.diagnostics);
|
|
56
|
+
if (locale === config.sourceLocale) continue;
|
|
57
|
+
let count = 0;
|
|
58
|
+
for (const status of result.status.values()) if (status.state === "missing") count++;
|
|
59
|
+
data.missing[locale] = count;
|
|
60
|
+
missingTotal += count;
|
|
61
|
+
}
|
|
62
|
+
if (flags.out !== null) await writeOutput(ctx, project, {
|
|
63
|
+
compiled,
|
|
64
|
+
locales,
|
|
65
|
+
messages: scanned.messages
|
|
66
|
+
}, {
|
|
67
|
+
...flags,
|
|
68
|
+
out: flags.out
|
|
69
|
+
}, data);
|
|
70
|
+
printSummary(ctx, data, flags);
|
|
71
|
+
const failed = hasErrors(ctx.out.diagnostics) || flags.strict && missingTotal > 0;
|
|
72
|
+
if (flags.strict && missingTotal > 0) ctx.out.note(`vi18n compile --strict: ${plural(missingTotal, "missing translation")}`);
|
|
73
|
+
return {
|
|
74
|
+
exitCode: failed ? EXIT.failure : EXIT.ok,
|
|
75
|
+
data
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
/** Whether compile must not run: unreadable catalogs, a live id collision, or drift (each reported). */
|
|
79
|
+
async function refuses(ctx, project, scanned, loaded) {
|
|
80
|
+
const unreadable = readErrors(loaded.diagnostics);
|
|
81
|
+
if (unreadable.length > 0) {
|
|
82
|
+
ctx.out.report(unreadable);
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
const collided = findCollisions(occurrencesOf(scanned), loaded.set, project.codec, { referenced: new Set(project.config.extraction.keep) });
|
|
86
|
+
if (hasErrors(collided)) {
|
|
87
|
+
ctx.out.report(collided);
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
const refusals = (await computeDrift(project, scanned.messages, loaded.set)).diagnostics.filter((d) => d.code === "catalog-drift" || d.code === "id-scheme-mismatch");
|
|
91
|
+
if (refusals.length === 0) return false;
|
|
92
|
+
ctx.out.report(refusals);
|
|
93
|
+
ctx.out.note("vi18n compile: the catalogs do not match the code; run vi18n extract first");
|
|
94
|
+
return true;
|
|
95
|
+
}
|
|
96
|
+
/** Writes (or with `--check` compares) every file of `--out` and `--assets`. */
|
|
97
|
+
async function writeOutput(ctx, project, input, flags, data) {
|
|
98
|
+
const { config } = project;
|
|
99
|
+
const out = resolve(ctx.global.cwd, flags.out);
|
|
100
|
+
data.out = rootRelative(config.root, out);
|
|
101
|
+
if (!flags.check) await mkdir(out, { recursive: true });
|
|
102
|
+
const assets = flags.assets === null ? null : resolve(ctx.global.cwd, flags.assets);
|
|
103
|
+
if (assets !== null) data.assets = rootRelative(config.root, assets);
|
|
104
|
+
const { files, version } = outputFiles(project, input, flags, {
|
|
105
|
+
out,
|
|
106
|
+
assets
|
|
107
|
+
});
|
|
108
|
+
const fix = `vi18n compile --out ${flags.out}${assets === null ? "" : ` --assets ${flags.assets}`}${flags.pseudo ? " --pseudo" : ""}`;
|
|
109
|
+
for (const [path, content] of files) {
|
|
110
|
+
const file = rootRelative(config.root, path);
|
|
111
|
+
data.files.push(file);
|
|
112
|
+
if (!flags.check) {
|
|
113
|
+
await writeFileAtomic(path, content, { ifChanged: true });
|
|
114
|
+
continue;
|
|
115
|
+
}
|
|
116
|
+
const drift = await fileDrift(path, file, content, fix);
|
|
117
|
+
if (drift === null) continue;
|
|
118
|
+
data.drift.push(file);
|
|
119
|
+
ctx.out.report([drift]);
|
|
120
|
+
}
|
|
121
|
+
if (version === null || assets === null || flags.check) return;
|
|
122
|
+
const removed = await removeOtherVersions(assets, version, [...config.locales, ...config.pseudoLocales]);
|
|
123
|
+
if (removed > 0) ctx.out.note(`removed ${plural(removed, "earlier catalog version")} from ${ctx.out.display(rootRelative(config.root, join(assets, "vi18n")))}`);
|
|
124
|
+
}
|
|
125
|
+
/** The files to write, and the server catalog version under `--assets` (null without). */
|
|
126
|
+
function outputFiles(project, input, flags, dirs) {
|
|
127
|
+
const { config, codec } = project;
|
|
128
|
+
const { compiled, locales } = input;
|
|
129
|
+
const { out, assets } = dirs;
|
|
130
|
+
const files = [];
|
|
131
|
+
const runtime = toRuntimeConfig(config, {
|
|
132
|
+
base: "/",
|
|
133
|
+
pseudo: flags.pseudo
|
|
134
|
+
});
|
|
135
|
+
const catalogJson = (locale) => serverCatalogJson(compiled.get(locale).messages) + "\n";
|
|
136
|
+
let version = null;
|
|
137
|
+
if (assets === null) for (const locale of locales) files.push([join(out, `${locale}.json`), catalogJson(locale)]);
|
|
138
|
+
else {
|
|
139
|
+
version = serverCatalogVersion({
|
|
140
|
+
idScheme: codec.idScheme,
|
|
141
|
+
v: null,
|
|
142
|
+
ids: compiled.get(config.sourceLocale).messages.keys(),
|
|
143
|
+
sourceHashOf: (id) => input.messages.get(id)?.sourceHash ?? ""
|
|
144
|
+
});
|
|
145
|
+
for (const locale of locales) {
|
|
146
|
+
const path = join(assets, serverCatalogsDir(version), locale, SERVER_FILES.catalog);
|
|
147
|
+
files.push([path, catalogJson(locale)]);
|
|
148
|
+
}
|
|
149
|
+
runtime.ssr.maxLoadedLocales = config.ssr.maxLoadedLocales;
|
|
150
|
+
}
|
|
151
|
+
files.push([join(out, "sources.json"), sourcesJson(input.messages)]);
|
|
152
|
+
files.push([join(out, "config.json"), JSON.stringify(runtime) + "\n"]);
|
|
153
|
+
if (version !== null) {
|
|
154
|
+
files.push([join(out, "catalogs.js"), assetCatalogsModule({
|
|
155
|
+
locales,
|
|
156
|
+
dir: serverCatalogsDir(version),
|
|
157
|
+
deploy: `deploy ${flags.assets} (written by vi18n compile --assets) with this Worker`,
|
|
158
|
+
modules: "compile without --assets to bundle the catalogs as modules"
|
|
159
|
+
})]);
|
|
160
|
+
files.push([join(out, "catalogs.d.ts"), CATALOGS_DTS]);
|
|
161
|
+
}
|
|
162
|
+
return {
|
|
163
|
+
files,
|
|
164
|
+
version
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
/** `--check`: a missing or different file is drift. */
|
|
168
|
+
async function fileDrift(path, file, content, fix) {
|
|
169
|
+
const current = await readIfExists(path);
|
|
170
|
+
if (current !== null && current.replace(/\r\n/g, "\n") === content) return null;
|
|
171
|
+
return {
|
|
172
|
+
code: "catalog-drift",
|
|
173
|
+
severity: "error",
|
|
174
|
+
message: current === null ? `${file} does not exist yet; run ${fix}` : `${file} is out of date; run ${fix}`,
|
|
175
|
+
file
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
function printSummary(ctx, data, flags) {
|
|
179
|
+
const rows = Object.entries(data.missing).map(([locale, count]) => [locale, count]);
|
|
180
|
+
if (rows.length > 0) ctx.out.result(table(["locale", "missing"], rows));
|
|
181
|
+
if (data.out === null) return;
|
|
182
|
+
const where = ctx.out.display(data.out) + (data.assets === null ? "" : ` and ${ctx.out.display(data.assets)}`);
|
|
183
|
+
if (!flags.check) {
|
|
184
|
+
ctx.out.result(`wrote ${plural(data.files.length, "file")} to ${where}`);
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
ctx.out.result(data.drift.length > 0 ? `vi18n compile --check: ${data.drift.length} out-of-date file(s) in ${where}` : `vi18n compile --check: ${where} ${data.assets === null ? "is" : "are"} up to date`);
|
|
188
|
+
}
|
|
189
|
+
/** Types of the generated `catalogs.js` for TypeScript apps (no `allowJs` needed). */
|
|
190
|
+
const CATALOGS_DTS = `// Generated by vi18n compile --assets: catalog loaders for registerCatalogs().
|
|
191
|
+
declare const catalogs: { [locale: string]: () => Promise<{ [id: string]: unknown }> };
|
|
192
|
+
export default catalogs;
|
|
193
|
+
`;
|
|
194
|
+
/** A version directory name (`hash8`): base64url, 8 characters. */
|
|
195
|
+
const VERSION_NAME = /^[\w-]{8}$/;
|
|
196
|
+
/**
|
|
197
|
+
* Removes the versions of `<assets>/vi18n/` other than `version` that this
|
|
198
|
+
* command wrote: directories named like a version holding only
|
|
199
|
+
* `<locale>/catalog.json` for configured locales. Anything else there (a
|
|
200
|
+
* Vite build's stable manifests, the app's own files) is left alone.
|
|
201
|
+
*/
|
|
202
|
+
async function removeOtherVersions(assets, version, locales) {
|
|
203
|
+
const root = join(assets, "vi18n");
|
|
204
|
+
let removed = 0;
|
|
205
|
+
for (const entry of await readdir(root, { withFileTypes: true }).catch(() => [])) {
|
|
206
|
+
if (!entry.isDirectory() || entry.name === version || !VERSION_NAME.test(entry.name)) continue;
|
|
207
|
+
const dir = join(root, entry.name);
|
|
208
|
+
if (!await onlyCatalogs(dir, locales)) continue;
|
|
209
|
+
await rm(dir, {
|
|
210
|
+
recursive: true,
|
|
211
|
+
force: true
|
|
212
|
+
});
|
|
213
|
+
removed++;
|
|
214
|
+
}
|
|
215
|
+
return removed;
|
|
216
|
+
}
|
|
217
|
+
async function onlyCatalogs(dir, locales) {
|
|
218
|
+
for (const entry of await readdir(dir, { withFileTypes: true })) {
|
|
219
|
+
if (!entry.isDirectory() || !locales.includes(entry.name)) return false;
|
|
220
|
+
if ((await readdir(join(dir, entry.name), { withFileTypes: true })).some((file) => !file.isFile() || file.name !== SERVER_FILES.catalog)) return false;
|
|
221
|
+
}
|
|
222
|
+
return true;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Every exact source literal of a generated-id message → its id, so
|
|
226
|
+
* untransformed code (`t("Hello {name}")` in a Worker) finds the compiled
|
|
227
|
+
* message (PLAN §5.3). Manual ids are looked up by id and need no entry.
|
|
228
|
+
*/
|
|
229
|
+
function sourcesJson(messages) {
|
|
230
|
+
const pairs = [];
|
|
231
|
+
for (const message of messages.values()) {
|
|
232
|
+
if (message.manual) continue;
|
|
233
|
+
for (const source of message.sources) pairs.push([source, message.id]);
|
|
234
|
+
}
|
|
235
|
+
pairs.sort((a, b) => compareText(a[0], b[0]));
|
|
236
|
+
const data = Object.create(null);
|
|
237
|
+
for (const [source, id] of pairs) data[source] = id;
|
|
238
|
+
return JSON.stringify(data) + "\n";
|
|
239
|
+
}
|
|
240
|
+
export { compile };
|