@h3ravel/console 11.0.7 → 11.2.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.
Files changed (119) hide show
  1. package/bin/fire.cjs +2 -0
  2. package/bin/fire.js +2 -0
  3. package/dist/Utils-CpiQZ3n9.cjs +122 -0
  4. package/dist/Utils-CpiQZ3n9.cjs.map +1 -0
  5. package/dist/Utils-Dvclc4Pc.js +73 -0
  6. package/dist/Utils-Dvclc4Pc.js.map +1 -0
  7. package/dist/Utils-cBgwEyTl.d.ts +20 -0
  8. package/dist/Utils-rIdzILgO.d.cts +20 -0
  9. package/dist/Utils.cjs +3 -217
  10. package/dist/Utils.d.cts +2 -0
  11. package/dist/Utils.d.ts +2 -0
  12. package/dist/Utils.js +3 -9
  13. package/dist/index.cjs +790 -949
  14. package/dist/index.cjs.map +1 -0
  15. package/dist/index.d.cts +173 -295
  16. package/dist/index.d.ts +173 -295
  17. package/dist/index.js +789 -44
  18. package/dist/index.js.map +1 -0
  19. package/package.json +35 -23
  20. package/bin/chunk-6Z5DP356.js +0 -1
  21. package/bin/lexer-DQCqS3nf-XQPNMZG6.js +0 -4
  22. package/bin/run.cjs +0 -26
  23. package/bin/run.js +0 -26
  24. package/dist/Commands/Command.cjs +0 -104
  25. package/dist/Commands/Command.js +0 -7
  26. package/dist/Commands/MakeCommand.cjs +0 -433
  27. package/dist/Commands/MakeCommand.js +0 -9
  28. package/dist/Commands/MigrateCommand.cjs +0 -200
  29. package/dist/Commands/MigrateCommand.js +0 -8
  30. package/dist/Commands/ServeCommand.cjs +0 -159
  31. package/dist/Commands/ServeCommand.js +0 -8
  32. package/dist/Contracts/ICommand.cjs +0 -18
  33. package/dist/Contracts/ICommand.js +0 -1
  34. package/dist/IO/app.cjs +0 -946
  35. package/dist/IO/app.js +0 -17
  36. package/dist/IO/providers.cjs +0 -930
  37. package/dist/IO/providers.js +0 -16
  38. package/dist/Kernel.cjs +0 -890
  39. package/dist/Kernel.js +0 -14
  40. package/dist/Musket.cjs +0 -835
  41. package/dist/Musket.js +0 -13
  42. package/dist/Providers/ConsoleServiceProvider.cjs +0 -912
  43. package/dist/Providers/ConsoleServiceProvider.js +0 -15
  44. package/dist/Signature.cjs +0 -172
  45. package/dist/Signature.js +0 -7
  46. package/dist/chunk-23QH5R54.js +0 -27
  47. package/dist/chunk-2O2AYFAG.js +0 -63
  48. package/dist/chunk-3ASEWMRX.js +0 -37
  49. package/dist/chunk-3FVPHQCH.js +0 -151
  50. package/dist/chunk-3RX6CLNR.js +0 -32
  51. package/dist/chunk-3VCNSA6P.js +0 -14
  52. package/dist/chunk-3WHUADTN.js +0 -6
  53. package/dist/chunk-6OCHCPBP.js +0 -36
  54. package/dist/chunk-6OIH6FS4.js +0 -32
  55. package/dist/chunk-7EWRZPTX.js +0 -63
  56. package/dist/chunk-7PUQ5ZIN.js +0 -6
  57. package/dist/chunk-A5AONVOH.js +0 -6
  58. package/dist/chunk-ADIVRUAJ.js +0 -27
  59. package/dist/chunk-CCEWV2BR.js +0 -39
  60. package/dist/chunk-CTQ6DUT2.js +0 -8
  61. package/dist/chunk-DXQTBFGG.js +0 -31
  62. package/dist/chunk-E4SSLXFT.js +0 -63
  63. package/dist/chunk-E5XIGIEX.js +0 -14
  64. package/dist/chunk-EIOQKTRM.js +0 -104
  65. package/dist/chunk-FOSDCKCR.js +0 -106
  66. package/dist/chunk-G4OE26TZ.js +0 -33
  67. package/dist/chunk-GVGO5OAK.js +0 -8
  68. package/dist/chunk-GXRCTWKL.js +0 -16
  69. package/dist/chunk-HVKW7JK4.js +0 -8
  70. package/dist/chunk-IGEFNODG.js +0 -22
  71. package/dist/chunk-JXL4VJHZ.js +0 -36
  72. package/dist/chunk-K3GOQSS3.js +0 -6
  73. package/dist/chunk-KCJKQP37.js +0 -133
  74. package/dist/chunk-KMIFCLXG.js +0 -16
  75. package/dist/chunk-KZA3MC77.js +0 -151
  76. package/dist/chunk-LLL3V7LB.js +0 -6
  77. package/dist/chunk-LQ6DL2HS.js +0 -68
  78. package/dist/chunk-M4ZRDJJ2.js +0 -68
  79. package/dist/chunk-MAQAT3PU.js +0 -32
  80. package/dist/chunk-MPXPSSLJ.js +0 -133
  81. package/dist/chunk-NADN2PHB.js +0 -0
  82. package/dist/chunk-NFRXMBRP.js +0 -24
  83. package/dist/chunk-NVPKTRMT.js +0 -7
  84. package/dist/chunk-O45AB4MX.js +0 -83
  85. package/dist/chunk-ORPRWIQ2.js +0 -33
  86. package/dist/chunk-P7M5PEDY.js +0 -18
  87. package/dist/chunk-PBNCVQZC.js +0 -6
  88. package/dist/chunk-PMV4TMFS.js +0 -151
  89. package/dist/chunk-POF4JGTX.js +0 -186
  90. package/dist/chunk-PYSJMSNM.js +0 -27
  91. package/dist/chunk-Q3OMG6YH.js +0 -186
  92. package/dist/chunk-QCNBVSFO.js +0 -68
  93. package/dist/chunk-QMEO4OUR.js +0 -151
  94. package/dist/chunk-QSQNELZQ.js +0 -83
  95. package/dist/chunk-RRP7K5LI.js +0 -36
  96. package/dist/chunk-SHUYVCID.js +0 -6
  97. package/dist/chunk-SP4JKAUC.js +0 -63
  98. package/dist/chunk-T6OOKENF.js +0 -6
  99. package/dist/chunk-TBDROT3I.js +0 -6356
  100. package/dist/chunk-TH2RWMWA.js +0 -133
  101. package/dist/chunk-TJZCDDEV.js +0 -36
  102. package/dist/chunk-TN5SV7LF.js +0 -133
  103. package/dist/chunk-U6TOLKGJ.js +0 -22
  104. package/dist/chunk-UCOXL3OM.js +0 -0
  105. package/dist/chunk-URLTFJET.js +0 -68
  106. package/dist/chunk-UWCTG2LX.js +0 -24
  107. package/dist/chunk-WO2BXMBQ.js +0 -6
  108. package/dist/chunk-XAWZUZVP.js +0 -32
  109. package/dist/chunk-XCOSZXAE.js +0 -133
  110. package/dist/chunk-XD2Q7LWE.js +0 -24
  111. package/dist/chunk-XSL373TG.js +0 -36
  112. package/dist/chunk-XUYTJO6X.js +0 -104
  113. package/dist/chunk-YAYU7VOK.js +0 -8
  114. package/dist/chunk-YRUCICBV.js +0 -24
  115. package/dist/chunk-Z5XE72Q5.js +0 -68
  116. package/dist/chunk-ZTIO25VB.js +0 -8
  117. package/dist/lexer-DQCqS3nf-6W2BHF4T.js +0 -68
  118. package/dist/run.cjs +0 -943
  119. package/dist/run.js +0 -14
package/dist/index.d.ts CHANGED
@@ -1,250 +1,159 @@
1
- import * as commander from 'commander';
2
- import { Argument, program } from 'commander';
3
- import { Application, ServiceProvider } from '@h3ravel/core';
4
- import { XGeneric } from '@h3ravel/support';
1
+ import { TableGuesser, Utils } from "./Utils-cBgwEyTl.js";
2
+ import { Application, ConsoleCommand, ConsoleKernel, ServiceProvider } from "@h3ravel/core";
3
+ import * as commander0 from "commander";
4
+ import { program } from "commander";
5
+ import { Options } from "tsdown";
5
6
 
6
- declare class Kernel {
7
- app: Application;
8
- cwd: string;
9
- output: {
10
- success: (msg: any, exit?: boolean) => void;
11
- info: (msg: any, exit?: boolean) => void;
12
- error: (msg: string | string[] | (Error & {
13
- detail?: string;
14
- }), exit?: boolean) => void;
15
- split: (name: string, value: string, status?: "success" | "info" | "error", exit?: boolean) => void;
16
- quiet: () => never;
17
- };
18
- basePath: string;
19
- modulePath: string;
20
- consolePath: string;
21
- modulePackage: XGeneric<{
22
- version: string;
23
- }>;
24
- consolePackage: XGeneric<{
25
- version: string;
26
- }>;
27
- constructor(app: Application, basePath?: string);
28
- static init(app: Application): void;
29
- private run;
30
- ensureDirectoryExists(dir: string): Promise<void>;
31
- private loadRequirements;
7
+ //#region src/Commands/Command.d.ts
8
+ declare class Command extends ConsoleCommand {}
9
+ //#endregion
10
+ //#region src/Commands/ListCommand.d.ts
11
+ declare class ListCommand extends Command {
12
+ /**
13
+ * The name and signature of the console command.
14
+ *
15
+ * @var string
16
+ */
17
+ protected signature: string;
18
+ /**
19
+ * The console command description.
20
+ *
21
+ * @var string
22
+ */
23
+ protected description: string;
24
+ handle(): Promise<void>;
32
25
  }
33
-
34
- declare class Command {
35
- protected app: Application;
36
- protected kernel: Kernel;
37
- constructor(app: Application, kernel: Kernel);
38
- /**
39
- * The name and signature of the console command.
40
- *
41
- * @var string
42
- */
43
- protected signature: string;
44
- /**
45
- * A dictionary of signatures or what not.
46
- *
47
- * @var object
48
- */
49
- protected dictionary: Record<string, any>;
50
- /**
51
- * The console command description.
52
- *
53
- * @var string
54
- */
55
- protected description?: string;
56
- /**
57
- * The console command input.
58
- *
59
- * @var object
60
- */
61
- private input;
62
- /**
63
- * Execute the console command.
64
- */
65
- handle(..._args: any[]): Promise<void>;
66
- setApplication(app: Application): void;
67
- setInput(options: XGeneric, args: string[], regArgs: readonly Argument[], dictionary: Record<string, any>): void;
68
- getSignature(): string;
69
- getDescription(): string | undefined;
70
- option(key: string, def?: any): any;
71
- options(key?: string): any;
72
- argument(key: string, def?: any): any;
73
- arguments(): Record<string, any>;
74
- }
75
-
26
+ //#endregion
27
+ //#region src/Commands/MakeCommand.d.ts
76
28
  declare class MakeCommand extends Command {
77
- /**
78
- * The name and signature of the console command.
79
- *
80
- * @var string
81
- */
82
- protected signature: string;
83
- /**
84
- * The console command description.
85
- *
86
- * @var string
87
- */
88
- protected description: string;
89
- handle(): Promise<void>;
90
- /**
91
- * Generate a new controller class.
92
- */
93
- protected makeController(): Promise<void>;
94
- protected makeResource(): void;
95
- /**
96
- * Generate a new database migration class
97
- */
98
- protected makeMigration(): Promise<void>;
99
- protected makeFactory(): void;
100
- protected makeSeeder(): void;
101
- /**
102
- * Generate a new Arquebus model class
103
- */
104
- protected makeModel(): Promise<void>;
105
- /**
106
- * Ge the database migration file name
107
- *
108
- * @param table
109
- * @param create
110
- * @param type
111
- * @returns
112
- */
113
- getMigrationStubName(table?: string, create?: boolean, type?: 'ts' | 'js'): string;
114
- }
115
-
116
- declare class MigrateCommand extends Command {
117
- /**
118
- * The name and signature of the console command.
119
- *
120
- * @var string
121
- */
122
- protected signature: string;
123
- /**
124
- * The console command description.
125
- *
126
- * @var string
127
- */
128
- protected description: string;
129
- /**
130
- * Execute the console command.
131
- */
132
- handle(): Promise<void>;
133
- /**
134
- * Run all pending migrations.
135
- */
136
- protected migrateRun(): Promise<void>;
137
- /**
138
- * Drop all tables and re-run all migrations.
139
- */
140
- protected migrateFresh(): Promise<void>;
141
- /**
142
- * Create the migration repository.
143
- */
144
- protected migrateInstall(): Promise<void>;
145
- /**
146
- * Reset and re-run all migrations.
147
- */
148
- protected migrateRefresh(): Promise<void>;
149
- /**
150
- * Rollback all database migrations.
151
- */
152
- protected migrateReset(): Promise<void>;
153
- /**
154
- * Rollback the last database migration.
155
- */
156
- protected migrateRollback(): Promise<void>;
157
- /**
158
- * Show the status of each migration.
159
- */
160
- protected migrateStatus(): Promise<void>;
161
- /**
162
- * Publish any migration files from installed packages.
163
- */
164
- protected migratePublish(): Promise<void>;
165
- }
166
-
167
- declare class ServeCommand extends Command {
168
- /**
169
- * The name and signature of the console command.
170
- *
171
- * @var string
172
- */
173
- protected signature: string;
174
- /**
175
- * The console command description.
176
- *
177
- * @var string
178
- */
179
- protected description: string;
180
- handle(): Promise<void>;
181
- protected serve(): Promise<void>;
29
+ /**
30
+ * The name and signature of the console command.
31
+ *
32
+ * @var string
33
+ */
34
+ protected signature: string;
35
+ /**
36
+ * The console command description.
37
+ *
38
+ * @var string
39
+ */
40
+ protected description: string;
41
+ handle(): Promise<void>;
42
+ /**
43
+ * Create a new controller class.
44
+ */
45
+ protected makeController(): Promise<void>;
46
+ protected makeResource(): void;
47
+ /**
48
+ * Generate a new database migration class
49
+ */
50
+ protected makeMigration(): Promise<void>;
51
+ /**
52
+ * Create a new model factory
53
+ */
54
+ protected makeFactory(): void;
55
+ /**
56
+ * Create a new seeder class
57
+ */
58
+ protected makeSeeder(): void;
59
+ /**
60
+ * Generate a new Arquebus model class
61
+ */
62
+ protected makeModel(): Promise<void>;
63
+ /**
64
+ * Create a new view.
65
+ */
66
+ protected makeView(): Promise<void>;
67
+ /**
68
+ * Ge the database migration file name
69
+ *
70
+ * @param table
71
+ * @param create
72
+ * @param type
73
+ * @returns
74
+ */
75
+ getMigrationStubName(table?: string, create?: boolean, type?: 'ts' | 'js'): string;
182
76
  }
183
-
77
+ //#endregion
78
+ //#region src/Contracts/ICommand.d.ts
184
79
  type CommandOption = {
185
- name: string;
186
- required?: boolean;
187
- multiple?: boolean;
188
- defaultValue?: string | number | boolean | undefined | string[];
189
- shared?: boolean;
190
- description?: string;
191
- /**
192
- * for options like --Q|queue
193
- */
194
- flags?: string[];
195
- /**
196
- * true if it's a flag option
197
- */
198
- isFlag?: boolean;
199
- /**
200
- * true if name begins with '#' or '^'
201
- */
202
- isHidden?: boolean;
203
- /**
204
- * for nested options
205
- */
206
- nestedOptions?: CommandOption[];
80
+ name: string;
81
+ required?: boolean;
82
+ multiple?: boolean;
83
+ defaultValue?: string | number | boolean | undefined | string[];
84
+ shared?: boolean;
85
+ description?: string;
86
+ /**
87
+ * for options like --Q|queue
88
+ */
89
+ flags?: string[];
90
+ /**
91
+ * true if it's a flag option
92
+ */
93
+ isFlag?: boolean;
94
+ /**
95
+ * true if name begins with '#' or '^'
96
+ */
97
+ isHidden?: boolean;
98
+ /**
99
+ * for nested options
100
+ */
101
+ nestedOptions?: CommandOption[];
207
102
  };
208
103
  type ParsedCommand = {
209
- commandClass: Command;
210
- baseCommand: string;
211
- description?: string;
212
- /**
213
- * true if baseCommand begins with '#' or '^'
214
- */
215
- isHidden?: boolean;
216
- /**
217
- * true if baseCommand ends with ':'
218
- */
219
- isNamespaceCommand: boolean;
220
- /**
221
- * for colon-ended commands
222
- */
223
- subCommands?: CommandOption[];
224
- /**
225
- * for normal commands
226
- */
227
- options?: CommandOption[];
104
+ commandClass: Command;
105
+ baseCommand: string;
106
+ description?: string;
107
+ /**
108
+ * true if baseCommand begins with '#' or '^'
109
+ */
110
+ isHidden?: boolean;
111
+ /**
112
+ * true if baseCommand ends with ':'
113
+ */
114
+ isNamespaceCommand: boolean;
115
+ /**
116
+ * for colon-ended commands
117
+ */
118
+ subCommands?: CommandOption[];
119
+ /**
120
+ * for normal commands
121
+ */
122
+ options?: CommandOption[];
228
123
  };
229
-
124
+ //#endregion
125
+ //#region src/Kernel.d.ts
126
+ declare class Kernel extends ConsoleKernel {
127
+ app: Application;
128
+ constructor(app: Application);
129
+ static init(app: Application): void;
130
+ private run;
131
+ private loadRequirements;
132
+ }
133
+ //#endregion
134
+ //#region src/logo.d.ts
135
+ declare const logo: string;
136
+ declare const altLogo: string;
137
+ //#endregion
138
+ //#region src/Musket.d.ts
230
139
  /**
231
140
  * Musket is H3ravel's CLI tool
232
141
  */
233
142
  declare class Musket {
234
- private app;
235
- private kernel;
236
- private output;
237
- private commands;
238
- constructor(app: Application, kernel: Kernel);
239
- build(): Promise<commander.Command>;
240
- private loadBaseCommands;
241
- private loadDiscoveredCommands;
242
- addCommand(command: Command): void;
243
- private initialize;
244
- makeOption(opt: CommandOption, cmd: typeof program, parse?: boolean, parent?: any): void;
245
- static parse(kernel: Kernel): Promise<commander.Command>;
143
+ private app;
144
+ private kernel;
145
+ private commands;
146
+ constructor(app: Application, kernel: Kernel);
147
+ build(): Promise<commander0.Command>;
148
+ private loadBaseCommands;
149
+ private loadDiscoveredCommands;
150
+ addCommand(command: Command): void;
151
+ private initialize;
152
+ makeOption(opt: CommandOption, cmd: typeof program, parse?: boolean, parent?: any): void;
153
+ static parse(kernel: Kernel): Promise<commander0.Command>;
246
154
  }
247
-
155
+ //#endregion
156
+ //#region src/Providers/ConsoleServiceProvider.d.ts
248
157
  /**
249
158
  * Handles CLI commands and tooling.
250
159
  *
@@ -255,67 +164,36 @@ declare class Musket {
255
164
  * Auto-Registered when in CLI mode
256
165
  */
257
166
  declare class ConsoleServiceProvider extends ServiceProvider {
258
- static priority: number;
259
- register(): void;
167
+ static priority: number;
168
+ /**
169
+ * Indicate that this service provider only runs in console
170
+ */
171
+ static console: boolean;
172
+ register(): void;
173
+ boot(): void;
260
174
  }
261
-
175
+ //#endregion
176
+ //#region src/Signature.d.ts
262
177
  declare class Signature {
263
- /**
264
- * Helper to parse options inside a block of text
265
- *
266
- * @param block
267
- * @returns
268
- */
269
- static parseOptions(block: string): CommandOption[];
270
- /**
271
- * Helper to parse a command's signature
272
- *
273
- * @param signature
274
- * @param commandClass
275
- * @returns
276
- */
277
- static parseSignature(signature: string, commandClass: Command): ParsedCommand;
178
+ /**
179
+ * Helper to parse options inside a block of text
180
+ *
181
+ * @param block
182
+ * @returns
183
+ */
184
+ static parseOptions(block: string): CommandOption[];
185
+ /**
186
+ * Helper to parse a command's signature
187
+ *
188
+ * @param signature
189
+ * @param commandClass
190
+ * @returns
191
+ */
192
+ static parseSignature(signature: string, commandClass: Command): ParsedCommand;
278
193
  }
279
-
280
- declare class Utils {
281
- /**
282
- * Wraps text with chalk
283
- *
284
- * @param txt
285
- * @param color
286
- * @returns
287
- */
288
- static textFormat(txt: any, color: (txt: string) => string): string;
289
- /**
290
- * Ouput formater object
291
- *
292
- * @returns
293
- */
294
- static output(): {
295
- success: (msg: any, exit?: boolean) => void;
296
- info: (msg: any, exit?: boolean) => void;
297
- error: (msg: string | string[] | (Error & {
298
- detail?: string;
299
- }), exit?: boolean) => void;
300
- split: (name: string, value: string, status?: "success" | "info" | "error", exit?: boolean) => void;
301
- quiet: () => never;
302
- };
303
- static findModulePkg(moduleId: string, cwd?: string): string | undefined;
304
- static getMigrationPaths(cwd: string, migrator: any, defaultPath: string, path: string): Promise<any[]>;
305
- static twoColumnDetail(name: string, value: string): void;
306
- /**
307
- * Check if file exists
308
- *
309
- * @param path
310
- * @returns
311
- */
312
- static fileExists(path: string): Promise<boolean>;
313
- static findUpConfig(cwd: string, name: string, extensions: string[]): string | void;
314
- }
315
- declare class TableGuesser {
316
- static CREATE_PATTERNS: RegExp[];
317
- static CHANGE_PATTERNS: RegExp[];
318
- static guess(migration: string): (string | boolean)[];
319
- }
320
-
321
- export { Command, type CommandOption, ConsoleServiceProvider, Kernel, MakeCommand, MigrateCommand, Musket, type ParsedCommand, ServeCommand, Signature, TableGuesser, Utils };
194
+ //#endregion
195
+ //#region src/TsdownConfig.d.ts
196
+ declare const TsDownConfig: Options;
197
+ //#endregion
198
+ export { Command, CommandOption, ConsoleServiceProvider, Kernel, ListCommand, MakeCommand, Musket, ParsedCommand, Signature, TableGuesser, TsDownConfig, Utils, altLogo, logo };
199
+ //# sourceMappingURL=index.d.ts.map