@adonisjs/core 7.0.0 → 7.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/ace-DBm6EcQ-.js +37 -0
- package/build/app-BCcG_oDd.js +7 -0
- package/build/app-CAuSGb2P.js +15 -0
- package/build/bodyparser_middleware-H5FArWkI.js +9 -0
- package/build/{chunk-iKc69rpz.js → chunk-Do49iUES.js} +3 -0
- package/build/commands/add.d.ts +1 -0
- package/build/commands/add.js +64 -10
- package/build/commands/build.js +41 -3
- package/build/commands/commands.json +1 -1
- package/build/commands/configure.js +70 -4
- package/build/commands/eject.js +30 -4
- package/build/commands/env/add.js +62 -4
- package/build/commands/generate_key.js +23 -3
- package/build/commands/inspect_rcfile.js +26 -2
- package/build/commands/list/routes.d.ts +5 -0
- package/build/commands/list/routes.js +242 -3
- package/build/commands/make/command.js +33 -4
- package/build/commands/make/controller.js +46 -4
- package/build/commands/make/event.js +36 -4
- package/build/commands/make/exception.js +36 -4
- package/build/commands/make/listener.js +44 -4
- package/build/commands/make/middleware.js +53 -5
- package/build/commands/make/preload.js +55 -5
- package/build/commands/make/provider.js +54 -5
- package/build/commands/make/service.js +29 -4
- package/build/commands/make/test.js +63 -4
- package/build/commands/make/transformer.js +37 -4
- package/build/commands/make/validator.js +44 -4
- package/build/commands/make/view.js +33 -4
- package/build/commands/repl.js +31 -2
- package/build/commands/serve.js +54 -4
- package/build/commands/test.js +69 -4
- package/build/config-Coti2q6R.js +7 -0
- package/build/config_provider-Do9af1ze.js +35 -0
- package/build/container-CGfEwWof.js +7 -0
- package/build/{core-IpCOCkUL.js → core-XjMm_ipu.js} +51 -2
- package/build/create_kernel-BV3swyCg.js +4 -0
- package/build/{create_kernel-B7ILNhuP.js → create_kernel-D38-0Zbt.js} +41 -1
- package/build/debug-DWofTfIX.js +20 -0
- package/build/{decorate-DmrZA614.js → decorate-B9Uz0anB.js} +2 -0
- package/build/{define_config-0oHaj43l.js → define_config--5euEdi8.js} +54 -3
- package/build/dumper-3R77st8F.js +353 -0
- package/build/edge-BG5ZYp6Z.js +57 -0
- package/build/{errors-CrCO-k44.js → errors-BScZTzBu.js} +9 -1
- package/build/events-DlKX1ZdL.js +7 -0
- package/build/exceptions-B2MzIlHY.js +2 -0
- package/build/factories/app.js +1 -0
- package/build/factories/bodyparser.js +1 -0
- package/build/factories/core/ace.js +16 -22
- package/build/factories/core/ignitor.js +13 -73
- package/build/factories/core/main.js +25 -17
- package/build/factories/core/test_utils.js +22 -19
- package/build/factories/encryption.js +1 -0
- package/build/factories/events.js +1 -0
- package/build/factories/hash.js +1 -0
- package/build/factories/http.js +1 -0
- package/build/factories/logger.js +1 -0
- package/build/factories/stubs.js +75 -7
- package/build/ignitor-Kym3gR-I.js +169 -0
- package/build/index.js +11 -8
- package/build/logger-DIdZPHCe.js +43 -0
- package/build/main-B50zECAi.js +121 -0
- package/build/main-CRnMnrH7.js +184 -0
- package/build/{main-kn40V-hF.js → main-CfTiGsiS.js} +2 -0
- package/build/main-Ck0GqLx4.js +117 -0
- package/build/main-CoZI4Ezs.js +2 -0
- package/build/main-D1MSq4Uu.js +435 -0
- package/build/{main--nXd7T-C.js → main-bRYXIHgD.js} +75 -3
- package/build/main-zxNP7iRl.js +7 -0
- package/build/modules/ace/codemods.d.ts +1 -1
- package/build/modules/ace/codemods.js +303 -8
- package/build/modules/ace/commands.d.ts +5 -0
- package/build/modules/ace/main.js +2 -1
- package/build/modules/app.js +3 -5
- package/build/modules/bodyparser/bodyparser_middleware.js +2 -2
- package/build/modules/bodyparser/main.js +3 -5
- package/build/modules/config.js +3 -5
- package/build/modules/container.js +3 -5
- package/build/modules/dumper/main.js +29 -2
- package/build/modules/dumper/plugins/edge.js +2 -46
- package/build/modules/encryption/drivers/aes_256_cbc.js +1 -0
- package/build/modules/encryption/drivers/aes_256_gcm.js +1 -0
- package/build/modules/encryption/drivers/aes_siv.js +1 -0
- package/build/modules/encryption/drivers/chacha20_poly1305.js +1 -0
- package/build/modules/encryption/drivers/legacy.js +46 -1
- package/build/modules/encryption/main.js +7 -5
- package/build/modules/env/editor.js +1 -0
- package/build/modules/env/main.js +1 -0
- package/build/modules/events.js +3 -5
- package/build/modules/hash/drivers/argon.js +1 -0
- package/build/modules/hash/drivers/bcrypt.js +1 -0
- package/build/modules/hash/drivers/scrypt.js +1 -0
- package/build/modules/hash/main.js +4 -4
- package/build/modules/hash/phc_formatter.js +1 -0
- package/build/modules/health.js +1 -0
- package/build/modules/http/helpers.js +1 -0
- package/build/modules/http/main.js +2 -2
- package/build/modules/http/url_builder_client.js +1 -0
- package/build/modules/logger.js +3 -13
- package/build/modules/repl.js +3 -5
- package/build/modules/transformers/main.js +1 -0
- package/build/providers/app_provider.js +214 -15
- package/build/providers/edge_provider.js +90 -3
- package/build/providers/hash_provider.js +59 -4
- package/build/providers/repl_provider.js +64 -2
- package/build/providers/vinejs_provider.js +44 -3
- package/build/repl-C02Re0Yd.js +7 -0
- package/build/services/ace.js +11 -1
- package/build/services/app.js +2 -4
- package/build/services/config.js +7 -1
- package/build/services/dumper.js +13 -1
- package/build/services/emitter.js +8 -1
- package/build/services/encryption.js +8 -1
- package/build/services/hash.js +8 -1
- package/build/services/logger.js +8 -1
- package/build/services/repl.js +8 -1
- package/build/services/router.js +8 -1
- package/build/services/server.js +8 -1
- package/build/services/test_utils.js +11 -1
- package/build/services/url_builder.js +8 -1
- package/build/src/cli_formatters/routes_list.d.ts +7 -0
- package/build/src/exceptions.js +2 -1
- package/build/src/helpers/assert.js +1 -0
- package/build/src/helpers/http.js +1 -0
- package/build/src/helpers/is.js +24 -0
- package/build/src/helpers/main.js +2 -1
- package/build/src/helpers/string.js +2 -27
- package/build/src/helpers/types.js +18 -0
- package/build/src/helpers/verification_token.js +2 -45
- package/build/src/test_utils/main.js +9 -7
- package/build/src/types.js +1 -0
- package/build/src/vine.js +2 -32
- package/build/string-8_8He-HH.js +46 -0
- package/build/test_utils-DbJS_uEu.js +32 -0
- package/build/toolkit/main.js +13 -1
- package/build/types/ace.js +1 -0
- package/build/types/app.js +1 -0
- package/build/types/bodyparser.js +1 -0
- package/build/types/common.js +1 -0
- package/build/types/container.js +1 -0
- package/build/types/encryption.js +1 -0
- package/build/types/events.js +1 -0
- package/build/types/hash.js +1 -0
- package/build/types/health.js +1 -0
- package/build/types/helpers.js +1 -0
- package/build/types/http.js +1 -0
- package/build/types/logger.js +1 -0
- package/build/types/repl.js +1 -0
- package/build/types/transformers.js +1 -0
- package/build/utils-CKwka7OL.js +105 -0
- package/build/verification_token-WCrZtUgZ.js +108 -0
- package/build/vine-DkIupA3Z.js +97 -0
- package/package.json +12 -12
- package/build/config_provider-FIAUgvae.js +0 -13
- package/build/create_kernel-BD0Iqi8e.js +0 -3
- package/build/debug-CGQmxzGt.js +0 -3
- package/build/dumper-BBgqFX5a.js +0 -147
- package/build/main-Cxz0TyIw.js +0 -173
- package/build/main-DN2qEEg5.js +0 -41
- package/build/main-DkNgvceD.js +0 -52
- package/build/main-MBAMnmJb.js +0 -81
- package/build/utils-rRkbAPnP.js +0 -42
|
@@ -1,11 +1,43 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import "../../chunk-Do49iUES.js";
|
|
2
|
+
import { t as stubsRoot } from "../../main-CfTiGsiS.js";
|
|
3
|
+
import { f as BaseCommand, l as flags, o as args } from "../../main-CRnMnrH7.js";
|
|
4
|
+
import { t as __decorate } from "../../decorate-B9Uz0anB.js";
|
|
5
|
+
//#region commands/make/transformer.ts
|
|
6
|
+
/**
|
|
7
|
+
* Command to create a new transformer class.
|
|
8
|
+
* Transformers are used to serialize data objects (like models) into specific
|
|
9
|
+
* formats for API responses, allowing you to control which fields are exposed
|
|
10
|
+
* and how data is structured for clients.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```
|
|
14
|
+
* ace make:transformer User
|
|
15
|
+
* ace make:transformer Post
|
|
16
|
+
* ace make:transformer ProductTransformer
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
4
19
|
var MakeTransformer = class extends BaseCommand {
|
|
20
|
+
/**
|
|
21
|
+
* The command name
|
|
22
|
+
*/
|
|
5
23
|
static commandName = "make:transformer";
|
|
6
|
-
|
|
24
|
+
/**
|
|
25
|
+
* The command description
|
|
26
|
+
*/
|
|
27
|
+
static description = "Create a new transformer class in app/transformers for serializing data in API responses";
|
|
28
|
+
/**
|
|
29
|
+
* Command options configuration.
|
|
30
|
+
* Allows unknown flags to be passed through.
|
|
31
|
+
*/
|
|
7
32
|
static options = { allowUnknownFlags: true };
|
|
33
|
+
/**
|
|
34
|
+
* The stub template file to use for generating the transformer class
|
|
35
|
+
*/
|
|
8
36
|
stubPath = "make/transformer/main.stub";
|
|
37
|
+
/**
|
|
38
|
+
* Execute the command to create a new transformer class.
|
|
39
|
+
* Generates the transformer file with proper data serialization structure.
|
|
40
|
+
*/
|
|
9
41
|
async run() {
|
|
10
42
|
await (await this.createCodemods()).makeUsingStub(stubsRoot, this.stubPath, {
|
|
11
43
|
flags: this.parsed.flags,
|
|
@@ -16,4 +48,5 @@ var MakeTransformer = class extends BaseCommand {
|
|
|
16
48
|
};
|
|
17
49
|
__decorate([args.string({ description: "Entity name for which to generate the transformer" })], MakeTransformer.prototype, "name", void 0);
|
|
18
50
|
__decorate([flags.string({ description: "Use the contents of the given file as the generated output" })], MakeTransformer.prototype, "contentsFrom", void 0);
|
|
51
|
+
//#endregion
|
|
19
52
|
export { MakeTransformer as default };
|
|
@@ -1,14 +1,53 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import "../../chunk-Do49iUES.js";
|
|
2
|
+
import { t as stubsRoot } from "../../main-CfTiGsiS.js";
|
|
3
|
+
import { f as BaseCommand, l as flags, o as args } from "../../main-CRnMnrH7.js";
|
|
4
|
+
import { t as __decorate } from "../../decorate-B9Uz0anB.js";
|
|
5
|
+
//#region commands/make/validator.ts
|
|
6
|
+
/**
|
|
7
|
+
* Command to create a new VineJS validator file.
|
|
8
|
+
* Validators define reusable validation schemas for request validation,
|
|
9
|
+
* and can be generated as simple validators or resource-based validators
|
|
10
|
+
* with create and update schemas.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```
|
|
14
|
+
* ace make:validator UserValidator
|
|
15
|
+
* ace make:validator PostValidator --resource
|
|
16
|
+
* ace make:validator ContactValidator
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
4
19
|
var MakeValidator = class extends BaseCommand {
|
|
20
|
+
/**
|
|
21
|
+
* The command name
|
|
22
|
+
*/
|
|
5
23
|
static commandName = "make:validator";
|
|
6
|
-
|
|
24
|
+
/**
|
|
25
|
+
* The command description
|
|
26
|
+
*/
|
|
27
|
+
static description = "Create a new VineJS validator file in app/validators. Use --resource to generate both create and update validation schemas";
|
|
28
|
+
/**
|
|
29
|
+
* Command options configuration.
|
|
30
|
+
* Allows unknown flags to be passed through.
|
|
31
|
+
*/
|
|
7
32
|
static options = { allowUnknownFlags: true };
|
|
33
|
+
/**
|
|
34
|
+
* The stub template file to use for generating the validator
|
|
35
|
+
*/
|
|
8
36
|
stubPath = "make/validator/main.stub";
|
|
37
|
+
/**
|
|
38
|
+
* Prepare the command by selecting the appropriate stub based on options.
|
|
39
|
+
* Uses a resource stub when generating validators for CRUD operations.
|
|
40
|
+
*/
|
|
9
41
|
async prepare() {
|
|
42
|
+
/**
|
|
43
|
+
* Use resource stub
|
|
44
|
+
*/
|
|
10
45
|
if (this.resource) this.stubPath = "make/validator/resource.stub";
|
|
11
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* Execute the command to create a new VineJS validator file.
|
|
49
|
+
* Generates the validator with the appropriate stub template.
|
|
50
|
+
*/
|
|
12
51
|
async run() {
|
|
13
52
|
await (await this.createCodemods()).makeUsingStub(stubsRoot, this.stubPath, {
|
|
14
53
|
flags: this.parsed.flags,
|
|
@@ -19,4 +58,5 @@ var MakeValidator = class extends BaseCommand {
|
|
|
19
58
|
__decorate([args.string({ description: "Name of the validator file" })], MakeValidator.prototype, "name", void 0);
|
|
20
59
|
__decorate([flags.boolean({ description: "Create a file with pre-defined validators for create and update actions" })], MakeValidator.prototype, "resource", void 0);
|
|
21
60
|
__decorate([flags.string({ description: "Use the contents of the given file as the generated output" })], MakeValidator.prototype, "contentsFrom", void 0);
|
|
61
|
+
//#endregion
|
|
22
62
|
export { MakeValidator as default };
|
|
@@ -1,10 +1,38 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import "../../chunk-Do49iUES.js";
|
|
2
|
+
import { t as stubsRoot } from "../../main-CfTiGsiS.js";
|
|
3
|
+
import { f as BaseCommand, l as flags, o as args } from "../../main-CRnMnrH7.js";
|
|
4
|
+
import { t as __decorate } from "../../decorate-B9Uz0anB.js";
|
|
5
|
+
//#region commands/make/view.ts
|
|
6
|
+
/**
|
|
7
|
+
* Command to create a new Edge.js template file.
|
|
8
|
+
* Edge templates are used for rendering HTML views in your web application,
|
|
9
|
+
* supporting layouts, partials, components, and template inheritance.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```
|
|
13
|
+
* ace make:view home
|
|
14
|
+
* ace make:view users/profile
|
|
15
|
+
* ace make:view components/navbar
|
|
16
|
+
* ace make:view layouts/app
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
4
19
|
var MakeView = class extends BaseCommand {
|
|
20
|
+
/**
|
|
21
|
+
* The command name
|
|
22
|
+
*/
|
|
5
23
|
static commandName = "make:view";
|
|
6
|
-
|
|
24
|
+
/**
|
|
25
|
+
* The command description
|
|
26
|
+
*/
|
|
27
|
+
static description = "Create a new Edge.js template file in resources/views";
|
|
28
|
+
/**
|
|
29
|
+
* The stub template file to use for generating the Edge template
|
|
30
|
+
*/
|
|
7
31
|
stubPath = "make/view/main.stub";
|
|
32
|
+
/**
|
|
33
|
+
* Execute the command to create a new Edge.js template file.
|
|
34
|
+
* Generates the template file in the views directory.
|
|
35
|
+
*/
|
|
8
36
|
async run() {
|
|
9
37
|
await (await this.createCodemods()).makeUsingStub(stubsRoot, this.stubPath, {
|
|
10
38
|
flags: this.parsed.flags,
|
|
@@ -14,4 +42,5 @@ var MakeView = class extends BaseCommand {
|
|
|
14
42
|
};
|
|
15
43
|
__decorate([args.string({ description: "Name of the template" })], MakeView.prototype, "name", void 0);
|
|
16
44
|
__decorate([flags.string({ description: "Use the contents of the given file as the generated output" })], MakeView.prototype, "contentsFrom", void 0);
|
|
45
|
+
//#endregion
|
|
17
46
|
export { MakeView as default };
|
package/build/commands/repl.js
CHANGED
|
@@ -1,11 +1,39 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "../chunk-Do49iUES.js";
|
|
2
|
+
import { f as BaseCommand } from "../main-CRnMnrH7.js";
|
|
3
|
+
//#region commands/repl.ts
|
|
4
|
+
/**
|
|
5
|
+
* Command to start an interactive REPL (Read-Eval-Print Loop) session for AdonisJS.
|
|
6
|
+
* The REPL provides a command-line interface where you can execute JavaScript code
|
|
7
|
+
* in the context of your AdonisJS application, allowing you to interact with models,
|
|
8
|
+
* services, and other application components in real-time.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```
|
|
12
|
+
* ace repl
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
2
15
|
var ReplCommand = class extends BaseCommand {
|
|
16
|
+
/**
|
|
17
|
+
* The command name
|
|
18
|
+
*/
|
|
3
19
|
static commandName = "repl";
|
|
4
|
-
|
|
20
|
+
/**
|
|
21
|
+
* The command description
|
|
22
|
+
*/
|
|
23
|
+
static description = "Start an interactive REPL session with the application booted and IoC container available";
|
|
24
|
+
/**
|
|
25
|
+
* Command options configuration.
|
|
26
|
+
* Requires the application to be started and keeps the process alive.
|
|
27
|
+
*/
|
|
5
28
|
static options = {
|
|
6
29
|
startApp: true,
|
|
7
30
|
staysAlive: true
|
|
8
31
|
};
|
|
32
|
+
/**
|
|
33
|
+
* Execute the command to start the REPL server.
|
|
34
|
+
* Creates a REPL instance from the container and sets up an exit handler
|
|
35
|
+
* that properly terminates the application when the REPL session ends.
|
|
36
|
+
*/
|
|
9
37
|
async run() {
|
|
10
38
|
const repl = await this.app.container.make("repl");
|
|
11
39
|
repl.start();
|
|
@@ -14,4 +42,5 @@ var ReplCommand = class extends BaseCommand {
|
|
|
14
42
|
});
|
|
15
43
|
}
|
|
16
44
|
};
|
|
45
|
+
//#endregion
|
|
17
46
|
export { ReplCommand as default };
|
package/build/commands/serve.js
CHANGED
|
@@ -1,9 +1,34 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import "../chunk-Do49iUES.js";
|
|
2
|
+
import { t as importAssembler } from "../utils-CKwka7OL.js";
|
|
3
|
+
import { f as BaseCommand, l as flags } from "../main-CRnMnrH7.js";
|
|
4
|
+
import { t as __decorate } from "../decorate-B9Uz0anB.js";
|
|
5
|
+
//#region commands/serve.ts
|
|
6
|
+
/**
|
|
7
|
+
* Serve command is used to run the AdonisJS HTTP server during development. The
|
|
8
|
+
* command under the hood runs the "bin/server.ts" file and watches for file
|
|
9
|
+
* system changes
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```
|
|
13
|
+
* ace serve
|
|
14
|
+
* ace serve --watch
|
|
15
|
+
* ace serve --hmr
|
|
16
|
+
* ace serve --poll
|
|
17
|
+
* ace serve --no-clear
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
4
20
|
var Serve = class extends BaseCommand {
|
|
21
|
+
/**
|
|
22
|
+
* The command name
|
|
23
|
+
*/
|
|
5
24
|
static commandName = "serve";
|
|
6
|
-
|
|
25
|
+
/**
|
|
26
|
+
* The command description
|
|
27
|
+
*/
|
|
28
|
+
static description = "Start the development HTTP server. Use --watch for auto-restart on file change or --hmr for hot module replacement";
|
|
29
|
+
/**
|
|
30
|
+
* Help text for the command
|
|
31
|
+
*/
|
|
7
32
|
static help = [
|
|
8
33
|
"Start the development server with file watcher using the following command.",
|
|
9
34
|
"```",
|
|
@@ -21,7 +46,15 @@ var Serve = class extends BaseCommand {
|
|
|
21
46
|
"{{ binaryName }} serve --assets-args=\"--debug --base=/public\"",
|
|
22
47
|
"```"
|
|
23
48
|
];
|
|
49
|
+
/**
|
|
50
|
+
* Command options configuration
|
|
51
|
+
*/
|
|
24
52
|
static options = { staysAlive: true };
|
|
53
|
+
/**
|
|
54
|
+
* Log a development dependency is missing
|
|
55
|
+
*
|
|
56
|
+
* @param dependency - The name of the missing dependency
|
|
57
|
+
*/
|
|
25
58
|
#logMissingDevelopmentDependency(dependency) {
|
|
26
59
|
this.logger.error([
|
|
27
60
|
`Cannot find package "${dependency}"`,
|
|
@@ -31,6 +64,9 @@ var Serve = class extends BaseCommand {
|
|
|
31
64
|
"If you are running your application in production, then use \"node bin/server.js\" command to start the HTTP server"
|
|
32
65
|
].join("\n"));
|
|
33
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* Runs the HTTP server
|
|
69
|
+
*/
|
|
34
70
|
async run() {
|
|
35
71
|
const assembler = await importAssembler(this.app);
|
|
36
72
|
if (!assembler) {
|
|
@@ -51,15 +87,28 @@ var Serve = class extends BaseCommand {
|
|
|
51
87
|
metaFiles: this.app.rcFile.metaFiles,
|
|
52
88
|
hooks: this.app.rcFile.hooks
|
|
53
89
|
});
|
|
90
|
+
/**
|
|
91
|
+
* Share command logger with assembler, so that CLI flags like --no-ansi has
|
|
92
|
+
* similar impact for assembler logs as well.
|
|
93
|
+
*/
|
|
54
94
|
this.devServer.ui.logger = this.logger;
|
|
95
|
+
/**
|
|
96
|
+
* Exit command when the dev server is closed
|
|
97
|
+
*/
|
|
55
98
|
this.devServer.onClose((exitCode) => {
|
|
56
99
|
this.exitCode = exitCode;
|
|
57
100
|
this.terminate();
|
|
58
101
|
});
|
|
102
|
+
/**
|
|
103
|
+
* Exit command when the dev server crashes
|
|
104
|
+
*/
|
|
59
105
|
this.devServer.onError(() => {
|
|
60
106
|
this.exitCode = 1;
|
|
61
107
|
this.terminate();
|
|
62
108
|
});
|
|
109
|
+
/**
|
|
110
|
+
* Start the development server
|
|
111
|
+
*/
|
|
63
112
|
if (this.watch) await this.devServer.startAndWatch({ poll: this.poll || false });
|
|
64
113
|
else await this.devServer.start();
|
|
65
114
|
}
|
|
@@ -78,4 +127,5 @@ __decorate([flags.boolean({
|
|
|
78
127
|
showNegatedVariantInHelp: true,
|
|
79
128
|
default: true
|
|
80
129
|
})], Serve.prototype, "clear", void 0);
|
|
130
|
+
//#endregion
|
|
81
131
|
export { Serve as default };
|
package/build/commands/test.js
CHANGED
|
@@ -1,13 +1,47 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import "../chunk-Do49iUES.js";
|
|
2
|
+
import { t as importAssembler } from "../utils-CKwka7OL.js";
|
|
3
|
+
import { f as BaseCommand, l as flags, o as args } from "../main-CRnMnrH7.js";
|
|
4
|
+
import { t as __decorate } from "../decorate-B9Uz0anB.js";
|
|
5
|
+
//#region commands/test.ts
|
|
6
|
+
/**
|
|
7
|
+
* Command to run application tests using the Japa test runner.
|
|
8
|
+
* Supports filtering tests by suites, files, tags, groups, and individual tests.
|
|
9
|
+
* Can run in watch mode to automatically re-run tests when files change.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```
|
|
13
|
+
* ace test
|
|
14
|
+
* ace test unit integration
|
|
15
|
+
* ace test --watch
|
|
16
|
+
* ace test --files=user.spec.ts
|
|
17
|
+
* ace test --tags=slow --groups="User tests"
|
|
18
|
+
* ace test --reporters=spec,dot
|
|
19
|
+
* ace test --timeout=5000 --retries=2
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
4
22
|
var Test = class extends BaseCommand {
|
|
23
|
+
/**
|
|
24
|
+
* The command name
|
|
25
|
+
*/
|
|
5
26
|
static commandName = "test";
|
|
6
|
-
|
|
27
|
+
/**
|
|
28
|
+
* The command description
|
|
29
|
+
*/
|
|
30
|
+
static description = "Run tests using Japa test runner. Supports filtering by suite, file, tag, and group. Use --watch for re-runs on file change";
|
|
31
|
+
/**
|
|
32
|
+
* Command options configuration.
|
|
33
|
+
* Allows unknown flags to be passed to Japa and keeps the process alive.
|
|
34
|
+
*/
|
|
7
35
|
static options = {
|
|
8
36
|
allowUnknownFlags: true,
|
|
9
37
|
staysAlive: true
|
|
10
38
|
};
|
|
39
|
+
/**
|
|
40
|
+
* Log an error message when a required development dependency is missing.
|
|
41
|
+
* Provides helpful instructions for resolving the issue.
|
|
42
|
+
*
|
|
43
|
+
* @param dependency - The name of the missing dependency package
|
|
44
|
+
*/
|
|
11
45
|
#logMissingDevelopmentDependency(dependency) {
|
|
12
46
|
this.logger.error([
|
|
13
47
|
`Cannot find package "${dependency}"`,
|
|
@@ -17,14 +51,31 @@ var Test = class extends BaseCommand {
|
|
|
17
51
|
"If you are run tests inside a CI, make sure the NODE_ENV is set to \"development\""
|
|
18
52
|
].join("\n"));
|
|
19
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* Collect unknown flags and format them to pass to the Japa test runner.
|
|
56
|
+
* Handles boolean flags, arrays, and single values appropriately.
|
|
57
|
+
*
|
|
58
|
+
* @returns Array of formatted command-line arguments for Japa
|
|
59
|
+
*/
|
|
20
60
|
#getPassthroughFlags() {
|
|
21
61
|
return this.parsed.unknownFlags.map((flag) => {
|
|
22
62
|
const value = this.parsed.flags[flag];
|
|
63
|
+
/**
|
|
64
|
+
* Not mentioning value when value is "true"
|
|
65
|
+
*/
|
|
23
66
|
if (value === true) return [`--${flag}`];
|
|
67
|
+
/**
|
|
68
|
+
* Repeating flag multiple times when value is an array
|
|
69
|
+
*/
|
|
24
70
|
if (Array.isArray(value)) return value.map((v) => [`--${flag}`, v]);
|
|
25
71
|
return [`--${flag}`, value];
|
|
26
72
|
}).flat(2);
|
|
27
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* Execute the test command. Sets up the test runner with all configured options
|
|
76
|
+
* and filters, then runs tests either once or in watch mode. Handles missing
|
|
77
|
+
* dependencies and properly configures the test environment.
|
|
78
|
+
*/
|
|
28
79
|
async run() {
|
|
29
80
|
process.env.NODE_ENV = "test";
|
|
30
81
|
const assembler = await importAssembler(this.app);
|
|
@@ -58,15 +109,28 @@ var Test = class extends BaseCommand {
|
|
|
58
109
|
hooks: this.app.rcFile.hooks,
|
|
59
110
|
metaFiles: this.app.rcFile.metaFiles
|
|
60
111
|
});
|
|
112
|
+
/**
|
|
113
|
+
* Share command logger with assembler, so that CLI flags like --no-ansi has
|
|
114
|
+
* similar impact for assembler logs as well.
|
|
115
|
+
*/
|
|
61
116
|
this.testsRunner.ui.logger = this.logger;
|
|
117
|
+
/**
|
|
118
|
+
* Exit command when the test runner is closed
|
|
119
|
+
*/
|
|
62
120
|
this.testsRunner.onClose((exitCode) => {
|
|
63
121
|
this.exitCode = exitCode;
|
|
64
122
|
this.terminate();
|
|
65
123
|
});
|
|
124
|
+
/**
|
|
125
|
+
* Exit command when the dev server crashes
|
|
126
|
+
*/
|
|
66
127
|
this.testsRunner.onError(() => {
|
|
67
128
|
this.exitCode = 1;
|
|
68
129
|
this.terminate();
|
|
69
130
|
});
|
|
131
|
+
/**
|
|
132
|
+
* Start the test runner in watch mode
|
|
133
|
+
*/
|
|
70
134
|
if (this.watch) await this.testsRunner.runAndWatch({ poll: this.poll || false });
|
|
71
135
|
else await this.testsRunner.run();
|
|
72
136
|
}
|
|
@@ -90,4 +154,5 @@ __decorate([flags.boolean({
|
|
|
90
154
|
showNegatedVariantInHelp: true,
|
|
91
155
|
default: true
|
|
92
156
|
})], Test.prototype, "clear", void 0);
|
|
157
|
+
//#endregion
|
|
93
158
|
export { Test as default };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { n as __reExport, t as __exportAll } from "./chunk-Do49iUES.js";
|
|
2
|
+
//#region modules/config.ts
|
|
3
|
+
var config_exports = /* @__PURE__ */ __exportAll({});
|
|
4
|
+
import * as import__adonisjs_config from "@adonisjs/config";
|
|
5
|
+
__reExport(config_exports, import__adonisjs_config);
|
|
6
|
+
//#endregion
|
|
7
|
+
export { config_exports as t };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
//#region src/config_provider.ts
|
|
2
|
+
/**
|
|
3
|
+
* Helper utilities to create and resolve config providers. Config providers
|
|
4
|
+
* are used to defer configuration resolution until the application is booted,
|
|
5
|
+
* allowing access to environment variables and other application services.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* // Creating a database config provider
|
|
9
|
+
* const databaseConfig = configProvider.create(async (app) => ({
|
|
10
|
+
* connection: app.env.get('DB_CONNECTION', 'sqlite'),
|
|
11
|
+
* host: app.env.get('DB_HOST', 'localhost'),
|
|
12
|
+
* port: app.env.get('DB_PORT', 5432)
|
|
13
|
+
* }))
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* // Resolving a config provider
|
|
17
|
+
* const config = await configProvider.resolve(app, databaseConfig)
|
|
18
|
+
* if (config) {
|
|
19
|
+
* console.log(`Database connection: ${config.connection}`)
|
|
20
|
+
* }
|
|
21
|
+
*/
|
|
22
|
+
const configProvider = {
|
|
23
|
+
create(resolver) {
|
|
24
|
+
return {
|
|
25
|
+
type: "provider",
|
|
26
|
+
resolver
|
|
27
|
+
};
|
|
28
|
+
},
|
|
29
|
+
async resolve(app, provider) {
|
|
30
|
+
if (provider && typeof provider === "object" && "type" in provider) return provider.resolver(app);
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
//#endregion
|
|
35
|
+
export { configProvider as t };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { n as __reExport, t as __exportAll } from "./chunk-Do49iUES.js";
|
|
2
|
+
//#region modules/container.ts
|
|
3
|
+
var container_exports = /* @__PURE__ */ __exportAll({});
|
|
4
|
+
import * as import__adonisjs_fold from "@adonisjs/fold";
|
|
5
|
+
__reExport(container_exports, import__adonisjs_fold);
|
|
6
|
+
//#endregion
|
|
7
|
+
export { container_exports as t };
|
|
@@ -1,10 +1,49 @@
|
|
|
1
|
-
import stringHelpers from "./
|
|
2
|
-
import { r as outputTransformerDataObjects } from "./utils-
|
|
1
|
+
import { t as stringHelpers } from "./string-8_8He-HH.js";
|
|
2
|
+
import { r as outputTransformerDataObjects } from "./utils-CKwka7OL.js";
|
|
3
3
|
import { errors } from "@adonisjs/ace";
|
|
4
4
|
import { errors as errors$1 } from "@adonisjs/env";
|
|
5
5
|
import { errors as errors$2 } from "@adonisjs/application";
|
|
6
6
|
import { errors as errors$3 } from "@boringnode/encryption";
|
|
7
7
|
import { errors as errors$4 } from "@adonisjs/http-server";
|
|
8
|
+
//#region src/assembler_hooks/index_entities.ts
|
|
9
|
+
/**
|
|
10
|
+
* Configures the IndexGenerator to create barrel files for "controllers", "events",
|
|
11
|
+
* and "listeners". This function is used as an assembler hook to automatically generate
|
|
12
|
+
* index files that export all modules from specified directories.
|
|
13
|
+
*
|
|
14
|
+
* @param {IndexEntitiesConfig} entities - Configuration object for entities indexing
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* // Basic usage with default configuration
|
|
18
|
+
* indexEntities({})
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* // Custom configuration for specific entities
|
|
22
|
+
* indexEntities({
|
|
23
|
+
* events: {
|
|
24
|
+
* enabled: true,
|
|
25
|
+
* source: 'app/custom-events',
|
|
26
|
+
* importAlias: '#custom-events'
|
|
27
|
+
* },
|
|
28
|
+
* transformers: {
|
|
29
|
+
* enabled: true,
|
|
30
|
+
* withSharedProps: true,
|
|
31
|
+
* inertiaMiddlewareImportPath: '#middleware/inertia_middleware'
|
|
32
|
+
* },
|
|
33
|
+
* controllers: {
|
|
34
|
+
* enabled: false
|
|
35
|
+
* }
|
|
36
|
+
* })
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* // Using custom glob patterns
|
|
40
|
+
* indexEntities({
|
|
41
|
+
* listeners: {
|
|
42
|
+
* source: 'app/handlers',
|
|
43
|
+
* glob: '**\/*_handler.ts'
|
|
44
|
+
* }
|
|
45
|
+
* })
|
|
46
|
+
*/
|
|
8
47
|
function indexEntities(entities = {}) {
|
|
9
48
|
const events = Object.assign({
|
|
10
49
|
enabled: true,
|
|
@@ -123,6 +162,11 @@ function indexEntities(entities = {}) {
|
|
|
123
162
|
});
|
|
124
163
|
} };
|
|
125
164
|
}
|
|
165
|
+
//#endregion
|
|
166
|
+
//#region index.ts
|
|
167
|
+
/**
|
|
168
|
+
* Aggregated errors from all modules.
|
|
169
|
+
*/
|
|
126
170
|
const errors$5 = {
|
|
127
171
|
...errors$3,
|
|
128
172
|
...errors$4,
|
|
@@ -130,6 +174,10 @@ const errors$5 = {
|
|
|
130
174
|
...errors,
|
|
131
175
|
...errors$1
|
|
132
176
|
};
|
|
177
|
+
/**
|
|
178
|
+
* Pretty prints an error with colorful output using
|
|
179
|
+
* Youch terminal
|
|
180
|
+
*/
|
|
133
181
|
async function prettyPrintError(error) {
|
|
134
182
|
if (error && typeof error === "object" && error.code === "E_DUMP_DIE_EXCEPTION") {
|
|
135
183
|
console.error(error);
|
|
@@ -143,4 +191,5 @@ async function prettyPrintError(error) {
|
|
|
143
191
|
console.error(error);
|
|
144
192
|
}
|
|
145
193
|
}
|
|
194
|
+
//#endregion
|
|
146
195
|
export { prettyPrintError as n, indexEntities as r, errors$5 as t };
|
|
@@ -1,10 +1,40 @@
|
|
|
1
|
-
import { d as Kernel, n as HelpCommand, t as FsLoader } from "./main-
|
|
1
|
+
import { d as Kernel, n as HelpCommand, t as FsLoader } from "./main-CRnMnrH7.js";
|
|
2
|
+
//#region modules/ace/create_kernel.ts
|
|
3
|
+
/**
|
|
4
|
+
* Create and configure an Ace command kernel for AdonisJS applications.
|
|
5
|
+
* This function abstracts the kernel setup logic and can be used in different
|
|
6
|
+
* environments with appropriate configurations.
|
|
7
|
+
*
|
|
8
|
+
* - In console environment, Ace manages the lifecycle of the process
|
|
9
|
+
* - In other environments, Ace can be pulled from the container to run commands
|
|
10
|
+
*
|
|
11
|
+
* @param app - The AdonisJS application service instance
|
|
12
|
+
* @param commandName - Optional specific command name for optimized loading
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* const app = new Application(new URL('../', import.meta.url))
|
|
17
|
+
* const kernel = createAceKernel(app)
|
|
18
|
+
*
|
|
19
|
+
* // Run a specific command
|
|
20
|
+
* await kernel.handle(['make:controller', 'UserController'])
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
2
23
|
function createAceKernel(app, commandName) {
|
|
3
24
|
const kernel = new Kernel(app);
|
|
4
25
|
kernel.info.set("binary", "node ace");
|
|
26
|
+
/**
|
|
27
|
+
* Lazy import commands mentioned in the "commands" array
|
|
28
|
+
* of rcFile
|
|
29
|
+
*/
|
|
5
30
|
app.rcFile.commands.forEach((commandModule) => {
|
|
6
31
|
kernel.addLoader(() => typeof commandModule === "function" ? commandModule() : app.import(commandModule));
|
|
7
32
|
});
|
|
33
|
+
/**
|
|
34
|
+
* When we know the command we are running ahead of time, then we
|
|
35
|
+
* defer loading the application commands if the command has
|
|
36
|
+
* already been registered by other loaders.
|
|
37
|
+
*/
|
|
8
38
|
const fsLoader = new FsLoader(app.commandsPath());
|
|
9
39
|
kernel.addLoader({
|
|
10
40
|
async getMetaData() {
|
|
@@ -15,6 +45,9 @@ function createAceKernel(app, commandName) {
|
|
|
15
45
|
return fsLoader.getCommand(command);
|
|
16
46
|
}
|
|
17
47
|
});
|
|
48
|
+
/**
|
|
49
|
+
* Custom global flags
|
|
50
|
+
*/
|
|
18
51
|
kernel.defineFlag("ansi", {
|
|
19
52
|
type: "boolean",
|
|
20
53
|
showNegatedVariantInHelp: true,
|
|
@@ -24,10 +57,16 @@ function createAceKernel(app, commandName) {
|
|
|
24
57
|
type: "boolean",
|
|
25
58
|
description: HelpCommand.description
|
|
26
59
|
});
|
|
60
|
+
/**
|
|
61
|
+
* Flag listener to turn colors on/off
|
|
62
|
+
*/
|
|
27
63
|
kernel.on("ansi", (_, $kernel, parsed) => {
|
|
28
64
|
if (parsed.flags.ansi === false) $kernel.ui.switchMode("silent");
|
|
29
65
|
if (parsed.flags.ansi === true) $kernel.ui.switchMode("normal");
|
|
30
66
|
});
|
|
67
|
+
/**
|
|
68
|
+
* Flag listener to display the help
|
|
69
|
+
*/
|
|
31
70
|
kernel.on("help", async (command, $kernel, parsed) => {
|
|
32
71
|
parsed.args.unshift(command.commandName);
|
|
33
72
|
await new HelpCommand($kernel, parsed, kernel.ui, kernel.prompt).exec();
|
|
@@ -35,4 +74,5 @@ function createAceKernel(app, commandName) {
|
|
|
35
74
|
});
|
|
36
75
|
return kernel;
|
|
37
76
|
}
|
|
77
|
+
//#endregion
|
|
38
78
|
export { createAceKernel as t };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { debuglog } from "node:util";
|
|
2
|
+
//#region src/debug.ts
|
|
3
|
+
/**
|
|
4
|
+
* Debug utility for AdonisJS core. This uses Node.js built-in debuglog
|
|
5
|
+
* utility to provide debugging information when the NODE_DEBUG environment
|
|
6
|
+
* variable includes 'adonisjs:core'.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* // Enable debugging by setting environment variable
|
|
10
|
+
* // NODE_DEBUG=adonisjs:core node app.js
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* // Usage in code
|
|
14
|
+
* import debug from '@adonisjs/core/debug'
|
|
15
|
+
* debug('Application started')
|
|
16
|
+
* debug('Processing request: %s', req.url)
|
|
17
|
+
*/
|
|
18
|
+
var debug_default = debuglog("adonisjs:core");
|
|
19
|
+
//#endregion
|
|
20
|
+
export { debug_default as t };
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
//#region \0@oxc-project+runtime@0.115.0/helpers/decorate.js
|
|
1
2
|
function __decorate(decorators, target, key, desc) {
|
|
2
3
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
4
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
5
|
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;
|
|
5
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
7
|
}
|
|
8
|
+
//#endregion
|
|
7
9
|
export { __decorate as t };
|