@the-i18n-kit/cli 4.9.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 +368 -0
- package/dist/_shared-Dv1EW2gy.js +248 -0
- package/dist/_shared-Dv1EW2gy.js.map +1 -0
- package/dist/add-BvXrJkqZ.js +40 -0
- package/dist/add-BvXrJkqZ.js.map +1 -0
- package/dist/bin-Cs-dvpEC.d.ts +1 -0
- package/dist/bin.js +11 -0
- package/dist/bin.js.map +1 -0
- package/dist/check-9dcNfHtC.js +49 -0
- package/dist/check-9dcNfHtC.js.map +1 -0
- package/dist/cli-CiX4llY1.js +82 -0
- package/dist/cli-CiX4llY1.js.map +1 -0
- package/dist/config/framework/stubs/next-intl-routing-DEwC7Bbk.d.ts +19 -0
- package/dist/config/framework/stubs/next-intl-routing-DEwC7Bbk.d.ts.map +1 -0
- package/dist/config/framework/stubs/next-intl-routing.js +22 -0
- package/dist/config/framework/stubs/next-intl-routing.js.map +1 -0
- package/dist/config/framework/stubs/unplugin-vue-i18n-D9yaDzRk.d.ts +25 -0
- package/dist/config/framework/stubs/unplugin-vue-i18n-D9yaDzRk.d.ts.map +1 -0
- package/dist/config/framework/stubs/unplugin-vue-i18n.js +26 -0
- package/dist/config/framework/stubs/unplugin-vue-i18n.js.map +1 -0
- package/dist/define-config-4ubtfvUy.js +14 -0
- package/dist/define-config-4ubtfvUy.js.map +1 -0
- package/dist/define-config-Dhg13592.d.ts +142 -0
- package/dist/define-config-Dhg13592.d.ts.map +1 -0
- package/dist/define-config-lQrIpPSK.d.ts +2 -0
- package/dist/define-config.d.ts +1 -0
- package/dist/define-config.js +2 -0
- package/dist/detect-Dr2skxeL.js +17 -0
- package/dist/detect-Dr2skxeL.js.map +1 -0
- package/dist/empty-p0wct8Hk.js +36 -0
- package/dist/empty-p0wct8Hk.js.map +1 -0
- package/dist/errors-coI1dhw1.js +33 -0
- package/dist/errors-coI1dhw1.js.map +1 -0
- package/dist/find-duplicates-DuI8niF7.js +31 -0
- package/dist/find-duplicates-DuI8niF7.js.map +1 -0
- package/dist/get-BskDC2wT.js +41 -0
- package/dist/get-BskDC2wT.js.map +1 -0
- package/dist/index-BtSA6-iT.d.ts +1130 -0
- package/dist/index-BtSA6-iT.d.ts.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +6 -0
- package/dist/init-D7r6iX3q.js +33 -0
- package/dist/init-D7r6iX3q.js.map +1 -0
- package/dist/list-dirs-BHk38JXZ.js +17 -0
- package/dist/list-dirs-BHk38JXZ.js.map +1 -0
- package/dist/missing-0gSZKTgt.js +51 -0
- package/dist/missing-0gSZKTgt.js.map +1 -0
- package/dist/operations-BCJd7in3.js +6464 -0
- package/dist/operations-BCJd7in3.js.map +1 -0
- package/dist/php-reader-DcgOAhTw.js +2 -0
- package/dist/php-reader-DuZ0Hyl_.js +32 -0
- package/dist/php-reader-DuZ0Hyl_.js.map +1 -0
- package/dist/providers-BAwPjeCy.js +482 -0
- package/dist/providers-BAwPjeCy.js.map +1 -0
- package/dist/remove-DR_mRiMA.js +41 -0
- package/dist/remove-DR_mRiMA.js.map +1 -0
- package/dist/remove-orphans-CcA3XQHJ.js +57 -0
- package/dist/remove-orphans-CcA3XQHJ.js.map +1 -0
- package/dist/rename-CWLfThC1.js +45 -0
- package/dist/rename-CWLfThC1.js.map +1 -0
- package/dist/scaffold-BahXKbo9.js +39 -0
- package/dist/scaffold-BahXKbo9.js.map +1 -0
- package/dist/scan-CTxs3kl7.js +31 -0
- package/dist/scan-CTxs3kl7.js.map +1 -0
- package/dist/search-BonEgmSt.js +49 -0
- package/dist/search-BonEgmSt.js.map +1 -0
- package/dist/status-C_5Khw14.js +45 -0
- package/dist/status-C_5Khw14.js.map +1 -0
- package/dist/stdout-guard-sJHFWVem.js +20 -0
- package/dist/stdout-guard-sJHFWVem.js.map +1 -0
- package/dist/translate-CnXvBi5O.js +92 -0
- package/dist/translate-CnXvBi5O.js.map +1 -0
- package/dist/translate-key-DwO9XZMc.js +73 -0
- package/dist/translate-key-DwO9XZMc.js.map +1 -0
- package/dist/update-HR8MvPlI.js +40 -0
- package/dist/update-HR8MvPlI.js.map +1 -0
- package/dist/write-CAD9xQDy.js +47 -0
- package/dist/write-CAD9xQDy.js.map +1 -0
- package/package.json +86 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import "./stdout-guard-sJHFWVem.js";
|
|
2
|
+
import { c as addTranslations } from "./operations-BCJd7in3.js";
|
|
3
|
+
import "./providers-BAwPjeCy.js";
|
|
4
|
+
import "./php-reader-DuZ0Hyl_.js";
|
|
5
|
+
import { r as parseJsonArg, t as createCommand } from "./_shared-Dv1EW2gy.js";
|
|
6
|
+
//#region src/commands/add.ts
|
|
7
|
+
var add_default = createCommand({
|
|
8
|
+
name: "add",
|
|
9
|
+
description: "Add new translation keys (skips keys that already exist)",
|
|
10
|
+
args: {
|
|
11
|
+
layer: {
|
|
12
|
+
type: "string",
|
|
13
|
+
description: "Layer name",
|
|
14
|
+
required: true
|
|
15
|
+
},
|
|
16
|
+
translations: {
|
|
17
|
+
type: "string",
|
|
18
|
+
description: "JSON: { \"key\": { \"en\": \"val\", \"de\": \"val\" } }",
|
|
19
|
+
required: true
|
|
20
|
+
},
|
|
21
|
+
dryRun: {
|
|
22
|
+
type: "boolean",
|
|
23
|
+
description: "Preview changes without writing",
|
|
24
|
+
default: false
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
async run(args) {
|
|
28
|
+
const translations = parseJsonArg(args.translations, "translations");
|
|
29
|
+
return addTranslations({
|
|
30
|
+
layer: args.layer,
|
|
31
|
+
translations,
|
|
32
|
+
dryRun: args.dryRun,
|
|
33
|
+
projectDir: args.projectDir
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
//#endregion
|
|
38
|
+
export { add_default as default };
|
|
39
|
+
|
|
40
|
+
//# sourceMappingURL=add-BvXrJkqZ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-BvXrJkqZ.js","names":[],"sources":["../src/commands/add.ts"],"sourcesContent":["import { createCommand, parseJsonArg } from './_shared.js'\nimport { addTranslations } from '../core/operations.js'\n\nexport default createCommand({\n name: 'add',\n description: 'Add new translation keys (skips keys that already exist)',\n args: {\n layer: { type: 'string', description: 'Layer name', required: true },\n translations: { type: 'string', description: 'JSON: { \"key\": { \"en\": \"val\", \"de\": \"val\" } }', required: true },\n dryRun: { type: 'boolean', description: 'Preview changes without writing', default: false },\n },\n async run(args) {\n const translations = parseJsonArg<Record<string, Record<string, string>>>(args.translations, 'translations')\n return addTranslations({ layer: args.layer, translations, dryRun: args.dryRun, projectDir: args.projectDir })\n },\n})\n"],"mappings":";;;;;;AAGA,IAAA,cAAe,cAAc;CAC3B,MAAM;CACN,aAAa;CACb,MAAM;EACJ,OAAO;GAAE,MAAM;GAAU,aAAa;GAAc,UAAU;GAAM;EACpE,cAAc;GAAE,MAAM;GAAU,aAAa;GAAiD,UAAU;GAAM;EAC9G,QAAQ;GAAE,MAAM;GAAW,aAAa;GAAmC,SAAS;GAAO;EAC5F;CACD,MAAM,IAAI,MAAM;EACd,MAAM,eAAe,aAAqD,KAAK,cAAc,eAAe;AAC5G,SAAO,gBAAgB;GAAE,OAAO,KAAK;GAAO;GAAc,QAAQ,KAAK;GAAQ,YAAY,KAAK;GAAY,CAAC;;CAEhH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/bin.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { t as guardStdout } from "./stdout-guard-sJHFWVem.js";
|
|
3
|
+
//#region src/bin.ts
|
|
4
|
+
const args = process.argv.slice(2);
|
|
5
|
+
if (!(args.includes("--help") || args.includes("-h") || args.includes("--version") || args.includes("-v"))) guardStdout();
|
|
6
|
+
const { runCli } = await import("./cli-CiX4llY1.js");
|
|
7
|
+
await runCli();
|
|
8
|
+
//#endregion
|
|
9
|
+
export {};
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=bin.js.map
|
package/dist/bin.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.js","names":[],"sources":["../src/bin.ts"],"sourcesContent":["#!/usr/bin/env node\n// Install the stdout guard before anything else loads, so third-party logs\n// (e.g. Nuxt modules during config detection) can never pollute the\n// machine-readable output on stdout. Help/version invocations skip the guard:\n// they never load third-party code and their output belongs on stdout\n// (mirrors the flag check in cli.ts, which cannot be imported before the\n// guard decision).\nimport { guardStdout } from './utils/stdout-guard.js'\n\nconst args = process.argv.slice(2)\nconst isHelpOrVersion = args.includes('--help') || args.includes('-h')\n || args.includes('--version') || args.includes('-v')\nif (!isHelpOrVersion) {\n guardStdout()\n}\nconst { runCli } = await import('./cli.js')\nawait runCli()\n"],"mappings":";;;AASA,MAAM,OAAO,QAAQ,KAAK,MAAM,EAAE;AAGlC,IAAI,EAFoB,KAAK,SAAS,SAAS,IAAI,KAAK,SAAS,KAAK,IACjE,KAAK,SAAS,YAAY,IAAI,KAAK,SAAS,KAAK,EAEpD,cAAa;AAEf,MAAM,EAAE,WAAW,MAAM,OAAO;AAChC,MAAM,QAAQ"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import "./stdout-guard-sJHFWVem.js";
|
|
2
|
+
import { t as checkUndefinedKeys } from "./operations-BCJd7in3.js";
|
|
3
|
+
import "./providers-BAwPjeCy.js";
|
|
4
|
+
import "./php-reader-DuZ0Hyl_.js";
|
|
5
|
+
import { t as createCommand } from "./_shared-Dv1EW2gy.js";
|
|
6
|
+
//#region src/commands/check.ts
|
|
7
|
+
/**
|
|
8
|
+
* CI gate for `check`: any undefined-key finding fails the build.
|
|
9
|
+
* Reads summary.undefinedCount, so it works for inline results and for
|
|
10
|
+
* the { reportFile, summary } shape alike. Uncertain findings never fail.
|
|
11
|
+
*/
|
|
12
|
+
function hasUndefinedKeys(result) {
|
|
13
|
+
if (result === null || typeof result !== "object") return false;
|
|
14
|
+
const summary = result.summary;
|
|
15
|
+
if (summary === null || typeof summary !== "object") return false;
|
|
16
|
+
const count = summary.undefinedCount;
|
|
17
|
+
return typeof count === "number" && count > 0;
|
|
18
|
+
}
|
|
19
|
+
var check_default = createCommand({
|
|
20
|
+
name: "check",
|
|
21
|
+
description: "Find keys referenced in code but defined in no consumed locale layer (they render as raw keys); exits non-zero when any are found",
|
|
22
|
+
args: {
|
|
23
|
+
locale: {
|
|
24
|
+
type: "string",
|
|
25
|
+
description: "Reference locale to resolve definitions in (default: project default)"
|
|
26
|
+
},
|
|
27
|
+
outputFile: {
|
|
28
|
+
type: "string",
|
|
29
|
+
description: "Write full output to this file path and return only a summary (useful for large outputs)"
|
|
30
|
+
},
|
|
31
|
+
codequalityOutput: {
|
|
32
|
+
type: "string",
|
|
33
|
+
description: "Also write the findings as a GitLab Code Quality (CodeClimate) JSON report to this file path"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
failWhen: hasUndefinedKeys,
|
|
37
|
+
async run(args) {
|
|
38
|
+
return checkUndefinedKeys({
|
|
39
|
+
locale: args.locale,
|
|
40
|
+
projectDir: args.projectDir,
|
|
41
|
+
outputFile: args.outputFile,
|
|
42
|
+
codequalityOutput: args.codequalityOutput
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
//#endregion
|
|
47
|
+
export { check_default as default };
|
|
48
|
+
|
|
49
|
+
//# sourceMappingURL=check-9dcNfHtC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-9dcNfHtC.js","names":[],"sources":["../src/commands/check.ts"],"sourcesContent":["import { createCommand } from './_shared.js'\nimport { checkUndefinedKeys } from '../core/operations.js'\n\n/**\n * CI gate for `check`: any undefined-key finding fails the build.\n * Reads summary.undefinedCount, so it works for inline results and for\n * the { reportFile, summary } shape alike. Uncertain findings never fail.\n */\nexport function hasUndefinedKeys(result: unknown): boolean {\n if (result === null || typeof result !== 'object') return false\n const summary = (result as Record<string, unknown>).summary\n if (summary === null || typeof summary !== 'object') return false\n const count = (summary as Record<string, unknown>).undefinedCount\n return typeof count === 'number' && count > 0\n}\n\nexport default createCommand({\n name: 'check',\n description: 'Find keys referenced in code but defined in no consumed locale layer (they render as raw keys); exits non-zero when any are found',\n args: {\n locale: { type: 'string', description: 'Reference locale to resolve definitions in (default: project default)' },\n outputFile: { type: 'string', description: 'Write full output to this file path and return only a summary (useful for large outputs)' },\n codequalityOutput: { type: 'string', description: 'Also write the findings as a GitLab Code Quality (CodeClimate) JSON report to this file path' },\n },\n failWhen: hasUndefinedKeys,\n async run(args) {\n return checkUndefinedKeys({\n locale: args.locale,\n projectDir: args.projectDir,\n outputFile: args.outputFile,\n codequalityOutput: args.codequalityOutput,\n })\n },\n})\n"],"mappings":";;;;;;;;;;;AAQA,SAAgB,iBAAiB,QAA0B;AACzD,KAAI,WAAW,QAAQ,OAAO,WAAW,SAAU,QAAO;CAC1D,MAAM,UAAW,OAAmC;AACpD,KAAI,YAAY,QAAQ,OAAO,YAAY,SAAU,QAAO;CAC5D,MAAM,QAAS,QAAoC;AACnD,QAAO,OAAO,UAAU,YAAY,QAAQ;;AAG9C,IAAA,gBAAe,cAAc;CAC3B,MAAM;CACN,aAAa;CACb,MAAM;EACJ,QAAQ;GAAE,MAAM;GAAU,aAAa;GAAyE;EAChH,YAAY;GAAE,MAAM;GAAU,aAAa;GAA4F;EACvI,mBAAmB;GAAE,MAAM;GAAU,aAAa;GAAgG;EACnJ;CACD,UAAU;CACV,MAAM,IAAI,MAAM;AACd,SAAO,mBAAmB;GACxB,QAAQ,KAAK;GACb,YAAY,KAAK;GACjB,YAAY,KAAK;GACjB,mBAAmB,KAAK;GACzB,CAAC;;CAEL,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import "./stdout-guard-sJHFWVem.js";
|
|
2
|
+
import "./providers-BAwPjeCy.js";
|
|
3
|
+
import { n as emitErrorResult } from "./_shared-Dv1EW2gy.js";
|
|
4
|
+
import { createRequire } from "node:module";
|
|
5
|
+
import { defineCommand, runCommand, runMain } from "citty";
|
|
6
|
+
//#region src/commands/index.ts
|
|
7
|
+
const commands$1 = {
|
|
8
|
+
"init": () => import("./init-D7r6iX3q.js").then((m) => m.default),
|
|
9
|
+
"detect": () => import("./detect-Dr2skxeL.js").then((m) => m.default),
|
|
10
|
+
"list-dirs": () => import("./list-dirs-BHk38JXZ.js").then((m) => m.default),
|
|
11
|
+
"get": () => import("./get-BskDC2wT.js").then((m) => m.default),
|
|
12
|
+
"write": () => import("./write-CAD9xQDy.js").then((m) => m.default),
|
|
13
|
+
"add": () => import("./add-BvXrJkqZ.js").then((m) => m.default),
|
|
14
|
+
"update": () => import("./update-HR8MvPlI.js").then((m) => m.default),
|
|
15
|
+
"missing": () => import("./missing-0gSZKTgt.js").then((m) => m.default),
|
|
16
|
+
"status": () => import("./status-C_5Khw14.js").then((m) => m.default),
|
|
17
|
+
"empty": () => import("./empty-p0wct8Hk.js").then((m) => m.default),
|
|
18
|
+
"search": () => import("./search-BonEgmSt.js").then((m) => m.default),
|
|
19
|
+
"remove": () => import("./remove-DR_mRiMA.js").then((m) => m.default),
|
|
20
|
+
"rename": () => import("./rename-CWLfThC1.js").then((m) => m.default),
|
|
21
|
+
"translate": () => import("./translate-CnXvBi5O.js").then((m) => m.default),
|
|
22
|
+
"translate-missing": () => import("./translate-CnXvBi5O.js").then((m) => {
|
|
23
|
+
const def = m.default;
|
|
24
|
+
return {
|
|
25
|
+
...def,
|
|
26
|
+
meta: {
|
|
27
|
+
...def.meta,
|
|
28
|
+
name: "translate-missing",
|
|
29
|
+
description: "Alias of \"translate\" — matches the MCP tool translate_missing."
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}),
|
|
33
|
+
"translate-key": () => import("./translate-key-DwO9XZMc.js").then((m) => m.default),
|
|
34
|
+
"scan": () => import("./scan-CTxs3kl7.js").then((m) => m.default),
|
|
35
|
+
"check": () => import("./check-9dcNfHtC.js").then((m) => m.default),
|
|
36
|
+
"find-duplicates": () => import("./find-duplicates-DuI8niF7.js").then((m) => m.default),
|
|
37
|
+
"remove-orphans": () => import("./remove-orphans-CcA3XQHJ.js").then((m) => m.default),
|
|
38
|
+
"scaffold": () => import("./scaffold-BahXKbo9.js").then((m) => m.default)
|
|
39
|
+
};
|
|
40
|
+
//#endregion
|
|
41
|
+
//#region src/cli.ts
|
|
42
|
+
/**
|
|
43
|
+
* Diagnostic commands kept out of the public CLI surface.
|
|
44
|
+
*
|
|
45
|
+
* Note this removes them from the *executed* map, not just from `--help`, so a
|
|
46
|
+
* name listed here cannot be invoked at all. `scan` is deliberately absent:
|
|
47
|
+
* key-usage scanning has no other route on either surface — `discover` covers
|
|
48
|
+
* `detect` and `list-dirs`, but nothing covers this — so filtering it made a
|
|
49
|
+
* documented command unreachable (#307). The remaining three are #252.
|
|
50
|
+
*/
|
|
51
|
+
const hiddenCommands = new Set([
|
|
52
|
+
"detect",
|
|
53
|
+
"list-dirs",
|
|
54
|
+
"empty"
|
|
55
|
+
]);
|
|
56
|
+
const commands = Object.fromEntries(Object.entries(commands$1).filter(([key]) => !hiddenCommands.has(key)));
|
|
57
|
+
const { version, description } = createRequire(import.meta.url)("../package.json");
|
|
58
|
+
const main = defineCommand({
|
|
59
|
+
meta: {
|
|
60
|
+
name: "the-i18n-cli",
|
|
61
|
+
version,
|
|
62
|
+
description
|
|
63
|
+
},
|
|
64
|
+
subCommands: commands
|
|
65
|
+
});
|
|
66
|
+
async function runCli() {
|
|
67
|
+
const rawArgs = process.argv.slice(2);
|
|
68
|
+
if (rawArgs.includes("--help") || rawArgs.includes("-h") || rawArgs.includes("--version") || rawArgs.includes("-v")) {
|
|
69
|
+
await runMain(main);
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
try {
|
|
73
|
+
await runCommand(main, { rawArgs });
|
|
74
|
+
} catch (error) {
|
|
75
|
+
emitErrorResult(error, { json: rawArgs.includes("--json") });
|
|
76
|
+
process.exitCode = 1;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
//#endregion
|
|
80
|
+
export { runCli };
|
|
81
|
+
|
|
82
|
+
//# sourceMappingURL=cli-CiX4llY1.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-CiX4llY1.js","names":["commands","allCommands"],"sources":["../src/commands/index.ts","../src/cli.ts"],"sourcesContent":["import type { CommandDef } from 'citty'\n\nexport const commands = {\n 'init': () => import('./init.js').then(m => m.default as CommandDef),\n 'detect': () => import('./detect.js').then(m => m.default as CommandDef),\n 'list-dirs': () => import('./list-dirs.js').then(m => m.default as CommandDef),\n 'get': () => import('./get.js').then(m => m.default as CommandDef),\n 'write': () => import('./write.js').then(m => m.default as CommandDef),\n 'add': () => import('./add.js').then(m => m.default as CommandDef),\n 'update': () => import('./update.js').then(m => m.default as CommandDef),\n 'missing': () => import('./missing.js').then(m => m.default as CommandDef),\n 'status': () => import('./status.js').then(m => m.default as CommandDef),\n 'empty': () => import('./empty.js').then(m => m.default as CommandDef),\n 'search': () => import('./search.js').then(m => m.default as CommandDef),\n 'remove': () => import('./remove.js').then(m => m.default as CommandDef),\n 'rename': () => import('./rename.js').then(m => m.default as CommandDef),\n 'translate': () => import('./translate.js').then(m => m.default as CommandDef),\n // Alias: same operation as `translate`, named to match the MCP tool\n // translate_missing so docs can use one name across both surfaces.\n 'translate-missing': () => import('./translate.js').then((m) => {\n const def = m.default as CommandDef\n return {\n ...def,\n meta: { ...(def.meta as object), name: 'translate-missing', description: 'Alias of \"translate\" — matches the MCP tool translate_missing.' },\n } as CommandDef\n }),\n 'translate-key': () => import('./translate-key.js').then(m => m.default as CommandDef),\n 'scan': () => import('./scan.js').then(m => m.default as CommandDef),\n 'check': () => import('./check.js').then(m => m.default as CommandDef),\n 'find-duplicates': () => import('./find-duplicates.js').then(m => m.default as CommandDef),\n 'remove-orphans': () => import('./remove-orphans.js').then(m => m.default as CommandDef),\n 'scaffold': () => import('./scaffold.js').then(m => m.default as CommandDef),\n} as const\n","import { createRequire } from 'node:module'\nimport { defineCommand, runCommand, runMain } from 'citty'\nimport { commands as allCommands } from './commands/index.js'\nimport { emitErrorResult } from './commands/_shared.js'\n\n/**\n * Diagnostic commands kept out of the public CLI surface.\n *\n * Note this removes them from the *executed* map, not just from `--help`, so a\n * name listed here cannot be invoked at all. `scan` is deliberately absent:\n * key-usage scanning has no other route on either surface — `discover` covers\n * `detect` and `list-dirs`, but nothing covers this — so filtering it made a\n * documented command unreachable (#307). The remaining three are #252.\n */\nconst hiddenCommands = new Set(['detect', 'list-dirs', 'empty'])\nconst commands = Object.fromEntries(\n Object.entries(allCommands).filter(([key]) => !hiddenCommands.has(key)),\n)\n\nconst require = createRequire(import.meta.url)\nconst { version, description } = require('../package.json') as { version: string; description: string }\n\nconst main = defineCommand({\n meta: {\n name: 'the-i18n-cli',\n version,\n description,\n },\n subCommands: commands,\n})\n\nexport async function runCli(): Promise<void> {\n const rawArgs = process.argv.slice(2)\n\n // Let citty handle --help and --version natively (pretty-printed usage)\n if (rawArgs.includes('--help') || rawArgs.includes('-h')\n || rawArgs.includes('--version') || rawArgs.includes('-v')) {\n await runMain(main)\n return\n }\n\n // For normal execution, use runCommand so we control error output.\n // Command run() errors are handled inside createCommand; this catch only\n // sees pre-run failures (unknown command, argument parsing) — those must\n // also keep stdout parseable in JSON mode.\n try {\n await runCommand(main, { rawArgs })\n } catch (error: unknown) {\n emitErrorResult(error, { json: rawArgs.includes('--json') })\n process.exitCode = 1\n }\n}\n"],"mappings":";;;;;;AAEA,MAAaA,aAAW;CACtB,cAAc,OAAO,sBAAa,MAAK,MAAK,EAAE,QAAsB;CACpE,gBAAgB,OAAO,wBAAe,MAAK,MAAK,EAAE,QAAsB;CACxE,mBAAmB,OAAO,2BAAkB,MAAK,MAAK,EAAE,QAAsB;CAC9E,aAAa,OAAO,qBAAY,MAAK,MAAK,EAAE,QAAsB;CAClE,eAAe,OAAO,uBAAc,MAAK,MAAK,EAAE,QAAsB;CACtE,aAAa,OAAO,qBAAY,MAAK,MAAK,EAAE,QAAsB;CAClE,gBAAgB,OAAO,wBAAe,MAAK,MAAK,EAAE,QAAsB;CACxE,iBAAiB,OAAO,yBAAgB,MAAK,MAAK,EAAE,QAAsB;CAC1E,gBAAgB,OAAO,wBAAe,MAAK,MAAK,EAAE,QAAsB;CACxE,eAAe,OAAO,uBAAc,MAAK,MAAK,EAAE,QAAsB;CACtE,gBAAgB,OAAO,wBAAe,MAAK,MAAK,EAAE,QAAsB;CACxE,gBAAgB,OAAO,wBAAe,MAAK,MAAK,EAAE,QAAsB;CACxE,gBAAgB,OAAO,wBAAe,MAAK,MAAK,EAAE,QAAsB;CACxE,mBAAmB,OAAO,2BAAkB,MAAK,MAAK,EAAE,QAAsB;CAG9E,2BAA2B,OAAO,2BAAkB,MAAM,MAAM;EAC9D,MAAM,MAAM,EAAE;AACd,SAAO;GACL,GAAG;GACH,MAAM;IAAE,GAAI,IAAI;IAAiB,MAAM;IAAqB,aAAa;IAAkE;GAC5I;GACD;CACF,uBAAuB,OAAO,+BAAsB,MAAK,MAAK,EAAE,QAAsB;CACtF,cAAc,OAAO,sBAAa,MAAK,MAAK,EAAE,QAAsB;CACpE,eAAe,OAAO,uBAAc,MAAK,MAAK,EAAE,QAAsB;CACtE,yBAAyB,OAAO,iCAAwB,MAAK,MAAK,EAAE,QAAsB;CAC1F,wBAAwB,OAAO,gCAAuB,MAAK,MAAK,EAAE,QAAsB;CACxF,kBAAkB,OAAO,0BAAiB,MAAK,MAAK,EAAE,QAAsB;CAC7E;;;;;;;;;;;;AClBD,MAAM,iBAAiB,IAAI,IAAI;CAAC;CAAU;CAAa;CAAQ,CAAC;AAChE,MAAM,WAAW,OAAO,YACtB,OAAO,QAAQC,WAAY,CAAC,QAAQ,CAAC,SAAS,CAAC,eAAe,IAAI,IAAI,CAAC,CACxE;AAGD,MAAM,EAAE,SAAS,gBADD,cAAc,OAAO,KAAK,IAAI,CACL,kBAAkB;AAE3D,MAAM,OAAO,cAAc;CACzB,MAAM;EACJ,MAAM;EACN;EACA;EACD;CACD,aAAa;CACd,CAAC;AAEF,eAAsB,SAAwB;CAC5C,MAAM,UAAU,QAAQ,KAAK,MAAM,EAAE;AAGrC,KAAI,QAAQ,SAAS,SAAS,IAAI,QAAQ,SAAS,KAAK,IACnD,QAAQ,SAAS,YAAY,IAAI,QAAQ,SAAS,KAAK,EAAE;AAC5D,QAAM,QAAQ,KAAK;AACnB;;AAOF,KAAI;AACF,QAAM,WAAW,MAAM,EAAE,SAAS,CAAC;UAC5B,OAAgB;AACvB,kBAAgB,OAAO,EAAE,MAAM,QAAQ,SAAS,SAAS,EAAE,CAAC;AAC5D,UAAQ,WAAW"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/config/framework/stubs/next-intl-routing.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* A stand-in for `next-intl/routing`, used only when the real package cannot
|
|
4
|
+
* be resolved from the config file being read.
|
|
5
|
+
*
|
|
6
|
+
* `defineRouting` returns the object it is given, so a routing file's
|
|
7
|
+
* `locales` and `defaultLocale` survive this substitution untouched — which is
|
|
8
|
+
* the only reason it is safe. It exists so that reading a routing file does
|
|
9
|
+
* not require the project's dependencies to be installed: a fresh clone, a CI
|
|
10
|
+
* lint job, or a playground fixture has a `routing.ts` long before it has a
|
|
11
|
+
* `node_modules`.
|
|
12
|
+
*
|
|
13
|
+
* The real package is preferred whenever it resolves. See `resolvableFrom` in
|
|
14
|
+
* ../next.ts.
|
|
15
|
+
*/
|
|
16
|
+
declare function defineRouting<T>(config: T): T;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { defineRouting as default, defineRouting };
|
|
19
|
+
//# sourceMappingURL=next-intl-routing-DEwC7Bbk.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"next-intl-routing-DEwC7Bbk.d.ts","names":[],"sources":["../../../../src/config/framework/stubs/next-intl-routing.ts"],"sourcesContent":[],"mappings":";;AAcA;;;;;;;;;;;;;iBAAgB,yBAAyB,IAAI"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//#region src/config/framework/stubs/next-intl-routing.ts
|
|
2
|
+
/**
|
|
3
|
+
* A stand-in for `next-intl/routing`, used only when the real package cannot
|
|
4
|
+
* be resolved from the config file being read.
|
|
5
|
+
*
|
|
6
|
+
* `defineRouting` returns the object it is given, so a routing file's
|
|
7
|
+
* `locales` and `defaultLocale` survive this substitution untouched — which is
|
|
8
|
+
* the only reason it is safe. It exists so that reading a routing file does
|
|
9
|
+
* not require the project's dependencies to be installed: a fresh clone, a CI
|
|
10
|
+
* lint job, or a playground fixture has a `routing.ts` long before it has a
|
|
11
|
+
* `node_modules`.
|
|
12
|
+
*
|
|
13
|
+
* The real package is preferred whenever it resolves. See `resolvableFrom` in
|
|
14
|
+
* ../next.ts.
|
|
15
|
+
*/
|
|
16
|
+
function defineRouting(config) {
|
|
17
|
+
return config;
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { defineRouting as default, defineRouting };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=next-intl-routing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"next-intl-routing.js","names":[],"sources":["../../../../src/config/framework/stubs/next-intl-routing.ts"],"sourcesContent":["/**\n * A stand-in for `next-intl/routing`, used only when the real package cannot\n * be resolved from the config file being read.\n *\n * `defineRouting` returns the object it is given, so a routing file's\n * `locales` and `defaultLocale` survive this substitution untouched — which is\n * the only reason it is safe. It exists so that reading a routing file does\n * not require the project's dependencies to be installed: a fresh clone, a CI\n * lint job, or a playground fixture has a `routing.ts` long before it has a\n * `node_modules`.\n *\n * The real package is preferred whenever it resolves. See `resolvableFrom` in\n * ../next.ts.\n */\nexport function defineRouting<T>(config: T): T {\n return config\n}\n\nexport default defineRouting\n"],"mappings":";;;;;;;;;;;;;;;AAcA,SAAgB,cAAiB,QAAc;AAC7C,QAAO"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//#region src/config/framework/stubs/unplugin-vue-i18n.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* A stand-in for `@intlify/unplugin-vue-i18n` used only while reading a
|
|
4
|
+
* project's `vite.config`.
|
|
5
|
+
*
|
|
6
|
+
* The real plugin keeps its `include` option in a closure — the object it
|
|
7
|
+
* returns is all Vite hooks, no options — so executing the config teaches us
|
|
8
|
+
* nothing unless the call itself is observed. This records the options and
|
|
9
|
+
* hands back an inert plugin; the resolved Vite config is thrown away either
|
|
10
|
+
* way, we are only here for that one value.
|
|
11
|
+
*
|
|
12
|
+
* Recorded on `globalThis` because jiti compiles this file into its own module
|
|
13
|
+
* registry: a module-level variable here is not the same variable the CLI
|
|
14
|
+
* would read. A registered symbol crosses that boundary.
|
|
15
|
+
*/
|
|
16
|
+
declare const RECORDED: unique symbol;
|
|
17
|
+
declare function record(options?: unknown): {
|
|
18
|
+
name: string;
|
|
19
|
+
};
|
|
20
|
+
declare const vueI18n: typeof record;
|
|
21
|
+
declare const unpluginVueI18n: typeof record;
|
|
22
|
+
//# sourceMappingURL=unplugin-vue-i18n.d.ts.map
|
|
23
|
+
//#endregion
|
|
24
|
+
export { RECORDED, record as default, unpluginVueI18n, vueI18n };
|
|
25
|
+
//# sourceMappingURL=unplugin-vue-i18n-D9yaDzRk.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unplugin-vue-i18n-D9yaDzRk.d.ts","names":[],"sources":["../../../../src/config/framework/stubs/unplugin-vue-i18n.ts"],"sourcesContent":[],"mappings":";;AAcA;AAA4E;AAQ5E;AACA;;;;;;;;;;cATa;iBAEJ,MAAA;;;cAMI,gBAAO;cACP,wBAAe"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//#region src/config/framework/stubs/unplugin-vue-i18n.ts
|
|
2
|
+
/**
|
|
3
|
+
* A stand-in for `@intlify/unplugin-vue-i18n` used only while reading a
|
|
4
|
+
* project's `vite.config`.
|
|
5
|
+
*
|
|
6
|
+
* The real plugin keeps its `include` option in a closure — the object it
|
|
7
|
+
* returns is all Vite hooks, no options — so executing the config teaches us
|
|
8
|
+
* nothing unless the call itself is observed. This records the options and
|
|
9
|
+
* hands back an inert plugin; the resolved Vite config is thrown away either
|
|
10
|
+
* way, we are only here for that one value.
|
|
11
|
+
*
|
|
12
|
+
* Recorded on `globalThis` because jiti compiles this file into its own module
|
|
13
|
+
* registry: a module-level variable here is not the same variable the CLI
|
|
14
|
+
* would read. A registered symbol crosses that boundary.
|
|
15
|
+
*/
|
|
16
|
+
const RECORDED = Symbol.for("the-i18n-kit:unplugin-vue-i18n-options");
|
|
17
|
+
function record(options) {
|
|
18
|
+
globalThis[RECORDED] = options;
|
|
19
|
+
return { name: "the-i18n-kit:unplugin-vue-i18n-stub" };
|
|
20
|
+
}
|
|
21
|
+
const vueI18n = record;
|
|
22
|
+
const unpluginVueI18n = record;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { RECORDED, record as default, unpluginVueI18n, vueI18n };
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=unplugin-vue-i18n.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unplugin-vue-i18n.js","names":[],"sources":["../../../../src/config/framework/stubs/unplugin-vue-i18n.ts"],"sourcesContent":["/**\n * A stand-in for `@intlify/unplugin-vue-i18n` used only while reading a\n * project's `vite.config`.\n *\n * The real plugin keeps its `include` option in a closure — the object it\n * returns is all Vite hooks, no options — so executing the config teaches us\n * nothing unless the call itself is observed. This records the options and\n * hands back an inert plugin; the resolved Vite config is thrown away either\n * way, we are only here for that one value.\n *\n * Recorded on `globalThis` because jiti compiles this file into its own module\n * registry: a module-level variable here is not the same variable the CLI\n * would read. A registered symbol crosses that boundary.\n */\nexport const RECORDED = Symbol.for('the-i18n-kit:unplugin-vue-i18n-options')\n\nfunction record(options?: unknown) {\n ;(globalThis as Record<symbol, unknown>)[RECORDED] = options\n return { name: 'the-i18n-kit:unplugin-vue-i18n-stub' }\n}\n\nexport default record\nexport const vueI18n = record\nexport const unpluginVueI18n = record\n"],"mappings":";;;;;;;;;;;;;;;AAcA,MAAa,WAAW,OAAO,IAAI,yCAAyC;AAE5E,SAAS,OAAO,SAAmB;AAC/B,YAAuC,YAAY;AACrD,QAAO,EAAE,MAAM,uCAAuC;;AAIxD,MAAa,UAAU;AACvB,MAAa,kBAAkB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region src/define-config.ts
|
|
2
|
+
/**
|
|
3
|
+
* Identity at runtime; the point is the type. Returning the argument unchanged
|
|
4
|
+
* keeps the config file's inferred type exact, so `defaultLocale` autocompletes
|
|
5
|
+
* and a misspelled `protectedLocals` is a red squiggle rather than a key that
|
|
6
|
+
* silently protects nothing.
|
|
7
|
+
*/
|
|
8
|
+
function defineI18nKitConfig(config) {
|
|
9
|
+
return config;
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { defineI18nKitConfig as t };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=define-config-4ubtfvUy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define-config-4ubtfvUy.js","names":[],"sources":["../src/define-config.ts"],"sourcesContent":["/**\n * The entry point a project's own `i18n-kit.config.ts` imports:\n *\n * ```ts\n * import { defineI18nKitConfig } from 'the-i18n-cli/config'\n *\n * export default defineI18nKitConfig({ defaultLocale: 'en' })\n * ```\n *\n * Deliberately its own entry rather than part of the package's main export.\n * This module is loaded *by the config file the CLI is about to read*, so it\n * has to stay free of anything that touches the filesystem, the logger, or a\n * provider — importing it must not be able to do anything.\n */\nimport type { ProjectConfig } from './config/types.js'\n\n/**\n * Everything `.i18n-mcp.json` accepts, minus the JSON-only `$schema` key —\n * a TypeScript config is checked by the editor rather than by a schema URL.\n */\nexport type I18nKitConfig = ProjectConfig\n\n/**\n * Identity at runtime; the point is the type. Returning the argument unchanged\n * keeps the config file's inferred type exact, so `defaultLocale` autocompletes\n * and a misspelled `protectedLocals` is a red squiggle rather than a key that\n * silently protects nothing.\n */\nexport function defineI18nKitConfig(config: I18nKitConfig): I18nKitConfig {\n return config\n}\n\nexport type { ProjectConfig, LocaleDefinition, LocaleDir, I18nConfig } from './config/types.js'\n"],"mappings":";;;;;;;AA4BA,SAAgB,oBAAoB,QAAsC;AACxE,QAAO"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
//#region src/adapters/types.d.ts
|
|
2
|
+
type LocaleFileFormat = 'json' | 'php-array';
|
|
3
|
+
//#endregion
|
|
4
|
+
//#region src/config/types.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* A single locale definition as detected from the framework config.
|
|
7
|
+
*/
|
|
8
|
+
interface LocaleDefinition {
|
|
9
|
+
/** Locale code used in URLs and as identifier (e.g., 'de', 'en', 'en-us') */
|
|
10
|
+
code: string;
|
|
11
|
+
/** BCP-47 language tag (e.g., 'de-DE', 'en-GB') */
|
|
12
|
+
language: string;
|
|
13
|
+
/** Locale filename (e.g., 'de-DE.json'). Optional for directory-per-locale layouts (Laravel). */
|
|
14
|
+
file?: string;
|
|
15
|
+
/** Human-readable name (e.g., 'Deutsch') */
|
|
16
|
+
name?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* A locale directory discovered from a Nuxt layer.
|
|
20
|
+
*/
|
|
21
|
+
interface LocaleDir {
|
|
22
|
+
/** Absolute path to the locale directory */
|
|
23
|
+
path: string;
|
|
24
|
+
/** Layer name (e.g., 'root', 'app-admin', 'app-shop') */
|
|
25
|
+
layer: string;
|
|
26
|
+
/** Absolute path to the layer's root directory */
|
|
27
|
+
layerRootDir: string;
|
|
28
|
+
/** If this dir is a symlink/alias to another layer's dir (e.g., app-outlook -> app-shop) */
|
|
29
|
+
aliasOf?: string;
|
|
30
|
+
}
|
|
31
|
+
interface AppInfo {
|
|
32
|
+
/** App name (e.g., 'app-admin', 'root') */
|
|
33
|
+
name: string;
|
|
34
|
+
/** Absolute path to the app's root directory */
|
|
35
|
+
rootDir: string;
|
|
36
|
+
/** Layer names this app consumes (from _layers) */
|
|
37
|
+
layers: string[];
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Project-specific configuration from `.i18n-mcp.json`.
|
|
41
|
+
* All fields are optional — the server passes them to the agent as-is.
|
|
42
|
+
*/
|
|
43
|
+
interface ProjectConfig {
|
|
44
|
+
/** Framework hint to bypass auto-detection (e.g., 'nuxt', 'laravel') */
|
|
45
|
+
framework?: string;
|
|
46
|
+
/** Free-form project background for the agent */
|
|
47
|
+
context?: string;
|
|
48
|
+
/** Rules for deciding which layer a key belongs to */
|
|
49
|
+
layerRules?: Array<{
|
|
50
|
+
layer: string;
|
|
51
|
+
description: string;
|
|
52
|
+
when: string;
|
|
53
|
+
}>;
|
|
54
|
+
/** Term dictionary for consistent translations */
|
|
55
|
+
glossary?: Record<string, string>;
|
|
56
|
+
/** System prompt for translation requests */
|
|
57
|
+
translationPrompt?: string;
|
|
58
|
+
/** Per-locale context (formal register, regional differences, etc.) */
|
|
59
|
+
localeNotes?: Record<string, string>;
|
|
60
|
+
/** Few-shot translation examples */
|
|
61
|
+
examples?: Array<Record<string, string>>;
|
|
62
|
+
/** Per-layer scan directories and ignore patterns for orphan key detection. Keys are layer names. */
|
|
63
|
+
orphanScan?: Record<string, {
|
|
64
|
+
/** Glob patterns for translation keys to exclude from orphan detection (e.g., "common.datetime.months.*"). */
|
|
65
|
+
ignorePatterns?: string[];
|
|
66
|
+
}>;
|
|
67
|
+
/**
|
|
68
|
+
* Where diagnostic reports are written: `true` for '.i18n-reports/', or a
|
|
69
|
+
* relative path. There is no `false` — omitting the key is how you say no,
|
|
70
|
+
* and accepting both spellings of "off" would be two ways to mean one thing.
|
|
71
|
+
*/
|
|
72
|
+
reportOutput?: string | true;
|
|
73
|
+
/** Locale directories for the generic adapter. Each entry is a path string (layer="default") or { path, layer } object. */
|
|
74
|
+
localeDirs?: Array<string | {
|
|
75
|
+
path: string;
|
|
76
|
+
layer: string;
|
|
77
|
+
}>;
|
|
78
|
+
/** Default locale code (required for generic adapter activation). */
|
|
79
|
+
defaultLocale?: string;
|
|
80
|
+
/** Explicit list of locale codes. If set, overrides framework auto-detection (all adapters). Auto-discovered when absent. */
|
|
81
|
+
locales?: string[];
|
|
82
|
+
/**
|
|
83
|
+
* Human-maintained locales excluded from automatic translation.
|
|
84
|
+
* Entries may be any locale ref (code, language tag, or file name);
|
|
85
|
+
* entries that do not match a known locale are ignored with a warning.
|
|
86
|
+
* Explicitly naming a protected locale in targetLocales overrides the
|
|
87
|
+
* protection (with a warning).
|
|
88
|
+
*/
|
|
89
|
+
protectedLocales?: string[];
|
|
90
|
+
/** Override the auto-detected locale file format. E.g., "json" or "php-array". Useful when both formats exist or auto-detection picks wrong. */
|
|
91
|
+
localeFileFormat?: LocaleFileFormat;
|
|
92
|
+
/**
|
|
93
|
+
* Base URL for the LLM provider — gateways, self-hosted model servers and
|
|
94
|
+
* corporate proxies that speak the provider's own protocol. Overrides the
|
|
95
|
+
* endpoint only, not the request shape or auth header. Overridden by the
|
|
96
|
+
* I18N_BASE_URL env var and by --baseUrl. Not supported by "google".
|
|
97
|
+
*/
|
|
98
|
+
providerBaseUrl?: string;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* The fully resolved i18n configuration for a project.
|
|
102
|
+
*/
|
|
103
|
+
interface I18nConfig {
|
|
104
|
+
/** Detected framework name (e.g., 'nuxt', 'laravel'). Set by the detector. */
|
|
105
|
+
framework?: string;
|
|
106
|
+
/** Absolute path to the project root */
|
|
107
|
+
rootDir: string;
|
|
108
|
+
/** Default locale code */
|
|
109
|
+
defaultLocale: string;
|
|
110
|
+
/** Fallback locale chain (e.g., { 'de-formal': ['de'], 'default': ['en'] }) */
|
|
111
|
+
fallbackLocale: Record<string, string[]>;
|
|
112
|
+
/** All locale definitions */
|
|
113
|
+
locales: LocaleDefinition[];
|
|
114
|
+
/** All discovered locale directories, per layer */
|
|
115
|
+
localeDirs: LocaleDir[];
|
|
116
|
+
/** Root directories of all framework layers/roots. Used for source code scanning. */
|
|
117
|
+
layerRootDirs: string[];
|
|
118
|
+
/** Optional project-specific config from .i18n-mcp.json */
|
|
119
|
+
projectConfig?: ProjectConfig;
|
|
120
|
+
/** Locale file format used by this project (default: 'json') */
|
|
121
|
+
localeFileFormat?: LocaleFileFormat;
|
|
122
|
+
/** Discovered apps and their layer dependencies. Used for orphan scan scope. */
|
|
123
|
+
apps: AppInfo[];
|
|
124
|
+
}
|
|
125
|
+
//# sourceMappingURL=types.d.ts.map
|
|
126
|
+
//#endregion
|
|
127
|
+
//#region src/define-config.d.ts
|
|
128
|
+
/**
|
|
129
|
+
* Everything `.i18n-mcp.json` accepts, minus the JSON-only `$schema` key —
|
|
130
|
+
* a TypeScript config is checked by the editor rather than by a schema URL.
|
|
131
|
+
*/
|
|
132
|
+
type I18nKitConfig = ProjectConfig;
|
|
133
|
+
/**
|
|
134
|
+
* Identity at runtime; the point is the type. Returning the argument unchanged
|
|
135
|
+
* keeps the config file's inferred type exact, so `defaultLocale` autocompletes
|
|
136
|
+
* and a misspelled `protectedLocals` is a red squiggle rather than a key that
|
|
137
|
+
* silently protects nothing.
|
|
138
|
+
*/
|
|
139
|
+
declare function defineI18nKitConfig(config: I18nKitConfig): I18nKitConfig;
|
|
140
|
+
//#endregion
|
|
141
|
+
export { LocaleDir as a, LocaleDefinition as i, defineI18nKitConfig as n, ProjectConfig as o, I18nConfig as r, I18nKitConfig as t };
|
|
142
|
+
//# sourceMappingURL=define-config-Dhg13592.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define-config-Dhg13592.d.ts","names":[],"sources":["../src/adapters/types.ts","../src/config/types.ts","../src/define-config.ts"],"sourcesContent":[],"mappings":";AAEY,KAAA,gBAAA,GAAgB,MAAA,GAAA,WAAA;;;AAA5B;;;UCGiB,gBAAA;EAAA;EAcA,IAAA,EAAA,MAAS;EAWT;EAaA,QAAA,EAAA,MAAa;EAAA;MAMf,CAAA,EAAA,MAAA;;MAUC,CAAA,EAAA,MAAA;;;;;AA6BK,UArEJ,SAAA,CAqEI;EAAgB;EAapB,IAAA,EAAA,MAAA;EAAU;OAQT,EAAA,MAAA;;cAIJ,EAAA,MAAA;;SAMO,CAAA,EAAA,MAAA;;AAEN,UA3FE,OAAA,CA2FF;;;;ECrGH,OAAA,EAAA,MAAA;EAQI;EAAmB,MAAA,EAAA,MAAA,EAAA;;;;;;UDelB,aAAA;;;;;;eAMF;;;;;;aAMF;;;;gBAIG;;aAEH,MAAM;;eAEJ;;;;;;;;;;;eAWA;;;;;;;;;;;;;;;;;qBAcM;;;;;;;;;;;;UAaJ,UAAA;;;;;;;;kBAQC;;WAEP;;cAEG;;;;kBAII;;qBAEG;;QAEb;;;;;;;;;AApBS,KCjFL,aAAA,GAAgB,aDiFD;;;;;;;AAoBnB,iBC7FQ,mBAAA,CD6FR,MAAA,EC7FoC,aD6FpC,CAAA,EC7FoD,aD6FpD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './define-config-lQrIpPSK.d.ts';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import "./stdout-guard-sJHFWVem.js";
|
|
2
|
+
import { m as detectConfig } from "./operations-BCJd7in3.js";
|
|
3
|
+
import "./providers-BAwPjeCy.js";
|
|
4
|
+
import "./php-reader-DuZ0Hyl_.js";
|
|
5
|
+
import { t as createCommand } from "./_shared-Dv1EW2gy.js";
|
|
6
|
+
//#region src/commands/detect.ts
|
|
7
|
+
var detect_default = createCommand({
|
|
8
|
+
name: "detect",
|
|
9
|
+
description: "Detect i18n configuration from the project",
|
|
10
|
+
async run(args) {
|
|
11
|
+
return detectConfig(args.projectDir);
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
//#endregion
|
|
15
|
+
export { detect_default as default };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=detect-Dr2skxeL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect-Dr2skxeL.js","names":[],"sources":["../src/commands/detect.ts"],"sourcesContent":["import { createCommand } from './_shared.js'\nimport { detectConfig } from '../core/operations.js'\n\nexport default createCommand({\n name: 'detect',\n description: 'Detect i18n configuration from the project',\n async run(args) {\n return detectConfig(args.projectDir)\n },\n})\n"],"mappings":";;;;;;AAGA,IAAA,iBAAe,cAAc;CAC3B,MAAM;CACN,aAAa;CACb,MAAM,IAAI,MAAM;AACd,SAAO,aAAa,KAAK,WAAW;;CAEvC,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import "./stdout-guard-sJHFWVem.js";
|
|
2
|
+
import { h as findEmptyTranslations } from "./operations-BCJd7in3.js";
|
|
3
|
+
import "./providers-BAwPjeCy.js";
|
|
4
|
+
import "./php-reader-DuZ0Hyl_.js";
|
|
5
|
+
import { t as createCommand } from "./_shared-Dv1EW2gy.js";
|
|
6
|
+
//#region src/commands/empty.ts
|
|
7
|
+
var empty_default = createCommand({
|
|
8
|
+
name: "empty",
|
|
9
|
+
description: "Find translation keys with empty string values",
|
|
10
|
+
args: {
|
|
11
|
+
layer: {
|
|
12
|
+
type: "string",
|
|
13
|
+
description: "Filter to a specific layer"
|
|
14
|
+
},
|
|
15
|
+
locale: {
|
|
16
|
+
type: "string",
|
|
17
|
+
description: "Filter to a specific locale"
|
|
18
|
+
},
|
|
19
|
+
outputFile: {
|
|
20
|
+
type: "string",
|
|
21
|
+
description: "Write full output to this file path and return only a summary (useful for large outputs)"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
async run(args) {
|
|
25
|
+
return findEmptyTranslations({
|
|
26
|
+
layer: args.layer,
|
|
27
|
+
locale: args.locale,
|
|
28
|
+
projectDir: args.projectDir,
|
|
29
|
+
outputFile: args.outputFile
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
//#endregion
|
|
34
|
+
export { empty_default as default };
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=empty-p0wct8Hk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"empty-p0wct8Hk.js","names":[],"sources":["../src/commands/empty.ts"],"sourcesContent":["import { createCommand } from './_shared.js'\nimport { findEmptyTranslations } from '../core/operations.js'\n\nexport default createCommand({\n name: 'empty',\n description: 'Find translation keys with empty string values',\n args: {\n layer: { type: 'string', description: 'Filter to a specific layer' },\n locale: { type: 'string', description: 'Filter to a specific locale' },\n outputFile: { type: 'string', description: 'Write full output to this file path and return only a summary (useful for large outputs)' },\n },\n async run(args) {\n return findEmptyTranslations({\n layer: args.layer,\n locale: args.locale,\n projectDir: args.projectDir,\n outputFile: args.outputFile,\n })\n },\n})\n"],"mappings":";;;;;;AAGA,IAAA,gBAAe,cAAc;CAC3B,MAAM;CACN,aAAa;CACb,MAAM;EACJ,OAAO;GAAE,MAAM;GAAU,aAAa;GAA8B;EACpE,QAAQ;GAAE,MAAM;GAAU,aAAa;GAA+B;EACtE,YAAY;GAAE,MAAM;GAAU,aAAa;GAA4F;EACxI;CACD,MAAM,IAAI,MAAM;AACd,SAAO,sBAAsB;GAC3B,OAAO,KAAK;GACZ,QAAQ,KAAK;GACb,YAAY,KAAK;GACjB,YAAY,KAAK;GAClB,CAAC;;CAEL,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//#region src/utils/errors.ts
|
|
2
|
+
/** Extract a human-readable message from any thrown value. */
|
|
3
|
+
function toErrorMessage(error) {
|
|
4
|
+
return error instanceof Error ? error.message : String(error);
|
|
5
|
+
}
|
|
6
|
+
var ConfigError = class extends Error {
|
|
7
|
+
constructor(message) {
|
|
8
|
+
super(message);
|
|
9
|
+
this.name = "ConfigError";
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
var FileIOError = class extends Error {
|
|
13
|
+
filePath;
|
|
14
|
+
code;
|
|
15
|
+
constructor(message, filePath, code = "FILE_IO_ERROR") {
|
|
16
|
+
super(message);
|
|
17
|
+
this.name = "FileIOError";
|
|
18
|
+
this.filePath = filePath;
|
|
19
|
+
this.code = code;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
var ToolError = class extends Error {
|
|
23
|
+
code;
|
|
24
|
+
constructor(message, code) {
|
|
25
|
+
super(message);
|
|
26
|
+
this.name = "ToolError";
|
|
27
|
+
this.code = code;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
//#endregion
|
|
31
|
+
export { toErrorMessage as i, FileIOError as n, ToolError as r, ConfigError as t };
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=errors-coI1dhw1.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors-coI1dhw1.js","names":[],"sources":["../src/utils/errors.ts"],"sourcesContent":["/** Extract a human-readable message from any thrown value. */\nexport function toErrorMessage(error: unknown): string {\n return error instanceof Error ? error.message : String(error)\n}\n\nexport class ConfigError extends Error {\n constructor(message: string) {\n super(message)\n this.name = 'ConfigError'\n }\n}\n\nexport class FileIOError extends Error {\n public readonly filePath: string\n public readonly code: string\n\n constructor(message: string, filePath: string, code = 'FILE_IO_ERROR') {\n super(message)\n this.name = 'FileIOError'\n this.filePath = filePath\n this.code = code\n }\n}\n\nexport class ToolError extends Error {\n public readonly code: string\n\n constructor(message: string, code: string) {\n super(message)\n this.name = 'ToolError'\n this.code = code\n }\n}\n"],"mappings":";;AACA,SAAgB,eAAe,OAAwB;AACrD,QAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,MAAM;;AAG/D,IAAa,cAAb,cAAiC,MAAM;CACrC,YAAY,SAAiB;AAC3B,QAAM,QAAQ;AACd,OAAK,OAAO;;;AAIhB,IAAa,cAAb,cAAiC,MAAM;CACrC;CACA;CAEA,YAAY,SAAiB,UAAkB,OAAO,iBAAiB;AACrE,QAAM,QAAQ;AACd,OAAK,OAAO;AACZ,OAAK,WAAW;AAChB,OAAK,OAAO;;;AAIhB,IAAa,YAAb,cAA+B,MAAM;CACnC;CAEA,YAAY,SAAiB,MAAc;AACzC,QAAM,QAAQ;AACd,OAAK,OAAO;AACZ,OAAK,OAAO"}
|