@adonisjs/core 7.5.0 → 7.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- import { t as Ignitor } from "./main-B2M1tZ4I.js";
2
- import { t as IgnitorFactory } from "./ignitor-CSR3YT32.js";
1
+ import { t as Ignitor } from "./main-B2rXbPKm.js";
2
+ import { t as IgnitorFactory } from "./ignitor-B4zotvea.js";
3
3
  import { t as createAceKernel } from "./create_kernel-Bx7xtr5F.js";
4
4
  //#region factories/core/ace.ts
5
5
  /**
@@ -1,4 +1,4 @@
1
- import { n as prettyPrintError } from "../core-BOOnPIz3.js";
1
+ import { n as prettyPrintError } from "../main-B2rXbPKm.js";
2
2
  import { o as args, p as BaseCommand, u as flags } from "../main-DvUje0hm.js";
3
3
  import { t as __decorate } from "../decorate-COk3IovQ.js";
4
4
  //#region commands/add.ts
@@ -1,6 +1,7 @@
1
1
  import { n as __reExport, t as __exportAll } from "./rolldown-runtime-BBjsoOtd.js";
2
+ import { t as configProvider } from "./config_provider-t1UIlTp8.js";
2
3
  //#region modules/config.ts
3
- var config_exports = /* @__PURE__ */ __exportAll({});
4
+ var config_exports = /* @__PURE__ */ __exportAll({ configProvider: () => configProvider });
4
5
  import * as import__adonisjs_config from "@adonisjs/config";
5
6
  __reExport(config_exports, import__adonisjs_config);
6
7
  //#endregion
@@ -0,0 +1,23 @@
1
+ import "./main-DbL06a4f.js";
2
+ import "./container-DLqyMqk-.js";
3
+ import "./main-B2rXbPKm.js";
4
+ import "./config_provider-t1UIlTp8.js";
5
+ import "./index_entities-C517sTpx.js";
6
+ import { errors } from "@adonisjs/ace";
7
+ import { errors as errors$1 } from "@adonisjs/env";
8
+ import { errors as errors$2 } from "@adonisjs/application";
9
+ import { errors as errors$3 } from "@boringnode/encryption";
10
+ import { errors as errors$4 } from "@adonisjs/http-server";
11
+ //#region index.ts
12
+ /**
13
+ * Aggregated errors from all modules.
14
+ */
15
+ const errors$5 = {
16
+ ...errors$3,
17
+ ...errors$4,
18
+ ...errors$2,
19
+ ...errors,
20
+ ...errors$1
21
+ };
22
+ //#endregion
23
+ export { errors$5 as t };
@@ -1,2 +1,2 @@
1
- import { t as AceFactory } from "../../ace-DZFqbA8w.js";
1
+ import { t as AceFactory } from "../../ace-B6apQo2x.js";
2
2
  export { AceFactory };
@@ -1,2 +1,2 @@
1
- import { t as IgnitorFactory } from "../../ignitor-CSR3YT32.js";
1
+ import { t as IgnitorFactory } from "../../ignitor-B4zotvea.js";
2
2
  export { IgnitorFactory };
@@ -1,4 +1,4 @@
1
- import { t as IgnitorFactory } from "../../ignitor-CSR3YT32.js";
2
- import { t as AceFactory } from "../../ace-DZFqbA8w.js";
3
- import { t as TestUtilsFactory } from "../../test_utils-BRlZx7WG.js";
1
+ import { t as IgnitorFactory } from "../../ignitor-B4zotvea.js";
2
+ import { t as AceFactory } from "../../ace-B6apQo2x.js";
3
+ import { t as TestUtilsFactory } from "../../test_utils-DeLxr1gf.js";
4
4
  export { AceFactory, IgnitorFactory, TestUtilsFactory };
@@ -1,2 +1,2 @@
1
- import { t as TestUtilsFactory } from "../../test_utils-BRlZx7WG.js";
1
+ import { t as TestUtilsFactory } from "../../test_utils-DeLxr1gf.js";
2
2
  export { TestUtilsFactory };
@@ -1,5 +1,5 @@
1
1
  import { t as stubsRoot } from "../main-DbL06a4f.js";
2
- import "../core-BOOnPIz3.js";
2
+ import "../core-CPmWMNBG.js";
3
3
  import { AppFactory } from "@adonisjs/application/factories";
4
4
  //#region factories/stubs.ts
5
5
  /**
@@ -1,4 +1,4 @@
1
- import { t as Ignitor } from "./main-B2M1tZ4I.js";
1
+ import { t as Ignitor } from "./main-B2rXbPKm.js";
2
2
  import { t as logger_exports } from "./logger-DaDoVXHv.js";
3
3
  import { t as main_exports } from "./main-BOydGWpm.js";
4
4
  import { n as drivers, t as defineConfig } from "./define_config-DzONx0uA.js";
package/build/index.d.ts CHANGED
@@ -5,15 +5,10 @@ import { errors as encryptionErrors } from '@boringnode/encryption';
5
5
  import { errors as httpServerErrors } from '@adonisjs/http-server';
6
6
  export { stubsRoot } from './stubs/main.ts';
7
7
  export { inject } from './modules/container.ts';
8
- export { Ignitor } from './src/ignitor/main.ts';
8
+ export { Ignitor, prettyPrintError } from './src/ignitor/main.ts';
9
9
  export { configProvider } from './src/config_provider.ts';
10
10
  export { indexEntities } from './src/assembler_hooks/index_entities.ts';
11
11
  /**
12
12
  * Aggregated errors from all modules.
13
13
  */
14
14
  export declare const errors: typeof encryptionErrors & typeof httpServerErrors & typeof appErrors & typeof aceErrors & typeof envErrors;
15
- /**
16
- * Pretty prints an error with colorful output using
17
- * Youch terminal
18
- */
19
- export declare function prettyPrintError(error: any): Promise<void>;
package/build/index.js CHANGED
@@ -1,7 +1,8 @@
1
1
  import { t as stubsRoot } from "./main-DbL06a4f.js";
2
2
  import { t as container_exports } from "./container-DLqyMqk-.js";
3
- import { t as Ignitor } from "./main-B2M1tZ4I.js";
3
+ import { n as prettyPrintError, t as Ignitor } from "./main-B2rXbPKm.js";
4
4
  import { t as configProvider } from "./config_provider-t1UIlTp8.js";
5
- import { n as prettyPrintError, r as indexEntities, t as errors } from "./core-BOOnPIz3.js";
5
+ import { t as indexEntities } from "./index_entities-C517sTpx.js";
6
+ import { t as errors } from "./core-CPmWMNBG.js";
6
7
  var inject = container_exports.inject;
7
8
  export { Ignitor, configProvider, errors, indexEntities, inject, prettyPrintError, stubsRoot };
@@ -1,14 +1,5 @@
1
- import "./main-DbL06a4f.js";
2
- import "./container-DLqyMqk-.js";
3
- import "./main-B2M1tZ4I.js";
4
- import "./config_provider-t1UIlTp8.js";
5
1
  import { t as stringHelpers } from "./string-DUpLZV_t.js";
6
2
  import { i as outputTransformerDataObjects } from "./utils-CeWrQT0f.js";
7
- import { errors } from "@adonisjs/ace";
8
- import { errors as errors$1 } from "@adonisjs/env";
9
- import { errors as errors$2 } from "@adonisjs/application";
10
- import { errors as errors$3 } from "@boringnode/encryption";
11
- import { errors as errors$4 } from "@adonisjs/http-server";
12
3
  //#region src/assembler_hooks/index_entities.ts
13
4
  /**
14
5
  * Configures the IndexGenerator to create barrel files for "controllers", "events",
@@ -168,33 +159,4 @@ function indexEntities(entities = {}) {
168
159
  } };
169
160
  }
170
161
  //#endregion
171
- //#region index.ts
172
- /**
173
- * Aggregated errors from all modules.
174
- */
175
- const errors$5 = {
176
- ...errors$3,
177
- ...errors$4,
178
- ...errors$2,
179
- ...errors,
180
- ...errors$1
181
- };
182
- /**
183
- * Pretty prints an error with colorful output using
184
- * Youch terminal
185
- */
186
- async function prettyPrintError(error) {
187
- if (error && typeof error === "object" && error.code === "E_DUMP_DIE_EXCEPTION") {
188
- console.error(error);
189
- return;
190
- }
191
- try {
192
- const { Youch } = await import("youch");
193
- const youch = new Youch();
194
- console.error(await youch.toANSI(error));
195
- } catch {
196
- console.error(error);
197
- }
198
- }
199
- //#endregion
200
- export { prettyPrintError as n, indexEntities as r, errors$5 as t };
162
+ export { indexEntities as t };
@@ -431,5 +431,22 @@ var Ignitor = class {
431
431
  await this.#app?.terminate();
432
432
  }
433
433
  };
434
+ /**
435
+ * Pretty prints an error with colorful output using
436
+ * Youch terminal
437
+ */
438
+ async function prettyPrintError(error) {
439
+ if (error && typeof error === "object" && error.code === "E_DUMP_DIE_EXCEPTION") {
440
+ console.error(error);
441
+ return;
442
+ }
443
+ try {
444
+ const { Youch } = await import("youch");
445
+ const youch = new Youch();
446
+ console.error(await youch.toANSI(error));
447
+ } catch {
448
+ console.error(error);
449
+ }
450
+ }
434
451
  //#endregion
435
- export { Ignitor as t };
452
+ export { prettyPrintError as n, Ignitor as t };
@@ -1,7 +1,6 @@
1
1
  /**
2
- * Configuration module re-exports all functionality from @adonisjs/config.
3
- * This includes the Config class and related types for managing application
4
- * configuration files and environment-specific settings.
2
+ * Configuration module re-exports @adonisjs/config and the config provider
3
+ * helper used to defer configuration resolution until application boot.
5
4
  *
6
5
  * @example
7
6
  * // Import the Config class
@@ -14,5 +13,9 @@
14
13
  * @example
15
14
  * // Import configuration types
16
15
  * import type { ConfigProvider } from '@adonisjs/core/config'
16
+ *
17
+ * // Create a lazy configuration provider
18
+ * import { configProvider } from '@adonisjs/core/config'
17
19
  */
18
20
  export * from '@adonisjs/config';
21
+ export { configProvider } from '../src/config_provider.ts';
@@ -1,3 +1,4 @@
1
- import "../config-BB5flRG9.js";
1
+ import { t as configProvider } from "../config_provider-t1UIlTp8.js";
2
+ import "../config-8KhKvjYy.js";
2
3
  export * from "@adonisjs/config";
3
- export {};
4
+ export { configProvider };
@@ -1,7 +1,7 @@
1
1
  import { t as app_exports } from "../app-BOjDPLf-.js";
2
2
  import { t as configProvider } from "../config_provider-t1UIlTp8.js";
3
3
  import { t as emitRouteTypes } from "../utils-CeWrQT0f.js";
4
- import { t as config_exports } from "../config-BB5flRG9.js";
4
+ import { t as config_exports } from "../config-8KhKvjYy.js";
5
5
  import { t as events_exports } from "../events-BVzXwbEH.js";
6
6
  import { t as logger_exports } from "../logger-DaDoVXHv.js";
7
7
  import { t as Dumper } from "../dumper-BhtAWrcS.js";
@@ -0,0 +1,2 @@
1
+ import { t as indexEntities } from "../../index_entities-C517sTpx.js";
2
+ export { indexEntities };
@@ -65,3 +65,8 @@ export declare class Ignitor {
65
65
  */
66
66
  terminate(): Promise<void>;
67
67
  }
68
+ /**
69
+ * Pretty prints an error with colorful output using
70
+ * Youch terminal
71
+ */
72
+ export declare function prettyPrintError(error: any): Promise<void>;
@@ -0,0 +1,2 @@
1
+ import { n as prettyPrintError, t as Ignitor } from "../../main-B2rXbPKm.js";
2
+ export { Ignitor, prettyPrintError };
@@ -1,6 +1,6 @@
1
- import { t as Ignitor } from "./main-B2M1tZ4I.js";
2
- import "./core-BOOnPIz3.js";
3
- import { t as IgnitorFactory } from "./ignitor-CSR3YT32.js";
1
+ import { t as Ignitor } from "./main-B2rXbPKm.js";
2
+ import "./core-CPmWMNBG.js";
3
+ import { t as IgnitorFactory } from "./ignitor-B4zotvea.js";
4
4
  import { t as TestUtils } from "./main-j-xf1jGN.js";
5
5
  //#region factories/core/test_utils.ts
6
6
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@adonisjs/core",
3
3
  "description": "Core of AdonisJS",
4
- "version": "7.5.0",
4
+ "version": "7.5.1",
5
5
  "engines": {
6
6
  "node": ">=24.0.0"
7
7
  },
@@ -27,6 +27,8 @@
27
27
  "./providers/*": "./build/providers/*.js",
28
28
  "./helpers": "./build/src/helpers/main.js",
29
29
  "./helpers/*": "./build/src/helpers/*.js",
30
+ "./ignitor": "./build/src/ignitor/main.js",
31
+ "./generators": "./build/src/assembler_hooks/index_entities.js",
30
32
  "./ace": "./build/modules/ace/main.js",
31
33
  "./ace/codemods": "./build/modules/ace/codemods.js",
32
34
  "./bodyparser": "./build/modules/bodyparser/main.js",
@@ -235,6 +237,8 @@
235
237
  "providers/**/*.ts",
236
238
  "src/helpers/main.ts",
237
239
  "src/helpers/**/*.ts",
240
+ "src/ignitor/main.ts",
241
+ "src/assembler_hooks/index_entities.ts",
238
242
  "modules/ace/main.ts",
239
243
  "modules/ace/codemods.ts",
240
244
  "modules/bodyparser/main.ts",
@@ -1 +0,0 @@
1
- {"commands":[{"commandName":"add","description":"Install and configure one or more AdonisJS packages. Runs npm install followed by the package configure hook","help":["Use this command instead of manually running npm install + configure separately.","Accepts shorthand names: \"vinejs\" for @vinejs/vine, \"edge\" for edge.js.","```","{{ binaryName }} add @adonisjs/lucid","{{ binaryName }} add @adonisjs/auth @adonisjs/session","```"],"namespace":null,"aliases":[],"flags":[{"name":"verbose","flagName":"verbose","required":false,"type":"boolean","description":"Display logs in verbose mode"},{"name":"packageManager","flagName":"package-manager","required":false,"type":"string","description":"Define the package manager you want to use"},{"name":"dev","flagName":"dev","required":false,"type":"boolean","description":"Should we install the package as a dev dependency","alias":"D"},{"name":"force","flagName":"force","required":false,"type":"boolean","description":"Forcefully overwrite existing files"}],"args":[{"name":"names","argumentName":"names","required":true,"description":"Package names to install and configure","type":"spread"}],"options":{"allowUnknownFlags":true},"filePath":"add.js"},{"commandName":"build","description":"Build application for production by compiling frontend assets and TypeScript source to JavaScript","help":["Create the production build using the following command.","```","{{ binaryName }} build","```","","The assets bundler dev server runs automatically after detecting vite config or webpack config files","You may pass vite CLI args using the --assets-args command line flag.","```","{{ binaryName }} build --assets-args=\"--debug --base=/public\"","```"],"namespace":null,"aliases":[],"flags":[{"name":"ignoreTsErrors","flagName":"ignore-ts-errors","required":false,"type":"boolean","description":"Ignore TypeScript errors and continue with the build process"},{"name":"packageManager","flagName":"package-manager","required":false,"type":"string","description":"Define the package manager to copy the appropriate lock file"},{"name":"tsconfig","flagName":"tsconfig","required":false,"type":"string","description":"Define the tsconfig path"}],"args":[],"options":{},"filePath":"build.js"},{"commandName":"codegen","description":"Generate TypeScript type definitions and index files for the application","help":["Regenerate the codegen files without starting the HTTP server.","```","{{ binaryName }} codegen","```","","Use it inside a CI pipeline to keep the generated types up-to-date before","typechecking or building the application, without committing them to git.","```","npm ci && {{ binaryName }} codegen && npm run typecheck","```"],"namespace":null,"aliases":[],"flags":[],"args":[],"options":{},"filePath":"codegen.js"},{"commandName":"configure","description":"Run the configure hook of an already-installed package. Use \"add\" command instead to both install and configure in one step","help":"","namespace":null,"aliases":[],"flags":[{"name":"verbose","flagName":"verbose","required":false,"type":"boolean","description":"Display logs in verbose mode","alias":"v"},{"name":"force","flagName":"force","required":false,"type":"boolean","description":"Forcefully overwrite existing files","alias":"f"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Package name","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"configure.js"},{"commandName":"eject","description":"Copy scaffolding stubs from a package to your application for customization. Stubs are templates used by make:* commands","help":"","namespace":null,"aliases":[],"flags":[{"name":"pkg","flagName":"pkg","required":false,"type":"string","description":"Mention package name for searching stubs","default":"@adonisjs/core"}],"args":[{"name":"stubPath","argumentName":"stub-path","required":true,"description":"Path to the stubs directory or a single stub file","type":"string"}],"options":{},"filePath":"eject.js"},{"commandName":"env:add","description":"Add a new environment variable to .env, .env.example, and its validation rule to start/env.ts","help":"","namespace":"env","aliases":[],"flags":[{"name":"type","flagName":"type","required":false,"type":"string","description":"Type of the variable"},{"name":"enumValues","flagName":"enum-values","required":false,"type":"array","description":"Allowed values for the enum type in a comma-separated list","default":[""]}],"args":[{"name":"name","argumentName":"name","required":false,"description":"Variable name. Will be converted to screaming snake case","type":"string"},{"name":"value","argumentName":"value","required":false,"description":"Variable value","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"env/add.js"},{"commandName":"generate:key","description":"Generate a cryptographically secure APP_KEY and write it to the .env file. Use --show to print without writing","help":"","namespace":"generate","aliases":[],"flags":[{"name":"show","flagName":"show","required":false,"type":"boolean","description":"Display the key on the terminal, instead of writing it to .env file"},{"name":"force","flagName":"force","required":false,"type":"boolean","description":"Force update .env file in production environment"}],"args":[],"options":{},"filePath":"generate_key.js"},{"commandName":"inspect:rcfile","description":"Display the resolved adonisrc.ts configuration as JSON, including providers, preloads, commands, and meta files","help":"","namespace":"inspect","aliases":[],"flags":[],"args":[],"options":{},"filePath":"inspect_rcfile.js"},{"commandName":"list:routes","description":"List all registered routes with their HTTP methods, URL patterns, handlers, and middleware","help":"","namespace":"list","aliases":[],"flags":[{"name":"middleware","flagName":"middleware","required":false,"type":"array","description":"View routes that includes all the mentioned middleware names. Use * to see routes that are using one or more middleware"},{"name":"ignoreMiddleware","flagName":"ignore-middleware","required":false,"type":"array","description":"View routes that does not include all the mentioned middleware names. Use * to see routes that are using zero middleware"},{"name":"json","flagName":"json","required":false,"type":"boolean","description":"Get routes list as a JSON string"},{"name":"table","flagName":"table","required":false,"type":"boolean","description":"View list of routes as a table"},{"name":"jsonl","flagName":"jsonl","required":false,"type":"boolean","description":"Get routes as JSONL, one JSON object per line (optimized for AI agents)"}],"args":[{"name":"match","argumentName":"match","required":false,"description":"Find routes matching the given keyword. Route name, pattern and controller name will be searched against the keyword","type":"string"}],"options":{"startApp":true},"filePath":"list/routes.js"},{"commandName":"make:command","description":"Create a new Ace CLI command class in commands/","help":"","namespace":"make","aliases":[],"flags":[{"name":"contentsFrom","flagName":"contents-from","required":false,"type":"string","description":"Use the contents of the given file as the generated output"},{"name":"force","flagName":"force","required":false,"type":"boolean","description":"Forcefully overwrite existing files","alias":"f"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the command","type":"string"}],"options":{},"filePath":"make/command.js"},{"commandName":"make:controller","description":"Create a new HTTP controller class in app/controllers. Use --resource for CRUD methods or --api for API-only CRUD (no create/edit)","help":"","namespace":"make","aliases":[],"flags":[{"name":"singular","flagName":"singular","required":false,"type":"boolean","description":"Generate controller in singular form","alias":"s"},{"name":"resource","flagName":"resource","required":false,"type":"boolean","description":"Generate resourceful controller with methods to perform CRUD actions on a resource","alias":"r"},{"name":"api","flagName":"api","required":false,"type":"boolean","description":"Generate resourceful controller without the \"edit\" and the \"create\" methods","alias":"a"},{"name":"contentsFrom","flagName":"contents-from","required":false,"type":"string","description":"Use the contents of the given file as the generated output"},{"name":"force","flagName":"force","required":false,"type":"boolean","description":"Forcefully overwrite existing files","alias":"f"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"The name of the controller","type":"string"},{"name":"actions","argumentName":"actions","required":false,"description":"Create controller with custom method names","type":"spread"}],"options":{"allowUnknownFlags":true},"filePath":"make/controller.js"},{"commandName":"make:event","description":"Create a new event class in app/events. Events are dispatched via emitter and handled by listeners","help":"","namespace":"make","aliases":[],"flags":[{"name":"contentsFrom","flagName":"contents-from","required":false,"type":"string","description":"Use the contents of the given file as the generated output"},{"name":"force","flagName":"force","required":false,"type":"boolean","description":"Forcefully overwrite existing files","alias":"f"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the event","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/event.js"},{"commandName":"make:exception","description":"Create a new custom exception class in app/exceptions with handle and report methods","help":"","namespace":"make","aliases":[],"flags":[{"name":"contentsFrom","flagName":"contents-from","required":false,"type":"string","description":"Use the contents of the given file as the generated output"},{"name":"force","flagName":"force","required":false,"type":"boolean","description":"Forcefully overwrite existing files","alias":"f"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the exception","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/exception.js"},{"commandName":"make:listener","description":"Create a new event listener class in app/listeners. Use --event to also generate the event class and bind them together","help":"","namespace":"make","aliases":[],"flags":[{"name":"event","flagName":"event","required":false,"type":"string","description":"Generate an event class alongside the listener","alias":"e"},{"name":"contentsFrom","flagName":"contents-from","required":false,"type":"string","description":"Use the contents of the given file as the generated output"},{"name":"force","flagName":"force","required":false,"type":"boolean","description":"Forcefully overwrite existing files","alias":"f"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the event listener","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/listener.js"},{"commandName":"make:middleware","description":"Create a new middleware class in app/middleware and register it in start/kernel.ts under the chosen stack (server, router, or named)","help":"","namespace":"make","aliases":[],"flags":[{"name":"stack","flagName":"stack","required":false,"type":"string","description":"The stack in which to register the middleware","alias":"s"},{"name":"contentsFrom","flagName":"contents-from","required":false,"type":"string","description":"Use the contents of the given file as the generated output"},{"name":"force","flagName":"force","required":false,"type":"boolean","description":"Forcefully overwrite existing files","alias":"f"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the middleware","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/middleware.js"},{"commandName":"make:preload","description":"Create a new preload file in start/ and optionally register it in adonisrc.ts. Preload files run during app boot","help":"","namespace":"make","aliases":[],"flags":[{"name":"register","flagName":"register","required":false,"type":"boolean","description":"Auto register the preload file inside the .adonisrc.ts file","showNegatedVariantInHelp":true,"alias":"r"},{"name":"environments","flagName":"environments","required":false,"type":"array","description":"Define the preload file's environment. Accepted values are \"web,console,test,repl\"","alias":"e"},{"name":"contentsFrom","flagName":"contents-from","required":false,"type":"string","description":"Use the contents of the given file as the generated output"},{"name":"force","flagName":"force","required":false,"type":"boolean","description":"Forcefully overwrite existing files","alias":"f"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the preload file","type":"string"}],"options":{},"filePath":"make/preload.js"},{"commandName":"make:provider","description":"Create a new service provider in providers/ and optionally register it in adonisrc.ts. Providers register IoC container bindings","help":"","namespace":"make","aliases":[],"flags":[{"name":"register","flagName":"register","required":false,"type":"boolean","description":"Auto register the provider inside the .adonisrc.ts file","showNegatedVariantInHelp":true,"alias":"r"},{"name":"environments","flagName":"environments","required":false,"type":"array","description":"Define the provider environment. Accepted values are \"web,console,test,repl\"","alias":"e"},{"name":"contentsFrom","flagName":"contents-from","required":false,"type":"string","description":"Use the contents of the given file as the generated output"},{"name":"force","flagName":"force","required":false,"type":"boolean","description":"Forcefully overwrite existing files","alias":"f"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the provider","type":"string"}],"options":{},"filePath":"make/provider.js"},{"commandName":"make:service","description":"Create a new service class in app/services. Services encapsulate reusable business logic outside of controllers","help":"","namespace":"make","aliases":[],"flags":[{"name":"contentsFrom","flagName":"contents-from","required":false,"type":"string","description":"Use the contents of the given file as the generated output"},{"name":"force","flagName":"force","required":false,"type":"boolean","description":"Forcefully overwrite existing files","alias":"f"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the service","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/service.js"},{"commandName":"make:test","description":"Create a new Japa test file in tests/. Use --suite to specify the test suite (unit, functional, etc.)","help":"","namespace":"make","aliases":[],"flags":[{"name":"suite","flagName":"suite","required":false,"type":"string","description":"The suite for which to create the test file","alias":"s"},{"name":"contentsFrom","flagName":"contents-from","required":false,"type":"string","description":"Use the contents of the given file as the generated output"},{"name":"force","flagName":"force","required":false,"type":"boolean","description":"Forcefully overwrite existing files","alias":"f"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the test file","type":"string"}],"options":{},"filePath":"make/test.js"},{"commandName":"make:transformer","description":"Create a new transformer class in app/transformers for serializing data in API responses","help":"","namespace":"make","aliases":[],"flags":[{"name":"contentsFrom","flagName":"contents-from","required":false,"type":"string","description":"Use the contents of the given file as the generated output"},{"name":"force","flagName":"force","required":false,"type":"boolean","description":"Forcefully overwrite existing files","alias":"f"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Entity name for which to generate the transformer","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/transformer.js"},{"commandName":"make:validator","description":"Create a new VineJS validator file in app/validators. Use --resource to generate both create and update validation schemas","help":"","namespace":"make","aliases":[],"flags":[{"name":"resource","flagName":"resource","required":false,"type":"boolean","description":"Create a file with pre-defined validators for create and update actions"},{"name":"contentsFrom","flagName":"contents-from","required":false,"type":"string","description":"Use the contents of the given file as the generated output"},{"name":"force","flagName":"force","required":false,"type":"boolean","description":"Forcefully overwrite existing files","alias":"f"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the validator file","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/validator.js"},{"commandName":"make:view","description":"Create a new Edge.js template file in resources/views","help":"","namespace":"make","aliases":[],"flags":[{"name":"contentsFrom","flagName":"contents-from","required":false,"type":"string","description":"Use the contents of the given file as the generated output"},{"name":"force","flagName":"force","required":false,"type":"boolean","description":"Forcefully overwrite existing files","alias":"f"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the template","type":"string"}],"options":{},"filePath":"make/view.js"},{"commandName":"repl","description":"Start an interactive REPL session with the application booted and IoC container available","help":"","namespace":null,"aliases":[],"flags":[],"args":[],"options":{"startApp":true,"staysAlive":true},"filePath":"repl.js"},{"commandName":"serve","description":"Start the development HTTP server. Use --watch for auto-restart on file change or --hmr for hot module replacement","help":["Start the development server with file watcher using the following command.","```","{{ binaryName }} serve --watch","```","","You can also start the server with HMR support using the following command.","```","{{ binaryName }} serve --hmr","```","","The assets bundler dev server runs automatically after detecting vite config or webpack config files","You may pass vite CLI args using the --assets-args command line flag.","```","{{ binaryName }} serve --assets-args=\"--debug --base=/public\"","```"],"namespace":null,"aliases":[],"flags":[{"name":"hmr","flagName":"hmr","required":false,"type":"boolean","description":"Start the server with HMR support"},{"name":"watch","flagName":"watch","required":false,"type":"boolean","description":"Watch filesystem and restart the HTTP server on file change","alias":"w"},{"name":"poll","flagName":"poll","required":false,"type":"boolean","description":"Use polling to detect filesystem changes","alias":"p"},{"name":"clear","flagName":"clear","required":false,"type":"boolean","description":"Clear the terminal for new logs after file change","showNegatedVariantInHelp":true,"default":true}],"args":[],"options":{"staysAlive":true},"filePath":"serve.js"},{"commandName":"test","description":"Run tests using Japa test runner. Supports filtering by suite, file, tag, and group. Use --watch for re-runs on file change","help":"","namespace":null,"aliases":[],"flags":[{"name":"files","flagName":"files","required":false,"type":"array","description":"Filter tests by the filename"},{"name":"tags","flagName":"tags","required":false,"type":"array","description":"Filter tests by tags"},{"name":"groups","flagName":"groups","required":false,"type":"array","description":"Filter tests by parent group title"},{"name":"tests","flagName":"tests","required":false,"type":"array","description":"Filter tests by test title"},{"name":"reporters","flagName":"reporters","required":false,"type":"array","description":"Activate one or more test reporters"},{"name":"watch","flagName":"watch","required":false,"type":"boolean","description":"Watch filesystem and re-run tests on file change"},{"name":"poll","flagName":"poll","required":false,"type":"boolean","description":"Use polling to detect filesystem changes"},{"name":"timeout","flagName":"timeout","required":false,"type":"number","description":"Define default timeout for all tests"},{"name":"retries","flagName":"retries","required":false,"type":"number","description":"Define default retries for all tests"},{"name":"failed","flagName":"failed","required":false,"type":"boolean","description":"Execute tests failed during the last run"},{"name":"clear","flagName":"clear","required":false,"type":"boolean","description":"Clear the terminal for new logs after file change","showNegatedVariantInHelp":true,"default":true}],"args":[{"name":"suites","argumentName":"suites","required":false,"description":"Mention suite names to run tests for selected suites","type":"spread"}],"options":{"allowUnknownFlags":true,"staysAlive":true},"filePath":"test.js"}],"version":1}
@@ -1,4 +0,0 @@
1
- import { CommandMetaData, Command } from '@adonisjs/ace/types';
2
-
3
- export function getMetaData(): Promise<CommandMetaData[]>
4
- export function getCommand(metaData: CommandMetaData): Promise<Command | null>
@@ -1,36 +0,0 @@
1
- import { readFile } from 'node:fs/promises'
2
-
3
- /**
4
- * In-memory cache of commands after they have been loaded
5
- */
6
- let commandsMetaData
7
-
8
- /**
9
- * Reads the commands from the "./commands.json" file. Since, the commands.json
10
- * file is generated automatically, we do not have to validate its contents
11
- */
12
- export async function getMetaData() {
13
- if (commandsMetaData) {
14
- return commandsMetaData
15
- }
16
-
17
- const commandsIndex = await readFile(new URL('./commands.json', import.meta.url), 'utf-8')
18
- commandsMetaData = JSON.parse(commandsIndex).commands
19
-
20
- return commandsMetaData
21
- }
22
-
23
- /**
24
- * Imports the command by lookingup its path from the commands
25
- * metadata
26
- */
27
- export async function getCommand(metaData) {
28
- const commands = await getMetaData()
29
- const command = commands.find(({ commandName }) => metaData.commandName === commandName)
30
- if (!command) {
31
- return null
32
- }
33
-
34
- const { default: commandConstructor } = await import(new URL(command.filePath, import.meta.url).href)
35
- return commandConstructor
36
- }