@batijs/cli
Advanced tools
Comparing version
@@ -7,3 +7,3 @@ // files/$package.json.ts | ||
packageJson.scripts["edgedb:generate-edgeql-js"] = "@edgedb/generate edgeql-js"; | ||
return addDependency(packageJson, await import("../package-LS4N573U.js"), { | ||
return addDependency(packageJson, await import("../package-562PRDA5.js"), { | ||
devDependencies: ["@edgedb/generate"], | ||
@@ -10,0 +10,0 @@ dependencies: ["edgedb"] |
@@ -7,3 +7,3 @@ // files/$package.json.ts | ||
packageJson.scripts.build = "vite build"; | ||
return addDependency(packageJson, await import("../package-HUSTD3AA.js"), { | ||
return addDependency(packageJson, await import("../package-Y3HBW6TZ.js"), { | ||
devDependencies: ["@types/express"], | ||
@@ -10,0 +10,0 @@ dependencies: [ |
@@ -10,3 +10,3 @@ // files/$package.json.ts | ||
} | ||
return addDependency(packageJson, await import("../package-H54ANVLS.js"), { | ||
return addDependency(packageJson, await import("../package-OHT2RKHN.js"), { | ||
devDependencies: ["@hattip/vite", "@hattip/adapter-node"], | ||
@@ -13,0 +13,0 @@ dependencies: [ |
@@ -7,3 +7,3 @@ // files/$package.json.ts | ||
packageJson.scripts["prisma:generate"] = "prisma generate"; | ||
return addDependency(packageJson, await import("../package-ML7OLGIV.js"), { | ||
return addDependency(packageJson, await import("../package-C3YKOB7I.js"), { | ||
devDependencies: ["prisma"], | ||
@@ -10,0 +10,0 @@ dependencies: ["@prisma/client"] |
@@ -5,3 +5,3 @@ // files/$package.json.ts | ||
const packageJson = await loadAsJson(currentContent); | ||
return addDependency(packageJson, await import("../package-YA6MIN7J.js"), { | ||
return addDependency(packageJson, await import("../package-7OPRREQL.js"), { | ||
devDependencies: ["vite", "@types/react", "@types/react-dom"], | ||
@@ -8,0 +8,0 @@ dependencies: ["@vitejs/plugin-react", "cross-fetch", "react", "react-dom", "vite-plugin-ssr", "vike-react"] |
@@ -5,3 +5,3 @@ // files/$package.json.ts | ||
const packageJson = await loadAsJson(currentContent); | ||
return addDependency(packageJson, await import("../package-2QJ7AU5D.js"), { | ||
return addDependency(packageJson, await import("../package-XS4RS3KO.js"), { | ||
devDependencies: ["vite"], | ||
@@ -8,0 +8,0 @@ dependencies: ["cross-fetch", "solid-js", "vike-solid", "vite-plugin-ssr"] |
@@ -5,3 +5,3 @@ // files/$package.json.ts | ||
const packageJson = await loadAsJson(currentContent); | ||
return addDependency(packageJson, await import("../package-O545P6XC.js"), { | ||
return addDependency(packageJson, await import("../package-TCXHQCAL.js"), { | ||
devDependencies: ["tailwindcss", "postcss", "autoprefixer"] | ||
@@ -8,0 +8,0 @@ }); |
@@ -5,3 +5,3 @@ // files/$package.json.ts | ||
const packageJson = await loadAsJson(currentContent); | ||
return addDependency(packageJson, await import("../package-WTKGDPTF.js"), { | ||
return addDependency(packageJson, await import("../package-VO4UYQPG.js"), { | ||
dependencies: ["telefunc"] | ||
@@ -8,0 +8,0 @@ }); |
@@ -5,3 +5,3 @@ // files/$package.json.ts | ||
const packageJson = await loadAsJson(currentContent); | ||
return addDependency(packageJson, await import("../package-EV6NMSSH.js"), { | ||
return addDependency(packageJson, await import("../package-5EXMRHUV.js"), { | ||
devDependencies: ["vite"], | ||
@@ -8,0 +8,0 @@ dependencies: [ |
@@ -7,3 +7,3 @@ #!/usr/bin/env node | ||
// ../../node_modules/.pnpm/citty@0.1.3/node_modules/citty/dist/index.mjs | ||
// ../../node_modules/.pnpm/citty@0.1.4/node_modules/citty/dist/index.mjs | ||
function toArray(val) { | ||
@@ -291,27 +291,34 @@ if (Array.isArray(val)) { | ||
} | ||
const subCommands = await resolveValue(cmd.subCommands); | ||
if (subCommands && Object.keys(subCommands).length > 0) { | ||
const subCommandArgIndex = opts.rawArgs.findIndex( | ||
(arg) => !arg.startsWith("-") | ||
); | ||
const subCommandName = opts.rawArgs[subCommandArgIndex]; | ||
if (!subCommandName && !cmd.run) { | ||
throw new CLIError(`No command specified.`, "E_NO_COMMAND"); | ||
} | ||
if (!subCommands[subCommandName]) { | ||
throw new CLIError( | ||
`Unknown command \`${subCommandName}\``, | ||
"E_UNKNOWN_COMMAND" | ||
try { | ||
const subCommands = await resolveValue(cmd.subCommands); | ||
if (subCommands && Object.keys(subCommands).length > 0) { | ||
const subCommandArgIndex = opts.rawArgs.findIndex( | ||
(arg) => !arg.startsWith("-") | ||
); | ||
const subCommandName = opts.rawArgs[subCommandArgIndex]; | ||
if (subCommandName) { | ||
if (!subCommands[subCommandName]) { | ||
throw new CLIError( | ||
`Unknown command \`${subCommandName}\``, | ||
"E_UNKNOWN_COMMAND" | ||
); | ||
} | ||
const subCommand = await resolveValue(subCommands[subCommandName]); | ||
if (subCommand) { | ||
await runCommand(subCommand, { | ||
rawArgs: opts.rawArgs.slice(subCommandArgIndex + 1) | ||
}); | ||
} | ||
} else if (!cmd.run) { | ||
throw new CLIError(`No command specified.`, "E_NO_COMMAND"); | ||
} | ||
} | ||
const subCommand = await resolveValue(subCommands[subCommandName]); | ||
if (subCommand) { | ||
await runCommand(subCommand, { | ||
rawArgs: opts.rawArgs.slice(subCommandArgIndex + 1) | ||
}); | ||
if (typeof cmd.run === "function") { | ||
await cmd.run(context); | ||
} | ||
} finally { | ||
if (typeof cmd.cleanup === "function") { | ||
await cmd.cleanup(context); | ||
} | ||
} | ||
if (typeof cmd.run === "function") { | ||
await cmd.run(context); | ||
} | ||
} | ||
@@ -424,2 +431,8 @@ async function resolveSubCommand(cmd, rawArgs, parent) { | ||
process.exit(0); | ||
} else if (rawArgs.length === 1 && rawArgs[0] === "--version") { | ||
const meta = typeof cmd.meta === "function" ? await cmd.meta() : await cmd.meta; | ||
if (!meta?.version) { | ||
throw new CLIError("No version specified", "E_NO_VERSION"); | ||
} | ||
consola.log(meta.version); | ||
} else { | ||
@@ -557,3 +570,3 @@ await runCommand(cmd, { rawArgs }); | ||
name: "@batijs/cli", | ||
version: "0.0.69", | ||
version: "0.0.70", | ||
type: "module", | ||
@@ -576,3 +589,3 @@ scripts: { | ||
"@types/which": "^3.0.0", | ||
citty: "^0.1.3", | ||
citty: "^0.1.4", | ||
colorette: "^2.0.20", | ||
@@ -589,3 +602,3 @@ esbuild: "^0.19.2", | ||
vite: "^4.4.9", | ||
vitest: "^0.34.3", | ||
vitest: "^0.34.4", | ||
which: "^4.0.0" | ||
@@ -592,0 +605,0 @@ }, |
{ | ||
"name": "@batijs/cli", | ||
"version": "0.0.69", | ||
"version": "0.0.70", | ||
"type": "module", | ||
@@ -13,3 +13,3 @@ "keywords": [], | ||
"@types/which": "^3.0.0", | ||
"citty": "^0.1.3", | ||
"citty": "^0.1.4", | ||
"colorette": "^2.0.20", | ||
@@ -26,9 +26,9 @@ "esbuild": "^0.19.2", | ||
"vite": "^4.4.9", | ||
"vitest": "^0.34.3", | ||
"vitest": "^0.34.4", | ||
"which": "^4.0.0", | ||
"@batijs/build": "0.0.69", | ||
"@batijs/tsup": "0.0.69" | ||
"@batijs/build": "0.0.70", | ||
"@batijs/tsup": "0.0.70" | ||
}, | ||
"dependencies": { | ||
"@batijs/core": "0.0.69" | ||
"@batijs/core": "0.0.70" | ||
}, | ||
@@ -35,0 +35,0 @@ "bin": "./dist/index.js", |
221382
0.22%5422
0.24%+ Added
- Removed
Updated