@adonisjs/core 7.0.0-next.8 → 7.0.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/README.md +62 -1
- package/build/chunk-iKc69rpz.js +26 -0
- package/build/commands/add.d.ts +4 -3
- package/build/commands/add.js +73 -110
- package/build/commands/build.js +51 -107
- package/build/commands/commands.json +1 -1
- package/build/commands/configure.js +81 -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.d.ts +5 -0
- package/build/commands/make/command.js +16 -57
- package/build/commands/make/controller.d.ts +5 -0
- package/build/commands/make/controller.js +44 -120
- package/build/commands/make/event.d.ts +5 -0
- package/build/commands/make/event.js +17 -62
- package/build/commands/make/exception.d.ts +5 -0
- package/build/commands/make/exception.js +17 -62
- package/build/commands/make/listener.d.ts +5 -0
- package/build/commands/make/listener.js +37 -93
- package/build/commands/make/middleware.d.ts +5 -0
- package/build/commands/make/middleware.js +42 -101
- package/build/commands/make/preload.d.ts +5 -0
- package/build/commands/make/preload.js +48 -113
- package/build/commands/make/provider.d.ts +5 -0
- package/build/commands/make/provider.js +48 -112
- package/build/commands/make/service.d.ts +5 -0
- package/build/commands/make/service.js +17 -55
- package/build/commands/make/test.d.ts +5 -0
- package/build/commands/make/test.js +48 -132
- package/build/commands/make/transformer.d.ts +5 -0
- package/build/commands/make/transformer.js +18 -64
- package/build/commands/make/validator.d.ts +5 -0
- package/build/commands/make/validator.js +21 -80
- package/build/commands/make/view.d.ts +5 -0
- package/build/commands/make/view.js +16 -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_provider-FIAUgvae.js +13 -0
- package/build/core-IpCOCkUL.js +146 -0
- package/build/create_kernel-B7ILNhuP.js +38 -0
- package/build/create_kernel-BD0Iqi8e.js +3 -0
- package/build/debug-CGQmxzGt.js +3 -0
- package/build/decorate-DmrZA614.js +7 -0
- package/build/define_config-0oHaj43l.js +86 -0
- package/build/dumper-BBgqFX5a.js +147 -0
- package/build/errors-CrCO-k44.js +8 -0
- package/build/factories/app.js +2 -9
- package/build/factories/bodyparser.js +2 -9
- package/build/factories/core/ace.js +22 -45
- package/build/factories/core/ignitor.js +74 -180
- package/build/factories/core/main.js +18 -11
- package/build/factories/core/test_utils.js +19 -42
- 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.d.ts +1 -6
- package/build/factories/stubs.js +24 -91
- package/build/index.d.ts +1 -1
- package/build/index.js +10 -46
- package/build/main--nXd7T-C.js +73 -0
- package/build/main-Cxz0TyIw.js +173 -0
- package/build/main-DN2qEEg5.js +41 -0
- package/build/main-DkNgvceD.js +52 -0
- package/build/main-MBAMnmJb.js +81 -0
- package/build/main-kn40V-hF.js +2 -0
- package/build/{stubs/make → make}/health/controller.stub +5 -2
- package/build/modules/ace/codemods.d.ts +74 -22
- package/build/modules/ace/codemods.js +295 -476
- package/build/modules/ace/main.js +2 -41
- package/build/modules/app.js +6 -26
- package/build/modules/bodyparser/bodyparser_middleware.js +3 -14
- package/build/modules/bodyparser/main.js +6 -9
- package/build/modules/config.js +6 -26
- package/build/modules/container.js +6 -9
- package/build/modules/dumper/main.js +6 -32
- package/build/modules/dumper/plugins/edge.js +46 -61
- package/build/modules/encryption/define_config.d.ts +161 -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/aes_siv.d.ts +19 -0
- package/build/modules/encryption/drivers/aes_siv.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/drivers/legacy.d.ts +84 -0
- package/build/modules/encryption/drivers/legacy.js +57 -0
- package/build/modules/encryption/errors.d.ts +16 -0
- package/build/modules/encryption/main.d.ts +89 -0
- package/build/modules/encryption/main.js +6 -0
- package/build/modules/env/editor.js +2 -9
- package/build/modules/env/main.js +2 -28
- package/build/modules/events.js +6 -9
- package/build/modules/hash/drivers/argon.js +2 -9
- package/build/modules/hash/drivers/bcrypt.js +2 -20
- package/build/modules/hash/drivers/scrypt.js +2 -9
- package/build/modules/hash/main.js +6 -28
- package/build/modules/hash/phc_formatter.js +2 -9
- package/build/modules/health.js +2 -9
- package/build/modules/http/helpers.d.ts +1 -0
- package/build/modules/http/helpers.js +2 -0
- package/build/modules/http/main.js +4 -15
- package/build/modules/http/request_validator.d.ts +3 -4
- package/build/modules/http/url_builder_client.js +2 -9
- package/build/modules/logger.d.ts +30 -0
- package/build/modules/logger.js +14 -9
- package/build/modules/repl.js +6 -9
- package/build/modules/transformers/main.js +2 -9
- package/build/providers/app_provider.d.ts +14 -21
- package/build/providers/app_provider.js +153 -354
- package/build/providers/edge_provider.js +98 -164
- package/build/providers/hash_provider.js +29 -91
- package/build/providers/repl_provider.js +66 -152
- package/build/providers/vinejs_provider.d.ts +1 -1
- package/build/providers/vinejs_provider.js +21 -65
- package/build/services/ace.js +1 -16
- package/build/services/app.js +3 -19
- package/build/services/config.js +1 -12
- package/build/services/dumper.js +4 -20
- package/build/services/emitter.js +1 -13
- package/build/services/encryption.js +1 -13
- package/build/services/hash.js +1 -13
- package/build/services/logger.js +1 -13
- package/build/services/repl.js +1 -13
- package/build/services/router.js +1 -13
- package/build/services/server.js +1 -13
- package/build/services/test_utils.js +1 -16
- package/build/services/url_builder.d.ts +3 -3
- package/build/services/url_builder.js +4 -16
- package/build/src/assembler_hooks/index_entities.d.ts +34 -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.js +2 -28
- package/build/src/helpers/is.js +3 -31
- package/build/src/helpers/main.js +5 -52
- package/build/src/helpers/string.js +26 -76
- package/build/src/helpers/types.js +25 -134
- package/build/src/helpers/verification_token.js +46 -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 +29 -101
- 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 +53 -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.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-rRkbAPnP.js +42 -0
- package/package.json +117 -62
- 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 -266
- package/build/modules/dumper/errors.js +0 -119
- package/build/modules/encryption.d.ts +0 -18
- package/build/modules/encryption.js +0 -26
- 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 -112
- package/build/src/cli_formatters/routes_list.js +0 -397
- 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 -159
- 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 -114
- 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/types/repl.js
CHANGED
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
-
export * from '@adonisjs/repl/types';
|
|
1
|
+
export * from "@adonisjs/repl/types";
|
|
2
|
+
export {};
|
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
-
export * from '@adonisjs/http-transformers/types';
|
|
1
|
+
export * from "@adonisjs/http-transformers/types";
|
|
2
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
async function importAssembler(app) {
|
|
2
|
+
try {
|
|
3
|
+
return await app.import("@adonisjs/assembler");
|
|
4
|
+
} catch {}
|
|
5
|
+
}
|
|
6
|
+
async function importTypeScript(app) {
|
|
7
|
+
try {
|
|
8
|
+
return await app.importDefault("typescript");
|
|
9
|
+
} catch {}
|
|
10
|
+
}
|
|
11
|
+
async function outputTransformerDataObjects(transformersList, buffer, withSharedProps, inertiaMiddlewareImportPath = "#middleware/inertia_middleware") {
|
|
12
|
+
const importsBuffer = buffer.create();
|
|
13
|
+
importsBuffer.write(`/// <reference path="./manifest.d.ts" />`);
|
|
14
|
+
importsBuffer.write(`import type { InferData, InferVariants } from '@adonisjs/core/types/transformers'`);
|
|
15
|
+
if (withSharedProps) importsBuffer.write(`import type { InferSharedProps } from '@adonisjs/inertia/types'`);
|
|
16
|
+
buffer.writeLine(importsBuffer);
|
|
17
|
+
buffer.write("export namespace Data {").indent();
|
|
18
|
+
function generateNamespaceTree(input, parents) {
|
|
19
|
+
Object.keys(input).forEach((key) => {
|
|
20
|
+
const value = input[key];
|
|
21
|
+
if (typeof value === "string") {
|
|
22
|
+
const importName = `${parents.join("")}${key}Transformer`;
|
|
23
|
+
importsBuffer.write(`import type ${importName} from '${value}'`);
|
|
24
|
+
buffer.write(`export type ${key} = InferData<${importName}>`);
|
|
25
|
+
buffer.write(`export namespace ${key} {`).indent();
|
|
26
|
+
buffer.write(`export type Variants = InferVariants<${importName}>`);
|
|
27
|
+
buffer.dedent().write("}");
|
|
28
|
+
} else {
|
|
29
|
+
buffer.write(`export namespace ${key} {`).indent();
|
|
30
|
+
generateNamespaceTree(value, [...parents, key]);
|
|
31
|
+
buffer.dedent().write(`}`);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
generateNamespaceTree(transformersList, []);
|
|
36
|
+
if (withSharedProps) {
|
|
37
|
+
importsBuffer.write(`import type InertiaMiddleware from '${inertiaMiddlewareImportPath}'`);
|
|
38
|
+
buffer.write("export type SharedProps = InferSharedProps<InertiaMiddleware>");
|
|
39
|
+
}
|
|
40
|
+
buffer.dedent().write("}");
|
|
41
|
+
}
|
|
42
|
+
export { importTypeScript as n, outputTransformerDataObjects as r, importAssembler as t };
|
package/package.json
CHANGED
|
@@ -1,24 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adonisjs/core",
|
|
3
3
|
"description": "Core of AdonisJS",
|
|
4
|
-
"version": "7.0.0
|
|
4
|
+
"version": "7.0.0",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=24.0.0"
|
|
7
7
|
},
|
|
8
8
|
"main": "build/index.js",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"files": [
|
|
11
|
-
"build
|
|
12
|
-
"build/
|
|
13
|
-
"build/
|
|
14
|
-
"build/services",
|
|
15
|
-
"build/factories",
|
|
16
|
-
"build/toolkit",
|
|
17
|
-
"build/types",
|
|
18
|
-
"build/src",
|
|
19
|
-
"build/stubs",
|
|
20
|
-
"build/index.d.ts",
|
|
21
|
-
"build/index.js"
|
|
11
|
+
"build",
|
|
12
|
+
"!build/bin",
|
|
13
|
+
"!build/tests"
|
|
22
14
|
],
|
|
23
15
|
"bin": {
|
|
24
16
|
"adonis-kit": "./build/toolkit/main.js"
|
|
@@ -47,13 +39,18 @@
|
|
|
47
39
|
"./app": "./build/modules/app.js",
|
|
48
40
|
"./config": "./build/modules/config.js",
|
|
49
41
|
"./container": "./build/modules/container.js",
|
|
50
|
-
"./encryption": "./build/modules/encryption.js",
|
|
42
|
+
"./encryption": "./build/modules/encryption/main.js",
|
|
43
|
+
"./encryption/drivers/aes_256_cbc": "./build/modules/encryption/drivers/aes_256_cbc.js",
|
|
44
|
+
"./encryption/drivers/aes_256_gcm": "./build/modules/encryption/drivers/aes_256_gcm.js",
|
|
45
|
+
"./encryption/drivers/aes_siv": "./build/modules/encryption/drivers/aes_siv.js",
|
|
46
|
+
"./encryption/drivers/chacha20_poly1305": "./build/modules/encryption/drivers/chacha20_poly1305.js",
|
|
51
47
|
"./env": "./build/modules/env/main.js",
|
|
52
48
|
"./dumper": "./build/modules/dumper/main.js",
|
|
53
49
|
"./dumper/plugin_edge": "./build/modules/dumper/plugins/edge.js",
|
|
54
50
|
"./env/editor": "./build/modules/env/editor.js",
|
|
55
51
|
"./events": "./build/modules/events.js",
|
|
56
52
|
"./http": "./build/modules/http/main.js",
|
|
53
|
+
"./http/helpers": "./build/modules/http/helpers.js",
|
|
57
54
|
"./http/url_builder_client": "./build/modules/http/url_builder_client.js",
|
|
58
55
|
"./logger": "./build/modules/logger.js",
|
|
59
56
|
"./repl": "./build/modules/repl.js",
|
|
@@ -66,11 +63,11 @@
|
|
|
66
63
|
},
|
|
67
64
|
"scripts": {
|
|
68
65
|
"pretest": "npm run lint",
|
|
69
|
-
"test": "cross-env NODE_DEBUG=adonisjs:core
|
|
66
|
+
"test": "cross-env NODE_DEBUG=adonisjs:core npm run quick:test",
|
|
70
67
|
"clean": "del-cli build",
|
|
71
|
-
"copy:templates": "copyfiles \"stubs/**/**/*.stub\" build",
|
|
68
|
+
"copy:templates": "copyfiles \"stubs/**/**/*.stub\" --up=1 build",
|
|
72
69
|
"precompile": "npm run lint",
|
|
73
|
-
"compile": "npm run clean && tsc",
|
|
70
|
+
"compile": "npm run clean && tsdown && tsc --emitDeclarationOnly --declaration",
|
|
74
71
|
"postcompile": "npm run copy:templates && npm run index:commands",
|
|
75
72
|
"build": "npm run compile",
|
|
76
73
|
"docs": "typedoc",
|
|
@@ -85,76 +82,79 @@
|
|
|
85
82
|
"index:commands": "node --import=@poppinss/ts-exec toolkit/main.js index build/commands"
|
|
86
83
|
},
|
|
87
84
|
"devDependencies": {
|
|
88
|
-
"@adonisjs/assembler": "^8.0.0
|
|
89
|
-
"@adonisjs/eslint-config": "^3.0.0
|
|
85
|
+
"@adonisjs/assembler": "^8.0.0",
|
|
86
|
+
"@adonisjs/eslint-config": "^3.0.0",
|
|
90
87
|
"@adonisjs/prettier-config": "^1.4.5",
|
|
91
|
-
"@adonisjs/tsconfig": "^2.0.0
|
|
92
|
-
"@japa/assert": "^4.
|
|
93
|
-
"@japa/expect-type": "^2.0.
|
|
94
|
-
"@japa/file-system": "^
|
|
95
|
-
"@japa/runner": "^
|
|
96
|
-
"@japa/snapshot": "^2.0.
|
|
97
|
-
"@poppinss/ts-exec": "^1.4.
|
|
98
|
-
"@release-it/conventional-changelog": "^10.0.
|
|
99
|
-
"@types/node": "
|
|
88
|
+
"@adonisjs/tsconfig": "^2.0.0",
|
|
89
|
+
"@japa/assert": "^4.2.0",
|
|
90
|
+
"@japa/expect-type": "^2.0.4",
|
|
91
|
+
"@japa/file-system": "^3.0.0",
|
|
92
|
+
"@japa/runner": "^5.3.0",
|
|
93
|
+
"@japa/snapshot": "^2.0.10",
|
|
94
|
+
"@poppinss/ts-exec": "^1.4.4",
|
|
95
|
+
"@release-it/conventional-changelog": "^10.0.5",
|
|
96
|
+
"@types/node": "~25.3.0",
|
|
100
97
|
"@types/pretty-hrtime": "^1.0.3",
|
|
101
|
-
"@types/sinon": "^
|
|
98
|
+
"@types/sinon": "^21.0.0",
|
|
102
99
|
"@types/supertest": "^6.0.3",
|
|
103
100
|
"@types/test-console": "^2.0.3",
|
|
104
|
-
"@vinejs/vine": "^4.0
|
|
101
|
+
"@vinejs/vine": "^4.3.0",
|
|
105
102
|
"argon2": "^0.44.0",
|
|
106
103
|
"bcrypt": "^6.0.0",
|
|
107
|
-
"c8": "^
|
|
104
|
+
"c8": "^11.0.0",
|
|
108
105
|
"copyfiles": "^2.4.1",
|
|
109
106
|
"cross-env": "^10.1.0",
|
|
110
107
|
"del-cli": "^7.0.0",
|
|
111
|
-
"edge.js": "^6.
|
|
112
|
-
"eslint": "^
|
|
113
|
-
"execa": "^9.6.
|
|
108
|
+
"edge.js": "^6.5.0",
|
|
109
|
+
"eslint": "^10.0.2",
|
|
110
|
+
"execa": "^9.6.1",
|
|
114
111
|
"get-port": "^7.1.0",
|
|
115
|
-
"
|
|
116
|
-
"
|
|
117
|
-
"
|
|
118
|
-
"
|
|
112
|
+
"pino-pretty": "^13.1.3",
|
|
113
|
+
"prettier": "^3.8.1",
|
|
114
|
+
"release-it": "^19.2.4",
|
|
115
|
+
"sinon": "^21.0.1",
|
|
116
|
+
"supertest": "^7.2.2",
|
|
119
117
|
"test-console": "^2.0.0",
|
|
120
118
|
"timekeeper": "^2.3.1",
|
|
121
|
-
"
|
|
119
|
+
"tsdown": "^0.20.3",
|
|
120
|
+
"typedoc": "^0.28.17",
|
|
122
121
|
"typescript": "^5.9.3",
|
|
123
|
-
"youch": "^4.1.0
|
|
122
|
+
"youch": "^4.1.0"
|
|
124
123
|
},
|
|
125
124
|
"dependencies": {
|
|
126
|
-
"@adonisjs/ace": "^14.0.1
|
|
127
|
-
"@adonisjs/application": "^9.0.0
|
|
128
|
-
"@adonisjs/bodyparser": "^11.0.0
|
|
129
|
-
"@adonisjs/config": "^6.
|
|
130
|
-
"@adonisjs/
|
|
131
|
-
"@adonisjs/
|
|
132
|
-
"@adonisjs/
|
|
133
|
-
"@adonisjs/
|
|
134
|
-
"@adonisjs/
|
|
135
|
-
"@adonisjs/
|
|
136
|
-
"@adonisjs/http-
|
|
137
|
-
"@adonisjs/
|
|
138
|
-
"@adonisjs/
|
|
139
|
-
"@
|
|
140
|
-
"@poppinss/colors": "^4.1.
|
|
141
|
-
"@poppinss/dumper": "^0.
|
|
125
|
+
"@adonisjs/ace": "^14.0.1",
|
|
126
|
+
"@adonisjs/application": "^9.0.0",
|
|
127
|
+
"@adonisjs/bodyparser": "^11.0.0",
|
|
128
|
+
"@adonisjs/config": "^6.1.0",
|
|
129
|
+
"@adonisjs/env": "^7.0.0",
|
|
130
|
+
"@adonisjs/events": "^10.1.0",
|
|
131
|
+
"@adonisjs/fold": "^11.0.0",
|
|
132
|
+
"@adonisjs/hash": "^10.0.0",
|
|
133
|
+
"@adonisjs/health": "^3.1.0",
|
|
134
|
+
"@adonisjs/http-server": "^8.0.0",
|
|
135
|
+
"@adonisjs/http-transformers": "^2.3.0",
|
|
136
|
+
"@adonisjs/logger": "^7.1.0",
|
|
137
|
+
"@adonisjs/repl": "^5.0.0",
|
|
138
|
+
"@boringnode/encryption": "^1.0.0",
|
|
139
|
+
"@poppinss/colors": "^4.1.6",
|
|
140
|
+
"@poppinss/dumper": "^0.7.0",
|
|
142
141
|
"@poppinss/macroable": "^1.1.0",
|
|
143
|
-
"@poppinss/utils": "^7.0.0
|
|
144
|
-
"@sindresorhus/is": "^7.
|
|
142
|
+
"@poppinss/utils": "^7.0.0",
|
|
143
|
+
"@sindresorhus/is": "^7.2.0",
|
|
145
144
|
"@types/he": "^1.2.3",
|
|
146
145
|
"error-stack-parser-es": "^1.0.5",
|
|
147
146
|
"he": "^1.2.0",
|
|
148
147
|
"pretty-hrtime": "^1.0.3",
|
|
149
|
-
"string-width": "^8.
|
|
148
|
+
"string-width": "^8.2.0"
|
|
150
149
|
},
|
|
151
150
|
"peerDependencies": {
|
|
152
|
-
"@adonisjs/assembler": "^8.0.0-next.
|
|
153
|
-
"@vinejs/vine": "^4.0.0
|
|
154
|
-
"argon2": "^0.
|
|
151
|
+
"@adonisjs/assembler": "^8.0.0-next.23 || ^8.0.0",
|
|
152
|
+
"@vinejs/vine": "^4.0.0",
|
|
153
|
+
"argon2": "^0.44.0",
|
|
155
154
|
"bcrypt": "^6.0.0",
|
|
156
155
|
"edge.js": "^6.2.0",
|
|
157
|
-
"
|
|
156
|
+
"pino-pretty": "^13.1.3",
|
|
157
|
+
"youch": "^4.1.0-beta.13 || ^4.1.0"
|
|
158
158
|
},
|
|
159
159
|
"peerDependenciesMeta": {
|
|
160
160
|
"argon2": {
|
|
@@ -174,6 +174,9 @@
|
|
|
174
174
|
},
|
|
175
175
|
"youch": {
|
|
176
176
|
"optional": true
|
|
177
|
+
},
|
|
178
|
+
"pino-pretty": {
|
|
179
|
+
"optional": true
|
|
177
180
|
}
|
|
178
181
|
},
|
|
179
182
|
"homepage": "https://github.com/adonisjs/core#readme",
|
|
@@ -217,6 +220,58 @@
|
|
|
217
220
|
"@commitlint/config-conventional"
|
|
218
221
|
]
|
|
219
222
|
},
|
|
223
|
+
"tsdown": {
|
|
224
|
+
"entry": [
|
|
225
|
+
"index.ts",
|
|
226
|
+
"commands/main.ts",
|
|
227
|
+
"commands/**/*.ts",
|
|
228
|
+
"factories/core/main.ts",
|
|
229
|
+
"factories/**/*.ts",
|
|
230
|
+
"src/types.ts",
|
|
231
|
+
"toolkit/main.ts",
|
|
232
|
+
"types/**/*.ts",
|
|
233
|
+
"services/**/*.ts",
|
|
234
|
+
"providers/**/*.ts",
|
|
235
|
+
"src/helpers/main.ts",
|
|
236
|
+
"src/helpers/**/*.ts",
|
|
237
|
+
"modules/ace/main.ts",
|
|
238
|
+
"modules/ace/codemods.ts",
|
|
239
|
+
"modules/bodyparser/main.ts",
|
|
240
|
+
"modules/bodyparser/bodyparser_middleware.ts",
|
|
241
|
+
"modules/hash/main.ts",
|
|
242
|
+
"modules/hash/phc_formatter.ts",
|
|
243
|
+
"modules/hash/drivers/*.ts",
|
|
244
|
+
"modules/app.ts",
|
|
245
|
+
"modules/config.ts",
|
|
246
|
+
"modules/container.ts",
|
|
247
|
+
"modules/encryption/main.ts",
|
|
248
|
+
"modules/encryption/drivers/*.ts",
|
|
249
|
+
"modules/env/main.ts",
|
|
250
|
+
"modules/dumper/main.ts",
|
|
251
|
+
"modules/dumper/plugins/edge.ts",
|
|
252
|
+
"modules/env/editor.ts",
|
|
253
|
+
"modules/events.ts",
|
|
254
|
+
"modules/http/main.ts",
|
|
255
|
+
"modules/http/helpers.ts",
|
|
256
|
+
"modules/http/url_builder_client.ts",
|
|
257
|
+
"modules/logger.ts",
|
|
258
|
+
"modules/repl.ts",
|
|
259
|
+
"modules/transformers/main.ts",
|
|
260
|
+
"src/exceptions.ts",
|
|
261
|
+
"src/test_utils/main.ts",
|
|
262
|
+
"modules/health.ts",
|
|
263
|
+
"src/vine.ts"
|
|
264
|
+
],
|
|
265
|
+
"outDir": "./build",
|
|
266
|
+
"clean": true,
|
|
267
|
+
"format": "esm",
|
|
268
|
+
"minify": "dce-only",
|
|
269
|
+
"fixedExtension": false,
|
|
270
|
+
"dts": false,
|
|
271
|
+
"treeshake": false,
|
|
272
|
+
"sourcemaps": false,
|
|
273
|
+
"target": "esnext"
|
|
274
|
+
},
|
|
220
275
|
"release-it": {
|
|
221
276
|
"git": {
|
|
222
277
|
"requireCleanWorkingDir": true,
|
|
@@ -1,157 +0,0 @@
|
|
|
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
|
-
import { BaseCommand as AceBaseCommand, ListCommand as AceListCommand } from '@adonisjs/ace';
|
|
10
|
-
/**
|
|
11
|
-
* The base command class for creating custom Ace commands in AdonisJS applications.
|
|
12
|
-
* This class extends the base Ace command with AdonisJS-specific functionality like
|
|
13
|
-
* dependency injection and application lifecycle management.
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* ```ts
|
|
17
|
-
* export default class MakeUser extends BaseCommand {
|
|
18
|
-
* static commandName = 'make:user'
|
|
19
|
-
* static description = 'Create a new user'
|
|
20
|
-
*
|
|
21
|
-
* async run() {
|
|
22
|
-
* this.logger.info('Creating user...')
|
|
23
|
-
* // Command implementation
|
|
24
|
-
* }
|
|
25
|
-
* }
|
|
26
|
-
* ```
|
|
27
|
-
*/
|
|
28
|
-
export class BaseCommand extends AceBaseCommand {
|
|
29
|
-
app;
|
|
30
|
-
kernel;
|
|
31
|
-
static options = {};
|
|
32
|
-
get staysAlive() {
|
|
33
|
-
return this.constructor.options.staysAlive;
|
|
34
|
-
}
|
|
35
|
-
get startApp() {
|
|
36
|
-
return this.constructor.options.startApp;
|
|
37
|
-
}
|
|
38
|
-
constructor(app, kernel, parsed, ui, prompt) {
|
|
39
|
-
super(kernel, parsed, ui, prompt);
|
|
40
|
-
this.app = app;
|
|
41
|
-
this.kernel = kernel;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Creates the codemods module to modify source files programmatically.
|
|
45
|
-
* This method provides access to AST-based code transformations.
|
|
46
|
-
*
|
|
47
|
-
* @example
|
|
48
|
-
* ```ts
|
|
49
|
-
* const codemods = await this.createCodemods()
|
|
50
|
-
* await codemods.makeUsingStub(stubsRoot, 'controller.stub', {
|
|
51
|
-
* filename: 'UserController',
|
|
52
|
-
* entity: { name: 'User' }
|
|
53
|
-
* })
|
|
54
|
-
* ```
|
|
55
|
-
*/
|
|
56
|
-
async createCodemods() {
|
|
57
|
-
const { Codemods } = await import('./codemods.js');
|
|
58
|
-
const codemods = new Codemods(this.app, this.logger);
|
|
59
|
-
codemods.on('error', () => {
|
|
60
|
-
this.exitCode = 1;
|
|
61
|
-
});
|
|
62
|
-
return codemods;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Executes the lifecycle hooks and the run method from the command
|
|
66
|
-
*/
|
|
67
|
-
async exec() {
|
|
68
|
-
this.hydrate();
|
|
69
|
-
try {
|
|
70
|
-
/**
|
|
71
|
-
* Executing the template methods
|
|
72
|
-
*/
|
|
73
|
-
this.prepare && (await this.app.container.call(this, 'prepare'));
|
|
74
|
-
this.interact && (await this.app.container.call(this, 'interact'));
|
|
75
|
-
const result = await this.app.container.call(this, 'run');
|
|
76
|
-
/**
|
|
77
|
-
* Set exit code
|
|
78
|
-
*/
|
|
79
|
-
this.result = this.result === undefined ? result : this.result;
|
|
80
|
-
this.exitCode = this.exitCode ?? 0;
|
|
81
|
-
}
|
|
82
|
-
catch (error) {
|
|
83
|
-
this.error = error;
|
|
84
|
-
this.exitCode = this.exitCode ?? 1;
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Run the completed method (if exists) and check if has handled
|
|
88
|
-
* the error
|
|
89
|
-
*/
|
|
90
|
-
let errorHandled = this.completed
|
|
91
|
-
? await this.app.container.call(this, 'completed')
|
|
92
|
-
: false;
|
|
93
|
-
if (this.error && !errorHandled) {
|
|
94
|
-
await this.kernel.errorHandler.render(this.error, this.kernel);
|
|
95
|
-
}
|
|
96
|
-
return this.result;
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Terminate the application gracefully. This method should be preferred over
|
|
100
|
-
* calling `app.terminate()` directly as it only triggers termination when
|
|
101
|
-
* the current command is the main command responsible for the process.
|
|
102
|
-
*
|
|
103
|
-
* @example
|
|
104
|
-
* ```ts
|
|
105
|
-
* export default class SomeCommand extends BaseCommand {
|
|
106
|
-
* async run() {
|
|
107
|
-
* // Do some work
|
|
108
|
-
* await this.terminate()
|
|
109
|
-
* }
|
|
110
|
-
* }
|
|
111
|
-
* ```
|
|
112
|
-
*/
|
|
113
|
-
async terminate() {
|
|
114
|
-
if (this.kernel.getMainCommand() === this) {
|
|
115
|
-
await this.app.terminate();
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* The List command is used to display a list of available commands.
|
|
121
|
-
* This command extends the base Ace ListCommand with AdonisJS-specific functionality.
|
|
122
|
-
*/
|
|
123
|
-
export class ListCommand extends AceListCommand {
|
|
124
|
-
app;
|
|
125
|
-
kernel;
|
|
126
|
-
static options = {};
|
|
127
|
-
get staysAlive() {
|
|
128
|
-
return this.constructor.options.staysAlive;
|
|
129
|
-
}
|
|
130
|
-
get startApp() {
|
|
131
|
-
return this.constructor.options.startApp;
|
|
132
|
-
}
|
|
133
|
-
constructor(app, kernel, parsed, ui, prompt) {
|
|
134
|
-
super(kernel, parsed, ui, prompt);
|
|
135
|
-
this.app = app;
|
|
136
|
-
this.kernel = kernel;
|
|
137
|
-
}
|
|
138
|
-
/**
|
|
139
|
-
* Creates the codemods module to modify source files programmatically.
|
|
140
|
-
* This method provides access to AST-based code transformations.
|
|
141
|
-
*/
|
|
142
|
-
async createCodemods() {
|
|
143
|
-
const { Codemods } = await import('./codemods.js');
|
|
144
|
-
return new Codemods(this.app, this.logger);
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* Terminate the app. A command should prefer calling this method
|
|
148
|
-
* over the "app.terminate", because this method only triggers
|
|
149
|
-
* app termination when the current command is in the charge
|
|
150
|
-
* of the process.
|
|
151
|
-
*/
|
|
152
|
-
async terminate() {
|
|
153
|
-
if (this.kernel.getMainCommand() === this) {
|
|
154
|
-
await this.app.terminate();
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
}
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @adonisjs/ace
|
|
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
|
-
import { Kernel } from "./main.js";
|
|
10
|
-
import { FsLoader, HelpCommand } from "../../modules/ace/main.js";
|
|
11
|
-
/**
|
|
12
|
-
* Create and configure an Ace command kernel for AdonisJS applications.
|
|
13
|
-
* This function abstracts the kernel setup logic and can be used in different
|
|
14
|
-
* environments with appropriate configurations.
|
|
15
|
-
*
|
|
16
|
-
* - In console environment, Ace manages the lifecycle of the process
|
|
17
|
-
* - In other environments, Ace can be pulled from the container to run commands
|
|
18
|
-
*
|
|
19
|
-
* @param app - The AdonisJS application service instance
|
|
20
|
-
* @param commandName - Optional specific command name for optimized loading
|
|
21
|
-
*
|
|
22
|
-
* @example
|
|
23
|
-
* ```ts
|
|
24
|
-
* const app = new Application(new URL('../', import.meta.url))
|
|
25
|
-
* const kernel = createAceKernel(app)
|
|
26
|
-
*
|
|
27
|
-
* // Run a specific command
|
|
28
|
-
* await kernel.handle(['make:controller', 'UserController'])
|
|
29
|
-
* ```
|
|
30
|
-
*/
|
|
31
|
-
export function createAceKernel(app, commandName) {
|
|
32
|
-
const kernel = new Kernel(app);
|
|
33
|
-
kernel.info.set('binary', 'node ace');
|
|
34
|
-
/**
|
|
35
|
-
* Lazy import commands mentioned in the "commands" array
|
|
36
|
-
* of rcFile
|
|
37
|
-
*/
|
|
38
|
-
app.rcFile.commands.forEach((commandModule) => {
|
|
39
|
-
kernel.addLoader(() => typeof commandModule === 'function' ? commandModule() : app.import(commandModule));
|
|
40
|
-
});
|
|
41
|
-
/**
|
|
42
|
-
* When we know the command we are running ahead of time, then we
|
|
43
|
-
* defer loading the application commands if the command has
|
|
44
|
-
* already been registered by other loaders.
|
|
45
|
-
*/
|
|
46
|
-
const fsLoader = new FsLoader(app.commandsPath());
|
|
47
|
-
kernel.addLoader({
|
|
48
|
-
async getMetaData() {
|
|
49
|
-
if (!commandName || !kernel.getCommand(commandName)) {
|
|
50
|
-
return fsLoader.getMetaData();
|
|
51
|
-
}
|
|
52
|
-
return [];
|
|
53
|
-
},
|
|
54
|
-
getCommand(command) {
|
|
55
|
-
return fsLoader.getCommand(command);
|
|
56
|
-
},
|
|
57
|
-
});
|
|
58
|
-
/**
|
|
59
|
-
* Custom global flags
|
|
60
|
-
*/
|
|
61
|
-
kernel.defineFlag('ansi', {
|
|
62
|
-
type: 'boolean',
|
|
63
|
-
showNegatedVariantInHelp: true,
|
|
64
|
-
description: 'Force enable or disable colorful output',
|
|
65
|
-
});
|
|
66
|
-
kernel.defineFlag('help', {
|
|
67
|
-
type: 'boolean',
|
|
68
|
-
description: HelpCommand.description,
|
|
69
|
-
});
|
|
70
|
-
/**
|
|
71
|
-
* Flag listener to turn colors on/off
|
|
72
|
-
*/
|
|
73
|
-
kernel.on('ansi', (_, $kernel, parsed) => {
|
|
74
|
-
if (parsed.flags.ansi === false) {
|
|
75
|
-
$kernel.ui.switchMode('silent');
|
|
76
|
-
}
|
|
77
|
-
if (parsed.flags.ansi === true) {
|
|
78
|
-
$kernel.ui.switchMode('normal');
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
/**
|
|
82
|
-
* Flag listener to display the help
|
|
83
|
-
*/
|
|
84
|
-
kernel.on('help', async (command, $kernel, parsed) => {
|
|
85
|
-
parsed.args.unshift(command.commandName);
|
|
86
|
-
const help = new HelpCommand($kernel, parsed, kernel.ui, kernel.prompt);
|
|
87
|
-
await help.exec();
|
|
88
|
-
return $kernel.shortcircuit();
|
|
89
|
-
});
|
|
90
|
-
return kernel;
|
|
91
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
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
|
-
import { Kernel as AceKernel } from '@adonisjs/ace';
|
|
10
|
-
import { ListCommand } from "./commands.js";
|
|
11
|
-
/**
|
|
12
|
-
* The Ace command kernel for AdonisJS applications. This kernel extends the base
|
|
13
|
-
* Ace kernel with AdonisJS-specific functionality like dependency injection and
|
|
14
|
-
* application lifecycle management.
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* ```ts
|
|
18
|
-
* const app = new Application(new URL('../', import.meta.url))
|
|
19
|
-
* const kernel = new Kernel(app)
|
|
20
|
-
*
|
|
21
|
-
* await kernel.handle(['make:controller', 'UserController'])
|
|
22
|
-
* ```
|
|
23
|
-
*/
|
|
24
|
-
export class Kernel extends AceKernel {
|
|
25
|
-
app;
|
|
26
|
-
/**
|
|
27
|
-
* Create a new Ace kernel instance
|
|
28
|
-
*
|
|
29
|
-
* @param app - The AdonisJS application instance
|
|
30
|
-
*/
|
|
31
|
-
constructor(app) {
|
|
32
|
-
super(ListCommand, {
|
|
33
|
-
create: async (command, parsedOutput, $kernel) => {
|
|
34
|
-
return app.container.make(command, [app, $kernel, parsedOutput, $kernel.ui, $kernel.prompt]);
|
|
35
|
-
},
|
|
36
|
-
run: (command) => command.exec(),
|
|
37
|
-
});
|
|
38
|
-
this.app = app;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
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
|
-
/**
|
|
10
|
-
* Define configuration for the dumper service exported by the
|
|
11
|
-
* "@adonisjs/core/services/dumper" module. This function allows
|
|
12
|
-
* you to customize HTML and console output formatting options.
|
|
13
|
-
*
|
|
14
|
-
* @param dumperConfig - Configuration object with HTML and console options
|
|
15
|
-
* @param dumperConfig.html - HTML output formatting configuration
|
|
16
|
-
* @param dumperConfig.console - Console output formatting configuration
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* ```ts
|
|
20
|
-
* export default defineConfig({
|
|
21
|
-
* html: {
|
|
22
|
-
* showHidden: true,
|
|
23
|
-
* depth: 5,
|
|
24
|
-
* colors: true
|
|
25
|
-
* },
|
|
26
|
-
* console: {
|
|
27
|
-
* showHidden: false,
|
|
28
|
-
* depth: 3,
|
|
29
|
-
* collapse: ['Date', 'DateTime']
|
|
30
|
-
* }
|
|
31
|
-
* })
|
|
32
|
-
* ```
|
|
33
|
-
*/
|
|
34
|
-
export function defineConfig(dumperConfig) {
|
|
35
|
-
return dumperConfig;
|
|
36
|
-
}
|