@adonisjs/core 7.5.1 → 7.6.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/build/commands/add.js +1 -1
- package/build/commands/build.js +1 -1
- package/build/commands/commands.json +1 -0
- package/build/commands/configure.js +1 -1
- package/build/commands/eject.js +1 -1
- package/build/commands/env/add.js +1 -1
- package/build/commands/generate_key.js +1 -1
- package/build/commands/list/routes.js +1 -1
- package/build/commands/main.d.ts +4 -0
- package/build/commands/main.js +36 -0
- package/build/commands/make/command.js +1 -1
- package/build/commands/make/controller.js +1 -1
- package/build/commands/make/event.js +1 -1
- package/build/commands/make/exception.js +1 -1
- package/build/commands/make/listener.js +1 -1
- package/build/commands/make/middleware.js +1 -1
- package/build/commands/make/preload.js +1 -1
- package/build/commands/make/provider.js +1 -1
- package/build/commands/make/service.js +1 -1
- package/build/commands/make/test.js +1 -1
- package/build/commands/make/transformer.js +1 -1
- package/build/commands/make/validator.js +1 -1
- package/build/commands/make/view.js +1 -1
- package/build/commands/serve.js +1 -1
- package/build/commands/test.js +1 -1
- package/build/{decorate-COk3IovQ.js → decorate-JJf0EFHX.js} +1 -1
- package/build/modules/ace/codemods.d.ts +23 -2
- package/build/modules/ace/codemods.js +55 -3
- package/build/toolkit/main.js +2 -1
- package/package.json +14 -14
package/build/commands/add.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
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
|
-
import { t as __decorate } from "../decorate-
|
|
3
|
+
import { t as __decorate } from "../decorate-JJf0EFHX.js";
|
|
4
4
|
//#region commands/add.ts
|
|
5
5
|
/**
|
|
6
6
|
* The install command is used to `npm install` and `node ace configure` one or more packages
|
package/build/commands/build.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as importAssembler, r as importTypeScript } from "../utils-CeWrQT0f.js";
|
|
2
2
|
import { p as BaseCommand, u as flags } from "../main-DvUje0hm.js";
|
|
3
|
-
import { t as __decorate } from "../decorate-
|
|
3
|
+
import { t as __decorate } from "../decorate-JJf0EFHX.js";
|
|
4
4
|
//#region commands/build.ts
|
|
5
5
|
/**
|
|
6
6
|
* Create the production build by compiling TypeScript source and the
|
|
@@ -0,0 +1 @@
|
|
|
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,6 +1,6 @@
|
|
|
1
1
|
import { t as stubsRoot } from "../main-DbL06a4f.js";
|
|
2
2
|
import { o as args, p as BaseCommand, u as flags } from "../main-DvUje0hm.js";
|
|
3
|
-
import { t as __decorate } from "../decorate-
|
|
3
|
+
import { t as __decorate } from "../decorate-JJf0EFHX.js";
|
|
4
4
|
import { RuntimeException } from "@poppinss/utils/exception";
|
|
5
5
|
//#region commands/configure.ts
|
|
6
6
|
/**
|
package/build/commands/eject.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as stringHelpers } from "../string-DUpLZV_t.js";
|
|
2
2
|
import { o as args, p as BaseCommand, u as flags } from "../main-DvUje0hm.js";
|
|
3
|
-
import { t as __decorate } from "../decorate-
|
|
3
|
+
import { t as __decorate } from "../decorate-JJf0EFHX.js";
|
|
4
4
|
//#region commands/eject.ts
|
|
5
5
|
/**
|
|
6
6
|
* Command to eject scaffolding stubs from packages to your application root.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as stringHelpers } from "../../string-DUpLZV_t.js";
|
|
2
2
|
import { o as args, p as BaseCommand, u as flags } from "../../main-DvUje0hm.js";
|
|
3
|
-
import { t as __decorate } from "../../decorate-
|
|
3
|
+
import { t as __decorate } from "../../decorate-JJf0EFHX.js";
|
|
4
4
|
//#region commands/env/add.ts
|
|
5
5
|
const ALLOWED_TYPES = [
|
|
6
6
|
"string",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { p as BaseCommand, u as flags } from "../main-DvUje0hm.js";
|
|
2
|
-
import { t as __decorate } from "../decorate-
|
|
2
|
+
import { t as __decorate } from "../decorate-JJf0EFHX.js";
|
|
3
3
|
import string from "@poppinss/utils/string";
|
|
4
4
|
import { EnvEditor } from "@adonisjs/env/editor";
|
|
5
5
|
//#region commands/generate_key.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { o as args, p as BaseCommand, s as cliHelpers, u as flags } from "../../main-DvUje0hm.js";
|
|
2
|
-
import { t as __decorate } from "../../decorate-
|
|
2
|
+
import { t as __decorate } from "../../decorate-JJf0EFHX.js";
|
|
3
3
|
import stringWidth from "string-width";
|
|
4
4
|
import { middlewareInfo, routeInfo } from "@adonisjs/http-server/helpers";
|
|
5
5
|
//#region src/cli_formatters/routes_list.ts
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as stubsRoot } from "../../main-DbL06a4f.js";
|
|
2
2
|
import { o as args, p as BaseCommand, u as flags } from "../../main-DvUje0hm.js";
|
|
3
|
-
import { t as __decorate } from "../../decorate-
|
|
3
|
+
import { t as __decorate } from "../../decorate-JJf0EFHX.js";
|
|
4
4
|
//#region commands/make/command.ts
|
|
5
5
|
/**
|
|
6
6
|
* Command to create a new Ace command class.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as stubsRoot } from "../../main-DbL06a4f.js";
|
|
2
2
|
import { o as args, p as BaseCommand, u as flags } from "../../main-DvUje0hm.js";
|
|
3
|
-
import { t as __decorate } from "../../decorate-
|
|
3
|
+
import { t as __decorate } from "../../decorate-JJf0EFHX.js";
|
|
4
4
|
import string from "@poppinss/utils/string";
|
|
5
5
|
//#region commands/make/controller.ts
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as stubsRoot } from "../../main-DbL06a4f.js";
|
|
2
2
|
import { o as args, p as BaseCommand, u as flags } from "../../main-DvUje0hm.js";
|
|
3
|
-
import { t as __decorate } from "../../decorate-
|
|
3
|
+
import { t as __decorate } from "../../decorate-JJf0EFHX.js";
|
|
4
4
|
//#region commands/make/event.ts
|
|
5
5
|
/**
|
|
6
6
|
* Command to create a new event class.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as stubsRoot } from "../../main-DbL06a4f.js";
|
|
2
2
|
import { o as args, p as BaseCommand, u as flags } from "../../main-DvUje0hm.js";
|
|
3
|
-
import { t as __decorate } from "../../decorate-
|
|
3
|
+
import { t as __decorate } from "../../decorate-JJf0EFHX.js";
|
|
4
4
|
//#region commands/make/exception.ts
|
|
5
5
|
/**
|
|
6
6
|
* Command to create a new custom exception class.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as stubsRoot } from "../../main-DbL06a4f.js";
|
|
2
2
|
import { o as args, p as BaseCommand, u as flags } from "../../main-DvUje0hm.js";
|
|
3
|
-
import { t as __decorate } from "../../decorate-
|
|
3
|
+
import { t as __decorate } from "../../decorate-JJf0EFHX.js";
|
|
4
4
|
//#region commands/make/listener.ts
|
|
5
5
|
/**
|
|
6
6
|
* Command to create a new event listener class.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as stubsRoot } from "../../main-DbL06a4f.js";
|
|
2
2
|
import { t as stringHelpers } from "../../string-DUpLZV_t.js";
|
|
3
3
|
import { o as args, p as BaseCommand, u as flags } from "../../main-DvUje0hm.js";
|
|
4
|
-
import { t as __decorate } from "../../decorate-
|
|
4
|
+
import { t as __decorate } from "../../decorate-JJf0EFHX.js";
|
|
5
5
|
import string from "@poppinss/utils/string";
|
|
6
6
|
import { basename, extname, relative } from "node:path";
|
|
7
7
|
//#region commands/make/middleware.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as stubsRoot } from "../../main-DbL06a4f.js";
|
|
2
2
|
import { t as stringHelpers } from "../../string-DUpLZV_t.js";
|
|
3
3
|
import { o as args, p as BaseCommand, u as flags } from "../../main-DvUje0hm.js";
|
|
4
|
-
import { t as __decorate } from "../../decorate-
|
|
4
|
+
import { t as __decorate } from "../../decorate-JJf0EFHX.js";
|
|
5
5
|
import { extname, relative } from "node:path";
|
|
6
6
|
//#region commands/make/preload.ts
|
|
7
7
|
const ALLOWED_ENVIRONMENTS = [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as stubsRoot } from "../../main-DbL06a4f.js";
|
|
2
2
|
import { t as stringHelpers } from "../../string-DUpLZV_t.js";
|
|
3
3
|
import { o as args, p as BaseCommand, u as flags } from "../../main-DvUje0hm.js";
|
|
4
|
-
import { t as __decorate } from "../../decorate-
|
|
4
|
+
import { t as __decorate } from "../../decorate-JJf0EFHX.js";
|
|
5
5
|
import { extname, relative } from "node:path";
|
|
6
6
|
//#region commands/make/provider.ts
|
|
7
7
|
const ALLOWED_ENVIRONMENTS = [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as stubsRoot } from "../../main-DbL06a4f.js";
|
|
2
2
|
import { o as args, p as BaseCommand, u as flags } from "../../main-DvUje0hm.js";
|
|
3
|
-
import { t as __decorate } from "../../decorate-
|
|
3
|
+
import { t as __decorate } from "../../decorate-JJf0EFHX.js";
|
|
4
4
|
//#region commands/make/service.ts
|
|
5
5
|
/**
|
|
6
6
|
* Make a new service class
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as stubsRoot } from "../../main-DbL06a4f.js";
|
|
2
2
|
import { o as args, p as BaseCommand, u as flags } from "../../main-DvUje0hm.js";
|
|
3
|
-
import { t as __decorate } from "../../decorate-
|
|
3
|
+
import { t as __decorate } from "../../decorate-JJf0EFHX.js";
|
|
4
4
|
//#region commands/make/test.ts
|
|
5
5
|
/**
|
|
6
6
|
* Command to create a new Japa test file.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as stubsRoot } from "../../main-DbL06a4f.js";
|
|
2
2
|
import { o as args, p as BaseCommand, u as flags } from "../../main-DvUje0hm.js";
|
|
3
|
-
import { t as __decorate } from "../../decorate-
|
|
3
|
+
import { t as __decorate } from "../../decorate-JJf0EFHX.js";
|
|
4
4
|
//#region commands/make/transformer.ts
|
|
5
5
|
/**
|
|
6
6
|
* Command to create a new transformer class.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as stubsRoot } from "../../main-DbL06a4f.js";
|
|
2
2
|
import { o as args, p as BaseCommand, u as flags } from "../../main-DvUje0hm.js";
|
|
3
|
-
import { t as __decorate } from "../../decorate-
|
|
3
|
+
import { t as __decorate } from "../../decorate-JJf0EFHX.js";
|
|
4
4
|
//#region commands/make/validator.ts
|
|
5
5
|
/**
|
|
6
6
|
* Command to create a new VineJS validator file.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as stubsRoot } from "../../main-DbL06a4f.js";
|
|
2
2
|
import { o as args, p as BaseCommand, u as flags } from "../../main-DvUje0hm.js";
|
|
3
|
-
import { t as __decorate } from "../../decorate-
|
|
3
|
+
import { t as __decorate } from "../../decorate-JJf0EFHX.js";
|
|
4
4
|
//#region commands/make/view.ts
|
|
5
5
|
/**
|
|
6
6
|
* Command to create a new Edge.js template file.
|
package/build/commands/serve.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as importAssembler } from "../utils-CeWrQT0f.js";
|
|
2
2
|
import { p as BaseCommand, u as flags } from "../main-DvUje0hm.js";
|
|
3
|
-
import { t as __decorate } from "../decorate-
|
|
3
|
+
import { t as __decorate } from "../decorate-JJf0EFHX.js";
|
|
4
4
|
//#region commands/serve.ts
|
|
5
5
|
/**
|
|
6
6
|
* Serve command is used to run the AdonisJS HTTP server during development. The
|
package/build/commands/test.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as importAssembler } from "../utils-CeWrQT0f.js";
|
|
2
2
|
import { o as args, p as BaseCommand, u as flags } from "../main-DvUje0hm.js";
|
|
3
|
-
import { t as __decorate } from "../decorate-
|
|
3
|
+
import { t as __decorate } from "../decorate-JJf0EFHX.js";
|
|
4
4
|
//#region commands/test.ts
|
|
5
5
|
/**
|
|
6
6
|
* Command to run application tests using the Japa test runner.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region \0@oxc-project+runtime@0.
|
|
1
|
+
//#region \0@oxc-project+runtime@0.151.0/helpers/esm/decorate.js
|
|
2
2
|
function __decorate(decorators, target, key, desc) {
|
|
3
3
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
4
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -9,8 +9,9 @@ import { type GeneratedStub } from '../../types/app.ts';
|
|
|
9
9
|
* This class provides APIs to modify configuration files, register middleware,
|
|
10
10
|
* generate stubs, and install packages.
|
|
11
11
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
12
|
+
* Some codemods, including installPackages, rely on the optional
|
|
13
|
+
* "@adonisjs/assembler" package. defineEnvVariables, makeUsingStub,
|
|
14
|
+
* addImportAlias, and createDirectory work without it.
|
|
14
15
|
*
|
|
15
16
|
* @example
|
|
16
17
|
* ```ts
|
|
@@ -67,6 +68,26 @@ export declare class Codemods extends EventEmitter {
|
|
|
67
68
|
defineEnvVariables<T extends Record<string, number | string | boolean>>(environmentVariables: T, options?: {
|
|
68
69
|
omitFromExample?: Array<keyof T>;
|
|
69
70
|
}): Promise<void>;
|
|
71
|
+
/**
|
|
72
|
+
* Add a subpath import to the application's package.json. Existing aliases
|
|
73
|
+
* are left unchanged, even when their target differs.
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```ts
|
|
77
|
+
* await codemods.addImportAlias('#channels/*', './app/channels/*.js')
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
addImportAlias(alias: string, target: string): Promise<void>;
|
|
81
|
+
/**
|
|
82
|
+
* Create a directory relative to the application root, including missing parents.
|
|
83
|
+
* Leave an existing directory unchanged.
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* ```ts
|
|
87
|
+
* await codemods.createDirectory('app/channels')
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
createDirectory(directory: string): Promise<void>;
|
|
70
91
|
/**
|
|
71
92
|
* Returns the TsMorph project instance for advanced AST manipulations.
|
|
72
93
|
* See https://ts-morph.com/ for documentation.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as debug_default } from "../../debug-DrrWgeSu.js";
|
|
2
2
|
import { t as stringHelpers } from "../../string-DUpLZV_t.js";
|
|
3
3
|
import { isAbsolute } from "node:path";
|
|
4
|
-
import { readFile } from "node:fs/promises";
|
|
4
|
+
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
5
5
|
import { EnvEditor } from "@adonisjs/env/editor";
|
|
6
6
|
import { EventEmitter } from "node:events";
|
|
7
7
|
//#region modules/ace/codemods.ts
|
|
@@ -10,8 +10,9 @@ import { EventEmitter } from "node:events";
|
|
|
10
10
|
* This class provides APIs to modify configuration files, register middleware,
|
|
11
11
|
* generate stubs, and install packages.
|
|
12
12
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
13
|
+
* Some codemods, including installPackages, rely on the optional
|
|
14
|
+
* "@adonisjs/assembler" package. defineEnvVariables, makeUsingStub,
|
|
15
|
+
* addImportAlias, and createDirectory work without it.
|
|
15
16
|
*
|
|
16
17
|
* @example
|
|
17
18
|
* ```ts
|
|
@@ -124,6 +125,57 @@ var Codemods = class extends EventEmitter {
|
|
|
124
125
|
this.#cliLogger.action("update .env file").succeeded();
|
|
125
126
|
}
|
|
126
127
|
/**
|
|
128
|
+
* Add a subpath import to the application's package.json. Existing aliases
|
|
129
|
+
* are left unchanged, even when their target differs.
|
|
130
|
+
*
|
|
131
|
+
* @example
|
|
132
|
+
* ```ts
|
|
133
|
+
* await codemods.addImportAlias('#channels/*', './app/channels/*.js')
|
|
134
|
+
* ```
|
|
135
|
+
*/
|
|
136
|
+
async addImportAlias(alias, target) {
|
|
137
|
+
const action = this.#cliLogger.action("update package.json file");
|
|
138
|
+
try {
|
|
139
|
+
const path = this.#app.makePath("package.json");
|
|
140
|
+
const contents = await readFile(path, "utf-8");
|
|
141
|
+
const bom = contents.startsWith("") ? "" : "";
|
|
142
|
+
const packageJson = JSON.parse(contents.slice(bom.length));
|
|
143
|
+
packageJson.imports ??= {};
|
|
144
|
+
if (Object.hasOwn(packageJson.imports, alias)) {
|
|
145
|
+
action.skipped(`import alias "${alias}" already exists`);
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
packageJson.imports[alias] = target;
|
|
149
|
+
const indent = contents.match(/^([ \t]+)"[^"\n]+"\s*:/m)?.[1] ?? (contents.includes("\n") ? " " : "");
|
|
150
|
+
const newline = contents.includes("\r\n") ? "\r\n" : "\n";
|
|
151
|
+
const updated = JSON.stringify(packageJson, null, indent).replaceAll("\n", newline);
|
|
152
|
+
await writeFile(path, bom + updated + (contents.endsWith("\n") ? newline : ""));
|
|
153
|
+
action.succeeded();
|
|
154
|
+
} catch (error) {
|
|
155
|
+
this.emit("error", error);
|
|
156
|
+
action.failed(error.message);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Create a directory relative to the application root, including missing parents.
|
|
161
|
+
* Leave an existing directory unchanged.
|
|
162
|
+
*
|
|
163
|
+
* @example
|
|
164
|
+
* ```ts
|
|
165
|
+
* await codemods.createDirectory('app/channels')
|
|
166
|
+
* ```
|
|
167
|
+
*/
|
|
168
|
+
async createDirectory(directory) {
|
|
169
|
+
const action = this.#cliLogger.action(`create ${directory} directory`);
|
|
170
|
+
try {
|
|
171
|
+
if (await mkdir(this.#app.makePath(directory), { recursive: true })) action.succeeded();
|
|
172
|
+
else action.skipped("directory already exists");
|
|
173
|
+
} catch (error) {
|
|
174
|
+
this.emit("error", error);
|
|
175
|
+
action.failed(error.message);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
127
179
|
* Returns the TsMorph project instance for advanced AST manipulations.
|
|
128
180
|
* See https://ts-morph.com/ for documentation.
|
|
129
181
|
*
|
package/build/toolkit/main.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { t as __decorate } from "../decorate-
|
|
2
|
+
import { t as __decorate } from "../decorate-JJf0EFHX.js";
|
|
3
3
|
import { BaseCommand, HelpCommand, IndexGenerator, Kernel, ListLoader, args } from "@adonisjs/ace";
|
|
4
4
|
import { join } from "node:path";
|
|
5
5
|
//#region toolkit/commands/index_commands.ts
|
|
@@ -32,5 +32,6 @@ kernel.on("help", async (command, $kernel, parsed) => {
|
|
|
32
32
|
return $kernel.shortcircuit();
|
|
33
33
|
});
|
|
34
34
|
await kernel.handle(process.argv.splice(2));
|
|
35
|
+
process.exitCode = kernel.exitCode;
|
|
35
36
|
//#endregion
|
|
36
37
|
export {};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adonisjs/core",
|
|
3
3
|
"description": "Core of AdonisJS",
|
|
4
|
-
"version": "7.
|
|
4
|
+
"version": "7.6.0",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=24.0.0"
|
|
7
7
|
},
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"index:commands": "node --import=@poppinss/ts-exec toolkit/main.js index build/commands"
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|
|
87
|
-
"@adonisjs/assembler": "^8.5.
|
|
87
|
+
"@adonisjs/assembler": "^8.5.2",
|
|
88
88
|
"@adonisjs/encryption": "^6.0.2",
|
|
89
89
|
"@adonisjs/eslint-config": "^3.1.0",
|
|
90
90
|
"@adonisjs/prettier-config": "^1.5.0",
|
|
@@ -95,8 +95,8 @@
|
|
|
95
95
|
"@japa/runner": "^5.3.0",
|
|
96
96
|
"@japa/snapshot": "^2.0.10",
|
|
97
97
|
"@poppinss/ts-exec": "^1.4.4",
|
|
98
|
-
"@release-it/conventional-changelog": "^12.0.
|
|
99
|
-
"@types/node": "~26.2
|
|
98
|
+
"@release-it/conventional-changelog": "^12.0.2",
|
|
99
|
+
"@types/node": "~26.6.2",
|
|
100
100
|
"@types/pretty-hrtime": "^1.0.3",
|
|
101
101
|
"@types/sinon": "^22.0.0",
|
|
102
102
|
"@types/supertest": "^7.2.1",
|
|
@@ -109,32 +109,32 @@
|
|
|
109
109
|
"cross-env": "^10.1.0",
|
|
110
110
|
"del-cli": "^7.0.0",
|
|
111
111
|
"edge.js": "^6.5.1",
|
|
112
|
-
"eslint": "^10.
|
|
112
|
+
"eslint": "^10.11.0",
|
|
113
113
|
"execa": "^10.0.1",
|
|
114
114
|
"get-port": "^7.2.0",
|
|
115
115
|
"pino-pretty": "^13.1.3",
|
|
116
|
-
"prettier": "^3.9.
|
|
117
|
-
"release-it": "^21.0
|
|
116
|
+
"prettier": "^3.9.9",
|
|
117
|
+
"release-it": "^21.1.0",
|
|
118
118
|
"sinon": "^22.1.0",
|
|
119
|
-
"supertest": "^7.
|
|
119
|
+
"supertest": "^7.3.0",
|
|
120
120
|
"test-console": "^2.0.0",
|
|
121
121
|
"timekeeper": "^2.3.1",
|
|
122
|
-
"tsdown": "^0.
|
|
122
|
+
"tsdown": "^0.23.0",
|
|
123
123
|
"typedoc": "^0.28.20",
|
|
124
124
|
"typescript": "^6.0.3",
|
|
125
125
|
"youch": "^4.1.1"
|
|
126
126
|
},
|
|
127
127
|
"dependencies": {
|
|
128
|
-
"@adonisjs/ace": "^14.1.
|
|
128
|
+
"@adonisjs/ace": "^14.1.1",
|
|
129
129
|
"@adonisjs/application": "^9.1.0",
|
|
130
130
|
"@adonisjs/bodyparser": "^11.0.4",
|
|
131
131
|
"@adonisjs/config": "^6.1.0",
|
|
132
|
-
"@adonisjs/env": "^7.
|
|
132
|
+
"@adonisjs/env": "^7.1.0",
|
|
133
133
|
"@adonisjs/events": "^10.2.0",
|
|
134
|
-
"@adonisjs/fold": "^11.
|
|
134
|
+
"@adonisjs/fold": "^11.1.0",
|
|
135
135
|
"@adonisjs/hash": "^10.1.1",
|
|
136
136
|
"@adonisjs/health": "^3.1.0",
|
|
137
|
-
"@adonisjs/http-server": "^9.
|
|
137
|
+
"@adonisjs/http-server": "^9.3.1",
|
|
138
138
|
"@adonisjs/http-transformers": "^2.3.1",
|
|
139
139
|
"@adonisjs/logger": "^7.1.1",
|
|
140
140
|
"@adonisjs/repl": "^5.0.0",
|
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
"@poppinss/colors": "^4.1.6",
|
|
143
143
|
"@poppinss/dumper": "^0.7.0",
|
|
144
144
|
"@poppinss/macroable": "^1.1.2",
|
|
145
|
-
"@poppinss/utils": "^7.
|
|
145
|
+
"@poppinss/utils": "^7.1.1",
|
|
146
146
|
"@sindresorhus/is": "^8.1.0",
|
|
147
147
|
"@types/he": "^1.2.3",
|
|
148
148
|
"error-stack-parser-es": "^2.0.1",
|