@kubb/cli
Advanced tools
Comparing version 0.31.0 to 0.31.1
@@ -31,4 +31,4 @@ #!/usr/bin/env node | ||
// src/utils/createConfig.ts | ||
var createConfig = async (result, options) => { | ||
// src/utils/getConfig.ts | ||
var getConfig = async (result, options) => { | ||
const config = result?.config; | ||
@@ -64,5 +64,23 @@ if (result?.filepath.endsWith(".json")) { | ||
}; | ||
const onDone = async (config) => { | ||
if (!config.hooks?.done) { | ||
return; | ||
} | ||
spinner2.start("Running hooks"); | ||
let commands = []; | ||
if (typeof config.hooks?.done === "string") { | ||
commands = [config.hooks.done]; | ||
} else { | ||
commands = config.hooks.done; | ||
} | ||
const promises = commands.map(async (command) => { | ||
const [cmd, ..._args] = [...stringArgv.parseArgsStringToArgv(command)]; | ||
return execa.execa(cmd, _args); | ||
}); | ||
await Promise.all(promises); | ||
spinner2.succeed("Running hooks completed"); | ||
}; | ||
try { | ||
spinner2.start("Building"); | ||
const config = await createConfig(result, options); | ||
const config = await getConfig(result, options); | ||
await core.build({ | ||
@@ -77,17 +95,3 @@ config: { | ||
spinner2.succeed(pc2.blue("Kubb generation done")); | ||
if (config.hooks?.done) { | ||
spinner2.start("Running hooks"); | ||
let commands = []; | ||
if (typeof config.hooks?.done === "string") { | ||
commands = [config.hooks.done]; | ||
} else { | ||
commands = config.hooks.done; | ||
} | ||
const promises = commands.map(async (command) => { | ||
const [cmd, ..._args] = [...stringArgv.parseArgsStringToArgv(command)]; | ||
return execa.execa(cmd, _args); | ||
}); | ||
await Promise.all(promises); | ||
spinner2.succeed("Running hooks completed"); | ||
} | ||
await onDone(config); | ||
} catch (err) { | ||
@@ -101,3 +105,3 @@ spinner2.fail("Something went wrong\n"); | ||
// package.json | ||
var version = "0.31.0"; | ||
var version = "0.31.1"; | ||
@@ -104,0 +108,0 @@ // src/index.ts |
{ | ||
"name": "@kubb/cli", | ||
"version": "0.31.0", | ||
"version": "0.31.1", | ||
"description": "Generator cli", | ||
@@ -23,3 +23,3 @@ "repository": { | ||
"dependencies": { | ||
"@kubb/core": "0.31.0", | ||
"@kubb/core": "0.31.1", | ||
"commander": "^9.4.1", | ||
@@ -26,0 +26,0 @@ "cosmiconfig": "^8.0.0", |
Sorry, the diff of this file is not supported yet
12485
266
+ Added@kubb/core@0.31.1(transitive)
- Removed@kubb/core@0.31.0(transitive)
Updated@kubb/core@0.31.1