@h3ravel/console 11.3.9 → 11.4.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.
- package/bin/fire.cjs +14 -7
- package/bin/fire.js +14 -7
- package/dist/index.cjs +99 -22
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +24 -1
- package/dist/index.d.ts +24 -1
- package/dist/index.js +95 -21
- package/dist/index.js.map +1 -1
- package/package.json +4 -11
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["ConsoleCommand","Logger","e","FileSystem","nodepath","path","Logger","TableGuesser","stub: string","FileSystem","options: CommandOption[]","nestedOptions: CommandOption[] | undefined","flags: string[] | undefined","defaultValue: string | number | boolean | undefined | string[]","dir","entryFileName","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/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 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 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 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 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(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 * 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 = 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.option('force')\n\n const path = app_path(`Models/${name.toLowerCase()}.${type}`)\n\n /** The model is scoped to a path make sure to create the associated directories */\n if (name.includes('/')) {\n await mkdir(beforeLast(path, '/'), { recursive: true })\n }\n\n /** Check if the model already exists */\n if (!force && await FileSystem.fileExists(path)) {\n Logger.error(`ERORR: ${name} model 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: ${name} 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 = 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(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 /**\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 /**\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\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 { 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'\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 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","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,KAAK,EAAE,SAAS,MAClE,EAAE,EAAE,aAAa,IAAI,MAAM,CA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B;AACvB,WAAQ,KAAK,EAAE;IACjB;AACF,UAAQ,GAAG,iBAAiB;AACxB,WAAQ,KAAK,EAAE;IACjB"}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["ConsoleCommand","outDir","TaskManager","Logger","ConsoleCommand","Logger","e","FileSystem","nodepath","path","Logger","TableGuesser","stub: string","FileSystem","options: CommandOption[]","nestedOptions: CommandOption[] | 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/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=false : Minify your bundle output}\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 = env('DIST_DIR', 'dist')\n\n const pm = (await preferredPM(base_path()))?.name ?? 'pnpm'\n const minify = this.option('minify')\n const debug = Number(this.option('verbose', 0)) > 0\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[Number(this.option('verbose', 0))]\n }\n\n const silent = ENV_VARS.LOG_LEVEL === 'silent' ? '--silent' : null\n\n Logger.log([['\\n INFO ', 'bgBlue'], [' Creating Production Bundle', 'white']], '')\n console.log('')\n\n await TaskManager.taskRunner(Logger.log([[' SUCCESS ', 'bgGreen'], [' Production Bundle Created', 'white']], '', false), 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 console.log('')\n })\n }\n}\n","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 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 {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 {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 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 migration: 'makeMigration',\n factory: 'makeFactory',\n seeder: 'makeSeeder',\n model: 'makeModel',\n view: 'makeView',\n command: 'makeCommand',\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 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(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 * 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 = 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 Musket command\n */\n protected makeCommand () {\n Logger.success('Musket command creation 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.option('force')\n\n const path = app_path(`Models/${name.toLowerCase()}.${type}`)\n\n /** The model is scoped to a path make sure to create the associated directories */\n if (name.includes('/')) {\n await mkdir(beforeLast(path, '/'), { recursive: true })\n }\n\n /** Check if the model already exists */\n if (!force && await FileSystem.fileExists(path)) {\n Logger.error(`ERORR: ${name} model 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: ${name} 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 = 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(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 /**\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 /**\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\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 { 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 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","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'\nimport { BuildCommand } from './Commands/BuildCommand'\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 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 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 public 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":[7],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,IAAa,eAAb,cAAkCA,8BAAe;;;;;;CAO7C,AAAU,YAAoB;;;;;;;;CAS9B,AAAU,cAAsB;CAEhC,MAAa,SAAU;AACnB,MAAI;AACA,SAAM,KAAK,MAAM;WACZ,GAAG;AACR,2BAAO,MAAM,EAAS;;;CAI9B,MAAgB,OAAQ;EACpB,MAAMC,WAAS,IAAI,YAAY,OAAO;EAEtC,MAAM,MAAM,gCAAkB,WAAW,CAAC,GAAG,QAAQ;EACrD,MAAM,SAAS,KAAK,OAAO,SAAS;EASpC,MAAM,WAAW;GACb,gBATU,OAAO,KAAK,OAAO,WAAW,EAAE,CAAC,GAAG,IAStB,SAAS;GACjC,WAAW;GACX,UAAU;GACV,UAAUA;GACV,aAAa;GACb,WAbe;IACf;IACA;IACA;IACA;IACH,CAQyB,OAAO,KAAK,OAAO,WAAW,EAAE,CAAC;GAC1D;EAED,MAAM,SAAS,SAAS,cAAc,WAAW,aAAa;AAE9D,0BAAO,IAAI,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jB,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
|
@@ -4,6 +4,24 @@ import { Application, ConsoleCommand, ConsoleKernel, ServiceProvider } from "@h3
|
|
|
4
4
|
import { Command as Command$1 } from "commander";
|
|
5
5
|
import { Options } from "tsdown";
|
|
6
6
|
|
|
7
|
+
//#region src/Commands/BuildCommand.d.ts
|
|
8
|
+
declare class BuildCommand extends ConsoleCommand {
|
|
9
|
+
/**
|
|
10
|
+
* The name and signature of the console command.
|
|
11
|
+
*
|
|
12
|
+
* @var string
|
|
13
|
+
*/
|
|
14
|
+
protected signature: string;
|
|
15
|
+
/**
|
|
16
|
+
* The console command description.
|
|
17
|
+
*
|
|
18
|
+
* @var string
|
|
19
|
+
*/
|
|
20
|
+
protected description: string;
|
|
21
|
+
handle(): Promise<void>;
|
|
22
|
+
protected fire(): Promise<void>;
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
7
25
|
//#region src/Commands/Command.d.ts
|
|
8
26
|
declare class Command extends ConsoleCommand {}
|
|
9
27
|
//#endregion
|
|
@@ -52,6 +70,10 @@ declare class MakeCommand extends Command {
|
|
|
52
70
|
* Create a new model factory
|
|
53
71
|
*/
|
|
54
72
|
protected makeFactory(): void;
|
|
73
|
+
/**
|
|
74
|
+
* Create a new Musket command
|
|
75
|
+
*/
|
|
76
|
+
protected makeCommand(): void;
|
|
55
77
|
/**
|
|
56
78
|
* Create a new seeder class
|
|
57
79
|
*/
|
|
@@ -192,6 +214,7 @@ declare class ConsoleServiceProvider extends ServiceProvider {
|
|
|
192
214
|
* Indicate that this service provider only runs in console
|
|
193
215
|
*/
|
|
194
216
|
static console: boolean;
|
|
217
|
+
console: boolean;
|
|
195
218
|
register(): void;
|
|
196
219
|
boot(): void;
|
|
197
220
|
}
|
|
@@ -218,5 +241,5 @@ declare class Signature {
|
|
|
218
241
|
//#region src/TsdownConfig.d.ts
|
|
219
242
|
declare const TsDownConfig: Options;
|
|
220
243
|
//#endregion
|
|
221
|
-
export { Command, CommandOption, ConsoleServiceProvider, Kernel, ListCommand, MakeCommand, Musket, ParsedCommand, PostinstallCommand, Signature, TableGuesser, TsDownConfig, Utils, altLogo, logo };
|
|
244
|
+
export { BuildCommand, Command, CommandOption, ConsoleServiceProvider, Kernel, ListCommand, MakeCommand, Musket, ParsedCommand, PostinstallCommand, Signature, TableGuesser, TsDownConfig, Utils, altLogo, logo };
|
|
222
245
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,24 @@ import { Application, ConsoleCommand, ConsoleKernel, ServiceProvider } from "@h3
|
|
|
4
4
|
import { Command as Command$1 } from "commander";
|
|
5
5
|
import { Options } from "tsdown";
|
|
6
6
|
|
|
7
|
+
//#region src/Commands/BuildCommand.d.ts
|
|
8
|
+
declare class BuildCommand extends ConsoleCommand {
|
|
9
|
+
/**
|
|
10
|
+
* The name and signature of the console command.
|
|
11
|
+
*
|
|
12
|
+
* @var string
|
|
13
|
+
*/
|
|
14
|
+
protected signature: string;
|
|
15
|
+
/**
|
|
16
|
+
* The console command description.
|
|
17
|
+
*
|
|
18
|
+
* @var string
|
|
19
|
+
*/
|
|
20
|
+
protected description: string;
|
|
21
|
+
handle(): Promise<void>;
|
|
22
|
+
protected fire(): Promise<void>;
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
7
25
|
//#region src/Commands/Command.d.ts
|
|
8
26
|
declare class Command extends ConsoleCommand {}
|
|
9
27
|
//#endregion
|
|
@@ -52,6 +70,10 @@ declare class MakeCommand extends Command {
|
|
|
52
70
|
* Create a new model factory
|
|
53
71
|
*/
|
|
54
72
|
protected makeFactory(): void;
|
|
73
|
+
/**
|
|
74
|
+
* Create a new Musket command
|
|
75
|
+
*/
|
|
76
|
+
protected makeCommand(): void;
|
|
55
77
|
/**
|
|
56
78
|
* Create a new seeder class
|
|
57
79
|
*/
|
|
@@ -192,6 +214,7 @@ declare class ConsoleServiceProvider extends ServiceProvider {
|
|
|
192
214
|
* Indicate that this service provider only runs in console
|
|
193
215
|
*/
|
|
194
216
|
static console: boolean;
|
|
217
|
+
console: boolean;
|
|
195
218
|
register(): void;
|
|
196
219
|
boot(): void;
|
|
197
220
|
}
|
|
@@ -218,5 +241,5 @@ declare class Signature {
|
|
|
218
241
|
//#region src/TsdownConfig.d.ts
|
|
219
242
|
declare const TsDownConfig: Options;
|
|
220
243
|
//#endregion
|
|
221
|
-
export { Command, CommandOption, ConsoleServiceProvider, Kernel, ListCommand, MakeCommand, Musket, ParsedCommand, PostinstallCommand, Signature, TableGuesser, TsDownConfig, Utils, altLogo, logo };
|
|
244
|
+
export { BuildCommand, Command, CommandOption, ConsoleServiceProvider, Kernel, ListCommand, MakeCommand, Musket, ParsedCommand, PostinstallCommand, Signature, TableGuesser, TsDownConfig, Utils, altLogo, logo };
|
|
222
245
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,23 +1,81 @@
|
|
|
1
1
|
import { TableGuesser, Utils } from "./Utils-Dn22CO9s.js";
|
|
2
|
+
import { FileSystem, Logger, TaskManager } from "@h3ravel/shared";
|
|
2
3
|
import { Application, ConsoleCommand, ConsoleKernel, ServiceProvider } from "@h3ravel/core";
|
|
3
|
-
import {
|
|
4
|
+
import { execa } from "execa";
|
|
5
|
+
import preferredPM from "preferred-pm";
|
|
4
6
|
import { glob, mkdir, readFile, rm, writeFile } from "node:fs/promises";
|
|
5
7
|
import { beforeLast } from "@h3ravel/support";
|
|
6
8
|
import dayjs from "dayjs";
|
|
7
9
|
import nodepath from "node:path";
|
|
8
|
-
import "@h3ravel/http";
|
|
9
|
-
import "@h3ravel/router";
|
|
10
|
-
import "@h3ravel/database";
|
|
11
|
-
import "@h3ravel/cache";
|
|
12
|
-
import "@h3ravel/queue";
|
|
13
|
-
import "@h3ravel/mail";
|
|
14
|
-
import "@h3ravel/config";
|
|
15
10
|
import { Option, program } from "commander";
|
|
16
11
|
import { existsSync } from "node:fs";
|
|
17
|
-
import { dirname, join, resolve } from "path";
|
|
18
12
|
import { fork } from "child_process";
|
|
13
|
+
import { dirname, join, resolve } from "path";
|
|
19
14
|
import { build } from "tsdown";
|
|
20
15
|
|
|
16
|
+
//#region src/Commands/BuildCommand.ts
|
|
17
|
+
var BuildCommand = class extends ConsoleCommand {
|
|
18
|
+
/**
|
|
19
|
+
* The name and signature of the console command.
|
|
20
|
+
*
|
|
21
|
+
* @var string
|
|
22
|
+
*/
|
|
23
|
+
signature = `build:
|
|
24
|
+
{--m|minify=false : Minify your bundle output}
|
|
25
|
+
`;
|
|
26
|
+
/**
|
|
27
|
+
* The console command description.
|
|
28
|
+
*
|
|
29
|
+
* @var string
|
|
30
|
+
*/
|
|
31
|
+
description = "Build the app for production";
|
|
32
|
+
async handle() {
|
|
33
|
+
try {
|
|
34
|
+
await this.fire();
|
|
35
|
+
} catch (e) {
|
|
36
|
+
Logger.error(e);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
async fire() {
|
|
40
|
+
const outDir$1 = env("DIST_DIR", "dist");
|
|
41
|
+
const pm = (await preferredPM(base_path()))?.name ?? "pnpm";
|
|
42
|
+
const minify = this.option("minify");
|
|
43
|
+
const ENV_VARS = {
|
|
44
|
+
EXTENDED_DEBUG: Number(this.option("verbose", 0)) > 0 ? "true" : "false",
|
|
45
|
+
CLI_BUILD: "true",
|
|
46
|
+
NODE_ENV: "production",
|
|
47
|
+
DIST_DIR: outDir$1,
|
|
48
|
+
DIST_MINIFY: minify,
|
|
49
|
+
LOG_LEVEL: [
|
|
50
|
+
"silent",
|
|
51
|
+
"info",
|
|
52
|
+
"warn",
|
|
53
|
+
"error"
|
|
54
|
+
][Number(this.option("verbose", 0))]
|
|
55
|
+
};
|
|
56
|
+
const silent = ENV_VARS.LOG_LEVEL === "silent" ? "--silent" : null;
|
|
57
|
+
Logger.log([["\n INFO ", "bgBlue"], [" Creating Production Bundle", "white"]], "");
|
|
58
|
+
console.log("");
|
|
59
|
+
await TaskManager.taskRunner(Logger.log([[" SUCCESS ", "bgGreen"], [" Production Bundle Created", "white"]], "", false), async () => {
|
|
60
|
+
await execa(pm, [
|
|
61
|
+
"tsdown",
|
|
62
|
+
silent,
|
|
63
|
+
"--config-loader",
|
|
64
|
+
"unconfig",
|
|
65
|
+
"-c",
|
|
66
|
+
"tsdown.default.config.ts"
|
|
67
|
+
].filter((e) => e !== null), {
|
|
68
|
+
stdout: "inherit",
|
|
69
|
+
stderr: "inherit",
|
|
70
|
+
cwd: base_path(),
|
|
71
|
+
env: Object.assign({}, process.env, ENV_VARS)
|
|
72
|
+
});
|
|
73
|
+
console.log("");
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
//#endregion
|
|
21
79
|
//#region src/Commands/Command.ts
|
|
22
80
|
var Command = class extends ConsoleCommand {};
|
|
23
81
|
|
|
@@ -135,6 +193,10 @@ var MakeCommand = class extends Command {
|
|
|
135
193
|
| {--t|table : The table to migrate}
|
|
136
194
|
| {--c|create : The table to be created}
|
|
137
195
|
}
|
|
196
|
+
{command : Create a new Musket command.
|
|
197
|
+
| {--command : The terminal command that will be used to invoke the class}
|
|
198
|
+
| {--force : Create the class even if the console command already exists}
|
|
199
|
+
}
|
|
138
200
|
{factory : Create a new model factory.}
|
|
139
201
|
{seeder : Create a new seeder class.}
|
|
140
202
|
{view : Create a new view.
|
|
@@ -169,7 +231,8 @@ var MakeCommand = class extends Command {
|
|
|
169
231
|
factory: "makeFactory",
|
|
170
232
|
seeder: "makeSeeder",
|
|
171
233
|
model: "makeModel",
|
|
172
|
-
view: "makeView"
|
|
234
|
+
view: "makeView",
|
|
235
|
+
command: "makeCommand"
|
|
173
236
|
};
|
|
174
237
|
try {
|
|
175
238
|
await this?.[methods[command]]();
|
|
@@ -233,6 +296,12 @@ var MakeCommand = class extends Command {
|
|
|
233
296
|
Logger.success("Factory support is not yet available");
|
|
234
297
|
}
|
|
235
298
|
/**
|
|
299
|
+
* Create a new Musket command
|
|
300
|
+
*/
|
|
301
|
+
makeCommand() {
|
|
302
|
+
Logger.success("Musket command creation is not yet available");
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
236
305
|
* Create a new seeder class
|
|
237
306
|
*/
|
|
238
307
|
makeSeeder() {
|
|
@@ -533,14 +602,16 @@ function run(opts = {}) {
|
|
|
533
602
|
|
|
534
603
|
//#endregion
|
|
535
604
|
//#region src/TsdownConfig.ts
|
|
536
|
-
const env = process.env.NODE_ENV || "development";
|
|
537
|
-
|
|
605
|
+
const env$1 = process.env.NODE_ENV || "development";
|
|
606
|
+
let outDir = env$1 === "development" ? ".h3ravel/serve" : "dist";
|
|
607
|
+
if (process.env.DIST_DIR) outDir = process.env.DIST_DIR;
|
|
538
608
|
const TsDownConfig = {
|
|
539
609
|
outDir,
|
|
540
610
|
entry: ["src/**/*.ts"],
|
|
541
611
|
format: ["esm"],
|
|
542
612
|
target: "node22",
|
|
543
|
-
sourcemap: env === "development",
|
|
613
|
+
sourcemap: env$1 === "development",
|
|
614
|
+
minify: !!process.env.DIST_MINIFY,
|
|
544
615
|
clean: true,
|
|
545
616
|
shims: true,
|
|
546
617
|
copy: [
|
|
@@ -551,11 +622,11 @@ const TsDownConfig = {
|
|
|
551
622
|
"src/resources",
|
|
552
623
|
"src/database"
|
|
553
624
|
],
|
|
554
|
-
env: env === "development" ? {
|
|
555
|
-
NODE_ENV: env,
|
|
625
|
+
env: env$1 === "development" ? {
|
|
626
|
+
NODE_ENV: env$1,
|
|
556
627
|
DIST_DIR: outDir
|
|
557
628
|
} : {},
|
|
558
|
-
watch: env === "development" && process.env.CLI_BUILD !== "true" ? [
|
|
629
|
+
watch: env$1 === "development" && process.env.CLI_BUILD !== "true" ? [
|
|
559
630
|
".env",
|
|
560
631
|
".env.*",
|
|
561
632
|
"src",
|
|
@@ -578,9 +649,9 @@ const TsDownConfig = {
|
|
|
578
649
|
}
|
|
579
650
|
});
|
|
580
651
|
},
|
|
581
|
-
plugins: env === "development" && process.env.CLI_BUILD !== "true" ? [run({
|
|
652
|
+
plugins: env$1 === "development" && process.env.CLI_BUILD !== "true" ? [run({
|
|
582
653
|
env: Object.assign({}, process.env, {
|
|
583
|
-
NODE_ENV: env,
|
|
654
|
+
NODE_ENV: env$1,
|
|
584
655
|
DIST_DIR: outDir
|
|
585
656
|
}),
|
|
586
657
|
execArgv: ["-r", "source-map-support/register"],
|
|
@@ -610,15 +681,17 @@ var Musket = class Musket {
|
|
|
610
681
|
[
|
|
611
682
|
new MakeCommand(this.app, this.kernel),
|
|
612
683
|
new ListCommand(this.app, this.kernel),
|
|
613
|
-
new PostinstallCommand(this.app, this.kernel)
|
|
684
|
+
new PostinstallCommand(this.app, this.kernel),
|
|
685
|
+
new BuildCommand(this.app, this.kernel)
|
|
614
686
|
].forEach((e) => this.addCommand(e));
|
|
615
687
|
}
|
|
616
688
|
async loadDiscoveredCommands() {
|
|
689
|
+
const DIST_DIR = `/${env("DIST_DIR", ".h3ravel/serve")}/`.replaceAll("//", "");
|
|
617
690
|
const commands = [...this.app.registeredCommands.map((cmd) => new cmd(this.app, this.kernel))];
|
|
618
691
|
/**
|
|
619
692
|
* Musket Commands auto registration
|
|
620
693
|
*/
|
|
621
|
-
const providers_path = app_path("Console/Commands/*.js").replace("/src/",
|
|
694
|
+
const providers_path = app_path("Console/Commands/*.js").replace("/src/", DIST_DIR);
|
|
622
695
|
/** Add the App Commands */
|
|
623
696
|
for await (const cmd of glob(providers_path)) {
|
|
624
697
|
const name = nodepath.basename(cmd).replace(".js", "");
|
|
@@ -798,6 +871,7 @@ var ConsoleServiceProvider = class extends ServiceProvider {
|
|
|
798
871
|
* Indicate that this service provider only runs in console
|
|
799
872
|
*/
|
|
800
873
|
static console = true;
|
|
874
|
+
console = true;
|
|
801
875
|
register() {}
|
|
802
876
|
boot() {
|
|
803
877
|
Kernel.init(this.app);
|
|
@@ -811,5 +885,5 @@ var ConsoleServiceProvider = class extends ServiceProvider {
|
|
|
811
885
|
};
|
|
812
886
|
|
|
813
887
|
//#endregion
|
|
814
|
-
export { Command, ConsoleServiceProvider, Kernel, ListCommand, MakeCommand, Musket, PostinstallCommand, Signature, TableGuesser, TsDownConfig, Utils, altLogo, logo };
|
|
888
|
+
export { BuildCommand, Command, ConsoleServiceProvider, Kernel, ListCommand, MakeCommand, Musket, PostinstallCommand, Signature, TableGuesser, TsDownConfig, Utils, altLogo, logo };
|
|
815
889
|
//# sourceMappingURL=index.js.map
|