@kubb/cli 2.21.1 → 2.21.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,3 +1,53 @@
1
+ import { Config } from '@kubb/core';
2
+ import { ParsedArgs } from 'citty';
3
+
4
+ declare const args: {
5
+ readonly config: {
6
+ readonly type: "string";
7
+ readonly description: "Path to the Kubb config";
8
+ readonly alias: "c";
9
+ };
10
+ readonly logLevel: {
11
+ readonly type: "string";
12
+ readonly description: "Info, silent or debug";
13
+ readonly alias: "l";
14
+ readonly default: "info";
15
+ readonly valueHint: "silent|info|debug";
16
+ };
17
+ readonly watch: {
18
+ readonly type: "boolean";
19
+ readonly description: "Watch mode based on the input file";
20
+ readonly alias: "w";
21
+ readonly default: false;
22
+ };
23
+ readonly bun: {
24
+ readonly type: "boolean";
25
+ readonly description: "Run Kubb with Bun";
26
+ readonly alias: "b";
27
+ readonly default: false;
28
+ };
29
+ readonly debug: {
30
+ readonly type: "boolean";
31
+ readonly description: "Override logLevel to debug";
32
+ readonly alias: "d";
33
+ readonly default: false;
34
+ };
35
+ readonly help: {
36
+ readonly type: "boolean";
37
+ readonly description: "Show help";
38
+ readonly alias: "h";
39
+ readonly default: false;
40
+ };
41
+ };
42
+ type Args = ParsedArgs<typeof args>;
43
+
44
+ type GenerateProps = {
45
+ input?: string;
46
+ config: Config;
47
+ args: Args;
48
+ };
49
+ declare function generate({ input, config, args }: GenerateProps): Promise<void>;
50
+
1
51
  declare function run(_argv?: string[]): Promise<void>;
2
52
 
3
- export { run };
53
+ export { generate, run };
package/dist/index.js CHANGED
@@ -1,3 +1,7 @@
1
+ import {
2
+ generate
3
+ } from "./chunk-FUT7JJ3R.js";
4
+
1
5
  // src/index.ts
2
6
  import { defineCommand, runCommand, runMain } from "citty";
3
7
  import getLatestVersion from "latest-version";
@@ -5,7 +9,7 @@ import { lt } from "semver";
5
9
  import consola from "consola";
6
10
 
7
11
  // package.json
8
- var version = "2.21.1";
12
+ var version = "2.21.2";
9
13
 
10
14
  // src/index.ts
11
15
  var name = "kubb";
@@ -33,19 +37,20 @@ Run \`npm install -g @kubb/cli\` to update`,
33
37
  } catch (_e) {
34
38
  }
35
39
  if (rawArgs[0] !== "generate") {
36
- const generateCommand = await import("./generate-SXM56MPF.js").then((r) => r.default);
40
+ const generateCommand = await import("./generate-IRW46OYH.js").then((r) => r.default);
37
41
  await runCommand(generateCommand, { rawArgs });
38
42
  process.exit(0);
39
43
  }
40
44
  },
41
45
  subCommands: {
42
- generate: () => import("./generate-SXM56MPF.js").then((r) => r.default)
46
+ generate: () => import("./generate-IRW46OYH.js").then((r) => r.default)
43
47
  }
44
48
  });
45
49
  async function run(_argv) {
46
50
  await runMain(main);
47
51
  }
48
52
  export {
53
+ generate,
49
54
  run
50
55
  };
51
56
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../package.json"],"sourcesContent":["import { defineCommand, runCommand, runMain } from 'citty'\nimport getLatestVersion from 'latest-version'\nimport { lt } from 'semver'\n\nimport consola from 'consola'\nimport { version } from '../package.json'\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 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 (rawArgs[0] !== 'generate') {\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\": \"2.21.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\": \"git://github.com/kubb-labs/kubb.git\",\n \"directory\": \"packages/cli\"\n },\n \"license\": \"MIT\",\n \"author\": \"Stijn Van Hulle <stijn@stijnvanhulle.be\",\n \"sideEffects\": false,\n \"type\": \"module\",\n \"main\": \"dist/index.cjs\",\n \"module\": \"dist/index.js\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"import\": \"./dist/index.js\",\n \"require\": \"./dist/index.cjs\",\n \"default\": \"./dist/index.cjs\"\n }\n },\n \"bin\": {\n \"kubb\": \"bin/kubb.cjs\",\n \"bkubb\": \"bin/bkubb.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/fs\": \"workspace:*\",\n \"bundle-require\": \"^4.2.1\",\n \"chokidar\": \"^3.6.0\",\n \"citty\": \"^0.1.6\",\n \"consola\": \"^3.2.3\",\n \"cosmiconfig\": \"^9.0.0\",\n \"esbuild\": \"^0.20.2\",\n \"execa\": \"^8.0.1\",\n \"js-runtime\": \"^0.0.8\",\n \"latest-version\": \"^9.0.0\",\n \"ora\": \"^8.0.1\",\n \"semver\": \"^7.6.2\",\n \"string-argv\": \"^0.3.2\",\n \"tinyrainbow\": \"^1.1.1\"\n },\n \"devDependencies\": {\n \"@kubb/config-ts\": \"workspace:*\",\n \"@kubb/config-tsup\": \"workspace:*\",\n \"@kubb/plugin-oas\": \"workspace:*\",\n \"@types/node\": \"^20.14.7\",\n \"@types/semver\": \"^7.5.8\",\n \"source-map-support\": \"^0.5.21\",\n \"tsup\": \"^8.1.0\",\n \"typescript\": \"^5.5.2\"\n },\n \"engines\": {\n \"node\": \">=18\"\n },\n \"preferGlobal\": true,\n \"publishConfig\": {\n \"access\": \"public\",\n \"registry\": \"https://registry.npmjs.org/\"\n }\n}\n"],"mappings":";AAAA,SAAS,eAAe,YAAY,eAAe;AACnD,OAAO,sBAAsB;AAC7B,SAAS,UAAU;AAEnB,OAAO,aAAa;;;ACFlB,cAAW;;;ADKb,IAAM,OAAO;AAEb,IAAM,OAAO,cAAc;AAAA,EACzB,MAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,aAAa;AAAA,EACf;AAAA,EACA,MAAM,MAAM,EAAE,QAAQ,GAAG;AACvB,QAAI;AACF,YAAM,gBAAgB,MAAM,iBAAiB,WAAW;AAExD,UAAI,GAAG,SAAS,aAAa,GAAG;AAC9B,gBAAQ,IAAI;AAAA,UACV,OAAO;AAAA,UACP,SAAS,MAAM,OAAO,gBAAW,aAAa;AAAA;AAAA,UAE9C,OAAO;AAAA,YACL,SAAS;AAAA,YACT,aAAa;AAAA,YACb,aAAa;AAAA,UACf;AAAA,QACF,CAAC;AAAA,MACH;AAAA,IACF,SAAS,IAAI;AAAA,IAAC;AAEd,QAAI,QAAQ,CAAC,MAAM,YAAY;AAE7B,YAAM,kBAAkB,MAAM,OAAO,wBAAwB,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO;AAEpF,YAAM,WAAW,iBAAiB,EAAE,QAAQ,CAAC;AAE7C,cAAQ,KAAK,CAAC;AAAA,IAChB;AAAA,EACF;AAAA,EACA,aAAa;AAAA,IACX,UAAU,MAAM,OAAO,wBAAwB,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO;AAAA,EACxE;AACF,CAAC;AAED,eAAsB,IAAI,OAAiC;AACzD,QAAM,QAAQ,IAAI;AACpB;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts","../package.json"],"sourcesContent":["import { defineCommand, runCommand, runMain } from 'citty'\nimport getLatestVersion from 'latest-version'\nimport { lt } from 'semver'\n\nimport consola from 'consola'\nimport { version } from '../package.json'\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 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 (rawArgs[0] !== 'generate') {\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\nexport { generate } from './generate.ts'\n","{\n \"name\": \"@kubb/cli\",\n \"version\": \"2.21.2\",\n \"description\": \"Generator cli\",\n \"keywords\": [\n \"typescript\",\n \"plugins\",\n \"kubb\",\n \"codegen\",\n \"cli\"\n ],\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git://github.com/kubb-labs/kubb.git\",\n \"directory\": \"packages/cli\"\n },\n \"license\": \"MIT\",\n \"author\": \"Stijn Van Hulle <stijn@stijnvanhulle.be\",\n \"sideEffects\": false,\n \"type\": \"module\",\n \"main\": \"dist/index.cjs\",\n \"module\": \"dist/index.js\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"import\": \"./dist/index.js\",\n \"require\": \"./dist/index.cjs\",\n \"default\": \"./dist/index.cjs\"\n }\n },\n \"bin\": {\n \"kubb\": \"bin/kubb.cjs\",\n \"bkubb\": \"bin/bkubb.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/fs\": \"workspace:*\",\n \"bundle-require\": \"^4.2.1\",\n \"chokidar\": \"^3.6.0\",\n \"citty\": \"^0.1.6\",\n \"consola\": \"^3.2.3\",\n \"cosmiconfig\": \"^9.0.0\",\n \"esbuild\": \"^0.20.2\",\n \"execa\": \"^8.0.1\",\n \"js-runtime\": \"^0.0.8\",\n \"latest-version\": \"^9.0.0\",\n \"ora\": \"^8.0.1\",\n \"semver\": \"^7.6.2\",\n \"string-argv\": \"^0.3.2\",\n \"tinyrainbow\": \"^1.1.1\"\n },\n \"devDependencies\": {\n \"@kubb/config-ts\": \"workspace:*\",\n \"@kubb/config-tsup\": \"workspace:*\",\n \"@kubb/plugin-oas\": \"workspace:*\",\n \"@types/node\": \"^20.14.9\",\n \"@types/semver\": \"^7.5.8\",\n \"source-map-support\": \"^0.5.21\",\n \"tsup\": \"^8.1.0\",\n \"typescript\": \"^5.5.2\"\n },\n \"engines\": {\n \"node\": \">=18\"\n },\n \"preferGlobal\": true,\n \"publishConfig\": {\n \"access\": \"public\",\n \"registry\": \"https://registry.npmjs.org/\"\n }\n}\n"],"mappings":";;;;;AAAA,SAAS,eAAe,YAAY,eAAe;AACnD,OAAO,sBAAsB;AAC7B,SAAS,UAAU;AAEnB,OAAO,aAAa;;;ACFlB,cAAW;;;ADKb,IAAM,OAAO;AAEb,IAAM,OAAO,cAAc;AAAA,EACzB,MAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,aAAa;AAAA,EACf;AAAA,EACA,MAAM,MAAM,EAAE,QAAQ,GAAG;AACvB,QAAI;AACF,YAAM,gBAAgB,MAAM,iBAAiB,WAAW;AAExD,UAAI,GAAG,SAAS,aAAa,GAAG;AAC9B,gBAAQ,IAAI;AAAA,UACV,OAAO;AAAA,UACP,SAAS,MAAM,OAAO,gBAAW,aAAa;AAAA;AAAA,UAE9C,OAAO;AAAA,YACL,SAAS;AAAA,YACT,aAAa;AAAA,YACb,aAAa;AAAA,UACf;AAAA,QACF,CAAC;AAAA,MACH;AAAA,IACF,SAAS,IAAI;AAAA,IAAC;AAEd,QAAI,QAAQ,CAAC,MAAM,YAAY;AAE7B,YAAM,kBAAkB,MAAM,OAAO,wBAAwB,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO;AAEpF,YAAM,WAAW,iBAAiB,EAAE,QAAQ,CAAC;AAE7C,cAAQ,KAAK,CAAC;AAAA,IAChB;AAAA,EACF;AAAA,EACA,aAAa;AAAA,IACX,UAAU,MAAM,OAAO,wBAAwB,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO;AAAA,EACxE;AACF,CAAC;AAED,eAAsB,IAAI,OAAiC;AACzD,QAAM,QAAQ,IAAI;AACpB;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/cli",
3
- "version": "2.21.1",
3
+ "version": "2.21.2",
4
4
  "description": "Generator cli",
5
5
  "keywords": [
6
6
  "typescript",
@@ -53,18 +53,18 @@
53
53
  "semver": "^7.6.2",
54
54
  "string-argv": "^0.3.2",
55
55
  "tinyrainbow": "^1.1.1",
56
- "@kubb/core": "2.21.1",
57
- "@kubb/fs": "2.21.1"
56
+ "@kubb/core": "2.21.2",
57
+ "@kubb/fs": "2.21.2"
58
58
  },
59
59
  "devDependencies": {
60
- "@types/node": "^20.14.7",
60
+ "@types/node": "^20.14.9",
61
61
  "@types/semver": "^7.5.8",
62
62
  "source-map-support": "^0.5.21",
63
63
  "tsup": "^8.1.0",
64
64
  "typescript": "^5.5.2",
65
- "@kubb/config-ts": "2.21.1",
66
- "@kubb/config-tsup": "2.21.1",
67
- "@kubb/plugin-oas": "2.21.1"
65
+ "@kubb/config-ts": "2.21.2",
66
+ "@kubb/config-tsup": "2.21.2",
67
+ "@kubb/plugin-oas": "2.21.2"
68
68
  },
69
69
  "engines": {
70
70
  "node": ">=18"
package/src/index.ts CHANGED
@@ -48,3 +48,5 @@ Run \`npm install -g @kubb/cli\` to update`,
48
48
  export async function run(_argv?: string[]): Promise<void> {
49
49
  await runMain(main)
50
50
  }
51
+
52
+ export { generate } from './generate.ts'
@@ -1,73 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __typeError = (msg) => {
8
- throw TypeError(msg);
9
- };
10
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
11
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
12
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
13
- }) : x)(function(x) {
14
- if (typeof require !== "undefined") return require.apply(this, arguments);
15
- throw Error('Dynamic require of "' + x + '" is not supported');
16
- });
17
- var __esm = (fn, res) => function __init() {
18
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
19
- };
20
- var __commonJS = (cb, mod) => function __require2() {
21
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
22
- };
23
- var __copyProps = (to, from, except, desc) => {
24
- if (from && typeof from === "object" || typeof from === "function") {
25
- for (let key of __getOwnPropNames(from))
26
- if (!__hasOwnProp.call(to, key) && key !== except)
27
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
28
- }
29
- return to;
30
- };
31
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
32
- // If the importer is in node compatibility mode or this is not an ESM
33
- // file that has been converted to a CommonJS file using a Babel-
34
- // compatible transform (i.e. "__esModule" has not been set), then set
35
- // "default" to the CommonJS "module.exports" for node compatibility.
36
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
37
- mod
38
- ));
39
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
40
- var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
41
- var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
42
- var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
43
- var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
44
- var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
45
- var __privateWrapper = (obj, member, setter, getter) => ({
46
- set _(value) {
47
- __privateSet(obj, member, value, setter);
48
- },
49
- get _() {
50
- return __privateGet(obj, member, getter);
51
- }
52
- });
53
-
54
- // ../../node_modules/.pnpm/tsup@8.1.0_@microsoft+api-extractor@7.47.0_ts-node@10.9.2_typescript@5.5.2/node_modules/tsup/assets/cjs_shims.js
55
- var init_cjs_shims = __esm({
56
- "../../node_modules/.pnpm/tsup@8.1.0_@microsoft+api-extractor@7.47.0_ts-node@10.9.2_typescript@5.5.2/node_modules/tsup/assets/cjs_shims.js"() {
57
- "use strict";
58
- }
59
- });
60
-
61
-
62
-
63
-
64
-
65
-
66
-
67
-
68
-
69
-
70
-
71
-
72
- exports.__require = __require; exports.__commonJS = __commonJS; exports.__toESM = __toESM; exports.__publicField = __publicField; exports.__privateGet = __privateGet; exports.__privateAdd = __privateAdd; exports.__privateSet = __privateSet; exports.__privateMethod = __privateMethod; exports.__privateWrapper = __privateWrapper; exports.init_cjs_shims = init_cjs_shims;
73
- //# sourceMappingURL=chunk-M5BJZT7M.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../node_modules/.pnpm/tsup@8.1.0_@microsoft+api-extractor@7.47.0_ts-node@10.9.2_typescript@5.5.2/node_modules/tsup/assets/cjs_shims.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["// Shim globals in cjs bundle\n// There's a weird bug that esbuild will always inject importMetaUrl\n// if we export it as `const importMetaUrl = ... __filename ...`\n// But using a function will not cause this issue\n\nconst getImportMetaUrl = () =>\n typeof document === 'undefined'\n ? new URL('file:' + __filename).href\n : (document.currentScript && document.currentScript.src) ||\n new URL('main.js', document.baseURI).href\n\nexport const importMetaUrl = /* @__PURE__ */ getImportMetaUrl()\n"]}