@adonisjs/core 7.0.0-next.2 → 7.0.0-next.20
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-sWl9sgM1.js +16 -0
- package/build/app-B6oge7b3.js +5 -0
- package/build/app-DNvbxVWl.js +5 -0
- package/build/bodyparser_middleware-BmARtnYe.js +3 -0
- package/build/chunk-B88MteZI.js +26 -0
- package/build/commands/add.d.ts +4 -3
- package/build/commands/add.js +76 -110
- package/build/commands/build.js +51 -107
- package/build/commands/commands.json +1 -1
- package/build/commands/configure.js +82 -177
- package/build/commands/eject.js +17 -60
- package/build/commands/env/add.js +55 -134
- package/build/commands/generate_key.js +22 -66
- package/build/commands/inspect_rcfile.js +27 -55
- package/build/commands/list/routes.js +246 -116
- package/build/commands/make/command.js +15 -57
- package/build/commands/make/controller.js +43 -120
- package/build/commands/make/event.js +16 -62
- package/build/commands/make/exception.js +16 -62
- package/build/commands/make/listener.js +36 -93
- package/build/commands/make/middleware.js +41 -101
- package/build/commands/make/preload.js +47 -113
- package/build/commands/make/provider.js +47 -112
- package/build/commands/make/service.js +16 -55
- package/build/commands/make/test.js +47 -132
- package/build/commands/make/transformer.js +17 -64
- package/build/commands/make/validator.js +20 -80
- package/build/commands/make/view.js +15 -56
- package/build/commands/repl.js +17 -50
- package/build/commands/serve.js +80 -156
- package/build/commands/test.js +92 -208
- package/build/config-Dd2H6-_e.js +5 -0
- package/build/config_provider-DWVFHOQX.js +15 -0
- package/build/container-uxa8LpGI.js +5 -0
- package/build/core-BuPP8K6N.js +140 -0
- package/build/create_kernel-Cn8zVtvt.js +3 -0
- package/build/create_kernel-Cpqqa931.js +38 -0
- package/build/decorate-CJcHOoD-.js +7 -0
- package/build/define_config-CoWy5lbf.js +62 -0
- package/build/dumper-BTjb8j4y.js +147 -0
- package/build/edge-BVYR-Vjr.js +47 -0
- package/build/events-C4d0OPUI.js +5 -0
- package/build/exceptions-DNMesP42.js +2 -0
- package/build/factories/app.js +2 -9
- package/build/factories/bodyparser.js +2 -9
- package/build/factories/core/ace.js +16 -46
- package/build/factories/core/ignitor.js +13 -180
- package/build/factories/core/main.js +24 -11
- package/build/factories/core/test_utils.js +21 -43
- package/build/factories/encryption.d.ts +1 -1
- package/build/factories/encryption.js +2 -9
- package/build/factories/events.js +2 -9
- package/build/factories/hash.js +2 -9
- package/build/factories/http.js +2 -9
- package/build/factories/logger.js +2 -9
- package/build/factories/stubs.js +27 -91
- package/build/ignitor-BrmVPN5N.js +71 -0
- package/build/index.d.ts +1 -1
- package/build/index.js +12 -46
- package/build/logger-0KKSqgPG.js +13 -0
- package/build/main-BU8NWUEG.js +73 -0
- package/build/main-Bfnr5tAw.js +2 -0
- package/build/main-BlJhxJJ2.js +81 -0
- package/build/main-C4B2SPOT.js +5 -0
- package/build/main-CZZ21eXm.js +171 -0
- package/build/main-D-WhqOOn.js +51 -0
- package/build/main-DOY5Q8Av.js +5 -0
- package/build/main-kn40V-hF.js +2 -0
- package/build/main-nojlltNo.js +30 -0
- package/build/{stubs/make → make}/health/controller.stub +5 -2
- package/build/modules/ace/codemods.d.ts +109 -14
- package/build/modules/ace/codemods.js +222 -382
- package/build/modules/ace/main.d.ts +30 -0
- package/build/modules/ace/main.js +2 -11
- package/build/modules/app.d.ts +17 -0
- package/build/modules/app.js +4 -9
- package/build/modules/bodyparser/bodyparser_middleware.js +2 -14
- package/build/modules/bodyparser/main.js +4 -9
- package/build/modules/config.d.ts +17 -0
- package/build/modules/config.js +4 -9
- package/build/modules/container.js +4 -9
- package/build/modules/dumper/dumper.d.ts +5 -0
- package/build/modules/dumper/main.d.ts +21 -0
- package/build/modules/dumper/main.js +6 -11
- package/build/modules/dumper/plugins/edge.js +2 -62
- package/build/modules/encryption/define_config.d.ts +128 -0
- package/build/modules/encryption/drivers/aes_256_cbc.d.ts +20 -0
- package/build/modules/encryption/drivers/aes_256_cbc.js +2 -0
- package/build/modules/encryption/drivers/aes_256_gcm.d.ts +21 -0
- package/build/modules/encryption/drivers/aes_256_gcm.js +2 -0
- package/build/modules/encryption/drivers/chacha20_poly1305.d.ts +21 -0
- package/build/modules/encryption/drivers/chacha20_poly1305.js +2 -0
- package/build/modules/encryption/main.d.ts +85 -0
- package/build/modules/encryption/main.js +5 -0
- package/build/modules/env/editor.js +2 -9
- package/build/modules/env/main.d.ts +19 -0
- package/build/modules/env/main.js +2 -9
- package/build/modules/events.js +4 -9
- package/build/modules/hash/drivers/argon.js +2 -9
- package/build/modules/hash/drivers/bcrypt.d.ts +11 -0
- package/build/modules/hash/drivers/bcrypt.js +2 -9
- package/build/modules/hash/drivers/scrypt.js +2 -9
- package/build/modules/hash/main.d.ts +18 -0
- package/build/modules/hash/main.js +5 -10
- package/build/modules/hash/phc_formatter.js +2 -9
- package/build/modules/health.js +2 -9
- package/build/modules/http/main.js +4 -15
- package/build/modules/http/request_validator.d.ts +1 -3
- package/build/modules/http/url_builder_client.d.ts +1 -0
- package/build/modules/http/url_builder_client.js +2 -0
- package/build/modules/logger.d.ts +30 -0
- package/build/modules/logger.js +4 -9
- package/build/modules/repl.js +4 -9
- package/build/modules/transformers/main.js +4 -9
- package/build/providers/app_provider.d.ts +14 -25
- package/build/providers/app_provider.js +155 -363
- package/build/providers/edge_provider.js +97 -114
- package/build/providers/hash_provider.js +28 -91
- package/build/providers/repl_provider.js +66 -152
- package/build/providers/vinejs_provider.d.ts +1 -1
- package/build/providers/vinejs_provider.js +19 -66
- package/build/repl-GSxgovJQ.js +5 -0
- package/build/services/ace.js +2 -17
- package/build/services/app.js +2 -21
- package/build/services/config.js +2 -13
- package/build/services/dumper.js +5 -21
- package/build/services/emitter.js +2 -14
- package/build/services/encryption.js +2 -14
- package/build/services/hash.js +2 -14
- package/build/services/logger.js +2 -14
- package/build/services/repl.js +2 -14
- package/build/services/router.js +2 -14
- package/build/services/server.js +2 -14
- package/build/services/test_utils.js +2 -17
- package/build/services/url_builder.d.ts +3 -3
- package/build/services/url_builder.js +5 -17
- package/build/src/assembler_hooks/index_entities.d.ts +29 -1
- package/build/src/debug.d.ts +1 -1
- package/build/src/exceptions.js +2 -49
- package/build/src/helpers/assert.js +2 -55
- package/build/src/helpers/http.d.ts +20 -0
- package/build/src/helpers/http.js +2 -0
- package/build/src/helpers/is.js +3 -31
- package/build/src/helpers/main.d.ts +1 -5
- package/build/src/helpers/main.js +5 -56
- package/build/src/helpers/string.js +2 -60
- package/build/src/helpers/types.js +26 -135
- package/build/src/helpers/verification_token.js +2 -120
- package/build/src/test_utils/main.js +8 -77
- package/build/src/types.d.ts +53 -99
- package/build/src/types.js +0 -8
- package/build/src/utils.d.ts +1 -1
- package/build/src/vine.js +2 -97
- package/build/string-Cx6q_win.js +28 -0
- package/build/test_utils-hkQDmNpX.js +10 -0
- package/build/toolkit/main.js +19 -21
- package/build/types/ace.js +2 -9
- package/build/types/app.js +2 -9
- package/build/types/bodyparser.js +2 -9
- package/build/types/common.js +2 -9
- package/build/types/container.js +2 -9
- package/build/types/encryption.d.ts +39 -1
- package/build/types/encryption.js +1 -9
- package/build/types/events.js +2 -9
- package/build/types/hash.js +2 -9
- package/build/types/health.js +2 -9
- package/build/types/helpers.d.ts +20 -0
- package/build/types/helpers.js +0 -8
- package/build/types/http.js +2 -9
- package/build/types/logger.js +2 -9
- package/build/types/repl.js +2 -9
- package/build/types/transformers.js +2 -9
- package/build/utils-CtGytdtt.js +42 -0
- package/build/verification_token-DrdoU4RH.js +46 -0
- package/build/vine-DGint2rk.js +32 -0
- package/package.json +113 -60
- package/build/modules/ace/commands.js +0 -157
- package/build/modules/ace/create_kernel.js +0 -91
- package/build/modules/ace/kernel.js +0 -40
- package/build/modules/dumper/define_config.js +0 -36
- package/build/modules/dumper/dumper.js +0 -256
- package/build/modules/dumper/errors.js +0 -119
- package/build/modules/encryption.d.ts +0 -1
- package/build/modules/encryption.js +0 -9
- package/build/modules/hash/define_config.js +0 -125
- package/build/modules/http/request_validator.js +0 -100
- package/build/src/assembler_hooks/index_entities.js +0 -107
- package/build/src/cli_formatters/routes_list.js +0 -381
- package/build/src/config_provider.js +0 -71
- package/build/src/debug.js +0 -25
- package/build/src/ignitor/ace.js +0 -102
- package/build/src/ignitor/http.js +0 -146
- package/build/src/ignitor/main.js +0 -124
- package/build/src/ignitor/test.js +0 -66
- package/build/src/test_utils/http.js +0 -82
- package/build/src/utils.js +0 -104
- package/build/stubs/main.js +0 -9
- package/build/toolkit/commands/index_commands.js +0 -30
- /package/build/{stubs/make → make}/command/main.stub +0 -0
- /package/build/{stubs/make → make}/controller/actions.stub +0 -0
- /package/build/{stubs/make → make}/controller/api.stub +0 -0
- /package/build/{stubs/make → make}/controller/main.stub +0 -0
- /package/build/{stubs/make → make}/controller/resource.stub +0 -0
- /package/build/{stubs/make → make}/event/main.stub +0 -0
- /package/build/{stubs/make → make}/exception/main.stub +0 -0
- /package/build/{stubs/make → make}/health/main.stub +0 -0
- /package/build/{stubs/make → make}/listener/for_event.stub +0 -0
- /package/build/{stubs/make → make}/listener/main.stub +0 -0
- /package/build/{stubs/make → make}/middleware/main.stub +0 -0
- /package/build/{stubs/make → make}/preload/main.stub +0 -0
- /package/build/{stubs/make → make}/provider/main.stub +0 -0
- /package/build/{stubs/make → make}/service/main.stub +0 -0
- /package/build/{stubs/make → make}/test/main.stub +0 -0
- /package/build/{stubs/make → make}/transformer/main.stub +0 -0
- /package/build/{stubs/make → make}/validator/main.stub +0 -0
- /package/build/{stubs/make → make}/validator/resource.stub +0 -0
- /package/build/{stubs/make → make}/view/main.stub +0 -0
package/build/commands/test.js
CHANGED
|
@@ -1,209 +1,93 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { t as importAssembler } from "../utils-CtGytdtt.js";
|
|
2
|
+
import { f as BaseCommand, l as flags, o as args } from "../main-BlJhxJJ2.js";
|
|
3
|
+
import { t as __decorate } from "../decorate-CJcHOoD-.js";
|
|
4
|
+
var Test = class extends BaseCommand {
|
|
5
|
+
static commandName = "test";
|
|
6
|
+
static description = "Run tests along with the file watcher to re-run tests on file change";
|
|
7
|
+
static options = {
|
|
8
|
+
allowUnknownFlags: true,
|
|
9
|
+
staysAlive: true
|
|
10
|
+
};
|
|
11
|
+
#logMissingDevelopmentDependency(dependency) {
|
|
12
|
+
this.logger.error([
|
|
13
|
+
`Cannot find package "${dependency}"`,
|
|
14
|
+
"",
|
|
15
|
+
`The "${dependency}" package is a development dependency and therefore you should run tests with development dependencies installed.`,
|
|
16
|
+
"",
|
|
17
|
+
"If you are run tests inside a CI, make sure the NODE_ENV is set to \"development\""
|
|
18
|
+
].join("\n"));
|
|
19
|
+
}
|
|
20
|
+
#getPassthroughFlags() {
|
|
21
|
+
return this.parsed.unknownFlags.map((flag) => {
|
|
22
|
+
const value = this.parsed.flags[flag];
|
|
23
|
+
if (value === true) return [`--${flag}`];
|
|
24
|
+
if (Array.isArray(value)) return value.map((v) => [`--${flag}`, v]);
|
|
25
|
+
return [`--${flag}`, value];
|
|
26
|
+
}).flat(2);
|
|
27
|
+
}
|
|
28
|
+
async run() {
|
|
29
|
+
process.env.NODE_ENV = "test";
|
|
30
|
+
const assembler = await importAssembler(this.app);
|
|
31
|
+
if (!assembler) {
|
|
32
|
+
this.#logMissingDevelopmentDependency("@adonisjs/assembler");
|
|
33
|
+
this.exitCode = 1;
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
this.testsRunner = new assembler.TestRunner(this.app.appRoot, {
|
|
37
|
+
clearScreen: this.clear === false ? false : true,
|
|
38
|
+
nodeArgs: this.parsed.nodeArgs,
|
|
39
|
+
scriptArgs: this.#getPassthroughFlags(),
|
|
40
|
+
filters: {
|
|
41
|
+
suites: this.suites,
|
|
42
|
+
files: this.files,
|
|
43
|
+
groups: this.groups,
|
|
44
|
+
tags: this.tags,
|
|
45
|
+
tests: this.tests
|
|
46
|
+
},
|
|
47
|
+
failed: this.failed,
|
|
48
|
+
retries: this.retries,
|
|
49
|
+
timeout: this.timeout,
|
|
50
|
+
reporters: this.reporters,
|
|
51
|
+
suites: this.app.rcFile.tests.suites.map((suite) => {
|
|
52
|
+
return {
|
|
53
|
+
name: suite.name,
|
|
54
|
+
files: suite.files
|
|
55
|
+
};
|
|
56
|
+
}),
|
|
57
|
+
env: { NODE_ENV: "test" },
|
|
58
|
+
hooks: this.app.rcFile.hooks,
|
|
59
|
+
metaFiles: this.app.rcFile.metaFiles
|
|
60
|
+
});
|
|
61
|
+
this.testsRunner.ui.logger = this.logger;
|
|
62
|
+
this.testsRunner.onClose((exitCode) => {
|
|
63
|
+
this.exitCode = exitCode;
|
|
64
|
+
this.terminate();
|
|
65
|
+
});
|
|
66
|
+
this.testsRunner.onError(() => {
|
|
67
|
+
this.exitCode = 1;
|
|
68
|
+
this.terminate();
|
|
69
|
+
});
|
|
70
|
+
if (this.watch) await this.testsRunner.runAndWatch({ poll: this.poll || false });
|
|
71
|
+
else await this.testsRunner.run();
|
|
72
|
+
}
|
|
14
73
|
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
* The command name
|
|
36
|
-
*/
|
|
37
|
-
static commandName = 'test';
|
|
38
|
-
/**
|
|
39
|
-
* The command description
|
|
40
|
-
*/
|
|
41
|
-
static description = 'Run tests along with the file watcher to re-run tests on file change';
|
|
42
|
-
/**
|
|
43
|
-
* Command options configuration.
|
|
44
|
-
* Allows unknown flags to be passed to Japa and keeps the process alive.
|
|
45
|
-
*/
|
|
46
|
-
static options = {
|
|
47
|
-
allowUnknownFlags: true,
|
|
48
|
-
staysAlive: true,
|
|
49
|
-
};
|
|
50
|
-
/**
|
|
51
|
-
* Log an error message when a required development dependency is missing.
|
|
52
|
-
* Provides helpful instructions for resolving the issue.
|
|
53
|
-
*
|
|
54
|
-
* @param dependency - The name of the missing dependency package
|
|
55
|
-
*/
|
|
56
|
-
#logMissingDevelopmentDependency(dependency) {
|
|
57
|
-
this.logger.error([
|
|
58
|
-
`Cannot find package "${dependency}"`,
|
|
59
|
-
'',
|
|
60
|
-
`The "${dependency}" package is a development dependency and therefore you should run tests with development dependencies installed.`,
|
|
61
|
-
'',
|
|
62
|
-
'If you are run tests inside a CI, make sure the NODE_ENV is set to "development"',
|
|
63
|
-
].join('\n'));
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Collect unknown flags and format them to pass to the Japa test runner.
|
|
67
|
-
* Handles boolean flags, arrays, and single values appropriately.
|
|
68
|
-
*
|
|
69
|
-
* @returns Array of formatted command-line arguments for Japa
|
|
70
|
-
*/
|
|
71
|
-
#getPassthroughFlags() {
|
|
72
|
-
return this.parsed.unknownFlags
|
|
73
|
-
.map((flag) => {
|
|
74
|
-
const value = this.parsed.flags[flag];
|
|
75
|
-
/**
|
|
76
|
-
* Not mentioning value when value is "true"
|
|
77
|
-
*/
|
|
78
|
-
if (value === true) {
|
|
79
|
-
return [`--${flag}`];
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Repeating flag multiple times when value is an array
|
|
83
|
-
*/
|
|
84
|
-
if (Array.isArray(value)) {
|
|
85
|
-
return value.map((v) => [`--${flag}`, v]);
|
|
86
|
-
}
|
|
87
|
-
return [`--${flag}`, value];
|
|
88
|
-
})
|
|
89
|
-
.flat(2);
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* Execute the test command. Sets up the test runner with all configured options
|
|
93
|
-
* and filters, then runs tests either once or in watch mode. Handles missing
|
|
94
|
-
* dependencies and properly configures the test environment.
|
|
95
|
-
*/
|
|
96
|
-
async run() {
|
|
97
|
-
process.env.NODE_ENV = 'test';
|
|
98
|
-
const assembler = await importAssembler(this.app);
|
|
99
|
-
if (!assembler) {
|
|
100
|
-
this.#logMissingDevelopmentDependency('@adonisjs/assembler');
|
|
101
|
-
this.exitCode = 1;
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
this.testsRunner = new assembler.TestRunner(this.app.appRoot, {
|
|
105
|
-
clearScreen: this.clear === false ? false : true,
|
|
106
|
-
nodeArgs: this.parsed.nodeArgs,
|
|
107
|
-
scriptArgs: this.#getPassthroughFlags(),
|
|
108
|
-
filters: {
|
|
109
|
-
suites: this.suites,
|
|
110
|
-
files: this.files,
|
|
111
|
-
groups: this.groups,
|
|
112
|
-
tags: this.tags,
|
|
113
|
-
tests: this.tests,
|
|
114
|
-
},
|
|
115
|
-
failed: this.failed,
|
|
116
|
-
retries: this.retries,
|
|
117
|
-
timeout: this.timeout,
|
|
118
|
-
reporters: this.reporters,
|
|
119
|
-
suites: this.app.rcFile.tests.suites.map((suite) => {
|
|
120
|
-
return {
|
|
121
|
-
name: suite.name,
|
|
122
|
-
files: suite.files,
|
|
123
|
-
};
|
|
124
|
-
}),
|
|
125
|
-
env: {
|
|
126
|
-
NODE_ENV: 'test',
|
|
127
|
-
},
|
|
128
|
-
hooks: this.app.rcFile.hooks,
|
|
129
|
-
metaFiles: this.app.rcFile.metaFiles,
|
|
130
|
-
});
|
|
131
|
-
/**
|
|
132
|
-
* Share command logger with assembler, so that CLI flags like --no-ansi has
|
|
133
|
-
* similar impact for assembler logs as well.
|
|
134
|
-
*/
|
|
135
|
-
this.testsRunner.ui.logger = this.logger;
|
|
136
|
-
/**
|
|
137
|
-
* Exit command when the test runner is closed
|
|
138
|
-
*/
|
|
139
|
-
this.testsRunner.onClose((exitCode) => {
|
|
140
|
-
this.exitCode = exitCode;
|
|
141
|
-
this.terminate();
|
|
142
|
-
});
|
|
143
|
-
/**
|
|
144
|
-
* Exit command when the dev server crashes
|
|
145
|
-
*/
|
|
146
|
-
this.testsRunner.onError(() => {
|
|
147
|
-
this.exitCode = 1;
|
|
148
|
-
this.terminate();
|
|
149
|
-
});
|
|
150
|
-
/**
|
|
151
|
-
* Start the test runner in watch mode
|
|
152
|
-
*/
|
|
153
|
-
if (this.watch) {
|
|
154
|
-
const ts = await importTypeScript(this.app);
|
|
155
|
-
if (!ts) {
|
|
156
|
-
this.#logMissingDevelopmentDependency('typescript');
|
|
157
|
-
this.exitCode = 1;
|
|
158
|
-
return;
|
|
159
|
-
}
|
|
160
|
-
await this.testsRunner.runAndWatch(ts, { poll: this.poll || false });
|
|
161
|
-
}
|
|
162
|
-
else {
|
|
163
|
-
await this.testsRunner.run();
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
__decorate([
|
|
168
|
-
args.spread({
|
|
169
|
-
description: 'Mention suite names to run tests for selected suites',
|
|
170
|
-
required: false,
|
|
171
|
-
})
|
|
172
|
-
], Test.prototype, "suites", void 0);
|
|
173
|
-
__decorate([
|
|
174
|
-
flags.array({ description: 'Filter tests by the filename' })
|
|
175
|
-
], Test.prototype, "files", void 0);
|
|
176
|
-
__decorate([
|
|
177
|
-
flags.array({ description: 'Filter tests by tags' })
|
|
178
|
-
], Test.prototype, "tags", void 0);
|
|
179
|
-
__decorate([
|
|
180
|
-
flags.array({ description: 'Filter tests by parent group title' })
|
|
181
|
-
], Test.prototype, "groups", void 0);
|
|
182
|
-
__decorate([
|
|
183
|
-
flags.array({ description: 'Filter tests by test title' })
|
|
184
|
-
], Test.prototype, "tests", void 0);
|
|
185
|
-
__decorate([
|
|
186
|
-
flags.array({ description: 'Activate one or more test reporters' })
|
|
187
|
-
], Test.prototype, "reporters", void 0);
|
|
188
|
-
__decorate([
|
|
189
|
-
flags.boolean({ description: 'Watch filesystem and re-run tests on file change' })
|
|
190
|
-
], Test.prototype, "watch", void 0);
|
|
191
|
-
__decorate([
|
|
192
|
-
flags.boolean({ description: 'Use polling to detect filesystem changes' })
|
|
193
|
-
], Test.prototype, "poll", void 0);
|
|
194
|
-
__decorate([
|
|
195
|
-
flags.number({ description: 'Define default timeout for all tests' })
|
|
196
|
-
], Test.prototype, "timeout", void 0);
|
|
197
|
-
__decorate([
|
|
198
|
-
flags.number({ description: 'Define default retries for all tests' })
|
|
199
|
-
], Test.prototype, "retries", void 0);
|
|
200
|
-
__decorate([
|
|
201
|
-
flags.boolean({ description: 'Execute tests failed during the last run' })
|
|
202
|
-
], Test.prototype, "failed", void 0);
|
|
203
|
-
__decorate([
|
|
204
|
-
flags.boolean({
|
|
205
|
-
description: 'Clear the terminal for new logs after file change',
|
|
206
|
-
showNegatedVariantInHelp: true,
|
|
207
|
-
default: true,
|
|
208
|
-
})
|
|
209
|
-
], Test.prototype, "clear", void 0);
|
|
74
|
+
__decorate([args.spread({
|
|
75
|
+
description: "Mention suite names to run tests for selected suites",
|
|
76
|
+
required: false
|
|
77
|
+
})], Test.prototype, "suites", void 0);
|
|
78
|
+
__decorate([flags.array({ description: "Filter tests by the filename" })], Test.prototype, "files", void 0);
|
|
79
|
+
__decorate([flags.array({ description: "Filter tests by tags" })], Test.prototype, "tags", void 0);
|
|
80
|
+
__decorate([flags.array({ description: "Filter tests by parent group title" })], Test.prototype, "groups", void 0);
|
|
81
|
+
__decorate([flags.array({ description: "Filter tests by test title" })], Test.prototype, "tests", void 0);
|
|
82
|
+
__decorate([flags.array({ description: "Activate one or more test reporters" })], Test.prototype, "reporters", void 0);
|
|
83
|
+
__decorate([flags.boolean({ description: "Watch filesystem and re-run tests on file change" })], Test.prototype, "watch", void 0);
|
|
84
|
+
__decorate([flags.boolean({ description: "Use polling to detect filesystem changes" })], Test.prototype, "poll", void 0);
|
|
85
|
+
__decorate([flags.number({ description: "Define default timeout for all tests" })], Test.prototype, "timeout", void 0);
|
|
86
|
+
__decorate([flags.number({ description: "Define default retries for all tests" })], Test.prototype, "retries", void 0);
|
|
87
|
+
__decorate([flags.boolean({ description: "Execute tests failed during the last run" })], Test.prototype, "failed", void 0);
|
|
88
|
+
__decorate([flags.boolean({
|
|
89
|
+
description: "Clear the terminal for new logs after file change",
|
|
90
|
+
showNegatedVariantInHelp: true,
|
|
91
|
+
default: true
|
|
92
|
+
})], Test.prototype, "clear", void 0);
|
|
93
|
+
export { Test as default };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { debuglog } from "node:util";
|
|
2
|
+
var debug_default = debuglog("adonisjs:core");
|
|
3
|
+
const configProvider = {
|
|
4
|
+
create(resolver) {
|
|
5
|
+
return {
|
|
6
|
+
type: "provider",
|
|
7
|
+
resolver
|
|
8
|
+
};
|
|
9
|
+
},
|
|
10
|
+
async resolve(app, provider) {
|
|
11
|
+
if (provider && typeof provider === "object" && "type" in provider) return provider.resolver(app);
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
export { debug_default as n, configProvider as t };
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { t as string_default } from "./string-Cx6q_win.js";
|
|
2
|
+
import { r as outputTransformerDataObjects } from "./utils-CtGytdtt.js";
|
|
3
|
+
import { errors } from "@adonisjs/ace";
|
|
4
|
+
import { errors as errors$1 } from "@adonisjs/env";
|
|
5
|
+
import { errors as errors$2 } from "@adonisjs/application";
|
|
6
|
+
import { errors as errors$3 } from "@boringnode/encryption";
|
|
7
|
+
import { errors as errors$4 } from "@adonisjs/http-server";
|
|
8
|
+
function indexEntities(entities = {}) {
|
|
9
|
+
const events = Object.assign({
|
|
10
|
+
enabled: true,
|
|
11
|
+
source: "app/events",
|
|
12
|
+
importAlias: "#events",
|
|
13
|
+
skipSegments: ["events"],
|
|
14
|
+
output: ".adonisjs/server/events.ts"
|
|
15
|
+
}, entities.events);
|
|
16
|
+
const listeners = Object.assign({
|
|
17
|
+
enabled: true,
|
|
18
|
+
source: "app/listeners",
|
|
19
|
+
importAlias: "#listeners",
|
|
20
|
+
skipSegments: ["listeners"],
|
|
21
|
+
output: ".adonisjs/server/listeners.ts"
|
|
22
|
+
}, entities.listeners);
|
|
23
|
+
const controllers = Object.assign({
|
|
24
|
+
enabled: true,
|
|
25
|
+
source: "app/controllers",
|
|
26
|
+
importAlias: "#controllers",
|
|
27
|
+
skipSegments: ["controllers"],
|
|
28
|
+
output: ".adonisjs/server/controllers.ts"
|
|
29
|
+
}, entities.controllers);
|
|
30
|
+
const transformers = Object.assign({
|
|
31
|
+
enabled: false,
|
|
32
|
+
source: "app/transformers",
|
|
33
|
+
importAlias: "#transformers",
|
|
34
|
+
withSharedProps: false,
|
|
35
|
+
skipSegments: ["transformers"],
|
|
36
|
+
output: ".adonisjs/client/data.d.ts"
|
|
37
|
+
}, entities.transformers);
|
|
38
|
+
const manifest = {
|
|
39
|
+
enabled: entities.manifest?.enabled === false ? false : transformers.enabled,
|
|
40
|
+
source: "config",
|
|
41
|
+
output: ".adonisjs/client/manifest.d.ts",
|
|
42
|
+
exclude: entities.manifest?.exclude ?? [
|
|
43
|
+
"app.ts",
|
|
44
|
+
"bodyparser.ts",
|
|
45
|
+
"cors.ts",
|
|
46
|
+
"database.ts",
|
|
47
|
+
"encryption.ts",
|
|
48
|
+
"inertia.ts",
|
|
49
|
+
"session.ts",
|
|
50
|
+
"shield.ts",
|
|
51
|
+
"static.ts",
|
|
52
|
+
"vite.ts"
|
|
53
|
+
]
|
|
54
|
+
};
|
|
55
|
+
return { run(_, __, indexGenerator) {
|
|
56
|
+
if (events.enabled) indexGenerator.add("events", {
|
|
57
|
+
source: events.source,
|
|
58
|
+
disableLazyImports: true,
|
|
59
|
+
glob: events.glob,
|
|
60
|
+
as: "barrelFile",
|
|
61
|
+
exportName: "events",
|
|
62
|
+
importAlias: events.importAlias,
|
|
63
|
+
skipSegments: events.skipSegments,
|
|
64
|
+
output: events.output
|
|
65
|
+
});
|
|
66
|
+
if (listeners.enabled) indexGenerator.add("listeners", {
|
|
67
|
+
source: listeners.source,
|
|
68
|
+
glob: listeners.glob,
|
|
69
|
+
as: "barrelFile",
|
|
70
|
+
exportName: "listeners",
|
|
71
|
+
importAlias: listeners.importAlias,
|
|
72
|
+
skipSegments: listeners.skipSegments,
|
|
73
|
+
output: listeners.output
|
|
74
|
+
});
|
|
75
|
+
if (controllers.enabled) indexGenerator.add("controllers", {
|
|
76
|
+
source: controllers.source,
|
|
77
|
+
glob: controllers.glob,
|
|
78
|
+
as: "barrelFile",
|
|
79
|
+
exportName: "controllers",
|
|
80
|
+
importAlias: controllers.importAlias,
|
|
81
|
+
skipSegments: controllers.skipSegments,
|
|
82
|
+
removeSuffix: "controller",
|
|
83
|
+
output: controllers.output
|
|
84
|
+
});
|
|
85
|
+
if (transformers.enabled) indexGenerator.add("transformers", {
|
|
86
|
+
source: transformers.source,
|
|
87
|
+
glob: transformers.glob,
|
|
88
|
+
as(vfs, buffer, ___, helpers) {
|
|
89
|
+
outputTransformerDataObjects(vfs.asTree({
|
|
90
|
+
transformKey(key) {
|
|
91
|
+
let segments = key.split("/");
|
|
92
|
+
const baseName = segments.pop();
|
|
93
|
+
if (transformers.skipSegments?.length) segments = segments.filter((s) => !transformers.skipSegments.includes(s));
|
|
94
|
+
return [...segments.map((segment) => string_default.pascalCase(segment)), string_default.create(baseName).removeSuffix("transformer").pascalCase()].join("/");
|
|
95
|
+
},
|
|
96
|
+
transformValue: helpers.toImportPath
|
|
97
|
+
}), buffer, transformers.withSharedProps);
|
|
98
|
+
},
|
|
99
|
+
importAlias: transformers.importAlias,
|
|
100
|
+
output: transformers.output
|
|
101
|
+
});
|
|
102
|
+
if (manifest.enabled) indexGenerator.add("manifest", {
|
|
103
|
+
source: manifest.source,
|
|
104
|
+
filter: (filePath, isDirectory) => {
|
|
105
|
+
if (isDirectory) return true;
|
|
106
|
+
if (!manifest.exclude?.length) return true;
|
|
107
|
+
return !manifest.exclude.find((include) => filePath.endsWith(include));
|
|
108
|
+
},
|
|
109
|
+
as(vfs, buffer, ___, helpers) {
|
|
110
|
+
const configFilesList = vfs.asList();
|
|
111
|
+
buffer.write(`/// <reference path="../../adonisrc.ts" />`);
|
|
112
|
+
Object.values(configFilesList).forEach((value) => {
|
|
113
|
+
buffer.write(`/// <reference path="${helpers.toImportPath(value)}" />`);
|
|
114
|
+
});
|
|
115
|
+
},
|
|
116
|
+
output: manifest.output
|
|
117
|
+
});
|
|
118
|
+
} };
|
|
119
|
+
}
|
|
120
|
+
const errors$5 = {
|
|
121
|
+
...errors$3,
|
|
122
|
+
...errors$4,
|
|
123
|
+
...errors$2,
|
|
124
|
+
...errors,
|
|
125
|
+
...errors$1
|
|
126
|
+
};
|
|
127
|
+
async function prettyPrintError(error) {
|
|
128
|
+
if (error && typeof error === "object" && error.code === "E_DUMP_DIE_EXCEPTION") {
|
|
129
|
+
console.error(error);
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
try {
|
|
133
|
+
const { Youch } = await import("youch");
|
|
134
|
+
const youch = new Youch();
|
|
135
|
+
console.error(await youch.toANSI(error));
|
|
136
|
+
} catch {
|
|
137
|
+
console.error(error);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
export { prettyPrintError as n, indexEntities as r, errors$5 as t };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { d as Kernel, n as HelpCommand, t as FsLoader } from "./main-BlJhxJJ2.js";
|
|
2
|
+
function createAceKernel(app, commandName) {
|
|
3
|
+
const kernel = new Kernel(app);
|
|
4
|
+
kernel.info.set("binary", "node ace");
|
|
5
|
+
app.rcFile.commands.forEach((commandModule) => {
|
|
6
|
+
kernel.addLoader(() => typeof commandModule === "function" ? commandModule() : app.import(commandModule));
|
|
7
|
+
});
|
|
8
|
+
const fsLoader = new FsLoader(app.commandsPath());
|
|
9
|
+
kernel.addLoader({
|
|
10
|
+
async getMetaData() {
|
|
11
|
+
if (!commandName || !kernel.getCommand(commandName)) return fsLoader.getMetaData();
|
|
12
|
+
return [];
|
|
13
|
+
},
|
|
14
|
+
getCommand(command) {
|
|
15
|
+
return fsLoader.getCommand(command);
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
kernel.defineFlag("ansi", {
|
|
19
|
+
type: "boolean",
|
|
20
|
+
showNegatedVariantInHelp: true,
|
|
21
|
+
description: "Force enable or disable colorful output"
|
|
22
|
+
});
|
|
23
|
+
kernel.defineFlag("help", {
|
|
24
|
+
type: "boolean",
|
|
25
|
+
description: HelpCommand.description
|
|
26
|
+
});
|
|
27
|
+
kernel.on("ansi", (_, $kernel, parsed) => {
|
|
28
|
+
if (parsed.flags.ansi === false) $kernel.ui.switchMode("silent");
|
|
29
|
+
if (parsed.flags.ansi === true) $kernel.ui.switchMode("normal");
|
|
30
|
+
});
|
|
31
|
+
kernel.on("help", async (command, $kernel, parsed) => {
|
|
32
|
+
parsed.args.unshift(command.commandName);
|
|
33
|
+
await new HelpCommand($kernel, parsed, kernel.ui, kernel.prompt).exec();
|
|
34
|
+
return $kernel.shortcircuit();
|
|
35
|
+
});
|
|
36
|
+
return kernel;
|
|
37
|
+
}
|
|
38
|
+
export { createAceKernel as t };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
function __decorate(decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
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
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
}
|
|
7
|
+
export { __decorate as t };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { n as debug_default, t as configProvider } from "./config_provider-DWVFHOQX.js";
|
|
2
|
+
import { n as InvalidArgumentsException } from "./exceptions-DNMesP42.js";
|
|
3
|
+
function defineConfig(config) {
|
|
4
|
+
if (!config.list) throw new InvalidArgumentsException("Missing \"list\" property in encryption config");
|
|
5
|
+
if (config.default && !config.list[config.default]) throw new InvalidArgumentsException(`Missing "list.${String(config.default)}" in encryption config. It is referenced by the "default" property`);
|
|
6
|
+
return configProvider.create(async (app) => {
|
|
7
|
+
debug_default("resolving encryption config");
|
|
8
|
+
const encryptorsList = Object.keys(config.list);
|
|
9
|
+
const encryptors = {};
|
|
10
|
+
for (let encryptorName of encryptorsList) {
|
|
11
|
+
const encryptor = config.list[encryptorName];
|
|
12
|
+
if ("resolver" in encryptor) encryptors[encryptorName] = await encryptor.resolver(app);
|
|
13
|
+
else encryptors[encryptorName] = encryptor;
|
|
14
|
+
}
|
|
15
|
+
return {
|
|
16
|
+
default: config.default,
|
|
17
|
+
list: encryptors
|
|
18
|
+
};
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
const drivers = {
|
|
22
|
+
chacha20: (config) => {
|
|
23
|
+
return configProvider.create(async () => {
|
|
24
|
+
const { ChaCha20Poly1305 } = await import("./modules/encryption/drivers/chacha20_poly1305.js");
|
|
25
|
+
debug_default("configuring chacha20 encryption driver");
|
|
26
|
+
return {
|
|
27
|
+
driver: (key) => new ChaCha20Poly1305({
|
|
28
|
+
id: config.id,
|
|
29
|
+
key
|
|
30
|
+
}),
|
|
31
|
+
keys: config.keys
|
|
32
|
+
};
|
|
33
|
+
});
|
|
34
|
+
},
|
|
35
|
+
aes256cbc: (config) => {
|
|
36
|
+
return configProvider.create(async () => {
|
|
37
|
+
const { AES256CBC } = await import("./modules/encryption/drivers/aes_256_cbc.js");
|
|
38
|
+
debug_default("configuring aes256cbc encryption driver");
|
|
39
|
+
return {
|
|
40
|
+
driver: (key) => new AES256CBC({
|
|
41
|
+
id: config.id,
|
|
42
|
+
key
|
|
43
|
+
}),
|
|
44
|
+
keys: config.keys
|
|
45
|
+
};
|
|
46
|
+
});
|
|
47
|
+
},
|
|
48
|
+
aes256gcm: (config) => {
|
|
49
|
+
return configProvider.create(async () => {
|
|
50
|
+
const { AES256GCM } = await import("./modules/encryption/drivers/aes_256_gcm.js");
|
|
51
|
+
debug_default("configuring aes256gcm encryption driver");
|
|
52
|
+
return {
|
|
53
|
+
driver: (key) => new AES256GCM({
|
|
54
|
+
id: config.id,
|
|
55
|
+
key
|
|
56
|
+
}),
|
|
57
|
+
keys: config.keys
|
|
58
|
+
};
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
export { drivers as n, defineConfig as t };
|