@h3ravel/console 11.6.1 → 11.7.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/dist/index.js CHANGED
@@ -1,11 +1,9 @@
1
- import { TableGuesser, Utils } from "./Utils-Dn22CO9s.js";
2
1
  import { FileSystem, Logger, TaskManager } from "@h3ravel/shared";
3
2
  import { Application, ConsoleCommand, ConsoleKernel, ServiceProvider } from "@h3ravel/core";
4
3
  import { execa } from "execa";
5
4
  import preferredPM from "preferred-pm";
6
5
  import { glob, mkdir, readFile, rm, writeFile } from "node:fs/promises";
7
- import { beforeLast } from "@h3ravel/support";
8
- import dayjs from "dayjs";
6
+ import { Str } from "@h3ravel/support";
9
7
  import nodepath from "node:path";
10
8
  import { Option, program } from "commander";
11
9
  import { existsSync } from "node:fs";
@@ -188,31 +186,13 @@ var MakeCommand = class extends Command {
188
186
  | {--c|collection : Create a resource collection}
189
187
  | {--force : Create the resource even if it already exists}
190
188
  }
191
- {migration : Generates a new database migration class.
192
- | {--l|type=ts : The file type to generate}
193
- | {--t|table : The table to migrate}
194
- | {--c|create : The table to be created}
195
- }
196
189
  {command : Create a new Musket command.
197
190
  | {--command : The terminal command that will be used to invoke the class}
198
191
  | {--force : Create the class even if the console command already exists}
199
192
  }
200
- {factory : Create a new model factory.}
201
- {seeder : Create a new seeder class.}
202
193
  {view : Create a new view.
203
194
  | {--force : Create the view even if it already exists}
204
195
  }
205
- {model : Create a new Eloquent model class.
206
- | {--api : Indicates if the generated controller should be an API resource controller}
207
- | {--c|controller : Create a new controller for the model}
208
- | {--f|factory : Create a new factory for the model}
209
- | {--m|migration : Create a new migration file for the model}
210
- | {--r|resource : Indicates if the generated controller should be a resource controller}
211
- | {--a|all : Generate a migration, seeder, factory, policy, resource controller, and form request classes for the model}
212
- | {--s|seed : Create a new seeder for the model}
213
- | {--t|type=ts : The file type to generate}
214
- | {--force : Create the model even if it already exists}
215
- }
216
196
  {^name : The name of the [name] to generate}
217
197
  `;
218
198
  /**
@@ -227,10 +207,6 @@ var MakeCommand = class extends Command {
227
207
  await this[{
228
208
  controller: "makeController",
229
209
  resource: "makeResource",
230
- migration: "makeMigration",
231
- factory: "makeFactory",
232
- seeder: "makeSeeder",
233
- model: "makeModel",
234
210
  view: "makeView",
235
211
  command: "makeCommand"
236
212
  }[command]]();
@@ -246,7 +222,7 @@ var MakeCommand = class extends Command {
246
222
  const stubPath = nodepath.join(crtlrPath, `dist/stubs/controller${type}.stub`);
247
223
  const path = app_path(`Http/Controllers/${name}.ts`);
248
224
  /** The Controller is scoped to a path make sure to create the associated directories */
249
- if (name.includes("/")) await mkdir(beforeLast(path, "/"), { recursive: true });
225
+ if (name.includes("/")) await mkdir(Str.beforeLast(path, "/"), { recursive: true });
250
226
  /** Check if the controller already exists */
251
227
  if (!force && await FileSystem.fileExists(path)) Logger.error(`ERORR: ${name} controller already exists`);
252
228
  let stub = await readFile(stubPath, "utf-8");
@@ -258,70 +234,12 @@ var MakeCommand = class extends Command {
258
234
  Logger.success("Resource support is not yet available");
259
235
  }
260
236
  /**
261
- * Generate a new database migration class
262
- */
263
- async makeMigration() {
264
- const name = this.argument("name");
265
- const datePrefix = dayjs().format("YYYY_MM_DD_HHmmss");
266
- const path = database_path(`migrations/${datePrefix}_${name}.ts`);
267
- const crtlrPath = FileSystem.findModulePkg("@h3ravel/database", this.kernel.cwd) ?? "";
268
- let create = this.option("create", false);
269
- let table = this.option("table");
270
- if (!table && typeof create === "string") {
271
- table = create;
272
- create = true;
273
- }
274
- if (!table) {
275
- const guessed = TableGuesser.guess(name);
276
- table = guessed[0];
277
- create = !!guessed[1];
278
- }
279
- const stubPath = nodepath.join(crtlrPath, this.getMigrationStubName(table, create));
280
- let stub = await readFile(stubPath, "utf-8");
281
- if (table !== null) stub = stub.replace(/DummyTable|{{\s*table\s*}}/g, table);
282
- Logger.info("INFO: Creating Migration");
283
- await this.kernel.ensureDirectoryExists(nodepath.dirname(path));
284
- await writeFile(path, stub);
285
- Logger.split("INFO: Migration Created", Logger.log(nodepath.basename(path), "gray", false));
286
- }
287
- /**
288
- * Create a new model factory
289
- */
290
- makeFactory() {
291
- Logger.success("Factory support is not yet available");
292
- }
293
- /**
294
237
  * Create a new Musket command
295
238
  */
296
239
  makeCommand() {
297
240
  Logger.success("Musket command creation is not yet available");
298
241
  }
299
242
  /**
300
- * Create a new seeder class
301
- */
302
- makeSeeder() {
303
- Logger.success("Seeder support is not yet available");
304
- }
305
- /**
306
- * Generate a new Arquebus model class
307
- */
308
- async makeModel() {
309
- const type = this.option("type", "ts");
310
- const name = this.argument("name");
311
- const force = this.option("force");
312
- const path = app_path(`Models/${name.toLowerCase()}.${type}`);
313
- /** The model is scoped to a path make sure to create the associated directories */
314
- if (name.includes("/")) await mkdir(beforeLast(path, "/"), { recursive: true });
315
- /** Check if the model already exists */
316
- if (!force && await FileSystem.fileExists(path)) Logger.error(`ERORR: ${name} model already exists`);
317
- const crtlrPath = FileSystem.findModulePkg("@h3ravel/database", this.kernel.cwd) ?? "";
318
- const stubPath = nodepath.join(crtlrPath, `dist/stubs/model-${type}.stub`);
319
- let stub = await readFile(stubPath, "utf-8");
320
- stub = stub.replace(/{{ name }}/g, name);
321
- await writeFile(path, stub);
322
- Logger.split(`INFO: ${name} Model Created`, Logger.log(nodepath.basename(path), "gray", false));
323
- }
324
- /**
325
243
  * Create a new view.
326
244
  */
327
245
  async makeView() {
@@ -329,27 +247,12 @@ var MakeCommand = class extends Command {
329
247
  const force = this.option("force");
330
248
  const path = base_path(`src/resources/views/${name}.edge`);
331
249
  /** The view is scoped to a path make sure to create the associated directories */
332
- if (name.includes("/")) await mkdir(beforeLast(path, "/"), { recursive: true });
250
+ if (name.includes("/")) await mkdir(Str.beforeLast(path, "/"), { recursive: true });
333
251
  /** Check if the view already exists */
334
252
  if (!force && await FileSystem.fileExists(path)) Logger.error(`ERORR: ${name} view already exists`);
335
253
  await writeFile(path, `{{-- src/resources/views/${name}.edge --}}`);
336
254
  Logger.split("INFO: View Created", Logger.log(`src/resources/views/${name}.edge`, "gray", false));
337
255
  }
338
- /**
339
- * Ge the database migration file name
340
- *
341
- * @param table
342
- * @param create
343
- * @param type
344
- * @returns
345
- */
346
- getMigrationStubName(table, create = false, type = "ts") {
347
- let stub;
348
- if (!table) stub = `migration-${type}.stub`;
349
- else if (create) stub = `migration.create-${type}.stub`;
350
- else stub = `migration.update-${type}.stub`;
351
- return "dist/stubs/" + stub;
352
- }
353
256
  };
354
257
 
355
258
  //#endregion
@@ -443,6 +346,7 @@ var Signature = class Signature {
443
346
  let name = namePart;
444
347
  let required = /[^a-zA-Z0-9_|-]/.test(name);
445
348
  let multiple = false;
349
+ let placeholder;
446
350
  if (name.endsWith("?*")) {
447
351
  required = false;
448
352
  multiple = true;
@@ -453,6 +357,7 @@ var Signature = class Signature {
453
357
  } else if (name.endsWith("?")) {
454
358
  required = false;
455
359
  name = name.slice(0, -1);
360
+ placeholder = `[${name.split("--").at(1)?.split("|").at(1) ?? name}]`;
456
361
  }
457
362
  /**
458
363
  * Check if it's a flag option (starts with --)
@@ -490,6 +395,7 @@ var Signature = class Signature {
490
395
  shared,
491
396
  isFlag,
492
397
  isHidden,
398
+ placeholder,
493
399
  defaultValue,
494
400
  nestedOptions
495
401
  });
@@ -547,7 +453,7 @@ var Signature = class Signature {
547
453
  };
548
454
 
549
455
  //#endregion
550
- //#region ../../node_modules/.pnpm/@rollup+plugin-run@3.1.0/node_modules/@rollup/plugin-run/dist/es/index.js
456
+ //#region ../../node_modules/.pnpm/@rollup+plugin-run@3.1.0_rollup@4.52.3/node_modules/@rollup/plugin-run/dist/es/index.js
551
457
  function run(opts = {}) {
552
458
  let input;
553
459
  let proc;
@@ -807,9 +713,16 @@ var Musket = class Musket {
807
713
  const description = opt.description?.replace(/\[(\w+)\]/g, (_, k) => parent?.[k] ?? `[${k}]`) ?? "";
808
714
  const type = opt.name.replaceAll("-", "");
809
715
  if (opt.isFlag) if (parse) {
810
- const flags = opt.flags?.map((f) => f.length === 1 ? `-${f}` : `--${f}`).join(", ").replaceAll("----", "--").replaceAll("---", "-");
811
- cmd.option(flags || "", description, String(opt.defaultValue) || void 0);
812
- } else cmd.option(opt.flags?.join(", ") + (opt.required ? ` <${type}>` : ""), description, opt.defaultValue);
716
+ let flags = opt.flags?.map((f) => f.length === 1 ? `-${f}` : `--${f.replace(/^-+/, "")}`).join(", ") ?? void 0;
717
+ if (opt.required && !opt.placeholder) flags += ` <${type}>`;
718
+ else if (opt.placeholder) flags += " " + opt.placeholder;
719
+ cmd.option(flags || "", description, opt.defaultValue);
720
+ } else {
721
+ let flags = opt.flags?.join(", ") ?? "";
722
+ if (opt.required && !opt.placeholder) flags += ` <${type}>`;
723
+ else if (opt.placeholder) flags += " " + opt.placeholder;
724
+ cmd.option(flags, description, opt.defaultValue);
725
+ }
813
726
  else cmd.argument(opt.required ? `<${opt.name}>` : `[${opt.name}]`, description, opt.defaultValue);
814
727
  }
815
728
  static async parse(kernel) {
@@ -866,8 +779,8 @@ var ConsoleServiceProvider = class extends ServiceProvider {
866
779
  /**
867
780
  * Indicate that this service provider only runs in console
868
781
  */
869
- static console = true;
870
- console = true;
782
+ static runsInConsole = true;
783
+ runsInConsole = true;
871
784
  register() {}
872
785
  boot() {
873
786
  Kernel.init(this.app);
@@ -881,5 +794,5 @@ var ConsoleServiceProvider = class extends ServiceProvider {
881
794
  };
882
795
 
883
796
  //#endregion
884
- export { BuildCommand, Command, ConsoleServiceProvider, Kernel, ListCommand, MakeCommand, Musket, PostinstallCommand, Signature, TableGuesser, TsDownConfig, Utils, altLogo, logo };
797
+ export { BuildCommand, Command, ConsoleServiceProvider, Kernel, ListCommand, MakeCommand, Musket, PostinstallCommand, Signature, TsDownConfig, altLogo, logo };
885
798
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["outDir","e","stub: string","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","i","cmd","TsDownConfig","app: Application","path"],"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 (this: any) {\n const command = (this.dictionary.baseCommand ?? this.dictionary.name) as never\n\n if (!this.argument('name')) {\n this.program.error('Please provide a valid name for the ' + command)\n }\n\n const methods = {\n controller: 'makeController',\n resource: 'makeResource',\n migration: 'makeMigration',\n factory: 'makeFactory',\n seeder: 'makeSeeder',\n model: 'makeModel',\n view: 'makeView',\n command: 'makeCommand',\n } as const\n\n await this[methods[command]]()\n }\n\n /**\n * Create a new controller class.\n */\n protected async makeController () {\n const type = this.option('api') ? '-resource' : ''\n const name = this.argument('name')\n const force = this.option('force')\n\n const crtlrPath = FileSystem.findModulePkg('@h3ravel/http', this.kernel.cwd) ?? ''\n const stubPath = nodepath.join(crtlrPath, `dist/stubs/controller${type}.stub`)\n const path = app_path(`Http/Controllers/${name}.ts`)\n\n /** The Controller is scoped to a path make sure to create the associated directories */\n if (name.includes('/')) {\n await mkdir(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 external: [\n /^@h3ravel\\/.*/gi,\n ],\n clean: true,\n shims: true,\n copy: [{ from: 'public', to: outDir }, 'src/resources', 'src/database'],\n env: env === 'development' ? {\n NODE_ENV: env,\n DIST_DIR: outDir,\n } : {},\n watch:\n env === 'development' && process.env.CLI_BUILD !== 'true'\n ? ['.env', '.env.*', 'src', '../../packages']\n : false,\n dts: false,\n logLevel: 'silent',\n nodeProtocol: true,\n skipNodeModulesBundle: true,\n hooks (e) {\n e.hook('build:done', async () => {\n const paths = ['database/migrations', 'database/factories', 'database/seeders']\n for (let i = 0; i < paths.length; i++) {\n const name = paths[i]\n if (existsSync(path.join(outDir, name)))\n await rm(path.join(outDir, name), { recursive: true })\n }\n })\n },\n plugins: env === 'development' && process.env.CLI_BUILD !== 'true' ? [\n run({\n env: Object.assign({}, process.env, {\n NODE_ENV: env,\n DIST_DIR: outDir,\n }),\n execArgv: ['-r', 'source-map-support/register'],\n allowRestarts: false,\n input: process.cwd() + '/src/server.ts'//\n })\n ] : [],\n}\n\nexport default TsDownConfig\n","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,cAAkC,eAAe;;;;;;CAO7C,AAAU,YAAoB;;;;;;;;CAS9B,AAAU,cAAsB;CAEhC,MAAa,SAAU;AACnB,MAAI;AACA,SAAM,KAAK,MAAM;WACZ,GAAG;AACR,UAAO,MAAM,EAAS;;;CAI9B,MAAgB,OAAQ;EACpB,MAAMA,WAAS,IAAI,YAAY,OAAO;EAEtC,MAAM,MAAM,MAAM,YAAY,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,SAAO,IAAI,CAAC,CAAC,YAAY,SAAS,EAAE,CAAC,+BAA+B,QAAQ,CAAC,EAAE,GAAG;AAClF,UAAQ,IAAI,GAAG;AAEf,QAAM,YAAY,WAAW,OAAO,IAAI,CAAC,CAAC,aAAa,UAAU,EAAE,CAAC,8BAA8B,QAAQ,CAAC,EAAE,IAAI,MAAM,EAAE,YAAY;AACjI,SAAM,MACF,IACA;IAAC;IAAU;IAAQ;IAAmB;IAAY;IAAM;IAA2B,CAAC,QAAO,MAAK,MAAM,KAAK,EAC3G;IAAE,QAAQ;IAAW,QAAQ;IAAW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,MAAM,WAAW,IAAI,OAAO,IAAI;AAEhC,UAAQ,IAAI,CAAC,SAAS,kBAAkB,CAAC,CAAC,CACrC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC;;CAI/B,MAAc,MAAO;AACjB,QAAM,OAAO,MAAM,KAAK;AACxB,UAAQ,KAAK,EAAE;;CAGnB,MAAc,mBAAoB;AAC9B,OAAK,MAAMC,SAAK,KAAK,QAAQ,KAAK,EAAE,KAAK,SAAS;AAClD,OAAK,aAAa,WAAW,cAAc,iBAAiB,KAAK,IAAI,IAAI;AACzE,OAAK,cAAc,WAAW,cAAc,oBAAoB,KAAK,IAAI,IAAI;AAE7E,MAAI;AACA,QAAK,gBAAgB,MAAM,OAAOA,SAAK,KAAK,KAAK,YAAY,eAAe;UACxE;AACJ,QAAK,gBAAgB,EAAE,SAAS,OAAO;;AAG3C,MAAI;AACA,QAAK,iBAAiB,MAAM,OAAOA,SAAK,KAAK,KAAK,aAAa,eAAe;UAC1E;AACJ,QAAK,iBAAiB,EAAE,SAAS,OAAO;;AAG5C,SAAO;;;;;;;;;;;;;;;AC5Bf,IAAa,yBAAb,cAA4C,gBAAgB;CACxD,OAAc,WAAW;;;;CAKzB,OAAc,UAAU;CACxB,AAAO,UAAU;CAEjB,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.js","names":["outDir","e","options: CommandOption[]","match: RegExpExecArray | null","nestedOptions: CommandOption[] | undefined","placeholder: string | undefined","flags: string[] | undefined","defaultValue: string | number | boolean | undefined | string[]","dir","entryFileName","env","TsDownConfig: Options","path","app: Application","kernel: Kernel","commands: Command[]","path","i","cmd","TsDownConfig","app: Application","path"],"sources":["../src/Commands/BuildCommand.ts","../src/Commands/Command.ts","../src/logo.ts","../src/Commands/ListCommand.ts","../src/Commands/MakeCommand.ts","../src/Commands/PostinstallCommand.ts","../src/Signature.ts","../../../node_modules/.pnpm/@rollup+plugin-run@3.1.0_rollup@4.52.3/node_modules/@rollup/plugin-run/dist/es/index.js","../src/TsdownConfig.ts","../src/Musket.ts","../src/Kernel.ts","../src/Providers/ConsoleServiceProvider.ts"],"sourcesContent":["import { Logger, TaskManager } from '@h3ravel/shared'\n\nimport { ConsoleCommand } from '@h3ravel/core'\nimport { execa } from 'execa'\nimport preferredPM from 'preferred-pm'\n\nexport class BuildCommand extends ConsoleCommand {\n\n /**\n * The name and signature of the console command.\n *\n * @var string\n */\n protected signature: string = `build:\n {--m|minify=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 { Str } from '@h3ravel/support'\nimport nodepath from 'node:path'\n\nexport class MakeCommand extends Command {\n\n /**\n * The name and signature of the console command.\n *\n * @var string\n */\n protected signature: string = `#make:\n {controller : Create a new controller class. \n | {--a|api : Exclude the create and edit methods from the controller} \n | {--m|model= : Generate a resource controller for the given model} \n | {--r|resource : Generate a resource controller class} \n | {--force : Create the controller even if it already exists}\n }\n {resource : Create a new resource. \n | {--c|collection : Create a resource collection}\n | {--force : Create the resource even if it already exists}\n }\n {command : Create a new Musket command. \n | {--command : The terminal command that will be used to invoke the class} \n | {--force : Create the class even if the console command already exists}\n }\n {view : Create a new view.\n | {--force : Create the view even if it already exists}\n }\n {^name : The name of the [name] to generate}\n `\n /**\n * The console command description.\n *\n * @var string\n */\n protected description: string = 'Generate component classes'\n\n public async handle (this: any) {\n const command = (this.dictionary.baseCommand ?? this.dictionary.name) as never\n\n if (!this.argument('name')) {\n this.program.error('Please provide a valid name for the ' + command)\n }\n\n const methods = {\n controller: 'makeController',\n resource: 'makeResource',\n view: 'makeView',\n command: 'makeCommand',\n } as const\n\n await this[methods[command]]()\n }\n\n /**\n * Create a new controller class.\n */\n protected async makeController () {\n const type = this.option('api') ? '-resource' : ''\n const name = this.argument('name')\n const force = this.option('force')\n\n const crtlrPath = FileSystem.findModulePkg('@h3ravel/http', this.kernel.cwd) ?? ''\n const stubPath = nodepath.join(crtlrPath, `dist/stubs/controller${type}.stub`)\n const path = app_path(`Http/Controllers/${name}.ts`)\n\n /** The Controller is scoped to a path make sure to create the associated directories */\n if (name.includes('/')) {\n await mkdir(Str.beforeLast(path, '/'), { recursive: true })\n }\n\n /** Check if the controller already exists */\n if (!force && await FileSystem.fileExists(path)) {\n Logger.error(`ERORR: ${name} controller already exists`)\n }\n\n let stub = await readFile(stubPath, 'utf-8')\n stub = stub.replace(/{{ name }}/g, name)\n\n await writeFile(path, stub)\n Logger.split('INFO: Controller Created', Logger.log(nodepath.basename(path), 'gray', false))\n }\n\n protected makeResource () {\n Logger.success('Resource support is not yet available')\n }\n\n /**\n * Create a new Musket command\n */\n protected makeCommand () {\n Logger.success('Musket command creation is not yet available')\n }\n\n /**\n * Create a new view.\n */\n protected async makeView () {\n const name = this.argument('name')\n const force = this.option('force')\n\n const path = base_path(`src/resources/views/${name}.edge`)\n\n /** The view is scoped to a path make sure to create the associated directories */\n if (name.includes('/')) {\n await mkdir(Str.beforeLast(path, '/'), { recursive: true })\n }\n\n /** Check if the view already exists */\n if (!force && await FileSystem.fileExists(path)) {\n Logger.error(`ERORR: ${name} view already exists`)\n }\n\n await writeFile(path, `{{-- src/resources/views/${name}.edge --}}`)\n Logger.split('INFO: View Created', Logger.log(`src/resources/views/${name}.edge`, 'gray', false))\n }\n}\n","import { mkdir, writeFile } from 'node:fs/promises'\n\nimport { Command } from './Command'\nimport { FileSystem } from '@h3ravel/shared'\n\nexport class PostinstallCommand extends Command {\n\n /**\n * The name and signature of the console command.\n *\n * @var string\n */\n protected signature: string = 'postinstall'\n\n /**\n * The console command description.\n *\n * @var string\n */\n protected description: string = 'Default post installation command'\n\n public async handle () {\n this.createSqliteDB()\n }\n\n /**\n * Create sqlite database if none exist\n * \n * @returns \n */\n private async createSqliteDB () {\n if (config('database.default') !== 'sqlite') return\n\n if (!await FileSystem.fileExists(database_path())) {\n await mkdir(database_path(), { recursive: true })\n }\n\n if (!await FileSystem.fileExists(database_path('db.sqlite'))) {\n await writeFile(database_path('db.sqlite'), '')\n }\n }\n}\n","import { CommandOption, ParsedCommand } from './Contracts/ICommand'\n\nimport { Command } from './Commands/Command'\n\nexport class Signature {\n /**\n * Helper to parse options inside a block of text\n * \n * @param block \n * @returns \n */\n static parseOptions (block: string): CommandOption[] {\n const options: CommandOption[] = []\n /**\n * Match { ... } blocks at top level \n */\n const regex = /\\{([^{}]+(?:\\{[^{}]*\\}[^{}]*)*)\\}/g\n let match: RegExpExecArray | null\n\n while ((match = regex.exec(block)) !== null) {\n const shared = '^' === match[1][0]! || /:[#^]/.test(match[1])\n const isHidden = (['#', '^'].includes(match[1][0]!) || /:[#^]/.test(match[1])) && !shared\n const content = match[1].trim().replace(/[#^]/, '')\n /**\n * Split by first ':' to separate name and description+nested\n */\n const colonIndex = content.indexOf(':')\n if (colonIndex === -1) {\n /**\n * No description, treat whole as name\n */\n options.push({ name: content })\n continue\n }\n\n const namePart = content.substring(0, colonIndex).trim()\n const rest = content.substring(colonIndex + 1).trim()\n\n /**\n * Check for nested options after '|'\n */\n let description = rest\n let nestedOptions: CommandOption[] | undefined\n\n const pipeIndex = rest.indexOf('|')\n if (pipeIndex !== -1) {\n description = rest.substring(0, pipeIndex).trim()\n const nestedText = rest.substring(pipeIndex + 1).trim()\n /**\n * nestedText should start with '{' and end with ')', clean it\n * Also Remove trailing ')' if present\n */\n const cleanedNestedText = nestedText.replace(/^\\{/, '').trim()\n\n /**\n * Parse nested options recursively\n */\n nestedOptions = Signature.parseOptions('{' + cleanedNestedText + '}')\n } else {\n /**\n * Trim the string\n */\n description = description.trim()\n }\n\n /**\n * Parse name modifiers (?, *, ?*)\n */\n let name = namePart\n let required = /[^a-zA-Z0-9_|-]/.test(name)\n let multiple = false\n let placeholder: string | undefined\n\n if (name.endsWith('?*')) {\n required = false\n multiple = true\n name = name.slice(0, -2)\n } else if (name.endsWith('*')) {\n multiple = true\n name = name.slice(0, -1)\n } else if (name.endsWith('?')) {\n required = false\n name = name.slice(0, -1)\n const cname = name.split('--').at(1)?.split('|').at(1) ?? name\n placeholder = `[${cname}]`\n }\n\n /**\n * Check if it's a flag option (starts with --)\n */\n const isFlag = name.startsWith('--')\n let flags: string[] | undefined\n let defaultValue: string | number | boolean | undefined | string[]\n\n if (isFlag) {\n /**\n * Parse flags and default values\n */\n const flagParts = name.split('|').map(s => s.trim())\n\n flags = []\n\n for (let part of flagParts) {\n if (part.startsWith('--') && part.slice(2).length === 1) {\n part = '-' + part.slice(2)\n } else if (part.startsWith('-') && !part.startsWith('--') && part.slice(1).length > 1) {\n part = '--' + part.slice(1)\n } else if (!part.startsWith('-') && part.slice(1).length > 1) {\n part = '--' + part\n }\n\n const eqIndex = part.indexOf('=')\n if (eqIndex !== -1) {\n flags.push(part.substring(0, eqIndex))\n const val = part.substring(eqIndex + 1)\n if (val === '*') {\n defaultValue = []\n } else if (val === 'true' || val === 'false' || (!val && !required)) {\n defaultValue = val === 'true'\n } else if (!isNaN(Number(val))) {\n defaultValue = Number(val)\n } else {\n defaultValue = val\n }\n } else {\n flags.push(part)\n }\n }\n }\n\n options.push({\n name: isFlag ? flags![flags!.length - 1] : name,\n required,\n multiple,\n description,\n flags,\n shared,\n isFlag,\n isHidden,\n placeholder,\n defaultValue,\n nestedOptions,\n })\n }\n\n return options\n }\n\n /**\n * Helper to parse a command's signature\n * \n * @param signature \n * @param commandClass \n * @returns \n */\n static parseSignature (signature: string, commandClass: Command): ParsedCommand {\n const lines = signature.split('\\n').map(l => l.trim()).filter(l => l.length > 0)\n const isHidden = ['#', '^'].includes(lines[0][0]!) || /:[#^]/.test(lines[0])\n const baseCommand = lines[0].replace(/[^\\w=:-]/g, '')\n const description = commandClass.getDescription()\n const isNamespaceCommand = baseCommand.endsWith(':')\n\n /**\n * Join the rest lines to a single string for parsing\n */\n const rest = lines.slice(1).join(' ')\n\n /**\n * Parse all top-level options/subcommands\n */\n const allOptions = Signature.parseOptions(rest)\n\n if (isNamespaceCommand) {\n /**\n * Separate subcommands (those without flags) and base options (flags)\n * Here we assume subcommands are those without flags (isFlag false)\n * and base options are flags or options after subcommands\n\n * For simplicity, treat all top-level options as subcommands\n * and assume base command options come after subcommands in signature (not shown in example)\n */\n\n return {\n baseCommand: baseCommand.slice(0, -1),\n isNamespaceCommand,\n subCommands: allOptions.filter(e => !e.flags && !e.isHidden),\n description,\n commandClass,\n options: allOptions.filter(e => !!e.flags),\n isHidden,\n }\n } else {\n return {\n baseCommand,\n isNamespaceCommand,\n options: allOptions,\n description,\n commandClass,\n isHidden,\n }\n }\n }\n}\n","import { fork } from 'child_process';\nimport { resolve, dirname, join } from 'path';\n\nfunction run(opts = {}) {\n let input;\n let proc;\n const args = opts.args || [];\n const allowRestarts = opts.allowRestarts || false;\n const overrideInput = opts.input;\n const forkOptions = opts.options || opts;\n delete forkOptions.args;\n delete forkOptions.allowRestarts;\n return {\n name: 'run',\n buildStart(options) {\n let inputs = overrideInput !== null && overrideInput !== void 0 ? overrideInput : options.input;\n if (typeof inputs === 'string') {\n inputs = [inputs];\n }\n if (typeof inputs === 'object') {\n inputs = Object.values(inputs);\n }\n if (inputs.length > 1) {\n throw new Error(`@rollup/plugin-run must have a single entry point; consider setting the \\`input\\` option`);\n }\n input = resolve(inputs[0]);\n },\n generateBundle(_outputOptions, _bundle, isWrite) {\n if (!isWrite) {\n this.error(`@rollup/plugin-run currently only works with bundles that are written to disk`);\n }\n },\n writeBundle(outputOptions, bundle) {\n const forkBundle = (dir, entryFileName) => {\n if (proc)\n proc.kill();\n proc = fork(join(dir, entryFileName), args, forkOptions);\n };\n const dir = outputOptions.dir || dirname(outputOptions.file);\n const entryFileName = Object.keys(bundle).find((fileName) => {\n const chunk = bundle[fileName];\n return chunk.isEntry && chunk.facadeModuleId === input;\n });\n if (entryFileName) {\n forkBundle(dir, entryFileName);\n if (allowRestarts) {\n process.stdin.resume();\n process.stdin.setEncoding('utf8');\n process.stdin.on('data', (data) => {\n const line = data.toString().trim().toLowerCase();\n if (line === 'rs' || line === 'restart' || data.toString().charCodeAt(0) === 11) {\n forkBundle(dir, entryFileName);\n }\n else if (line === 'cls' || line === 'clear' || data.toString().charCodeAt(0) === 12) {\n // eslint-disable-next-line no-console\n console.clear();\n }\n });\n }\n }\n else {\n this.error(`@rollup/plugin-run could not find output chunk`);\n }\n }\n };\n}\n\nexport { run as default };\n//# sourceMappingURL=index.js.map\n","import { Options } from 'tsdown'\nimport { existsSync } from 'node:fs'\nimport path from 'node:path'\nimport { rm } from 'node:fs/promises'\nimport run from '@rollup/plugin-run'\n\nconst env = process.env.NODE_ENV || 'development'\nlet outDir = env === 'development' ? '.h3ravel/serve' : 'dist'\nif (process.env.DIST_DIR) {\n outDir = process.env.DIST_DIR\n}\n\nexport const TsDownConfig: Options = {\n outDir,\n entry: ['src/**/*.ts'],\n format: ['esm'],//, 'cjs'],\n target: 'node22',\n sourcemap: env === 'development',\n minify: !!process.env.DIST_MINIFY,\n external: [\n /^@h3ravel\\/.*/gi,\n ],\n clean: true,\n shims: true,\n copy: [{ from: 'public', to: outDir }, 'src/resources', 'src/database'],\n env: env === 'development' ? {\n NODE_ENV: env,\n DIST_DIR: outDir,\n } : {},\n watch:\n env === 'development' && process.env.CLI_BUILD !== 'true'\n ? ['.env', '.env.*', 'src', '../../packages']\n : false,\n dts: false,\n logLevel: 'silent',\n nodeProtocol: true,\n skipNodeModulesBundle: true,\n hooks (e) {\n e.hook('build:done', async () => {\n const paths = ['database/migrations', 'database/factories', 'database/seeders']\n for (let i = 0; i < paths.length; i++) {\n const name = paths[i]\n if (existsSync(path.join(outDir, name)))\n await rm(path.join(outDir, name), { recursive: true })\n }\n })\n },\n plugins: env === 'development' && process.env.CLI_BUILD !== 'true' ? [\n run({\n env: Object.assign({}, process.env, {\n NODE_ENV: env,\n DIST_DIR: outDir,\n }),\n execArgv: ['-r', 'source-map-support/register'],\n allowRestarts: false,\n input: process.cwd() + '/src/server.ts'//\n })\n ] : [],\n}\n\nexport default TsDownConfig\n","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 let flags = opt.flags\n ?.map(f => (f.length === 1 ? `-${f}` : `--${f.replace(/^-+/, '')}`))\n .join(', ') ?? undefined\n\n if (opt.required && !opt.placeholder) {\n flags += ` <${type}>`\n } else if (opt.placeholder) {\n flags += ' ' + opt.placeholder\n }\n\n cmd.option(flags || '', description!, <never>opt.defaultValue)\n } else {\n let flags = opt.flags?.join(', ') ?? ''\n\n if (opt.required && !opt.placeholder) {\n flags += ` <${type}>`\n } else if (opt.placeholder) {\n flags += ' ' + opt.placeholder\n }\n\n cmd.option(\n flags,\n description!,\n <never>opt.defaultValue\n )\n }\n } else {\n cmd.argument(\n opt.required ? `<${opt.name}>` : `[${opt.name}]`,\n description,\n opt.defaultValue\n )\n }\n }\n\n static async parse (kernel: Kernel) {\n return (await new Musket(kernel.app, kernel).build()).parseAsync()\n }\n\n}\n","import { Application, ConsoleKernel } from '@h3ravel/core'\n\nimport { FileSystem } from '@h3ravel/shared'\nimport { Musket } from './Musket'\nimport path from 'node:path'\n\nexport class Kernel extends ConsoleKernel {\n constructor(public app: Application) {\n super(app)\n }\n\n static init (app: Application) {\n const instance = new Kernel(app)\n\n Promise.all([instance.loadRequirements()])\n .then(([e]) => e.run())\n }\n\n\n private async run () {\n await Musket.parse(this)\n process.exit(0)\n }\n\n private async loadRequirements () {\n this.cwd = path.join(process.cwd(), this.basePath)\n this.modulePath = FileSystem.findModulePkg('@h3ravel/core', this.cwd) ?? ''\n this.consolePath = FileSystem.findModulePkg('@h3ravel/console', this.cwd) ?? ''\n\n try {\n this.modulePackage = await import(path.join(this.modulePath, 'package.json'))\n } catch {\n this.modulePackage = { version: 'N/A' }\n }\n\n try {\n this.consolePackage = await import(path.join(this.consolePath, 'package.json'))\n } catch {\n this.consolePackage = { version: 'N/A' }\n }\n\n return this\n }\n}\n","/// <reference path=\"../../../core/src/app.globals.d.ts\" />\n\nimport { Kernel } from '../Kernel'\nimport { ServiceProvider } from '@h3ravel/core'\n/**\n * Handles CLI commands and tooling.\n * \n * Register DatabaseManager and QueryBuilder.\n * Set up ORM models and relationships.\n * Register migration and seeder commands.\n * \n * Auto-Registered when in CLI mode\n */\nexport class ConsoleServiceProvider extends ServiceProvider {\n public static priority = 992\n\n /**\n * Indicate that this service provider only runs in console\n */\n public static runsInConsole = true\n public runsInConsole = true\n\n register () {\n }\n\n boot () {\n Kernel.init(this.app)\n\n process.on('SIGINT', () => {\n process.exit(0)\n })\n process.on('SIGTERM', () => {\n process.exit(0)\n })\n }\n}\n"],"x_google_ignoreList":[7],"mappings":";;;;;;;;;;;;;;AAMA,IAAa,eAAb,cAAkC,eAAe;;;;;;CAO7C,AAAU,YAAoB;;;;;;;;CAS9B,AAAU,cAAsB;CAEhC,MAAa,SAAU;AACnB,MAAI;AACA,SAAM,KAAK,MAAM;WACZ,GAAG;AACR,UAAO,MAAM,EAAS;;;CAI9B,MAAgB,OAAQ;EACpB,MAAMA,WAAS,IAAI,YAAY,OAAO;EAEtC,MAAM,MAAM,MAAM,YAAY,WAAW,CAAC,GAAG,QAAQ;EACrD,MAAM,SAAS,KAAK,OAAO,SAAS;EASpC,MAAM,WAAW;GACb,gBATU,OAAO,KAAK,OAAO,WAAW,EAAE,CAAC,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,YAAY;;;;;;ACvQ1E,IAAa,SAAb,MAAa,eAAe,cAAc;CACtC,YAAY,AAAOC,KAAkB;AACjC,QAAM,IAAI;EADK;;CAInB,OAAO,KAAM,KAAkB;EAC3B,MAAM,WAAW,IAAI,OAAO,IAAI;AAEhC,UAAQ,IAAI,CAAC,SAAS,kBAAkB,CAAC,CAAC,CACrC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC;;CAI/B,MAAc,MAAO;AACjB,QAAM,OAAO,MAAM,KAAK;AACxB,UAAQ,KAAK,EAAE;;CAGnB,MAAc,mBAAoB;AAC9B,OAAK,MAAMC,SAAK,KAAK,QAAQ,KAAK,EAAE,KAAK,SAAS;AAClD,OAAK,aAAa,WAAW,cAAc,iBAAiB,KAAK,IAAI,IAAI;AACzE,OAAK,cAAc,WAAW,cAAc,oBAAoB,KAAK,IAAI,IAAI;AAE7E,MAAI;AACA,QAAK,gBAAgB,MAAM,OAAOA,SAAK,KAAK,KAAK,YAAY,eAAe;UACxE;AACJ,QAAK,gBAAgB,EAAE,SAAS,OAAO;;AAG3C,MAAI;AACA,QAAK,iBAAiB,MAAM,OAAOA,SAAK,KAAK,KAAK,aAAa,eAAe;UAC1E;AACJ,QAAK,iBAAiB,EAAE,SAAS,OAAO;;AAG5C,SAAO;;;;;;;;;;;;;;;AC5Bf,IAAa,yBAAb,cAA4C,gBAAgB;CACxD,OAAc,WAAW;;;;CAKzB,OAAc,gBAAgB;CAC9B,AAAO,gBAAgB;CAEvB,WAAY;CAGZ,OAAQ;AACJ,SAAO,KAAK,KAAK,IAAI;AAErB,UAAQ,GAAG,gBAAgB;AACvB,WAAQ,KAAK,EAAE;IACjB;AACF,UAAQ,GAAG,iBAAiB;AACxB,WAAQ,KAAK,EAAE;IACjB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@h3ravel/console",
3
- "version": "11.6.1",
3
+ "version": "11.7.0",
4
4
  "description": "CLI utilities for scaffolding, running migrations, tasks and for H3ravel.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -51,9 +51,8 @@
51
51
  "laravel"
52
52
  ],
53
53
  "peerDependencies": {
54
- "@h3ravel/arquebus": "^0.5.0",
55
- "@h3ravel/core": "^1.11.0",
56
- "@h3ravel/support": "^0.10.3"
54
+ "@h3ravel/core": "^1.13.0",
55
+ "@h3ravel/support": "^0.13.0"
57
56
  },
58
57
  "devDependencies": {
59
58
  "typescript": "^5.9.2"
@@ -67,7 +66,7 @@
67
66
  "radashi": "^12.6.2",
68
67
  "resolve-from": "^5.0.0",
69
68
  "tsx": "^4.20.5",
70
- "@h3ravel/shared": "^0.20.9"
69
+ "@h3ravel/shared": "^0.21.0"
71
70
  },
72
71
  "scripts": {
73
72
  "barrelx": "barrelsby --directory src --delete --singleQuotes",
@@ -1,10 +0,0 @@
1
- //#region src/Utils.d.ts
2
- declare class Utils {}
3
- declare class TableGuesser {
4
- static CREATE_PATTERNS: RegExp[];
5
- static CHANGE_PATTERNS: RegExp[];
6
- static guess(migration: string): (string | boolean)[];
7
- }
8
- //#endregion
9
- export { TableGuesser, Utils };
10
- //# sourceMappingURL=Utils-CbqNJtIj.d.ts.map
@@ -1,10 +0,0 @@
1
- //#region src/Utils.d.ts
2
- declare class Utils {}
3
- declare class TableGuesser {
4
- static CREATE_PATTERNS: RegExp[];
5
- static CHANGE_PATTERNS: RegExp[];
6
- static guess(migration: string): (string | boolean)[];
7
- }
8
- //#endregion
9
- export { TableGuesser, Utils };
10
- //# sourceMappingURL=Utils-CxAcuqeI.d.cts.map
@@ -1,33 +0,0 @@
1
-
2
- //#region src/Utils.ts
3
- var Utils = class {};
4
- var TableGuesser = class TableGuesser {
5
- static CREATE_PATTERNS = [/^create_(\w+)_table$/, /^create_(\w+)$/];
6
- static CHANGE_PATTERNS = [/.+_(to|from|in)_(\w+)_table$/, /.+_(to|from|in)_(\w+)$/];
7
- static guess(migration) {
8
- for (const pattern of TableGuesser.CREATE_PATTERNS) {
9
- const matches = migration.match(pattern);
10
- if (matches) return [matches[1], true];
11
- }
12
- for (const pattern of TableGuesser.CHANGE_PATTERNS) {
13
- const matches = migration.match(pattern);
14
- if (matches) return [matches[2], false];
15
- }
16
- return [];
17
- }
18
- };
19
-
20
- //#endregion
21
- Object.defineProperty(exports, 'TableGuesser', {
22
- enumerable: true,
23
- get: function () {
24
- return TableGuesser;
25
- }
26
- });
27
- Object.defineProperty(exports, 'Utils', {
28
- enumerable: true,
29
- get: function () {
30
- return Utils;
31
- }
32
- });
33
- //# sourceMappingURL=Utils-D6ZDNdVG.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Utils-D6ZDNdVG.cjs","names":[],"sources":["../src/Utils.ts"],"sourcesContent":["export class Utils {\n}\n\nclass TableGuesser {\n static CREATE_PATTERNS = [\n /^create_(\\w+)_table$/,\n /^create_(\\w+)$/\n ]\n static CHANGE_PATTERNS = [\n /.+_(to|from|in)_(\\w+)_table$/,\n /.+_(to|from|in)_(\\w+)$/\n ]\n static guess (migration: string) {\n for (const pattern of TableGuesser.CREATE_PATTERNS) {\n const matches = migration.match(pattern)\n if (matches) {\n return [matches[1], true]\n }\n }\n for (const pattern of TableGuesser.CHANGE_PATTERNS) {\n const matches = migration.match(pattern)\n if (matches) {\n return [matches[2], false]\n }\n }\n return []\n }\n}\n\nexport { TableGuesser }\n"],"mappings":";;AAAA,IAAa,QAAb,MAAmB;AAGnB,IAAM,eAAN,MAAM,aAAa;CACjB,OAAO,kBAAkB,CACvB,wBACA,iBACD;CACD,OAAO,kBAAkB,CACvB,gCACA,yBACD;CACD,OAAO,MAAO,WAAmB;AAC/B,OAAK,MAAM,WAAW,aAAa,iBAAiB;GAClD,MAAM,UAAU,UAAU,MAAM,QAAQ;AACxC,OAAI,QACF,QAAO,CAAC,QAAQ,IAAI,KAAK;;AAG7B,OAAK,MAAM,WAAW,aAAa,iBAAiB;GAClD,MAAM,UAAU,UAAU,MAAM,QAAQ;AACxC,OAAI,QACF,QAAO,CAAC,QAAQ,IAAI,MAAM;;AAG9B,SAAO,EAAE"}
@@ -1,21 +0,0 @@
1
- //#region src/Utils.ts
2
- var Utils = class {};
3
- var TableGuesser = class TableGuesser {
4
- static CREATE_PATTERNS = [/^create_(\w+)_table$/, /^create_(\w+)$/];
5
- static CHANGE_PATTERNS = [/.+_(to|from|in)_(\w+)_table$/, /.+_(to|from|in)_(\w+)$/];
6
- static guess(migration) {
7
- for (const pattern of TableGuesser.CREATE_PATTERNS) {
8
- const matches = migration.match(pattern);
9
- if (matches) return [matches[1], true];
10
- }
11
- for (const pattern of TableGuesser.CHANGE_PATTERNS) {
12
- const matches = migration.match(pattern);
13
- if (matches) return [matches[2], false];
14
- }
15
- return [];
16
- }
17
- };
18
-
19
- //#endregion
20
- export { TableGuesser, Utils };
21
- //# sourceMappingURL=Utils-Dn22CO9s.js.map