@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,31 @@
|
|
|
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
|
* Make a new service class
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```
|
|
8
|
+
* ace make:service UserService
|
|
9
|
+
* ace make:service AuthService
|
|
10
|
+
* ace make:service User/ProfileService
|
|
11
|
+
* ```
|
|
5
12
|
*/
|
|
6
13
|
export default class MakeService 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
|
+
* Command options configuration
|
|
24
|
+
*/
|
|
9
25
|
static options: CommandOptions;
|
|
26
|
+
/**
|
|
27
|
+
* Name of the service
|
|
28
|
+
*/
|
|
10
29
|
name: string;
|
|
11
30
|
/**
|
|
12
31
|
* The stub to use for generating the service class
|
|
@@ -12,14 +12,30 @@ 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, BaseCommand } from
|
|
15
|
+
import { stubsRoot } from "../../stubs/main.js";
|
|
16
|
+
import { args, BaseCommand } from "../../modules/ace/main.js";
|
|
17
17
|
/**
|
|
18
18
|
* Make a new service class
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```
|
|
22
|
+
* ace make:service UserService
|
|
23
|
+
* ace make:service AuthService
|
|
24
|
+
* ace make:service User/ProfileService
|
|
25
|
+
* ```
|
|
19
26
|
*/
|
|
20
27
|
export default class MakeService extends BaseCommand {
|
|
28
|
+
/**
|
|
29
|
+
* The command name
|
|
30
|
+
*/
|
|
21
31
|
static commandName = 'make:service';
|
|
32
|
+
/**
|
|
33
|
+
* The command description
|
|
34
|
+
*/
|
|
22
35
|
static description = 'Create a new service class';
|
|
36
|
+
/**
|
|
37
|
+
* Command options configuration
|
|
38
|
+
*/
|
|
23
39
|
static options = {
|
|
24
40
|
allowUnknownFlags: true,
|
|
25
41
|
};
|
|
@@ -1,19 +1,42 @@
|
|
|
1
|
-
import { BaseCommand } from '../../modules/ace/main.
|
|
1
|
+
import { BaseCommand } from '../../modules/ace/main.ts';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Command to create a new Japa test file.
|
|
4
|
+
* Supports multiple test suites and automatically detects or prompts for
|
|
5
|
+
* the appropriate suite and directory based on application configuration.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```
|
|
9
|
+
* ace make:test UserController
|
|
10
|
+
* ace make:test UserModel --suite=unit
|
|
11
|
+
* ace make:test AuthService --suite=integration
|
|
12
|
+
* ```
|
|
4
13
|
*/
|
|
5
14
|
export default class MakeTest extends BaseCommand {
|
|
6
15
|
#private;
|
|
16
|
+
/**
|
|
17
|
+
* The command name
|
|
18
|
+
*/
|
|
7
19
|
static commandName: string;
|
|
20
|
+
/**
|
|
21
|
+
* The command description
|
|
22
|
+
*/
|
|
8
23
|
static description: string;
|
|
24
|
+
/**
|
|
25
|
+
* Name of the test file to create
|
|
26
|
+
*/
|
|
9
27
|
name: string;
|
|
28
|
+
/**
|
|
29
|
+
* Test suite name where the test file should be created
|
|
30
|
+
*/
|
|
10
31
|
suite?: string;
|
|
11
32
|
/**
|
|
12
|
-
* The stub to use for generating the test file
|
|
33
|
+
* The stub template file to use for generating the test file
|
|
13
34
|
*/
|
|
14
35
|
protected stubPath: string;
|
|
15
36
|
/**
|
|
16
|
-
*
|
|
37
|
+
* Execute the command to create a new test file.
|
|
38
|
+
* Validates the suite exists, prompts for missing information,
|
|
39
|
+
* and generates the test file in the appropriate location.
|
|
17
40
|
*/
|
|
18
41
|
run(): Promise<void>;
|
|
19
42
|
}
|
|
@@ -12,20 +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, flags, BaseCommand } from
|
|
15
|
+
import { stubsRoot } from "../../stubs/main.js";
|
|
16
|
+
import { args, flags, BaseCommand } from "../../modules/ace/main.js";
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
18
|
+
* Command to create a new Japa test file.
|
|
19
|
+
* Supports multiple test suites and automatically detects or prompts for
|
|
20
|
+
* the appropriate suite and directory based on application configuration.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```
|
|
24
|
+
* ace make:test UserController
|
|
25
|
+
* ace make:test UserModel --suite=unit
|
|
26
|
+
* ace make:test AuthService --suite=integration
|
|
27
|
+
* ```
|
|
19
28
|
*/
|
|
20
29
|
export default class MakeTest extends BaseCommand {
|
|
30
|
+
/**
|
|
31
|
+
* The command name
|
|
32
|
+
*/
|
|
21
33
|
static commandName = 'make:test';
|
|
34
|
+
/**
|
|
35
|
+
* The command description
|
|
36
|
+
*/
|
|
22
37
|
static description = 'Create a new Japa test file';
|
|
23
38
|
/**
|
|
24
|
-
* The stub to use for generating the test file
|
|
39
|
+
* The stub template file to use for generating the test file
|
|
25
40
|
*/
|
|
26
41
|
stubPath = 'make/test/main.stub';
|
|
27
42
|
/**
|
|
28
|
-
*
|
|
43
|
+
* Determine the test suite name for creating the test file.
|
|
44
|
+
* Uses the provided suite flag, or automatically selects if only one suite exists,
|
|
45
|
+
* or prompts the user to choose from available suites.
|
|
46
|
+
*
|
|
47
|
+
* @returns The name of the selected test suite
|
|
29
48
|
*/
|
|
30
49
|
async #getSuite() {
|
|
31
50
|
if (this.suite) {
|
|
@@ -51,7 +70,11 @@ export default class MakeTest extends BaseCommand {
|
|
|
51
70
|
});
|
|
52
71
|
}
|
|
53
72
|
/**
|
|
54
|
-
*
|
|
73
|
+
* Determine the directory path for the test file within the selected suite.
|
|
74
|
+
* Automatically selects if only one directory exists, otherwise prompts the user.
|
|
75
|
+
*
|
|
76
|
+
* @param directories - Array of available directories for the suite
|
|
77
|
+
* @returns The selected directory path
|
|
55
78
|
*/
|
|
56
79
|
async #getSuiteDirectory(directories) {
|
|
57
80
|
if (directories.length === 1) {
|
|
@@ -64,7 +87,10 @@ export default class MakeTest extends BaseCommand {
|
|
|
64
87
|
});
|
|
65
88
|
}
|
|
66
89
|
/**
|
|
67
|
-
* Find suite
|
|
90
|
+
* Find suite configuration from the RC file by name.
|
|
91
|
+
*
|
|
92
|
+
* @param suiteName - The name of the suite to find
|
|
93
|
+
* @returns The suite configuration or undefined if not found
|
|
68
94
|
*/
|
|
69
95
|
#findSuite(suiteName) {
|
|
70
96
|
return this.app.rcFile.tests.suites.find((suite) => {
|
|
@@ -72,7 +98,9 @@ export default class MakeTest extends BaseCommand {
|
|
|
72
98
|
});
|
|
73
99
|
}
|
|
74
100
|
/**
|
|
75
|
-
*
|
|
101
|
+
* Execute the command to create a new test file.
|
|
102
|
+
* Validates the suite exists, prompts for missing information,
|
|
103
|
+
* and generates the test file in the appropriate location.
|
|
76
104
|
*/
|
|
77
105
|
async run() {
|
|
78
106
|
const suite = this.#findSuite(await this.#getSuite());
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { BaseCommand } from '../../modules/ace/main.ts';
|
|
2
|
+
import { type CommandOptions } from '../../types/ace.ts';
|
|
3
|
+
/**
|
|
4
|
+
* Command to create a new transformer class.
|
|
5
|
+
* Transformers are used to serialize data objects (like models) into specific
|
|
6
|
+
* formats for API responses, allowing you to control which fields are exposed
|
|
7
|
+
* and how data is structured for clients.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```
|
|
11
|
+
* ace make:transformer User
|
|
12
|
+
* ace make:transformer Post
|
|
13
|
+
* ace make:transformer ProductTransformer
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export default class MakeTransformer extends BaseCommand {
|
|
17
|
+
/**
|
|
18
|
+
* The command name
|
|
19
|
+
*/
|
|
20
|
+
static commandName: string;
|
|
21
|
+
/**
|
|
22
|
+
* The command description
|
|
23
|
+
*/
|
|
24
|
+
static description: string;
|
|
25
|
+
/**
|
|
26
|
+
* Command options configuration.
|
|
27
|
+
* Allows unknown flags to be passed through.
|
|
28
|
+
*/
|
|
29
|
+
static options: CommandOptions;
|
|
30
|
+
/**
|
|
31
|
+
* Name of the entity for which to generate the transformer
|
|
32
|
+
*/
|
|
33
|
+
name: string;
|
|
34
|
+
/**
|
|
35
|
+
* The stub template file to use for generating the transformer class
|
|
36
|
+
*/
|
|
37
|
+
protected stubPath: string;
|
|
38
|
+
/**
|
|
39
|
+
* Execute the command to create a new transformer class.
|
|
40
|
+
* Generates the transformer file with proper data serialization structure.
|
|
41
|
+
*/
|
|
42
|
+
run(): Promise<void>;
|
|
43
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @adonisjs/core
|
|
3
|
+
*
|
|
4
|
+
* (c) AdonisJS
|
|
5
|
+
*
|
|
6
|
+
* For the full copyright and license information, please view the LICENSE
|
|
7
|
+
* file that was distributed with this source code.
|
|
8
|
+
*/
|
|
9
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
10
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
11
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
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
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
14
|
+
};
|
|
15
|
+
import { stubsRoot } from "../../stubs/main.js";
|
|
16
|
+
import { args, BaseCommand } from "../../modules/ace/main.js";
|
|
17
|
+
/**
|
|
18
|
+
* Command to create a new transformer class.
|
|
19
|
+
* Transformers are used to serialize data objects (like models) into specific
|
|
20
|
+
* formats for API responses, allowing you to control which fields are exposed
|
|
21
|
+
* and how data is structured for clients.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```
|
|
25
|
+
* ace make:transformer User
|
|
26
|
+
* ace make:transformer Post
|
|
27
|
+
* ace make:transformer ProductTransformer
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export default class MakeTransformer extends BaseCommand {
|
|
31
|
+
/**
|
|
32
|
+
* The command name
|
|
33
|
+
*/
|
|
34
|
+
static commandName = 'make:transformer';
|
|
35
|
+
/**
|
|
36
|
+
* The command description
|
|
37
|
+
*/
|
|
38
|
+
static description = 'Create a new transformer class';
|
|
39
|
+
/**
|
|
40
|
+
* Command options configuration.
|
|
41
|
+
* Allows unknown flags to be passed through.
|
|
42
|
+
*/
|
|
43
|
+
static options = {
|
|
44
|
+
allowUnknownFlags: true,
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* The stub template file to use for generating the transformer class
|
|
48
|
+
*/
|
|
49
|
+
stubPath = 'make/transformer/main.stub';
|
|
50
|
+
/**
|
|
51
|
+
* Execute the command to create a new transformer class.
|
|
52
|
+
* Generates the transformer file with proper data serialization structure.
|
|
53
|
+
*/
|
|
54
|
+
async run() {
|
|
55
|
+
const codemods = await this.createCodemods();
|
|
56
|
+
await codemods.makeUsingStub(stubsRoot, this.stubPath, {
|
|
57
|
+
flags: this.parsed.flags,
|
|
58
|
+
entity: this.app.generators.createEntity(this.name),
|
|
59
|
+
model: this.app.generators.createEntity(this.name),
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
__decorate([
|
|
64
|
+
args.string({ description: 'Entity name for which to generate the transformer' })
|
|
65
|
+
], MakeTransformer.prototype, "name", void 0);
|
|
@@ -1,21 +1,52 @@
|
|
|
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
|
+
* Command to create a new VineJS validator file.
|
|
5
|
+
* Validators define reusable validation schemas for request validation,
|
|
6
|
+
* and can be generated as simple validators or resource-based validators
|
|
7
|
+
* with create and update schemas.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```
|
|
11
|
+
* ace make:validator UserValidator
|
|
12
|
+
* ace make:validator PostValidator --resource
|
|
13
|
+
* ace make:validator ContactValidator
|
|
14
|
+
* ```
|
|
5
15
|
*/
|
|
6
16
|
export default class MakeValidator extends BaseCommand {
|
|
17
|
+
/**
|
|
18
|
+
* The command name
|
|
19
|
+
*/
|
|
7
20
|
static commandName: string;
|
|
21
|
+
/**
|
|
22
|
+
* The command description
|
|
23
|
+
*/
|
|
8
24
|
static description: string;
|
|
25
|
+
/**
|
|
26
|
+
* Command options configuration.
|
|
27
|
+
* Allows unknown flags to be passed through.
|
|
28
|
+
*/
|
|
9
29
|
static options: CommandOptions;
|
|
30
|
+
/**
|
|
31
|
+
* Name of the validator file to create
|
|
32
|
+
*/
|
|
10
33
|
name: string;
|
|
34
|
+
/**
|
|
35
|
+
* Generate a resource validator with create and update schemas
|
|
36
|
+
*/
|
|
11
37
|
resource: boolean;
|
|
12
38
|
/**
|
|
13
|
-
* The stub to use for generating the validator
|
|
39
|
+
* The stub template file to use for generating the validator
|
|
14
40
|
*/
|
|
15
41
|
protected stubPath: string;
|
|
16
42
|
/**
|
|
17
|
-
*
|
|
43
|
+
* Prepare the command by selecting the appropriate stub based on options.
|
|
44
|
+
* Uses a resource stub when generating validators for CRUD operations.
|
|
18
45
|
*/
|
|
19
46
|
prepare(): Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* Execute the command to create a new VineJS validator file.
|
|
49
|
+
* Generates the validator with the appropriate stub template.
|
|
50
|
+
*/
|
|
20
51
|
run(): Promise<void>;
|
|
21
52
|
}
|
|
@@ -12,23 +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 { stubsRoot } from
|
|
16
|
-
import { args, flags, BaseCommand } from
|
|
15
|
+
import { stubsRoot } from "../../stubs/main.js";
|
|
16
|
+
import { args, flags, BaseCommand } from "../../modules/ace/main.js";
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
18
|
+
* Command to create a new VineJS validator file.
|
|
19
|
+
* Validators define reusable validation schemas for request validation,
|
|
20
|
+
* and can be generated as simple validators or resource-based validators
|
|
21
|
+
* with create and update schemas.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```
|
|
25
|
+
* ace make:validator UserValidator
|
|
26
|
+
* ace make:validator PostValidator --resource
|
|
27
|
+
* ace make:validator ContactValidator
|
|
28
|
+
* ```
|
|
19
29
|
*/
|
|
20
30
|
export default class MakeValidator extends BaseCommand {
|
|
31
|
+
/**
|
|
32
|
+
* The command name
|
|
33
|
+
*/
|
|
21
34
|
static commandName = 'make:validator';
|
|
35
|
+
/**
|
|
36
|
+
* The command description
|
|
37
|
+
*/
|
|
22
38
|
static description = 'Create a new file to define VineJS validators';
|
|
39
|
+
/**
|
|
40
|
+
* Command options configuration.
|
|
41
|
+
* Allows unknown flags to be passed through.
|
|
42
|
+
*/
|
|
23
43
|
static options = {
|
|
24
44
|
allowUnknownFlags: true,
|
|
25
45
|
};
|
|
26
46
|
/**
|
|
27
|
-
* The stub to use for generating the validator
|
|
47
|
+
* The stub template file to use for generating the validator
|
|
28
48
|
*/
|
|
29
49
|
stubPath = 'make/validator/main.stub';
|
|
30
50
|
/**
|
|
31
|
-
*
|
|
51
|
+
* Prepare the command by selecting the appropriate stub based on options.
|
|
52
|
+
* Uses a resource stub when generating validators for CRUD operations.
|
|
32
53
|
*/
|
|
33
54
|
async prepare() {
|
|
34
55
|
/**
|
|
@@ -38,6 +59,10 @@ export default class MakeValidator extends BaseCommand {
|
|
|
38
59
|
this.stubPath = 'make/validator/resource.stub';
|
|
39
60
|
}
|
|
40
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* Execute the command to create a new VineJS validator file.
|
|
64
|
+
* Generates the validator with the appropriate stub template.
|
|
65
|
+
*/
|
|
41
66
|
async run() {
|
|
42
67
|
const codemods = await this.createCodemods();
|
|
43
68
|
await codemods.makeUsingStub(stubsRoot, this.stubPath, {
|
|
@@ -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 Edge.js template file.
|
|
4
|
+
* Edge templates are used for rendering HTML views in your web application,
|
|
5
|
+
* supporting layouts, partials, components, and template inheritance.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```
|
|
9
|
+
* ace make:view home
|
|
10
|
+
* ace make:view users/profile
|
|
11
|
+
* ace make:view components/navbar
|
|
12
|
+
* ace make:view layouts/app
|
|
13
|
+
* ```
|
|
4
14
|
*/
|
|
5
15
|
export default class MakeView 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 template file to create
|
|
26
|
+
*/
|
|
8
27
|
name: string;
|
|
9
28
|
/**
|
|
10
|
-
* The stub to use for generating the template
|
|
29
|
+
* The stub template file to use for generating the Edge template
|
|
11
30
|
*/
|
|
12
31
|
protected stubPath: string;
|
|
32
|
+
/**
|
|
33
|
+
* Execute the command to create a new Edge.js template file.
|
|
34
|
+
* Generates the template file in the views directory.
|
|
35
|
+
*/
|
|
13
36
|
run(): Promise<void>;
|
|
14
37
|
}
|
|
@@ -12,18 +12,38 @@ 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, BaseCommand } from
|
|
15
|
+
import { stubsRoot } from "../../stubs/main.js";
|
|
16
|
+
import { args, BaseCommand } from "../../modules/ace/main.js";
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
18
|
+
* Command to create a new Edge.js template file.
|
|
19
|
+
* Edge templates are used for rendering HTML views in your web application,
|
|
20
|
+
* supporting layouts, partials, components, and template inheritance.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```
|
|
24
|
+
* ace make:view home
|
|
25
|
+
* ace make:view users/profile
|
|
26
|
+
* ace make:view components/navbar
|
|
27
|
+
* ace make:view layouts/app
|
|
28
|
+
* ```
|
|
19
29
|
*/
|
|
20
30
|
export default class MakeView extends BaseCommand {
|
|
31
|
+
/**
|
|
32
|
+
* The command name
|
|
33
|
+
*/
|
|
21
34
|
static commandName = 'make:view';
|
|
35
|
+
/**
|
|
36
|
+
* The command description
|
|
37
|
+
*/
|
|
22
38
|
static description = 'Create a new Edge.js template file';
|
|
23
39
|
/**
|
|
24
|
-
* The stub to use for generating the template
|
|
40
|
+
* The stub template file to use for generating the Edge template
|
|
25
41
|
*/
|
|
26
42
|
stubPath = 'make/view/main.stub';
|
|
43
|
+
/**
|
|
44
|
+
* Execute the command to create a new Edge.js template file.
|
|
45
|
+
* Generates the template file in the views directory.
|
|
46
|
+
*/
|
|
27
47
|
async run() {
|
|
28
48
|
const codemods = await this.createCodemods();
|
|
29
49
|
await codemods.makeUsingStub(stubsRoot, this.stubPath, {
|
package/build/commands/repl.d.ts
CHANGED
|
@@ -1,14 +1,34 @@
|
|
|
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
|
+
* Command to start an interactive REPL (Read-Eval-Print Loop) session for AdonisJS.
|
|
5
|
+
* The REPL provides a command-line interface where you can execute JavaScript code
|
|
6
|
+
* in the context of your AdonisJS application, allowing you to interact with models,
|
|
7
|
+
* services, and other application components in real-time.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```
|
|
11
|
+
* ace repl
|
|
12
|
+
* ```
|
|
5
13
|
*/
|
|
6
14
|
export default class ReplCommand 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
|
+
* Command options configuration.
|
|
25
|
+
* Requires the application to be started and keeps the process alive.
|
|
26
|
+
*/
|
|
9
27
|
static options: CommandOptions;
|
|
10
28
|
/**
|
|
11
|
-
*
|
|
29
|
+
* Execute the command to start the REPL server.
|
|
30
|
+
* Creates a REPL instance from the container and sets up an exit handler
|
|
31
|
+
* that properly terminates the application when the REPL session ends.
|
|
12
32
|
*/
|
|
13
33
|
run(): Promise<void>;
|
|
14
34
|
}
|
package/build/commands/repl.js
CHANGED
|
@@ -6,19 +6,39 @@
|
|
|
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 start an interactive REPL (Read-Eval-Print Loop) session for AdonisJS.
|
|
12
|
+
* The REPL provides a command-line interface where you can execute JavaScript code
|
|
13
|
+
* in the context of your AdonisJS application, allowing you to interact with models,
|
|
14
|
+
* services, and other application components in real-time.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```
|
|
18
|
+
* ace repl
|
|
19
|
+
* ```
|
|
12
20
|
*/
|
|
13
21
|
export default class ReplCommand extends BaseCommand {
|
|
22
|
+
/**
|
|
23
|
+
* The command name
|
|
24
|
+
*/
|
|
14
25
|
static commandName = 'repl';
|
|
26
|
+
/**
|
|
27
|
+
* The command description
|
|
28
|
+
*/
|
|
15
29
|
static description = 'Start a new REPL session';
|
|
30
|
+
/**
|
|
31
|
+
* Command options configuration.
|
|
32
|
+
* Requires the application to be started and keeps the process alive.
|
|
33
|
+
*/
|
|
16
34
|
static options = {
|
|
17
35
|
startApp: true,
|
|
18
36
|
staysAlive: true,
|
|
19
37
|
};
|
|
20
38
|
/**
|
|
21
|
-
*
|
|
39
|
+
* Execute the command to start the REPL server.
|
|
40
|
+
* Creates a REPL instance from the container and sets up an exit handler
|
|
41
|
+
* that properly terminates the application when the REPL session ends.
|
|
22
42
|
*/
|
|
23
43
|
async run() {
|
|
24
44
|
const repl = await this.app.container.make('repl');
|
|
@@ -1,24 +1,58 @@
|
|
|
1
1
|
import type { DevServer } from '@adonisjs/assembler';
|
|
2
|
-
import type { CommandOptions } from '../types/ace.
|
|
3
|
-
import { BaseCommand } from '../modules/ace/main.
|
|
2
|
+
import type { CommandOptions } from '../types/ace.ts';
|
|
3
|
+
import { BaseCommand } from '../modules/ace/main.ts';
|
|
4
4
|
/**
|
|
5
5
|
* Serve command is used to run the AdonisJS HTTP server during development. The
|
|
6
6
|
* command under the hood runs the "bin/server.ts" file and watches for file
|
|
7
7
|
* system changes
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```
|
|
11
|
+
* ace serve
|
|
12
|
+
* ace serve --watch
|
|
13
|
+
* ace serve --hmr
|
|
14
|
+
* ace serve --poll
|
|
15
|
+
* ace serve --no-clear
|
|
16
|
+
* ```
|
|
8
17
|
*/
|
|
9
18
|
export default class Serve extends BaseCommand {
|
|
10
19
|
#private;
|
|
20
|
+
/**
|
|
21
|
+
* The command name
|
|
22
|
+
*/
|
|
11
23
|
static commandName: string;
|
|
24
|
+
/**
|
|
25
|
+
* The command description
|
|
26
|
+
*/
|
|
12
27
|
static description: string;
|
|
28
|
+
/**
|
|
29
|
+
* Help text for the command
|
|
30
|
+
*/
|
|
13
31
|
static help: string[];
|
|
32
|
+
/**
|
|
33
|
+
* Command options configuration
|
|
34
|
+
*/
|
|
14
35
|
static options: CommandOptions;
|
|
36
|
+
/**
|
|
37
|
+
* The development server instance
|
|
38
|
+
*/
|
|
15
39
|
devServer: DevServer;
|
|
40
|
+
/**
|
|
41
|
+
* Start the server with HMR support
|
|
42
|
+
*/
|
|
16
43
|
hmr?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Watch filesystem and restart the HTTP server on file change
|
|
46
|
+
*/
|
|
17
47
|
watch?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Use polling to detect filesystem changes
|
|
50
|
+
*/
|
|
18
51
|
poll?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Clear the terminal for new logs after file change
|
|
54
|
+
*/
|
|
19
55
|
clear?: boolean;
|
|
20
|
-
assets?: boolean;
|
|
21
|
-
assetsArgs?: string[];
|
|
22
56
|
/**
|
|
23
57
|
* Runs the HTTP server
|
|
24
58
|
*/
|