@h3ravel/console 11.8.0 → 11.9.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["ConsoleCommand","outDir","TaskManager","ConsoleCommand","Logger","e","FileSystem","nodepath","path","Str","Logger","FileSystem","options: CommandOption[]","match: RegExpExecArray | null","nestedOptions: CommandOption[] | undefined","placeholder: string | undefined","flags: string[] | undefined","defaultValue: string | number | boolean | undefined | string[]","dir","entryFileName","env","TsDownConfig: Options","path","app: Application","kernel: Kernel","commands: Command[]","path","Logger","Option","program","i","cmd","TsDownConfig","ConsoleKernel","app: Application","path","FileSystem","ServiceProvider"],"sources":["../src/Commands/BuildCommand.ts","../src/Commands/Command.ts","../src/logo.ts","../src/Commands/ListCommand.ts","../src/Commands/MakeCommand.ts","../src/Commands/PostinstallCommand.ts","../src/Signature.ts","../../../node_modules/.pnpm/@rollup+plugin-run@3.1.0_rollup@4.52.3/node_modules/@rollup/plugin-run/dist/es/index.js","../src/TsdownConfig.ts","../src/Musket.ts","../src/Kernel.ts","../src/Providers/ConsoleServiceProvider.ts"],"sourcesContent":["import { Logger, TaskManager } from '@h3ravel/shared'\n\nimport { ConsoleCommand } from '@h3ravel/core'\nimport { execa } from 'execa'\nimport preferredPM from 'preferred-pm'\n\nexport class BuildCommand extends ConsoleCommand {\n\n /**\n * The name and signature of the console command.\n *\n * @var string\n */\n protected signature: string = `build:\n {--m|minify : Minify your bundle output}\n {--d|dev : Build for dev but don't watch for changes}\n `\n\n /**\n * The console command description.\n *\n * @var string\n */\n protected description: string = 'Build the app for production'\n\n public async handle () {\n try {\n await this.fire()\n } catch (e) {\n Logger.error(e as any)\n }\n }\n\n protected async fire () {\n const outDir = this.option('dev') ? '.h3ravel/serve' : env('DIST_DIR', 'dist')\n const minify = this.option('minify')\n const verbosity = this.getVerbosity()\n const debug = verbosity > 0\n\n this.newLine()\n await BuildCommand.build({ outDir, minify, verbosity, debug, mute: false })\n this.newLine()\n }\n\n /**\n * build\n */\n public static async build ({ debug, minify, mute, verbosity, outDir } = {\n mute: false,\n debug: false,\n minify: false,\n verbosity: 0,\n outDir: 'dist'\n }) {\n\n const pm = (await preferredPM(base_path()))?.name ?? 'pnpm'\n\n const LOG_LEVELS = [\n 'silent',\n 'info',\n 'warn',\n 'error',\n ]\n\n const ENV_VARS = {\n EXTENDED_DEBUG: debug ? 'true' : 'false',\n CLI_BUILD: 'true',\n NODE_ENV: 'production',\n DIST_DIR: outDir,\n DIST_MINIFY: minify,\n LOG_LEVEL: LOG_LEVELS[verbosity]\n }\n\n const silent = ENV_VARS.LOG_LEVEL === 'silent' ? '--silent' : null\n\n if (mute) {\n return await execa(\n pm,\n ['tsdown', silent, '--config-loader', 'unconfig', '-c', 'tsdown.default.config.ts'].filter(e => e !== null),\n { stdout: 'inherit', stderr: 'inherit', cwd: base_path(), env: Object.assign({}, process.env, ENV_VARS) }\n )\n }\n\n const type = outDir === 'dist' ? 'Production' : 'Development'\n\n return await TaskManager.advancedTaskRunner(\n [[`Creating ${type} Bundle`, 'STARTED'], [`${type} Bundle Created`, 'COMPLETED']],\n async () => {\n await execa(\n pm,\n ['tsdown', silent, '--config-loader', 'unconfig', '-c', 'tsdown.default.config.ts'].filter(e => e !== null),\n { stdout: 'inherit', stderr: 'inherit', cwd: base_path(), env: Object.assign({}, process.env, ENV_VARS) }\n )\n }\n )\n }\n}\n","import { ConsoleCommand } from '@h3ravel/core'\n\nexport class Command extends ConsoleCommand {\n}\n","export const logo = String.raw`\n 111 \n 111111111 \n 1111111111 111111 \n 111111 111 111111 \n 111111 111 111111 \n11111 111 11111 \n1111111 111 1111111 \n111 11111 111 111111 111 1111 1111 11111111 1111\n111 11111 1111 111111 111 1111 1111 1111 11111 1111\n111 11111 11111 111 1111 1111 111111111111 111111111111 1111 1111111 1111\n111 111111 1111 111 111111111111 111111 11111 1111 111 1111 11111111 1111 1111\n111 111 11111111 111 1101 1101 111111111 11111111 1111 1111111111111111101\n111 1111111111111111 1111 111 1111 1111 111 11111011 1111 111 1111111 1101 1111\n111 11111 1110111111111111 111 1111 1111 1111111101 1111 111111111 1111011 111111111 1111\n1111111 111110111110 111 1111 1111 111111 1111 11011101 10111 11111 1111\n11011 111111 11 11111 \n 111111 11101 111111 \n 111111 111 111111 \n 111111 111 111111 \n 111111111 \n 110 \n`\n\nexport const altLogo = String.raw`\n _ _ _____ _ \n| | | |___ / _ __ __ ___ _____| |\n| |_| | |_ \\| '__/ _ \\ \\ / / _ \\ |\n| _ |___) | | | (_| |\\ V / __/ |\n|_| |_|____/|_| \\__,_| \\_/ \\___|_|\n\n`\n","import { Command } from './Command'\nimport { Logger } from '@h3ravel/shared'\nimport { Option } from 'commander'\n/* eslint-disable no-control-regex */\nimport { altLogo } from '../logo'\n\nexport class ListCommand extends Command {\n\n /**\n * The name and signature of the console command.\n *\n * @var string\n */\n protected signature: string = 'list'\n\n /**\n * The console command description.\n *\n * @var string\n */\n protected description: string = 'List all available commands'\n\n public async handle () {\n const options = [\n {\n short: '-h',\n long: '--help',\n description: 'Display help for the given command. When no command is given display help for the list command'\n } as Option\n ]\n .concat(this.program.options)\n .map(e => {\n const desc = Logger.describe(Logger.log(\n ' ' + [e.short, e.long].filter(e => !!e).join(', '), 'green', false\n ), e.description, 25, false)\n return desc.join('')\n })\n\n /** Get the program commands */\n const commands = this.program.commands.map(e => {\n const desc = Logger.describe(Logger.log(' ' + e.name(), 'green', false), e.description(), 25, false)\n return desc.join('')\n })\n\n const list = ListCommand.groupItems(commands)\n\n /** Ootput the app version */\n Logger.log([['H3ravel Framework', 'white'], [this.kernel.modulePackage.version, 'green']], ' ')\n\n console.log('')\n\n console.log(altLogo)\n\n console.log('')\n\n Logger.log('Usage:', 'yellow')\n Logger.log(' command [options] [arguments]', 'white')\n\n console.log('')\n\n /** Ootput the options */\n Logger.log('Options:', 'yellow')\n console.log(options.join('\\n').trim())\n\n console.log('')\n\n /** Ootput the commands */\n Logger.log('Available Commands:', 'yellow')\n console.log(list.join('\\n\\n').trim())\n }\n\n /**\n * Group Commands based on thier names\n * \n * @param commands \n * @returns \n */\n public static groupItems (commands: string[], fmtd = false) {\n const grouped = commands.reduce<Record<string, string[]>>((acc, cmd) => {\n /** strip colors before checking prefix */\n const clean = cmd.replace(/\\x1b\\[\\d+m/g, '')\n const prefix = clean.includes(':') ? clean.split(':')[0].trim() : '__root__'\n acc[prefix] ??= []\n /** keep original with colors */\n acc[prefix].push(cmd)\n return acc\n }, {})\n\n return Object.entries(grouped).map(([group, cmds]) => {\n const label = group === '__root__' ? '' : group\n let out = [Logger.log(label, 'yellow', false), cmds.join('\\n')].join('\\n')\n if (fmtd) {\n out += '\\n'\n }\n return out\n })\n }\n}\n","import { FileSystem, Logger } from '@h3ravel/shared'\nimport { mkdir, readFile, writeFile } from 'node:fs/promises'\n\nimport { Command } from './Command'\nimport { Str } from '@h3ravel/support'\nimport nodepath from 'node:path'\n\nexport class MakeCommand extends Command {\n\n /**\n * The name and signature of the console command.\n *\n * @var string\n */\n protected signature: string = `#make:\n {controller : Create a new controller class. \n | {--a|api : Exclude the create and edit methods from the controller} \n | {--m|model= : Generate a resource controller for the given model} \n | {--r|resource : Generate a resource controller class} \n | {--force : Create the controller even if it already exists}\n }\n {resource : Create a new resource. \n | {--c|collection : Create a resource collection}\n | {--force : Create the resource even if it already exists}\n }\n {command : Create a new Musket command. \n | {--command : The terminal command that will be used to invoke the class} \n | {--force : Create the class even if the console command already exists}\n }\n {view : Create a new view.\n | {--force : Create the view even if it already exists}\n }\n {^name : The name of the [name] to generate}\n `\n /**\n * The console command description.\n *\n * @var string\n */\n protected description: string = 'Generate component classes'\n\n public async handle (this: any) {\n const command = (this.dictionary.baseCommand ?? this.dictionary.name) as never\n\n if (!this.argument('name')) {\n this.program.error('Please provide a valid name for the ' + command)\n }\n\n const methods = {\n controller: 'makeController',\n resource: 'makeResource',\n view: 'makeView',\n command: 'makeCommand',\n } as const\n\n await this[methods[command]]()\n }\n\n /**\n * Create a new controller class.\n */\n protected async makeController () {\n const type = this.option('api') ? '-resource' : ''\n const name = this.argument('name')\n const force = this.option('force')\n\n const crtlrPath = FileSystem.findModulePkg('@h3ravel/http', this.kernel.cwd) ?? ''\n const stubPath = nodepath.join(crtlrPath, `dist/stubs/controller${type}.stub`)\n const path = app_path(`Http/Controllers/${name}.ts`)\n\n /** The Controller is scoped to a path make sure to create the associated directories */\n if (name.includes('/')) {\n await mkdir(Str.beforeLast(path, '/'), { recursive: true })\n }\n\n /** Check if the controller already exists */\n if (!force && await FileSystem.fileExists(path)) {\n Logger.error(`ERORR: ${name} controller already exists`)\n }\n\n let stub = await readFile(stubPath, 'utf-8')\n stub = stub.replace(/{{ name }}/g, name)\n\n await writeFile(path, stub)\n Logger.split('INFO: Controller Created', Logger.log(nodepath.basename(path), 'gray', false))\n }\n\n protected makeResource () {\n Logger.success('Resource support is not yet available')\n }\n\n /**\n * Create a new Musket command\n */\n protected makeCommand () {\n Logger.success('Musket command creation is not yet available')\n }\n\n /**\n * Create a new view.\n */\n protected async makeView () {\n const name = this.argument('name')\n const force = this.option('force')\n\n const path = base_path(`src/resources/views/${name}.edge`)\n\n /** The view is scoped to a path make sure to create the associated directories */\n if (name.includes('/')) {\n await mkdir(Str.beforeLast(path, '/'), { recursive: true })\n }\n\n /** Check if the view already exists */\n if (!force && await FileSystem.fileExists(path)) {\n Logger.error(`ERORR: ${name} view already exists`)\n }\n\n await writeFile(path, `{{-- src/resources/views/${name}.edge --}}`)\n Logger.split('INFO: View Created', Logger.log(`src/resources/views/${name}.edge`, 'gray', false))\n }\n}\n","import { mkdir, writeFile } from 'node:fs/promises'\n\nimport { Command } from './Command'\nimport { FileSystem } from '@h3ravel/shared'\n\nexport class PostinstallCommand extends Command {\n\n /**\n * The name and signature of the console command.\n *\n * @var string\n */\n protected signature: string = 'postinstall'\n\n /**\n * The console command description.\n *\n * @var string\n */\n protected description: string = 'Default post installation command'\n\n public async handle () {\n this.createSqliteDB()\n }\n\n /**\n * Create sqlite database if none exist\n * \n * @returns \n */\n private async createSqliteDB () {\n if (config('database.default') !== 'sqlite') return\n\n if (!await FileSystem.fileExists(database_path())) {\n await mkdir(database_path(), { recursive: true })\n }\n\n if (!await FileSystem.fileExists(database_path('db.sqlite'))) {\n await writeFile(database_path('db.sqlite'), '')\n }\n }\n}\n","import { CommandOption, ParsedCommand } from './Contracts/ICommand'\n\nimport { Command } from './Commands/Command'\n\nexport class Signature {\n /**\n * Helper to parse options inside a block of text\n * \n * @param block \n * @returns \n */\n static parseOptions (block: string): CommandOption[] {\n const options: CommandOption[] = []\n /**\n * Match { ... } blocks at top level \n */\n const regex = /\\{([^{}]+(?:\\{[^{}]*\\}[^{}]*)*)\\}/g\n let match: RegExpExecArray | null\n\n while ((match = regex.exec(block)) !== null) {\n const shared = '^' === match[1][0]! || /:[#^]/.test(match[1])\n const isHidden = (['#', '^'].includes(match[1][0]!) || /:[#^]/.test(match[1])) && !shared\n const content = match[1].trim().replace(/[#^]/, '')\n /**\n * Split by first ':' to separate name and description+nested\n */\n const colonIndex = content.indexOf(':')\n if (colonIndex === -1) {\n /**\n * No description, treat whole as name\n */\n options.push({ name: content })\n continue\n }\n\n const namePart = content.substring(0, colonIndex).trim()\n const rest = content.substring(colonIndex + 1).trim()\n\n /**\n * Check for nested options after '|'\n */\n let description = rest\n let nestedOptions: CommandOption[] | undefined\n\n const pipeIndex = rest.indexOf('|')\n if (pipeIndex !== -1) {\n description = rest.substring(0, pipeIndex).trim()\n const nestedText = rest.substring(pipeIndex + 1).trim()\n /**\n * nestedText should start with '{' and end with ')', clean it\n * Also Remove trailing ')' if present\n */\n const cleanedNestedText = nestedText.replace(/^\\{/, '').trim()\n\n /**\n * Parse nested options recursively\n */\n nestedOptions = Signature.parseOptions('{' + cleanedNestedText + '}')\n } else {\n /**\n * Trim the string\n */\n description = description.trim()\n }\n\n /**\n * Parse name modifiers (?, *, ?*)\n */\n let name = namePart\n let required = /[^a-zA-Z0-9_|-]/.test(name)\n let multiple = false\n let placeholder: string | undefined\n\n if (name.endsWith('?*')) {\n required = false\n multiple = true\n name = name.slice(0, -2)\n } else if (name.endsWith('*')) {\n multiple = true\n name = name.slice(0, -1)\n } else if (name.endsWith('?')) {\n required = false\n name = name.slice(0, -1)\n const cname = name.split('--').at(1)?.split('|').at(1) ?? name\n placeholder = `[${cname}]`\n }\n\n /**\n * Check if it's a flag option (starts with --)\n */\n const isFlag = name.startsWith('--')\n let flags: string[] | undefined\n let defaultValue: string | number | boolean | undefined | string[]\n\n if (isFlag) {\n /**\n * Parse flags and default values\n */\n const flagParts = name.split('|').map(s => s.trim())\n\n flags = []\n\n for (let part of flagParts) {\n if (part.startsWith('--') && part.slice(2).length === 1) {\n part = '-' + part.slice(2)\n } else if (part.startsWith('-') && !part.startsWith('--') && part.slice(1).length > 1) {\n part = '--' + part.slice(1)\n } else if (!part.startsWith('-') && part.slice(1).length > 1) {\n part = '--' + part\n }\n\n const eqIndex = part.indexOf('=')\n if (eqIndex !== -1) {\n flags.push(part.substring(0, eqIndex))\n const val = part.substring(eqIndex + 1)\n if (val === '*') {\n defaultValue = []\n } else if (val === 'true' || val === 'false' || (!val && !required)) {\n defaultValue = val === 'true'\n } else if (!isNaN(Number(val))) {\n defaultValue = Number(val)\n } else {\n defaultValue = val\n }\n } else {\n flags.push(part)\n }\n }\n }\n\n options.push({\n name: isFlag ? flags![flags!.length - 1] : name,\n required,\n multiple,\n description,\n flags,\n shared,\n isFlag,\n isHidden,\n placeholder,\n defaultValue,\n nestedOptions,\n })\n }\n\n return options\n }\n\n /**\n * Helper to parse a command's signature\n * \n * @param signature \n * @param commandClass \n * @returns \n */\n static parseSignature (signature: string, commandClass: Command): ParsedCommand {\n const lines = signature.split('\\n').map(l => l.trim()).filter(l => l.length > 0)\n const isHidden = ['#', '^'].includes(lines[0][0]!) || /:[#^]/.test(lines[0])\n const baseCommand = lines[0].replace(/[^\\w=:-]/g, '')\n const description = commandClass.getDescription()\n const isNamespaceCommand = baseCommand.endsWith(':')\n\n /**\n * Join the rest lines to a single string for parsing\n */\n const rest = lines.slice(1).join(' ')\n\n /**\n * Parse all top-level options/subcommands\n */\n const allOptions = Signature.parseOptions(rest)\n\n if (isNamespaceCommand) {\n /**\n * Separate subcommands (those without flags) and base options (flags)\n * Here we assume subcommands are those without flags (isFlag false)\n * and base options are flags or options after subcommands\n\n * For simplicity, treat all top-level options as subcommands\n * and assume base command options come after subcommands in signature (not shown in example)\n */\n\n return {\n baseCommand: baseCommand.slice(0, -1),\n isNamespaceCommand,\n subCommands: allOptions.filter(e => !e.flags && !e.isHidden),\n description,\n commandClass,\n options: allOptions.filter(e => !!e.flags),\n isHidden,\n }\n } else {\n return {\n baseCommand,\n isNamespaceCommand,\n options: allOptions,\n description,\n commandClass,\n isHidden,\n }\n }\n }\n}\n","import { fork } from 'child_process';\nimport { resolve, dirname, join } from 'path';\n\nfunction run(opts = {}) {\n let input;\n let proc;\n const args = opts.args || [];\n const allowRestarts = opts.allowRestarts || false;\n const overrideInput = opts.input;\n const forkOptions = opts.options || opts;\n delete forkOptions.args;\n delete forkOptions.allowRestarts;\n return {\n name: 'run',\n buildStart(options) {\n let inputs = overrideInput !== null && overrideInput !== void 0 ? overrideInput : options.input;\n if (typeof inputs === 'string') {\n inputs = [inputs];\n }\n if (typeof inputs === 'object') {\n inputs = Object.values(inputs);\n }\n if (inputs.length > 1) {\n throw new Error(`@rollup/plugin-run must have a single entry point; consider setting the \\`input\\` option`);\n }\n input = resolve(inputs[0]);\n },\n generateBundle(_outputOptions, _bundle, isWrite) {\n if (!isWrite) {\n this.error(`@rollup/plugin-run currently only works with bundles that are written to disk`);\n }\n },\n writeBundle(outputOptions, bundle) {\n const forkBundle = (dir, entryFileName) => {\n if (proc)\n proc.kill();\n proc = fork(join(dir, entryFileName), args, forkOptions);\n };\n const dir = outputOptions.dir || dirname(outputOptions.file);\n const entryFileName = Object.keys(bundle).find((fileName) => {\n const chunk = bundle[fileName];\n return chunk.isEntry && chunk.facadeModuleId === input;\n });\n if (entryFileName) {\n forkBundle(dir, entryFileName);\n if (allowRestarts) {\n process.stdin.resume();\n process.stdin.setEncoding('utf8');\n process.stdin.on('data', (data) => {\n const line = data.toString().trim().toLowerCase();\n if (line === 'rs' || line === 'restart' || data.toString().charCodeAt(0) === 11) {\n forkBundle(dir, entryFileName);\n }\n else if (line === 'cls' || line === 'clear' || data.toString().charCodeAt(0) === 12) {\n // eslint-disable-next-line no-console\n console.clear();\n }\n });\n }\n }\n else {\n this.error(`@rollup/plugin-run could not find output chunk`);\n }\n }\n };\n}\n\nexport { run as default };\n//# sourceMappingURL=index.js.map\n","import { Options } from 'tsdown'\nimport { existsSync } from 'node:fs'\nimport path from 'node:path'\nimport { rm } from 'node:fs/promises'\nimport run from '@rollup/plugin-run'\n\nconst env = process.env.NODE_ENV || 'development'\nlet outDir = env === 'development' ? '.h3ravel/serve' : 'dist'\nif (process.env.DIST_DIR) {\n outDir = process.env.DIST_DIR\n}\n\nexport const TsDownConfig: Options = {\n outDir,\n entry: ['src/**/*.ts'],\n format: ['esm'],//, 'cjs'],\n target: 'node22',\n sourcemap: env === 'development',\n minify: !!process.env.DIST_MINIFY,\n external: [\n /^@h3ravel\\/.*/gi,\n ],\n clean: true,\n shims: true,\n copy: [{ from: 'public', to: outDir }, 'src/resources', 'src/database'],\n env: env === 'development' ? {\n NODE_ENV: env,\n DIST_DIR: outDir,\n } : {},\n watch:\n env === 'development' && process.env.CLI_BUILD !== 'true'\n ? ['.env', '.env.*', 'src', '../../packages']\n : false,\n dts: false,\n logLevel: 'silent',\n nodeProtocol: true,\n skipNodeModulesBundle: true,\n hooks (e) {\n e.hook('build:done', async () => {\n const paths = ['database/migrations', 'database/factories', 'database/seeders']\n for (let i = 0; i < paths.length; i++) {\n const name = paths[i]\n if (existsSync(path.join(outDir, name)))\n await rm(path.join(outDir, name), { recursive: true })\n }\n })\n },\n plugins: env === 'development' && process.env.CLI_BUILD !== 'true' ? [\n run({\n env: Object.assign({}, process.env, {\n NODE_ENV: env,\n DIST_DIR: outDir,\n }),\n execArgv: ['-r', 'source-map-support/register'],\n allowRestarts: false,\n input: process.cwd() + '/src/server.ts'//\n })\n ] : [],\n}\n\nexport default TsDownConfig\n","\nimport { CommandOption, ParsedCommand } from './Contracts/ICommand'\nimport { Option, program, type Command as Commander } from 'commander'\n\nimport { Application } from '@h3ravel/core'\nimport { Command } from './Commands/Command'\nimport { Kernel } from './Kernel'\nimport { ListCommand } from './Commands/ListCommand'\nimport { Logger } from '@h3ravel/shared'\nimport { MakeCommand } from './Commands/MakeCommand'\nimport { Signature } from './Signature'\nimport TsDownConfig from './TsdownConfig'\nimport { altLogo } from './logo'\nimport { build } from 'tsdown'\nimport { glob } from 'node:fs/promises'\nimport path from 'node:path'\nimport { PostinstallCommand } from './Commands/PostinstallCommand'\nimport { BuildCommand } from './Commands/BuildCommand'\n\n\nexport class Musket {\n private commands: ParsedCommand[] = []\n\n constructor(private app: Application, private kernel: Kernel) { }\n\n async build () {\n this.loadBaseCommands()\n await this.loadDiscoveredCommands()\n return await this.initialize()\n }\n\n private loadBaseCommands () {\n const commands: Command[] = [\n new MakeCommand(this.app, this.kernel),\n new ListCommand(this.app, this.kernel),\n new PostinstallCommand(this.app, this.kernel),\n new BuildCommand(this.app, this.kernel),\n ]\n\n commands.forEach(e => this.addCommand(e))\n }\n\n private async loadDiscoveredCommands () {\n const DIST_DIR = `/${env('DIST_DIR', '.h3ravel/serve')}/`.replaceAll('//', '')\n const commands: Command[] = [\n ...this.app.registeredCommands.map(cmd => new cmd(this.app, this.kernel))\n ]\n\n /**\n * Musket Commands auto registration\n */\n const providers_path = app_path('Console/Commands/*.js').replace('/src/', DIST_DIR)\n\n /** Add the App Commands */\n for await (const cmd of glob(providers_path)) {\n const name = path.basename(cmd).replace('.js', '')\n try {\n const cmdClass = (await import(cmd))[name]\n commands.push(new cmdClass(this.app, this.kernel))\n } catch { /** */ }\n }\n\n commands.forEach(e => this.addCommand(e))\n }\n\n addCommand (command: Command) {\n this.commands.push(Signature.parseSignature(command.getSignature(), command))\n }\n\n private async initialize () {\n // Build the app if the user is calling for help to ensure we get the latest data\n if (process.argv.includes('--help') || process.argv.includes('-h')) {\n await this.rebuild('help')\n Object.keys(require.cache).forEach(key => delete require.cache[key])\n }\n\n /** Init the Musket Version */\n const cliVersion = Logger.parse([\n ['Musket CLI:', 'white'],\n [this.kernel.consolePackage.version, 'green']\n ], ' ', false)\n\n /** Init the App Version */\n const localVersion = Logger.parse([\n ['H3ravel Framework:', 'white'],\n [this.kernel.modulePackage.version, 'green']\n ], ' ', false)\n\n const additional = {\n quiet: ['-q, --quiet', 'Do not output any message except errors and warnings'],\n silent: ['--silent', 'Do not output any message'],\n verbose: ['-v, --verbose <number>', 'Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug'],\n noInteraction: ['-n, --no-interaction', 'Do not ask any interactive question'],\n }\n\n /** \n * Init Commander\n */\n program\n .name('musket')\n .version(`${cliVersion}\\n${localVersion}`)\n .description(altLogo)\n .configureHelp({ showGlobalOptions: true })\n .addOption(new Option(additional.quiet[0], additional.quiet[1]))\n .addOption(new Option(additional.silent[0], additional.silent[1]).implies({ quiet: true }))\n .addOption(new Option(additional.verbose[0], additional.verbose[1]).choices(['1', '2', '3']))\n .addOption(new Option(additional.noInteraction[0], additional.noInteraction[1]))\n .action(async () => {\n const instance = new ListCommand(this.app, this.kernel)\n instance.setInput(program.opts(), program.args, program.registeredArguments, {}, program)\n instance.handle()\n })\n\n /**\n * Format the help command display\n */\n program.configureHelp({\n styleTitle: (str) => Logger.log(str, 'yellow', false),\n styleOptionTerm: (str) => Logger.log(str, 'green', false),\n styleArgumentTerm: (str) => Logger.log(str, 'green', false),\n styleSubcommandTerm: (str) => Logger.log(str, 'green', false),\n formatItemList (heading, items) {\n if (items.length < 1) {\n return []\n }\n const c = (str: string) => str.replace(/[^A-Za-z0-9-,]/g, '').replace('32m', '')\n\n let flags = items.filter(e => c(e).startsWith('--') || c(e).includes(',--'))\n\n if (flags.length > 0) {\n flags = [Logger.log('\\n' + heading + '\\n', 'yellow', false)].concat(flags)\n }\n\n const list = items.filter(e => !c(e).startsWith('--') && !c(e).includes(',--'))\n\n if (list.length < 1) {\n return flags\n }\n\n return flags.concat(Logger.log('\\nAvailable Commands:', 'yellow', false), ListCommand.groupItems(list, true))\n },\n showGlobalOptions: true\n })\n\n\n /** \n * Create the init Command\n */\n program\n .command('init')\n .description('Initialize H3ravel.')\n .action(async () => {\n Logger.success('Initialized: H3ravel has been initialized!')\n })\n\n /** \n * Loop through all the available commands\n */\n for (let i = 0; i < this.commands.length; i++) {\n const command = this.commands[i]\n const instance = command.commandClass\n\n if (command.isNamespaceCommand && command.subCommands) {\n /**\n * Initialize the base command\n */\n const cmd = command.isHidden\n ? program\n : program\n .command(command.baseCommand)\n .description(command.description ?? '')\n .action(async () => {\n instance.setInput(cmd.opts(), cmd.args, cmd.registeredArguments, command, program)\n await instance.handle()\n })\n\n /**\n * Add options to the base command if it has any\n */\n if ((command.options?.length ?? 0) > 0) {\n command.options\n ?.filter((v, i, a) => a.findIndex(t => t.name === v.name) === i)\n .forEach(opt => {\n this.makeOption(opt, cmd)\n })\n }\n\n /**\n * Initialize the sub commands\n */\n command\n .subCommands\n .filter((v, i, a) => !v.shared && a.findIndex(t => t.name === v.name) === i)\n .forEach(sub => {\n const cmd = program\n .command(`${command.baseCommand}:${sub.name}`)\n .description(sub.description || '')\n .action(async () => {\n instance.setInput(cmd.opts(), cmd.args, cmd.registeredArguments, sub, program)\n await instance.handle()\n })\n\n /**\n * Add the shared arguments here\n */\n command.subCommands?.filter(e => e.shared).forEach(opt => {\n this.makeOption(opt, cmd, false, sub)\n })\n\n /**\n * Add the shared options here\n */\n command.options?.filter(e => e.shared).forEach(opt => {\n this.makeOption(opt, cmd, false, sub)\n })\n\n /**\n * Add options to the sub command if it has any\n */\n if (sub.nestedOptions) {\n sub.nestedOptions\n .filter((v, i, a) => a.findIndex(t => t.name === v.name) === i)\n .forEach(opt => {\n this.makeOption(opt, cmd)\n })\n }\n })\n } else {\n /**\n * Initialize command with options\n */\n const cmd = program\n .command(command.baseCommand)\n .description(command.description ?? '')\n\n command\n ?.options\n ?.filter((v, i, a) => a.findIndex(t => t.name === v.name) === i)\n .forEach(opt => {\n this.makeOption(opt, cmd, true)\n })\n\n cmd.action(async () => {\n instance.setInput(cmd.opts(), cmd.args, cmd.registeredArguments, command, program)\n await instance.handle()\n })\n }\n }\n\n /** Rebuild the app on every command except fire so we wont need TS */\n program.hook('preAction', async (_, cmd) => {\n this.rebuild(cmd.name())\n })\n\n return program\n }\n\n async rebuild (name: string) {\n if (name !== 'fire' && name !== 'build') {\n await build({\n ...TsDownConfig,\n watch: false,\n plugins: []\n })\n }\n }\n\n makeOption (opt: CommandOption, cmd: Commander, parse?: boolean, parent?: any) {\n const description = opt.description?.replace(/\\[(\\w+)\\]/g, (_, k) => parent?.[k] ?? `[${k}]`) ?? ''\n const type = opt.name.replaceAll('-', '')\n\n if (opt.isFlag) {\n if (parse) {\n let flags = opt.flags\n ?.map(f => (f.length === 1 ? `-${f}` : `--${f.replace(/^-+/, '')}`))\n .join(', ') ?? undefined\n\n if (opt.required && !opt.placeholder) {\n flags += ` <${type}>`\n } else if (opt.placeholder) {\n flags += ' ' + opt.placeholder\n }\n\n cmd.option(flags || '', description!, <never>opt.defaultValue)\n } else {\n let flags = opt.flags?.join(', ') ?? ''\n\n if (opt.required && !opt.placeholder) {\n flags += ` <${type}>`\n } else if (opt.placeholder) {\n flags += ' ' + opt.placeholder\n }\n\n cmd.option(\n flags,\n description!,\n <never>opt.defaultValue\n )\n }\n } else {\n cmd.argument(\n opt.required ? `<${opt.name}>` : `[${opt.name}]`,\n description,\n opt.defaultValue\n )\n }\n }\n\n static async parse (kernel: Kernel) {\n return (await new Musket(kernel.app, kernel).build()).parseAsync()\n }\n\n}\n","import { Application, ConsoleKernel } from '@h3ravel/core'\n\nimport { FileSystem } from '@h3ravel/shared'\nimport { Musket } from './Musket'\nimport path from 'node:path'\n\nexport class Kernel extends ConsoleKernel {\n constructor(public app: Application) {\n super(app)\n }\n\n static init (app: Application) {\n const instance = new Kernel(app)\n\n Promise.all([instance.loadRequirements()])\n .then(([e]) => e.run())\n }\n\n\n private async run () {\n await Musket.parse(this)\n process.exit(0)\n }\n\n private async loadRequirements () {\n this.cwd = path.join(process.cwd(), this.basePath)\n this.modulePath = FileSystem.findModulePkg('@h3ravel/core', this.cwd) ?? ''\n this.consolePath = FileSystem.findModulePkg('@h3ravel/console', this.cwd) ?? ''\n\n try {\n this.modulePackage = await import(path.join(this.modulePath, 'package.json'))\n } catch {\n this.modulePackage = { version: 'N/A' }\n }\n\n try {\n this.consolePackage = await import(path.join(this.consolePath, 'package.json'))\n } catch {\n this.consolePackage = { version: 'N/A' }\n }\n\n return this\n }\n}\n","/// <reference path=\"../../../core/src/app.globals.d.ts\" />\n\nimport { Kernel } from '../Kernel'\nimport { ServiceProvider } from '@h3ravel/core'\n/**\n * Handles CLI commands and tooling.\n * \n * Register DatabaseManager and QueryBuilder.\n * Set up ORM models and relationships.\n * Register migration and seeder commands.\n * \n * Auto-Registered when in CLI mode\n */\nexport class ConsoleServiceProvider extends ServiceProvider {\n public static priority = 992\n\n /**\n * Indicate that this service provider only runs in console\n */\n public static runsInConsole = true\n public runsInConsole = true\n\n register () {\n }\n\n boot () {\n Kernel.init(this.app)\n\n process.on('SIGINT', () => {\n process.exit(0)\n })\n process.on('SIGTERM', () => {\n process.exit(0)\n })\n }\n}\n"],"x_google_ignoreList":[7],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,IAAa,eAAb,MAAa,qBAAqBA,8BAAe;;;;;;CAO7C,AAAU,YAAoB;;;;;;;;;CAU9B,AAAU,cAAsB;CAEhC,MAAa,SAAU;AACnB,MAAI;AACA,SAAM,KAAK,MAAM;WACZ,GAAG;AACR,2BAAO,MAAM,EAAS;;;CAI9B,MAA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;EADK;;CAInB,OAAO,KAAM,KAAkB;EAC3B,MAAM,WAAW,IAAI,OAAO,IAAI;AAEhC,UAAQ,IAAI,CAAC,SAAS,kBAAkB,CAAC,CAAC,CACrC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC;;CAI/B,MAAc,MAAO;AACjB,QAAM,OAAO,MAAM,KAAK;AACxB,UAAQ,KAAK,EAAE;;CAGnB,MAAc,mBAAoB;AAC9B,OAAK,MAAMC,kBAAK,KAAK,QAAQ,KAAK,EAAE,KAAK,SAAS;AAClD,OAAK,aAAaC,4BAAW,cAAc,iBAAiB,KAAK,IAAI,IAAI;AACzE,OAAK,cAAcA,4BAAW,cAAc,oBAAoB,KAAK,IAAI,IAAI;AAE7E,MAAI;AACA,QAAK,gBAAgB,MAAM,OAAOD,kBAAK,KAAK,KAAK,YAAY,eAAe;UACxE;AACJ,QAAK,gBAAgB,EAAE,SAAS,OAAO;;AAG3C,MAAI;AACA,QAAK,iBAAiB,MAAM,OAAOA,kBAAK,KAAK,KAAK,aAAa,eAAe;UAC1E;AACJ,QAAK,iBAAiB,EAAE,SAAS,OAAO;;AAG5C,SAAO;;;;;;;;;;;;;;;AC5Bf,IAAa,yBAAb,cAA4CE,+BAAgB;CACxD,OAAc,WAAW;;;;CAKzB,OAAc,gBAAgB;CAC9B,AAAO,gBAAgB;CAEvB,WAAY;CAGZ,OAAQ;AACJ,SAAO,KAAK,KAAK,IAAI;AAErB,UAAQ,GAAG,gBAAgB;AACvB,WAAQ,KAAK,EAAE;IACjB;AACF,UAAQ,GAAG,iBAAiB;AACxB,WAAQ,KAAK,EAAE;IACjB"}
1
+ {"version":3,"file":"index.cjs","names":["ConsoleCommand","outDir","TaskManager","ConsoleCommand","Logger","Logger","e","FileSystem","nodepath","path","Str","Logger","FileSystem","options: CommandOption[]","match: RegExpExecArray | null","description: string","nestedOptions: CommandOption[] | undefined","flags: string[] | undefined","choices: string[]","placeholder: string | undefined","defaultValue: string | number | boolean | undefined | string[]","dir","entryFileName","env","TsDownConfig: Options","path","app: Application","kernel: Kernel","commands: Command[]","path","Logger","Option","program","i","cmd","TsDownConfig","Argument","ContainerResolver","ConsoleKernel","app: Application","path","FileSystem","ServiceProvider"],"sources":["../src/Commands/BuildCommand.ts","../src/Commands/Command.ts","../src/Commands/HelpCommand.ts","../src/logo.ts","../src/Commands/ListCommand.ts","../src/Commands/MakeCommand.ts","../src/Commands/PostinstallCommand.ts","../src/Signature.ts","../../../node_modules/.pnpm/@rollup+plugin-run@3.1.0_rollup@4.52.3/node_modules/@rollup/plugin-run/dist/es/index.js","../src/TsdownConfig.ts","../src/Musket.ts","../src/Kernel.ts","../src/Providers/ConsoleServiceProvider.ts"],"sourcesContent":["import { Logger, TaskManager } from '@h3ravel/shared'\n\nimport { ConsoleCommand } from '@h3ravel/core'\nimport { execa } from 'execa'\nimport preferredPM from 'preferred-pm'\n\nexport class BuildCommand extends ConsoleCommand {\n\n /**\n * The name and signature of the console command.\n *\n * @var string\n */\n protected signature: string = `build\n {--m|minify : Minify your bundle output}\n {--d|dev : Build for dev but don't watch for changes}\n `\n\n /**\n * The console command description.\n *\n * @var string\n */\n protected description: string = 'Build the app for production'\n\n public async handle () {\n try {\n await this.fire()\n } catch (e) {\n Logger.error(e as any)\n }\n }\n\n protected async fire () {\n const outDir = this.option('dev') ? '.h3ravel/serve' : env('DIST_DIR', 'dist')\n const minify = this.option('minify')\n const verbosity = this.getVerbosity()\n const debug = verbosity > 0\n\n this.newLine()\n await BuildCommand.build({ outDir, minify, verbosity, debug, mute: false })\n this.newLine()\n }\n\n /**\n * build\n */\n public static async build ({ debug, minify, mute, verbosity, outDir } = {\n mute: false,\n debug: false,\n minify: false,\n verbosity: 0,\n outDir: 'dist'\n }) {\n\n const pm = (await preferredPM(base_path()))?.name ?? 'pnpm'\n\n const LOG_LEVELS = [\n 'silent',\n 'info',\n 'warn',\n 'error',\n ]\n\n const ENV_VARS = {\n EXTENDED_DEBUG: debug ? 'true' : 'false',\n CLI_BUILD: 'true',\n NODE_ENV: 'production',\n DIST_DIR: outDir,\n DIST_MINIFY: minify,\n LOG_LEVEL: LOG_LEVELS[verbosity]\n }\n\n const silent = ENV_VARS.LOG_LEVEL === 'silent' ? '--silent' : null\n\n if (mute) {\n return await execa(\n pm,\n ['tsdown', silent, '--config-loader', 'unconfig', '-c', 'tsdown.default.config.ts'].filter(e => e !== null),\n { stdout: 'inherit', stderr: 'inherit', cwd: base_path(), env: Object.assign({}, process.env, ENV_VARS) }\n )\n }\n\n const type = outDir === 'dist' ? 'Production' : 'Development'\n\n return await TaskManager.advancedTaskRunner(\n [[`Creating ${type} Bundle`, 'STARTED'], [`${type} Bundle Created`, 'COMPLETED']],\n async () => {\n await execa(\n pm,\n ['tsdown', silent, '--config-loader', 'unconfig', '-c', 'tsdown.default.config.ts'].filter(e => e !== null),\n { stdout: 'inherit', stderr: 'inherit', cwd: base_path(), env: Object.assign({}, process.env, ENV_VARS) }\n )\n }\n )\n }\n}\n","import { ConsoleCommand } from '@h3ravel/core'\n\nexport class Command extends ConsoleCommand {\n}\n","import { Command } from './Command'\nimport { Logger } from '@h3ravel/shared'\n\nexport class HelpCommand extends Command {\n\n /**\n * The name and signature of the console command.\n *\n * @var string\n */\n protected signature: string = `help\n {command_name=help : The command name}\n {--format=txt : The output format}\n `\n\n /**\n * The console command description.\n *\n * @var string\n */\n protected description: string = 'Display help for a command'\n\n public async handle () {\n const cmd = this.argument('command_name')\n\n if (!cmd) {\n this.program.outputHelp()\n return\n }\n\n const target = this.program.commands.find(c => c.name() === cmd)\n\n if (!target) {\n this.error(`ERROR: Unknown command: ${Logger.log(cmd, ['italic', 'grey'], false)}.`)\n process.exit(1)\n }\n\n target.outputHelp()\n }\n}\n","export const logo = String.raw`\n 111 \n 111111111 \n 1111111111 111111 \n 111111 111 111111 \n 111111 111 111111 \n11111 111 11111 \n1111111 111 1111111 \n111 11111 111 111111 111 1111 1111 11111111 1111\n111 11111 1111 111111 111 1111 1111 1111 11111 1111\n111 11111 11111 111 1111 1111 111111111111 111111111111 1111 1111111 1111\n111 111111 1111 111 111111111111 111111 11111 1111 111 1111 11111111 1111 1111\n111 111 11111111 111 1101 1101 111111111 11111111 1111 1111111111111111101\n111 1111111111111111 1111 111 1111 1111 111 11111011 1111 111 1111111 1101 1111\n111 11111 1110111111111111 111 1111 1111 1111111101 1111 111111111 1111011 111111111 1111\n1111111 111110111110 111 1111 1111 111111 1111 11011101 10111 11111 1111\n11011 111111 11 11111 \n 111111 11101 111111 \n 111111 111 111111 \n 111111 111 111111 \n 111111111 \n 110 \n`\n\nexport const altLogo = String.raw`\n _ _ _____ _ \n| | | |___ / _ __ __ ___ _____| |\n| |_| | |_ \\| '__/ _ \\ \\ / / _ \\ |\n| _ |___) | | | (_| |\\ V / __/ |\n|_| |_|____/|_| \\__,_| \\_/ \\___|_|\n\n`\n","import { Command } from './Command'\nimport { Logger } from '@h3ravel/shared'\nimport { Option } from 'commander'\n/* eslint-disable no-control-regex */\nimport { altLogo } from '../logo'\n\nexport class ListCommand extends Command {\n\n /**\n * The name and signature of the console command.\n *\n * @var string\n */\n protected signature: string = 'list'\n\n /**\n * The console command description.\n *\n * @var string\n */\n protected description: string = 'List all available commands'\n\n public async handle () {\n const options = [\n {\n short: '-h',\n long: '--help',\n description: 'Display help for the given command. When no command is given display help for the list command'\n } as Option\n ]\n .concat(this.program.options)\n .map(e => {\n const desc = Logger.describe(Logger.log(\n ' ' + [e.short, e.long].filter(e => !!e).join(', '), 'green', false\n ), e.description, 25, false)\n return desc.join('')\n })\n\n /** Get the program commands */\n const commands = this.program.commands.map(e => {\n const desc = Logger.describe(Logger.log(' ' + e.name(), 'green', false), e.description(), 25, false)\n return desc.join('')\n })\n\n const list = ListCommand.groupItems(commands)\n\n /** Ootput the app version */\n Logger.log([['H3ravel Framework', 'white'], [this.kernel.modulePackage.version, 'green']], ' ')\n\n console.log('')\n\n console.log(altLogo)\n\n console.log('')\n\n Logger.log('Usage:', 'yellow')\n Logger.log(' command [options] [arguments]', 'white')\n\n console.log('')\n\n /** Ootput the options */\n Logger.log('Options:', 'yellow')\n console.log(options.join('\\n').trim())\n\n console.log('')\n\n /** Ootput the commands */\n Logger.log('Available Commands:', 'yellow')\n console.log(list.join('\\n\\n').trim())\n }\n\n /**\n * Group Commands based on thier names\n * \n * @param commands \n * @returns \n */\n public static groupItems (commands: string[], fmtd = false) {\n const grouped = commands.reduce<Record<string, string[]>>((acc, cmd) => {\n /** strip colors before checking prefix */\n const clean = cmd.replace(/\\x1b\\[\\d+m/g, '')\n const prefix = clean.includes(':') ? clean.split(':')[0].trim() : '__root__'\n acc[prefix] ??= []\n /** keep original with colors */\n acc[prefix].push(cmd)\n return acc\n }, {})\n\n return Object.entries(grouped).map(([group, cmds]) => {\n const label = group === '__root__' ? '' : group\n let out = [Logger.log(label, 'yellow', false), cmds.join('\\n')].join('\\n')\n if (fmtd) {\n out += '\\n'\n }\n return out\n })\n }\n}\n","import { FileSystem, Logger } from '@h3ravel/shared'\nimport { mkdir, readFile, writeFile } from 'node:fs/promises'\n\nimport { Command } from './Command'\nimport { Str } from '@h3ravel/support'\nimport nodepath from 'node:path'\n\nexport class MakeCommand extends Command {\n\n /**\n * The name and signature of the console command.\n *\n * @var string\n */\n protected signature: string = `#make:\n {controller : Create a new controller class. \n | {--a|api : Exclude the create and edit methods from the controller} \n | {--m|model= : Generate a resource controller for the given model} \n | {--r|resource : Generate a resource controller class} \n | {--force : Create the controller even if it already exists}\n }\n {resource : Create a new resource. \n | {--c|collection : Create a resource collection}\n | {--force : Create the resource even if it already exists}\n }\n {command : Create a new Musket command. \n | {--command : The terminal command that will be used to invoke the class} \n | {--force : Create the class even if the console command already exists}\n }\n {view : Create a new view.\n | {--force : Create the view even if it already exists}\n }\n {^name : The name of the [name] to generate}\n `\n /**\n * The console command description.\n *\n * @var string\n */\n protected description: string = 'Generate component classes'\n\n public async handle (this: any) {\n const command = (this.dictionary.baseCommand ?? this.dictionary.name) as never\n\n if (!this.argument('name')) {\n this.program.error('Please provide a valid name for the ' + command)\n }\n\n const methods = {\n controller: 'makeController',\n resource: 'makeResource',\n view: 'makeView',\n command: 'makeCommand',\n } as const\n\n await this[methods[command]]()\n }\n\n /**\n * Create a new controller class.\n */\n protected async makeController () {\n const type = this.option('api') ? '-resource' : ''\n const name = this.argument('name')\n const force = this.option('force')\n\n const crtlrPath = FileSystem.findModulePkg('@h3ravel/http', this.kernel.cwd) ?? ''\n const stubPath = nodepath.join(crtlrPath, `dist/stubs/controller${type}.stub`)\n const path = app_path(`Http/Controllers/${name}.ts`)\n\n /** The Controller is scoped to a path make sure to create the associated directories */\n if (name.includes('/')) {\n await mkdir(Str.beforeLast(path, '/'), { recursive: true })\n }\n\n /** Check if the controller already exists */\n if (!force && await FileSystem.fileExists(path)) {\n Logger.error(`ERORR: ${name} controller already exists`)\n }\n\n let stub = await readFile(stubPath, 'utf-8')\n stub = stub.replace(/{{ name }}/g, name)\n\n await writeFile(path, stub)\n Logger.split('INFO: Controller Created', Logger.log(nodepath.basename(path), 'gray', false))\n }\n\n protected makeResource () {\n Logger.success('Resource support is not yet available')\n }\n\n /**\n * Create a new Musket command\n */\n protected makeCommand () {\n Logger.success('Musket command creation is not yet available')\n }\n\n /**\n * Create a new view.\n */\n protected async makeView () {\n const name = this.argument('name')\n const force = this.option('force')\n\n const path = base_path(`src/resources/views/${name}.edge`)\n\n /** The view is scoped to a path make sure to create the associated directories */\n if (name.includes('/')) {\n await mkdir(Str.beforeLast(path, '/'), { recursive: true })\n }\n\n /** Check if the view already exists */\n if (!force && await FileSystem.fileExists(path)) {\n Logger.error(`ERORR: ${name} view already exists`)\n }\n\n await writeFile(path, `{{-- src/resources/views/${name}.edge --}}`)\n Logger.split('INFO: View Created', Logger.log(`src/resources/views/${name}.edge`, 'gray', false))\n }\n}\n","import { mkdir, writeFile } from 'node:fs/promises'\n\nimport { Command } from './Command'\nimport { FileSystem } from '@h3ravel/shared'\n\nexport class PostinstallCommand extends Command {\n\n /**\n * The name and signature of the console command.\n *\n * @var string\n */\n protected signature: string = 'postinstall'\n\n /**\n * The console command description.\n *\n * @var string\n */\n protected description: string = 'Default post installation command'\n\n public async handle () {\n this.createSqliteDB()\n }\n\n /**\n * Create sqlite database if none exist\n * \n * @returns \n */\n private async createSqliteDB () {\n if (config('database.default') !== 'sqlite') return\n\n if (!await FileSystem.fileExists(database_path())) {\n await mkdir(database_path(), { recursive: true })\n }\n\n if (!await FileSystem.fileExists(database_path('db.sqlite'))) {\n await writeFile(database_path('db.sqlite'), '')\n }\n }\n}\n","import { CommandOption, ParsedCommand } from './Contracts/ICommand'\n\nimport { Command } from './Commands/Command'\n\nexport class Signature {\n /**\n * Helper to parse options inside a block of text\n * \n * @param block \n * @returns \n */\n static parseOptions (block: string): CommandOption[] {\n const options: CommandOption[] = []\n /**\n * Match { ... } blocks at top level \n */\n const regex = /\\{([^{}]+(?:\\{[^{}]*\\}[^{}]*)*)\\}/g\n let match: RegExpExecArray | null\n\n while ((match = regex.exec(block)) !== null) {\n const shared = '^' === match[1][0]! || /:[#^]/.test(match[1])\n const isHidden = (['#', '^'].includes(match[1][0]!) || /:[#^]/.test(match[1])) && !shared\n const content = match[1].trim().replace(/[#^]/, '')\n /**\n * Split by first ':' to separate name and description+nested\n */\n const colonIndex = content.indexOf(':')\n if (colonIndex === -1) {\n /**\n * No description, treat whole as name\n */\n options.push({ name: content })\n continue\n }\n\n const namePart = content.substring(0, colonIndex).trim()\n const rest = content.substring(colonIndex + 1).trim()\n\n /**\n * Check for nested options after '|'\n */\n let description: string = rest\n let nestedOptions: CommandOption[] | undefined\n\n const pipeIndex = rest.indexOf('|')\n if (pipeIndex !== -1) {\n description = rest.substring(0, pipeIndex).trim()\n const nestedText = rest.substring(pipeIndex + 1).trim()\n /**\n * nestedText should start with '{' and end with ')', clean it\n * Also Remove trailing ')' if present\n */\n const cleanedNestedText = nestedText.replace(/^\\{/, '').trim()\n\n /**\n * Parse nested options recursively\n */\n nestedOptions = Signature.parseOptions('{' + cleanedNestedText + '}')\n } else {\n /**\n * Trim the string\n */\n description = description.trim()\n }\n\n // Initialize all variables\n let name = namePart\n let flags: string[] | undefined\n let choices: string[] = []\n let required = /[^a-zA-Z0-9_|-]/.test(name)\n let multiple = false\n let placeholder: string | undefined\n let defaultValue: string | number | boolean | undefined | string[]\n\n /**\n * Parse the command name\n */\n if (name.includes('=')) {\n const [rawName, rawDefault] = name.split('=')\n\n name = rawName.trim()\n const hold = rawName.trim().split('|')\n const holder = (hold.at(1) ?? hold.at(0)!).replace('--', '')\n defaultValue = rawDefault.trim()\n placeholder = defaultValue ? `[${holder}]` : `<${holder}>`\n required = false\n }\n\n /**\n * Parse name modifiers (?, *, ?*)\n */\n if (name.endsWith('?*')) {\n required = false\n multiple = true\n name = name.slice(0, -2)\n } else if (name.endsWith('*')) {\n multiple = true\n name = name.slice(0, -1)\n } else if (name.endsWith('?')) {\n required = false\n name = name.slice(0, -1)\n const cname = name.split('--').at(1)?.split('|').at(1) ?? name\n placeholder = `[${cname}]`\n }\n\n /**\n * Check if it's a flag option (starts with --)\n */\n const isFlag = name.startsWith('--')\n\n if (isFlag) {\n /**\n * Parse flags and default values\n */\n const flagParts = name.split('|').map(s => s.trim())\n\n flags = []\n\n for (let part of flagParts) {\n if (part.startsWith('--') && part.slice(2).length === 1) {\n part = '-' + part.slice(2)\n } else if (part.startsWith('-') && !part.startsWith('--') && part.slice(1).length > 1) {\n part = '--' + part.slice(1)\n } else if (!part.startsWith('-') && part.slice(1).length > 1) {\n part = '--' + part\n }\n\n const eqIndex = part.indexOf('=')\n if (eqIndex !== -1) {\n flags.push(part.substring(0, eqIndex))\n const val = part.substring(eqIndex + 1)\n if (val === '*') {\n defaultValue = []\n } else if (val === 'true' || val === 'false' || (!val && !required)) {\n defaultValue = val === 'true'\n } else if (!isNaN(Number(val))) {\n defaultValue = Number(val)\n } else {\n defaultValue = val\n }\n } else {\n flags.push(part)\n }\n }\n }\n\n // Extract choices from the descriptions\n const desc = description.match(/^([^:]+?)\\s*:\\s*\\[?([\\w\\s,]+)\\]?$/)\n if (match) {\n description = desc?.[1].trim() ?? description\n choices = desc?.[2].split(',').map(s => s.trim()).filter(Boolean) ?? choices\n }\n\n options.push({\n name: isFlag ? flags![flags!.length - 1] : name,\n choices,\n required,\n multiple,\n description,\n flags,\n shared,\n isFlag,\n isHidden,\n placeholder,\n defaultValue,\n nestedOptions,\n })\n }\n\n return options\n }\n\n /**\n * Helper to parse a command's signature\n * \n * @param signature \n * @param commandClass \n * @returns \n */\n static parseSignature (signature: string, commandClass: Command): ParsedCommand {\n const lines = signature.split('\\n').map(l => l.trim()).filter(l => l.length > 0)\n const isHidden = ['#', '^'].includes(lines[0][0]!) || /:[#^]/.test(lines[0])\n const baseCommand = lines[0].split('{')[0].trim().replace(/[^\\w:-]/g, '')\n const description = commandClass.getDescription()\n const isNamespaceCommand = baseCommand.endsWith(':')\n /**\n * Join the rest lines to a single string for parsing\n */\n const rest = lines.slice(1).join(' ')\n\n /**\n * Parse all top-level options/subcommands\n */\n const allOptions = Signature.parseOptions(rest)\n\n if (isNamespaceCommand) {\n /**\n * Separate subcommands (those without flags) and base options (flags)\n * Here we assume subcommands are those without flags (isFlag false)\n * and base options are flags or options after subcommands\n\n * For simplicity, treat all top-level options as subcommands\n * and assume base command options come after subcommands in signature (not shown in example)\n */\n\n return {\n baseCommand: baseCommand.slice(0, -1),\n isNamespaceCommand,\n subCommands: allOptions.filter(e => !e.flags && !e.isHidden),\n description,\n commandClass,\n options: allOptions.filter(e => !!e.flags),\n isHidden,\n }\n } else {\n return {\n baseCommand,\n isNamespaceCommand,\n options: allOptions,\n description,\n commandClass,\n isHidden,\n }\n }\n }\n}\n","import { fork } from 'child_process';\nimport { resolve, dirname, join } from 'path';\n\nfunction run(opts = {}) {\n let input;\n let proc;\n const args = opts.args || [];\n const allowRestarts = opts.allowRestarts || false;\n const overrideInput = opts.input;\n const forkOptions = opts.options || opts;\n delete forkOptions.args;\n delete forkOptions.allowRestarts;\n return {\n name: 'run',\n buildStart(options) {\n let inputs = overrideInput !== null && overrideInput !== void 0 ? overrideInput : options.input;\n if (typeof inputs === 'string') {\n inputs = [inputs];\n }\n if (typeof inputs === 'object') {\n inputs = Object.values(inputs);\n }\n if (inputs.length > 1) {\n throw new Error(`@rollup/plugin-run must have a single entry point; consider setting the \\`input\\` option`);\n }\n input = resolve(inputs[0]);\n },\n generateBundle(_outputOptions, _bundle, isWrite) {\n if (!isWrite) {\n this.error(`@rollup/plugin-run currently only works with bundles that are written to disk`);\n }\n },\n writeBundle(outputOptions, bundle) {\n const forkBundle = (dir, entryFileName) => {\n if (proc)\n proc.kill();\n proc = fork(join(dir, entryFileName), args, forkOptions);\n };\n const dir = outputOptions.dir || dirname(outputOptions.file);\n const entryFileName = Object.keys(bundle).find((fileName) => {\n const chunk = bundle[fileName];\n return chunk.isEntry && chunk.facadeModuleId === input;\n });\n if (entryFileName) {\n forkBundle(dir, entryFileName);\n if (allowRestarts) {\n process.stdin.resume();\n process.stdin.setEncoding('utf8');\n process.stdin.on('data', (data) => {\n const line = data.toString().trim().toLowerCase();\n if (line === 'rs' || line === 'restart' || data.toString().charCodeAt(0) === 11) {\n forkBundle(dir, entryFileName);\n }\n else if (line === 'cls' || line === 'clear' || data.toString().charCodeAt(0) === 12) {\n // eslint-disable-next-line no-console\n console.clear();\n }\n });\n }\n }\n else {\n this.error(`@rollup/plugin-run could not find output chunk`);\n }\n }\n };\n}\n\nexport { run as default };\n//# sourceMappingURL=index.js.map\n","import { Options } from 'tsdown'\nimport { existsSync } from 'node:fs'\nimport path from 'node:path'\nimport { rm } from 'node:fs/promises'\nimport run from '@rollup/plugin-run'\n\nconst env = process.env.NODE_ENV || 'development'\nlet outDir = env === 'development' ? '.h3ravel/serve' : 'dist'\nif (process.env.DIST_DIR) {\n outDir = process.env.DIST_DIR\n}\n\nexport const TsDownConfig: Options = {\n outDir,\n entry: ['src/**/*.ts'],\n format: ['esm'],//, 'cjs'],\n target: 'node22',\n sourcemap: env === 'development',\n minify: !!process.env.DIST_MINIFY,\n external: [\n /^@h3ravel\\/.*/gi,\n ],\n clean: true,\n shims: true,\n copy: [{ from: 'public', to: outDir }, 'src/resources', 'src/database'],\n env: env === 'development' ? {\n NODE_ENV: env,\n DIST_DIR: outDir,\n } : {},\n watch:\n env === 'development' && process.env.CLI_BUILD !== 'true'\n ? ['.env', '.env.*', 'src', '../../packages']\n : false,\n dts: false,\n logLevel: 'silent',\n nodeProtocol: true,\n skipNodeModulesBundle: true,\n hooks (e) {\n e.hook('build:done', async () => {\n const paths = ['database/migrations', 'database/factories', 'database/seeders']\n for (let i = 0; i < paths.length; i++) {\n const name = paths[i]\n if (existsSync(path.join(outDir, name)))\n await rm(path.join(outDir, name), { recursive: true })\n }\n })\n },\n plugins: env === 'development' && process.env.CLI_BUILD !== 'true' ? [\n run({\n env: Object.assign({}, process.env, {\n NODE_ENV: env,\n DIST_DIR: outDir,\n }),\n execArgv: ['-r', 'source-map-support/register'],\n allowRestarts: false,\n input: process.cwd() + '/src/server.ts'//\n })\n ] : [],\n}\n\nexport default TsDownConfig\n","\nimport { CommandOption, ParsedCommand } from './Contracts/ICommand'\nimport { Argument, Option, program, type Command as Commander } from 'commander'\n\nimport { Application, ContainerResolver } from '@h3ravel/core'\nimport { Command } from './Commands/Command'\nimport { Kernel } from './Kernel'\nimport { ListCommand } from './Commands/ListCommand'\nimport { Logger } from '@h3ravel/shared'\nimport { MakeCommand } from './Commands/MakeCommand'\nimport { Signature } from './Signature'\nimport TsDownConfig from './TsdownConfig'\nimport { altLogo } from './logo'\nimport { build } from 'tsdown'\nimport { glob } from 'node:fs/promises'\nimport path from 'node:path'\nimport { PostinstallCommand } from './Commands/PostinstallCommand'\nimport { BuildCommand } from './Commands/BuildCommand'\nimport { HelpCommand } from './Commands/HelpCommand'\n\n\nexport class Musket {\n private commands: ParsedCommand[] = []\n\n constructor(private app: Application, private kernel: Kernel) { }\n\n async build () {\n this.loadBaseCommands()\n await this.loadDiscoveredCommands()\n return await this.initialize()\n }\n\n private loadBaseCommands () {\n const commands: Command[] = [\n new HelpCommand(this.app, this.kernel),\n new MakeCommand(this.app, this.kernel),\n new ListCommand(this.app, this.kernel),\n new PostinstallCommand(this.app, this.kernel),\n new BuildCommand(this.app, this.kernel),\n ]\n\n commands.forEach(e => this.addCommand(e))\n }\n\n private async loadDiscoveredCommands () {\n const DIST_DIR = `/${env('DIST_DIR', '.h3ravel/serve')}/`.replaceAll('//', '')\n const commands: Command[] = [\n ...this.app.registeredCommands.map(cmd => new cmd(this.app, this.kernel))\n ]\n\n /**\n * Musket Commands auto registration\n */\n const providers_path = app_path('Console/Commands/*.js').replace('/src/', DIST_DIR)\n\n /** Add the App Commands */\n for await (const cmd of glob(providers_path)) {\n const name = path.basename(cmd).replace('.js', '')\n try {\n const cmdClass = (await import(cmd))[name]\n commands.push(new cmdClass(this.app, this.kernel))\n } catch { /** */ }\n }\n\n commands.forEach(e => this.addCommand(e))\n }\n\n addCommand (command: Command) {\n this.commands.push(Signature.parseSignature(command.getSignature(), command))\n }\n\n private async initialize () {\n // Build the app if the user is calling for help to ensure we get the latest data\n if (process.argv.includes('--help') || process.argv.includes('-h')) {\n await this.rebuild('help')\n Object.keys(require.cache).forEach(key => delete require.cache[key])\n }\n\n /** Init the Musket Version */\n const cliVersion = Logger.parse([\n ['Musket CLI:', 'white'],\n [this.kernel.consolePackage.version, 'green']\n ], ' ', false)\n\n /** Init the App Version */\n const localVersion = Logger.parse([\n ['H3ravel Framework:', 'white'],\n [this.kernel.modulePackage.version, 'green']\n ], ' ', false)\n\n const additional = {\n quiet: ['-q, --quiet', 'Do not output any message except errors and warnings'],\n silent: ['--silent', 'Do not output any message'],\n verbose: ['-v, --verbose <number>', 'Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug'],\n noInteraction: ['-n, --no-interaction', 'Do not ask any interactive question'],\n }\n\n /** \n * Init Commander\n */\n program\n .name('musket')\n .version(`${cliVersion}\\n${localVersion}`)\n .description(altLogo)\n .configureHelp({ showGlobalOptions: true })\n .addOption(new Option(additional.quiet[0], additional.quiet[1]))\n .addOption(new Option(additional.silent[0], additional.silent[1]).implies({ quiet: true }))\n .addOption(new Option(additional.verbose[0], additional.verbose[1]).choices(['1', '2', '3']))\n .addOption(new Option(additional.noInteraction[0], additional.noInteraction[1]))\n .action(async () => {\n const instance = new ListCommand(this.app, this.kernel)\n instance.setInput(program.opts(), program.args, program.registeredArguments, {}, program)\n await this.handle(instance)\n })\n\n /**\n * Format the help command display\n */\n program.configureHelp({\n styleTitle: (str) => Logger.log(str, 'yellow', false),\n styleOptionTerm: (str) => Logger.log(str, 'green', false),\n styleArgumentTerm: (str) => Logger.log(str, 'green', false),\n styleSubcommandTerm: (str) => Logger.log(str, 'green', false),\n formatItemList (heading, items) {\n if (items.length < 1) {\n return []\n }\n\n if (!heading.includes('Commands:')) {\n return items\n }\n\n const c = (str: string) => str.replace(/[^A-Za-z0-9-,]/g, '').replace('32m', '')\n\n let flags = items.filter(e => c(e).startsWith('--') || c(e).includes(',--'))\n\n if (flags.length > 0) {\n flags = [Logger.log('\\n' + heading + '\\n', 'yellow', false)].concat(flags)\n }\n\n const list = items.filter(e => !c(e).startsWith('--') && !c(e).includes(',--'))\n\n if (list.length < 1) {\n return flags\n }\n\n const _heading = c(heading).includes('Arguments') ? heading : 'Available Commands:'\n\n return flags.concat(Logger.log(`\\n${_heading}`, 'yellow', false), ListCommand.groupItems(list, true))\n },\n showGlobalOptions: true\n })\n\n\n /** \n * Create the init Command\n */\n program\n .command('init')\n .description('Initialize H3ravel.')\n .action(async () => {\n Logger.success('Initialized: H3ravel has been initialized!')\n })\n\n /** \n * Loop through all the available commands\n */\n for (let i = 0; i < this.commands.length; i++) {\n const command = this.commands[i]\n const instance = command.commandClass\n\n if (command.isNamespaceCommand && command.subCommands) {\n /**\n * Initialize the base command\n */\n const cmd = command.isHidden\n ? program\n : program\n .command(command.baseCommand)\n .description(command.description ?? '')\n .action(async () => {\n instance.setInput(cmd.opts(), cmd.args, cmd.registeredArguments, command, program)\n await this.handle(instance)\n })\n\n /**\n * Add options to the base command if it has any\n */\n if ((command.options?.length ?? 0) > 0) {\n command.options\n ?.filter((v, i, a) => a.findIndex(t => t.name === v.name) === i)\n .forEach(opt => {\n this.makeOption(opt, cmd)\n })\n }\n\n /**\n * Initialize the sub commands\n */\n command\n .subCommands\n .filter((v, i, a) => !v.shared && a.findIndex(t => t.name === v.name) === i)\n .forEach(sub => {\n const cmd = program\n .command(`${command.baseCommand}:${sub.name}`)\n .description(sub.description || '')\n .action(async () => {\n instance.setInput(cmd.opts(), cmd.args, cmd.registeredArguments, sub, program)\n await this.handle(instance)\n })\n\n /**\n * Add the shared arguments here\n */\n command.subCommands?.filter(e => e.shared).forEach(opt => {\n this.makeOption(opt, cmd, false, sub)\n })\n\n /**\n * Add the shared options here\n */\n command.options?.filter(e => e.shared).forEach(opt => {\n this.makeOption(opt, cmd, false, sub)\n })\n\n /**\n * Add options to the sub command if it has any\n */\n if (sub.nestedOptions) {\n sub.nestedOptions\n .filter((v, i, a) => a.findIndex(t => t.name === v.name) === i)\n .forEach(opt => {\n this.makeOption(opt, cmd)\n })\n }\n })\n } else {\n /**\n * Initialize command with options\n */\n const cmd = program\n .command(command.baseCommand)\n .description(command.description ?? '')\n\n command\n ?.options\n ?.filter((v, i, a) => a.findIndex(t => t.name === v.name) === i)\n .forEach(opt => {\n this.makeOption(opt, cmd, true)\n })\n\n cmd.action(async () => {\n instance.setInput(cmd.opts(), cmd.args, cmd.registeredArguments, command, program)\n await this.handle(instance)\n })\n }\n }\n\n /** Rebuild the app on every command except fire so we wont need TS */\n program.hook('preAction', async (_, cmd) => {\n this.rebuild(cmd.name())\n })\n\n return program\n }\n\n async rebuild (name: string) {\n if (name !== 'fire' && name !== 'build') {\n await build({\n ...TsDownConfig,\n watch: false,\n plugins: []\n })\n }\n }\n\n private makeOption (opt: CommandOption, cmd: Commander, parse?: boolean, parent?: any) {\n const description = opt.description?.replace(/\\[(\\w+)\\]/g, (_, k) => parent?.[k] ?? `[${k}]`) ?? ''\n const type = opt.name.replaceAll('-', '')\n\n if (opt.isFlag) {\n if (parse) {\n let flags = opt.flags\n ?.map(f => (f.length === 1 ? `-${f}` : `--${f.replace(/^-+/, '')}`))\n .join(', ') ?? undefined\n\n if (opt.required && !opt.placeholder) {\n flags += ` <${type}>`\n } else if (opt.placeholder) {\n flags += ' ' + opt.placeholder\n }\n\n let optn = new Option(flags || '', description).default(opt.defaultValue)\n if (opt.choices && opt.choices.length) {\n optn = optn.choices(opt.choices ?? [])\n }\n cmd.addOption(optn)\n } else {\n let flags = opt.flags?.join(', ') ?? ''\n\n if (opt.required && !opt.placeholder) {\n flags += ` <${type}>`\n } else if (opt.placeholder) {\n flags += ' ' + opt.placeholder\n }\n\n let optn = new Option(flags, description).default(opt.defaultValue)\n if (opt.choices && opt.choices.length) {\n optn = optn.choices(opt.choices ?? [])\n }\n cmd.addOption(optn)\n }\n } else {\n let name = opt.placeholder\n if (!name) {\n name = opt.required ? `<${opt.name}>` : `[${opt.name}]`\n }\n\n let arg = new Argument(name, description)\n if (opt.choices && opt.choices.length) {\n arg = arg.choices(opt.choices ?? [])\n }\n if (opt.defaultValue) arg.default(opt.defaultValue)\n cmd.addArgument(arg)\n }\n }\n\n private async handle (cmd: Command) {\n //\n await new ContainerResolver(this.app).resolveMethodParams(cmd, 'handle')\n }\n\n static async parse (kernel: Kernel) {\n return (await new Musket(kernel.app, kernel).build())\n .exitOverride(() => {\n Logger.log('Unknown command or argument.', 'white')\n Logger.log([\n ['Run', 'white'],\n ['`musket --help`', ['grey', 'italic']],\n ['to see available commands.', 'white']\n ], ' ')\n })\n .parseAsync(process.argv)\n .catch(e => e)\n }\n\n}\n","import { Application, ConsoleKernel } from '@h3ravel/core'\n\nimport { FileSystem } from '@h3ravel/shared'\nimport { Musket } from './Musket'\nimport path from 'node:path'\n\nexport class Kernel extends ConsoleKernel {\n constructor(public app: Application) {\n super(app)\n }\n\n static init (app: Application) {\n const instance = new Kernel(app)\n\n Promise.all([instance.loadRequirements()])\n .then(([e]) => e.run())\n }\n\n\n private async run () {\n await Musket.parse(this)\n process.exit(0)\n }\n\n private async loadRequirements () {\n this.cwd = path.join(process.cwd(), this.basePath)\n this.modulePath = FileSystem.findModulePkg('@h3ravel/core', this.cwd) ?? ''\n this.consolePath = FileSystem.findModulePkg('@h3ravel/console', this.cwd) ?? ''\n\n try {\n this.modulePackage = await import(path.join(this.modulePath, 'package.json'))\n } catch {\n this.modulePackage = { version: 'N/A' }\n }\n\n try {\n this.consolePackage = await import(path.join(this.consolePath, 'package.json'))\n } catch {\n this.consolePackage = { version: 'N/A' }\n }\n\n return this\n }\n}\n","/// <reference path=\"../../../core/src/app.globals.d.ts\" />\n\nimport { Kernel } from '../Kernel'\nimport { ServiceProvider } from '@h3ravel/core'\n/**\n * Handles CLI commands and tooling.\n * \n * Register DatabaseManager and QueryBuilder.\n * Set up ORM models and relationships.\n * Register migration and seeder commands.\n * \n * Auto-Registered when in CLI mode\n */\nexport class ConsoleServiceProvider extends ServiceProvider {\n public static priority = 992\n\n /**\n * Indicate that this service provider only runs in console\n */\n public static runsInConsole = true\n public runsInConsole = true\n\n register () {\n }\n\n boot () {\n Kernel.init(this.app)\n\n process.on('SIGINT', () => {\n process.exit(0)\n })\n process.on('SIGTERM', () => {\n process.exit(0)\n })\n }\n}\n"],"x_google_ignoreList":[8],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,IAAa,eAAb,MAAa,qBAAqBA,8BAAe;;;;;;CAO7C,AAAU,YAAoB;;;;;;;;;CAU9B,AAAU,cAAsB;CAEhC,MAAa,SAAU;AACnB,MAAI;AACA,SAAM,KAAK,MAAM;WACZ,GAAG;AACR,2BAAO,MAAM,EAAS;;;CAI9B,MAAgB,OAAQ;EACpB,MAAMC,WAAS,KAAK,OAAO,MAAM,GAAG,mBAAmB,IAAI,YAAY,OAAO;EAC9E,MAAM,SAAS,KAAK,O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AAK,KAAK,KAAK,YAAY,eAAe;UACxE;AACJ,QAAK,gBAAgB,EAAE,SAAS,OAAO;;AAG3C,MAAI;AACA,QAAK,iBAAiB,MAAM,OAAOA,kBAAK,KAAK,KAAK,aAAa,eAAe;UAC1E;AACJ,QAAK,iBAAiB,EAAE,SAAS,OAAO;;AAG5C,SAAO;;;;;;;;;;;;;;;AC5Bf,IAAa,yBAAb,cAA4CE,+BAAgB;CACxD,OAAc,WAAW;;;;CAKzB,OAAc,gBAAgB;CAC9B,AAAO,gBAAgB;CAEvB,WAAY;CAGZ,OAAQ;AACJ,SAAO,KAAK,KAAK,IAAI;AAErB,UAAQ,GAAG,gBAAgB;AACvB,WAAQ,KAAK,EAAE;IACjB;AACF,UAAQ,GAAG,iBAAiB;AACxB,WAAQ,KAAK,EAAE;IACjB"}
package/dist/index.d.cts CHANGED
@@ -53,6 +53,23 @@ declare class BuildCommand extends ConsoleCommand {
53
53
  //#region src/Commands/Command.d.ts
54
54
  declare class Command extends ConsoleCommand {}
55
55
  //#endregion
56
+ //#region src/Commands/HelpCommand.d.ts
57
+ declare class HelpCommand extends Command {
58
+ /**
59
+ * The name and signature of the console command.
60
+ *
61
+ * @var string
62
+ */
63
+ protected signature: string;
64
+ /**
65
+ * The console command description.
66
+ *
67
+ * @var string
68
+ */
69
+ protected description: string;
70
+ handle(): Promise<void>;
71
+ }
72
+ //#endregion
56
73
  //#region src/Commands/ListCommand.d.ts
57
74
  declare class ListCommand extends Command {
58
75
  /**
@@ -139,6 +156,8 @@ type CommandOption = {
139
156
  placeholder?: string;
140
157
  description?: string;
141
158
  defaultValue?: string | number | boolean | undefined | string[];
159
+ choices?: string[];
160
+ argParser?: (...args: []) => any;
142
161
  /**
143
162
  * for options like --Q|queue
144
163
  */
@@ -203,8 +222,9 @@ declare class Musket {
203
222
  addCommand(command: Command): void;
204
223
  private initialize;
205
224
  rebuild(name: string): Promise<void>;
206
- makeOption(opt: CommandOption, cmd: Command$1, parse?: boolean, parent?: any): void;
207
- static parse(kernel: Kernel): Promise<Command$1>;
225
+ private makeOption;
226
+ private handle;
227
+ static parse(kernel: Kernel): Promise<any>;
208
228
  }
209
229
  //#endregion
210
230
  //#region src/Providers/ConsoleServiceProvider.d.ts
@@ -250,5 +270,5 @@ declare class Signature {
250
270
  //#region src/TsdownConfig.d.ts
251
271
  declare const TsDownConfig: Options;
252
272
  //#endregion
253
- export { BuildCommand, Command, CommandOption, ConsoleServiceProvider, Kernel, ListCommand, MakeCommand, Musket, ParsedCommand, PostinstallCommand, Signature, TsDownConfig, altLogo, logo };
273
+ export { BuildCommand, Command, CommandOption, ConsoleServiceProvider, HelpCommand, Kernel, ListCommand, MakeCommand, Musket, ParsedCommand, PostinstallCommand, Signature, TsDownConfig, altLogo, logo };
254
274
  //# sourceMappingURL=index.d.cts.map
package/dist/index.d.ts CHANGED
@@ -53,6 +53,23 @@ declare class BuildCommand extends ConsoleCommand {
53
53
  //#region src/Commands/Command.d.ts
54
54
  declare class Command extends ConsoleCommand {}
55
55
  //#endregion
56
+ //#region src/Commands/HelpCommand.d.ts
57
+ declare class HelpCommand extends Command {
58
+ /**
59
+ * The name and signature of the console command.
60
+ *
61
+ * @var string
62
+ */
63
+ protected signature: string;
64
+ /**
65
+ * The console command description.
66
+ *
67
+ * @var string
68
+ */
69
+ protected description: string;
70
+ handle(): Promise<void>;
71
+ }
72
+ //#endregion
56
73
  //#region src/Commands/ListCommand.d.ts
57
74
  declare class ListCommand extends Command {
58
75
  /**
@@ -139,6 +156,8 @@ type CommandOption = {
139
156
  placeholder?: string;
140
157
  description?: string;
141
158
  defaultValue?: string | number | boolean | undefined | string[];
159
+ choices?: string[];
160
+ argParser?: (...args: []) => any;
142
161
  /**
143
162
  * for options like --Q|queue
144
163
  */
@@ -203,8 +222,9 @@ declare class Musket {
203
222
  addCommand(command: Command): void;
204
223
  private initialize;
205
224
  rebuild(name: string): Promise<void>;
206
- makeOption(opt: CommandOption, cmd: Command$1, parse?: boolean, parent?: any): void;
207
- static parse(kernel: Kernel): Promise<Command$1>;
225
+ private makeOption;
226
+ private handle;
227
+ static parse(kernel: Kernel): Promise<any>;
208
228
  }
209
229
  //#endregion
210
230
  //#region src/Providers/ConsoleServiceProvider.d.ts
@@ -250,5 +270,5 @@ declare class Signature {
250
270
  //#region src/TsdownConfig.d.ts
251
271
  declare const TsDownConfig: Options;
252
272
  //#endregion
253
- export { BuildCommand, Command, CommandOption, ConsoleServiceProvider, Kernel, ListCommand, MakeCommand, Musket, ParsedCommand, PostinstallCommand, Signature, TsDownConfig, altLogo, logo };
273
+ export { BuildCommand, Command, CommandOption, ConsoleServiceProvider, HelpCommand, Kernel, ListCommand, MakeCommand, Musket, ParsedCommand, PostinstallCommand, Signature, TsDownConfig, altLogo, logo };
254
274
  //# sourceMappingURL=index.d.ts.map