@adonisjs/core 6.19.0 → 7.0.0-next.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.
- package/build/commands/add.d.ts +36 -5
- package/build/commands/add.js +24 -60
- package/build/commands/build.d.ts +23 -3
- package/build/commands/build.js +22 -36
- package/build/commands/commands.json +1 -1
- package/build/commands/configure.d.ts +35 -12
- package/build/commands/configure.js +39 -12
- package/build/commands/eject.d.ts +28 -3
- package/build/commands/eject.js +24 -5
- package/build/commands/env/add.d.ts +41 -4
- package/build/commands/env/add.js +32 -5
- package/build/commands/generate_key.d.ts +20 -1
- package/build/commands/generate_key.js +14 -1
- package/build/commands/inspect_rcfile.d.ts +20 -2
- package/build/commands/inspect_rcfile.js +20 -2
- package/build/commands/list/routes.d.ts +33 -11
- package/build/commands/list/routes.js +28 -5
- package/build/commands/make/command.d.ts +26 -3
- package/build/commands/make/command.js +25 -5
- package/build/commands/make/controller.d.ts +35 -2
- package/build/commands/make/controller.js +20 -2
- package/build/commands/make/event.d.ts +30 -4
- package/build/commands/make/event.js +27 -4
- package/build/commands/make/exception.d.ts +30 -4
- package/build/commands/make/exception.js +27 -4
- package/build/commands/make/listener.d.ts +38 -5
- package/build/commands/make/listener.js +32 -5
- package/build/commands/make/middleware.d.ts +25 -2
- package/build/commands/make/middleware.js +21 -4
- package/build/commands/make/preload.d.ts +31 -4
- package/build/commands/make/preload.js +28 -8
- package/build/commands/make/provider.d.ts +32 -3
- package/build/commands/make/provider.js +29 -7
- package/build/commands/make/service.d.ts +21 -2
- package/build/commands/make/service.js +18 -2
- package/build/commands/make/test.d.ts +27 -4
- package/build/commands/make/test.js +36 -8
- package/build/commands/make/transformer.d.ts +43 -0
- package/build/commands/make/transformer.js +65 -0
- package/build/commands/make/validator.d.ts +36 -5
- package/build/commands/make/validator.js +30 -5
- package/build/commands/make/view.d.ts +26 -3
- package/build/commands/make/view.js +24 -4
- package/build/commands/repl.d.ts +24 -4
- package/build/commands/repl.js +23 -3
- package/build/commands/serve.d.ts +38 -4
- package/build/commands/serve.js +34 -43
- package/build/commands/test.d.ts +68 -7
- package/build/commands/test.js +39 -37
- package/build/factories/core/ace.d.ts +31 -4
- package/build/factories/core/ace.js +20 -4
- package/build/factories/core/ignitor.d.ts +80 -9
- package/build/factories/core/ignitor.js +84 -13
- package/build/factories/core/main.d.ts +3 -3
- package/build/factories/core/main.js +3 -3
- package/build/factories/core/test_utils.d.ts +32 -4
- package/build/factories/core/test_utils.js +21 -4
- package/build/factories/stubs.d.ts +54 -5
- package/build/factories/stubs.js +55 -6
- package/build/index.d.ts +5 -4
- package/build/index.js +13 -9
- package/build/modules/ace/codemods.d.ts +71 -11
- package/build/modules/ace/codemods.js +90 -22
- package/build/modules/ace/commands.d.ts +48 -13
- package/build/modules/ace/commands.js +45 -10
- package/build/modules/ace/create_kernel.d.ts +19 -8
- package/build/modules/ace/create_kernel.js +19 -8
- package/build/modules/ace/kernel.d.ts +18 -4
- package/build/modules/ace/kernel.js +17 -3
- package/build/modules/ace/main.d.ts +3 -3
- package/build/modules/ace/main.js +3 -3
- package/build/modules/dumper/define_config.d.ts +25 -4
- package/build/modules/dumper/define_config.js +23 -2
- package/build/modules/dumper/dumper.d.ts +82 -12
- package/build/modules/dumper/dumper.js +82 -12
- package/build/modules/dumper/errors.d.ts +31 -10
- package/build/modules/dumper/errors.js +28 -7
- package/build/modules/dumper/main.d.ts +3 -3
- package/build/modules/dumper/main.js +3 -3
- package/build/modules/dumper/plugins/edge.d.ts +1 -1
- package/build/modules/hash/define_config.d.ts +53 -8
- package/build/modules/hash/define_config.js +51 -6
- package/build/modules/hash/main.d.ts +1 -1
- package/build/modules/hash/main.js +1 -1
- package/build/modules/http/main.d.ts +1 -1
- package/build/modules/http/main.js +1 -1
- package/build/modules/http/request_validator.d.ts +36 -9
- package/build/modules/http/request_validator.js +32 -5
- package/build/modules/transformers/main.d.ts +1 -0
- package/build/modules/transformers/main.js +9 -0
- package/build/providers/app_provider.d.ts +173 -1
- package/build/providers/app_provider.js +204 -8
- package/build/providers/edge_provider.d.ts +31 -2
- package/build/providers/edge_provider.js +31 -2
- package/build/providers/hash_provider.d.ts +38 -1
- package/build/providers/hash_provider.js +40 -3
- package/build/providers/repl_provider.d.ts +40 -1
- package/build/providers/repl_provider.js +52 -2
- package/build/providers/vinejs_provider.d.ts +32 -5
- package/build/providers/vinejs_provider.js +31 -4
- package/build/services/ace.d.ts +1 -1
- package/build/services/ace.js +1 -1
- package/build/services/app.d.ts +1 -1
- package/build/services/config.d.ts +1 -1
- package/build/services/config.js +1 -1
- package/build/services/dumper.js +1 -1
- package/build/services/emitter.d.ts +1 -1
- package/build/services/emitter.js +1 -1
- package/build/services/encryption.d.ts +1 -1
- package/build/services/encryption.js +1 -1
- package/build/services/hash.d.ts +1 -1
- package/build/services/hash.js +1 -1
- package/build/services/logger.d.ts +1 -1
- package/build/services/logger.js +1 -1
- package/build/services/repl.d.ts +1 -1
- package/build/services/repl.js +1 -1
- package/build/services/router.d.ts +1 -1
- package/build/services/router.js +1 -1
- package/build/services/server.d.ts +1 -1
- package/build/services/server.js +1 -1
- package/build/services/test_utils.d.ts +1 -1
- package/build/services/test_utils.js +1 -1
- package/build/services/url_builder.d.ts +4 -0
- package/build/services/url_builder.js +21 -0
- package/build/src/assembler_hooks/index_entities.d.ts +37 -0
- package/build/src/assembler_hooks/index_entities.js +106 -0
- package/build/src/cli_formatters/routes_list.d.ts +24 -12
- package/build/src/cli_formatters/routes_list.js +43 -46
- package/build/src/config_provider.d.ts +48 -3
- package/build/src/config_provider.js +47 -2
- package/build/src/debug.d.ts +15 -0
- package/build/src/debug.js +15 -0
- package/build/src/exceptions.d.ts +41 -1
- package/build/src/exceptions.js +41 -1
- package/build/src/helpers/assert.d.ts +47 -1
- package/build/src/helpers/assert.js +47 -1
- package/build/src/helpers/is.d.ts +21 -0
- package/build/src/helpers/is.js +21 -0
- package/build/src/helpers/main.d.ts +48 -5
- package/build/src/helpers/main.js +48 -5
- package/build/src/helpers/string.d.ts +89 -9
- package/build/src/helpers/string.js +21 -2
- package/build/src/helpers/types.d.ts +97 -2
- package/build/src/helpers/types.js +96 -2
- package/build/src/helpers/verification_token.d.ts +22 -1
- package/build/src/helpers/verification_token.js +24 -2
- package/build/src/ignitor/ace.d.ts +23 -3
- package/build/src/ignitor/ace.js +21 -1
- package/build/src/ignitor/http.d.ts +16 -3
- package/build/src/ignitor/http.js +16 -3
- package/build/src/ignitor/main.d.ts +29 -6
- package/build/src/ignitor/main.js +30 -7
- package/build/src/ignitor/test.d.ts +26 -3
- package/build/src/ignitor/test.js +24 -1
- package/build/src/test_utils/http.d.ts +19 -3
- package/build/src/test_utils/http.js +24 -3
- package/build/src/test_utils/main.d.ts +22 -4
- package/build/src/test_utils/main.js +21 -3
- package/build/src/types.d.ts +283 -26
- package/build/src/utils.d.ts +60 -0
- package/build/src/utils.js +104 -0
- package/build/src/vine.d.ts +24 -1
- package/build/src/vine.js +27 -1
- package/build/stubs/main.js +1 -2
- package/build/stubs/make/transformer/main.stub +18 -0
- package/build/toolkit/main.js +1 -1
- package/build/types/common.d.ts +1 -0
- package/build/types/common.js +9 -0
- package/build/types/helpers.d.ts +2 -1
- package/build/types/http.d.ts +1 -0
- package/build/types/transformers.d.ts +1 -0
- package/build/types/transformers.js +9 -0
- package/package.json +55 -52
- package/build/src/helpers/parse_binding_reference.d.ts +0 -45
- package/build/src/helpers/parse_binding_reference.js +0 -83
- package/build/src/internal_helpers.d.ts +0 -15
- package/build/src/internal_helpers.js +0 -63
|
@@ -1,12 +1,37 @@
|
|
|
1
|
-
import { BaseCommand } from '../modules/ace/main.
|
|
1
|
+
import { BaseCommand } from '../modules/ace/main.ts';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* Command to eject scaffolding stubs from packages to your application root.
|
|
4
|
+
* This allows you to customize templates used by make commands and other
|
|
5
|
+
* code generation features by copying them to your local application.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```
|
|
9
|
+
* ace eject make/controller
|
|
10
|
+
* ace eject make/controller --pkg=@adonisjs/lucid
|
|
11
|
+
* ace eject stubs/
|
|
12
|
+
* ```
|
|
5
13
|
*/
|
|
6
14
|
export default class Eject extends BaseCommand {
|
|
15
|
+
/**
|
|
16
|
+
* The command name
|
|
17
|
+
*/
|
|
7
18
|
static commandName: string;
|
|
19
|
+
/**
|
|
20
|
+
* The command description
|
|
21
|
+
*/
|
|
8
22
|
static description: string;
|
|
23
|
+
/**
|
|
24
|
+
* Path to the stubs directory or a single stub file to eject
|
|
25
|
+
*/
|
|
9
26
|
stubPath: string;
|
|
27
|
+
/**
|
|
28
|
+
* Package name to search for stubs. Defaults to @adonisjs/core
|
|
29
|
+
*/
|
|
10
30
|
pkg: string;
|
|
31
|
+
/**
|
|
32
|
+
* Execute the command to eject stubs from the specified package.
|
|
33
|
+
* Copies the stubs to the application root and logs success messages
|
|
34
|
+
* for each ejected file.
|
|
35
|
+
*/
|
|
11
36
|
run(): Promise<void>;
|
|
12
37
|
}
|
package/build/commands/eject.js
CHANGED
|
@@ -12,22 +12,41 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
12
12
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
13
13
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
14
14
|
};
|
|
15
|
-
import {
|
|
16
|
-
import
|
|
15
|
+
import { args, BaseCommand, flags } from "../modules/ace/main.js";
|
|
16
|
+
import stringHelpers from "../src/helpers/string.js";
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
18
|
+
* Command to eject scaffolding stubs from packages to your application root.
|
|
19
|
+
* This allows you to customize templates used by make commands and other
|
|
20
|
+
* code generation features by copying them to your local application.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```
|
|
24
|
+
* ace eject make/controller
|
|
25
|
+
* ace eject make/controller --pkg=@adonisjs/lucid
|
|
26
|
+
* ace eject stubs/
|
|
27
|
+
* ```
|
|
20
28
|
*/
|
|
21
29
|
export default class Eject extends BaseCommand {
|
|
30
|
+
/**
|
|
31
|
+
* The command name
|
|
32
|
+
*/
|
|
22
33
|
static commandName = 'eject';
|
|
34
|
+
/**
|
|
35
|
+
* The command description
|
|
36
|
+
*/
|
|
23
37
|
static description = 'Eject scaffolding stubs to your application root';
|
|
38
|
+
/**
|
|
39
|
+
* Execute the command to eject stubs from the specified package.
|
|
40
|
+
* Copies the stubs to the application root and logs success messages
|
|
41
|
+
* for each ejected file.
|
|
42
|
+
*/
|
|
24
43
|
async run() {
|
|
25
44
|
const stubs = await this.app.stubs.create();
|
|
26
45
|
const copied = await stubs.copy(this.stubPath, {
|
|
27
46
|
pkg: this.pkg,
|
|
28
47
|
});
|
|
29
48
|
copied.forEach((stubPath) => {
|
|
30
|
-
this.logger.success(`eject ${
|
|
49
|
+
this.logger.success(`eject ${stringHelpers.toUnixSlash(this.app.relativePath(stubPath))}`);
|
|
31
50
|
});
|
|
32
51
|
}
|
|
33
52
|
}
|
|
@@ -1,20 +1,57 @@
|
|
|
1
|
-
import { CommandOptions } from '../../types/ace.
|
|
2
|
-
import { BaseCommand } from '../../modules/ace/main.
|
|
1
|
+
import { type CommandOptions } from '../../types/ace.ts';
|
|
2
|
+
import { BaseCommand } from '../../modules/ace/main.ts';
|
|
3
3
|
declare const ALLOWED_TYPES: readonly ["string", "boolean", "number", "enum"];
|
|
4
4
|
type AllowedTypes = (typeof ALLOWED_TYPES)[number];
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* Command to add a new environment variable to the application.
|
|
7
|
+
* Updates .env, .env.example, and start/env.ts files with the new variable,
|
|
8
|
+
* including appropriate validation schema based on the variable type.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```
|
|
12
|
+
* ace env:add
|
|
13
|
+
* ace env:add DATABASE_URL postgres://localhost:5432/mydb
|
|
14
|
+
* ace env:add API_KEY secret --type=string
|
|
15
|
+
* ace env:add PORT 3333 --type=number
|
|
16
|
+
* ace env:add DEBUG true --type=boolean
|
|
17
|
+
* ace env:add LOG_LEVEL info --type=enum --enum-values=debug,info,warn,error
|
|
18
|
+
* ```
|
|
8
19
|
*/
|
|
9
20
|
export default class EnvAdd extends BaseCommand {
|
|
10
21
|
#private;
|
|
22
|
+
/**
|
|
23
|
+
* The command name
|
|
24
|
+
*/
|
|
11
25
|
static commandName: string;
|
|
26
|
+
/**
|
|
27
|
+
* The command description
|
|
28
|
+
*/
|
|
12
29
|
static description: string;
|
|
30
|
+
/**
|
|
31
|
+
* Command options configuration.
|
|
32
|
+
* Allows unknown flags to be passed through.
|
|
33
|
+
*/
|
|
13
34
|
static options: CommandOptions;
|
|
35
|
+
/**
|
|
36
|
+
* Environment variable name (will be converted to SCREAMING_SNAKE_CASE)
|
|
37
|
+
*/
|
|
14
38
|
name: string;
|
|
39
|
+
/**
|
|
40
|
+
* Environment variable value
|
|
41
|
+
*/
|
|
15
42
|
value: string;
|
|
43
|
+
/**
|
|
44
|
+
* Data type of the environment variable (string, boolean, number, enum)
|
|
45
|
+
*/
|
|
16
46
|
type: AllowedTypes;
|
|
47
|
+
/**
|
|
48
|
+
* Allowed values for enum type variables
|
|
49
|
+
*/
|
|
17
50
|
enumValues: string[];
|
|
51
|
+
/**
|
|
52
|
+
* Execute the command to add a new environment variable.
|
|
53
|
+
* Prompts for missing values, validates inputs, and updates all relevant files.
|
|
54
|
+
*/
|
|
18
55
|
run(): Promise<void>;
|
|
19
56
|
}
|
|
20
57
|
export {};
|
|
@@ -12,25 +12,52 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
12
12
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
13
13
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
14
14
|
};
|
|
15
|
-
import stringHelpers from
|
|
16
|
-
import { args, BaseCommand, flags } from
|
|
15
|
+
import stringHelpers from "../../src/helpers/string.js";
|
|
16
|
+
import { args, BaseCommand, flags } from "../../modules/ace/main.js";
|
|
17
17
|
const ALLOWED_TYPES = ['string', 'boolean', 'number', 'enum'];
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
19
|
+
* Command to add a new environment variable to the application.
|
|
20
|
+
* Updates .env, .env.example, and start/env.ts files with the new variable,
|
|
21
|
+
* including appropriate validation schema based on the variable type.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```
|
|
25
|
+
* ace env:add
|
|
26
|
+
* ace env:add DATABASE_URL postgres://localhost:5432/mydb
|
|
27
|
+
* ace env:add API_KEY secret --type=string
|
|
28
|
+
* ace env:add PORT 3333 --type=number
|
|
29
|
+
* ace env:add DEBUG true --type=boolean
|
|
30
|
+
* ace env:add LOG_LEVEL info --type=enum --enum-values=debug,info,warn,error
|
|
31
|
+
* ```
|
|
21
32
|
*/
|
|
22
33
|
export default class EnvAdd extends BaseCommand {
|
|
34
|
+
/**
|
|
35
|
+
* The command name
|
|
36
|
+
*/
|
|
23
37
|
static commandName = 'env:add';
|
|
38
|
+
/**
|
|
39
|
+
* The command description
|
|
40
|
+
*/
|
|
24
41
|
static description = 'Add a new environment variable';
|
|
42
|
+
/**
|
|
43
|
+
* Command options configuration.
|
|
44
|
+
* Allows unknown flags to be passed through.
|
|
45
|
+
*/
|
|
25
46
|
static options = {
|
|
26
47
|
allowUnknownFlags: true,
|
|
27
48
|
};
|
|
28
49
|
/**
|
|
29
|
-
* Validate the type
|
|
50
|
+
* Validate that the provided type is one of the allowed types.
|
|
51
|
+
*
|
|
52
|
+
* @returns True if the type is valid, false otherwise
|
|
30
53
|
*/
|
|
31
54
|
#isTypeFlagValid() {
|
|
32
55
|
return ALLOWED_TYPES.includes(this.type);
|
|
33
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* Execute the command to add a new environment variable.
|
|
59
|
+
* Prompts for missing values, validates inputs, and updates all relevant files.
|
|
60
|
+
*/
|
|
34
61
|
async run() {
|
|
35
62
|
/**
|
|
36
63
|
* Prompt for missing name
|
|
@@ -1,12 +1,31 @@
|
|
|
1
|
-
import { BaseCommand } from '../modules/ace/main.
|
|
1
|
+
import { BaseCommand } from '../modules/ace/main.ts';
|
|
2
2
|
/**
|
|
3
3
|
* The generate key command is used to generate the app key
|
|
4
4
|
* and write it inside the .env file.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```
|
|
8
|
+
* ace generate:key
|
|
9
|
+
* ace generate:key --show
|
|
10
|
+
* ace generate:key --force
|
|
11
|
+
* ```
|
|
5
12
|
*/
|
|
6
13
|
export default class GenerateKey extends BaseCommand {
|
|
14
|
+
/**
|
|
15
|
+
* The command name
|
|
16
|
+
*/
|
|
7
17
|
static commandName: string;
|
|
18
|
+
/**
|
|
19
|
+
* The command description
|
|
20
|
+
*/
|
|
8
21
|
static description: string;
|
|
22
|
+
/**
|
|
23
|
+
* Display the key on the terminal, instead of writing it to .env file
|
|
24
|
+
*/
|
|
9
25
|
show: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Force update .env file in production environment
|
|
28
|
+
*/
|
|
10
29
|
force: boolean;
|
|
11
30
|
run(): Promise<void>;
|
|
12
31
|
}
|
|
@@ -14,13 +14,26 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
14
14
|
};
|
|
15
15
|
import string from '@poppinss/utils/string';
|
|
16
16
|
import { EnvEditor } from '@adonisjs/env/editor';
|
|
17
|
-
import { BaseCommand, flags } from
|
|
17
|
+
import { BaseCommand, flags } from "../modules/ace/main.js";
|
|
18
18
|
/**
|
|
19
19
|
* The generate key command is used to generate the app key
|
|
20
20
|
* and write it inside the .env file.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```
|
|
24
|
+
* ace generate:key
|
|
25
|
+
* ace generate:key --show
|
|
26
|
+
* ace generate:key --force
|
|
27
|
+
* ```
|
|
21
28
|
*/
|
|
22
29
|
export default class GenerateKey extends BaseCommand {
|
|
30
|
+
/**
|
|
31
|
+
* The command name
|
|
32
|
+
*/
|
|
23
33
|
static commandName = 'generate:key';
|
|
34
|
+
/**
|
|
35
|
+
* The command description
|
|
36
|
+
*/
|
|
24
37
|
static description = 'Generate a cryptographically secure random application key';
|
|
25
38
|
async run() {
|
|
26
39
|
let writeToFile = process.env.NODE_ENV !== 'production';
|
|
@@ -1,9 +1,27 @@
|
|
|
1
|
-
import { BaseCommand } from '../modules/ace/main.
|
|
1
|
+
import { BaseCommand } from '../modules/ace/main.ts';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Command to inspect and display the AdonisJS RC file contents with default values.
|
|
4
|
+
* The RC file contains configuration for providers, preloads, commands, and other
|
|
5
|
+
* application settings. This command formats and displays the contents in a readable JSON format.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```
|
|
9
|
+
* ace inspect:rcfile
|
|
10
|
+
* ```
|
|
4
11
|
*/
|
|
5
12
|
export default class InspectRCFile extends BaseCommand {
|
|
13
|
+
/**
|
|
14
|
+
* The command name
|
|
15
|
+
*/
|
|
6
16
|
static commandName: string;
|
|
17
|
+
/**
|
|
18
|
+
* The command description
|
|
19
|
+
*/
|
|
7
20
|
static description: string;
|
|
21
|
+
/**
|
|
22
|
+
* Execute the command to display RC file contents.
|
|
23
|
+
* Transforms provider, preload, and command entries to display their file paths
|
|
24
|
+
* as strings and formats the output as readable JSON.
|
|
25
|
+
*/
|
|
8
26
|
run(): Promise<void>;
|
|
9
27
|
}
|
|
@@ -6,13 +6,31 @@
|
|
|
6
6
|
* For the full copyright and license information, please view the LICENSE
|
|
7
7
|
* file that was distributed with this source code.
|
|
8
8
|
*/
|
|
9
|
-
import { BaseCommand } from
|
|
9
|
+
import { BaseCommand } from "../modules/ace/main.js";
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* Command to inspect and display the AdonisJS RC file contents with default values.
|
|
12
|
+
* The RC file contains configuration for providers, preloads, commands, and other
|
|
13
|
+
* application settings. This command formats and displays the contents in a readable JSON format.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```
|
|
17
|
+
* ace inspect:rcfile
|
|
18
|
+
* ```
|
|
12
19
|
*/
|
|
13
20
|
export default class InspectRCFile extends BaseCommand {
|
|
21
|
+
/**
|
|
22
|
+
* The command name
|
|
23
|
+
*/
|
|
14
24
|
static commandName = 'inspect:rcfile';
|
|
25
|
+
/**
|
|
26
|
+
* The command description
|
|
27
|
+
*/
|
|
15
28
|
static description = 'Inspect the RC file with its default values';
|
|
29
|
+
/**
|
|
30
|
+
* Execute the command to display RC file contents.
|
|
31
|
+
* Transforms provider, preload, and command entries to display their file paths
|
|
32
|
+
* as strings and formats the output as readable JSON.
|
|
33
|
+
*/
|
|
16
34
|
async run() {
|
|
17
35
|
const { raw, providers, preloads, commands, ...rest } = this.app.rcFile;
|
|
18
36
|
this.logger.log(JSON.stringify({
|
|
@@ -1,36 +1,58 @@
|
|
|
1
|
-
import type { CommandOptions } from '../../types/ace.
|
|
2
|
-
import { BaseCommand } from '../../modules/ace/main.
|
|
1
|
+
import type { CommandOptions } from '../../types/ace.ts';
|
|
2
|
+
import { BaseCommand } from '../../modules/ace/main.ts';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Command to display a list of all registered routes in the application.
|
|
5
|
+
* Supports filtering by keywords, middleware, and output formatting options.
|
|
6
|
+
* Routes can be displayed as a formatted list, table, or JSON.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```
|
|
10
|
+
* ace list:routes
|
|
11
|
+
* ace list:routes user
|
|
12
|
+
* ace list:routes --middleware=auth
|
|
13
|
+
* ace list:routes --ignore-middleware=guest
|
|
14
|
+
* ace list:routes --json
|
|
15
|
+
* ace list:routes --table
|
|
16
|
+
* ```
|
|
5
17
|
*/
|
|
6
18
|
export default class ListRoutes extends BaseCommand {
|
|
19
|
+
/**
|
|
20
|
+
* The command name
|
|
21
|
+
*/
|
|
7
22
|
static commandName: string;
|
|
23
|
+
/**
|
|
24
|
+
* The command description
|
|
25
|
+
*/
|
|
8
26
|
static description: string;
|
|
9
27
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
28
|
+
* Command options configuration.
|
|
29
|
+
* Requires the application to be started so routes are loaded.
|
|
12
30
|
*/
|
|
13
31
|
static options: CommandOptions;
|
|
14
32
|
/**
|
|
15
|
-
*
|
|
16
|
-
* includes the match keyword
|
|
33
|
+
* Keyword to match against route names, patterns, and controller names
|
|
17
34
|
*/
|
|
18
35
|
match: string;
|
|
19
36
|
/**
|
|
20
|
-
*
|
|
37
|
+
* Filter routes that include all specified middleware names
|
|
21
38
|
*/
|
|
22
39
|
middleware: string[];
|
|
23
40
|
/**
|
|
24
|
-
*
|
|
41
|
+
* Filter routes that do not include all specified middleware names
|
|
25
42
|
*/
|
|
26
43
|
ignoreMiddleware: string[];
|
|
27
44
|
/**
|
|
28
|
-
*
|
|
45
|
+
* Output routes as JSON format
|
|
29
46
|
*/
|
|
30
47
|
json: boolean;
|
|
31
48
|
/**
|
|
32
|
-
*
|
|
49
|
+
* Output routes as a CLI table format
|
|
33
50
|
*/
|
|
34
51
|
table: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Execute the command to list application routes.
|
|
54
|
+
* Creates a formatter with the specified filters and outputs routes
|
|
55
|
+
* in the requested format (JSON, table, or formatted list).
|
|
56
|
+
*/
|
|
35
57
|
run(): Promise<void>;
|
|
36
58
|
}
|
|
@@ -12,21 +12,44 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
12
12
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
13
13
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
14
14
|
};
|
|
15
|
-
import { args, BaseCommand, flags } from
|
|
16
|
-
import { RoutesListFormatter } from
|
|
15
|
+
import { args, BaseCommand, flags } from "../../modules/ace/main.js";
|
|
16
|
+
import { RoutesListFormatter } from "../../src/cli_formatters/routes_list.js";
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
18
|
+
* Command to display a list of all registered routes in the application.
|
|
19
|
+
* Supports filtering by keywords, middleware, and output formatting options.
|
|
20
|
+
* Routes can be displayed as a formatted list, table, or JSON.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```
|
|
24
|
+
* ace list:routes
|
|
25
|
+
* ace list:routes user
|
|
26
|
+
* ace list:routes --middleware=auth
|
|
27
|
+
* ace list:routes --ignore-middleware=guest
|
|
28
|
+
* ace list:routes --json
|
|
29
|
+
* ace list:routes --table
|
|
30
|
+
* ```
|
|
19
31
|
*/
|
|
20
32
|
export default class ListRoutes extends BaseCommand {
|
|
33
|
+
/**
|
|
34
|
+
* The command name
|
|
35
|
+
*/
|
|
21
36
|
static commandName = 'list:routes';
|
|
37
|
+
/**
|
|
38
|
+
* The command description
|
|
39
|
+
*/
|
|
22
40
|
static description = 'List application routes. This command will boot the application in the console environment';
|
|
23
41
|
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
42
|
+
* Command options configuration.
|
|
43
|
+
* Requires the application to be started so routes are loaded.
|
|
26
44
|
*/
|
|
27
45
|
static options = {
|
|
28
46
|
startApp: true,
|
|
29
47
|
};
|
|
48
|
+
/**
|
|
49
|
+
* Execute the command to list application routes.
|
|
50
|
+
* Creates a formatter with the specified filters and outputs routes
|
|
51
|
+
* in the requested format (JSON, table, or formatted list).
|
|
52
|
+
*/
|
|
30
53
|
async run() {
|
|
31
54
|
const router = await this.app.container.make('router');
|
|
32
55
|
const formatter = new RoutesListFormatter(router, this.ui, {}, {
|
|
@@ -1,14 +1,37 @@
|
|
|
1
|
-
import { BaseCommand } from '../../modules/ace/main.
|
|
1
|
+
import { BaseCommand } from '../../modules/ace/main.ts';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Command to create a new Ace command class.
|
|
4
|
+
* Ace commands are CLI commands that can be executed via the `ace` binary,
|
|
5
|
+
* allowing you to create custom functionality for your application's command line interface.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```
|
|
9
|
+
* ace make:command SendEmails
|
|
10
|
+
* ace make:command ProcessPayments
|
|
11
|
+
* ace make:command GenerateReports
|
|
12
|
+
* ace make:command CleanupFiles
|
|
13
|
+
* ```
|
|
4
14
|
*/
|
|
5
15
|
export default class MakeCommand extends BaseCommand {
|
|
16
|
+
/**
|
|
17
|
+
* The command name
|
|
18
|
+
*/
|
|
6
19
|
static commandName: string;
|
|
20
|
+
/**
|
|
21
|
+
* The command description
|
|
22
|
+
*/
|
|
7
23
|
static description: string;
|
|
24
|
+
/**
|
|
25
|
+
* Name of the command class to create
|
|
26
|
+
*/
|
|
8
27
|
name: string;
|
|
9
28
|
/**
|
|
10
|
-
* The stub to use for generating the command class
|
|
29
|
+
* The stub template file to use for generating the command class
|
|
11
30
|
*/
|
|
12
31
|
protected stubPath: string;
|
|
32
|
+
/**
|
|
33
|
+
* Execute the command to create a new Ace command class.
|
|
34
|
+
* Generates the command file with proper CLI command structure.
|
|
35
|
+
*/
|
|
13
36
|
run(): Promise<void>;
|
|
14
37
|
}
|
|
@@ -12,19 +12,39 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
12
12
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
13
13
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
14
14
|
};
|
|
15
|
-
import { stubsRoot } from
|
|
16
|
-
import { args } from
|
|
17
|
-
import { BaseCommand } from
|
|
15
|
+
import { stubsRoot } from "../../stubs/main.js";
|
|
16
|
+
import { args } from "../../modules/ace/main.js";
|
|
17
|
+
import { BaseCommand } from "../../modules/ace/main.js";
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* Command to create a new Ace command class.
|
|
20
|
+
* Ace commands are CLI commands that can be executed via the `ace` binary,
|
|
21
|
+
* allowing you to create custom functionality for your application's command line interface.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```
|
|
25
|
+
* ace make:command SendEmails
|
|
26
|
+
* ace make:command ProcessPayments
|
|
27
|
+
* ace make:command GenerateReports
|
|
28
|
+
* ace make:command CleanupFiles
|
|
29
|
+
* ```
|
|
20
30
|
*/
|
|
21
31
|
export default class MakeCommand extends BaseCommand {
|
|
32
|
+
/**
|
|
33
|
+
* The command name
|
|
34
|
+
*/
|
|
22
35
|
static commandName = 'make:command';
|
|
36
|
+
/**
|
|
37
|
+
* The command description
|
|
38
|
+
*/
|
|
23
39
|
static description = 'Create a new ace command class';
|
|
24
40
|
/**
|
|
25
|
-
* The stub to use for generating the command class
|
|
41
|
+
* The stub template file to use for generating the command class
|
|
26
42
|
*/
|
|
27
43
|
stubPath = 'make/command/main.stub';
|
|
44
|
+
/**
|
|
45
|
+
* Execute the command to create a new Ace command class.
|
|
46
|
+
* Generates the command file with proper CLI command structure.
|
|
47
|
+
*/
|
|
28
48
|
async run() {
|
|
29
49
|
const codemods = await this.createCodemods();
|
|
30
50
|
await codemods.makeUsingStub(stubsRoot, this.stubPath, {
|
|
@@ -1,16 +1,49 @@
|
|
|
1
|
-
import { BaseCommand } from '../../modules/ace/main.
|
|
2
|
-
import { CommandOptions } from '../../types/ace.
|
|
1
|
+
import { BaseCommand } from '../../modules/ace/main.ts';
|
|
2
|
+
import { type CommandOptions } from '../../types/ace.ts';
|
|
3
3
|
/**
|
|
4
4
|
* The make controller command to create an HTTP controller
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```
|
|
8
|
+
* ace make:controller User
|
|
9
|
+
* ace make:controller User store update
|
|
10
|
+
* ace make:controller User --resource
|
|
11
|
+
* ace make:controller User --api
|
|
12
|
+
* ace make:controller User --singular
|
|
13
|
+
* ```
|
|
5
14
|
*/
|
|
6
15
|
export default class MakeController extends BaseCommand {
|
|
16
|
+
/**
|
|
17
|
+
* The command name
|
|
18
|
+
*/
|
|
7
19
|
static commandName: string;
|
|
20
|
+
/**
|
|
21
|
+
* The command description
|
|
22
|
+
*/
|
|
8
23
|
static description: string;
|
|
24
|
+
/**
|
|
25
|
+
* Command options configuration
|
|
26
|
+
*/
|
|
9
27
|
static options: CommandOptions;
|
|
28
|
+
/**
|
|
29
|
+
* The name of the controller
|
|
30
|
+
*/
|
|
10
31
|
name: string;
|
|
32
|
+
/**
|
|
33
|
+
* Create controller with custom method names
|
|
34
|
+
*/
|
|
11
35
|
actions?: string[];
|
|
36
|
+
/**
|
|
37
|
+
* Generate controller in singular form
|
|
38
|
+
*/
|
|
12
39
|
singular: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Generate resourceful controller with methods to perform CRUD actions on a resource
|
|
42
|
+
*/
|
|
13
43
|
resource: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Generate resourceful controller without the "edit" and the "create" methods
|
|
46
|
+
*/
|
|
14
47
|
api: boolean;
|
|
15
48
|
/**
|
|
16
49
|
* The stub to use for generating the controller
|
|
@@ -13,14 +13,32 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
13
13
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
14
14
|
};
|
|
15
15
|
import string from '@poppinss/utils/string';
|
|
16
|
-
import { stubsRoot } from
|
|
17
|
-
import { args, flags, BaseCommand } from
|
|
16
|
+
import { stubsRoot } from "../../stubs/main.js";
|
|
17
|
+
import { args, flags, BaseCommand } from "../../modules/ace/main.js";
|
|
18
18
|
/**
|
|
19
19
|
* The make controller command to create an HTTP controller
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```
|
|
23
|
+
* ace make:controller User
|
|
24
|
+
* ace make:controller User store update
|
|
25
|
+
* ace make:controller User --resource
|
|
26
|
+
* ace make:controller User --api
|
|
27
|
+
* ace make:controller User --singular
|
|
28
|
+
* ```
|
|
20
29
|
*/
|
|
21
30
|
export default class MakeController extends BaseCommand {
|
|
31
|
+
/**
|
|
32
|
+
* The command name
|
|
33
|
+
*/
|
|
22
34
|
static commandName = 'make:controller';
|
|
35
|
+
/**
|
|
36
|
+
* The command description
|
|
37
|
+
*/
|
|
23
38
|
static description = 'Create a new HTTP controller class';
|
|
39
|
+
/**
|
|
40
|
+
* Command options configuration
|
|
41
|
+
*/
|
|
24
42
|
static options = {
|
|
25
43
|
allowUnknownFlags: true,
|
|
26
44
|
};
|