@kubb/cli 5.15.1 → 5.15.3
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/{Telemetry-C7Qwy2s7.js → Telemetry-BTeqnqie.js} +2 -2
- package/dist/{Telemetry-C7Qwy2s7.js.map → Telemetry-BTeqnqie.js.map} +1 -1
- package/dist/{Telemetry-B52pKz9i.cjs → Telemetry-DuO34wMx.cjs} +2 -2
- package/dist/{Telemetry-B52pKz9i.cjs.map → Telemetry-DuO34wMx.cjs.map} +1 -1
- package/dist/{background-CK2gQtTU.cjs → background-CdE3TOkv.cjs} +2 -2
- package/dist/{background-CK2gQtTU.cjs.map → background-CdE3TOkv.cjs.map} +1 -1
- package/dist/{background-BJCuXYuB.js → background-DxK8rpi2.js} +2 -2
- package/dist/{background-BJCuXYuB.js.map → background-DxK8rpi2.js.map} +1 -1
- package/dist/{background-D4mZCg-4.js → background-TT-XsxC2.js} +1 -1
- package/dist/{configFile-CoEpHdXG.cjs → configFile-CVfWdtKh.cjs} +4 -40
- package/dist/configFile-CVfWdtKh.cjs.map +1 -0
- package/dist/{configFile-C0DIXNMD.js → configFile-IHj8fRIw.js} +3 -39
- package/dist/configFile-IHj8fRIw.js.map +1 -0
- package/dist/{spinner-BZaln7O8.js → fs-Cf1FSRh9.js} +20 -41
- package/dist/fs-Cf1FSRh9.js.map +1 -0
- package/dist/index.cjs +14 -14
- package/dist/index.js +14 -14
- package/dist/{installWithSpinner-DpnpxHq5.js → installWithSpinner-BAlTSQlE.js} +3 -3
- package/dist/{installWithSpinner-DpnpxHq5.js.map → installWithSpinner-BAlTSQlE.js.map} +1 -1
- package/dist/{installWithSpinner-ONGfIVUJ.cjs → installWithSpinner-X9J7yxiR.cjs} +3 -3
- package/dist/{installWithSpinner-ONGfIVUJ.cjs.map → installWithSpinner-X9J7yxiR.cjs.map} +1 -1
- package/dist/intro-DRl-pwVs.js +72 -0
- package/dist/intro-DRl-pwVs.js.map +1 -0
- package/dist/intro-DuyzJ3Rb.cjs +102 -0
- package/dist/intro-DuyzJ3Rb.cjs.map +1 -0
- package/dist/{intro-9PB8sE8z.js → log-B-1vLxF1.js} +2 -66
- package/dist/log-B-1vLxF1.js.map +1 -0
- package/dist/{intro-YPaf1Imr.cjs → log-wv1OxLiq.cjs} +1 -95
- package/dist/log-wv1OxLiq.cjs.map +1 -0
- package/dist/{mascot-JSA0j3Q_.cjs → mascot-CC-D4ON2.cjs} +2 -2
- package/dist/{mascot-JSA0j3Q_.cjs.map → mascot-CC-D4ON2.cjs.map} +1 -1
- package/dist/{mascot--q1xjKw1.js → mascot-CmUUHLlx.js} +2 -2
- package/dist/{mascot--q1xjKw1.js.map → mascot-CmUUHLlx.js.map} +1 -1
- package/dist/{mcp-CcseJJwh.cjs → mcp-DMCyJrkw.cjs} +2 -2
- package/dist/{mcp-CcseJJwh.cjs.map → mcp-DMCyJrkw.cjs.map} +1 -1
- package/dist/{mcp-DUTsS8tR.js → mcp-DNMDPZOo.js} +2 -2
- package/dist/{mcp-DUTsS8tR.js.map → mcp-DNMDPZOo.js.map} +1 -1
- package/dist/{package-B1hUUjio.cjs → package-Bc9heh-c.cjs} +2 -2
- package/dist/package-Bc9heh-c.cjs.map +1 -0
- package/dist/package-Bm6L1D0Q.js +5 -0
- package/dist/package-Bm6L1D0Q.js.map +1 -0
- package/dist/{registry-B3eYk4LN.js → registry-Cy48PGdh.js} +3 -2
- package/dist/registry-Cy48PGdh.js.map +1 -0
- package/dist/{registry-YE1pFWL-.cjs → registry-Q77p5TZp.cjs} +3 -2
- package/dist/registry-Q77p5TZp.cjs.map +1 -0
- package/dist/reporters-9MqdcKPp.js +1 -0
- package/dist/{reporters-BM430HdQ.js → reporters-B_USHwD6.js} +297 -33
- package/dist/reporters-B_USHwD6.js.map +1 -0
- package/dist/{reporters-2cgjvXwR.cjs → reporters-DyjE3BzZ.cjs} +318 -20
- package/dist/reporters-DyjE3BzZ.cjs.map +1 -0
- package/dist/{run-CXVhxFfC.js → run-B4pveKq5.js} +10 -10
- package/dist/{run-CXVhxFfC.js.map → run-B4pveKq5.js.map} +1 -1
- package/dist/{run-CLiHI99L.js → run-B7p16C0S.js} +4 -4
- package/dist/{run-CLiHI99L.js.map → run-B7p16C0S.js.map} +1 -1
- package/dist/{run-dMTJfs4_.cjs → run-BBzw9B1L.cjs} +4 -4
- package/dist/{run-dMTJfs4_.cjs.map → run-BBzw9B1L.cjs.map} +1 -1
- package/dist/{run-DUwX6Icx.js → run-CBB5Hlgy.js} +10 -9
- package/dist/{run-DUwX6Icx.js.map → run-CBB5Hlgy.js.map} +1 -1
- package/dist/{run-CrM4jsix.cjs → run-CfumUZCl.cjs} +7 -6
- package/dist/{run-CrM4jsix.cjs.map → run-CfumUZCl.cjs.map} +1 -1
- package/dist/{run-D-nn9-Wq.js → run-Cgy4_JPy.js} +14 -18
- package/dist/run-Cgy4_JPy.js.map +1 -0
- package/dist/{run-1H9TGT8v.js → run-Ch7Uuu-u.js} +4 -3
- package/dist/{run-1H9TGT8v.js.map → run-Ch7Uuu-u.js.map} +1 -1
- package/dist/{run-BsrNfFIl.js → run-CkNLuV4M.js} +44 -38
- package/dist/run-CkNLuV4M.js.map +1 -0
- package/dist/{run-CyzKy-0p.cjs → run-CoPzxsoM.cjs} +20 -20
- package/dist/{run-CyzKy-0p.cjs.map → run-CoPzxsoM.cjs.map} +1 -1
- package/dist/{run-DTqMrPS9.js → run-CrDbD50I.js} +2 -2
- package/dist/{run-DTqMrPS9.js.map → run-CrDbD50I.js.map} +1 -1
- package/dist/{run-LY_UAYyM.cjs → run-Cxf3s3Ap.cjs} +48 -42
- package/dist/run-Cxf3s3Ap.cjs.map +1 -0
- package/dist/{run-BYP_t9dR.cjs → run-DCggecSY.cjs} +19 -24
- package/dist/run-DCggecSY.cjs.map +1 -0
- package/dist/{run-BrM7-NSV.js → run-DHfFHNfG.js} +13 -17
- package/dist/run-DHfFHNfG.js.map +1 -0
- package/dist/{run-DBnSbwtU.cjs → run-DQdcGuXL.cjs} +47 -61
- package/dist/run-DQdcGuXL.cjs.map +1 -0
- package/dist/{run-CvFakE3B.cjs → run-DT4hTOR2.cjs} +16 -21
- package/dist/run-DT4hTOR2.cjs.map +1 -0
- package/dist/{run-FEiyv6_U.js → run-DcEE0-8W.js} +40 -53
- package/dist/run-DcEE0-8W.js.map +1 -0
- package/dist/{run-Bq6gcfkS.js → run-MGGga_wU.js} +1 -1
- package/dist/{run-CQORv7Gq.cjs → run-S6Hkmn-h.cjs} +13 -12
- package/dist/{run-CQORv7Gq.cjs.map → run-S6Hkmn-h.cjs.map} +1 -1
- package/dist/{run-uPA5s3rI.cjs → run-UXFhmzzO.cjs} +2 -2
- package/dist/{run-uPA5s3rI.cjs.map → run-UXFhmzzO.cjs.map} +1 -1
- package/dist/shared-DcDHRtZx.js +58 -0
- package/dist/shared-DcDHRtZx.js.map +1 -0
- package/dist/shared-KKRMm1xX.cjs +87 -0
- package/dist/shared-KKRMm1xX.cjs.map +1 -0
- package/dist/{snapshot-CPF9zyZj.cjs → snapshot-BHFRCLgH.cjs} +7 -7
- package/dist/{snapshot-CPF9zyZj.cjs.map → snapshot-BHFRCLgH.cjs.map} +1 -1
- package/dist/{snapshot-CiV08NJr.js → snapshot-NH1AFDwz.js} +6 -6
- package/dist/{snapshot-CiV08NJr.js.map → snapshot-NH1AFDwz.js.map} +1 -1
- package/dist/spinner-DxsAllRI.js +48 -0
- package/dist/spinner-DxsAllRI.js.map +1 -0
- package/dist/{spinner-CfB0sIPy.cjs → spinner-RfMb7fd6.cjs} +50 -21
- package/dist/spinner-RfMb7fd6.cjs.map +1 -0
- package/dist/{status-C066YA-4.cjs → status-3A7fVPqb.cjs} +3 -3
- package/dist/{status-C066YA-4.cjs.map → status-3A7fVPqb.cjs.map} +1 -1
- package/dist/{status-Dj8tivag.js → status-BeJwJ7Xa.js} +3 -3
- package/dist/{status-Dj8tivag.js.map → status-BeJwJ7Xa.js.map} +1 -1
- package/dist/{studio-B4XsXgKj.js → studio-B-1AM1My.js} +12 -12
- package/dist/{studio-B4XsXgKj.js.map → studio-B-1AM1My.js.map} +1 -1
- package/dist/{studio-D9_-mKee.cjs → studio-BUhnJl4S.cjs} +12 -12
- package/dist/{studio-D9_-mKee.cjs.map → studio-BUhnJl4S.cjs.map} +1 -1
- package/dist/studioWorker.js +2 -2
- package/dist/{summary-Clvl5Hxs.cjs → summary-B2Apv5KO.cjs} +17 -2
- package/dist/summary-B2Apv5KO.cjs.map +1 -0
- package/dist/{summary-CbmQKA8l.js → summary-BQWHL_Ca.js} +12 -3
- package/dist/summary-BQWHL_Ca.js.map +1 -0
- package/dist/{text-Ep3AulAS.cjs → text-DMiX2dcG.cjs} +10 -1
- package/dist/text-DMiX2dcG.cjs.map +1 -0
- package/dist/{text-BmiI4s6N.js → text-EoYn04SX.js} +5 -2
- package/dist/text-EoYn04SX.js.map +1 -0
- package/dist/{utils-CbJ6hS_t.js → utils-CeMUE4P0.js} +90 -70
- package/dist/utils-CeMUE4P0.js.map +1 -0
- package/dist/{utils-CO89mxRU.cjs → utils-uSJAZuvP.cjs} +101 -69
- package/dist/utils-uSJAZuvP.cjs.map +1 -0
- package/dist/{validate-C5fyNF4v.js → validate--AEg1yAB.js} +3 -3
- package/dist/{validate-C5fyNF4v.js.map → validate--AEg1yAB.js.map} +1 -1
- package/dist/{validate-B3tLWYJU.cjs → validate-BVNrsXe2.cjs} +3 -3
- package/dist/{validate-B3tLWYJU.cjs.map → validate-BVNrsXe2.cjs.map} +1 -1
- package/package.json +8 -7
- package/dist/configFile-C0DIXNMD.js.map +0 -1
- package/dist/configFile-CoEpHdXG.cjs.map +0 -1
- package/dist/intro-9PB8sE8z.js.map +0 -1
- package/dist/intro-YPaf1Imr.cjs.map +0 -1
- package/dist/package-B1hUUjio.cjs.map +0 -1
- package/dist/package-MYPMnnTX.js +0 -5
- package/dist/package-MYPMnnTX.js.map +0 -1
- package/dist/registry-B3eYk4LN.js.map +0 -1
- package/dist/registry-YE1pFWL-.cjs.map +0 -1
- package/dist/reporters-2cgjvXwR.cjs.map +0 -1
- package/dist/reporters-BM430HdQ.js.map +0 -1
- package/dist/run-BYP_t9dR.cjs.map +0 -1
- package/dist/run-BrM7-NSV.js.map +0 -1
- package/dist/run-BsrNfFIl.js.map +0 -1
- package/dist/run-CvFakE3B.cjs.map +0 -1
- package/dist/run-D-nn9-Wq.js.map +0 -1
- package/dist/run-DBnSbwtU.cjs.map +0 -1
- package/dist/run-FEiyv6_U.js.map +0 -1
- package/dist/run-LY_UAYyM.cjs.map +0 -1
- package/dist/shared-C0EtrdUm.cjs +0 -123
- package/dist/shared-C0EtrdUm.cjs.map +0 -1
- package/dist/shared-Ct9stKpp.js +0 -94
- package/dist/shared-Ct9stKpp.js.map +0 -1
- package/dist/spinner-BZaln7O8.js.map +0 -1
- package/dist/spinner-CfB0sIPy.cjs.map +0 -1
- package/dist/summary-CbmQKA8l.js.map +0 -1
- package/dist/summary-Clvl5Hxs.cjs.map +0 -1
- package/dist/text-BmiI4s6N.js.map +0 -1
- package/dist/text-Ep3AulAS.cjs.map +0 -1
- package/dist/utils-BdibacYq.js +0 -244
- package/dist/utils-BdibacYq.js.map +0 -1
- package/dist/utils-CO89mxRU.cjs.map +0 -1
- package/dist/utils-CbJ6hS_t.js.map +0 -1
- package/dist/utils-CcARPB45.cjs +0 -286
- package/dist/utils-CcARPB45.cjs.map +0 -1
|
@@ -1,64 +1,90 @@
|
|
|
1
1
|
import "./rolldown-runtime-xo6NMXYd.js";
|
|
2
|
-
import {
|
|
2
|
+
import { a as toPosixPath, i as read, o as write } from "./fs-Cf1FSRh9.js";
|
|
3
3
|
import process from "node:process";
|
|
4
4
|
import { x } from "tinyexec";
|
|
5
|
+
import { glob } from "node:fs/promises";
|
|
5
6
|
import path from "node:path";
|
|
6
7
|
import fs from "node:fs";
|
|
7
8
|
import { Diagnostics } from "@kubb/core";
|
|
9
|
+
import { detect, resolveCommand } from "package-manager-detector";
|
|
10
|
+
// ../../internals/utils/src/casing.ts
|
|
11
|
+
/**
|
|
12
|
+
* Shared implementation for camelCase and PascalCase conversion.
|
|
13
|
+
* Splits on common word boundaries (spaces, hyphens, underscores, dots, slashes, colons)
|
|
14
|
+
* and capitalizes each word according to `pascal`.
|
|
15
|
+
*
|
|
16
|
+
* When `pascal` is `true` the first word is also capitalized (PascalCase), otherwise only subsequent words are.
|
|
17
|
+
*/
|
|
18
|
+
function convert(text, pascal) {
|
|
19
|
+
return text.trim().replace(/([a-z\d])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").replace(/(\d)([a-z])/g, "$1 $2").split(/[\s\-_./\\:]+/).filter(Boolean).map((word, i) => {
|
|
20
|
+
if (word.length > 1 && word === word.toUpperCase()) return word;
|
|
21
|
+
return (i === 0 && !pascal ? word.charAt(0).toLowerCase() : word.charAt(0).toUpperCase()) + word.slice(1);
|
|
22
|
+
}).join("").replace(/[^a-zA-Z0-9]/g, "");
|
|
23
|
+
}
|
|
24
|
+
const cache = /* @__PURE__ */ new Map();
|
|
25
|
+
const cacheLimit = 1e5;
|
|
26
|
+
function toCamelOrPascal(text, pascal) {
|
|
27
|
+
const key = `${pascal ? "P" : "c"}${text}`;
|
|
28
|
+
const cached = cache.get(key);
|
|
29
|
+
if (cached !== void 0) return cached;
|
|
30
|
+
const result = convert(text, pascal);
|
|
31
|
+
if (cache.size >= cacheLimit) cache.clear();
|
|
32
|
+
cache.set(key, result);
|
|
33
|
+
return result;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Converts `text` to camelCase.
|
|
37
|
+
*
|
|
38
|
+
* @example Word boundaries
|
|
39
|
+
* `camelCase('hello-world') // 'helloWorld'`
|
|
40
|
+
*
|
|
41
|
+
* @example With a prefix
|
|
42
|
+
* `camelCase('tag', { prefix: 'create' }) // 'createTag'`
|
|
43
|
+
*/
|
|
44
|
+
function camelCase(text, { prefix = "", suffix = "" } = {}) {
|
|
45
|
+
return toCamelOrPascal(`${prefix} ${text} ${suffix}`, false);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Converts `text` to PascalCase.
|
|
49
|
+
*
|
|
50
|
+
* @example Word boundaries
|
|
51
|
+
* `pascalCase('hello-world') // 'HelloWorld'`
|
|
52
|
+
*
|
|
53
|
+
* @example With a suffix
|
|
54
|
+
* `pascalCase('tag', { suffix: 'schema' }) // 'TagSchema'`
|
|
55
|
+
*/
|
|
56
|
+
function pascalCase(text, { prefix = "", suffix = "" } = {}) {
|
|
57
|
+
return toCamelOrPascal(`${prefix} ${text} ${suffix}`, true);
|
|
58
|
+
}
|
|
8
59
|
// src/runners/init/utils.ts
|
|
9
|
-
/**
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
runCommand: []
|
|
18
|
-
},
|
|
19
|
-
yarn: {
|
|
20
|
-
name: "yarn",
|
|
21
|
-
lockFiles: ["yarn.lock"],
|
|
22
|
-
initCommand: ["init", "-y"],
|
|
23
|
-
installCommand: ["add", "-D"],
|
|
24
|
-
removeCommand: ["remove"],
|
|
25
|
-
runCommand: []
|
|
26
|
-
},
|
|
27
|
-
bun: {
|
|
28
|
-
name: "bun",
|
|
29
|
-
lockFiles: ["bun.lock", "bun.lockb"],
|
|
30
|
-
initCommand: ["init", "-y"],
|
|
31
|
-
installCommand: ["add", "-d"],
|
|
32
|
-
removeCommand: ["remove"],
|
|
33
|
-
runCommand: ["run"]
|
|
34
|
-
},
|
|
35
|
-
npm: {
|
|
36
|
-
name: "npm",
|
|
37
|
-
lockFiles: ["package-lock.json"],
|
|
38
|
-
initCommand: ["init", "-y"],
|
|
39
|
-
installCommand: ["install", "--save-dev"],
|
|
40
|
-
removeCommand: ["uninstall"],
|
|
41
|
-
runCommand: ["run"]
|
|
42
|
-
}
|
|
60
|
+
/**
|
|
61
|
+
* Subcommands that create a `package.json`; `package-manager-detector` has no `init` command.
|
|
62
|
+
*/
|
|
63
|
+
const initCommands = {
|
|
64
|
+
npm: ["init", "-y"],
|
|
65
|
+
pnpm: ["init"],
|
|
66
|
+
yarn: ["init", "-y"],
|
|
67
|
+
bun: ["init", "-y"]
|
|
43
68
|
};
|
|
44
|
-
/**
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
69
|
+
/**
|
|
70
|
+
* Detects the package manager in `cwd`: the `packageManager` field in `package.json`, then a lock file, then `npm`. Parent folders are not searched.
|
|
71
|
+
*/
|
|
72
|
+
async function detectPackageManager(cwd = process.cwd()) {
|
|
73
|
+
const found = await detect({
|
|
74
|
+
cwd,
|
|
75
|
+
stopDir: cwd,
|
|
76
|
+
strategies: ["packageManager-field", "lockfile"]
|
|
77
|
+
});
|
|
78
|
+
return found && found.name in initCommands ? found : {
|
|
79
|
+
name: "npm",
|
|
80
|
+
agent: "npm"
|
|
81
|
+
};
|
|
56
82
|
}
|
|
57
83
|
/**
|
|
58
84
|
* Initializes a new `package.json` at `cwd` using the detected package manager.
|
|
59
85
|
*/
|
|
60
86
|
async function initPackageJson(cwd, packageManager) {
|
|
61
|
-
await x(packageManager.name, [...packageManager.
|
|
87
|
+
await x(packageManager.name, [...initCommands[packageManager.name]], {
|
|
62
88
|
nodeOptions: {
|
|
63
89
|
cwd,
|
|
64
90
|
stdio: "inherit"
|
|
@@ -72,9 +98,9 @@ const INSTALL_TIMEOUT_MS = 3e5;
|
|
|
72
98
|
* to `onLine`, so the caller can show it while the install runs; a failed install also keeps the
|
|
73
99
|
* end of the output in the error.
|
|
74
100
|
*/
|
|
75
|
-
async function installPackages(packages, packageManager, cwd = process.cwd(), onLine, command =
|
|
76
|
-
const args =
|
|
77
|
-
const result = x(
|
|
101
|
+
async function installPackages(packages, packageManager, cwd = process.cwd(), onLine, command = "add") {
|
|
102
|
+
const { command: bin, args } = resolveCommand(packageManager.agent, command, command === "add" ? ["-D", ...packages] : packages);
|
|
103
|
+
const result = x(bin, args, {
|
|
78
104
|
nodeOptions: {
|
|
79
105
|
cwd,
|
|
80
106
|
stdio: [
|
|
@@ -92,15 +118,15 @@ async function installPackages(packages, packageManager, cwd = process.cwd(), on
|
|
|
92
118
|
onLine?.(line);
|
|
93
119
|
}
|
|
94
120
|
if (result.exitCode === 0) return;
|
|
95
|
-
if (result.exitCode === void 0) throw new Error(`\`${
|
|
121
|
+
if (result.exitCode === void 0) throw new Error(`\`${bin} ${args.join(" ")}\` timed out after ${INSTALL_TIMEOUT_MS / 6e4} minutes`);
|
|
96
122
|
const output = lines.slice(-20).join("\n");
|
|
97
|
-
throw new Error(`\`${
|
|
123
|
+
throw new Error(`\`${bin} ${args.join(" ")}\` failed with exit code ${result.exitCode}${output ? `:\n${output}` : ""}`);
|
|
98
124
|
}
|
|
99
125
|
/**
|
|
100
126
|
* Uninstalls the given packages at `cwd` with the package manager's remove command, like {@link installPackages}.
|
|
101
127
|
*/
|
|
102
128
|
function uninstallPackages(packages, packageManager, cwd = process.cwd()) {
|
|
103
|
-
return installPackages(packages, packageManager, cwd, void 0,
|
|
129
|
+
return installPackages(packages, packageManager, cwd, void 0, "uninstall");
|
|
104
130
|
}
|
|
105
131
|
/**
|
|
106
132
|
* What the selected plugins' `manifests` say is missing from the selection: a `dependencies`
|
|
@@ -128,23 +154,17 @@ const SKIPPED_DIRS = /* @__PURE__ */ new Set([
|
|
|
128
154
|
]);
|
|
129
155
|
/**
|
|
130
156
|
* Finds OpenAPI spec files up to `depth` folders below `cwd`, shallowest first, as `./`-relative
|
|
131
|
-
* paths.
|
|
157
|
+
* paths. Skips hidden and build folders without walking them and returns at most `limit` files.
|
|
132
158
|
*/
|
|
133
159
|
async function findSpecFiles(cwd, { depth = 3, limit = 20 } = {}) {
|
|
134
160
|
const found = [];
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
for (const { dir, entries } of listings) for (const entry of entries.toSorted((a, b) => a.name.localeCompare(b.name))) {
|
|
143
|
-
if (entry.isFile() && SPEC_FILE.test(entry.name)) found.push(`./${path.posix.join(dir, entry.name)}`);
|
|
144
|
-
if (entry.isDirectory() && !entry.name.startsWith(".") && !SKIPPED_DIRS.has(entry.name)) level.push(path.posix.join(dir, entry.name));
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
return found.slice(0, limit);
|
|
161
|
+
const pattern = `{${Array.from({ length: depth + 1 }, (_, level) => "*/".repeat(level)).join(",")}}*`;
|
|
162
|
+
const files = glob(pattern, {
|
|
163
|
+
cwd,
|
|
164
|
+
exclude: (file) => file.split(path.sep).some((segment) => SKIPPED_DIRS.has(segment))
|
|
165
|
+
});
|
|
166
|
+
for await (const file of files) if (SPEC_FILE.test(path.basename(file))) found.push(toPosixPath(file));
|
|
167
|
+
return found.toSorted((a, b) => a.split("/").length - b.split("/").length || a.localeCompare(b)).slice(0, limit).map((file) => `./${file}`);
|
|
148
168
|
}
|
|
149
169
|
const SPEC_HEAD_BYTES = 262144;
|
|
150
170
|
const METHOD = "(?:get|put|post|delete|options|head|patch|trace)";
|
|
@@ -217,6 +237,6 @@ async function addGenerateScript(cwd) {
|
|
|
217
237
|
async function generateScript(cwd) {
|
|
218
238
|
return (await readPackageJson(cwd)).scripts?.generate;
|
|
219
239
|
}
|
|
220
|
-
export { generateScript as a, missingPluginDependencies as c, uninstallPackages as d, findSpecFiles as i, parsePluginsFlag as l, detectPackageManager as n, initPackageJson as o, findPlugin as r, installPackages as s, addGenerateScript as t, readSpecInfo as u };
|
|
240
|
+
export { generateScript as a, missingPluginDependencies as c, uninstallPackages as d, camelCase as f, findSpecFiles as i, parsePluginsFlag as l, detectPackageManager as n, initPackageJson as o, pascalCase as p, findPlugin as r, installPackages as s, addGenerateScript as t, readSpecInfo as u };
|
|
221
241
|
|
|
222
|
-
//# sourceMappingURL=utils-
|
|
242
|
+
//# sourceMappingURL=utils-CeMUE4P0.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils-CeMUE4P0.js","names":[],"sources":["../../../internals/utils/src/casing.ts","../src/runners/init/utils.ts"],"sourcesContent":["type Options = {\n /**\n * Text prepended before casing is applied.\n */\n prefix?: string\n /**\n * Text appended before casing is applied.\n */\n suffix?: string\n}\n\n/**\n * Shared implementation for camelCase and PascalCase conversion.\n * Splits on common word boundaries (spaces, hyphens, underscores, dots, slashes, colons)\n * and capitalizes each word according to `pascal`.\n *\n * When `pascal` is `true` the first word is also capitalized (PascalCase), otherwise only subsequent words are.\n */\nfunction convert(text: string, pascal: boolean): string {\n return text\n .trim()\n .replace(/([a-z\\d])([A-Z])/g, '$1 $2')\n .replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2')\n .replace(/(\\d)([a-z])/g, '$1 $2')\n .split(/[\\s\\-_./\\\\:]+/)\n .filter(Boolean)\n .map((word, i) => {\n if (word.length > 1 && word === word.toUpperCase()) return word\n const head = i === 0 && !pascal ? word.charAt(0).toLowerCase() : word.charAt(0).toUpperCase()\n return head + word.slice(1)\n })\n .join('')\n .replace(/[^a-zA-Z0-9]/g, '')\n}\n\n// Plugins case the same names on every visit. Clearing at the limit bounds a long-running host.\nconst cache = new Map<string, string>()\nconst cacheLimit = 100_000\n\nfunction toCamelOrPascal(text: string, pascal: boolean): string {\n const key = `${pascal ? 'P' : 'c'}${text}`\n const cached = cache.get(key)\n if (cached !== undefined) return cached\n\n const result = convert(text, pascal)\n if (cache.size >= cacheLimit) cache.clear()\n cache.set(key, result)\n return result\n}\n\n/**\n * Converts `text` to camelCase.\n *\n * @example Word boundaries\n * `camelCase('hello-world') // 'helloWorld'`\n *\n * @example With a prefix\n * `camelCase('tag', { prefix: 'create' }) // 'createTag'`\n */\nexport function camelCase(text: string, { prefix = '', suffix = '' }: Options = {}): string {\n return toCamelOrPascal(`${prefix} ${text} ${suffix}`, false)\n}\n\n/**\n * Converts `text` to PascalCase.\n *\n * @example Word boundaries\n * `pascalCase('hello-world') // 'HelloWorld'`\n *\n * @example With a suffix\n * `pascalCase('tag', { suffix: 'schema' }) // 'TagSchema'`\n */\nexport function pascalCase(text: string, { prefix = '', suffix = '' }: Options = {}): string {\n return toCamelOrPascal(`${prefix} ${text} ${suffix}`, true)\n}\n","import fs from 'node:fs'\nimport { glob } from 'node:fs/promises'\nimport path from 'node:path'\nimport process from 'node:process'\nimport { read, toPosixPath, write } from '@internals/utils'\nimport { Diagnostics, type ExtensionManifest, type RegistryEntry } from '@kubb/core'\nimport { type Agent, type AgentName, detect, resolveCommand } from 'package-manager-detector'\nimport { x } from 'tinyexec'\n\nexport type PackageManagerName = Extract<AgentName, 'npm' | 'pnpm' | 'yarn' | 'bun'>\n\n/**\n * A project's package manager: `name` for messages, `agent` for `resolveCommand`.\n */\nexport type PackageManagerInfo = { name: PackageManagerName; agent: Agent }\n\n/**\n * Subcommands that create a `package.json`; `package-manager-detector` has no `init` command.\n */\nconst initCommands: Record<PackageManagerName, ReadonlyArray<string>> = { npm: ['init', '-y'], pnpm: ['init'], yarn: ['init', '-y'], bun: ['init', '-y'] }\n\n/** Minimal shape of `package.json` fields read during detection. */\ntype PackageJson = {\n /** The `packageManager` field from `package.json` (e.g. `\"pnpm@9.0.0\"`). */\n packageManager?: string\n scripts?: Record<string, string>\n}\n\n/**\n * Detects the package manager in `cwd`: the `packageManager` field in `package.json`, then a lock file, then `npm`. Parent folders are not searched.\n */\nexport async function detectPackageManager(cwd: string = process.cwd()): Promise<PackageManagerInfo> {\n const found = await detect({ cwd, stopDir: cwd, strategies: ['packageManager-field', 'lockfile'] })\n return found && found.name in initCommands ? (found as PackageManagerInfo) : { name: 'npm', agent: 'npm' }\n}\n\n/**\n * Initializes a new `package.json` at `cwd` using the detected package manager.\n */\nexport async function initPackageJson(cwd: string, packageManager: PackageManagerInfo): Promise<void> {\n await x(packageManager.name, [...initCommands[packageManager.name]], {\n nodeOptions: { cwd, stdio: 'inherit' },\n throwOnError: true,\n })\n}\n\n/** How many trailing lines of a failed install's output the error keeps. */\nconst INSTALL_OUTPUT_LINES = 20\nconst INSTALL_TIMEOUT_MS = 5 * 60_000\n\n/**\n * Installs the given packages at `cwd` using the detected package manager. Each output line goes\n * to `onLine`, so the caller can show it while the install runs; a failed install also keeps the\n * end of the output in the error.\n */\nexport async function installPackages(\n packages: Array<string>,\n packageManager: PackageManagerInfo,\n cwd: string = process.cwd(),\n onLine?: (line: string) => void,\n command: 'add' | 'uninstall' = 'add',\n): Promise<void> {\n const { command: bin, args } = resolveCommand(packageManager.agent, command, command === 'add' ? ['-D', ...packages] : packages)!\n // No stdin, so a package manager that wants input fails instead of waiting. The timeout ends a stalled install.\n const result = x(bin, args, {\n nodeOptions: { cwd, stdio: ['ignore', 'pipe', 'pipe'] },\n timeout: INSTALL_TIMEOUT_MS,\n throwOnError: false,\n })\n const lines: Array<string> = []\n for await (const line of result) {\n lines.push(line)\n onLine?.(line)\n }\n if (result.exitCode === 0) return\n if (result.exitCode === undefined) throw new Error(`\\`${bin} ${args.join(' ')}\\` timed out after ${INSTALL_TIMEOUT_MS / 60_000} minutes`)\n\n const output = lines.slice(-INSTALL_OUTPUT_LINES).join('\\n')\n throw new Error(`\\`${bin} ${args.join(' ')}\\` failed with exit code ${result.exitCode}${output ? `:\\n${output}` : ''}`)\n}\n\n/**\n * Uninstalls the given packages at `cwd` with the package manager's remove command, like {@link installPackages}.\n */\nexport function uninstallPackages(packages: Array<string>, packageManager: PackageManagerInfo, cwd: string = process.cwd()): Promise<void> {\n return installPackages(packages, packageManager, cwd, undefined, 'uninstall')\n}\n\n/**\n * What the selected plugins' `manifests` say is missing from the selection: a `dependencies`\n * entry, or a `client` plugin next to a `consumer`. Empty when nothing is missing.\n * `optionalDependencies` are skipped, since `kubb init` writes the default options.\n */\nexport function missingPluginDependencies(manifests: Array<ExtensionManifest>): Array<string> {\n const selected = manifests.map((manifest) => manifest.name)\n const hasClient = manifests.some((manifest) => manifest.role === 'client')\n return manifests.flatMap((manifest) => [\n ...(manifest.dependencies ?? []).filter((name) => !selected.includes(name)).map((name) => `${manifest.name} needs ${name}.`),\n ...(manifest.role === 'consumer' && !hasClient ? [`${manifest.name} needs a client plugin, such as plugin-axios or plugin-fetch.`] : []),\n ])\n}\n\nasync function readPackageJson(cwd: string): Promise<PackageJson> {\n try {\n return JSON.parse(await read(path.join(cwd, 'package.json'))) as PackageJson\n } catch {\n return {}\n }\n}\n\nconst SPEC_FILE = /^(openapi|swagger)[\\w.-]*\\.(ya?ml|json)$/i\nconst SKIPPED_DIRS = new Set(['node_modules', 'dist', 'build', 'coverage'])\n\n/**\n * Finds OpenAPI spec files up to `depth` folders below `cwd`, shallowest first, as `./`-relative\n * paths. Skips hidden and build folders without walking them and returns at most `limit` files.\n */\nexport async function findSpecFiles(cwd: string, { depth = 3, limit = 20 }: { depth?: number; limit?: number } = {}): Promise<Array<string>> {\n const found: Array<string> = []\n const pattern = `{${Array.from({ length: depth + 1 }, (_, level) => '*/'.repeat(level)).join(',')}}*`\n // The extension stays out of the pattern so SPEC_FILE matches it case-insensitively. Dot folders are skipped by default.\n const files = glob(pattern, { cwd, exclude: (file) => file.split(path.sep).some((segment) => SKIPPED_DIRS.has(segment)) })\n for await (const file of files) if (SPEC_FILE.test(path.basename(file))) found.push(toPosixPath(file))\n return found\n .toSorted((a, b) => a.split('/').length - b.split('/').length || a.localeCompare(b))\n .slice(0, limit)\n .map((file) => `./${file}`)\n}\n\n/** The spec version and operation count, when the file states them. */\nexport type SpecInfo = { version?: string; operations?: number }\n\nconst SPEC_HEAD_BYTES = 256 * 1024\nconst METHOD = '(?:get|put|post|delete|options|head|patch|trace)'\n\n/**\n * Reads the OpenAPI or Swagger version and counts the operations from the first 256 KB of the\n * file, so a large spec is never parsed. The count is left out when the file is longer.\n */\nexport async function readSpecInfo(file: string): Promise<SpecInfo> {\n const handle = await fs.promises.open(file)\n try {\n const buffer = Buffer.alloc(SPEC_HEAD_BYTES)\n const { bytesRead } = await handle.read(buffer, 0, SPEC_HEAD_BYTES, 0)\n const head = buffer.toString('utf-8', 0, bytesRead)\n const complete = bytesRead < SPEC_HEAD_BYTES\n const version = head.match(/^\\s*[\"']?(?:openapi|swagger)[\"']?\\s*:\\s*[\"']?(\\d[\\d.]*)/m)?.[1]\n // shortcut: counts method keys at any depth, so a schema property named `get` counts too; use the adapter when that matters.\n const methods = new RegExp(`^\\\\s*[\"']?${METHOD}[\"']?\\\\s*:\\\\s*(?:\\\\{|$)`, 'gm')\n return { version, operations: complete ? (head.match(methods)?.length ?? 0) : undefined }\n } finally {\n await handle.close()\n }\n}\n\n/** Finds a plugin by registry id, slug, or short name, so `ts`, `plugin-ts`, and `kubb-labs/plugin-ts` all match. */\nexport function findPlugin({ plugins, id }: { plugins: Array<RegistryEntry>; id: string }): RegistryEntry | undefined {\n const ids = id.includes('/') ? [id] : [`kubb-labs/${id}`, `kubb-labs/plugin-${id}`]\n return plugins.find((entry) => ids.includes(entry.id))\n}\n\n/**\n * Turns the comma-separated `--plugins` value into registry entries.\n *\n * @throws when an id is not in `plugins`.\n */\nexport function parsePluginsFlag({ plugins, value }: { plugins: Array<RegistryEntry>; value: string }): Array<RegistryEntry> {\n const ids = value\n .split(',')\n .map((id) => id.trim())\n .filter(Boolean)\n const unknown = ids.filter((id) => !findPlugin({ plugins, id }))\n if (unknown.length)\n throw new Diagnostics.Error({\n code: Diagnostics.code.pluginNotFound,\n severity: 'error',\n message: `Not in the Kubb registry: ${unknown.join(', ')}. Browse the plugins at https://kubb.dev/extensions.`,\n help: 'Use plugin ids from https://kubb.dev/extensions, such as plugin-ts or ts.',\n })\n return ids.map((id) => findPlugin({ plugins, id })!)\n}\n\n/** Adds `\"generate\": \"kubb generate\"` to the `package.json` scripts at `cwd`. Returns `false`, and changes nothing, when a `generate` script exists. */\nexport async function addGenerateScript(cwd: string): Promise<boolean> {\n const file = path.join(cwd, 'package.json')\n const source = await read(file)\n const packageJson = JSON.parse(source) as PackageJson\n if (packageJson.scripts?.generate !== undefined) return false\n const indent = source.match(/^[ \\t]+/m)?.[0] ?? ' '\n const updated = { ...packageJson, scripts: { ...packageJson.scripts, generate: 'kubb generate' } }\n await write(file, JSON.stringify(updated, null, indent))\n return true\n}\n\n/** Reads the `generate` script from the `package.json` at `cwd`. */\nexport async function generateScript(cwd: string): Promise<string | undefined> {\n return (await readPackageJson(cwd)).scripts?.generate\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAkBA,SAAS,QAAQ,MAAc,QAAyB;CACtD,OAAO,KACJ,KAAK,CAAC,CACN,QAAQ,qBAAqB,OAAO,CAAC,CACrC,QAAQ,yBAAyB,OAAO,CAAC,CACzC,QAAQ,gBAAgB,OAAO,CAAC,CAChC,MAAM,eAAe,CAAC,CACtB,OAAO,OAAO,CAAC,CACf,KAAK,MAAM,MAAM;EAChB,IAAI,KAAK,SAAS,KAAK,SAAS,KAAK,YAAY,GAAG,OAAO;EAE3D,QADa,MAAM,KAAK,CAAC,SAAS,KAAK,OAAO,CAAC,CAAC,CAAC,YAAY,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,YAAY,KAC9E,KAAK,MAAM,CAAC;CAC5B,CAAC,CAAC,CACD,KAAK,EAAE,CAAC,CACR,QAAQ,iBAAiB,EAAE;AAChC;AAGA,MAAM,wBAAQ,IAAI,IAAoB;AACtC,MAAM,aAAa;AAEnB,SAAS,gBAAgB,MAAc,QAAyB;CAC9D,MAAM,MAAM,GAAG,SAAS,MAAM,MAAM;CACpC,MAAM,SAAS,MAAM,IAAI,GAAG;CAC5B,IAAI,WAAW,KAAA,GAAW,OAAO;CAEjC,MAAM,SAAS,QAAQ,MAAM,MAAM;CACnC,IAAI,MAAM,QAAQ,YAAY,MAAM,MAAM;CAC1C,MAAM,IAAI,KAAK,MAAM;CACrB,OAAO;AACT;;;;;;;;;;AAWA,SAAgB,UAAU,MAAc,EAAE,SAAS,IAAI,SAAS,OAAgB,CAAC,GAAW;CAC1F,OAAO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CAAC,aAAa,MAAM,oBAAoB,IAAI;CAClF,OAAO,QAAQ,MAAM,UAAU,IAAI,SAAS,MAAM,EAAE,CAAC;AACvD;;;;;;AAOA,SAAgB,iBAAiB,EAAE,SAAS,SAAiF;CAC3H,MAAM,MAAM,MACT,MAAM,GAAG,CAAC,CACV,KAAK,OAAO,GAAG,KAAK,CAAC,CAAC,CACtB,OAAO,OAAO;CACjB,MAAM,UAAU,IAAI,QAAQ,OAAO,CAAC,WAAW;EAAE;EAAS;CAAG,CAAC,CAAC;CAC/D,IAAI,QAAQ,QACV,MAAM,IAAI,YAAY,MAAM;EAC1B,MAAM,YAAY,KAAK;EACvB,UAAU;EACV,SAAS,6BAA6B,QAAQ,KAAK,IAAI,EAAE;EACzD,MAAM;CACR,CAAC;CACH,OAAO,IAAI,KAAK,OAAO,WAAW;EAAE;EAAS;CAAG,CAAC,CAAE;AACrD;;AAGA,eAAsB,kBAAkB,KAA+B;CACrE,MAAM,OAAO,KAAK,KAAK,KAAK,cAAc;CAC1C,MAAM,SAAS,MAAM,KAAK,IAAI;CAC9B,MAAM,cAAc,KAAK,MAAM,MAAM;CACrC,IAAI,YAAY,SAAS,aAAa,KAAA,GAAW,OAAO;CACxD,MAAM,SAAS,OAAO,MAAM,UAAU,CAAC,GAAG,MAAM;CAChD,MAAM,UAAU;EAAE,GAAG;EAAa,SAAS;GAAE,GAAG,YAAY;GAAS,UAAU;EAAgB;CAAE;CACjG,MAAM,MAAM,MAAM,KAAK,UAAU,SAAS,MAAM,MAAM,CAAC;CACvD,OAAO;AACT;;AAGA,eAAsB,eAAe,KAA0C;CAC7E,QAAQ,MAAM,gBAAgB,GAAG,EAAA,CAAG,SAAS;AAC/C"}
|
|
@@ -1,67 +1,93 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./rolldown-runtime-C3-Zg-KD.cjs");
|
|
2
|
-
const require_spinner = require("./spinner-
|
|
2
|
+
const require_spinner = require("./spinner-RfMb7fd6.cjs");
|
|
3
3
|
let node_process = require("node:process");
|
|
4
4
|
node_process = require_rolldown_runtime.__toESM(node_process, 1);
|
|
5
5
|
let tinyexec = require("tinyexec");
|
|
6
|
+
let node_fs_promises = require("node:fs/promises");
|
|
6
7
|
let node_path = require("node:path");
|
|
7
8
|
node_path = require_rolldown_runtime.__toESM(node_path, 1);
|
|
8
9
|
let node_fs = require("node:fs");
|
|
9
10
|
node_fs = require_rolldown_runtime.__toESM(node_fs, 1);
|
|
10
11
|
let _kubb_core = require("@kubb/core");
|
|
12
|
+
let package_manager_detector = require("package-manager-detector");
|
|
13
|
+
// ../../internals/utils/src/casing.ts
|
|
14
|
+
/**
|
|
15
|
+
* Shared implementation for camelCase and PascalCase conversion.
|
|
16
|
+
* Splits on common word boundaries (spaces, hyphens, underscores, dots, slashes, colons)
|
|
17
|
+
* and capitalizes each word according to `pascal`.
|
|
18
|
+
*
|
|
19
|
+
* When `pascal` is `true` the first word is also capitalized (PascalCase), otherwise only subsequent words are.
|
|
20
|
+
*/
|
|
21
|
+
function convert(text, pascal) {
|
|
22
|
+
return text.trim().replace(/([a-z\d])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").replace(/(\d)([a-z])/g, "$1 $2").split(/[\s\-_./\\:]+/).filter(Boolean).map((word, i) => {
|
|
23
|
+
if (word.length > 1 && word === word.toUpperCase()) return word;
|
|
24
|
+
return (i === 0 && !pascal ? word.charAt(0).toLowerCase() : word.charAt(0).toUpperCase()) + word.slice(1);
|
|
25
|
+
}).join("").replace(/[^a-zA-Z0-9]/g, "");
|
|
26
|
+
}
|
|
27
|
+
const cache = /* @__PURE__ */ new Map();
|
|
28
|
+
const cacheLimit = 1e5;
|
|
29
|
+
function toCamelOrPascal(text, pascal) {
|
|
30
|
+
const key = `${pascal ? "P" : "c"}${text}`;
|
|
31
|
+
const cached = cache.get(key);
|
|
32
|
+
if (cached !== void 0) return cached;
|
|
33
|
+
const result = convert(text, pascal);
|
|
34
|
+
if (cache.size >= cacheLimit) cache.clear();
|
|
35
|
+
cache.set(key, result);
|
|
36
|
+
return result;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Converts `text` to camelCase.
|
|
40
|
+
*
|
|
41
|
+
* @example Word boundaries
|
|
42
|
+
* `camelCase('hello-world') // 'helloWorld'`
|
|
43
|
+
*
|
|
44
|
+
* @example With a prefix
|
|
45
|
+
* `camelCase('tag', { prefix: 'create' }) // 'createTag'`
|
|
46
|
+
*/
|
|
47
|
+
function camelCase(text, { prefix = "", suffix = "" } = {}) {
|
|
48
|
+
return toCamelOrPascal(`${prefix} ${text} ${suffix}`, false);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Converts `text` to PascalCase.
|
|
52
|
+
*
|
|
53
|
+
* @example Word boundaries
|
|
54
|
+
* `pascalCase('hello-world') // 'HelloWorld'`
|
|
55
|
+
*
|
|
56
|
+
* @example With a suffix
|
|
57
|
+
* `pascalCase('tag', { suffix: 'schema' }) // 'TagSchema'`
|
|
58
|
+
*/
|
|
59
|
+
function pascalCase(text, { prefix = "", suffix = "" } = {}) {
|
|
60
|
+
return toCamelOrPascal(`${prefix} ${text} ${suffix}`, true);
|
|
61
|
+
}
|
|
11
62
|
// src/runners/init/utils.ts
|
|
12
|
-
/**
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
runCommand: []
|
|
21
|
-
},
|
|
22
|
-
yarn: {
|
|
23
|
-
name: "yarn",
|
|
24
|
-
lockFiles: ["yarn.lock"],
|
|
25
|
-
initCommand: ["init", "-y"],
|
|
26
|
-
installCommand: ["add", "-D"],
|
|
27
|
-
removeCommand: ["remove"],
|
|
28
|
-
runCommand: []
|
|
29
|
-
},
|
|
30
|
-
bun: {
|
|
31
|
-
name: "bun",
|
|
32
|
-
lockFiles: ["bun.lock", "bun.lockb"],
|
|
33
|
-
initCommand: ["init", "-y"],
|
|
34
|
-
installCommand: ["add", "-d"],
|
|
35
|
-
removeCommand: ["remove"],
|
|
36
|
-
runCommand: ["run"]
|
|
37
|
-
},
|
|
38
|
-
npm: {
|
|
39
|
-
name: "npm",
|
|
40
|
-
lockFiles: ["package-lock.json"],
|
|
41
|
-
initCommand: ["init", "-y"],
|
|
42
|
-
installCommand: ["install", "--save-dev"],
|
|
43
|
-
removeCommand: ["uninstall"],
|
|
44
|
-
runCommand: ["run"]
|
|
45
|
-
}
|
|
63
|
+
/**
|
|
64
|
+
* Subcommands that create a `package.json`; `package-manager-detector` has no `init` command.
|
|
65
|
+
*/
|
|
66
|
+
const initCommands = {
|
|
67
|
+
npm: ["init", "-y"],
|
|
68
|
+
pnpm: ["init"],
|
|
69
|
+
yarn: ["init", "-y"],
|
|
70
|
+
bun: ["init", "-y"]
|
|
46
71
|
};
|
|
47
|
-
/**
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
72
|
+
/**
|
|
73
|
+
* Detects the package manager in `cwd`: the `packageManager` field in `package.json`, then a lock file, then `npm`. Parent folders are not searched.
|
|
74
|
+
*/
|
|
75
|
+
async function detectPackageManager(cwd = node_process.default.cwd()) {
|
|
76
|
+
const found = await (0, package_manager_detector.detect)({
|
|
77
|
+
cwd,
|
|
78
|
+
stopDir: cwd,
|
|
79
|
+
strategies: ["packageManager-field", "lockfile"]
|
|
80
|
+
});
|
|
81
|
+
return found && found.name in initCommands ? found : {
|
|
82
|
+
name: "npm",
|
|
83
|
+
agent: "npm"
|
|
84
|
+
};
|
|
59
85
|
}
|
|
60
86
|
/**
|
|
61
87
|
* Initializes a new `package.json` at `cwd` using the detected package manager.
|
|
62
88
|
*/
|
|
63
89
|
async function initPackageJson(cwd, packageManager) {
|
|
64
|
-
await (0, tinyexec.x)(packageManager.name, [...packageManager.
|
|
90
|
+
await (0, tinyexec.x)(packageManager.name, [...initCommands[packageManager.name]], {
|
|
65
91
|
nodeOptions: {
|
|
66
92
|
cwd,
|
|
67
93
|
stdio: "inherit"
|
|
@@ -75,9 +101,9 @@ const INSTALL_TIMEOUT_MS = 3e5;
|
|
|
75
101
|
* to `onLine`, so the caller can show it while the install runs; a failed install also keeps the
|
|
76
102
|
* end of the output in the error.
|
|
77
103
|
*/
|
|
78
|
-
async function installPackages(packages, packageManager, cwd = node_process.default.cwd(), onLine, command =
|
|
79
|
-
const args =
|
|
80
|
-
const result = (0, tinyexec.x)(
|
|
104
|
+
async function installPackages(packages, packageManager, cwd = node_process.default.cwd(), onLine, command = "add") {
|
|
105
|
+
const { command: bin, args } = (0, package_manager_detector.resolveCommand)(packageManager.agent, command, command === "add" ? ["-D", ...packages] : packages);
|
|
106
|
+
const result = (0, tinyexec.x)(bin, args, {
|
|
81
107
|
nodeOptions: {
|
|
82
108
|
cwd,
|
|
83
109
|
stdio: [
|
|
@@ -95,15 +121,15 @@ async function installPackages(packages, packageManager, cwd = node_process.defa
|
|
|
95
121
|
onLine?.(line);
|
|
96
122
|
}
|
|
97
123
|
if (result.exitCode === 0) return;
|
|
98
|
-
if (result.exitCode === void 0) throw new Error(`\`${
|
|
124
|
+
if (result.exitCode === void 0) throw new Error(`\`${bin} ${args.join(" ")}\` timed out after ${INSTALL_TIMEOUT_MS / 6e4} minutes`);
|
|
99
125
|
const output = lines.slice(-20).join("\n");
|
|
100
|
-
throw new Error(`\`${
|
|
126
|
+
throw new Error(`\`${bin} ${args.join(" ")}\` failed with exit code ${result.exitCode}${output ? `:\n${output}` : ""}`);
|
|
101
127
|
}
|
|
102
128
|
/**
|
|
103
129
|
* Uninstalls the given packages at `cwd` with the package manager's remove command, like {@link installPackages}.
|
|
104
130
|
*/
|
|
105
131
|
function uninstallPackages(packages, packageManager, cwd = node_process.default.cwd()) {
|
|
106
|
-
return installPackages(packages, packageManager, cwd, void 0,
|
|
132
|
+
return installPackages(packages, packageManager, cwd, void 0, "uninstall");
|
|
107
133
|
}
|
|
108
134
|
/**
|
|
109
135
|
* What the selected plugins' `manifests` say is missing from the selection: a `dependencies`
|
|
@@ -131,23 +157,17 @@ const SKIPPED_DIRS = /* @__PURE__ */ new Set([
|
|
|
131
157
|
]);
|
|
132
158
|
/**
|
|
133
159
|
* Finds OpenAPI spec files up to `depth` folders below `cwd`, shallowest first, as `./`-relative
|
|
134
|
-
* paths.
|
|
160
|
+
* paths. Skips hidden and build folders without walking them and returns at most `limit` files.
|
|
135
161
|
*/
|
|
136
162
|
async function findSpecFiles(cwd, { depth = 3, limit = 20 } = {}) {
|
|
137
163
|
const found = [];
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
for (const { dir, entries } of listings) for (const entry of entries.toSorted((a, b) => a.name.localeCompare(b.name))) {
|
|
146
|
-
if (entry.isFile() && SPEC_FILE.test(entry.name)) found.push(`./${node_path.default.posix.join(dir, entry.name)}`);
|
|
147
|
-
if (entry.isDirectory() && !entry.name.startsWith(".") && !SKIPPED_DIRS.has(entry.name)) level.push(node_path.default.posix.join(dir, entry.name));
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
return found.slice(0, limit);
|
|
164
|
+
const pattern = `{${Array.from({ length: depth + 1 }, (_, level) => "*/".repeat(level)).join(",")}}*`;
|
|
165
|
+
const files = (0, node_fs_promises.glob)(pattern, {
|
|
166
|
+
cwd,
|
|
167
|
+
exclude: (file) => file.split(node_path.default.sep).some((segment) => SKIPPED_DIRS.has(segment))
|
|
168
|
+
});
|
|
169
|
+
for await (const file of files) if (SPEC_FILE.test(node_path.default.basename(file))) found.push(require_spinner.toPosixPath(file));
|
|
170
|
+
return found.toSorted((a, b) => a.split("/").length - b.split("/").length || a.localeCompare(b)).slice(0, limit).map((file) => `./${file}`);
|
|
151
171
|
}
|
|
152
172
|
const SPEC_HEAD_BYTES = 262144;
|
|
153
173
|
const METHOD = "(?:get|put|post|delete|options|head|patch|trace)";
|
|
@@ -226,6 +246,12 @@ Object.defineProperty(exports, "addGenerateScript", {
|
|
|
226
246
|
return addGenerateScript;
|
|
227
247
|
}
|
|
228
248
|
});
|
|
249
|
+
Object.defineProperty(exports, "camelCase", {
|
|
250
|
+
enumerable: true,
|
|
251
|
+
get: function() {
|
|
252
|
+
return camelCase;
|
|
253
|
+
}
|
|
254
|
+
});
|
|
229
255
|
Object.defineProperty(exports, "detectPackageManager", {
|
|
230
256
|
enumerable: true,
|
|
231
257
|
get: function() {
|
|
@@ -274,6 +300,12 @@ Object.defineProperty(exports, "parsePluginsFlag", {
|
|
|
274
300
|
return parsePluginsFlag;
|
|
275
301
|
}
|
|
276
302
|
});
|
|
303
|
+
Object.defineProperty(exports, "pascalCase", {
|
|
304
|
+
enumerable: true,
|
|
305
|
+
get: function() {
|
|
306
|
+
return pascalCase;
|
|
307
|
+
}
|
|
308
|
+
});
|
|
277
309
|
Object.defineProperty(exports, "readSpecInfo", {
|
|
278
310
|
enumerable: true,
|
|
279
311
|
get: function() {
|
|
@@ -287,4 +319,4 @@ Object.defineProperty(exports, "uninstallPackages", {
|
|
|
287
319
|
}
|
|
288
320
|
});
|
|
289
321
|
|
|
290
|
-
//# sourceMappingURL=utils-
|
|
322
|
+
//# sourceMappingURL=utils-uSJAZuvP.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils-uSJAZuvP.cjs","names":["process","detect","x","resolveCommand","read","path","glob","toPosixPath","fs","Diagnostics","write"],"sources":["../../../internals/utils/src/casing.ts","../src/runners/init/utils.ts"],"sourcesContent":["type Options = {\n /**\n * Text prepended before casing is applied.\n */\n prefix?: string\n /**\n * Text appended before casing is applied.\n */\n suffix?: string\n}\n\n/**\n * Shared implementation for camelCase and PascalCase conversion.\n * Splits on common word boundaries (spaces, hyphens, underscores, dots, slashes, colons)\n * and capitalizes each word according to `pascal`.\n *\n * When `pascal` is `true` the first word is also capitalized (PascalCase), otherwise only subsequent words are.\n */\nfunction convert(text: string, pascal: boolean): string {\n return text\n .trim()\n .replace(/([a-z\\d])([A-Z])/g, '$1 $2')\n .replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2')\n .replace(/(\\d)([a-z])/g, '$1 $2')\n .split(/[\\s\\-_./\\\\:]+/)\n .filter(Boolean)\n .map((word, i) => {\n if (word.length > 1 && word === word.toUpperCase()) return word\n const head = i === 0 && !pascal ? word.charAt(0).toLowerCase() : word.charAt(0).toUpperCase()\n return head + word.slice(1)\n })\n .join('')\n .replace(/[^a-zA-Z0-9]/g, '')\n}\n\n// Plugins case the same names on every visit. Clearing at the limit bounds a long-running host.\nconst cache = new Map<string, string>()\nconst cacheLimit = 100_000\n\nfunction toCamelOrPascal(text: string, pascal: boolean): string {\n const key = `${pascal ? 'P' : 'c'}${text}`\n const cached = cache.get(key)\n if (cached !== undefined) return cached\n\n const result = convert(text, pascal)\n if (cache.size >= cacheLimit) cache.clear()\n cache.set(key, result)\n return result\n}\n\n/**\n * Converts `text` to camelCase.\n *\n * @example Word boundaries\n * `camelCase('hello-world') // 'helloWorld'`\n *\n * @example With a prefix\n * `camelCase('tag', { prefix: 'create' }) // 'createTag'`\n */\nexport function camelCase(text: string, { prefix = '', suffix = '' }: Options = {}): string {\n return toCamelOrPascal(`${prefix} ${text} ${suffix}`, false)\n}\n\n/**\n * Converts `text` to PascalCase.\n *\n * @example Word boundaries\n * `pascalCase('hello-world') // 'HelloWorld'`\n *\n * @example With a suffix\n * `pascalCase('tag', { suffix: 'schema' }) // 'TagSchema'`\n */\nexport function pascalCase(text: string, { prefix = '', suffix = '' }: Options = {}): string {\n return toCamelOrPascal(`${prefix} ${text} ${suffix}`, true)\n}\n","import fs from 'node:fs'\nimport { glob } from 'node:fs/promises'\nimport path from 'node:path'\nimport process from 'node:process'\nimport { read, toPosixPath, write } from '@internals/utils'\nimport { Diagnostics, type ExtensionManifest, type RegistryEntry } from '@kubb/core'\nimport { type Agent, type AgentName, detect, resolveCommand } from 'package-manager-detector'\nimport { x } from 'tinyexec'\n\nexport type PackageManagerName = Extract<AgentName, 'npm' | 'pnpm' | 'yarn' | 'bun'>\n\n/**\n * A project's package manager: `name` for messages, `agent` for `resolveCommand`.\n */\nexport type PackageManagerInfo = { name: PackageManagerName; agent: Agent }\n\n/**\n * Subcommands that create a `package.json`; `package-manager-detector` has no `init` command.\n */\nconst initCommands: Record<PackageManagerName, ReadonlyArray<string>> = { npm: ['init', '-y'], pnpm: ['init'], yarn: ['init', '-y'], bun: ['init', '-y'] }\n\n/** Minimal shape of `package.json` fields read during detection. */\ntype PackageJson = {\n /** The `packageManager` field from `package.json` (e.g. `\"pnpm@9.0.0\"`). */\n packageManager?: string\n scripts?: Record<string, string>\n}\n\n/**\n * Detects the package manager in `cwd`: the `packageManager` field in `package.json`, then a lock file, then `npm`. Parent folders are not searched.\n */\nexport async function detectPackageManager(cwd: string = process.cwd()): Promise<PackageManagerInfo> {\n const found = await detect({ cwd, stopDir: cwd, strategies: ['packageManager-field', 'lockfile'] })\n return found && found.name in initCommands ? (found as PackageManagerInfo) : { name: 'npm', agent: 'npm' }\n}\n\n/**\n * Initializes a new `package.json` at `cwd` using the detected package manager.\n */\nexport async function initPackageJson(cwd: string, packageManager: PackageManagerInfo): Promise<void> {\n await x(packageManager.name, [...initCommands[packageManager.name]], {\n nodeOptions: { cwd, stdio: 'inherit' },\n throwOnError: true,\n })\n}\n\n/** How many trailing lines of a failed install's output the error keeps. */\nconst INSTALL_OUTPUT_LINES = 20\nconst INSTALL_TIMEOUT_MS = 5 * 60_000\n\n/**\n * Installs the given packages at `cwd` using the detected package manager. Each output line goes\n * to `onLine`, so the caller can show it while the install runs; a failed install also keeps the\n * end of the output in the error.\n */\nexport async function installPackages(\n packages: Array<string>,\n packageManager: PackageManagerInfo,\n cwd: string = process.cwd(),\n onLine?: (line: string) => void,\n command: 'add' | 'uninstall' = 'add',\n): Promise<void> {\n const { command: bin, args } = resolveCommand(packageManager.agent, command, command === 'add' ? ['-D', ...packages] : packages)!\n // No stdin, so a package manager that wants input fails instead of waiting. The timeout ends a stalled install.\n const result = x(bin, args, {\n nodeOptions: { cwd, stdio: ['ignore', 'pipe', 'pipe'] },\n timeout: INSTALL_TIMEOUT_MS,\n throwOnError: false,\n })\n const lines: Array<string> = []\n for await (const line of result) {\n lines.push(line)\n onLine?.(line)\n }\n if (result.exitCode === 0) return\n if (result.exitCode === undefined) throw new Error(`\\`${bin} ${args.join(' ')}\\` timed out after ${INSTALL_TIMEOUT_MS / 60_000} minutes`)\n\n const output = lines.slice(-INSTALL_OUTPUT_LINES).join('\\n')\n throw new Error(`\\`${bin} ${args.join(' ')}\\` failed with exit code ${result.exitCode}${output ? `:\\n${output}` : ''}`)\n}\n\n/**\n * Uninstalls the given packages at `cwd` with the package manager's remove command, like {@link installPackages}.\n */\nexport function uninstallPackages(packages: Array<string>, packageManager: PackageManagerInfo, cwd: string = process.cwd()): Promise<void> {\n return installPackages(packages, packageManager, cwd, undefined, 'uninstall')\n}\n\n/**\n * What the selected plugins' `manifests` say is missing from the selection: a `dependencies`\n * entry, or a `client` plugin next to a `consumer`. Empty when nothing is missing.\n * `optionalDependencies` are skipped, since `kubb init` writes the default options.\n */\nexport function missingPluginDependencies(manifests: Array<ExtensionManifest>): Array<string> {\n const selected = manifests.map((manifest) => manifest.name)\n const hasClient = manifests.some((manifest) => manifest.role === 'client')\n return manifests.flatMap((manifest) => [\n ...(manifest.dependencies ?? []).filter((name) => !selected.includes(name)).map((name) => `${manifest.name} needs ${name}.`),\n ...(manifest.role === 'consumer' && !hasClient ? [`${manifest.name} needs a client plugin, such as plugin-axios or plugin-fetch.`] : []),\n ])\n}\n\nasync function readPackageJson(cwd: string): Promise<PackageJson> {\n try {\n return JSON.parse(await read(path.join(cwd, 'package.json'))) as PackageJson\n } catch {\n return {}\n }\n}\n\nconst SPEC_FILE = /^(openapi|swagger)[\\w.-]*\\.(ya?ml|json)$/i\nconst SKIPPED_DIRS = new Set(['node_modules', 'dist', 'build', 'coverage'])\n\n/**\n * Finds OpenAPI spec files up to `depth` folders below `cwd`, shallowest first, as `./`-relative\n * paths. Skips hidden and build folders without walking them and returns at most `limit` files.\n */\nexport async function findSpecFiles(cwd: string, { depth = 3, limit = 20 }: { depth?: number; limit?: number } = {}): Promise<Array<string>> {\n const found: Array<string> = []\n const pattern = `{${Array.from({ length: depth + 1 }, (_, level) => '*/'.repeat(level)).join(',')}}*`\n // The extension stays out of the pattern so SPEC_FILE matches it case-insensitively. Dot folders are skipped by default.\n const files = glob(pattern, { cwd, exclude: (file) => file.split(path.sep).some((segment) => SKIPPED_DIRS.has(segment)) })\n for await (const file of files) if (SPEC_FILE.test(path.basename(file))) found.push(toPosixPath(file))\n return found\n .toSorted((a, b) => a.split('/').length - b.split('/').length || a.localeCompare(b))\n .slice(0, limit)\n .map((file) => `./${file}`)\n}\n\n/** The spec version and operation count, when the file states them. */\nexport type SpecInfo = { version?: string; operations?: number }\n\nconst SPEC_HEAD_BYTES = 256 * 1024\nconst METHOD = '(?:get|put|post|delete|options|head|patch|trace)'\n\n/**\n * Reads the OpenAPI or Swagger version and counts the operations from the first 256 KB of the\n * file, so a large spec is never parsed. The count is left out when the file is longer.\n */\nexport async function readSpecInfo(file: string): Promise<SpecInfo> {\n const handle = await fs.promises.open(file)\n try {\n const buffer = Buffer.alloc(SPEC_HEAD_BYTES)\n const { bytesRead } = await handle.read(buffer, 0, SPEC_HEAD_BYTES, 0)\n const head = buffer.toString('utf-8', 0, bytesRead)\n const complete = bytesRead < SPEC_HEAD_BYTES\n const version = head.match(/^\\s*[\"']?(?:openapi|swagger)[\"']?\\s*:\\s*[\"']?(\\d[\\d.]*)/m)?.[1]\n // shortcut: counts method keys at any depth, so a schema property named `get` counts too; use the adapter when that matters.\n const methods = new RegExp(`^\\\\s*[\"']?${METHOD}[\"']?\\\\s*:\\\\s*(?:\\\\{|$)`, 'gm')\n return { version, operations: complete ? (head.match(methods)?.length ?? 0) : undefined }\n } finally {\n await handle.close()\n }\n}\n\n/** Finds a plugin by registry id, slug, or short name, so `ts`, `plugin-ts`, and `kubb-labs/plugin-ts` all match. */\nexport function findPlugin({ plugins, id }: { plugins: Array<RegistryEntry>; id: string }): RegistryEntry | undefined {\n const ids = id.includes('/') ? [id] : [`kubb-labs/${id}`, `kubb-labs/plugin-${id}`]\n return plugins.find((entry) => ids.includes(entry.id))\n}\n\n/**\n * Turns the comma-separated `--plugins` value into registry entries.\n *\n * @throws when an id is not in `plugins`.\n */\nexport function parsePluginsFlag({ plugins, value }: { plugins: Array<RegistryEntry>; value: string }): Array<RegistryEntry> {\n const ids = value\n .split(',')\n .map((id) => id.trim())\n .filter(Boolean)\n const unknown = ids.filter((id) => !findPlugin({ plugins, id }))\n if (unknown.length)\n throw new Diagnostics.Error({\n code: Diagnostics.code.pluginNotFound,\n severity: 'error',\n message: `Not in the Kubb registry: ${unknown.join(', ')}. Browse the plugins at https://kubb.dev/extensions.`,\n help: 'Use plugin ids from https://kubb.dev/extensions, such as plugin-ts or ts.',\n })\n return ids.map((id) => findPlugin({ plugins, id })!)\n}\n\n/** Adds `\"generate\": \"kubb generate\"` to the `package.json` scripts at `cwd`. Returns `false`, and changes nothing, when a `generate` script exists. */\nexport async function addGenerateScript(cwd: string): Promise<boolean> {\n const file = path.join(cwd, 'package.json')\n const source = await read(file)\n const packageJson = JSON.parse(source) as PackageJson\n if (packageJson.scripts?.generate !== undefined) return false\n const indent = source.match(/^[ \\t]+/m)?.[0] ?? ' '\n const updated = { ...packageJson, scripts: { ...packageJson.scripts, generate: 'kubb generate' } }\n await write(file, JSON.stringify(updated, null, indent))\n return true\n}\n\n/** Reads the `generate` script from the `package.json` at `cwd`. */\nexport async function generateScript(cwd: string): Promise<string | undefined> {\n return (await readPackageJson(cwd)).scripts?.generate\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAkBA,SAAS,QAAQ,MAAc,QAAyB;CACtD,OAAO,KACJ,KAAK,CAAC,CACN,QAAQ,qBAAqB,OA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,OAAO,GAAG,KAAK,CAAC,CAAC,CACtB,OAAO,OAAO;CACjB,MAAM,UAAU,IAAI,QAAQ,OAAO,CAAC,WAAW;EAAE;EAAS;CAAG,CAAC,CAAC;CAC/D,IAAI,QAAQ,QACV,MAAM,IAAIC,WAAAA,YAAY,MAAM;EAC1B,MAAMA,WAAAA,YAAY,KAAK;EACvB,UAAU;EACV,SAAS,6BAA6B,QAAQ,KAAK,IAAI,EAAE;EACzD,MAAM;CACR,CAAC;CACH,OAAO,IAAI,KAAK,OAAO,WAAW;EAAE;EAAS;CAAG,CAAC,CAAE;AACrD;;AAGA,eAAsB,kBAAkB,KAA+B;CACrE,MAAM,OAAOJ,UAAAA,QAAK,KAAK,KAAK,cAAc;CAC1C,MAAM,SAAS,MAAMD,gBAAAA,KAAK,IAAI;CAC9B,MAAM,cAAc,KAAK,MAAM,MAAM;CACrC,IAAI,YAAY,SAAS,aAAa,KAAA,GAAW,OAAO;CACxD,MAAM,SAAS,OAAO,MAAM,UAAU,CAAC,GAAG,MAAM;CAChD,MAAM,UAAU;EAAE,GAAG;EAAa,SAAS;GAAE,GAAG,YAAY;GAAS,UAAU;EAAgB;CAAE;CACjG,MAAMM,gBAAAA,MAAM,MAAM,KAAK,UAAU,SAAS,MAAM,MAAM,CAAC;CACvD,OAAO;AACT;;AAGA,eAAsB,eAAe,KAA0C;CAC7E,QAAQ,MAAM,gBAAgB,GAAG,EAAA,CAAG,SAAS;AAC/C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./rolldown-runtime-xo6NMXYd.js";
|
|
2
|
-
import { t as configArg } from "./shared-
|
|
2
|
+
import { t as configArg } from "./shared-DcDHRtZx.js";
|
|
3
3
|
import { define } from "gunshi";
|
|
4
4
|
// src/commands/validate.ts
|
|
5
5
|
/** The runner is imported when the command runs, so listing `kubb --help` never loads `@kubb/adapter-oas`. */
|
|
@@ -16,7 +16,7 @@ const command = define({
|
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
async run({ values }) {
|
|
19
|
-
const { run } = await import("./run-
|
|
19
|
+
const { run } = await import("./run-B7p16C0S.js");
|
|
20
20
|
await run({
|
|
21
21
|
input: values.input,
|
|
22
22
|
configPath: values.config
|
|
@@ -25,4 +25,4 @@ const command = define({
|
|
|
25
25
|
});
|
|
26
26
|
export { command };
|
|
27
27
|
|
|
28
|
-
//# sourceMappingURL=validate
|
|
28
|
+
//# sourceMappingURL=validate--AEg1yAB.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate
|
|
1
|
+
{"version":3,"file":"validate--AEg1yAB.js","names":[],"sources":["../src/commands/validate.ts"],"sourcesContent":["import { define } from 'gunshi'\nimport { configArg } from './shared.ts'\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: 'Check a specification with the configured adapter before generating.',\n examples: ['kubb validate ./openapi.yaml', 'kubb validate https://petstore3.swagger.io/api/v3/openapi.json'].join('\\n'),\n args: {\n ...configArg,\n input: {\n type: 'positional',\n description: 'Path or URL to the specification 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, configPath: values.config })\n },\n})\n"],"mappings":";;;;;AAIA,MAAa,UAAU,OAAO;CAC5B,MAAM;CACN,aAAa;CACb,UAAU,CAAC,gCAAgC,gEAAgE,CAAC,CAAC,KAAK,IAAI;CACtH,MAAM;EACJ,GAAG;EACH,OAAO;GACL,MAAM;GACN,aAAa;GACb,UAAU;EACZ;CACF;CACA,MAAM,IAAI,EAAE,UAAU;EACpB,MAAM,EAAE,QAAQ,MAAM,OAAO;EAC7B,MAAM,IAAI;GAAE,OAAO,OAAO;GAAO,YAAY,OAAO;EAAO,CAAC;CAC9D;AACF,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
require("./rolldown-runtime-C3-Zg-KD.cjs");
|
|
2
|
-
const require_shared = require("./shared-
|
|
2
|
+
const require_shared = require("./shared-KKRMm1xX.cjs");
|
|
3
3
|
// src/commands/validate.ts
|
|
4
4
|
/** The runner is imported when the command runs, so listing `kubb --help` never loads `@kubb/adapter-oas`. */
|
|
5
5
|
const command = (0, require("gunshi").define)({
|
|
@@ -15,7 +15,7 @@ const command = (0, require("gunshi").define)({
|
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
async run({ values }) {
|
|
18
|
-
const { run } = await Promise.resolve().then(() => require("./run-
|
|
18
|
+
const { run } = await Promise.resolve().then(() => require("./run-BBzw9B1L.cjs"));
|
|
19
19
|
await run({
|
|
20
20
|
input: values.input,
|
|
21
21
|
configPath: values.config
|
|
@@ -24,4 +24,4 @@ const command = (0, require("gunshi").define)({
|
|
|
24
24
|
});
|
|
25
25
|
exports.command = command;
|
|
26
26
|
|
|
27
|
-
//# sourceMappingURL=validate-
|
|
27
|
+
//# sourceMappingURL=validate-BVNrsXe2.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-
|
|
1
|
+
{"version":3,"file":"validate-BVNrsXe2.cjs","names":["define","configArg"],"sources":["../src/commands/validate.ts"],"sourcesContent":["import { define } from 'gunshi'\nimport { configArg } from './shared.ts'\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: 'Check a specification with the configured adapter before generating.',\n examples: ['kubb validate ./openapi.yaml', 'kubb validate https://petstore3.swagger.io/api/v3/openapi.json'].join('\\n'),\n args: {\n ...configArg,\n input: {\n type: 'positional',\n description: 'Path or URL to the specification 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, configPath: values.config })\n },\n})\n"],"mappings":";;;;AAIA,MAAa,WAAA,G,gBAAUA,CAAAA,CAAAA,OAAAA,CAAO;CAC5B,MAAM;CACN,aAAa;CACb,UAAU,CAAC,gCAAgC,gEAAgE,CAAC,CAAC,KAAK,IAAI;CACtH,MAAM;EACJ,GAAGC,eAAAA;EACH,OAAO;GACL,MAAM;GACN,aAAa;GACb,UAAU;EACZ;CACF;CACA,MAAM,IAAI,EAAE,UAAU;EACpB,MAAM,EAAE,QAAQ,MAAA,QAAA,QAAA,CAAA,CAAA,WAAA,QAAM,oBAAA,CAAA;EACtB,MAAM,IAAI;GAAE,OAAO,OAAO;GAAO,YAAY,OAAO;EAAO,CAAC;CAC9D;AACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/cli",
|
|
3
|
-
"version": "5.15.
|
|
3
|
+
"version": "5.15.3",
|
|
4
4
|
"description": "Official CLI for Kubb. Run kubb generate, kubb init, kubb validate, kubb studio, and kubb mcp to manage the full code generation lifecycle.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -68,10 +68,11 @@
|
|
|
68
68
|
"dependencies": {
|
|
69
69
|
"@clack/prompts": "^1.8.1",
|
|
70
70
|
"@gunshi/plugin-dryrun": "^0.37.3",
|
|
71
|
-
"@kubb/core": "5.15.
|
|
71
|
+
"@kubb/core": "^5.15.3",
|
|
72
72
|
"chokidar": "^6.0.0",
|
|
73
73
|
"gunshi": "^0.37.3",
|
|
74
74
|
"jiti": "^2.7.0",
|
|
75
|
+
"package-manager-detector": "^1.9.0",
|
|
75
76
|
"tinyexec": "^1.3.1",
|
|
76
77
|
"verkit": "^0.5.0",
|
|
77
78
|
"yuku-parser": "^0.19.0"
|
|
@@ -79,13 +80,13 @@
|
|
|
79
80
|
"devDependencies": {
|
|
80
81
|
"@internals/shared": "0.0.1",
|
|
81
82
|
"@internals/utils": "0.0.1",
|
|
82
|
-
"@kubb/adapter-oas": "5.15.
|
|
83
|
-
"@kubb/studio": "5.15.
|
|
83
|
+
"@kubb/adapter-oas": "5.15.3",
|
|
84
|
+
"@kubb/studio": "5.15.3"
|
|
84
85
|
},
|
|
85
86
|
"peerDependencies": {
|
|
86
|
-
"@kubb/adapter-oas": "5.15.
|
|
87
|
-
"@kubb/mcp": "5.15.
|
|
88
|
-
"@kubb/studio": "5.15.
|
|
87
|
+
"@kubb/adapter-oas": "5.15.3",
|
|
88
|
+
"@kubb/mcp": "5.15.3",
|
|
89
|
+
"@kubb/studio": "5.15.3"
|
|
89
90
|
},
|
|
90
91
|
"peerDependenciesMeta": {
|
|
91
92
|
"@kubb/adapter-oas": {
|