New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@kubb/cli

Package Overview
Dependencies
Maintainers
1
Versions
685
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kubb/cli - npm Package Compare versions

Comparing version 0.14.1 to 0.19.0

49

dist/index.js

@@ -9,2 +9,4 @@ #!/usr/bin/env node

var ora = require('ora');
var execa = require('execa');
var stringArgv = require('string-argv');
var core = require('@kubb/core');

@@ -20,3 +22,3 @@

if (isJSONPlugins(plugins)) {
return plugins.map(async (plugin) => {
const promises = plugins.map(async (plugin) => {
const [name, options = {}] = plugin;

@@ -26,22 +28,24 @@ const importedPlugin = await import(name);

});
return Promise.all(promises);
}
return plugins;
return Promise.resolve(plugins);
};
// src/utils/createConfig.ts
var createConfig = async (result) => {
let config = result?.config;
var createConfig = async (result, options) => {
const config = result?.config;
if (result?.filepath.endsWith(".json")) {
config = {
...config,
plugins: getPlugins(config.plugins)
let JSONConfig = config;
JSONConfig = {
...JSONConfig,
plugins: JSONConfig.plugins ? await getPlugins(JSONConfig.plugins) : void 0
};
return config;
return Promise.resolve(JSONConfig);
}
if (typeof config === "function") {
const possiblePromise = config();
if (typeof possiblePromise?.then === "function") {
const possiblePromise = config(options);
if (core.isPromise(possiblePromise)) {
return possiblePromise;
}
return possiblePromise;
return Promise.resolve(possiblePromise);
}

@@ -64,6 +68,6 @@ return config;

spinner2.start("Building");
const config = await createConfig(result);
const config = await createConfig(result, options);
await core.build({
config: {
...core.defaultConfig,
root: process.cwd(),
...config

@@ -75,2 +79,17 @@ },

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");
}
} catch (err) {

@@ -84,3 +103,3 @@ spinner2.fail("Something went wrong\n");

// package.json
var version = "0.14.1";
var version = "0.19.0";

@@ -111,3 +130,3 @@ // src/index.ts

});
var program = new commander.Command(moduleName).description("Codegen plugins").action(async (options) => {
var program = new commander.Command(moduleName).description("Kubb").action(async (options) => {
spinner.succeed(pc2.blue("Kubb generation started"));

@@ -114,0 +133,0 @@ spinner.start("Loading config");

{
"name": "@kubb/cli",
"version": "0.14.1",
"version": "0.19.0",
"description": "Generator cli",

@@ -23,13 +23,15 @@ "repository": {

"dependencies": {
"@kubb/core": "0.14.1",
"@kubb/core": "0.19.0",
"commander": "^9.4.1",
"cosmiconfig": "^8.0.0",
"cosmiconfig-typescript-loader": "^4.3.0",
"execa": "^6.1.0",
"ora": "^6.1.2",
"picocolors": "^1.0.0"
"picocolors": "^1.0.0",
"string-argv": "^0.3.1"
},
"devDependencies": {
"@types/node": "^18.11.18",
"tsup": "^6.5.0",
"typescript": "^4.9.4",
"@types/node": "^18.11.18"
"typescript": "^4.9.4"
},

@@ -36,0 +38,0 @@ "publishConfig": {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc