import { h as defineCommand, s as logLevelArgs, t as cwdArgs } from "./_shared-YyGADOl7.mjs"; import { c as intro, d as outro, u as logger } from "./startup-clock-DXZlxuSA.mjs"; import { t as templateNames } from "./names-BemXlTaX.mjs"; import { t as loadKit } from "./kit-CbhDo9Zs.mjs"; import { r as relativeToProcess } from "./paths-DlXZaaIg.mjs"; import process from "node:process"; import { styleText } from "node:util"; import { dirname, isAbsolute, relative, resolve } from "pathe"; import { promises } from "node:fs"; import { camelCase, pascalCase } from "scule"; //#region src/utils/templates/modifiers.ts /** Suffixes accepted by `--mode`, and as shorthand flags of their own. */ const modes = ["client", "server"]; /** * Suffixes accepted by `--method`, and as shorthand flags of their own. * * Order decides the order suffixes are concatenated in when more than one * shorthand is passed, so it is kept rather than sorted. */ const httpMethods = [ "connect", "delete", "get", "head", "options", "post", "put", "trace", "patch" ]; //#endregion //#region src/utils/templates/api.ts const api = ({ name, args, nuxtOptions }) => { return { path: resolve(nuxtOptions.srcDir, nuxtOptions.serverDir, `api/${name}${applySuffix(args, httpMethods, "method")}.ts`), contents: ` export default defineEventHandler(event => { return 'Hello ${name}' }) ` }; }; //#endregion //#region src/utils/templates/app.ts const app = ({ args, nuxtOptions }) => ({ path: resolve(nuxtOptions.srcDir, "app.vue"), contents: args.pages ? `