@kubb/cli 5.8.4 → 5.9.1
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 +9 -3
- package/bin/kubb.js +1 -1
- package/dist/{Telemetry-DKccmt8g.cjs → Telemetry-BSuUeat7.cjs} +26 -66
- package/dist/Telemetry-BSuUeat7.cjs.map +1 -0
- package/dist/{Telemetry-Ci7sRy6A.js → Telemetry-DxSvCR-R.js} +26 -66
- package/dist/Telemetry-DxSvCR-R.js.map +1 -0
- package/dist/{background-B7VAPM7b.cjs → background-Bztbu76P.cjs} +2 -2
- package/dist/{background-B7VAPM7b.cjs.map → background-Bztbu76P.cjs.map} +1 -1
- package/dist/background-C5ADaF5O.js +1 -0
- package/dist/{background-CnSPyAn7.js → background-DErMBYPd.js} +2 -2
- package/dist/{background-CnSPyAn7.js.map → background-DErMBYPd.js.map} +1 -1
- package/dist/{commands-Cgmj9PsM.js → commands-BATSnmRI.js} +3 -3
- package/dist/{commands-Cgmj9PsM.js.map → commands-BATSnmRI.js.map} +1 -1
- package/dist/{commands-CLUcjHHU.cjs → commands-wWv2IyJV.cjs} +3 -3
- package/dist/{commands-CLUcjHHU.cjs.map → commands-wWv2IyJV.cjs.map} +1 -1
- package/dist/{config-DAdYwK_D.js → config-B6UIKcl1.js} +13 -16
- package/dist/config-B6UIKcl1.js.map +1 -0
- package/dist/{config-CRBZcWwg.cjs → config-Bo9ro7vg.cjs} +13 -16
- package/dist/config-Bo9ro7vg.cjs.map +1 -0
- package/dist/constants-Cii4HX64.js +12 -0
- package/dist/constants-Cii4HX64.js.map +1 -0
- package/dist/constants-Df449N47.cjs +29 -0
- package/dist/constants-Df449N47.cjs.map +1 -0
- package/dist/index.cjs +20 -28
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +20 -28
- package/dist/index.js.map +1 -1
- package/dist/{output-CWupdozw.cjs → output-BnK0scpX.cjs} +10 -15
- package/dist/output-BnK0scpX.cjs.map +1 -0
- package/dist/{output-B9Yw7vL0.js → output-qFt4vV7K.js} +10 -15
- package/dist/output-qFt4vV7K.js.map +1 -0
- package/dist/{reporters-C5HAypFq.cjs → reporters-B4rZOlo8.cjs} +2 -2
- package/dist/{reporters-C5HAypFq.cjs.map → reporters-B4rZOlo8.cjs.map} +1 -1
- package/dist/{reporters-CNZQUlXY.js → reporters-H21Jvrff.js} +2 -2
- package/dist/{reporters-CNZQUlXY.js.map → reporters-H21Jvrff.js.map} +1 -1
- package/dist/{run-VAkf24Cw.cjs → run-89YfZJuo.cjs} +3 -3
- package/dist/{run-VAkf24Cw.cjs.map → run-89YfZJuo.cjs.map} +1 -1
- package/dist/run-8HrdMihy.js +1 -0
- package/dist/{run-CMkKa1rU.cjs → run-BN1-GpZI.cjs} +10 -22
- package/dist/run-BN1-GpZI.cjs.map +1 -0
- package/dist/{run-CQKXIa2D.cjs → run-BOmuzVe1.cjs} +2 -2
- package/dist/{run-CQKXIa2D.cjs.map → run-BOmuzVe1.cjs.map} +1 -1
- package/dist/{run-Ey756UCd.js → run-BYff_byB.js} +2 -2
- package/dist/{run-Ey756UCd.js.map → run-BYff_byB.js.map} +1 -1
- package/dist/{run-99Go42ib.js → run-CFK9DYis.js} +2 -2
- package/dist/{run-99Go42ib.js.map → run-CFK9DYis.js.map} +1 -1
- package/dist/{run-USNnlQcA.js → run-CJHsZZB8.js} +41 -49
- package/dist/run-CJHsZZB8.js.map +1 -0
- package/dist/{run-yb2R1vt0.js → run-Ca_OX3WZ.js} +6 -7
- package/dist/run-Ca_OX3WZ.js.map +1 -0
- package/dist/{run-C5P5_H0R.cjs → run-Ct6kzKpg.cjs} +6 -6
- package/dist/run-Ct6kzKpg.cjs.map +1 -0
- package/dist/{run-BnCdDjXH.cjs → run-DAjjmDdw.cjs} +7 -7
- package/dist/{run-BnCdDjXH.cjs.map → run-DAjjmDdw.cjs.map} +1 -1
- package/dist/{run-E11sqsk0.cjs → run-DL2wLwBZ.cjs} +41 -49
- package/dist/run-DL2wLwBZ.cjs.map +1 -0
- package/dist/{run-DRR30f0e.js → run-Dej-hm91.js} +3 -3
- package/dist/{run-DRR30f0e.js.map → run-Dej-hm91.js.map} +1 -1
- package/dist/{run-9oIapU5y.js → run-DlQDj_SV.js} +7 -7
- package/dist/{run-9oIapU5y.js.map → run-DlQDj_SV.js.map} +1 -1
- package/dist/{run-ClLBHOpl.cjs → run-Dm7nOUUF.cjs} +3 -5
- package/dist/run-Dm7nOUUF.cjs.map +1 -0
- package/dist/{run-CnBJroZW.cjs → run-DpAMfkm5.cjs} +2 -2
- package/dist/{run-CnBJroZW.cjs.map → run-DpAMfkm5.cjs.map} +1 -1
- package/dist/{run-IkpyXtut.js → run-DssKB_1f.js} +3 -5
- package/dist/run-DssKB_1f.js.map +1 -0
- package/dist/{run-BSQJrncc.js → run-N37yeEmo.js} +10 -22
- package/dist/run-N37yeEmo.js.map +1 -0
- package/dist/{snapshot-CXplfGXC.cjs → snapshot-B27W-HME.cjs} +5 -5
- package/dist/{snapshot-CXplfGXC.cjs.map → snapshot-B27W-HME.cjs.map} +1 -1
- package/dist/{snapshot-2q9d9Dqg.js → snapshot-Ctv0_Xwv.js} +5 -5
- package/dist/{snapshot-2q9d9Dqg.js.map → snapshot-Ctv0_Xwv.js.map} +1 -1
- package/dist/studioWorker.js +2 -2
- package/dist/{utils-Dhx5PMpD.js → utils-BHW8kA8P.js} +11 -8
- package/dist/utils-BHW8kA8P.js.map +1 -0
- package/dist/{utils-ZcCFqERz.cjs → utils-BzQ46pgd.cjs} +16 -13
- package/dist/utils-BzQ46pgd.cjs.map +1 -0
- package/package.json +7 -7
- package/dist/Telemetry-Ci7sRy6A.js.map +0 -1
- package/dist/Telemetry-DKccmt8g.cjs.map +0 -1
- package/dist/background-CATamspG.js +0 -1
- package/dist/config-CRBZcWwg.cjs.map +0 -1
- package/dist/config-DAdYwK_D.js.map +0 -1
- package/dist/constants-CdxpgX3_.cjs +0 -115
- package/dist/constants-CdxpgX3_.cjs.map +0 -1
- package/dist/constants-DHRspBTo.js +0 -92
- package/dist/constants-DHRspBTo.js.map +0 -1
- package/dist/output-B9Yw7vL0.js.map +0 -1
- package/dist/output-CWupdozw.cjs.map +0 -1
- package/dist/run-BSQJrncc.js.map +0 -1
- package/dist/run-C5P5_H0R.cjs.map +0 -1
- package/dist/run-CMkKa1rU.cjs.map +0 -1
- package/dist/run-ClLBHOpl.cjs.map +0 -1
- package/dist/run-E11sqsk0.cjs.map +0 -1
- package/dist/run-IkpyXtut.js.map +0 -1
- package/dist/run-USNnlQcA.js.map +0 -1
- package/dist/run-yb2R1vt0.js.map +0 -1
- package/dist/utils-Dhx5PMpD.js.map +0 -1
- package/dist/utils-ZcCFqERz.cjs.map +0 -1
|
@@ -22,33 +22,30 @@ const JITI_OPTIONS = {
|
|
|
22
22
|
* lets go of a file, so `moduleCache: false` alone would keep returning the first version of it.
|
|
23
23
|
*/
|
|
24
24
|
const JAVASCRIPT_EXTENSION = /\.[cm]?jsx?$/;
|
|
25
|
+
const jiti = createJiti(import.meta.url, JITI_OPTIONS);
|
|
25
26
|
/**
|
|
26
|
-
*
|
|
27
|
+
* Loads a Kubb TypeScript or JavaScript config module via jiti.
|
|
27
28
|
*
|
|
28
29
|
* jiti transpiles TypeScript and the `@kubb/renderer-jsx` JSX runtime on the fly. Every load
|
|
29
30
|
* re-evaluates the file, so a config edited on disk is picked up by the next load.
|
|
30
31
|
*
|
|
31
32
|
* @example
|
|
32
33
|
* ```ts
|
|
33
|
-
* const config = await
|
|
34
|
+
* const config = await loadModule('/abs/kubb.config.ts', { default: true })
|
|
34
35
|
* ```
|
|
35
36
|
*/
|
|
36
|
-
function
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
});
|
|
45
|
-
return options?.default ? mod?.default ?? mod : mod;
|
|
46
|
-
} };
|
|
37
|
+
async function loadModule(filePath, options) {
|
|
38
|
+
if (!JAVASCRIPT_EXTENSION.test(filePath)) return options?.default ? jiti.import(filePath, { default: true }) : jiti.import(filePath);
|
|
39
|
+
const mod = await jiti.evalModule(await readFile(filePath, "utf8"), {
|
|
40
|
+
filename: filePath,
|
|
41
|
+
async: true,
|
|
42
|
+
forceTranspile: true
|
|
43
|
+
});
|
|
44
|
+
return options?.default ? mod?.default ?? mod : mod;
|
|
47
45
|
}
|
|
48
46
|
//#endregion
|
|
49
47
|
//#region src/config.ts
|
|
50
|
-
const
|
|
51
|
-
const tsLoader = (configFile) => loader.load(configFile, { default: true });
|
|
48
|
+
const tsLoader = (configFile) => loadModule(configFile, { default: true });
|
|
52
49
|
const MODULE_NAME = "kubb";
|
|
53
50
|
const SEARCH_FILES = [
|
|
54
51
|
"",
|
|
@@ -117,4 +114,4 @@ async function getConfigs({ configPath, input, watch, logLevel }) {
|
|
|
117
114
|
//#endregion
|
|
118
115
|
export { getConfigs as n, findConfigFile as t };
|
|
119
116
|
|
|
120
|
-
//# sourceMappingURL=config-
|
|
117
|
+
//# sourceMappingURL=config-B6UIKcl1.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-B6UIKcl1.js","names":[],"sources":["../../../internals/shared/src/loader.ts","../src/config.ts"],"sourcesContent":["import { readFile } from 'node:fs/promises'\nimport { createJiti } from 'jiti'\n\n/**\n * jiti options for loading Kubb config modules: the automatic JSX runtime pointed at\n * `@kubb/renderer-jsx`, and `moduleCache` off so a re-load re-evaluates the file.\n */\nconst JITI_OPTIONS = {\n jsx: { runtime: 'automatic', importSource: '@kubb/renderer-jsx' },\n moduleCache: false,\n} satisfies Parameters<typeof createJiti>[1]\n\n/**\n * Plain JavaScript files. jiti hands these to Node's native `import()`, whose module cache never\n * lets go of a file, so `moduleCache: false` alone would keep returning the first version of it.\n */\nconst JAVASCRIPT_EXTENSION = /\\.[cm]?jsx?$/\n\n/**\n * Per-call options for {@link loadModule}.\n */\ntype LoadModuleOptions = {\n /**\n * Return the module's default export instead of the full namespace.\n */\n default?: boolean\n}\n\nconst jiti = createJiti(import.meta.url, JITI_OPTIONS)\n\n/**\n * Loads a Kubb TypeScript or JavaScript config module via jiti.\n *\n * jiti transpiles TypeScript and the `@kubb/renderer-jsx` JSX runtime on the fly. Every load\n * re-evaluates the file, so a config edited on disk is picked up by the next load.\n *\n * @example\n * ```ts\n * const config = await loadModule('/abs/kubb.config.ts', { default: true })\n * ```\n */\nexport async function loadModule<T = unknown>(filePath: string, options?: LoadModuleOptions): Promise<T> {\n if (!JAVASCRIPT_EXTENSION.test(filePath)) {\n return (options?.default ? jiti.import(filePath, { default: true }) : jiti.import(filePath)) as Promise<T>\n }\n\n // Transpiled through jiti instead, so every load re-evaluates the file as it is on disk now.\n // A TypeScript file it imports reloads too. A plain JavaScript file it imports still goes\n // through Node's `import()` and stays cached until the process restarts.\n const mod = (await jiti.evalModule(await readFile(filePath, 'utf8'), { filename: filePath, async: true, forceTranspile: true })) as\n | { default?: unknown }\n | undefined\n return (options?.default ? (mod?.default ?? mod) : mod) as T\n}\n","import { existsSync } from 'node:fs'\nimport { basename, dirname, join, resolve } from 'node:path'\nimport process from 'node:process'\nimport { loadModule } from '@internals/shared'\nimport type { CLIOptions, Config, PossibleConfig } from '@kubb/core'\nimport { type LoadConfigResult, type LoadConfigSource, loadConfig } from 'unconfig'\n\n// Kubb configs are JS/TS modules (they call `defineConfig`/`pluginX()`), so YAML and JSON are not\n// supported. The jiti loader handles every module format and the JSX runtime, returning the default export.\nconst tsLoader = (configFile: string) => loadModule(configFile, { default: true })\n\nconst MODULE_NAME = 'kubb'\n\nconst SEARCH_FILES = ['', '.config/', 'configs/'].flatMap((prefix) => [`${prefix}.${MODULE_NAME}rc`, `${prefix}${MODULE_NAME}.config`])\nconst SEARCH_EXTENSIONS = ['ts', 'mts', 'cts', 'js', 'mjs', 'cjs']\n\n/**\n * The first Kubb config file in `cwd` or the nearest parent folder that has one, searched in the same\n * order as {@link getConfigs}, without loading it.\n */\nexport function findConfigFile(cwd: string = process.cwd()): string | undefined {\n for (let dir = resolve(cwd); ; dir = dirname(dir)) {\n const found = SEARCH_FILES.flatMap((file) => SEARCH_EXTENSIONS.map((extension) => join(dir, `${file}.${extension}`))).find((file) => existsSync(file))\n if (found || dirname(dir) === dir) return found\n }\n}\n\ntype GetConfigsOptions = {\n /** Explicit path to the Kubb config file. When omitted, the loader searches up from `process.cwd()`. */\n configPath?: string\n /** OpenAPI input path or URL that overrides `config.input` for this run. */\n input?: string\n /** Watch flag forwarded to the user's `defineConfig` function. */\n watch?: boolean\n /** Log level forwarded to the user's `defineConfig` function. */\n logLevel?: CLIOptions['logLevel']\n}\n\ntype GetConfigsResult = {\n /** Absolute path to the resolved config file. */\n configPath: string\n /** Resolved and normalized Kubb configs, each guaranteed to have a `plugins` array. */\n configs: Array<Config>\n}\n\n/** Discovers the Kubb config and resolves it into normalized configs, each guaranteed to have a `plugins` array. */\nexport async function getConfigs({ configPath, input, watch, logLevel }: GetConfigsOptions): Promise<GetConfigsResult> {\n const abs = configPath ? resolve(configPath) : undefined\n const sources: Array<LoadConfigSource<unknown>> = abs\n ? [{ files: [basename(abs)], extensions: [], parser: tsLoader }]\n : [{ files: SEARCH_FILES, extensions: SEARCH_EXTENSIONS, parser: tsLoader }]\n\n let result: LoadConfigResult<unknown>\n try {\n result = await loadConfig<unknown>({ cwd: abs ? dirname(abs) : process.cwd(), sources, merge: false })\n } catch (error) {\n throw new Error('Config failed loading', { cause: error })\n }\n\n const [filepath] = result.sources\n if (!result.config || !filepath) {\n throw new Error('Config not defined, create a kubb.config.js or pass through your config with the option --config')\n }\n\n const config = result.config as PossibleConfig<CLIOptions>\n const cli: CLIOptions = { config: configPath, input, watch, logLevel }\n const resolved = await (typeof config === 'function' ? config(cli) : config)\n const userConfigs = Array.isArray(resolved) ? resolved : [resolved]\n\n return {\n configPath: filepath,\n configs: userConfigs.map((item) => {\n const config: Config = { ...item, plugins: item.plugins ?? [] }\n return config\n }),\n }\n}\n"],"mappings":";;;;;;;;;;;;A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AC9C,CAAC;EAAE,OAAO,CAAC,SAAS,GAAG,CAAC;EAAG,YAAY,CAAC;EAAG,QAAQ;CAAS,CAAC,IAC7D,CAAC;EAAE,OAAO;EAAc,YAAY;EAAmB,QAAQ;CAAS,CAAC;CAE7E,IAAI;CACJ,IAAI;EACF,SAAS,MAAM,WAAoB;GAAE,KAAK,MAAM,QAAQ,GAAG,IAAI,QAAQ,IAAI;GAAG;GAAS,OAAO;EAAM,CAAC;CACvG,SAAS,OAAO;EACd,MAAM,IAAI,MAAM,yBAAyB,EAAE,OAAO,MAAM,CAAC;CAC3D;CAEA,MAAM,CAAC,YAAY,OAAO;CAC1B,IAAI,CAAC,OAAO,UAAU,CAAC,UACrB,MAAM,IAAI,MAAM,kGAAkG;CAGpH,MAAM,SAAS,OAAO;CAEtB,MAAM,WAAW,OAAO,OAAO,WAAW,aAAa,OAAO;EADpC,QAAQ;EAAY;EAAO;EAAO;CACI,CAAC,IAAI;CAGrE,OAAO;EACL,YAAY;EACZ,UAJkB,MAAM,QAAQ,QAAQ,IAAI,WAAW,CAAC,QAAQ,EAAA,CAI3C,KAAK,SAAS;GAEjC,OAAO;IADkB,GAAG;IAAM,SAAS,KAAK,WAAW,CAAC;GAChD;EACd,CAAC;CACH;AACF"}
|
|
@@ -23,33 +23,30 @@ const JITI_OPTIONS = {
|
|
|
23
23
|
* lets go of a file, so `moduleCache: false` alone would keep returning the first version of it.
|
|
24
24
|
*/
|
|
25
25
|
const JAVASCRIPT_EXTENSION = /\.[cm]?jsx?$/;
|
|
26
|
+
const jiti$1 = (0, jiti.createJiti)(require("url").pathToFileURL(__filename).href, JITI_OPTIONS);
|
|
26
27
|
/**
|
|
27
|
-
*
|
|
28
|
+
* Loads a Kubb TypeScript or JavaScript config module via jiti.
|
|
28
29
|
*
|
|
29
30
|
* jiti transpiles TypeScript and the `@kubb/renderer-jsx` JSX runtime on the fly. Every load
|
|
30
31
|
* re-evaluates the file, so a config edited on disk is picked up by the next load.
|
|
31
32
|
*
|
|
32
33
|
* @example
|
|
33
34
|
* ```ts
|
|
34
|
-
* const config = await
|
|
35
|
+
* const config = await loadModule('/abs/kubb.config.ts', { default: true })
|
|
35
36
|
* ```
|
|
36
37
|
*/
|
|
37
|
-
function
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
});
|
|
46
|
-
return options?.default ? mod?.default ?? mod : mod;
|
|
47
|
-
} };
|
|
38
|
+
async function loadModule(filePath, options) {
|
|
39
|
+
if (!JAVASCRIPT_EXTENSION.test(filePath)) return options?.default ? jiti$1.import(filePath, { default: true }) : jiti$1.import(filePath);
|
|
40
|
+
const mod = await jiti$1.evalModule(await (0, node_fs_promises.readFile)(filePath, "utf8"), {
|
|
41
|
+
filename: filePath,
|
|
42
|
+
async: true,
|
|
43
|
+
forceTranspile: true
|
|
44
|
+
});
|
|
45
|
+
return options?.default ? mod?.default ?? mod : mod;
|
|
48
46
|
}
|
|
49
47
|
//#endregion
|
|
50
48
|
//#region src/config.ts
|
|
51
|
-
const
|
|
52
|
-
const tsLoader = (configFile) => loader.load(configFile, { default: true });
|
|
49
|
+
const tsLoader = (configFile) => loadModule(configFile, { default: true });
|
|
53
50
|
const MODULE_NAME = "kubb";
|
|
54
51
|
const SEARCH_FILES = [
|
|
55
52
|
"",
|
|
@@ -129,4 +126,4 @@ Object.defineProperty(exports, "getConfigs", {
|
|
|
129
126
|
}
|
|
130
127
|
});
|
|
131
128
|
|
|
132
|
-
//# sourceMappingURL=config-
|
|
129
|
+
//# sourceMappingURL=config-Bo9ro7vg.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-Bo9ro7vg.cjs","names":["jiti","createJiti","readFile","process","resolve","dirname","join","existsSync","basename","loadConfig"],"sources":["../../../internals/shared/src/loader.ts","../src/config.ts"],"sourcesContent":["import { readFile } from 'node:fs/promises'\nimport { createJiti } from 'jiti'\n\n/**\n * jiti options for loading Kubb config modules: the automatic JSX runtime pointed at\n * `@kubb/renderer-jsx`, and `moduleCache` off so a re-load re-evaluates the file.\n */\nconst JITI_OPTIONS = {\n jsx: { runtime: 'automatic', importSource: '@kubb/renderer-jsx' },\n moduleCache: false,\n} satisfies Parameters<typeof createJiti>[1]\n\n/**\n * Plain JavaScript files. jiti hands these to Node's native `import()`, whose module cache never\n * lets go of a file, so `moduleCache: false` alone would keep returning the first version of it.\n */\nconst JAVASCRIPT_EXTENSION = /\\.[cm]?jsx?$/\n\n/**\n * Per-call options for {@link loadModule}.\n */\ntype LoadModuleOptions = {\n /**\n * Return the module's default export instead of the full namespace.\n */\n default?: boolean\n}\n\nconst jiti = createJiti(import.meta.url, JITI_OPTIONS)\n\n/**\n * Loads a Kubb TypeScript or JavaScript config module via jiti.\n *\n * jiti transpiles TypeScript and the `@kubb/renderer-jsx` JSX runtime on the fly. Every load\n * re-evaluates the file, so a config edited on disk is picked up by the next load.\n *\n * @example\n * ```ts\n * const config = await loadModule('/abs/kubb.config.ts', { default: true })\n * ```\n */\nexport async function loadModule<T = unknown>(filePath: string, options?: LoadModuleOptions): Promise<T> {\n if (!JAVASCRIPT_EXTENSION.test(filePath)) {\n return (options?.default ? jiti.import(filePath, { default: true }) : jiti.import(filePath)) as Promise<T>\n }\n\n // Transpiled through jiti instead, so every load re-evaluates the file as it is on disk now.\n // A TypeScript file it imports reloads too. A plain JavaScript file it imports still goes\n // through Node's `import()` and stays cached until the process restarts.\n const mod = (await jiti.evalModule(await readFile(filePath, 'utf8'), { filename: filePath, async: true, forceTranspile: true })) as\n | { default?: unknown }\n | undefined\n return (options?.default ? (mod?.default ?? mod) : mod) as T\n}\n","import { existsSync } from 'node:fs'\nimport { basename, dirname, join, resolve } from 'node:path'\nimport process from 'node:process'\nimport { loadModule } from '@internals/shared'\nimport type { CLIOptions, Config, PossibleConfig } from '@kubb/core'\nimport { type LoadConfigResult, type LoadConfigSource, loadConfig } from 'unconfig'\n\n// Kubb configs are JS/TS modules (they call `defineConfig`/`pluginX()`), so YAML and JSON are not\n// supported. The jiti loader handles every module format and the JSX runtime, returning the default export.\nconst tsLoader = (configFile: string) => loadModule(configFile, { default: true })\n\nconst MODULE_NAME = 'kubb'\n\nconst SEARCH_FILES = ['', '.config/', 'configs/'].flatMap((prefix) => [`${prefix}.${MODULE_NAME}rc`, `${prefix}${MODULE_NAME}.config`])\nconst SEARCH_EXTENSIONS = ['ts', 'mts', 'cts', 'js', 'mjs', 'cjs']\n\n/**\n * The first Kubb config file in `cwd` or the nearest parent folder that has one, searched in the same\n * order as {@link getConfigs}, without loading it.\n */\nexport function findConfigFile(cwd: string = process.cwd()): string | undefined {\n for (let dir = resolve(cwd); ; dir = dirname(dir)) {\n const found = SEARCH_FILES.flatMap((file) => SEARCH_EXTENSIONS.map((extension) => join(dir, `${file}.${extension}`))).find((file) => existsSync(file))\n if (found || dirname(dir) === dir) return found\n }\n}\n\ntype GetConfigsOptions = {\n /** Explicit path to the Kubb config file. When omitted, the loader searches up from `process.cwd()`. */\n configPath?: string\n /** OpenAPI input path or URL that overrides `config.input` for this run. */\n input?: string\n /** Watch flag forwarded to the user's `defineConfig` function. */\n watch?: boolean\n /** Log level forwarded to the user's `defineConfig` function. */\n logLevel?: CLIOptions['logLevel']\n}\n\ntype GetConfigsResult = {\n /** Absolute path to the resolved config file. */\n configPath: string\n /** Resolved and normalized Kubb configs, each guaranteed to have a `plugins` array. */\n configs: Array<Config>\n}\n\n/** Discovers the Kubb config and resolves it into normalized configs, each guaranteed to have a `plugins` array. */\nexport async function getConfigs({ configPath, input, watch, logLevel }: GetConfigsOptions): Promise<GetConfigsResult> {\n const abs = configPath ? resolve(configPath) : undefined\n const sources: Array<LoadConfigSource<unknown>> = abs\n ? [{ files: [basename(abs)], extensions: [], parser: tsLoader }]\n : [{ files: SEARCH_FILES, extensions: SEARCH_EXTENSIONS, parser: tsLoader }]\n\n let result: LoadConfigResult<unknown>\n try {\n result = await loadConfig<unknown>({ cwd: abs ? dirname(abs) : process.cwd(), sources, merge: false })\n } catch (error) {\n throw new Error('Config failed loading', { cause: error })\n }\n\n const [filepath] = result.sources\n if (!result.config || !filepath) {\n throw new Error('Config not defined, create a kubb.config.js or pass through your config with the option --config')\n }\n\n const config = result.config as PossibleConfig<CLIOptions>\n const cli: CLIOptions = { config: configPath, input, watch, logLevel }\n const resolved = await (typeof config === 'function' ? config(cli) : config)\n const userConfigs = Array.isArray(resolved) ? resolved : [resolved]\n\n return {\n configPath: filepath,\n configs: userConfigs.map((item) => {\n const config: Config = { ...item, plugins: item.plugins ?? [] }\n return config\n }),\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAOA,MAAM,eAAe;CACnB,KAAK;EAAE,SAAS;EAAa,cAAc;CAAqB;CAChE,aAAa;AACf;;;;;AAMA,MAAM,uBAAuB;AAY7B,MAAMA,UAAAA,GAAOC,KAAAA,WAAAA,CAAAA,QAAAA,KAAAA,CAAAA,CAAAA,cAAAA,UAAAA,CAAAA,CAAAA,MAA4B,YAAY;;;;;;;;;;;;AAarD,eAAsB,WAAwB,UAAkB,SAAyC;CACvG,IAAI,CAAC,qBAAqB,KAAK,QAAQ,GACrC,OAAQ,SAAS,UAAUD,OAAK,OAAO,UAAU,EAAE,SAAS,KAAK,CAAC,IAAIA,OAAK,OAAO,QAAQ;CAM5F,MAAM,MAAO,MAAMA,OAAK,WAAW,OAAA,GAAME,iBAAAA,SAAAA,CAAS,UAAU,MAAM,GAAG;EAAE,UAAU;EAAU,OAAO;EAAM,gBAAgB;CAAK,CAAC;CAG9H,OAAQ,SAAS,UAAW,KAAK,WAAW,MAAO;AACrD;;;AC5CA,MAAM,YAAY,eAAuB,WAAW,YAAY,EAAE,SAAS,KAAK,CAAC;AAEjF,MAAM,cAAc;AAEpB,MAAM,eAAe;CAAC;CAAI;CAAY;AAAU,CAAC,CAAC,SAAS,WAAW,CAAC,GAAG,OAAO,GAAG,YAAY,KAAK,GAAG,SAAS,YAAY,QAAQ,CAAC;AACtI,M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AAO,OAAO,WAAW,aAAa,OAAO;EADpC,QAAQ;EAAY;EAAO;EAAO;CACI,CAAC,IAAI;CAGrE,OAAO;EACL,YAAY;EACZ,UAJkB,MAAM,QAAQ,QAAQ,IAAI,WAAW,CAAC,QAAQ,EAAA,CAI3C,KAAK,SAAS;GAEjC,OAAO;IADkB,GAAG;IAAM,SAAS,KAAK,WAAW,CAAC;GAChD;EACd,CAAC;CACH;AACF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//#region ../../internals/shared/src/constants.ts
|
|
2
|
+
const KUBB_CONFIG_FILENAME = "kubb.config.ts";
|
|
3
|
+
const KUBB_PACKAGE_NAME = "kubb";
|
|
4
|
+
const initDefaults = {
|
|
5
|
+
inputPath: "./openapi.yaml",
|
|
6
|
+
outputPath: "./src/gen",
|
|
7
|
+
plugins: ["plugin-ts"]
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
10
|
+
export { KUBB_PACKAGE_NAME as n, initDefaults as r, KUBB_CONFIG_FILENAME as t };
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=constants-Cii4HX64.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants-Cii4HX64.js","names":[],"sources":["../../../internals/shared/src/constants.ts"],"sourcesContent":["export type PluginOption = {\n value: string\n label: string\n hint?: string\n packageName: string\n importName: string\n category: 'types' | 'client' | 'framework' | 'validation' | 'testing' | 'mocks' | 'documentation' | 'ai'\n}\n\nexport const KUBB_CONFIG_FILENAME = 'kubb.config.ts' as const\n\n/** File extensions a Kubb config file may use. */\nexport const CONFIG_EXTENSIONS = ['.ts', '.mts', '.cts', '.js', '.mjs', '.cjs'] as const\n\nexport const KUBB_PACKAGE_NAME = 'kubb' as const\n\nexport const initDefaults = {\n inputPath: './openapi.yaml',\n outputPath: './src/gen',\n plugins: ['plugin-ts'],\n} as const\n\nexport const availablePlugins: Array<PluginOption> = [\n {\n value: 'plugin-ts',\n label: 'TypeScript',\n hint: 'Recommended',\n packageName: '@kubb/plugin-ts',\n importName: 'pluginTs',\n category: 'types',\n },\n {\n value: 'plugin-axios',\n label: 'Axios Client',\n packageName: '@kubb/plugin-axios',\n importName: 'pluginAxios',\n category: 'client',\n },\n {\n value: 'plugin-fetch',\n label: 'Fetch Client',\n packageName: '@kubb/plugin-fetch',\n importName: 'pluginFetch',\n category: 'client',\n },\n {\n value: 'plugin-react-query',\n label: 'React Query / TanStack Query',\n packageName: '@kubb/plugin-react-query',\n importName: 'pluginReactQuery',\n category: 'framework',\n },\n {\n value: 'plugin-vue-query',\n label: 'Vue Query',\n packageName: '@kubb/plugin-vue-query',\n importName: 'pluginVueQuery',\n category: 'framework',\n },\n {\n value: 'plugin-zod',\n label: 'Zod Schemas',\n packageName: '@kubb/plugin-zod',\n importName: 'pluginZod',\n category: 'validation',\n },\n {\n value: 'plugin-faker',\n label: 'Faker.js Mocks',\n packageName: '@kubb/plugin-faker',\n importName: 'pluginFaker',\n category: 'mocks',\n },\n {\n value: 'plugin-msw',\n label: 'MSW Handlers',\n packageName: '@kubb/plugin-msw',\n importName: 'pluginMsw',\n category: 'mocks',\n },\n {\n value: 'plugin-cypress',\n label: 'Cypress Tests',\n packageName: '@kubb/plugin-cypress',\n importName: 'pluginCypress',\n category: 'testing',\n },\n {\n value: 'plugin-mcp',\n label: 'MCP Server (AI / Model Context Protocol)',\n packageName: '@kubb/plugin-mcp',\n importName: 'pluginMcp',\n category: 'ai',\n },\n {\n value: 'plugin-redoc',\n label: 'ReDoc Documentation',\n packageName: '@kubb/plugin-redoc',\n importName: 'pluginRedoc',\n category: 'documentation',\n },\n]\n"],"mappings":";AASA,MAAa,uBAAuB;AAKpC,MAAa,oBAAoB;AAEjC,MAAa,eAAe;CAC1B,WAAW;CACX,YAAY;CACZ,SAAS,CAAC,WAAW;AACvB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//#region ../../internals/shared/src/constants.ts
|
|
2
|
+
const KUBB_CONFIG_FILENAME = "kubb.config.ts";
|
|
3
|
+
const KUBB_PACKAGE_NAME = "kubb";
|
|
4
|
+
const initDefaults = {
|
|
5
|
+
inputPath: "./openapi.yaml",
|
|
6
|
+
outputPath: "./src/gen",
|
|
7
|
+
plugins: ["plugin-ts"]
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
10
|
+
Object.defineProperty(exports, "KUBB_CONFIG_FILENAME", {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function() {
|
|
13
|
+
return KUBB_CONFIG_FILENAME;
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
Object.defineProperty(exports, "KUBB_PACKAGE_NAME", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function() {
|
|
19
|
+
return KUBB_PACKAGE_NAME;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
Object.defineProperty(exports, "initDefaults", {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
get: function() {
|
|
25
|
+
return initDefaults;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=constants-Df449N47.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants-Df449N47.cjs","names":[],"sources":["../../../internals/shared/src/constants.ts"],"sourcesContent":["export type PluginOption = {\n value: string\n label: string\n hint?: string\n packageName: string\n importName: string\n category: 'types' | 'client' | 'framework' | 'validation' | 'testing' | 'mocks' | 'documentation' | 'ai'\n}\n\nexport const KUBB_CONFIG_FILENAME = 'kubb.config.ts' as const\n\n/** File extensions a Kubb config file may use. */\nexport const CONFIG_EXTENSIONS = ['.ts', '.mts', '.cts', '.js', '.mjs', '.cjs'] as const\n\nexport const KUBB_PACKAGE_NAME = 'kubb' as const\n\nexport const initDefaults = {\n inputPath: './openapi.yaml',\n outputPath: './src/gen',\n plugins: ['plugin-ts'],\n} as const\n\nexport const availablePlugins: Array<PluginOption> = [\n {\n value: 'plugin-ts',\n label: 'TypeScript',\n hint: 'Recommended',\n packageName: '@kubb/plugin-ts',\n importName: 'pluginTs',\n category: 'types',\n },\n {\n value: 'plugin-axios',\n label: 'Axios Client',\n packageName: '@kubb/plugin-axios',\n importName: 'pluginAxios',\n category: 'client',\n },\n {\n value: 'plugin-fetch',\n label: 'Fetch Client',\n packageName: '@kubb/plugin-fetch',\n importName: 'pluginFetch',\n category: 'client',\n },\n {\n value: 'plugin-react-query',\n label: 'React Query / TanStack Query',\n packageName: '@kubb/plugin-react-query',\n importName: 'pluginReactQuery',\n category: 'framework',\n },\n {\n value: 'plugin-vue-query',\n label: 'Vue Query',\n packageName: '@kubb/plugin-vue-query',\n importName: 'pluginVueQuery',\n category: 'framework',\n },\n {\n value: 'plugin-zod',\n label: 'Zod Schemas',\n packageName: '@kubb/plugin-zod',\n importName: 'pluginZod',\n category: 'validation',\n },\n {\n value: 'plugin-faker',\n label: 'Faker.js Mocks',\n packageName: '@kubb/plugin-faker',\n importName: 'pluginFaker',\n category: 'mocks',\n },\n {\n value: 'plugin-msw',\n label: 'MSW Handlers',\n packageName: '@kubb/plugin-msw',\n importName: 'pluginMsw',\n category: 'mocks',\n },\n {\n value: 'plugin-cypress',\n label: 'Cypress Tests',\n packageName: '@kubb/plugin-cypress',\n importName: 'pluginCypress',\n category: 'testing',\n },\n {\n value: 'plugin-mcp',\n label: 'MCP Server (AI / Model Context Protocol)',\n packageName: '@kubb/plugin-mcp',\n importName: 'pluginMcp',\n category: 'ai',\n },\n {\n value: 'plugin-redoc',\n label: 'ReDoc Documentation',\n packageName: '@kubb/plugin-redoc',\n importName: 'pluginRedoc',\n category: 'documentation',\n },\n]\n"],"mappings":";AASA,MAAa,uBAAuB;AAKpC,MAAa,oBAAoB;AAEjC,MAAa,eAAe;CAC1B,WAAW;CACX,YAAY;CACZ,SAAS,CAAC,WAAW;AACvB"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_agent = require("./agent-DElUuYuy.cjs");
|
|
3
|
-
const require_Telemetry = require("./Telemetry-
|
|
3
|
+
const require_Telemetry = require("./Telemetry-BSuUeat7.cjs");
|
|
4
4
|
let node_util = require("node:util");
|
|
5
5
|
let _gunshi_plugin_dryrun = require("@gunshi/plugin-dryrun");
|
|
6
6
|
_gunshi_plugin_dryrun = require_agent.__toESM(_gunshi_plugin_dryrun, 1);
|
|
@@ -93,7 +93,7 @@ const command$13 = (0, gunshi.define)({
|
|
|
93
93
|
}
|
|
94
94
|
},
|
|
95
95
|
async run({ values }) {
|
|
96
|
-
const { run } = await Promise.resolve().then(() => require("./run-
|
|
96
|
+
const { run } = await Promise.resolve().then(() => require("./run-Ct6kzKpg.cjs"));
|
|
97
97
|
await run({
|
|
98
98
|
id: values.id,
|
|
99
99
|
configPath: values.config,
|
|
@@ -176,7 +176,7 @@ const command$12 = (0, gunshi.defineWithTypes)()({
|
|
|
176
176
|
async run(ctx) {
|
|
177
177
|
const { values } = ctx;
|
|
178
178
|
const logLevel = resolveLogLevel(values);
|
|
179
|
-
const { run } = await Promise.resolve().then(() => require("./run-
|
|
179
|
+
const { run } = await Promise.resolve().then(() => require("./run-BN1-GpZI.cjs"));
|
|
180
180
|
await run({
|
|
181
181
|
input: values.input,
|
|
182
182
|
configPath: values.config,
|
|
@@ -221,13 +221,13 @@ const command$11 = (0, gunshi.defineWithTypes)()({
|
|
|
221
221
|
},
|
|
222
222
|
plugins: {
|
|
223
223
|
type: "string",
|
|
224
|
-
description: "Comma-separated
|
|
224
|
+
description: "Comma-separated Kubb registry ids of the plugins to add, the same ids `kubb add` takes (plugin-ts, plugin-zod, acme/plugin-x)",
|
|
225
225
|
metavar: "plugin-ts,plugin-zod,..."
|
|
226
226
|
}
|
|
227
227
|
},
|
|
228
228
|
async run(ctx) {
|
|
229
229
|
const { values } = ctx;
|
|
230
|
-
const { run } = await Promise.resolve().then(() => require("./run-
|
|
230
|
+
const { run } = await Promise.resolve().then(() => require("./run-DL2wLwBZ.cjs"));
|
|
231
231
|
await run({
|
|
232
232
|
yes: values.yes,
|
|
233
233
|
version: require_Telemetry.version,
|
|
@@ -245,7 +245,7 @@ const command$10 = (0, gunshi.define)({
|
|
|
245
245
|
description: "List the installed Kubb extensions: their registry id, package, installed version, the version the Kubb registry pins, and whether an update exists.",
|
|
246
246
|
examples: "kubb list",
|
|
247
247
|
async run() {
|
|
248
|
-
const { run } = await Promise.resolve().then(() => require("./run-
|
|
248
|
+
const { run } = await Promise.resolve().then(() => require("./run-DpAMfkm5.cjs"));
|
|
249
249
|
await run();
|
|
250
250
|
}
|
|
251
251
|
});
|
|
@@ -260,8 +260,9 @@ const command$9 = (0, gunshi.define)({
|
|
|
260
260
|
"# Then add to your MCP client config:",
|
|
261
261
|
"# { \"mcpServers\": { \"kubb\": { \"command\": \"npx\", \"args\": [\"kubb\", \"mcp\"] } } }"
|
|
262
262
|
].join("\n"),
|
|
263
|
+
rendering: { header: null },
|
|
263
264
|
async run() {
|
|
264
|
-
const { run } = await Promise.resolve().then(() => require("./run-
|
|
265
|
+
const { run } = await Promise.resolve().then(() => require("./run-BOmuzVe1.cjs"));
|
|
265
266
|
await run();
|
|
266
267
|
}
|
|
267
268
|
});
|
|
@@ -290,7 +291,7 @@ const command$8 = (0, gunshi.define)({
|
|
|
290
291
|
...logLevelArg
|
|
291
292
|
},
|
|
292
293
|
async run(ctx) {
|
|
293
|
-
const { connectRunner } = await Promise.resolve().then(() => require("./commands-
|
|
294
|
+
const { connectRunner } = await Promise.resolve().then(() => require("./commands-wWv2IyJV.cjs"));
|
|
294
295
|
await connectRunner(ctx);
|
|
295
296
|
}
|
|
296
297
|
});
|
|
@@ -303,7 +304,7 @@ const command$7 = (0, gunshi.define)({
|
|
|
303
304
|
toKebab: true,
|
|
304
305
|
args: command$8.args,
|
|
305
306
|
async run(ctx) {
|
|
306
|
-
const { loginRunner } = await Promise.resolve().then(() => require("./commands-
|
|
307
|
+
const { loginRunner } = await Promise.resolve().then(() => require("./commands-wWv2IyJV.cjs"));
|
|
307
308
|
await loginRunner(ctx);
|
|
308
309
|
}
|
|
309
310
|
});
|
|
@@ -321,7 +322,7 @@ const command$6 = (0, gunshi.define)({
|
|
|
321
322
|
...logLevelArg
|
|
322
323
|
},
|
|
323
324
|
async run(ctx) {
|
|
324
|
-
const { logoutRunner } = await Promise.resolve().then(() => require("./commands-
|
|
325
|
+
const { logoutRunner } = await Promise.resolve().then(() => require("./commands-wWv2IyJV.cjs"));
|
|
325
326
|
await logoutRunner(ctx);
|
|
326
327
|
}
|
|
327
328
|
});
|
|
@@ -361,7 +362,7 @@ const command$5 = (0, gunshi.define)({
|
|
|
361
362
|
...logLevelArg
|
|
362
363
|
},
|
|
363
364
|
async run(ctx) {
|
|
364
|
-
const { runner } = await Promise.resolve().then(() => require("./snapshot-
|
|
365
|
+
const { runner } = await Promise.resolve().then(() => require("./snapshot-B27W-HME.cjs"));
|
|
365
366
|
await runner(ctx);
|
|
366
367
|
}
|
|
367
368
|
});
|
|
@@ -373,7 +374,7 @@ const command$4 = (0, gunshi.define)({
|
|
|
373
374
|
toKebab: true,
|
|
374
375
|
args: command$8.args,
|
|
375
376
|
async run(ctx) {
|
|
376
|
-
const { startRunner } = await Promise.resolve().then(() => require("./commands-
|
|
377
|
+
const { startRunner } = await Promise.resolve().then(() => require("./commands-wWv2IyJV.cjs"));
|
|
377
378
|
await startRunner(ctx);
|
|
378
379
|
}
|
|
379
380
|
});
|
|
@@ -381,7 +382,7 @@ const stopCommand = (0, gunshi.define)({
|
|
|
381
382
|
name: "stop",
|
|
382
383
|
description: "Stop this project's background connection and keep its pairing.",
|
|
383
384
|
async run() {
|
|
384
|
-
const { stopRunner } = await Promise.resolve().then(() => require("./commands-
|
|
385
|
+
const { stopRunner } = await Promise.resolve().then(() => require("./commands-wWv2IyJV.cjs"));
|
|
385
386
|
await stopRunner();
|
|
386
387
|
}
|
|
387
388
|
});
|
|
@@ -399,7 +400,7 @@ const command$3 = (0, gunshi.define)({
|
|
|
399
400
|
...logLevelArg
|
|
400
401
|
},
|
|
401
402
|
async run(ctx) {
|
|
402
|
-
const { statusRunner } = await Promise.resolve().then(() => require("./commands-
|
|
403
|
+
const { statusRunner } = await Promise.resolve().then(() => require("./commands-wWv2IyJV.cjs"));
|
|
403
404
|
await statusRunner(ctx);
|
|
404
405
|
}
|
|
405
406
|
});
|
|
@@ -419,7 +420,7 @@ const command$2 = (0, gunshi.define)({
|
|
|
419
420
|
toKebab: true,
|
|
420
421
|
args: command$8.args,
|
|
421
422
|
async run(ctx) {
|
|
422
|
-
const { connectRunner } = await Promise.resolve().then(() => require("./commands-
|
|
423
|
+
const { connectRunner } = await Promise.resolve().then(() => require("./commands-wWv2IyJV.cjs"));
|
|
423
424
|
await connectRunner(ctx);
|
|
424
425
|
},
|
|
425
426
|
subCommands: {
|
|
@@ -469,7 +470,7 @@ const command$1 = (0, gunshi.define)({
|
|
|
469
470
|
...yesArg
|
|
470
471
|
},
|
|
471
472
|
async run({ values }) {
|
|
472
|
-
const { run } = await Promise.resolve().then(() => require("./run-
|
|
473
|
+
const { run } = await Promise.resolve().then(() => require("./run-89YfZJuo.cjs"));
|
|
473
474
|
await run({
|
|
474
475
|
ids: values.ids ?? [],
|
|
475
476
|
check: values.check,
|
|
@@ -490,7 +491,7 @@ const command = (0, gunshi.define)({
|
|
|
490
491
|
required: true
|
|
491
492
|
} },
|
|
492
493
|
async run({ values }) {
|
|
493
|
-
const { run } = await Promise.resolve().then(() => require("./run-
|
|
494
|
+
const { run } = await Promise.resolve().then(() => require("./run-Dm7nOUUF.cjs"));
|
|
494
495
|
await run({ input: values.input });
|
|
495
496
|
}
|
|
496
497
|
});
|
|
@@ -535,20 +536,11 @@ const QUIET_FLAGS = /* @__PURE__ */ new Set([
|
|
|
535
536
|
"--json"
|
|
536
537
|
]);
|
|
537
538
|
/**
|
|
538
|
-
* Strips the leading executable + script entries when `process.argv` is passed directly.
|
|
539
|
-
* Handles Node.js (`/usr/bin/node`), Bun (`/usr/local/bin/bun`), Deno, tsx, etc. All runtime
|
|
540
|
-
* executable paths contain a path separator; bare command names do not.
|
|
541
|
-
*/
|
|
542
|
-
function stripExecArgs(argv) {
|
|
543
|
-
const firstArgIsExecutablePath = (argv[0]?.includes("/") || argv[0]?.includes("\\")) ?? false;
|
|
544
|
-
return argv.length >= 2 && firstArgIsExecutablePath ? argv.slice(2) : argv;
|
|
545
|
-
}
|
|
546
|
-
/**
|
|
547
539
|
* Entry point for the `kubb` CLI. Prints the telemetry notice unless telemetry is disabled or a
|
|
548
540
|
* quiet flag is passed, then runs the given command, or `generate` when none is given.
|
|
549
541
|
*/
|
|
550
|
-
async function run(argv = process.argv) {
|
|
551
|
-
const args = routeStudioFlags(resolveDeprecatedFlags(
|
|
542
|
+
async function run(argv = process.argv.slice(2)) {
|
|
543
|
+
const args = routeStudioFlags(resolveDeprecatedFlags(argv));
|
|
552
544
|
const isQuietFlag = args.some((arg) => QUIET_FLAGS.has(arg));
|
|
553
545
|
if (!require_Telemetry.isDisabled() && !isQuietFlag) console.error(`${(0, node_util.styleText)("yellow", "Notice:")} Kubb collects anonymous telemetry data to help improve the tool. No personal data or file contents are collected. \nTo disable, set ${(0, node_util.styleText)("cyan", "KUBB_DISABLE_TELEMETRY=1")}.\n`);
|
|
554
546
|
await (0, gunshi.cli)(args, command$12, {
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["command","define","command","defineWithTypes","dryRunId","command","defineWithTypes","dryRunId","command","define","command","define","command","define","command","define","connectCommand","command","define","command","define","command","define","connectCommand","command","define","command","define","connectCommand","startCommand","loginCommand","logoutCommand","statusCommand","snapshotCommand","command","define","define","styleText","isTelemetryDisabled","styleText","cli","generateCommand","initCommand","validateCommand","mcpCommand","studioCommand","addCommand","updateCommand","listCommand","dryrun"],"sources":["../src/commands/shared.ts","../src/commands/add.ts","../src/commands/generate.ts","../src/commands/init.ts","../src/commands/list.ts","../src/commands/mcp.ts","../src/commands/studio/connect.ts","../src/commands/studio/login.ts","../src/commands/studio/logout.ts","../src/commands/studio/snapshot.ts","../src/commands/studio/background.ts","../src/commands/studio/status.ts","../src/commands/studio/index.ts","../src/commands/update.ts","../src/commands/validate.ts","../src/deprecatedFlags.ts","../src/index.ts"],"sourcesContent":["import { pluginId as dryRunId } from '@gunshi/plugin-dryrun'\nimport type { DryRunExtension } from '@gunshi/plugin-dryrun'\n\nexport { dryRunId }\n\n/** Extension shape gunshi's command context carries with `@gunshi/plugin-dryrun`; the `extensions` type parameter of `defineWithTypes`. */\nexport type DryRunExtensions = {\n [dryRunId]: DryRunExtension\n}\n\nexport const configArg = {\n config: {\n type: 'string',\n description: 'Path to the Kubb config',\n short: 'c',\n },\n} as const\n\nexport const yesArg = {\n yes: {\n type: 'boolean',\n description: 'Skip the confirmation',\n short: 'y',\n default: false,\n },\n} as const\n\nexport const logLevelArg = {\n logLevel: {\n type: 'enum',\n choices: ['silent', 'info', 'verbose'] as const,\n description: 'Info, silent or verbose',\n short: 'l',\n default: 'info',\n toKebab: true,\n },\n} as const\n\nexport const studioConnectionArgs = {\n url: {\n type: 'string',\n description: 'Base URL of the Kubb Studio instance',\n },\n token: {\n type: 'string',\n description: 'Organization CI API key for `snapshot`. Defaults to KUBB_TOKEN',\n },\n} as const\n\nexport const studioPermissionArgs = {\n allowRead: {\n type: 'boolean',\n description: 'Read the source of files a generation produced. Asked for once per project when omitted',\n default: false,\n toKebab: true,\n },\n allowWrite: {\n type: 'boolean',\n description: 'Write generated files to disk. Asked for once per project when omitted',\n default: false,\n toKebab: true,\n },\n allowConfigEdit: {\n type: 'boolean',\n description: 'Let Studio change plugin options in kubb.config.ts. Asked for once per project when omitted',\n default: false,\n toKebab: true,\n },\n allowExec: {\n type: 'boolean',\n description: 'Run the formatter, the linter, and output.postGenerate after a generation',\n default: false,\n toKebab: true,\n },\n} as const\n","import { define } from 'gunshi'\nimport { configArg, yesArg } from './shared.ts'\n\nexport const command = define({\n name: 'add',\n description:\n 'Install a plugin, adapter, or parser from the Kubb registry at its reviewed version. A plugin is added to kubb.config.ts, an adapter or parser prints the code to add. Reads KUBB_REGISTRY to use another registry.',\n examples: ['kubb add plugin-zod', 'kubb add kubb-labs/plugin-react-query', 'kubb add acme/plugin-x --yes', 'kubb add plugin-zod --no-install'].join('\\n'),\n toKebab: true,\n args: {\n id: {\n type: 'positional',\n description: 'Registry id: owner/slug, or a slug for an official extension',\n required: true,\n },\n ...configArg,\n ...yesArg,\n install: {\n type: 'boolean',\n description: 'Install the package. Pass --no-install to only edit the config',\n negatable: true,\n default: true,\n },\n },\n async run({ values }) {\n const { run } = await import('../runners/add/run.ts')\n await run({ id: values.id, configPath: values.config, yes: values.yes, install: values.install })\n },\n})\n","import { defineWithTypes } from 'gunshi'\nimport type { ReporterName } from '@kubb/core'\nimport { configArg, dryRunId, type DryRunExtensions, logLevelArg } from './shared.ts'\n\nconst REPORTER_NAMES: Array<ReporterName> = ['cli', 'json', 'file', 'html']\n\n/**\n * Splits and validates the comma-separated `--reporter` value against the known reporter names.\n */\nfunction parseReporters(value: string): Array<ReporterName> {\n const names = value\n .split(',')\n .map((name) => name.trim())\n .filter(Boolean)\n\n for (const name of names) {\n if (!REPORTER_NAMES.includes(name as ReporterName)) {\n throw new Error(`must be one of cli, json, file, html (got \"${name}\")`)\n }\n }\n\n return names as Array<ReporterName>\n}\n\n/**\n * Resolves the effective log level, letting the `--verbose` and `--silent` flags win over `--log-level`.\n */\nfunction resolveLogLevel({ verbose, silent, logLevel }: { verbose: boolean; silent: boolean; logLevel: string }): string {\n if (verbose) return 'verbose'\n if (silent) return 'silent'\n return logLevel\n}\n\nexport const command = defineWithTypes<{ extensions: DryRunExtensions }>()({\n name: 'generate',\n description:\n 'Generate TypeScript types, API clients, React Query hooks, Zod schemas, and more from an OpenAPI specification. Reads kubb.config.ts by default. Pass an OpenAPI file path as the first argument to override the input without editing the config.',\n examples: [\n 'kubb generate # generate from kubb.config.ts',\n 'kubb generate ./openapi.yaml # generate from this spec instead of the config input',\n 'kubb generate --config kubb.config.ts',\n 'kubb generate --watch # regenerate whenever the spec changes',\n 'kubb generate --dry-run # preview the run without writing files',\n 'kubb generate --reporter html # write an HTML run report',\n 'kubb studio # connect this project to Kubb Studio and generate from the browser',\n 'kubb studio --allow-write # let Studio write the generated files to disk',\n 'kubb studio login # pair this machine with Studio without connecting',\n ].join('\\n'),\n toKebab: true,\n args: {\n input: {\n type: 'positional',\n required: false,\n description: 'Path to the OpenAPI specification, overriding the config',\n },\n ...configArg,\n ...logLevelArg,\n watch: {\n type: 'boolean',\n description: 'Watch mode: watches an input file for changes, or polls an input URL',\n short: 'w',\n default: false,\n },\n verbose: {\n type: 'boolean',\n description: 'Override logLevel to verbose',\n default: false,\n },\n silent: {\n type: 'boolean',\n description: 'Override logLevel to silent',\n short: 's',\n default: false,\n },\n reporter: {\n type: 'custom',\n description: 'Reporters that render the run: cli, json, file, html. Comma-separated. Overrides config.reporters',\n metavar: 'cli|json|file|html',\n parse: parseReporters,\n },\n },\n async run(ctx) {\n const { values } = ctx\n const logLevel = resolveLogLevel(values)\n const { run } = await import('../runners/generate/run.ts')\n\n await run({\n input: values.input,\n configPath: values.config,\n logLevel,\n watch: values.watch,\n reporters: values.reporter,\n dryRun: ctx.extensions[dryRunId].enabled,\n })\n },\n})\n","import { defineWithTypes } from 'gunshi'\nimport { dryRunId, type DryRunExtensions } from './shared.ts'\nimport { version } from '../../package.json'\n\nexport const command = defineWithTypes<{ extensions: DryRunExtensions }>()({\n name: 'init',\n description:\n 'Scaffold a kubb.config.ts and install plugins for code generation from an OpenAPI spec. Run without flags for interactive setup, or pass --input, --output, and --plugins to skip the prompts.',\n examples: [\n 'kubb init',\n 'kubb init --yes',\n 'kubb init --input ./openapi.yaml --output ./src/gen --plugins plugin-ts,plugin-zod',\n 'kubb init --plugins plugin-ts,plugin-axios,plugin-react-query',\n 'kubb init --yes --dry-run',\n ].join('\\n'),\n toKebab: true,\n args: {\n yes: {\n type: 'boolean',\n description: 'Skip prompts and use default options',\n short: 'y',\n default: false,\n },\n input: {\n type: 'string',\n description: 'Path to the OpenAPI specification',\n short: 'i',\n metavar: 'path',\n },\n output: {\n type: 'string',\n description: 'Output directory for generated files',\n short: 'o',\n metavar: 'path',\n },\n plugins: {\n type: 'string',\n description:\n 'Comma-separated list of plugins to use (plugin-ts, plugin-axios, plugin-fetch, plugin-react-query, plugin-vue-query, plugin-zod, plugin-faker, plugin-msw, plugin-cypress, plugin-mcp, plugin-redoc)',\n metavar: 'plugin-ts,plugin-zod,...',\n },\n },\n async run(ctx) {\n const { values } = ctx\n const { run } = await import('../runners/init/run.ts')\n\n await run({\n yes: values.yes,\n version,\n input: values.input,\n output: values.output,\n plugins: values.plugins,\n dryRun: ctx.extensions[dryRunId],\n })\n },\n})\n","import { define } from 'gunshi'\n\nexport const command = define({\n name: 'list',\n description:\n 'List the installed Kubb extensions: their registry id, package, installed version, the version the Kubb registry pins, and whether an update exists.',\n examples: 'kubb list',\n async run() {\n const { run } = await import('../runners/list/run.ts')\n await run()\n },\n})\n","import { define } from 'gunshi'\n\n/** The runner is imported when the command runs, so listing `kubb --help` never loads `@kubb/mcp`. */\nexport const command = define({\n name: 'mcp',\n description:\n 'Start a Model Context Protocol (MCP) server that exposes Kubb code generation as tools for AI assistants. Once running, configure your AI client (Claude, Cursor, Windsurf, etc.) to connect to it — the assistant can then call kubb generate directly without leaving the chat.',\n examples: ['kubb mcp', '# Then add to your MCP client config:', '# { \"mcpServers\": { \"kubb\": { \"command\": \"npx\", \"args\": [\"kubb\", \"mcp\"] } } }'].join('\\n'),\n async run() {\n const { run } = await import('../runners/mcp/run.ts')\n await run()\n },\n})\n","import { define } from 'gunshi'\nimport { configArg, logLevelArg, studioConnectionArgs, studioPermissionArgs } from '../shared.ts'\n\nexport const command = define({\n name: 'connect',\n description: 'Connect this project to Kubb Studio and generate from the browser.',\n examples: [\n 'kubb studio connect',\n 'kubb studio connect --allow-read',\n 'kubb studio connect --allow-write --allow-exec',\n 'kubb studio connect --url http://localhost:3000',\n ].join('\\n'),\n toKebab: true,\n args: {\n ...configArg,\n ...studioConnectionArgs,\n ...studioPermissionArgs,\n open: {\n type: 'boolean',\n description: 'Open the approval page in a browser while pairing',\n default: true,\n negatable: true,\n },\n ...logLevelArg,\n },\n async run(ctx) {\n const { connectRunner } = await import('../../runners/studio/commands.ts')\n await connectRunner(ctx)\n },\n})\n","import { define } from 'gunshi'\nimport { command as connectCommand } from './connect.ts'\n\nexport const command = define({\n name: 'login',\n description: 'Pair this machine with Kubb Studio without connecting.',\n examples: ['kubb studio login', 'kubb studio login --url http://localhost:3000'].join('\\n'),\n toKebab: true,\n args: connectCommand.args,\n async run(ctx) {\n const { loginRunner } = await import('../../runners/studio/commands.ts')\n await loginRunner(ctx)\n },\n})\n","import { define } from 'gunshi'\nimport { configArg, logLevelArg, studioConnectionArgs, studioPermissionArgs } from '../shared.ts'\n\nexport const command = define({\n name: 'logout',\n description: 'Forget the stored Kubb Studio token.',\n examples: ['kubb studio logout'].join('\\n'),\n toKebab: true,\n args: {\n ...configArg,\n ...studioConnectionArgs,\n ...studioPermissionArgs,\n ...logLevelArg,\n },\n async run(ctx) {\n const { logoutRunner } = await import('../../runners/studio/commands.ts')\n await logoutRunner(ctx)\n },\n})\n","import { define } from 'gunshi'\nimport { configArg, logLevelArg, studioConnectionArgs } from '../shared.ts'\n\nexport const command = define({\n name: 'snapshot',\n description: 'Generate and publish a Kubb Studio snapshot from CI.',\n examples: ['kubb studio snapshot', 'kubb studio snapshot --json'].join('\\n'),\n toKebab: true,\n args: {\n ...configArg,\n ...studioConnectionArgs,\n id: {\n type: 'string',\n description: 'Stable identity for the CI agent, such as a pull request. Auto-detected on GitHub Actions, GitLab CI, Bitbucket Pipelines and CircleCI',\n },\n baseId: {\n type: 'string',\n description:\n \"Identity of another CI agent, such as the base branch's, to also compare this snapshot with. Auto-detected on GitHub pull requests and GitLab merge requests\",\n toKebab: true,\n },\n name: {\n type: 'string',\n description: 'Package name for the generated tarball. Defaults to the name in package.json',\n },\n packageVersion: {\n type: 'string',\n description: 'Package version for the generated tarball. Defaults to the version in package.json',\n toKebab: true,\n },\n json: {\n type: 'boolean',\n description: 'Print the result as one JSON object instead of a summary',\n default: false,\n },\n ...logLevelArg,\n },\n async run(ctx) {\n const { runner } = await import('../../runners/studio/snapshot.ts')\n await runner(ctx)\n },\n})\n","import { define } from 'gunshi'\nimport { command as connectCommand } from './connect.ts'\n\nexport const command = define({\n name: 'start',\n description: 'Keep this project connected to Kubb Studio in the background.',\n toKebab: true,\n args: connectCommand.args,\n async run(ctx) {\n const { startRunner } = await import('../../runners/studio/commands.ts')\n await startRunner(ctx)\n },\n})\n\nexport const stopCommand = define({\n name: 'stop',\n description: \"Stop this project's background connection and keep its pairing.\",\n async run() {\n const { stopRunner } = await import('../../runners/studio/commands.ts')\n await stopRunner()\n },\n})\n","import { define } from 'gunshi'\nimport { configArg, logLevelArg, studioConnectionArgs, studioPermissionArgs } from '../shared.ts'\n\nexport const command = define({\n name: 'status',\n description: 'Show the project worker, Kubb Studio pairing, and saved permissions.',\n examples: ['kubb studio status'].join('\\n'),\n toKebab: true,\n args: {\n ...configArg,\n ...studioConnectionArgs,\n ...studioPermissionArgs,\n ...logLevelArg,\n },\n async run(ctx) {\n const { statusRunner } = await import('../../runners/studio/commands.ts')\n await statusRunner(ctx)\n },\n})\n","import { define } from 'gunshi'\nimport { command as connectCommand } from './connect.ts'\nimport { command as loginCommand } from './login.ts'\nimport { command as logoutCommand } from './logout.ts'\nimport { command as snapshotCommand } from './snapshot.ts'\nimport { command as startCommand, stopCommand } from './background.ts'\nimport { command as statusCommand } from './status.ts'\n\nexport const command = define({\n name: 'studio',\n description: 'Connect this project to Kubb Studio, or manage its pairing and snapshots.',\n examples: ['kubb studio', 'kubb studio --allow-read', 'kubb studio login', 'kubb studio status', 'kubb studio logout', 'kubb studio snapshot'].join('\\n'),\n toKebab: true,\n args: connectCommand.args,\n async run(ctx) {\n const { connectRunner } = await import('../../runners/studio/commands.ts')\n await connectRunner(ctx)\n },\n subCommands: {\n start: startCommand,\n stop: stopCommand,\n connect: connectCommand,\n login: loginCommand,\n logout: logoutCommand,\n status: statusCommand,\n snapshot: snapshotCommand,\n },\n})\n\n/**\n * Sends `kubb studio --flag value` to `kubb studio connect`, the same runner. gunshi picks a\n * subcommand from the first token that is not a flag, so `--url http://…` would read the URL as one.\n */\nexport function routeStudioFlags(args: Array<string>): Array<string> {\n const [name, next] = args\n if (name !== 'studio' || !next?.startsWith('-') || next === '--help' || next === '-h') return args\n\n return ['studio', 'connect', ...args.slice(1)]\n}\n","import { define } from 'gunshi'\nimport { yesArg } from './shared.ts'\n\nexport const command = define({\n name: 'update',\n description:\n 'Update installed extensions to the version the Kubb registry pins. Pass ids to update only those, or --check to list the updates without installing.',\n examples: ['kubb update', 'kubb update --check', 'kubb update plugin-zod plugin-ts --yes'].join('\\n'),\n args: {\n ids: {\n type: 'positional',\n description: 'Registry ids to update, all installed extensions when omitted',\n multiple: true,\n },\n check: {\n type: 'boolean',\n description: 'List the available updates without installing them',\n default: false,\n },\n ...yesArg,\n },\n async run({ values }) {\n const { run } = await import('../runners/update/run.ts')\n await run({ ids: values.ids ?? [], check: values.check, yes: values.yes })\n },\n})\n","import { define } from 'gunshi'\n\n/** The runner is imported when the command runs, so listing `kubb --help` never loads `@kubb/adapter-oas`. */\nexport const command = define({\n name: 'validate',\n description:\n 'Parse and validate an OpenAPI/Swagger file for structural correctness. Reports schema errors, missing required fields, and malformed references. Use this before running generate to catch spec issues early.',\n examples: ['kubb validate ./openapi.yaml', 'kubb validate https://petstore3.swagger.io/api/v3/openapi.json'].join('\\n'),\n args: {\n input: {\n type: 'positional',\n description: 'Path or URL to the OpenAPI/Swagger file to validate',\n required: true,\n },\n },\n async run({ values }) {\n const { run } = await import('../runners/validate/run.ts')\n await run({ input: values.input })\n },\n})\n","import { styleText } from 'node:util'\n\n/**\n * Maps each camelCase flag removed in favor of kebab-case (kubb-labs/kubb#4046) to its\n * replacement. Drop this table, and the rewrite it drives, once the deprecation window ends.\n */\nconst DEPRECATED_FLAGS: Record<string, string> = {\n allowWrite: 'allow-write',\n allowConfigEdit: 'allow-config-edit',\n allowExec: 'allow-exec',\n logLevel: 'log-level',\n dryRun: 'dry-run',\n packageVersion: 'package-version',\n}\n\nconst FLAG_PATTERN = /^--([a-zA-Z][\\w-]*)(=.*)?$/\n\n/**\n * Rewrites a deprecated camelCase flag to its kebab-case replacement and warns on stderr, so a\n * script written against the old flag names keeps working during the deprecation window instead\n * of failing with an unknown-option error.\n */\nexport function resolveDeprecatedFlags(args: Array<string>): Array<string> {\n return args.map((arg) => {\n const match = FLAG_PATTERN.exec(arg)\n const name = match?.[1]\n const replacement = name ? DEPRECATED_FLAGS[name] : undefined\n\n if (!name || !replacement) {\n return arg\n }\n\n console.error(\n `${styleText('yellow', 'Warning:')} --${name} is deprecated, use --${replacement} instead. --${name} will be removed in a future major version.`,\n )\n\n return `--${replacement}${match?.[2] ?? ''}`\n })\n}\n","import { styleText } from 'node:util'\nimport dryrun from '@gunshi/plugin-dryrun'\nimport { cli } from 'gunshi'\nimport { isDisabled as isTelemetryDisabled } from './Telemetry.ts'\nimport { version } from '../package.json'\nimport { command as addCommand } from './commands/add.ts'\nimport { command as generateCommand } from './commands/generate.ts'\nimport { command as initCommand } from './commands/init.ts'\nimport { command as listCommand } from './commands/list.ts'\nimport { command as mcpCommand } from './commands/mcp.ts'\nimport { command as studioCommand, routeStudioFlags } from './commands/studio/index.ts'\nimport { command as updateCommand } from './commands/update.ts'\nimport { command as validateCommand } from './commands/validate.ts'\nimport { resolveDeprecatedFlags } from './deprecatedFlags.ts'\n\n/** Flags that short-circuit execution (help and version). The telemetry notice is suppressed for these. */\nconst QUIET_FLAGS = new Set<string>(['--help', '-h', '--version', '-v', '--json'])\n\n/**\n * Strips the leading executable + script entries when `process.argv` is passed directly.\n * Handles Node.js (`/usr/bin/node`), Bun (`/usr/local/bin/bun`), Deno, tsx, etc. All runtime\n * executable paths contain a path separator; bare command names do not.\n */\nfunction stripExecArgs(argv: Array<string>): Array<string> {\n const firstArgIsExecutablePath = (argv[0]?.includes('/') || argv[0]?.includes('\\\\')) ?? false\n return argv.length >= 2 && firstArgIsExecutablePath ? argv.slice(2) : argv\n}\n\n/**\n * Entry point for the `kubb` CLI. Prints the telemetry notice unless telemetry is disabled or a\n * quiet flag is passed, then runs the given command, or `generate` when none is given.\n */\nexport async function run(argv: Array<string> = process.argv): Promise<void> {\n const args = routeStudioFlags(resolveDeprecatedFlags(stripExecArgs(argv)))\n const isQuietFlag = args.some((arg) => QUIET_FLAGS.has(arg))\n\n // stderr, so the notice never lands in a stream a client parses, such as `kubb mcp` stdio.\n if (!isTelemetryDisabled() && !isQuietFlag) {\n console.error(\n `${styleText('yellow', 'Notice:')} Kubb collects anonymous telemetry data to help improve the tool. No personal data or file contents are collected. \\nTo disable, set ${styleText('cyan', 'KUBB_DISABLE_TELEMETRY=1')}.\\n`,\n )\n }\n\n // Each command's `run` imports its runner, so an optional peer (@kubb/adapter-oas, @kubb/mcp, @kubb/studio) loads only when it runs.\n await cli(args, generateCommand, {\n name: 'kubb',\n version,\n // Not `generateCommand.description`: gunshi prints this on every subcommand's help too, so\n // `kubb studio --help` would open with a paragraph about generating types.\n description: 'Generate code from an OpenAPI specification, manage Kubb extensions, or connect the project to Kubb Studio.',\n subCommands: {\n generate: generateCommand,\n init: initCommand,\n validate: validateCommand,\n mcp: mcpCommand,\n studio: studioCommand,\n add: addCommand,\n update: updateCommand,\n list: listCommand,\n },\n fallbackToEntry: true,\n strict: true,\n plugins: [dryrun({ name: 'dry-run' })],\n onErrorCommand: async (_ctx, error) => {\n process.exitCode = 1\n console.error(error)\n },\n })\n}\n"],"mappings":";;;;;;;;AAUA,MAAa,YAAY,EACvB,QAAQ;CACN,MAAM;CACN,aAAa;CACb,OAAO;AACT,EACF;AAEA,MAAa,SAAS,EACpB,KAAK;CACH,MAAM;CACN,aAAa;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AC/B,MAAM;EACN,SAAA,kBAAA;EAGA,aAAa;EACb,aAAa;GACX,UAAUA;GACV,MAAMC;GACN,UAAUC;GACV,KAAKC;GACL,QAAQC;GACR,KAAKC;GACL,QAAQC;GACR,MAAMC;EACR;EACA,iBAAiB;EACjB,QAAQ;EACR,SAAS,EAAA,GAACC,sBAAAA,QAAAA,CAAO,EAAE,MAAM,UAAU,CAAC,CAAC;EACrC,gBAAgB,OAAO,MAAM,UAAU;GACrC,QAAQ,WAAW;GACnB,QAAQ,MAAM,KAAK;EACrB;CACF,CAAC;AACH"}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["command","define","command","defineWithTypes","dryRunId","command","defineWithTypes","dryRunId","command","define","command","define","command","define","command","define","connectCommand","command","define","command","define","command","define","connectCommand","command","define","command","define","connectCommand","startCommand","loginCommand","logoutCommand","statusCommand","snapshotCommand","command","define","define","styleText","isTelemetryDisabled","styleText","cli","generateCommand","initCommand","validateCommand","mcpCommand","studioCommand","addCommand","updateCommand","listCommand","dryrun"],"sources":["../src/commands/shared.ts","../src/commands/add.ts","../src/commands/generate.ts","../src/commands/init.ts","../src/commands/list.ts","../src/commands/mcp.ts","../src/commands/studio/connect.ts","../src/commands/studio/login.ts","../src/commands/studio/logout.ts","../src/commands/studio/snapshot.ts","../src/commands/studio/background.ts","../src/commands/studio/status.ts","../src/commands/studio/index.ts","../src/commands/update.ts","../src/commands/validate.ts","../src/deprecatedFlags.ts","../src/index.ts"],"sourcesContent":["import { pluginId as dryRunId } from '@gunshi/plugin-dryrun'\nimport type { DryRunExtension } from '@gunshi/plugin-dryrun'\n\nexport { dryRunId }\n\n/** Extension shape gunshi's command context carries with `@gunshi/plugin-dryrun`; the `extensions` type parameter of `defineWithTypes`. */\nexport type DryRunExtensions = {\n [dryRunId]: DryRunExtension\n}\n\nexport const configArg = {\n config: {\n type: 'string',\n description: 'Path to the Kubb config',\n short: 'c',\n },\n} as const\n\nexport const yesArg = {\n yes: {\n type: 'boolean',\n description: 'Skip the confirmation',\n short: 'y',\n default: false,\n },\n} as const\n\nexport const logLevelArg = {\n logLevel: {\n type: 'enum',\n choices: ['silent', 'info', 'verbose'] as const,\n description: 'Info, silent or verbose',\n short: 'l',\n default: 'info',\n toKebab: true,\n },\n} as const\n\nexport const studioConnectionArgs = {\n url: {\n type: 'string',\n description: 'Base URL of the Kubb Studio instance',\n },\n token: {\n type: 'string',\n description: 'Organization CI API key for `snapshot`. Defaults to KUBB_TOKEN',\n },\n} as const\n\nexport const studioPermissionArgs = {\n allowRead: {\n type: 'boolean',\n description: 'Read the source of files a generation produced. Asked for once per project when omitted',\n default: false,\n toKebab: true,\n },\n allowWrite: {\n type: 'boolean',\n description: 'Write generated files to disk. Asked for once per project when omitted',\n default: false,\n toKebab: true,\n },\n allowConfigEdit: {\n type: 'boolean',\n description: 'Let Studio change plugin options in kubb.config.ts. Asked for once per project when omitted',\n default: false,\n toKebab: true,\n },\n allowExec: {\n type: 'boolean',\n description: 'Run the formatter, the linter, and output.postGenerate after a generation',\n default: false,\n toKebab: true,\n },\n} as const\n","import { define } from 'gunshi'\nimport { configArg, yesArg } from './shared.ts'\n\nexport const command = define({\n name: 'add',\n description:\n 'Install a plugin, adapter, or parser from the Kubb registry at its reviewed version. A plugin is added to kubb.config.ts, an adapter or parser prints the code to add. Reads KUBB_REGISTRY to use another registry.',\n examples: ['kubb add plugin-zod', 'kubb add kubb-labs/plugin-react-query', 'kubb add acme/plugin-x --yes', 'kubb add plugin-zod --no-install'].join('\\n'),\n toKebab: true,\n args: {\n id: {\n type: 'positional',\n description: 'Registry id: owner/slug, or a slug for an official extension',\n required: true,\n },\n ...configArg,\n ...yesArg,\n install: {\n type: 'boolean',\n description: 'Install the package. Pass --no-install to only edit the config',\n negatable: true,\n default: true,\n },\n },\n async run({ values }) {\n const { run } = await import('../runners/add/run.ts')\n await run({ id: values.id, configPath: values.config, yes: values.yes, install: values.install })\n },\n})\n","import { defineWithTypes } from 'gunshi'\nimport type { ReporterName } from '@kubb/core'\nimport { configArg, dryRunId, type DryRunExtensions, logLevelArg } from './shared.ts'\n\nconst REPORTER_NAMES: Array<ReporterName> = ['cli', 'json', 'file', 'html']\n\n/**\n * Splits and validates the comma-separated `--reporter` value against the known reporter names.\n */\nfunction parseReporters(value: string): Array<ReporterName> {\n const names = value\n .split(',')\n .map((name) => name.trim())\n .filter(Boolean)\n\n for (const name of names) {\n if (!REPORTER_NAMES.includes(name as ReporterName)) {\n throw new Error(`must be one of cli, json, file, html (got \"${name}\")`)\n }\n }\n\n return names as Array<ReporterName>\n}\n\n/**\n * Resolves the effective log level, letting the `--verbose` and `--silent` flags win over `--log-level`.\n */\nfunction resolveLogLevel({ verbose, silent, logLevel }: { verbose: boolean; silent: boolean; logLevel: string }): string {\n if (verbose) return 'verbose'\n if (silent) return 'silent'\n return logLevel\n}\n\nexport const command = defineWithTypes<{ extensions: DryRunExtensions }>()({\n name: 'generate',\n description:\n 'Generate TypeScript types, API clients, React Query hooks, Zod schemas, and more from an OpenAPI specification. Reads kubb.config.ts by default. Pass an OpenAPI file path as the first argument to override the input without editing the config.',\n examples: [\n 'kubb generate # generate from kubb.config.ts',\n 'kubb generate ./openapi.yaml # generate from this spec instead of the config input',\n 'kubb generate --config kubb.config.ts',\n 'kubb generate --watch # regenerate whenever the spec changes',\n 'kubb generate --dry-run # preview the run without writing files',\n 'kubb generate --reporter html # write an HTML run report',\n 'kubb studio # connect this project to Kubb Studio and generate from the browser',\n 'kubb studio --allow-write # let Studio write the generated files to disk',\n 'kubb studio login # pair this machine with Studio without connecting',\n ].join('\\n'),\n toKebab: true,\n args: {\n input: {\n type: 'positional',\n required: false,\n description: 'Path to the OpenAPI specification, overriding the config',\n },\n ...configArg,\n ...logLevelArg,\n watch: {\n type: 'boolean',\n description: 'Watch mode: watches an input file for changes, or polls an input URL',\n short: 'w',\n default: false,\n },\n verbose: {\n type: 'boolean',\n description: 'Override logLevel to verbose',\n default: false,\n },\n silent: {\n type: 'boolean',\n description: 'Override logLevel to silent',\n short: 's',\n default: false,\n },\n reporter: {\n type: 'custom',\n description: 'Reporters that render the run: cli, json, file, html. Comma-separated. Overrides config.reporters',\n metavar: 'cli|json|file|html',\n parse: parseReporters,\n },\n },\n async run(ctx) {\n const { values } = ctx\n const logLevel = resolveLogLevel(values)\n const { run } = await import('../runners/generate/run.ts')\n\n await run({\n input: values.input,\n configPath: values.config,\n logLevel,\n watch: values.watch,\n reporters: values.reporter,\n dryRun: ctx.extensions[dryRunId].enabled,\n })\n },\n})\n","import { defineWithTypes } from 'gunshi'\nimport { dryRunId, type DryRunExtensions } from './shared.ts'\nimport { version } from '../../package.json'\n\nexport const command = defineWithTypes<{ extensions: DryRunExtensions }>()({\n name: 'init',\n description:\n 'Scaffold a kubb.config.ts and install plugins for code generation from an OpenAPI spec. Run without flags for interactive setup, or pass --input, --output, and --plugins to skip the prompts.',\n examples: [\n 'kubb init',\n 'kubb init --yes',\n 'kubb init --input ./openapi.yaml --output ./src/gen --plugins plugin-ts,plugin-zod',\n 'kubb init --plugins plugin-ts,plugin-axios,plugin-react-query',\n 'kubb init --yes --dry-run',\n ].join('\\n'),\n toKebab: true,\n args: {\n yes: {\n type: 'boolean',\n description: 'Skip prompts and use default options',\n short: 'y',\n default: false,\n },\n input: {\n type: 'string',\n description: 'Path to the OpenAPI specification',\n short: 'i',\n metavar: 'path',\n },\n output: {\n type: 'string',\n description: 'Output directory for generated files',\n short: 'o',\n metavar: 'path',\n },\n plugins: {\n type: 'string',\n description: 'Comma-separated Kubb registry ids of the plugins to add, the same ids `kubb add` takes (plugin-ts, plugin-zod, acme/plugin-x)',\n metavar: 'plugin-ts,plugin-zod,...',\n },\n },\n async run(ctx) {\n const { values } = ctx\n const { run } = await import('../runners/init/run.ts')\n\n await run({\n yes: values.yes,\n version,\n input: values.input,\n output: values.output,\n plugins: values.plugins,\n dryRun: ctx.extensions[dryRunId],\n })\n },\n})\n","import { define } from 'gunshi'\n\nexport const command = define({\n name: 'list',\n description:\n 'List the installed Kubb extensions: their registry id, package, installed version, the version the Kubb registry pins, and whether an update exists.',\n examples: 'kubb list',\n async run() {\n const { run } = await import('../runners/list/run.ts')\n await run()\n },\n})\n","import { define } from 'gunshi'\n\n/** The runner is imported when the command runs, so listing `kubb --help` never loads `@kubb/mcp`. */\nexport const command = define({\n name: 'mcp',\n description:\n 'Start a Model Context Protocol (MCP) server that exposes Kubb code generation as tools for AI assistants. Once running, configure your AI client (Claude, Cursor, Windsurf, etc.) to connect to it — the assistant can then call kubb generate directly without leaving the chat.',\n examples: ['kubb mcp', '# Then add to your MCP client config:', '# { \"mcpServers\": { \"kubb\": { \"command\": \"npx\", \"args\": [\"kubb\", \"mcp\"] } } }'].join('\\n'),\n // gunshi prints the header to stdout, which the MCP stdio transport owns.\n rendering: { header: null },\n async run() {\n const { run } = await import('../runners/mcp/run.ts')\n await run()\n },\n})\n","import { define } from 'gunshi'\nimport { configArg, logLevelArg, studioConnectionArgs, studioPermissionArgs } from '../shared.ts'\n\nexport const command = define({\n name: 'connect',\n description: 'Connect this project to Kubb Studio and generate from the browser.',\n examples: [\n 'kubb studio connect',\n 'kubb studio connect --allow-read',\n 'kubb studio connect --allow-write --allow-exec',\n 'kubb studio connect --url http://localhost:3000',\n ].join('\\n'),\n toKebab: true,\n args: {\n ...configArg,\n ...studioConnectionArgs,\n ...studioPermissionArgs,\n open: {\n type: 'boolean',\n description: 'Open the approval page in a browser while pairing',\n default: true,\n negatable: true,\n },\n ...logLevelArg,\n },\n async run(ctx) {\n const { connectRunner } = await import('../../runners/studio/commands.ts')\n await connectRunner(ctx)\n },\n})\n","import { define } from 'gunshi'\nimport { command as connectCommand } from './connect.ts'\n\nexport const command = define({\n name: 'login',\n description: 'Pair this machine with Kubb Studio without connecting.',\n examples: ['kubb studio login', 'kubb studio login --url http://localhost:3000'].join('\\n'),\n toKebab: true,\n args: connectCommand.args,\n async run(ctx) {\n const { loginRunner } = await import('../../runners/studio/commands.ts')\n await loginRunner(ctx)\n },\n})\n","import { define } from 'gunshi'\nimport { configArg, logLevelArg, studioConnectionArgs, studioPermissionArgs } from '../shared.ts'\n\nexport const command = define({\n name: 'logout',\n description: 'Forget the stored Kubb Studio token.',\n examples: ['kubb studio logout'].join('\\n'),\n toKebab: true,\n args: {\n ...configArg,\n ...studioConnectionArgs,\n ...studioPermissionArgs,\n ...logLevelArg,\n },\n async run(ctx) {\n const { logoutRunner } = await import('../../runners/studio/commands.ts')\n await logoutRunner(ctx)\n },\n})\n","import { define } from 'gunshi'\nimport { configArg, logLevelArg, studioConnectionArgs } from '../shared.ts'\n\nexport const command = define({\n name: 'snapshot',\n description: 'Generate and publish a Kubb Studio snapshot from CI.',\n examples: ['kubb studio snapshot', 'kubb studio snapshot --json'].join('\\n'),\n toKebab: true,\n args: {\n ...configArg,\n ...studioConnectionArgs,\n id: {\n type: 'string',\n description: 'Stable identity for the CI agent, such as a pull request. Auto-detected on GitHub Actions, GitLab CI, Bitbucket Pipelines and CircleCI',\n },\n baseId: {\n type: 'string',\n description:\n \"Identity of another CI agent, such as the base branch's, to also compare this snapshot with. Auto-detected on GitHub pull requests and GitLab merge requests\",\n toKebab: true,\n },\n name: {\n type: 'string',\n description: 'Package name for the generated tarball. Defaults to the name in package.json',\n },\n packageVersion: {\n type: 'string',\n description: 'Package version for the generated tarball. Defaults to the version in package.json',\n toKebab: true,\n },\n json: {\n type: 'boolean',\n description: 'Print the result as one JSON object instead of a summary',\n default: false,\n },\n ...logLevelArg,\n },\n async run(ctx) {\n const { runner } = await import('../../runners/studio/snapshot.ts')\n await runner(ctx)\n },\n})\n","import { define } from 'gunshi'\nimport { command as connectCommand } from './connect.ts'\n\nexport const command = define({\n name: 'start',\n description: 'Keep this project connected to Kubb Studio in the background.',\n toKebab: true,\n args: connectCommand.args,\n async run(ctx) {\n const { startRunner } = await import('../../runners/studio/commands.ts')\n await startRunner(ctx)\n },\n})\n\nexport const stopCommand = define({\n name: 'stop',\n description: \"Stop this project's background connection and keep its pairing.\",\n async run() {\n const { stopRunner } = await import('../../runners/studio/commands.ts')\n await stopRunner()\n },\n})\n","import { define } from 'gunshi'\nimport { configArg, logLevelArg, studioConnectionArgs, studioPermissionArgs } from '../shared.ts'\n\nexport const command = define({\n name: 'status',\n description: 'Show the project worker, Kubb Studio pairing, and saved permissions.',\n examples: ['kubb studio status'].join('\\n'),\n toKebab: true,\n args: {\n ...configArg,\n ...studioConnectionArgs,\n ...studioPermissionArgs,\n ...logLevelArg,\n },\n async run(ctx) {\n const { statusRunner } = await import('../../runners/studio/commands.ts')\n await statusRunner(ctx)\n },\n})\n","import { define } from 'gunshi'\nimport { command as connectCommand } from './connect.ts'\nimport { command as loginCommand } from './login.ts'\nimport { command as logoutCommand } from './logout.ts'\nimport { command as snapshotCommand } from './snapshot.ts'\nimport { command as startCommand, stopCommand } from './background.ts'\nimport { command as statusCommand } from './status.ts'\n\nexport const command = define({\n name: 'studio',\n description: 'Connect this project to Kubb Studio, or manage its pairing and snapshots.',\n examples: ['kubb studio', 'kubb studio --allow-read', 'kubb studio login', 'kubb studio status', 'kubb studio logout', 'kubb studio snapshot'].join('\\n'),\n toKebab: true,\n args: connectCommand.args,\n async run(ctx) {\n const { connectRunner } = await import('../../runners/studio/commands.ts')\n await connectRunner(ctx)\n },\n subCommands: {\n start: startCommand,\n stop: stopCommand,\n connect: connectCommand,\n login: loginCommand,\n logout: logoutCommand,\n status: statusCommand,\n snapshot: snapshotCommand,\n },\n})\n\n/**\n * Sends `kubb studio --flag value` to `kubb studio connect`, the same runner. gunshi picks a\n * subcommand from the first token that is not a flag, so `--url http://…` would read the URL as one.\n */\nexport function routeStudioFlags(args: Array<string>): Array<string> {\n const [name, next] = args\n if (name !== 'studio' || !next?.startsWith('-') || next === '--help' || next === '-h') return args\n\n return ['studio', 'connect', ...args.slice(1)]\n}\n","import { define } from 'gunshi'\nimport { yesArg } from './shared.ts'\n\nexport const command = define({\n name: 'update',\n description:\n 'Update installed extensions to the version the Kubb registry pins. Pass ids to update only those, or --check to list the updates without installing.',\n examples: ['kubb update', 'kubb update --check', 'kubb update plugin-zod plugin-ts --yes'].join('\\n'),\n args: {\n ids: {\n type: 'positional',\n description: 'Registry ids to update, all installed extensions when omitted',\n multiple: true,\n },\n check: {\n type: 'boolean',\n description: 'List the available updates without installing them',\n default: false,\n },\n ...yesArg,\n },\n async run({ values }) {\n const { run } = await import('../runners/update/run.ts')\n await run({ ids: values.ids ?? [], check: values.check, yes: values.yes })\n },\n})\n","import { define } from 'gunshi'\n\n/** The runner is imported when the command runs, so listing `kubb --help` never loads `@kubb/adapter-oas`. */\nexport const command = define({\n name: 'validate',\n description:\n 'Parse and validate an OpenAPI/Swagger file for structural correctness. Reports schema errors, missing required fields, and malformed references. Use this before running generate to catch spec issues early.',\n examples: ['kubb validate ./openapi.yaml', 'kubb validate https://petstore3.swagger.io/api/v3/openapi.json'].join('\\n'),\n args: {\n input: {\n type: 'positional',\n description: 'Path or URL to the OpenAPI/Swagger file to validate',\n required: true,\n },\n },\n async run({ values }) {\n const { run } = await import('../runners/validate/run.ts')\n await run({ input: values.input })\n },\n})\n","import { styleText } from 'node:util'\n\n/**\n * Maps each camelCase flag removed in favor of kebab-case (kubb-labs/kubb#4046) to its\n * replacement. Drop this table, and the rewrite it drives, once the deprecation window ends.\n */\nconst DEPRECATED_FLAGS: Record<string, string> = {\n allowWrite: 'allow-write',\n allowConfigEdit: 'allow-config-edit',\n allowExec: 'allow-exec',\n logLevel: 'log-level',\n dryRun: 'dry-run',\n packageVersion: 'package-version',\n}\n\nconst FLAG_PATTERN = /^--([a-zA-Z][\\w-]*)(=.*)?$/\n\n/**\n * Rewrites a deprecated camelCase flag to its kebab-case replacement and warns on stderr, so a\n * script written against the old flag names keeps working during the deprecation window instead\n * of failing with an unknown-option error.\n */\nexport function resolveDeprecatedFlags(args: Array<string>): Array<string> {\n return args.map((arg) => {\n const match = FLAG_PATTERN.exec(arg)\n const name = match?.[1]\n const replacement = name ? DEPRECATED_FLAGS[name] : undefined\n\n if (!name || !replacement) {\n return arg\n }\n\n console.error(\n `${styleText('yellow', 'Warning:')} --${name} is deprecated, use --${replacement} instead. --${name} will be removed in a future major version.`,\n )\n\n return `--${replacement}${match?.[2] ?? ''}`\n })\n}\n","import { styleText } from 'node:util'\nimport dryrun from '@gunshi/plugin-dryrun'\nimport { cli } from 'gunshi'\nimport { isDisabled as isTelemetryDisabled } from './Telemetry.ts'\nimport { version } from '../package.json'\nimport { command as addCommand } from './commands/add.ts'\nimport { command as generateCommand } from './commands/generate.ts'\nimport { command as initCommand } from './commands/init.ts'\nimport { command as listCommand } from './commands/list.ts'\nimport { command as mcpCommand } from './commands/mcp.ts'\nimport { command as studioCommand, routeStudioFlags } from './commands/studio/index.ts'\nimport { command as updateCommand } from './commands/update.ts'\nimport { command as validateCommand } from './commands/validate.ts'\nimport { resolveDeprecatedFlags } from './deprecatedFlags.ts'\n\n/** Flags that short-circuit execution (help and version). The telemetry notice is suppressed for these. */\nconst QUIET_FLAGS = new Set<string>(['--help', '-h', '--version', '-v', '--json'])\n\n/**\n * Entry point for the `kubb` CLI. Prints the telemetry notice unless telemetry is disabled or a\n * quiet flag is passed, then runs the given command, or `generate` when none is given.\n */\nexport async function run(argv: Array<string> = process.argv.slice(2)): Promise<void> {\n const args = routeStudioFlags(resolveDeprecatedFlags(argv))\n const isQuietFlag = args.some((arg) => QUIET_FLAGS.has(arg))\n\n // stderr, so the notice never lands in a stream a client parses, such as `kubb mcp` stdio.\n if (!isTelemetryDisabled() && !isQuietFlag) {\n console.error(\n `${styleText('yellow', 'Notice:')} Kubb collects anonymous telemetry data to help improve the tool. No personal data or file contents are collected. \\nTo disable, set ${styleText('cyan', 'KUBB_DISABLE_TELEMETRY=1')}.\\n`,\n )\n }\n\n // Each command's `run` imports its runner, so an optional peer (@kubb/adapter-oas, @kubb/mcp, @kubb/studio) loads only when it runs.\n await cli(args, generateCommand, {\n name: 'kubb',\n version,\n // Not `generateCommand.description`: gunshi prints this on every subcommand's help too, so\n // `kubb studio --help` would open with a paragraph about generating types.\n description: 'Generate code from an OpenAPI specification, manage Kubb extensions, or connect the project to Kubb Studio.',\n subCommands: {\n generate: generateCommand,\n init: initCommand,\n validate: validateCommand,\n mcp: mcpCommand,\n studio: studioCommand,\n add: addCommand,\n update: updateCommand,\n list: listCommand,\n },\n fallbackToEntry: true,\n strict: true,\n plugins: [dryrun({ name: 'dry-run' })],\n onErrorCommand: async (_ctx, error) => {\n process.exitCode = 1\n console.error(error)\n },\n })\n}\n"],"mappings":";;;;;;;;AAUA,MAAa,YAAY,EACvB,QAAQ;CACN,MAAM;CACN,aAAa;CACb,OAAO;AACT,EACF;AAEA,MAAa,SAAS,EACpB,KAAK;CACH,MAAM;CACN,aAAa;CACb,OAAO;CACP,SAAS;AACX,EACF;AAEA,MAAa,cAAc,EACzB,UAAU;CACR,MAAM;CACN,SAAS;EAAC;EAAU;EAAQ;CAAS;CACrC,aAAa;CACb,OAAO;CACP,SAAS;CACT,SAAS;AACX,EACF;AAEA,MAAa,uBAAuB;CAClC,KAAK;EACH,MAAM;EACN,aAAa;CACf;CACA,OAAO;EACL,MAAM;EACN,aAAa;CACf;AACF;AAEA,MAAa,uBAAuB;CAClC,WAAW;EACT,MAAM;EACN,aAAa;EACb,SAAS;EACT,SAAS;CACX;CACA,YAAY;EACV,MAAM;EACN,aAAa;EACb,SAAS;EACT,SAAS;CACX;CACA,iBAAiB;EACf,MAAM;EACN,aAAa;EACb,SAAS;EACT,SAAS;CACX;CACA,WAAW;EACT,MAAM;EACN,aAAa;EACb,SAAS;EACT,SAAS;CACX;AACF;;;ACvEA,MAAaA,cAAAA,GAAUC,OAAAA,OAAAA,CAAO;CAC5B,MAAM;CACN,aACE;CACF,UAAU;EAAC;EAAuB;EAAyC;EAAgC;CAAkC,CAAC,CAAC,KAAK,IAAI;CACxJ,SAAS;CACT,MAAM;EACJ,IAAI;GACF,MAAM;GACN,aAAa;GACb,UAAU;EACZ;EACA,GAAG;EACH,GAAG;EACH,SAAS;GACP,MAAM;GACN,aAAa;GAC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