@kubb/cli 3.9.5 → 3.10.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/dist/chunk-O25IFQZO.cjs +52 -0
- package/dist/chunk-O25IFQZO.cjs.map +1 -0
- package/dist/{generate-LU6B33AA.cjs → generate-EWLW7UZE.cjs} +15 -15
- package/dist/generate-EWLW7UZE.cjs.map +1 -0
- package/dist/{generate-F47H4EHK.js → generate-LAUXB7MT.js} +7 -6
- package/dist/generate-LAUXB7MT.js.map +1 -0
- package/dist/{chunk-SMSDJUVC.js → generate-O4JEH3OR.js} +3 -3
- package/dist/generate-O4JEH3OR.js.map +1 -0
- package/dist/{chunk-K4BXFFZB.cjs → generate-WUJKCOJN.cjs} +187 -231
- package/dist/generate-WUJKCOJN.cjs.map +1 -0
- package/dist/index.cjs +7 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -56
- package/dist/index.d.ts +1 -56
- package/dist/index.js +7 -5
- package/dist/index.js.map +1 -1
- package/package.json +7 -6
- package/src/commands/generate.ts +5 -4
- package/src/index.ts +2 -3
- package/src/{generate.ts → runners/generate.ts} +4 -4
- package/dist/chunk-K4BXFFZB.cjs.map +0 -1
- package/dist/chunk-SMSDJUVC.js.map +0 -1
- package/dist/generate-F47H4EHK.js.map +0 -1
- package/dist/generate-LU6B33AA.cjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkO25IFQZO_cjs = require('./chunk-O25IFQZO.cjs');
|
|
4
4
|
var citty = require('citty');
|
|
5
5
|
var getLatestVersion = require('latest-version');
|
|
6
6
|
var semver = require('semver');
|
|
@@ -14,10 +14,10 @@ var gradientString__default = /*#__PURE__*/_interopDefault(gradientString);
|
|
|
14
14
|
var consola__default = /*#__PURE__*/_interopDefault(consola);
|
|
15
15
|
|
|
16
16
|
// src/index.ts
|
|
17
|
-
|
|
17
|
+
chunkO25IFQZO_cjs.init_cjs_shims();
|
|
18
18
|
|
|
19
19
|
// package.json
|
|
20
|
-
var version = "3.
|
|
20
|
+
var version = "3.10.1";
|
|
21
21
|
var name = "kubb";
|
|
22
22
|
var main = citty.defineCommand({
|
|
23
23
|
meta: {
|
|
@@ -43,24 +43,21 @@ Run \`npm install -g @kubb/cli\` to update`,
|
|
|
43
43
|
}
|
|
44
44
|
} catch (_e) {
|
|
45
45
|
}
|
|
46
|
-
if (rawArgs[0]
|
|
47
|
-
|
|
46
|
+
if (!["generate"].includes(rawArgs[0])) {
|
|
47
|
+
console.log(rawArgs[0]);
|
|
48
|
+
const generateCommand = await import('./generate-EWLW7UZE.cjs').then((r) => r.default);
|
|
48
49
|
await citty.runCommand(generateCommand, { rawArgs });
|
|
49
50
|
process.exit(0);
|
|
50
51
|
}
|
|
51
52
|
},
|
|
52
53
|
subCommands: {
|
|
53
|
-
generate: () => import('./generate-
|
|
54
|
+
generate: () => import('./generate-EWLW7UZE.cjs').then((r) => r.default)
|
|
54
55
|
}
|
|
55
56
|
});
|
|
56
57
|
async function run(_argv) {
|
|
57
58
|
await citty.runMain(main);
|
|
58
59
|
}
|
|
59
60
|
|
|
60
|
-
Object.defineProperty(exports, "generate", {
|
|
61
|
-
enumerable: true,
|
|
62
|
-
get: function () { return chunkK4BXFFZB_cjs.generate; }
|
|
63
|
-
});
|
|
64
61
|
exports.run = run;
|
|
65
62
|
//# sourceMappingURL=index.cjs.map
|
|
66
63
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../package.json"],"names":["init_cjs_shims","defineCommand","consola","gradientString","getLatestVersion","lt","runCommand","runMain"],"mappings":";;;;;;;;;;;;;;;;AAAAA,gCAAA,EAAA;;;ACEE,IAAW,OAAA,GAAA,
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../package.json"],"names":["init_cjs_shims","defineCommand","consola","gradientString","getLatestVersion","lt","runCommand","runMain"],"mappings":";;;;;;;;;;;;;;;;AAAAA,gCAAA,EAAA;;;ACEE,IAAW,OAAA,GAAA,QAAA;ADMb,IAAM,IAAO,GAAA,MAAA;AAEb,IAAM,OAAOC,mBAAc,CAAA;AAAA,EACzB,IAAM,EAAA;AAAA,IACJ,IAAA;AAAA,IACA,OAAA;AAAA,IACA,WAAa,EAAA;AAAA,GACf;AAAA,EACA,MAAM,KAAA,CAAM,EAAE,OAAA,EAAW,EAAA;AACvB,IAAI,IAAA;AACF,MAAQC,wBAAA,CAAA,GAAA,CAAIC,gCAAe,CAAC,SAAA,EAAW,WAAW,SAAS,CAAC,CAAE,CAAA,WAAW,CAAC,CAAA;AAE1E,MAAM,MAAA,aAAA,GAAgB,MAAMC,iCAAA,CAAiB,WAAW,CAAA;AAExD,MAAI,IAAAC,SAAA,CAAG,OAAS,EAAA,aAAa,CAAG,EAAA;AAC9B,QAAAH,wBAAA,CAAQ,GAAI,CAAA;AAAA,UACV,KAAO,EAAA,8BAAA;AAAA,UACP,OAAS,EAAA,CAAA,GAAA,EAAM,OAAO,CAAA,aAAA,EAAW,aAAa,CAAA;AAAA,0CAAA,CAAA;AAAA,UAE9C,KAAO,EAAA;AAAA,YACL,OAAS,EAAA,CAAA;AAAA,YACT,WAAa,EAAA,QAAA;AAAA,YACb,WAAa,EAAA;AAAA;AACf,SACD,CAAA;AAAA;AACH,aACO,EAAI,EAAA;AAAA;AAEb,IAAI,IAAA,CAAC,CAAC,UAAU,CAAA,CAAE,SAAS,OAAQ,CAAA,CAAC,CAAW,CAAG,EAAA;AAChD,MAAQ,OAAA,CAAA,GAAA,CAAI,OAAQ,CAAA,CAAC,CAAC,CAAA;AAEtB,MAAM,MAAA,eAAA,GAAkB,MAAM,OAAO,yBAAwB,EAAE,IAAK,CAAA,CAAC,CAAM,KAAA,CAAA,CAAE,OAAO,CAAA;AAEpF,MAAA,MAAMI,gBAAW,CAAA,eAAA,EAAiB,EAAE,OAAA,EAAS,CAAA;AAE7C,MAAA,OAAA,CAAQ,KAAK,CAAC,CAAA;AAAA;AAChB,GACF;AAAA,EACA,WAAa,EAAA;AAAA,IACX,QAAA,EAAU,MAAM,OAAO,yBAAwB,EAAE,IAAK,CAAA,CAAC,CAAM,KAAA,CAAA,CAAE,OAAO;AAAA;AAE1E,CAAC,CAAA;AAED,eAAsB,IAAI,KAAiC,EAAA;AACzD,EAAA,MAAMC,cAAQ,IAAI,CAAA;AACpB","file":"index.cjs","sourcesContent":["import { defineCommand, runCommand, runMain } from 'citty'\nimport getLatestVersion from 'latest-version'\nimport { lt } from 'semver'\nimport { default as gradientString } from 'gradient-string'\n\nimport { version } from '../package.json'\nimport consola from 'consola'\n\nconst name = 'kubb'\n\nconst main = defineCommand({\n meta: {\n name,\n version,\n description: 'Kubb generation',\n },\n async setup({ rawArgs }) {\n try {\n consola.log(gradientString(['#F58517', '#F5A217', '#F55A17'])('Kubb CLI:'))\n\n const latestVersion = await getLatestVersion('@kubb/cli')\n\n if (lt(version, latestVersion)) {\n consola.box({\n title: 'Update available for `Kubb` ',\n message: `\\`v${version}\\` → \\`v${latestVersion}\\`\nRun \\`npm install -g @kubb/cli\\` to update`,\n style: {\n padding: 2,\n borderColor: 'yellow',\n borderStyle: 'rounded',\n },\n })\n }\n } catch (_e) {}\n\n if (!['generate'].includes(rawArgs[0] as string)) {\n console.log(rawArgs[0])\n // generate is not being used\n const generateCommand = await import('./commands/generate.ts').then((r) => r.default)\n\n await runCommand(generateCommand, { rawArgs })\n\n process.exit(0)\n }\n },\n subCommands: {\n generate: () => import('./commands/generate.ts').then((r) => r.default),\n },\n})\n\nexport async function run(_argv?: string[]): Promise<void> {\n await runMain(main)\n}\n","{\n \"name\": \"@kubb/cli\",\n \"version\": \"3.10.1\",\n \"description\": \"Generator cli\",\n \"keywords\": [\n \"typescript\",\n \"plugins\",\n \"kubb\",\n \"codegen\",\n \"cli\"\n ],\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/kubb-labs/kubb.git\",\n \"directory\": \"packages/cli\"\n },\n \"license\": \"MIT\",\n \"author\": \"stijnvanhulle\",\n \"sideEffects\": false,\n \"type\": \"module\",\n \"exports\": {\n \".\": {\n \"import\": \"./dist/index.js\",\n \"require\": \"./dist/index.cjs\",\n \"default\": \"./dist/index.cjs\"\n }\n },\n \"main\": \"dist/index.cjs\",\n \"module\": \"dist/index.js\",\n \"types\": \"./dist/index.d.ts\",\n \"bin\": {\n \"kubb\": \"bin/kubb.cjs\"\n },\n \"files\": [\n \"src\",\n \"dist\",\n \"bin\",\n \"!/**/**.test.**\",\n \"!/**/__tests__/**\"\n ],\n \"scripts\": {\n \"build\": \"tsup\",\n \"clean\": \"npx rimraf ./dist\",\n \"lint\": \"bun biome lint .\",\n \"lint:fix\": \"bun biome lint --apply-unsafe .\",\n \"release\": \"pnpm publish --no-git-check\",\n \"release:canary\": \"bash ../../.github/canary.sh && node ../../scripts/build.js canary && pnpm publish --no-git-check\",\n \"start\": \"tsup --watch\",\n \"test\": \"vitest --passWithNoTests\",\n \"typecheck\": \"tsc -p ./tsconfig.json --noEmit --emitDeclarationOnly false\"\n },\n \"dependencies\": {\n \"@kubb/core\": \"workspace:*\",\n \"@kubb/ui\": \"workspace:*\",\n \"chokidar\": \"^4.0.3\",\n \"citty\": \"^0.1.6\",\n \"cli-progress\": \"^3.12.0\",\n \"consola\": \"^3.4.2\",\n \"cosmiconfig\": \"^9.0.0\",\n \"execa\": \"^9.5.2\",\n \"gradient-string\": \"^3.0.0\",\n \"jiti\": \"^2.4.2\",\n \"latest-version\": \"^9.0.0\",\n \"open\": \"^10.1.1\",\n \"p-queue\": \"^8.1.0\",\n \"semver\": \"^7.7.1\",\n \"string-argv\": \"^0.3.2\"\n },\n \"devDependencies\": {\n \"@kubb/config-ts\": \"workspace:*\",\n \"@kubb/config-tsup\": \"workspace:*\",\n \"@kubb/mcp\": \"workspace:*\",\n \"@kubb/plugin-oas\": \"workspace:*\",\n \"@types/cli-progress\": \"^3.11.6\",\n \"@types/node\": \"catalog:\",\n \"@types/semver\": \"^7.7.0\",\n \"source-map-support\": \"^0.5.21\",\n \"tsup\": \"catalog:\",\n \"typescript\": \"catalog:\"\n },\n \"engines\": {\n \"node\": \">=20\"\n },\n \"preferGlobal\": true,\n \"publishConfig\": {\n \"access\": \"public\",\n \"registry\": \"https://registry.npmjs.org/\"\n }\n}\n"]}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,58 +1,3 @@
|
|
|
1
|
-
import { Config } from '@kubb/core';
|
|
2
|
-
import { SingleBar } from 'cli-progress';
|
|
3
|
-
import { ParsedArgs } from 'citty';
|
|
4
|
-
|
|
5
|
-
declare global {
|
|
6
|
-
var isDevtoolsEnabled: any;
|
|
7
|
-
}
|
|
8
|
-
declare const args: {
|
|
9
|
-
readonly config: {
|
|
10
|
-
readonly type: "string";
|
|
11
|
-
readonly description: "Path to the Kubb config";
|
|
12
|
-
readonly alias: "c";
|
|
13
|
-
};
|
|
14
|
-
readonly logLevel: {
|
|
15
|
-
readonly type: "string";
|
|
16
|
-
readonly description: "Info, silent or debug";
|
|
17
|
-
readonly alias: "l";
|
|
18
|
-
readonly default: "info";
|
|
19
|
-
readonly valueHint: "silent|info|debug";
|
|
20
|
-
};
|
|
21
|
-
readonly watch: {
|
|
22
|
-
readonly type: "boolean";
|
|
23
|
-
readonly description: "Watch mode based on the input file";
|
|
24
|
-
readonly alias: "w";
|
|
25
|
-
readonly default: false;
|
|
26
|
-
};
|
|
27
|
-
readonly debug: {
|
|
28
|
-
readonly type: "boolean";
|
|
29
|
-
readonly description: "Override logLevel to debug";
|
|
30
|
-
readonly alias: "d";
|
|
31
|
-
readonly default: false;
|
|
32
|
-
};
|
|
33
|
-
readonly ui: {
|
|
34
|
-
readonly type: "boolean";
|
|
35
|
-
readonly description: "Open ui";
|
|
36
|
-
readonly alias: "u";
|
|
37
|
-
readonly default: false;
|
|
38
|
-
};
|
|
39
|
-
readonly help: {
|
|
40
|
-
readonly type: "boolean";
|
|
41
|
-
readonly description: "Show help";
|
|
42
|
-
readonly alias: "h";
|
|
43
|
-
readonly default: false;
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
type Args = ParsedArgs<typeof args>;
|
|
47
|
-
|
|
48
|
-
type GenerateProps = {
|
|
49
|
-
input?: string;
|
|
50
|
-
config: Config;
|
|
51
|
-
args: Args;
|
|
52
|
-
progressCache: Map<string, SingleBar>;
|
|
53
|
-
};
|
|
54
|
-
declare function generate({ input, config, progressCache, args }: GenerateProps): Promise<void>;
|
|
55
|
-
|
|
56
1
|
declare function run(_argv?: string[]): Promise<void>;
|
|
57
2
|
|
|
58
|
-
export {
|
|
3
|
+
export { run };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,58 +1,3 @@
|
|
|
1
|
-
import { Config } from '@kubb/core';
|
|
2
|
-
import { SingleBar } from 'cli-progress';
|
|
3
|
-
import { ParsedArgs } from 'citty';
|
|
4
|
-
|
|
5
|
-
declare global {
|
|
6
|
-
var isDevtoolsEnabled: any;
|
|
7
|
-
}
|
|
8
|
-
declare const args: {
|
|
9
|
-
readonly config: {
|
|
10
|
-
readonly type: "string";
|
|
11
|
-
readonly description: "Path to the Kubb config";
|
|
12
|
-
readonly alias: "c";
|
|
13
|
-
};
|
|
14
|
-
readonly logLevel: {
|
|
15
|
-
readonly type: "string";
|
|
16
|
-
readonly description: "Info, silent or debug";
|
|
17
|
-
readonly alias: "l";
|
|
18
|
-
readonly default: "info";
|
|
19
|
-
readonly valueHint: "silent|info|debug";
|
|
20
|
-
};
|
|
21
|
-
readonly watch: {
|
|
22
|
-
readonly type: "boolean";
|
|
23
|
-
readonly description: "Watch mode based on the input file";
|
|
24
|
-
readonly alias: "w";
|
|
25
|
-
readonly default: false;
|
|
26
|
-
};
|
|
27
|
-
readonly debug: {
|
|
28
|
-
readonly type: "boolean";
|
|
29
|
-
readonly description: "Override logLevel to debug";
|
|
30
|
-
readonly alias: "d";
|
|
31
|
-
readonly default: false;
|
|
32
|
-
};
|
|
33
|
-
readonly ui: {
|
|
34
|
-
readonly type: "boolean";
|
|
35
|
-
readonly description: "Open ui";
|
|
36
|
-
readonly alias: "u";
|
|
37
|
-
readonly default: false;
|
|
38
|
-
};
|
|
39
|
-
readonly help: {
|
|
40
|
-
readonly type: "boolean";
|
|
41
|
-
readonly description: "Show help";
|
|
42
|
-
readonly alias: "h";
|
|
43
|
-
readonly default: false;
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
type Args = ParsedArgs<typeof args>;
|
|
47
|
-
|
|
48
|
-
type GenerateProps = {
|
|
49
|
-
input?: string;
|
|
50
|
-
config: Config;
|
|
51
|
-
args: Args;
|
|
52
|
-
progressCache: Map<string, SingleBar>;
|
|
53
|
-
};
|
|
54
|
-
declare function generate({ input, config, progressCache, args }: GenerateProps): Promise<void>;
|
|
55
|
-
|
|
56
1
|
declare function run(_argv?: string[]): Promise<void>;
|
|
57
2
|
|
|
58
|
-
export {
|
|
3
|
+
export { run };
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
export { generate } from './chunk-SMSDJUVC.js';
|
|
2
1
|
import { defineCommand, runCommand, runMain } from 'citty';
|
|
3
2
|
import getLatestVersion from 'latest-version';
|
|
4
3
|
import { lt } from 'semver';
|
|
5
4
|
import gradientString from 'gradient-string';
|
|
6
5
|
import consola from 'consola';
|
|
7
6
|
|
|
7
|
+
// src/index.ts
|
|
8
|
+
|
|
8
9
|
// package.json
|
|
9
|
-
var version = "3.
|
|
10
|
+
var version = "3.10.1";
|
|
10
11
|
var name = "kubb";
|
|
11
12
|
var main = defineCommand({
|
|
12
13
|
meta: {
|
|
@@ -32,14 +33,15 @@ Run \`npm install -g @kubb/cli\` to update`,
|
|
|
32
33
|
}
|
|
33
34
|
} catch (_e) {
|
|
34
35
|
}
|
|
35
|
-
if (rawArgs[0]
|
|
36
|
-
|
|
36
|
+
if (!["generate"].includes(rawArgs[0])) {
|
|
37
|
+
console.log(rawArgs[0]);
|
|
38
|
+
const generateCommand = await import('./generate-LAUXB7MT.js').then((r) => r.default);
|
|
37
39
|
await runCommand(generateCommand, { rawArgs });
|
|
38
40
|
process.exit(0);
|
|
39
41
|
}
|
|
40
42
|
},
|
|
41
43
|
subCommands: {
|
|
42
|
-
generate: () => import('./generate-
|
|
44
|
+
generate: () => import('./generate-LAUXB7MT.js').then((r) => r.default)
|
|
43
45
|
}
|
|
44
46
|
});
|
|
45
47
|
async function run(_argv) {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../package.json","../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../package.json","../src/index.ts"],"names":[],"mappings":";;;;;;;;;AAEE,IAAW,OAAA,GAAA,QAAA;ACMb,IAAM,IAAO,GAAA,MAAA;AAEb,IAAM,OAAO,aAAc,CAAA;AAAA,EACzB,IAAM,EAAA;AAAA,IACJ,IAAA;AAAA,IACA,OAAA;AAAA,IACA,WAAa,EAAA;AAAA,GACf;AAAA,EACA,MAAM,KAAA,CAAM,EAAE,OAAA,EAAW,EAAA;AACvB,IAAI,IAAA;AACF,MAAQ,OAAA,CAAA,GAAA,CAAI,eAAe,CAAC,SAAA,EAAW,WAAW,SAAS,CAAC,CAAE,CAAA,WAAW,CAAC,CAAA;AAE1E,MAAM,MAAA,aAAA,GAAgB,MAAM,gBAAA,CAAiB,WAAW,CAAA;AAExD,MAAI,IAAA,EAAA,CAAG,OAAS,EAAA,aAAa,CAAG,EAAA;AAC9B,QAAA,OAAA,CAAQ,GAAI,CAAA;AAAA,UACV,KAAO,EAAA,8BAAA;AAAA,UACP,OAAS,EAAA,CAAA,GAAA,EAAM,OAAO,CAAA,aAAA,EAAW,aAAa,CAAA;AAAA,0CAAA,CAAA;AAAA,UAE9C,KAAO,EAAA;AAAA,YACL,OAAS,EAAA,CAAA;AAAA,YACT,WAAa,EAAA,QAAA;AAAA,YACb,WAAa,EAAA;AAAA;AACf,SACD,CAAA;AAAA;AACH,aACO,EAAI,EAAA;AAAA;AAEb,IAAI,IAAA,CAAC,CAAC,UAAU,CAAA,CAAE,SAAS,OAAQ,CAAA,CAAC,CAAW,CAAG,EAAA;AAChD,MAAQ,OAAA,CAAA,GAAA,CAAI,OAAQ,CAAA,CAAC,CAAC,CAAA;AAEtB,MAAM,MAAA,eAAA,GAAkB,MAAM,OAAO,wBAAwB,EAAE,IAAK,CAAA,CAAC,CAAM,KAAA,CAAA,CAAE,OAAO,CAAA;AAEpF,MAAA,MAAM,UAAW,CAAA,eAAA,EAAiB,EAAE,OAAA,EAAS,CAAA;AAE7C,MAAA,OAAA,CAAQ,KAAK,CAAC,CAAA;AAAA;AAChB,GACF;AAAA,EACA,WAAa,EAAA;AAAA,IACX,QAAA,EAAU,MAAM,OAAO,wBAAwB,EAAE,IAAK,CAAA,CAAC,CAAM,KAAA,CAAA,CAAE,OAAO;AAAA;AAE1E,CAAC,CAAA;AAED,eAAsB,IAAI,KAAiC,EAAA;AACzD,EAAA,MAAM,QAAQ,IAAI,CAAA;AACpB","file":"index.js","sourcesContent":["{\n \"name\": \"@kubb/cli\",\n \"version\": \"3.10.1\",\n \"description\": \"Generator cli\",\n \"keywords\": [\n \"typescript\",\n \"plugins\",\n \"kubb\",\n \"codegen\",\n \"cli\"\n ],\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/kubb-labs/kubb.git\",\n \"directory\": \"packages/cli\"\n },\n \"license\": \"MIT\",\n \"author\": \"stijnvanhulle\",\n \"sideEffects\": false,\n \"type\": \"module\",\n \"exports\": {\n \".\": {\n \"import\": \"./dist/index.js\",\n \"require\": \"./dist/index.cjs\",\n \"default\": \"./dist/index.cjs\"\n }\n },\n \"main\": \"dist/index.cjs\",\n \"module\": \"dist/index.js\",\n \"types\": \"./dist/index.d.ts\",\n \"bin\": {\n \"kubb\": \"bin/kubb.cjs\"\n },\n \"files\": [\n \"src\",\n \"dist\",\n \"bin\",\n \"!/**/**.test.**\",\n \"!/**/__tests__/**\"\n ],\n \"scripts\": {\n \"build\": \"tsup\",\n \"clean\": \"npx rimraf ./dist\",\n \"lint\": \"bun biome lint .\",\n \"lint:fix\": \"bun biome lint --apply-unsafe .\",\n \"release\": \"pnpm publish --no-git-check\",\n \"release:canary\": \"bash ../../.github/canary.sh && node ../../scripts/build.js canary && pnpm publish --no-git-check\",\n \"start\": \"tsup --watch\",\n \"test\": \"vitest --passWithNoTests\",\n \"typecheck\": \"tsc -p ./tsconfig.json --noEmit --emitDeclarationOnly false\"\n },\n \"dependencies\": {\n \"@kubb/core\": \"workspace:*\",\n \"@kubb/ui\": \"workspace:*\",\n \"chokidar\": \"^4.0.3\",\n \"citty\": \"^0.1.6\",\n \"cli-progress\": \"^3.12.0\",\n \"consola\": \"^3.4.2\",\n \"cosmiconfig\": \"^9.0.0\",\n \"execa\": \"^9.5.2\",\n \"gradient-string\": \"^3.0.0\",\n \"jiti\": \"^2.4.2\",\n \"latest-version\": \"^9.0.0\",\n \"open\": \"^10.1.1\",\n \"p-queue\": \"^8.1.0\",\n \"semver\": \"^7.7.1\",\n \"string-argv\": \"^0.3.2\"\n },\n \"devDependencies\": {\n \"@kubb/config-ts\": \"workspace:*\",\n \"@kubb/config-tsup\": \"workspace:*\",\n \"@kubb/mcp\": \"workspace:*\",\n \"@kubb/plugin-oas\": \"workspace:*\",\n \"@types/cli-progress\": \"^3.11.6\",\n \"@types/node\": \"catalog:\",\n \"@types/semver\": \"^7.7.0\",\n \"source-map-support\": \"^0.5.21\",\n \"tsup\": \"catalog:\",\n \"typescript\": \"catalog:\"\n },\n \"engines\": {\n \"node\": \">=20\"\n },\n \"preferGlobal\": true,\n \"publishConfig\": {\n \"access\": \"public\",\n \"registry\": \"https://registry.npmjs.org/\"\n }\n}\n","import { defineCommand, runCommand, runMain } from 'citty'\nimport getLatestVersion from 'latest-version'\nimport { lt } from 'semver'\nimport { default as gradientString } from 'gradient-string'\n\nimport { version } from '../package.json'\nimport consola from 'consola'\n\nconst name = 'kubb'\n\nconst main = defineCommand({\n meta: {\n name,\n version,\n description: 'Kubb generation',\n },\n async setup({ rawArgs }) {\n try {\n consola.log(gradientString(['#F58517', '#F5A217', '#F55A17'])('Kubb CLI:'))\n\n const latestVersion = await getLatestVersion('@kubb/cli')\n\n if (lt(version, latestVersion)) {\n consola.box({\n title: 'Update available for `Kubb` ',\n message: `\\`v${version}\\` → \\`v${latestVersion}\\`\nRun \\`npm install -g @kubb/cli\\` to update`,\n style: {\n padding: 2,\n borderColor: 'yellow',\n borderStyle: 'rounded',\n },\n })\n }\n } catch (_e) {}\n\n if (!['generate'].includes(rawArgs[0] as string)) {\n console.log(rawArgs[0])\n // generate is not being used\n const generateCommand = await import('./commands/generate.ts').then((r) => r.default)\n\n await runCommand(generateCommand, { rawArgs })\n\n process.exit(0)\n }\n },\n subCommands: {\n generate: () => import('./commands/generate.ts').then((r) => r.default),\n },\n})\n\nexport async function run(_argv?: string[]): Promise<void> {\n await runMain(main)\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/cli",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.10.1",
|
|
4
4
|
"description": "Generator cli",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
"p-queue": "^8.1.0",
|
|
53
53
|
"semver": "^7.7.1",
|
|
54
54
|
"string-argv": "^0.3.2",
|
|
55
|
-
"@kubb/core": "3.
|
|
56
|
-
"@kubb/ui": "3.
|
|
55
|
+
"@kubb/core": "3.10.1",
|
|
56
|
+
"@kubb/ui": "3.10.1"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@types/cli-progress": "^3.11.6",
|
|
@@ -62,9 +62,10 @@
|
|
|
62
62
|
"source-map-support": "^0.5.21",
|
|
63
63
|
"tsup": "^8.4.0",
|
|
64
64
|
"typescript": "^5.8.3",
|
|
65
|
-
"@kubb/config-ts": "3.
|
|
66
|
-
"@kubb/config-tsup": "3.
|
|
67
|
-
"@kubb/
|
|
65
|
+
"@kubb/config-ts": "3.10.1",
|
|
66
|
+
"@kubb/config-tsup": "3.10.1",
|
|
67
|
+
"@kubb/mcp": "3.10.1",
|
|
68
|
+
"@kubb/plugin-oas": "3.10.1"
|
|
68
69
|
},
|
|
69
70
|
"engines": {
|
|
70
71
|
"node": ">=20"
|
package/src/commands/generate.ts
CHANGED
|
@@ -10,8 +10,7 @@ import path from 'node:path'
|
|
|
10
10
|
import * as process from 'node:process'
|
|
11
11
|
import { PromiseManager, isInputPath } from '@kubb/core'
|
|
12
12
|
import { LogMapper, createLogger } from '@kubb/core/logger'
|
|
13
|
-
|
|
14
|
-
import { startServer } from '@kubb/ui'
|
|
13
|
+
|
|
15
14
|
import open from 'open'
|
|
16
15
|
import type { SingleBar } from 'cli-progress'
|
|
17
16
|
|
|
@@ -75,8 +74,7 @@ const command = defineCommand({
|
|
|
75
74
|
const input = args._[0]
|
|
76
75
|
|
|
77
76
|
if (args.help) {
|
|
78
|
-
showUsage(command)
|
|
79
|
-
return
|
|
77
|
+
return showUsage(command)
|
|
80
78
|
}
|
|
81
79
|
|
|
82
80
|
if (args.debug) {
|
|
@@ -87,6 +85,7 @@ const command = defineCommand({
|
|
|
87
85
|
const logger = createLogger({
|
|
88
86
|
logLevel,
|
|
89
87
|
})
|
|
88
|
+
const { generate } = await import('../runners/generate.ts')
|
|
90
89
|
|
|
91
90
|
logger.emit('start', 'Loading config')
|
|
92
91
|
|
|
@@ -127,6 +126,8 @@ const command = defineCommand({
|
|
|
127
126
|
}
|
|
128
127
|
|
|
129
128
|
if (args.ui) {
|
|
129
|
+
const { startServer } = await import('@kubb/ui')
|
|
130
|
+
|
|
130
131
|
await startServer(
|
|
131
132
|
{
|
|
132
133
|
stop: () => process.exit(1),
|
package/src/index.ts
CHANGED
|
@@ -34,7 +34,8 @@ Run \`npm install -g @kubb/cli\` to update`,
|
|
|
34
34
|
}
|
|
35
35
|
} catch (_e) {}
|
|
36
36
|
|
|
37
|
-
if (rawArgs[0]
|
|
37
|
+
if (!['generate'].includes(rawArgs[0] as string)) {
|
|
38
|
+
console.log(rawArgs[0])
|
|
38
39
|
// generate is not being used
|
|
39
40
|
const generateCommand = await import('./commands/generate.ts').then((r) => r.default)
|
|
40
41
|
|
|
@@ -51,5 +52,3 @@ Run \`npm install -g @kubb/cli\` to update`,
|
|
|
51
52
|
export async function run(_argv?: string[]): Promise<void> {
|
|
52
53
|
await runMain(main)
|
|
53
54
|
}
|
|
54
|
-
|
|
55
|
-
export { generate } from './generate.ts'
|
|
@@ -3,13 +3,13 @@ import { LogMapper } from '@kubb/core/logger'
|
|
|
3
3
|
import { colors } from 'consola/utils'
|
|
4
4
|
|
|
5
5
|
import { type Config, safeBuild, setup } from '@kubb/core'
|
|
6
|
-
import { executeHooks } from '
|
|
7
|
-
import { getErrorCauses } from '
|
|
8
|
-
import { getSummary } from '
|
|
6
|
+
import { executeHooks } from '../utils/executeHooks.ts'
|
|
7
|
+
import { getErrorCauses } from '../utils/getErrorCauses.ts'
|
|
8
|
+
import { getSummary } from '../utils/getSummary.ts'
|
|
9
9
|
|
|
10
10
|
import { createLogger } from '@kubb/core/logger'
|
|
11
11
|
import { Presets, SingleBar } from 'cli-progress'
|
|
12
|
-
import type { Args } from '
|
|
12
|
+
import type { Args } from '../commands/generate.ts'
|
|
13
13
|
import process from 'node:process'
|
|
14
14
|
|
|
15
15
|
type GenerateProps = {
|