@kubb/cli 5.0.0-beta.3 → 5.0.0-beta.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +177 -26
- package/dist/agent-CPKt8QQU.js +68 -0
- package/dist/agent-CPKt8QQU.js.map +1 -0
- package/dist/agent-lxTI4Krn.cjs +70 -0
- package/dist/agent-lxTI4Krn.cjs.map +1 -0
- package/dist/{chunk--u3MIqq1.js → chunk-BvFE5Tac.js} +1 -0
- package/dist/constants-B2JTeRBb.js +42 -0
- package/dist/constants-B2JTeRBb.js.map +1 -0
- package/dist/constants-BINTA5VZ.cjs +77 -0
- package/dist/constants-BINTA5VZ.cjs.map +1 -0
- package/dist/constants-BYGmiFs0.cjs +139 -0
- package/dist/constants-BYGmiFs0.cjs.map +1 -0
- package/dist/constants-DSJ-Xrbv.js +116 -0
- package/dist/constants-DSJ-Xrbv.js.map +1 -0
- package/dist/define-Bdn8j5VM.cjs.map +1 -1
- package/dist/{define-Ctii4bel.js → define-m_fp-Aqm.js} +2 -2
- package/dist/{define-Ctii4bel.js.map → define-m_fp-Aqm.js.map} +1 -1
- package/dist/{errors-CjPmyZHy.js → errors-CINO1EIv.js} +2 -2
- package/dist/{errors-CjPmyZHy.js.map → errors-CINO1EIv.js.map} +1 -1
- package/dist/errors-CLCjoSg0.cjs.map +1 -1
- package/dist/{generate-BzCMyyNN.cjs → generate-DgTJz23F.cjs} +10 -4
- package/dist/generate-DgTJz23F.cjs.map +1 -0
- package/dist/{generate-CTdVvIaP.js → generate-qCPyPiD6.js} +12 -6
- package/dist/generate-qCPyPiD6.js.map +1 -0
- package/dist/index.cjs +20 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +22 -13
- package/dist/index.js.map +1 -1
- package/dist/init-CM61rK5A.cjs +53 -0
- package/dist/init-CM61rK5A.cjs.map +1 -0
- package/dist/init-_-CN-ASE.js +53 -0
- package/dist/init-_-CN-ASE.js.map +1 -0
- package/dist/mcp-1ld_vD4n.js +39 -0
- package/dist/mcp-1ld_vD4n.js.map +1 -0
- package/dist/mcp-IMkVgOtF.cjs +39 -0
- package/dist/mcp-IMkVgOtF.cjs.map +1 -0
- package/dist/package-BDL80yHv.js +6 -0
- package/dist/package-BDL80yHv.js.map +1 -0
- package/dist/{package-DcmDg_mw.cjs → package-CHmy7tzG.cjs} +2 -2
- package/dist/package-CHmy7tzG.cjs.map +1 -0
- package/dist/run-B11-UaUs.cjs +33 -0
- package/dist/run-B11-UaUs.cjs.map +1 -0
- package/dist/{init-eNRlotJK.js → run-BNqMQygv.js} +107 -149
- package/dist/run-BNqMQygv.js.map +1 -0
- package/dist/{init-CZ5Xq2Hd.cjs → run-BnGfi7Cp.cjs} +105 -147
- package/dist/run-BnGfi7Cp.cjs.map +1 -0
- package/dist/{generate-BL-Kp5GY.js → run-BonExv0-.js} +561 -493
- package/dist/run-BonExv0-.js.map +1 -0
- package/dist/{agent-sdYBBgrd.js → run-BzpYYOQs.js} +46 -43
- package/dist/run-BzpYYOQs.js.map +1 -0
- package/dist/run-CCZ24VKk.js +51 -0
- package/dist/run-CCZ24VKk.js.map +1 -0
- package/dist/run-CQbj3ley.cjs +52 -0
- package/dist/run-CQbj3ley.cjs.map +1 -0
- package/dist/{agent-B4cAAab2.cjs → run-DwdAwnLG.cjs} +44 -41
- package/dist/run-DwdAwnLG.cjs.map +1 -0
- package/dist/run-PSA9X7ci.js +32 -0
- package/dist/run-PSA9X7ci.js.map +1 -0
- package/dist/{generate-DMqdAYqy.cjs → run-e1Pda1tW.cjs} +558 -490
- package/dist/run-e1Pda1tW.cjs.map +1 -0
- package/dist/shell-475fQKaX.cjs.map +1 -1
- package/dist/{shell-DLzN4fRo.js → shell-CN6DNqeC.js} +2 -2
- package/dist/{shell-DLzN4fRo.js.map → shell-CN6DNqeC.js.map} +1 -1
- package/dist/{telemetry-DN95_2pF.cjs → telemetry-B2iWkY5e.cjs} +5 -7
- package/dist/telemetry-B2iWkY5e.cjs.map +1 -0
- package/dist/{telemetry-LgT_sdPe.js → telemetry-BkektVz6.js} +6 -8
- package/dist/telemetry-BkektVz6.js.map +1 -0
- package/dist/validate-26X6uBG3.js +26 -0
- package/dist/validate-26X6uBG3.js.map +1 -0
- package/dist/validate-BAEo4Dcd.cjs +26 -0
- package/dist/validate-BAEo4Dcd.cjs.map +1 -0
- package/package.json +14 -14
- package/src/commands/agent/start.ts +10 -7
- package/src/commands/agent.ts +3 -1
- package/src/commands/generate.ts +5 -3
- package/src/commands/init.ts +34 -3
- package/src/commands/mcp.ts +28 -4
- package/src/commands/validate.ts +6 -4
- package/src/constants.ts +2 -58
- package/src/index.ts +5 -3
- package/src/loggers/clackLogger.ts +85 -118
- package/src/loggers/fileSystemLogger.ts +28 -15
- package/src/loggers/githubActionsLogger.ts +87 -96
- package/src/loggers/plainLogger.ts +48 -81
- package/src/loggers/types.ts +6 -0
- package/src/loggers/utils.ts +235 -11
- package/src/runners/agent/run.ts +113 -0
- package/src/runners/agent/utils.ts +98 -0
- package/src/runners/generate/run.ts +321 -0
- package/src/runners/generate/utils.ts +225 -0
- package/src/runners/init/run.ts +212 -0
- package/src/{utils/packageManager.ts → runners/init/utils.ts} +12 -2
- package/src/runners/mcp/run.ts +37 -0
- package/src/runners/validate/run.ts +63 -0
- package/src/{utils/telemetry.ts → telemetry.ts} +27 -20
- package/dist/agent-B4cAAab2.cjs.map +0 -1
- package/dist/agent-BFACosbG.cjs +0 -58
- package/dist/agent-BFACosbG.cjs.map +0 -1
- package/dist/agent-s7TqqoTg.js +0 -56
- package/dist/agent-s7TqqoTg.js.map +0 -1
- package/dist/agent-sdYBBgrd.js.map +0 -1
- package/dist/constants-CnDXa1R6.cjs +0 -148
- package/dist/constants-CnDXa1R6.cjs.map +0 -1
- package/dist/constants-aL3CP_Wq.js +0 -95
- package/dist/constants-aL3CP_Wq.js.map +0 -1
- package/dist/generate-BL-Kp5GY.js.map +0 -1
- package/dist/generate-BzCMyyNN.cjs.map +0 -1
- package/dist/generate-CTdVvIaP.js.map +0 -1
- package/dist/generate-DMqdAYqy.cjs.map +0 -1
- package/dist/init-BHMGbly9.cjs +0 -25
- package/dist/init-BHMGbly9.cjs.map +0 -1
- package/dist/init-CZ5Xq2Hd.cjs.map +0 -1
- package/dist/init-eNRlotJK.js.map +0 -1
- package/dist/init-qgpg-iRW.js +0 -25
- package/dist/init-qgpg-iRW.js.map +0 -1
- package/dist/mcp-BRp-2Rdc.js +0 -16
- package/dist/mcp-BRp-2Rdc.js.map +0 -1
- package/dist/mcp-CYOgxB82.cjs +0 -47
- package/dist/mcp-CYOgxB82.cjs.map +0 -1
- package/dist/mcp-DmJm3TrU.js +0 -46
- package/dist/mcp-DmJm3TrU.js.map +0 -1
- package/dist/mcp-N3mRyVuO.cjs +0 -16
- package/dist/mcp-N3mRyVuO.cjs.map +0 -1
- package/dist/package-DcmDg_mw.cjs.map +0 -1
- package/dist/package-DtuyzAVW.js +0 -6
- package/dist/package-DtuyzAVW.js.map +0 -1
- package/dist/telemetry-DN95_2pF.cjs.map +0 -1
- package/dist/telemetry-LgT_sdPe.js.map +0 -1
- package/dist/validate-CJpTOzKA.js +0 -25
- package/dist/validate-CJpTOzKA.js.map +0 -1
- package/dist/validate-DyTbv7Bc.cjs +0 -25
- package/dist/validate-DyTbv7Bc.cjs.map +0 -1
- package/dist/validate-kLJoT_hi.js +0 -33
- package/dist/validate-kLJoT_hi.js.map +0 -1
- package/dist/validate-yKKzqEZ5.cjs +0 -34
- package/dist/validate-yKKzqEZ5.cjs.map +0 -1
- package/src/runners/agent.ts +0 -155
- package/src/runners/generate.ts +0 -333
- package/src/runners/init.ts +0 -296
- package/src/runners/mcp.ts +0 -51
- package/src/runners/validate.ts +0 -39
- package/src/types.ts +0 -11
- package/src/utils/Writables.ts +0 -17
- package/src/utils/executeHooks.ts +0 -45
- package/src/utils/flags.ts +0 -9
- package/src/utils/getConfig.ts +0 -10
- package/src/utils/getCosmiConfig.ts +0 -80
- package/src/utils/getSummary.ts +0 -68
- package/src/utils/runHook.ts +0 -91
- package/src/utils/watcher.ts +0 -19
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-ByKO4r7w.cjs");
|
|
2
2
|
const require_shell = require("./shell-475fQKaX.cjs");
|
|
3
|
-
const require_constants = require("./constants-
|
|
3
|
+
const require_constants = require("./constants-BYGmiFs0.cjs");
|
|
4
4
|
let node_util = require("node:util");
|
|
5
5
|
let node_fs = require("node:fs");
|
|
6
6
|
node_fs = require_chunk.__toESM(node_fs, 1);
|
|
@@ -66,97 +66,8 @@ function detectPackageManager(cwd = process.cwd()) {
|
|
|
66
66
|
return packageManagers.npm;
|
|
67
67
|
}
|
|
68
68
|
//#endregion
|
|
69
|
-
//#region src/
|
|
70
|
-
function
|
|
71
|
-
return node_fs.default.existsSync(node_path.default.join(cwd, "package.json"));
|
|
72
|
-
}
|
|
73
|
-
async function initPackageJson(cwd, packageManager) {
|
|
74
|
-
await require_shell.spawnAsync(packageManager.name, {
|
|
75
|
-
npm: ["init", "-y"],
|
|
76
|
-
pnpm: ["init"],
|
|
77
|
-
yarn: ["init", "-y"],
|
|
78
|
-
bun: ["init", "-y"]
|
|
79
|
-
}[packageManager.name], { cwd });
|
|
80
|
-
}
|
|
81
|
-
async function installPackages(packages, packageManager, cwd = process.cwd()) {
|
|
82
|
-
await require_shell.spawnAsync(packageManager.name, [...packageManager.installCommand, ...packages], { cwd });
|
|
83
|
-
}
|
|
84
|
-
//#endregion
|
|
85
|
-
//#region src/runners/init.ts
|
|
86
|
-
const availablePlugins = [
|
|
87
|
-
{
|
|
88
|
-
value: "plugin-ts",
|
|
89
|
-
label: "TypeScript",
|
|
90
|
-
hint: "Recommended",
|
|
91
|
-
packageName: "@kubb/plugin-ts",
|
|
92
|
-
importName: "pluginTs",
|
|
93
|
-
category: "types"
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
value: "plugin-client",
|
|
97
|
-
label: "Client (Fetch/Axios)",
|
|
98
|
-
packageName: "@kubb/plugin-client",
|
|
99
|
-
importName: "pluginClient",
|
|
100
|
-
category: "client"
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
value: "plugin-react-query",
|
|
104
|
-
label: "React Query / TanStack Query",
|
|
105
|
-
packageName: "@kubb/plugin-react-query",
|
|
106
|
-
importName: "pluginReactQuery",
|
|
107
|
-
category: "framework"
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
value: "plugin-vue-query",
|
|
111
|
-
label: "Vue Query",
|
|
112
|
-
packageName: "@kubb/plugin-vue-query",
|
|
113
|
-
importName: "pluginVueQuery",
|
|
114
|
-
category: "framework"
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
value: "plugin-zod",
|
|
118
|
-
label: "Zod Schemas",
|
|
119
|
-
packageName: "@kubb/plugin-zod",
|
|
120
|
-
importName: "pluginZod",
|
|
121
|
-
category: "validation"
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
value: "plugin-faker",
|
|
125
|
-
label: "Faker.js Mocks",
|
|
126
|
-
packageName: "@kubb/plugin-faker",
|
|
127
|
-
importName: "pluginFaker",
|
|
128
|
-
category: "mocks"
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
value: "plugin-msw",
|
|
132
|
-
label: "MSW Handlers",
|
|
133
|
-
packageName: "@kubb/plugin-msw",
|
|
134
|
-
importName: "pluginMsw",
|
|
135
|
-
category: "mocks"
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
value: "plugin-cypress",
|
|
139
|
-
label: "Cypress Tests",
|
|
140
|
-
packageName: "@kubb/plugin-cypress",
|
|
141
|
-
importName: "pluginCypress",
|
|
142
|
-
category: "testing"
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
value: "plugin-mcp",
|
|
146
|
-
label: "MCP Server (AI / Model Context Protocol)",
|
|
147
|
-
packageName: "@kubb/plugin-mcp",
|
|
148
|
-
importName: "pluginMcp",
|
|
149
|
-
category: "ai"
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
value: "plugin-redoc",
|
|
153
|
-
label: "ReDoc Documentation",
|
|
154
|
-
packageName: "@kubb/plugin-redoc",
|
|
155
|
-
importName: "pluginRedoc",
|
|
156
|
-
category: "documentation"
|
|
157
|
-
}
|
|
158
|
-
];
|
|
159
|
-
function generateConfigFile(selectedPlugins, inputPath, outputPath) {
|
|
69
|
+
//#region ../../internals/shared/src/init.ts
|
|
70
|
+
function generateConfigFile({ selectedPlugins, inputPath, outputPath }) {
|
|
160
71
|
return `import { defineConfig } from 'kubb'
|
|
161
72
|
${selectedPlugins.map((plugin) => `import { ${plugin.importName} } from '${plugin.packageName}'`).join("\n")}
|
|
162
73
|
|
|
@@ -177,15 +88,63 @@ ${selectedPlugins.map((plugin) => {
|
|
|
177
88
|
})
|
|
178
89
|
`;
|
|
179
90
|
}
|
|
91
|
+
//#endregion
|
|
92
|
+
//#region src/runners/init/utils.ts
|
|
93
|
+
/**
|
|
94
|
+
* Returns `true` when a `package.json` exists at `cwd`.
|
|
95
|
+
*/
|
|
96
|
+
function hasPackageJson(cwd = node_process.default.cwd()) {
|
|
97
|
+
return node_fs.default.existsSync(node_path.default.join(cwd, "package.json"));
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Initializes a new `package.json` at `cwd` using the detected package manager.
|
|
101
|
+
*/
|
|
102
|
+
async function initPackageJson(cwd, packageManager) {
|
|
103
|
+
await require_shell.spawnAsync(packageManager.name, {
|
|
104
|
+
npm: ["init", "-y"],
|
|
105
|
+
pnpm: ["init"],
|
|
106
|
+
yarn: ["init", "-y"],
|
|
107
|
+
bun: ["init", "-y"]
|
|
108
|
+
}[packageManager.name], { cwd });
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Installs the given packages at `cwd` using the detected package manager.
|
|
112
|
+
*/
|
|
113
|
+
async function installPackages(packages, packageManager, cwd = node_process.default.cwd()) {
|
|
114
|
+
await require_shell.spawnAsync(packageManager.name, [...packageManager.installCommand, ...packages], { cwd });
|
|
115
|
+
}
|
|
116
|
+
//#endregion
|
|
117
|
+
//#region src/runners/init/run.ts
|
|
180
118
|
function cancelAndExit(message = "Operation cancelled.") {
|
|
181
119
|
_clack_prompts.cancel(message);
|
|
182
120
|
node_process.default.exit(0);
|
|
183
121
|
}
|
|
184
|
-
|
|
122
|
+
/**
|
|
123
|
+
* Runs the interactive Kubb scaffolding wizard.
|
|
124
|
+
* Detects the package manager, prompts for input/output paths and plugins, installs packages, and writes `kubb.config.ts`.
|
|
125
|
+
* Pass `yes: true` to skip all prompts and use defaults.
|
|
126
|
+
*/
|
|
127
|
+
async function run({ yes, version, input: inputFlag, output: outputFlag, plugins: pluginsFlag }) {
|
|
185
128
|
const cwd = node_process.default.cwd();
|
|
186
129
|
_clack_prompts.intro((0, node_util.styleText)("bgCyan", (0, node_util.styleText)("black", " Kubb Init ")));
|
|
130
|
+
/**
|
|
131
|
+
* Returns `flag` when provided, the `defaultValue` when `yes` is set,
|
|
132
|
+
* or calls `prompt()` for interactive input. Exits on cancellation.
|
|
133
|
+
*/
|
|
134
|
+
async function resolveOrPrompt(flag, defaultValue, logLabel, prompt) {
|
|
135
|
+
if (flag !== void 0) {
|
|
136
|
+
_clack_prompts.log.info(`${logLabel}: ${(0, node_util.styleText)("cyan", String(flag))}`);
|
|
137
|
+
return flag;
|
|
138
|
+
}
|
|
139
|
+
if (yes) {
|
|
140
|
+
_clack_prompts.log.info(`${logLabel}: ${(0, node_util.styleText)("cyan", String(defaultValue))}`);
|
|
141
|
+
return defaultValue;
|
|
142
|
+
}
|
|
143
|
+
const result = await prompt();
|
|
144
|
+
if (_clack_prompts.isCancel(result)) cancelAndExit();
|
|
145
|
+
return result;
|
|
146
|
+
}
|
|
187
147
|
try {
|
|
188
|
-
let packageManager;
|
|
189
148
|
if (!hasPackageJson(cwd)) {
|
|
190
149
|
if (!yes) {
|
|
191
150
|
const shouldInit = await _clack_prompts.confirm({
|
|
@@ -194,65 +153,60 @@ async function runInit({ yes, version }) {
|
|
|
194
153
|
});
|
|
195
154
|
if (_clack_prompts.isCancel(shouldInit) || !shouldInit) cancelAndExit();
|
|
196
155
|
}
|
|
197
|
-
packageManager = detectPackageManager(cwd);
|
|
156
|
+
const packageManager = detectPackageManager(cwd);
|
|
198
157
|
const spinner = _clack_prompts.spinner();
|
|
199
158
|
spinner.start(`Initializing package.json with ${packageManager.name}`);
|
|
200
159
|
await initPackageJson(cwd, packageManager);
|
|
201
160
|
spinner.stop(`Created package.json with ${packageManager.name}`);
|
|
202
|
-
} else {
|
|
203
|
-
packageManager = detectPackageManager(cwd);
|
|
204
|
-
_clack_prompts.log.info(`Detected package manager: ${(0, node_util.styleText)("cyan", packageManager.name)}`);
|
|
205
|
-
}
|
|
206
|
-
let inputPath;
|
|
207
|
-
if (yes) {
|
|
208
|
-
inputPath = require_constants.initDefaults.inputPath;
|
|
209
|
-
_clack_prompts.log.info(`Using input path: ${(0, node_util.styleText)("cyan", inputPath)}`);
|
|
210
|
-
} else {
|
|
211
|
-
const inputPathResult = await _clack_prompts.text({
|
|
212
|
-
message: "Where is your OpenAPI specification located?",
|
|
213
|
-
placeholder: require_constants.initDefaults.inputPath,
|
|
214
|
-
defaultValue: require_constants.initDefaults.inputPath,
|
|
215
|
-
validate: (value) => {
|
|
216
|
-
if (!value) return "Input path is required";
|
|
217
|
-
}
|
|
218
|
-
});
|
|
219
|
-
if (_clack_prompts.isCancel(inputPathResult)) cancelAndExit();
|
|
220
|
-
inputPath = inputPathResult;
|
|
221
161
|
}
|
|
222
|
-
|
|
223
|
-
if (
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
162
|
+
const packageManager = detectPackageManager(cwd);
|
|
163
|
+
if (hasPackageJson(cwd)) _clack_prompts.log.info(`Detected package manager: ${(0, node_util.styleText)("cyan", packageManager.name)}`);
|
|
164
|
+
const inputPath = await resolveOrPrompt(inputFlag, require_constants.initDefaults.inputPath, "Using input path", () => _clack_prompts.text({
|
|
165
|
+
message: "Where is your OpenAPI specification located?",
|
|
166
|
+
placeholder: require_constants.initDefaults.inputPath,
|
|
167
|
+
defaultValue: require_constants.initDefaults.inputPath,
|
|
168
|
+
validate: (value) => {
|
|
169
|
+
if (!value) return "Input path is required";
|
|
170
|
+
}
|
|
171
|
+
}));
|
|
172
|
+
const outputPath = await resolveOrPrompt(outputFlag, require_constants.initDefaults.outputPath, "Using output path", () => _clack_prompts.text({
|
|
173
|
+
message: "Where should the generated files be output?",
|
|
174
|
+
placeholder: require_constants.initDefaults.outputPath,
|
|
175
|
+
defaultValue: require_constants.initDefaults.outputPath,
|
|
176
|
+
validate: (value) => {
|
|
177
|
+
if (!value) return "Output path is required";
|
|
178
|
+
}
|
|
179
|
+
}));
|
|
180
|
+
const defaultPlugins = require_constants.availablePlugins.filter((p) => require_constants.initDefaults.plugins.includes(p.value));
|
|
181
|
+
const pluginLabel = (plugins) => (0, node_util.styleText)("cyan", plugins.map((p) => p.label).join(", "));
|
|
182
|
+
const selectedPlugins = await (async () => {
|
|
183
|
+
if (pluginsFlag) {
|
|
184
|
+
const requested = pluginsFlag.split(",").map((v) => v.trim()).filter(Boolean);
|
|
185
|
+
const plugins = require_constants.availablePlugins.filter((p) => requested.includes(p.value));
|
|
186
|
+
if (plugins.length === 0) {
|
|
187
|
+
_clack_prompts.log.warn(`No valid plugins found in --plugins value; falling back to default: ${pluginLabel(defaultPlugins)}`);
|
|
188
|
+
return defaultPlugins;
|
|
233
189
|
}
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
} else {
|
|
243
|
-
const selectedPluginValues = await _clack_prompts.multiselect({
|
|
190
|
+
_clack_prompts.log.info(`Using plugins: ${pluginLabel(plugins)}`);
|
|
191
|
+
return plugins;
|
|
192
|
+
}
|
|
193
|
+
if (yes) {
|
|
194
|
+
_clack_prompts.log.info(`Using plugins: ${pluginLabel(defaultPlugins)}`);
|
|
195
|
+
return defaultPlugins;
|
|
196
|
+
}
|
|
197
|
+
const values = await _clack_prompts.multiselect({
|
|
244
198
|
message: "Select plugins to use:",
|
|
245
|
-
options: availablePlugins.map((
|
|
246
|
-
value
|
|
247
|
-
label
|
|
248
|
-
hint
|
|
199
|
+
options: require_constants.availablePlugins.map(({ value, label, hint }) => ({
|
|
200
|
+
value,
|
|
201
|
+
label,
|
|
202
|
+
hint
|
|
249
203
|
})),
|
|
250
204
|
initialValues: [...require_constants.initDefaults.plugins],
|
|
251
205
|
required: true
|
|
252
206
|
});
|
|
253
|
-
if (_clack_prompts.isCancel(
|
|
254
|
-
|
|
255
|
-
}
|
|
207
|
+
if (_clack_prompts.isCancel(values)) cancelAndExit();
|
|
208
|
+
return require_constants.availablePlugins.filter((p) => values.includes(p.value));
|
|
209
|
+
})();
|
|
256
210
|
const packagesToInstall = ["kubb", ...selectedPlugins.map((p) => p.packageName)];
|
|
257
211
|
const spinner = _clack_prompts.spinner();
|
|
258
212
|
spinner.start(`Installing ${packagesToInstall.length} packages with ${packageManager.name}`);
|
|
@@ -265,7 +219,11 @@ async function runInit({ yes, version }) {
|
|
|
265
219
|
}
|
|
266
220
|
const configSpinner = _clack_prompts.spinner();
|
|
267
221
|
configSpinner.start(`Creating ${require_constants.KUBB_CONFIG_FILENAME}`);
|
|
268
|
-
const configContent = generateConfigFile(
|
|
222
|
+
const configContent = generateConfigFile({
|
|
223
|
+
selectedPlugins,
|
|
224
|
+
inputPath,
|
|
225
|
+
outputPath
|
|
226
|
+
});
|
|
269
227
|
const configPath = node_path.default.join(cwd, require_constants.KUBB_CONFIG_FILENAME);
|
|
270
228
|
if (node_fs.default.existsSync(configPath)) {
|
|
271
229
|
configSpinner.stop(`${require_constants.KUBB_CONFIG_FILENAME} already exists`);
|
|
@@ -278,9 +236,9 @@ async function runInit({ yes, version }) {
|
|
|
278
236
|
}
|
|
279
237
|
configSpinner.start(`Overwriting ${require_constants.KUBB_CONFIG_FILENAME}`);
|
|
280
238
|
}
|
|
281
|
-
node_fs.default.
|
|
239
|
+
await node_fs.default.promises.writeFile(configPath, configContent, "utf-8");
|
|
282
240
|
configSpinner.stop(`Created ${require_constants.KUBB_CONFIG_FILENAME}`);
|
|
283
|
-
_clack_prompts.outro((0, node_util.styleText)("green", "✓ All set!") + "\n\n" + (0, node_util.styleText)("dim", "Next steps:") + "\n" + (0, node_util.styleText)("cyan", ` 1. Make sure your OpenAPI spec is at: ${inputPath}`) + "\n" + (0, node_util.styleText)("cyan", " 2. Generate code with: npx kubb generate") + "\n" + (0, node_util.styleText)("cyan", " Or start a stream server with: npx kubb start") + "\n" + (0, node_util.styleText)("cyan", ` 3. Find generated files in: ${outputPath}`) + "\n\n" + (0, node_util.styleText)("dim", `Using ${packageManager.name} • Kubb v${version}`));
|
|
241
|
+
_clack_prompts.outro((0, node_util.styleText)("green", "✓ All set!") + "\n\n" + (0, node_util.styleText)("dim", "Next steps:") + "\n" + (0, node_util.styleText)("cyan", ` 1. Make sure your OpenAPI spec is at: ${inputPath}`) + "\n" + (0, node_util.styleText)("cyan", " 2. Generate code with: npx kubb generate") + "\n" + (0, node_util.styleText)("cyan", " Or start a stream server with: npx kubb agent start") + "\n" + (0, node_util.styleText)("cyan", ` 3. Find generated files in: ${outputPath}`) + "\n\n" + (0, node_util.styleText)("dim", `Using ${packageManager.name} • Kubb v${version}`));
|
|
284
242
|
} catch (error) {
|
|
285
243
|
_clack_prompts.log.error((0, node_util.styleText)("red", "An error occurred during initialization"));
|
|
286
244
|
if (error instanceof Error) _clack_prompts.log.error(error.message);
|
|
@@ -288,6 +246,6 @@ async function runInit({ yes, version }) {
|
|
|
288
246
|
}
|
|
289
247
|
}
|
|
290
248
|
//#endregion
|
|
291
|
-
exports.
|
|
249
|
+
exports.run = run;
|
|
292
250
|
|
|
293
|
-
//# sourceMappingURL=
|
|
251
|
+
//# sourceMappingURL=run-BnGfi7Cp.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-BnGfi7Cp.cjs","names":["pluginDefaultConfigs","process","fs","path","spawnAsync","process","clack","initDefaults","availablePlugins","KUBB_CONFIG_FILENAME","path","fs"],"sources":["../../../internals/utils/src/packageManager.ts","../../../internals/shared/src/init.ts","../src/runners/init/utils.ts","../src/runners/init/run.ts"],"sourcesContent":["import { existsSync, readFileSync } from 'node:fs'\nimport { join } from 'node:path'\n\n/**\n * Supported package manager identifiers.\n *\n * @example\n * ```ts\n * const pm: PackageManagerName = 'pnpm'\n * ```\n */\nexport type PackageManagerName = 'npm' | 'pnpm' | 'yarn' | 'bun'\n\n/**\n * Metadata describing a package manager's lock file and install command.\n */\nexport interface PackageManagerInfo {\n /**\n * Identifier used in CLI commands, e.g. `pnpm`, `yarn`.\n */\n name: PackageManagerName\n /**\n * Lock file name that uniquely identifies this package manager in a project root.\n */\n lockFile: string\n /**\n * Subcommands passed to the package manager binary to install a dev dependency.\n */\n installCommand: ReadonlyArray<string>\n}\n/**\n * Metadata for each supported package manager, keyed by its short name.\n *\n * @example\n * ```ts\n * packageManagers.pnpm.installCommand // ['add', '-D']\n * packageManagers.npm.lockFile // 'package-lock.json'\n * ```\n */\nconst packageManagers: Record<PackageManagerName, PackageManagerInfo> = {\n pnpm: {\n name: 'pnpm',\n lockFile: 'pnpm-lock.yaml',\n installCommand: ['add', '-D'],\n },\n yarn: {\n name: 'yarn',\n lockFile: 'yarn.lock',\n installCommand: ['add', '-D'],\n },\n bun: {\n name: 'bun',\n lockFile: 'bun.lockb',\n installCommand: ['add', '-d'],\n },\n npm: {\n name: 'npm',\n lockFile: 'package-lock.json',\n installCommand: ['install', '--save-dev'],\n },\n}\n\n/**\n * Minimal shape of `package.json` fields read during detection.\n */\ntype PackageJson = {\n /**\n * The `packageManager` field from `package.json` (e.g. `\"pnpm@9.0.0\"`).\n */\n packageManager?: string\n}\n\n/**\n * Detects the active package manager for the given directory.\n * Resolution order: `packageManager` field in `package.json`, then presence of a lock file.\n * Falls back to `npm` when no signal is found.\n *\n * @example\n * ```ts\n * detectPackageManager('/my/project') // { name: 'pnpm', lockFile: 'pnpm-lock.yaml', ... }\n * detectPackageManager() // falls back to npm when no lock file is found\n * ```\n */\nexport function detectPackageManager(cwd: string = process.cwd()): PackageManagerInfo {\n const packageJsonPath = join(cwd, 'package.json')\n if (existsSync(packageJsonPath)) {\n try {\n const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf-8')) as PackageJson\n const pmField = packageJson.packageManager\n if (typeof pmField === 'string') {\n const name = pmField.split('@')[0]\n if (name && name in packageManagers) {\n return packageManagers[name as PackageManagerName]\n }\n }\n } catch {\n // Continue to lock file detection\n }\n }\n\n for (const pm of Object.values(packageManagers)) {\n if (existsSync(join(cwd, pm.lockFile))) {\n return pm\n }\n }\n\n return packageManagers.npm\n}\n","import { pluginDefaultConfigs } from './constants.ts'\nimport type { PluginOption } from './types.ts'\n\nexport function generateConfigFile({\n selectedPlugins,\n inputPath,\n outputPath,\n}: {\n selectedPlugins: PluginOption[]\n inputPath: string\n outputPath: string\n}): string {\n const imports = selectedPlugins.map((plugin) => `import { ${plugin.importName} } from '${plugin.packageName}'`).join('\\n')\n\n const pluginConfigs = selectedPlugins\n .map((plugin) => {\n const config = (pluginDefaultConfigs as Record<string, string>)[plugin.value] ?? `${plugin.importName}()`\n return ` ${config},`\n })\n .join('\\n')\n\n return `import { defineConfig } from 'kubb'\n${imports}\n\nexport default defineConfig({\n root: '.',\n input: {\n path: '${inputPath}',\n },\n output: {\n path: '${outputPath}',\n clean: true,\n },\n plugins: [\n${pluginConfigs}\n ],\n})\n`\n}\n","import fs from 'node:fs'\nimport path from 'node:path'\nimport process from 'node:process'\nimport type { PackageManagerInfo, PackageManagerName } from '@internals/utils'\nimport { spawnAsync } from '@internals/utils'\n\n/**\n * Returns `true` when a `package.json` exists at `cwd`.\n */\nexport function hasPackageJson(cwd: string = process.cwd()): boolean {\n return fs.existsSync(path.join(cwd, 'package.json'))\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 const commands: Record<PackageManagerName, Array<string>> = {\n npm: ['init', '-y'],\n pnpm: ['init'],\n yarn: ['init', '-y'],\n bun: ['init', '-y'],\n }\n\n await spawnAsync(packageManager.name, commands[packageManager.name], { cwd })\n}\n\n/**\n * Installs the given packages at `cwd` using the detected package manager.\n */\nexport async function installPackages(packages: Array<string>, packageManager: PackageManagerInfo, cwd: string = process.cwd()): Promise<void> {\n await spawnAsync(packageManager.name, [...packageManager.installCommand, ...packages], { cwd })\n}\n","import fs from 'node:fs'\nimport path from 'node:path'\nimport process from 'node:process'\nimport { styleText } from 'node:util'\nimport * as clack from '@clack/prompts'\nimport { detectPackageManager } from '@internals/utils'\nimport { availablePlugins, generateConfigFile, initDefaults, KUBB_CONFIG_FILENAME, type PluginOption } from '@internals/shared'\nimport { hasPackageJson, initPackageJson, installPackages } from './utils.ts'\n\nfunction cancelAndExit(message = 'Operation cancelled.'): never {\n clack.cancel(message)\n process.exit(0)\n}\n\ntype InitOptions = {\n /**\n * When `true`, skips all interactive prompts and uses default values.\n */\n yes: boolean\n /**\n * Current `@kubb/cli` version string, shown in the outro and used for package installation.\n */\n version: string\n /**\n * Input path flag value from `--input`. When provided, skips the input prompt.\n */\n input?: string\n /**\n * Output directory flag value from `--output`. When provided, skips the output prompt.\n */\n output?: string\n /**\n * Comma-separated plugin list from `--plugins`, e.g. `'plugin-ts,plugin-zod'`. When provided, skips the plugin selection prompt.\n */\n plugins?: string\n}\n\n/**\n * Runs the interactive Kubb scaffolding wizard.\n * Detects the package manager, prompts for input/output paths and plugins, installs packages, and writes `kubb.config.ts`.\n * Pass `yes: true` to skip all prompts and use defaults.\n */\nexport async function run({ yes, version, input: inputFlag, output: outputFlag, plugins: pluginsFlag }: InitOptions): Promise<void> {\n const cwd = process.cwd()\n\n clack.intro(styleText('bgCyan', styleText('black', ' Kubb Init ')))\n\n /**\n * Returns `flag` when provided, the `defaultValue` when `yes` is set,\n * or calls `prompt()` for interactive input. Exits on cancellation.\n */\n async function resolveOrPrompt<T>(flag: T | undefined, defaultValue: T, logLabel: string, prompt: () => Promise<T | symbol>): Promise<T> {\n if (flag !== undefined) {\n clack.log.info(`${logLabel}: ${styleText('cyan', String(flag))}`)\n return flag\n }\n if (yes) {\n clack.log.info(`${logLabel}: ${styleText('cyan', String(defaultValue))}`)\n return defaultValue\n }\n const result = await prompt()\n if (clack.isCancel(result)) cancelAndExit()\n return result as T\n }\n\n try {\n // Check/create package.json — detect package manager once after the block\n if (!hasPackageJson(cwd)) {\n if (!yes) {\n const shouldInit = await clack.confirm({\n message: 'No package.json found. Would you like to create one?',\n initialValue: true,\n })\n\n if (clack.isCancel(shouldInit) || !shouldInit) {\n cancelAndExit()\n }\n }\n\n const packageManager = detectPackageManager(cwd)\n const spinner = clack.spinner()\n spinner.start(`Initializing package.json with ${packageManager.name}`)\n await initPackageJson(cwd, packageManager)\n spinner.stop(`Created package.json with ${packageManager.name}`)\n }\n\n const packageManager = detectPackageManager(cwd)\n if (hasPackageJson(cwd)) {\n clack.log.info(`Detected package manager: ${styleText('cyan', packageManager.name)}`)\n }\n\n // Prompt for OpenAPI spec path\n const inputPath = await resolveOrPrompt(inputFlag, initDefaults.inputPath, 'Using input path', () =>\n clack.text({\n message: 'Where is your OpenAPI specification located?',\n placeholder: initDefaults.inputPath,\n defaultValue: initDefaults.inputPath,\n validate: (value) => {\n if (!value) return 'Input path is required'\n },\n }),\n )\n\n // Prompt for output directory\n const outputPath = await resolveOrPrompt(outputFlag, initDefaults.outputPath, 'Using output path', () =>\n clack.text({\n message: 'Where should the generated files be output?',\n placeholder: initDefaults.outputPath,\n defaultValue: initDefaults.outputPath,\n validate: (value) => {\n if (!value) return 'Output path is required'\n },\n }),\n )\n\n // Plugin selection\n const defaultPlugins = availablePlugins.filter((p) => (initDefaults.plugins as ReadonlyArray<string>).includes(p.value))\n const pluginLabel = (plugins: Array<PluginOption>) => styleText('cyan', plugins.map((p) => p.label).join(', '))\n\n const selectedPlugins: Array<PluginOption> = await (async () => {\n if (pluginsFlag) {\n const requested = pluginsFlag\n .split(',')\n .map((v) => v.trim())\n .filter(Boolean)\n const plugins = availablePlugins.filter((p) => requested.includes(p.value))\n if (plugins.length === 0) {\n clack.log.warn(`No valid plugins found in --plugins value; falling back to default: ${pluginLabel(defaultPlugins)}`)\n return defaultPlugins\n }\n clack.log.info(`Using plugins: ${pluginLabel(plugins)}`)\n return plugins\n }\n if (yes) {\n clack.log.info(`Using plugins: ${pluginLabel(defaultPlugins)}`)\n return defaultPlugins\n }\n const values = await clack.multiselect({\n message: 'Select plugins to use:',\n options: availablePlugins.map(({ value, label, hint }) => ({ value, label, hint })),\n initialValues: [...initDefaults.plugins],\n required: true,\n })\n if (clack.isCancel(values)) cancelAndExit()\n return availablePlugins.filter((p) => (values as Array<string>).includes(p.value))\n })()\n\n // Install packages\n const packagesToInstall = ['kubb', ...selectedPlugins.map((p) => p.packageName)]\n\n const spinner = clack.spinner()\n spinner.start(`Installing ${packagesToInstall.length} packages with ${packageManager.name}`)\n\n try {\n await installPackages(packagesToInstall, packageManager, cwd)\n spinner.stop(`Installed ${packagesToInstall.length} packages`)\n } catch (error) {\n spinner.stop('Installation failed')\n throw error\n }\n\n // Generate config file\n const configSpinner = clack.spinner()\n configSpinner.start(`Creating ${KUBB_CONFIG_FILENAME}`)\n\n const configContent = generateConfigFile({ selectedPlugins, inputPath, outputPath })\n const configPath = path.join(cwd, KUBB_CONFIG_FILENAME)\n\n if (fs.existsSync(configPath)) {\n configSpinner.stop(`${KUBB_CONFIG_FILENAME} already exists`)\n\n if (!yes) {\n const shouldOverwrite = await clack.confirm({\n message: `${KUBB_CONFIG_FILENAME} already exists. Overwrite?`,\n initialValue: false,\n })\n\n if (clack.isCancel(shouldOverwrite) || !shouldOverwrite) {\n cancelAndExit('Keeping existing configuration. Packages have been installed.')\n }\n }\n\n configSpinner.start(`Overwriting ${KUBB_CONFIG_FILENAME}`)\n }\n\n await fs.promises.writeFile(configPath, configContent, 'utf-8')\n\n configSpinner.stop(`Created ${KUBB_CONFIG_FILENAME}`)\n\n clack.outro(\n styleText('green', '✓ All set!') +\n '\\n\\n' +\n styleText('dim', 'Next steps:') +\n '\\n' +\n styleText('cyan', ` 1. Make sure your OpenAPI spec is at: ${inputPath}`) +\n '\\n' +\n styleText('cyan', ' 2. Generate code with: npx kubb generate') +\n '\\n' +\n styleText('cyan', ' Or start a stream server with: npx kubb agent start') +\n '\\n' +\n styleText('cyan', ` 3. Find generated files in: ${outputPath}`) +\n '\\n\\n' +\n styleText('dim', `Using ${packageManager.name} • Kubb v${version}`),\n )\n } catch (error) {\n clack.log.error(styleText('red', 'An error occurred during initialization'))\n if (error instanceof Error) {\n clack.log.error(error.message)\n }\n process.exit(1)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAuCA,MAAM,kBAAkE;CACtE,MAAM;EACJ,MAAM;EACN,UAAU;EACV,gBAAgB,CAAC,OAAO,KAAK;EAC9B;CACD,MAAM;EACJ,MAAM;EACN,UAAU;EACV,gBAAgB,CAAC,OAAO,KAAK;EAC9B;CACD,KAAK;EACH,MAAM;EACN,UAAU;EACV,gBAAgB,CAAC,OAAO,KAAK;EAC9B;CACD,KAAK;EACH,MAAM;EACN,UAAU;EACV,gBAAgB,CAAC,WAAW,aAAa;EAC1C;CACF;;;;;;;;;;;;AAuBD,SAAgB,qBAAqB,MAAc,QAAQ,KAAK,EAAsB;CACpF,MAAM,mBAAA,GAAA,UAAA,MAAuB,KAAK,eAAe;CACjD,KAAA,GAAA,QAAA,YAAe,gBAAgB,EAC7B,IAAI;EAEF,MAAM,UADc,KAAK,OAAA,GAAA,QAAA,cAAmB,iBAAiB,QAAQ,CAC1C,CAAC;EAC5B,IAAI,OAAO,YAAY,UAAU;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