@h3ravel/console 11.2.1 → 11.3.1

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","Logger","e","path$1","escalade","path","nodepath","Logger","Utils","TableGuesser","stub: string","options: CommandOption[]","nestedOptions: CommandOption[] | undefined","flags: string[] | undefined","defaultValue: string | number | boolean | undefined | string[]","dir","entryFileName","TsDownConfig: Options","app: Application","kernel: Kernel","commands: Command[]","path","Logger","Option","program","i","cmd","TsDownConfig","ConsoleKernel","app: Application","path","ServiceProvider"],"sources":["../src/Commands/Command.ts","../src/logo.ts","../src/Commands/ListCommand.ts","../../filesystem/dist/index.js","../src/Commands/MakeCommand.ts","../src/Signature.ts","../../../node_modules/.pnpm/@rollup+plugin-run@3.1.0/node_modules/@rollup/plugin-run/dist/es/index.js","../src/TsdownConfig.ts","../src/Musket.ts","../src/Kernel.ts","../src/Providers/ConsoleServiceProvider.ts"],"sourcesContent":["import { ConsoleCommand } from '@h3ravel/core'\n\nexport class Command extends ConsoleCommand { }\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 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 const list = Object.entries(grouped).map(([group, cmds]) => {\n const label = group === '__root__' ? '' : group\n return [Logger.log(label, 'yellow', false), cmds.join('\\n')].join('\\n')\n })\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","import { ServiceProvider } from \"@h3ravel/core\";\nimport { access } from \"fs/promises\";\nimport escalade from \"escalade/sync\";\nimport path from \"path\";\n\n//#region src/Providers/FilesystemProvider.ts\n/**\n* Sets up Filesystem management and lifecycle.\n* \n*/\nvar FilesystemProvider = class extends ServiceProvider {\n\tstatic priority = 997;\n\tregister() {}\n};\n\n//#endregion\n//#region src/Utils/Helpers.ts\nvar Helpers = class {\n\tstatic findModulePkg(moduleId, cwd) {\n\t\tconst parts = moduleId.replace(/\\\\/g, \"/\").split(\"/\");\n\t\tlet packageName = \"\";\n\t\tif (parts.length > 0 && parts[0][0] === \"@\") packageName += parts.shift() + \"/\";\n\t\tpackageName += parts.shift();\n\t\tconst packageJson = path.join(cwd ?? process.cwd(), \"node_modules\", packageName);\n\t\tconst resolved = this.findUpConfig(packageJson, \"package\", [\"json\"]);\n\t\tif (!resolved) return;\n\t\treturn path.join(path.dirname(resolved), parts.join(\"/\"));\n\t}\n\t/**\n\t* Check if file exists\n\t* \n\t* @param path \n\t* @returns \n\t*/\n\tstatic async fileExists(path$1) {\n\t\ttry {\n\t\t\tawait access(path$1);\n\t\t\treturn true;\n\t\t} catch {\n\t\t\treturn false;\n\t\t}\n\t}\n\tstatic findUpConfig(cwd, name, extensions) {\n\t\treturn escalade(cwd, (_dir, names) => {\n\t\t\tfor (const ext of extensions) {\n\t\t\t\tconst filename = `${name}.${ext}`;\n\t\t\t\tif (names.includes(filename)) return filename;\n\t\t\t}\n\t\t\treturn false;\n\t\t});\n\t}\n};\n\n//#endregion\nexport { FilesystemProvider, Helpers };\n//# sourceMappingURL=index.js.map","import { TableGuesser, Utils } from '../Utils'\nimport { mkdir, readFile, writeFile } from 'node:fs/promises'\n\nimport { Command } from './Command'\nimport { Helpers } from '@h3ravel/filesystem'\nimport { Logger } from '@h3ravel/shared'\nimport { beforeLast } from '@h3ravel/support'\nimport dayjs from 'dayjs'\nimport { existsSync } from 'node:fs'\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 {migration : Generates a new database migration class. \n | {--l|type=ts : The file type to generate} \n | {--t|table : The table to migrate} \n | {--c|create : The table to be created} \n }\n {factory : Create a new model factory.}\n {seeder : Create a new seeder class.}\n {view : Create a new view.\n | {--force : Create the view even if it already exists}\n }\n {model : Create a new Eloquent model class. \n | {--api : Indicates if the generated controller should be an API resource controller} \n | {--c|controller : Create a new controller for the model} \n | {--f|factory : Create a new factory for the model} \n | {--m|migration : Create a new migration file for the model} \n | {--r|resource : Indicates if the generated controller should be a resource controller} \n | {--a|all : Generate a migration, seeder, factory, policy, resource controller, and form request classes for the model} \n | {--s|seed : Create a new seeder for the model} \n | {--t|type=ts : The file type to generate}\n | {--force : Create the model 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 () {\n const command = (this.dictionary.baseCommand ?? this.dictionary.name) as never\n\n const methods = {\n controller: 'makeController',\n resource: 'makeResource',\n migration: 'makeMigration',\n factory: 'makeFactory',\n seeder: 'makeSeeder',\n model: 'makeModel',\n view: 'makeView',\n } as const\n\n try {\n await (this as any)?.[methods[command]]()\n } catch (e) {\n Logger.error(e as any)\n }\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 path = nodepath.join(app_path('Http/Controllers'), name + '.ts')\n const crtlrPath = Helpers.findModulePkg('@h3ravel/http', this.kernel.cwd) ?? ''\n const stubPath = nodepath.join(crtlrPath, `dist/stubs/controller${type}.stub`)\n\n /** Check if the controller already exists */\n if (!force && existsSync(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 * Generate a new database migration class\n */\n protected async makeMigration () {\n const name = this.argument('name')\n const datePrefix = dayjs().format('YYYY_MM_DD_HHmmss')\n const path = nodepath.join(database_path('migrations'), `${datePrefix}_${name}.ts`)\n\n const crtlrPath = Utils.findModulePkg('@h3ravel/database', this.kernel.cwd) ?? ''\n\n let create = this.option('create', false)\n let table = this.option('table')\n if (!table && typeof create === 'string') {\n table = create\n create = true\n }\n\n if (!table) {\n const guessed = TableGuesser.guess(name)\n table = guessed[0]\n create = !!guessed[1]\n }\n\n const stubPath = nodepath.join(crtlrPath, this.getMigrationStubName(table, create))\n let stub = await readFile(stubPath, 'utf-8')\n\n if (table !== null) {\n stub = stub.replace(/DummyTable|{{\\s*table\\s*}}/g, table)\n }\n\n Logger.info('INFO: Creating Migration')\n\n await this.kernel.ensureDirectoryExists(nodepath.dirname(path))\n await writeFile(path, stub)\n\n Logger.split('INFO: Migration Created', Logger.log(nodepath.basename(path), 'gray', false))\n }\n\n /**\n * Create a new model factory\n */\n protected makeFactory () {\n Logger.success('Factory support is not yet available')\n }\n\n /**\n * Create a new seeder class\n */\n protected makeSeeder () {\n Logger.success('Seeder support is not yet available')\n }\n\n /**\n * Generate a new Arquebus model class\n */\n protected async makeModel () {\n const type = this.option('type', 'ts')\n const name = this.argument('name')\n const force = this.argument('force')\n\n const path = nodepath.join(app_path('Models'), name.toLowerCase(), '.' + type)\n\n /** Check if the model already exists */\n if (!force && existsSync(path)) {\n Logger.error(`ERORR: ${name} view already exists`)\n }\n\n const crtlrPath = Utils.findModulePkg('@h3ravel/database', this.kernel.cwd) ?? ''\n const stubPath = nodepath.join(crtlrPath, `dist/stubs/model-${type}.stub`)\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: Model Created', Logger.log(nodepath.basename(path), 'gray', false))\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 = nodepath.join(base_path('src/resources/views'), name + '.edge')\n\n if (name.includes('/')) {\n await mkdir(beforeLast(path, '/'), { recursive: true })\n }\n\n /** Check if the view already exists */\n if (!force && existsSync(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 /**\n * Ge the database migration file name\n * \n * @param table \n * @param create \n * @param type \n * @returns \n */\n getMigrationStubName (table?: string, create: boolean = false, type: 'ts' | 'js' = 'ts') {\n let stub: string\n if (!table) {\n stub = `migration-${type}.stub`\n }\n else if (create) {\n stub = `migration.create-${type}.stub`\n }\n else {\n stub = `migration.update-${type}.stub`\n }\n return 'dist/stubs/' + stub\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\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\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 }\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 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 { dirname, join, resolve } from 'path';\n\nimport { fork } from 'child_process';\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 run from '@rollup/plugin-run'\n\nconst env = process.env.NODE_ENV || 'development'\nconst outDir = env === 'development' ? '.h3ravel/serve' : 'dist'\n\nexport const TsDownConfig: Options = {\n outDir,\n entry: ['src/**/*.ts'],\n format: ['esm'],//, 'cjs'],\n target: 'node22',\n sourcemap: env === 'development',\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 SRC_PATH: 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 plugins: env === 'development' && process.env.CLI_BUILD !== 'true' ? [\n run({\n env: Object.assign({}, process.env, {\n NODE_ENV: env,\n SRC_PATH: 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","import { 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'\n\n/**\n * Musket is H3ravel's CLI tool\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 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 ]\n\n commands.forEach(e => this.addCommand(e))\n }\n\n private async loadDiscoveredCommands () {\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/', '/.h3ravel/serve/')\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 initialize () {\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'],\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 lock: ['--lock', 'Locked and loaded, do not ask any interactive question'],\n }\n\n /** Init Commander */\n program\n .name('musket')\n .version(`${cliVersion}\\n${localVersion}`)\n .description(altLogo)\n .addOption(new Option(additional.quiet[0], additional.quiet[1]).implies({ silent: true }))\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.lock[0], additional.lock[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 /** Create the init Command */\n program\n .command('init')\n .description('Initialize H3ravel.')\n .action(async () => {\n Logger.success('Initialized: H3ravel has been initialized!')\n })\n\n /** Loop through all the available commands */\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 .addOption(new Option(additional.quiet[0], additional.quiet[1]).implies({ silent: true }))\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.lock[0], additional.lock[1]))\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 .addOption(new Option(additional.quiet[0], additional.quiet[1]).implies({ silent: true }))\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.lock[0], additional.lock[1]))\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 if (cmd.name() !== 'fire') {\n await build({\n ...TsDownConfig,\n watch: false,\n plugins: []\n })\n }\n })\n\n return program\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 const flags = opt.flags\n ?.map(f => (f.length === 1 ? `-${f}` : `--${f}`)).join(', ')!\n .replaceAll('----', '--')\n .replaceAll('---', '-')\n\n cmd.option(flags || '', description!, String(opt.defaultValue) || undefined)\n } else {\n cmd.option(\n opt.flags?.join(', ') + (opt.required ? ` <${type}>` : ''),\n description!,\n opt.defaultValue as any\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 { Helpers } from '@h3ravel/filesystem'\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 = Helpers.findModulePkg('@h3ravel/core', this.cwd) ?? ''\n this.consolePath = Helpers.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 console = 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":[6],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAa,UAAb,cAA6BA,8BAAe;;;;ACF5C,MAAa,OAAO,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;AAwB9B,MAAa,UAAU,OAAO,GAAG;;;;;;;;;;;AClBjC,IAAa,cAAb,cAAiC,QAAQ;;;;;;CAOrC,AAAU,YAAoB;;;;;;CAO9B,AAAU,cAAsB;CAEhC,MAAa,SAAU;EACnB,MAAM,UAAU,CACZ;GACI,OAAO;GACP,MAAM;GACN,aAAa;GAChB,CACJ,CACI,OAAO,KAAK,QAAQ,QAAQ,CAC5B,KAAI,MAAK;AAIN,UAHaC,wBAAO,SAASA,wBAAO,IAChC,OAAO,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,QAAO,QAAK,CAAC,CAACC,IAAE,CAAC,KAAK,KAAK,EAAE,SAAS,MAClE,EAAE,EAAE,aAAa,IAAI,MAAM,CAChB,KAAK,GAAG;IACtB;EAQN,MAAM,UALW,KAAK,QAAQ,SAAS,KAAI,MAAK;AAE5C,UADaD,wBAAO,SAASA,wBAAO,IAAI,OAAO,EAAE,MAAM,EAAE,SAAS,MAAM,EAAE,EAAE,aAAa,EAAE,IAAI,MAAM,CACzF,KAAK,GAAG;IACtB,CAE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;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,aAAa,QAAQ,cAAc,iBAAiB,KAAK,IAAI,IAAI;AACtE,OAAK,cAAc,QAAQ,cAAc,oBAAoB,KAAK,IAAI,IAAI;AAE1E,MAAI;AACA,QAAK,gBAAgB,MAAM,OAAOA,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,cAA4CC,+BAAgB;CACxD,OAAc,WAAW;;;;CAKzB,OAAc,UAAU;CAExB,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","Logger","e","path","nodepath","FileSystem","Logger","TableGuesser","stub: string","FileSystem","options: CommandOption[]","nestedOptions: CommandOption[] | undefined","flags: string[] | undefined","defaultValue: string | number | boolean | undefined | string[]","dir","entryFileName","TsDownConfig: Options","app: Application","kernel: Kernel","commands: Command[]","path","Logger","Option","program","i","cmd","TsDownConfig","ConsoleKernel","app: Application","path","FileSystem","ServiceProvider"],"sources":["../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/node_modules/@rollup/plugin-run/dist/es/index.js","../src/TsdownConfig.ts","../src/Musket.ts","../src/Kernel.ts","../src/Providers/ConsoleServiceProvider.ts"],"sourcesContent":["import { ConsoleCommand } from '@h3ravel/core'\n\nexport class Command extends ConsoleCommand { }\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 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 const list = Object.entries(grouped).map(([group, cmds]) => {\n const label = group === '__root__' ? '' : group\n return [Logger.log(label, 'yellow', false), cmds.join('\\n')].join('\\n')\n })\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","import { FileSystem, Logger } from '@h3ravel/shared'\nimport { mkdir, readFile, writeFile } from 'node:fs/promises'\n\nimport { Command } from './Command'\nimport { TableGuesser } from '../Utils'\nimport { beforeLast } from '@h3ravel/support'\nimport dayjs from 'dayjs'\nimport { existsSync } from 'node:fs'\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 {migration : Generates a new database migration class. \n | {--l|type=ts : The file type to generate} \n | {--t|table : The table to migrate} \n | {--c|create : The table to be created} \n }\n {factory : Create a new model factory.}\n {seeder : Create a new seeder class.}\n {view : Create a new view.\n | {--force : Create the view even if it already exists}\n }\n {model : Create a new Eloquent model class. \n | {--api : Indicates if the generated controller should be an API resource controller} \n | {--c|controller : Create a new controller for the model} \n | {--f|factory : Create a new factory for the model} \n | {--m|migration : Create a new migration file for the model} \n | {--r|resource : Indicates if the generated controller should be a resource controller} \n | {--a|all : Generate a migration, seeder, factory, policy, resource controller, and form request classes for the model} \n | {--s|seed : Create a new seeder for the model} \n | {--t|type=ts : The file type to generate}\n | {--force : Create the model 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 () {\n const command = (this.dictionary.baseCommand ?? this.dictionary.name) as never\n\n const methods = {\n controller: 'makeController',\n resource: 'makeResource',\n migration: 'makeMigration',\n factory: 'makeFactory',\n seeder: 'makeSeeder',\n model: 'makeModel',\n view: 'makeView',\n } as const\n\n try {\n await (this as any)?.[methods[command]]()\n } catch (e) {\n Logger.error(e as any)\n }\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 path = nodepath.join(app_path('Http/Controllers'), name + '.ts')\n const crtlrPath = FileSystem.findModulePkg('@h3ravel/http', this.kernel.cwd) ?? ''\n const stubPath = nodepath.join(crtlrPath, `dist/stubs/controller${type}.stub`)\n\n /** Check if the controller already exists */\n if (!force && existsSync(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 * Generate a new database migration class\n */\n protected async makeMigration () {\n const name = this.argument('name')\n const datePrefix = dayjs().format('YYYY_MM_DD_HHmmss')\n const path = nodepath.join(database_path('migrations'), `${datePrefix}_${name}.ts`)\n\n const crtlrPath = FileSystem.findModulePkg('@h3ravel/database', this.kernel.cwd) ?? ''\n\n let create = this.option('create', false)\n let table = this.option('table')\n if (!table && typeof create === 'string') {\n table = create\n create = true\n }\n\n if (!table) {\n const guessed = TableGuesser.guess(name)\n table = guessed[0]\n create = !!guessed[1]\n }\n\n const stubPath = nodepath.join(crtlrPath, this.getMigrationStubName(table, create))\n let stub = await readFile(stubPath, 'utf-8')\n\n if (table !== null) {\n stub = stub.replace(/DummyTable|{{\\s*table\\s*}}/g, table)\n }\n\n Logger.info('INFO: Creating Migration')\n\n await this.kernel.ensureDirectoryExists(nodepath.dirname(path))\n await writeFile(path, stub)\n\n Logger.split('INFO: Migration Created', Logger.log(nodepath.basename(path), 'gray', false))\n }\n\n /**\n * Create a new model factory\n */\n protected makeFactory () {\n Logger.success('Factory support is not yet available')\n }\n\n /**\n * Create a new seeder class\n */\n protected makeSeeder () {\n Logger.success('Seeder support is not yet available')\n }\n\n /**\n * Generate a new Arquebus model class\n */\n protected async makeModel () {\n const type = this.option('type', 'ts')\n const name = this.argument('name')\n const force = this.argument('force')\n\n const path = nodepath.join(app_path('Models'), name.toLowerCase(), '.' + type)\n\n /** Check if the model already exists */\n if (!force && existsSync(path)) {\n Logger.error(`ERORR: ${name} view already exists`)\n }\n\n const crtlrPath = FileSystem.findModulePkg('@h3ravel/database', this.kernel.cwd) ?? ''\n const stubPath = nodepath.join(crtlrPath, `dist/stubs/model-${type}.stub`)\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: Model Created', Logger.log(nodepath.basename(path), 'gray', false))\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 = nodepath.join(base_path('src/resources/views'), name + '.edge')\n\n if (name.includes('/')) {\n await mkdir(beforeLast(path, '/'), { recursive: true })\n }\n\n /** Check if the view already exists */\n if (!force && existsSync(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 /**\n * Ge the database migration file name\n * \n * @param table \n * @param create \n * @param type \n * @returns \n */\n getMigrationStubName (table?: string, create: boolean = false, type: 'ts' | 'js' = 'ts') {\n let stub: string\n if (!table) {\n stub = `migration-${type}.stub`\n }\n else if (create) {\n stub = `migration.create-${type}.stub`\n }\n else {\n stub = `migration.update-${type}.stub`\n }\n return 'dist/stubs/' + stub\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 private async createSqliteDB () {\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\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\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 }\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 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 { dirname, join, resolve } from 'path';\n\nimport { fork } from 'child_process';\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 run from '@rollup/plugin-run'\n\nconst env = process.env.NODE_ENV || 'development'\nconst outDir = env === 'development' ? '.h3ravel/serve' : 'dist'\n\nexport const TsDownConfig: Options = {\n outDir,\n entry: ['src/**/*.ts'],\n format: ['esm'],//, 'cjs'],\n target: 'node22',\n sourcemap: env === 'development',\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 SRC_PATH: 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 plugins: env === 'development' && process.env.CLI_BUILD !== 'true' ? [\n run({\n env: Object.assign({}, process.env, {\n NODE_ENV: env,\n SRC_PATH: 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","import { 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'\n\n/**\n * Musket is H3ravel's CLI tool\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 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 ]\n\n commands.forEach(e => this.addCommand(e))\n }\n\n private async loadDiscoveredCommands () {\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/', '/.h3ravel/serve/')\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 initialize () {\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'],\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 lock: ['--lock', 'Locked and loaded, do not ask any interactive question'],\n }\n\n /** Init Commander */\n program\n .name('musket')\n .version(`${cliVersion}\\n${localVersion}`)\n .description(altLogo)\n .addOption(new Option(additional.quiet[0], additional.quiet[1]).implies({ silent: true }))\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.lock[0], additional.lock[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 /** Create the init Command */\n program\n .command('init')\n .description('Initialize H3ravel.')\n .action(async () => {\n Logger.success('Initialized: H3ravel has been initialized!')\n })\n\n /** Loop through all the available commands */\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 .addOption(new Option(additional.quiet[0], additional.quiet[1]).implies({ silent: true }))\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.lock[0], additional.lock[1]))\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 .addOption(new Option(additional.quiet[0], additional.quiet[1]).implies({ silent: true }))\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.lock[0], additional.lock[1]))\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 if (cmd.name() !== 'fire') {\n await build({\n ...TsDownConfig,\n watch: false,\n plugins: []\n })\n }\n })\n\n return program\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 const flags = opt.flags\n ?.map(f => (f.length === 1 ? `-${f}` : `--${f}`)).join(', ')!\n .replaceAll('----', '--')\n .replaceAll('---', '-')\n\n cmd.option(flags || '', description!, String(opt.defaultValue) || undefined)\n } else {\n cmd.option(\n opt.flags?.join(', ') + (opt.required ? ` <${type}>` : ''),\n description!,\n opt.defaultValue as any\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 console = 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":[6],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAa,UAAb,cAA6BA,8BAAe;;;;ACF5C,MAAa,OAAO,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;AAwB9B,MAAa,UAAU,OAAO,GAAG;;;;;;;;;;;AClBjC,IAAa,cAAb,cAAiC,QAAQ;;;;;;CAOrC,AAAU,YAAoB;;;;;;CAO9B,AAAU,cAAsB;CAEhC,MAAa,SAAU;EACnB,MAAM,UAAU,CACZ;GACI,OAAO;GACP,MAAM;GACN,aAAa;GAChB,CACJ,CACI,OAAO,KAAK,QAAQ,QAAQ,CAC5B,KAAI,MAAK;AAIN,UAHaC,wBAAO,SAASA,wBAAO,IAChC,OAAO,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,QAAO,QAAK,CAAC,CAACC,IAAE,CAAC,KAAK,KAA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;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,UAAU;CAExB,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
@@ -1,4 +1,4 @@
1
- import { TableGuesser, Utils } from "./Utils-rIdzILgO.cjs";
1
+ import { TableGuesser, Utils } from "./Utils-CxAcuqeI.cjs";
2
2
  import { Application, ConsoleCommand, ConsoleKernel, ServiceProvider } from "@h3ravel/core";
3
3
  import { Command as Command$1 } from "commander";
4
4
  import { Options } from "tsdown";
@@ -74,6 +74,24 @@ declare class MakeCommand extends Command {
74
74
  getMigrationStubName(table?: string, create?: boolean, type?: 'ts' | 'js'): string;
75
75
  }
76
76
  //#endregion
77
+ //#region src/Commands/PostinstallCommand.d.ts
78
+ declare class PostinstallCommand extends Command {
79
+ /**
80
+ * The name and signature of the console command.
81
+ *
82
+ * @var string
83
+ */
84
+ protected signature: string;
85
+ /**
86
+ * The console command description.
87
+ *
88
+ * @var string
89
+ */
90
+ protected description: string;
91
+ handle(): Promise<void>;
92
+ private createSqliteDB;
93
+ }
94
+ //#endregion
77
95
  //#region src/Contracts/ICommand.d.ts
78
96
  type CommandOption = {
79
97
  name: string;
@@ -194,5 +212,5 @@ declare class Signature {
194
212
  //#region src/TsdownConfig.d.ts
195
213
  declare const TsDownConfig: Options;
196
214
  //#endregion
197
- export { Command, CommandOption, ConsoleServiceProvider, Kernel, ListCommand, MakeCommand, Musket, ParsedCommand, Signature, TableGuesser, TsDownConfig, Utils, altLogo, logo };
215
+ export { Command, CommandOption, ConsoleServiceProvider, Kernel, ListCommand, MakeCommand, Musket, ParsedCommand, PostinstallCommand, Signature, TableGuesser, TsDownConfig, Utils, altLogo, logo };
198
216
  //# sourceMappingURL=index.d.cts.map
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { TableGuesser, Utils } from "./Utils-cBgwEyTl.js";
1
+ import { TableGuesser, Utils } from "./Utils-CbqNJtIj.js";
2
2
  import { Application, ConsoleCommand, ConsoleKernel, ServiceProvider } from "@h3ravel/core";
3
3
  import { Command as Command$1 } from "commander";
4
4
  import { Options } from "tsdown";
@@ -74,6 +74,24 @@ declare class MakeCommand extends Command {
74
74
  getMigrationStubName(table?: string, create?: boolean, type?: 'ts' | 'js'): string;
75
75
  }
76
76
  //#endregion
77
+ //#region src/Commands/PostinstallCommand.d.ts
78
+ declare class PostinstallCommand extends Command {
79
+ /**
80
+ * The name and signature of the console command.
81
+ *
82
+ * @var string
83
+ */
84
+ protected signature: string;
85
+ /**
86
+ * The console command description.
87
+ *
88
+ * @var string
89
+ */
90
+ protected description: string;
91
+ handle(): Promise<void>;
92
+ private createSqliteDB;
93
+ }
94
+ //#endregion
77
95
  //#region src/Contracts/ICommand.d.ts
78
96
  type CommandOption = {
79
97
  name: string;
@@ -194,5 +212,5 @@ declare class Signature {
194
212
  //#region src/TsdownConfig.d.ts
195
213
  declare const TsDownConfig: Options;
196
214
  //#endregion
197
- export { Command, CommandOption, ConsoleServiceProvider, Kernel, ListCommand, MakeCommand, Musket, ParsedCommand, Signature, TableGuesser, TsDownConfig, Utils, altLogo, logo };
215
+ export { Command, CommandOption, ConsoleServiceProvider, Kernel, ListCommand, MakeCommand, Musket, ParsedCommand, PostinstallCommand, Signature, TableGuesser, TsDownConfig, Utils, altLogo, logo };
198
216
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -1,8 +1,6 @@
1
- import { TableGuesser, Utils, sync_default } from "./Utils-Dvclc4Pc.js";
2
- import { access } from "fs/promises";
3
- import path, { dirname, join, resolve } from "path";
1
+ import { TableGuesser, Utils } from "./Utils-Dn22CO9s.js";
4
2
  import { Application, ConsoleCommand, ConsoleKernel, ServiceProvider } from "@h3ravel/core";
5
- import { Logger } from "@h3ravel/shared";
3
+ import { FileSystem, Logger } from "@h3ravel/shared";
6
4
  import { glob, mkdir, readFile, writeFile } from "node:fs/promises";
7
5
  import { beforeLast } from "@h3ravel/support";
8
6
  import dayjs from "dayjs";
@@ -16,6 +14,7 @@ import "@h3ravel/queue";
16
14
  import "@h3ravel/mail";
17
15
  import "@h3ravel/config";
18
16
  import { Option, program } from "commander";
17
+ import { dirname, join, resolve } from "path";
19
18
  import { fork } from "child_process";
20
19
  import { build } from "tsdown";
21
20
 
@@ -112,44 +111,6 @@ var ListCommand = class extends Command {
112
111
  }
113
112
  };
114
113
 
115
- //#endregion
116
- //#region ../filesystem/dist/index.js
117
- var Helpers = class {
118
- static findModulePkg(moduleId, cwd) {
119
- const parts = moduleId.replace(/\\/g, "/").split("/");
120
- let packageName = "";
121
- if (parts.length > 0 && parts[0][0] === "@") packageName += parts.shift() + "/";
122
- packageName += parts.shift();
123
- const packageJson = path.join(cwd ?? process.cwd(), "node_modules", packageName);
124
- const resolved = this.findUpConfig(packageJson, "package", ["json"]);
125
- if (!resolved) return;
126
- return path.join(path.dirname(resolved), parts.join("/"));
127
- }
128
- /**
129
- * Check if file exists
130
- *
131
- * @param path
132
- * @returns
133
- */
134
- static async fileExists(path$1) {
135
- try {
136
- await access(path$1);
137
- return true;
138
- } catch {
139
- return false;
140
- }
141
- }
142
- static findUpConfig(cwd, name, extensions) {
143
- return sync_default(cwd, (_dir, names) => {
144
- for (const ext of extensions) {
145
- const filename = `${name}.${ext}`;
146
- if (names.includes(filename)) return filename;
147
- }
148
- return false;
149
- });
150
- }
151
- };
152
-
153
114
  //#endregion
154
115
  //#region src/Commands/MakeCommand.ts
155
116
  var MakeCommand = class extends Command {
@@ -222,15 +183,15 @@ var MakeCommand = class extends Command {
222
183
  const type = this.option("api") ? "-resource" : "";
223
184
  const name = this.argument("name");
224
185
  const force = this.option("force");
225
- const path$1 = nodepath.join(app_path("Http/Controllers"), name + ".ts");
226
- const crtlrPath = Helpers.findModulePkg("@h3ravel/http", this.kernel.cwd) ?? "";
186
+ const path = nodepath.join(app_path("Http/Controllers"), name + ".ts");
187
+ const crtlrPath = FileSystem.findModulePkg("@h3ravel/http", this.kernel.cwd) ?? "";
227
188
  const stubPath = nodepath.join(crtlrPath, `dist/stubs/controller${type}.stub`);
228
189
  /** Check if the controller already exists */
229
- if (!force && existsSync(path$1)) Logger.error(`ERORR: ${name} controller already exists`);
190
+ if (!force && existsSync(path)) Logger.error(`ERORR: ${name} controller already exists`);
230
191
  let stub = await readFile(stubPath, "utf-8");
231
192
  stub = stub.replace(/{{ name }}/g, name);
232
- await writeFile(path$1, stub);
233
- Logger.split("INFO: Controller Created", Logger.log(nodepath.basename(path$1), "gray", false));
193
+ await writeFile(path, stub);
194
+ Logger.split("INFO: Controller Created", Logger.log(nodepath.basename(path), "gray", false));
234
195
  }
235
196
  makeResource() {
236
197
  Logger.success("Resource support is not yet available");
@@ -241,8 +202,8 @@ var MakeCommand = class extends Command {
241
202
  async makeMigration() {
242
203
  const name = this.argument("name");
243
204
  const datePrefix = dayjs().format("YYYY_MM_DD_HHmmss");
244
- const path$1 = nodepath.join(database_path("migrations"), `${datePrefix}_${name}.ts`);
245
- const crtlrPath = Utils.findModulePkg("@h3ravel/database", this.kernel.cwd) ?? "";
205
+ const path = nodepath.join(database_path("migrations"), `${datePrefix}_${name}.ts`);
206
+ const crtlrPath = FileSystem.findModulePkg("@h3ravel/database", this.kernel.cwd) ?? "";
246
207
  let create = this.option("create", false);
247
208
  let table = this.option("table");
248
209
  if (!table && typeof create === "string") {
@@ -258,9 +219,9 @@ var MakeCommand = class extends Command {
258
219
  let stub = await readFile(stubPath, "utf-8");
259
220
  if (table !== null) stub = stub.replace(/DummyTable|{{\s*table\s*}}/g, table);
260
221
  Logger.info("INFO: Creating Migration");
261
- await this.kernel.ensureDirectoryExists(nodepath.dirname(path$1));
262
- await writeFile(path$1, stub);
263
- Logger.split("INFO: Migration Created", Logger.log(nodepath.basename(path$1), "gray", false));
222
+ await this.kernel.ensureDirectoryExists(nodepath.dirname(path));
223
+ await writeFile(path, stub);
224
+ Logger.split("INFO: Migration Created", Logger.log(nodepath.basename(path), "gray", false));
264
225
  }
265
226
  /**
266
227
  * Create a new model factory
@@ -281,15 +242,15 @@ var MakeCommand = class extends Command {
281
242
  const type = this.option("type", "ts");
282
243
  const name = this.argument("name");
283
244
  const force = this.argument("force");
284
- const path$1 = nodepath.join(app_path("Models"), name.toLowerCase(), "." + type);
245
+ const path = nodepath.join(app_path("Models"), name.toLowerCase(), "." + type);
285
246
  /** Check if the model already exists */
286
- if (!force && existsSync(path$1)) Logger.error(`ERORR: ${name} view already exists`);
287
- const crtlrPath = Utils.findModulePkg("@h3ravel/database", this.kernel.cwd) ?? "";
247
+ if (!force && existsSync(path)) Logger.error(`ERORR: ${name} view already exists`);
248
+ const crtlrPath = FileSystem.findModulePkg("@h3ravel/database", this.kernel.cwd) ?? "";
288
249
  const stubPath = nodepath.join(crtlrPath, `dist/stubs/model-${type}.stub`);
289
250
  let stub = await readFile(stubPath, "utf-8");
290
251
  stub = stub.replace(/{{ name }}/g, name);
291
- await writeFile(path$1, stub);
292
- Logger.split("INFO: Model Created", Logger.log(nodepath.basename(path$1), "gray", false));
252
+ await writeFile(path, stub);
253
+ Logger.split("INFO: Model Created", Logger.log(nodepath.basename(path), "gray", false));
293
254
  }
294
255
  /**
295
256
  * Create a new view.
@@ -297,11 +258,11 @@ var MakeCommand = class extends Command {
297
258
  async makeView() {
298
259
  const name = this.argument("name");
299
260
  const force = this.option("force");
300
- const path$1 = nodepath.join(base_path("src/resources/views"), name + ".edge");
301
- if (name.includes("/")) await mkdir(beforeLast(path$1, "/"), { recursive: true });
261
+ const path = nodepath.join(base_path("src/resources/views"), name + ".edge");
262
+ if (name.includes("/")) await mkdir(beforeLast(path, "/"), { recursive: true });
302
263
  /** Check if the view already exists */
303
- if (!force && existsSync(path$1)) Logger.error(`ERORR: ${name} view already exists`);
304
- await writeFile(path$1, `{{-- src/resources/views/${name}.edge --}}`);
264
+ if (!force && existsSync(path)) Logger.error(`ERORR: ${name} view already exists`);
265
+ await writeFile(path, `{{-- src/resources/views/${name}.edge --}}`);
305
266
  Logger.split("INFO: View Created", Logger.log(`src/resources/views/${name}.edge`, "gray", false));
306
267
  }
307
268
  /**
@@ -321,6 +282,30 @@ var MakeCommand = class extends Command {
321
282
  }
322
283
  };
323
284
 
285
+ //#endregion
286
+ //#region src/Commands/PostinstallCommand.ts
287
+ var PostinstallCommand = class extends Command {
288
+ /**
289
+ * The name and signature of the console command.
290
+ *
291
+ * @var string
292
+ */
293
+ signature = "postinstall";
294
+ /**
295
+ * The console command description.
296
+ *
297
+ * @var string
298
+ */
299
+ description = "Default post installation command";
300
+ async handle() {
301
+ this.createSqliteDB();
302
+ }
303
+ async createSqliteDB() {
304
+ if (!await FileSystem.fileExists(database_path())) await mkdir(database_path(), { recursive: true });
305
+ if (!await FileSystem.fileExists(database_path("db.sqlite"))) await writeFile(database_path("db.sqlite"), "");
306
+ }
307
+ };
308
+
324
309
  //#endregion
325
310
  //#region src/Signature.ts
326
311
  var Signature = class Signature {
@@ -597,7 +582,11 @@ var Musket = class Musket {
597
582
  return this.initialize();
598
583
  }
599
584
  loadBaseCommands() {
600
- [new MakeCommand(this.app, this.kernel), new ListCommand(this.app, this.kernel)].forEach((e) => this.addCommand(e));
585
+ [
586
+ new MakeCommand(this.app, this.kernel),
587
+ new ListCommand(this.app, this.kernel),
588
+ new PostinstallCommand(this.app, this.kernel)
589
+ ].forEach((e) => this.addCommand(e));
601
590
  }
602
591
  async loadDiscoveredCommands() {
603
592
  const commands = [...this.app.registeredCommands.map((cmd) => new cmd(this.app, this.kernel))];
@@ -751,8 +740,8 @@ var Kernel = class Kernel extends ConsoleKernel {
751
740
  }
752
741
  async loadRequirements() {
753
742
  this.cwd = nodepath.join(process.cwd(), this.basePath);
754
- this.modulePath = Helpers.findModulePkg("@h3ravel/core", this.cwd) ?? "";
755
- this.consolePath = Helpers.findModulePkg("@h3ravel/console", this.cwd) ?? "";
743
+ this.modulePath = FileSystem.findModulePkg("@h3ravel/core", this.cwd) ?? "";
744
+ this.consolePath = FileSystem.findModulePkg("@h3ravel/console", this.cwd) ?? "";
756
745
  try {
757
746
  this.modulePackage = await import(nodepath.join(this.modulePath, "package.json"));
758
747
  } catch {
@@ -797,5 +786,5 @@ var ConsoleServiceProvider = class extends ServiceProvider {
797
786
  };
798
787
 
799
788
  //#endregion
800
- export { Command, ConsoleServiceProvider, Kernel, ListCommand, MakeCommand, Musket, Signature, TableGuesser, TsDownConfig, Utils, altLogo, logo };
789
+ export { Command, ConsoleServiceProvider, Kernel, ListCommand, MakeCommand, Musket, PostinstallCommand, Signature, TableGuesser, TsDownConfig, Utils, altLogo, logo };
801
790
  //# sourceMappingURL=index.js.map