@h3ravel/console 11.0.5 → 11.1.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 (78) hide show
  1. package/bin/fire.cjs +2 -0
  2. package/bin/fire.js +2 -0
  3. package/dist/Utils-7OrjoB1C.d.cts +22 -0
  4. package/dist/Utils-B1kpj9-1.cjs +130 -0
  5. package/dist/Utils-B1kpj9-1.cjs.map +1 -0
  6. package/dist/Utils-DAJvoXlr.js +86 -0
  7. package/dist/Utils-DAJvoXlr.js.map +1 -0
  8. package/dist/Utils-DxnHOGMz.d.ts +22 -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 +885 -921
  14. package/dist/index.cjs.map +1 -0
  15. package/dist/index.d.cts +270 -290
  16. package/dist/index.d.ts +270 -290
  17. package/dist/index.js +899 -44
  18. package/dist/index.js.map +1 -0
  19. package/package.json +36 -19
  20. package/bin/run.cjs +0 -26
  21. package/bin/run.js +0 -26
  22. package/dist/Commands/Command.cjs +0 -104
  23. package/dist/Commands/Command.js +0 -7
  24. package/dist/Commands/MakeCommand.cjs +0 -433
  25. package/dist/Commands/MakeCommand.js +0 -9
  26. package/dist/Commands/MigrateCommand.cjs +0 -202
  27. package/dist/Commands/MigrateCommand.js +0 -8
  28. package/dist/Commands/ServeCommand.cjs +0 -159
  29. package/dist/Commands/ServeCommand.js +0 -8
  30. package/dist/Contracts/ICommand.cjs +0 -18
  31. package/dist/Contracts/ICommand.js +0 -1
  32. package/dist/IO/app.cjs +0 -935
  33. package/dist/IO/app.js +0 -17
  34. package/dist/IO/providers.cjs +0 -911
  35. package/dist/IO/providers.js +0 -16
  36. package/dist/Kernel.cjs +0 -892
  37. package/dist/Kernel.js +0 -14
  38. package/dist/Musket.cjs +0 -837
  39. package/dist/Musket.js +0 -13
  40. package/dist/Providers/ConsoleServiceProvider.cjs +0 -904
  41. package/dist/Providers/ConsoleServiceProvider.js +0 -15
  42. package/dist/Signature.cjs +0 -172
  43. package/dist/Signature.js +0 -7
  44. package/dist/chunk-2O2AYFAG.js +0 -63
  45. package/dist/chunk-3FVPHQCH.js +0 -151
  46. package/dist/chunk-3VCNSA6P.js +0 -14
  47. package/dist/chunk-3WHUADTN.js +0 -6
  48. package/dist/chunk-6OCHCPBP.js +0 -36
  49. package/dist/chunk-CTQ6DUT2.js +0 -8
  50. package/dist/chunk-E5XIGIEX.js +0 -14
  51. package/dist/chunk-FOSDCKCR.js +0 -106
  52. package/dist/chunk-GVGO5OAK.js +0 -8
  53. package/dist/chunk-GXRCTWKL.js +0 -16
  54. package/dist/chunk-HVKW7JK4.js +0 -8
  55. package/dist/chunk-IGEFNODG.js +0 -22
  56. package/dist/chunk-JXL4VJHZ.js +0 -36
  57. package/dist/chunk-KMIFCLXG.js +0 -16
  58. package/dist/chunk-M4ZRDJJ2.js +0 -68
  59. package/dist/chunk-MAQAT3PU.js +0 -32
  60. package/dist/chunk-NADN2PHB.js +0 -0
  61. package/dist/chunk-O45AB4MX.js +0 -83
  62. package/dist/chunk-P7M5PEDY.js +0 -18
  63. package/dist/chunk-PMV4TMFS.js +0 -151
  64. package/dist/chunk-POF4JGTX.js +0 -186
  65. package/dist/chunk-RRP7K5LI.js +0 -36
  66. package/dist/chunk-SHUYVCID.js +0 -6
  67. package/dist/chunk-SP4JKAUC.js +0 -63
  68. package/dist/chunk-TJZCDDEV.js +0 -36
  69. package/dist/chunk-TN5SV7LF.js +0 -133
  70. package/dist/chunk-U6TOLKGJ.js +0 -22
  71. package/dist/chunk-UCOXL3OM.js +0 -0
  72. package/dist/chunk-URLTFJET.js +0 -68
  73. package/dist/chunk-XCOSZXAE.js +0 -133
  74. package/dist/chunk-XSL373TG.js +0 -36
  75. package/dist/chunk-YAYU7VOK.js +0 -8
  76. package/dist/chunk-ZTIO25VB.js +0 -8
  77. package/dist/run.cjs +0 -929
  78. package/dist/run.js +0 -14
package/dist/index.d.ts CHANGED
@@ -1,250 +1,261 @@
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-DxnHOGMz.js";
2
+ import { Application, ServiceProvider } from "@h3ravel/core";
3
+ import { Logger } from "@h3ravel/shared";
4
+ import * as commander0 from "commander";
5
+ import { Argument, program } from "commander";
6
+ import { XGeneric } from "@h3ravel/support";
7
+ import { Options } from "tsdown";
5
8
 
9
+ //#region src/Kernel.d.ts
6
10
  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;
11
+ app: Application;
12
+ cwd: string;
13
+ output: typeof Logger;
14
+ basePath: string;
15
+ modulePath: string;
16
+ consolePath: string;
17
+ modulePackage: XGeneric<{
18
+ version: string;
19
+ }>;
20
+ consolePackage: XGeneric<{
21
+ version: string;
22
+ }>;
23
+ constructor(app: Application);
24
+ static init(app: Application): void;
25
+ private run;
26
+ ensureDirectoryExists(dir: string): Promise<void>;
27
+ private loadRequirements;
32
28
  }
33
-
29
+ //#endregion
30
+ //#region src/Commands/Command.d.ts
34
31
  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>;
32
+ protected app: Application;
33
+ protected kernel: Kernel;
34
+ constructor(app: Application, kernel: Kernel);
35
+ /**
36
+ * The name and signature of the console command.
37
+ *
38
+ * @var string
39
+ */
40
+ protected signature: string;
41
+ /**
42
+ * A dictionary of signatures or what not.
43
+ *
44
+ * @var object
45
+ */
46
+ protected dictionary: Record<string, any>;
47
+ /**
48
+ * The console command description.
49
+ *
50
+ * @var string
51
+ */
52
+ protected description?: string;
53
+ /**
54
+ * The console command input.
55
+ *
56
+ * @var object
57
+ */
58
+ private input;
59
+ /**
60
+ * Execute the console command.
61
+ */
62
+ handle(..._args: any[]): Promise<void>;
63
+ setApplication(app: Application): void;
64
+ setInput(options: XGeneric, args: string[], regArgs: readonly Argument[], dictionary: Record<string, any>): void;
65
+ getSignature(): string;
66
+ getDescription(): string | undefined;
67
+ option(key: string, def?: any): any;
68
+ options(key?: string): any;
69
+ argument(key: string, def?: any): any;
70
+ arguments(): Record<string, any>;
74
71
  }
75
-
72
+ //#endregion
73
+ //#region src/Commands/FireCommand.d.ts
74
+ declare class FireCommand extends Command {
75
+ /**
76
+ * The name and signature of the console command.
77
+ *
78
+ * @var string
79
+ */
80
+ protected signature: string;
81
+ /**
82
+ * The console command description.
83
+ *
84
+ * @var string
85
+ */
86
+ protected description: string;
87
+ handle(): Promise<void>;
88
+ protected fire(): Promise<void>;
89
+ }
90
+ //#endregion
91
+ //#region src/Commands/MakeCommand.d.ts
76
92
  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;
93
+ /**
94
+ * The name and signature of the console command.
95
+ *
96
+ * @var string
97
+ */
98
+ protected signature: string;
99
+ /**
100
+ * The console command description.
101
+ *
102
+ * @var string
103
+ */
104
+ protected description: string;
105
+ handle(): Promise<void>;
106
+ /**
107
+ * Generate a new controller class.
108
+ */
109
+ protected makeController(): Promise<void>;
110
+ protected makeResource(): void;
111
+ /**
112
+ * Generate a new database migration class
113
+ */
114
+ protected makeMigration(): Promise<void>;
115
+ protected makeFactory(): void;
116
+ protected makeSeeder(): void;
117
+ /**
118
+ * Generate a new Arquebus model class
119
+ */
120
+ protected makeModel(): Promise<void>;
121
+ /**
122
+ * Ge the database migration file name
123
+ *
124
+ * @param table
125
+ * @param create
126
+ * @param type
127
+ * @returns
128
+ */
129
+ getMigrationStubName(table?: string, create?: boolean, type?: 'ts' | 'js'): string;
114
130
  }
115
-
131
+ //#endregion
132
+ //#region src/Commands/MigrateCommand.d.ts
116
133
  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>;
134
+ /**
135
+ * The current database connection
136
+ */
137
+ private connection;
138
+ /**
139
+ * The base path for all database operations
140
+ */
141
+ private databasePath;
142
+ /**
143
+ * The name and signature of the console command.
144
+ *
145
+ * @var string
146
+ */
147
+ protected signature: string;
148
+ /**
149
+ * The console command description.
150
+ *
151
+ * @var string
152
+ */
153
+ protected description: string;
154
+ /**
155
+ * Execute the console command.
156
+ */
157
+ handle(): Promise<void>;
158
+ /**
159
+ * Run all pending migrations.
160
+ */
161
+ protected migrateRun(): Promise<void>;
162
+ /**
163
+ * Drop all tables and re-run all migrations.
164
+ */
165
+ protected migrateFresh(): Promise<void>;
166
+ /**
167
+ * Create the migration repository.
168
+ */
169
+ protected migrateInstall(): Promise<void>;
170
+ /**
171
+ * Reset and re-run all migrations.
172
+ */
173
+ protected migrateRefresh(): Promise<void>;
174
+ /**
175
+ * Rollback all database migrations.
176
+ */
177
+ protected migrateReset(): Promise<void>;
178
+ /**
179
+ * Rollback the last database migration.
180
+ */
181
+ protected migrateRollback(): Promise<void>;
182
+ /**
183
+ * Show the status of each migration.
184
+ */
185
+ protected migrateStatus(): Promise<void>;
186
+ /**
187
+ * Publish any migration files from installed packages.
188
+ */
189
+ protected migratePublish(): Promise<void>;
165
190
  }
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>;
182
- }
183
-
191
+ //#endregion
192
+ //#region src/Contracts/ICommand.d.ts
184
193
  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[];
194
+ name: string;
195
+ required?: boolean;
196
+ multiple?: boolean;
197
+ defaultValue?: string | number | boolean | undefined | string[];
198
+ shared?: boolean;
199
+ description?: string;
200
+ /**
201
+ * for options like --Q|queue
202
+ */
203
+ flags?: string[];
204
+ /**
205
+ * true if it's a flag option
206
+ */
207
+ isFlag?: boolean;
208
+ /**
209
+ * true if name begins with '#' or '^'
210
+ */
211
+ isHidden?: boolean;
212
+ /**
213
+ * for nested options
214
+ */
215
+ nestedOptions?: CommandOption[];
207
216
  };
208
217
  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[];
218
+ commandClass: Command;
219
+ baseCommand: string;
220
+ description?: string;
221
+ /**
222
+ * true if baseCommand begins with '#' or '^'
223
+ */
224
+ isHidden?: boolean;
225
+ /**
226
+ * true if baseCommand ends with ':'
227
+ */
228
+ isNamespaceCommand: boolean;
229
+ /**
230
+ * for colon-ended commands
231
+ */
232
+ subCommands?: CommandOption[];
233
+ /**
234
+ * for normal commands
235
+ */
236
+ options?: CommandOption[];
228
237
  };
229
-
238
+ //#endregion
239
+ //#region src/Musket.d.ts
230
240
  /**
231
241
  * Musket is H3ravel's CLI tool
232
242
  */
233
243
  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>;
244
+ private app;
245
+ private kernel;
246
+ private output;
247
+ private commands;
248
+ constructor(app: Application, kernel: Kernel);
249
+ build(): Promise<commander0.Command>;
250
+ private loadBaseCommands;
251
+ private loadDiscoveredCommands;
252
+ addCommand(command: Command): void;
253
+ private initialize;
254
+ makeOption(opt: CommandOption, cmd: typeof program, parse?: boolean, parent?: any): void;
255
+ static parse(kernel: Kernel): Promise<commander0.Command>;
246
256
  }
247
-
257
+ //#endregion
258
+ //#region src/Providers/ConsoleServiceProvider.d.ts
248
259
  /**
249
260
  * Handles CLI commands and tooling.
250
261
  *
@@ -255,67 +266,36 @@ declare class Musket {
255
266
  * Auto-Registered when in CLI mode
256
267
  */
257
268
  declare class ConsoleServiceProvider extends ServiceProvider {
258
- static priority: number;
259
- register(): void;
269
+ static priority: number;
270
+ /**
271
+ * Indicate that this service provider only runs in console
272
+ */
273
+ static console: boolean;
274
+ register(): void;
275
+ boot(): void;
260
276
  }
261
-
277
+ //#endregion
278
+ //#region src/Signature.d.ts
262
279
  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;
280
+ /**
281
+ * Helper to parse options inside a block of text
282
+ *
283
+ * @param block
284
+ * @returns
285
+ */
286
+ static parseOptions(block: string): CommandOption[];
287
+ /**
288
+ * Helper to parse a command's signature
289
+ *
290
+ * @param signature
291
+ * @param commandClass
292
+ * @returns
293
+ */
294
+ static parseSignature(signature: string, commandClass: Command): ParsedCommand;
278
295
  }
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 };
296
+ //#endregion
297
+ //#region src/TsdownConfig.d.ts
298
+ declare const TsDownConfig: Options;
299
+ //#endregion
300
+ export { Command, CommandOption, ConsoleServiceProvider, FireCommand, Kernel, MakeCommand, MigrateCommand, Musket, ParsedCommand, Signature, TableGuesser, TsDownConfig, Utils };
301
+ //# sourceMappingURL=index.d.ts.map