@adonisjs/core 7.0.0-next.10 → 7.0.0-next.12
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-DDzvaSs_.js +16 -0
- package/build/app-B6oge7b3.js +5 -0
- package/build/app-BK0PN3li.js +5 -0
- package/build/bodyparser_middleware-DTW0epKM.js +3 -0
- package/build/chunk-MjwdjG2f.js +32 -0
- package/build/commands/add.js +40 -110
- package/build/commands/build.js +51 -107
- 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 -150
- package/build/commands/test.js +92 -202
- package/build/config-B2S2xfmN.js +5 -0
- package/build/config_provider-CY-xuo2R.js +13 -0
- package/build/container-ClFvcykQ.js +5 -0
- package/build/core-CNNCwlhc.js +95 -0
- package/build/create_kernel-B7zWS8Zz.js +38 -0
- package/build/create_kernel-CsTq0pWc.js +3 -0
- package/build/debug-DURPi9xn.js +3 -0
- package/build/decorate-DM0Sx1ye.js +7 -0
- package/build/dumper-C_sMcyFb.js +147 -0
- package/build/edge-LQdCc1L3.js +47 -0
- package/build/encryption-D2HGu0bU.js +5 -0
- package/build/events-B8hK42QT.js +5 -0
- package/build/factories/app.js +2 -9
- package/build/factories/bodyparser.js +2 -9
- package/build/factories/core/ace.js +15 -46
- package/build/factories/core/ignitor.js +12 -180
- package/build/factories/core/main.js +22 -11
- package/build/factories/core/test_utils.js +19 -43
- 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 +28 -91
- package/build/ignitor-Dil-rtCo.js +63 -0
- package/build/index.js +13 -46
- package/build/logger-Dha-0hp1.js +13 -0
- package/build/main-2-nm3TiB.js +72 -0
- package/build/main-BTUXw6He.js +171 -0
- package/build/main-BWftwyAK.js +81 -0
- package/build/main-BrJQ1VAM.js +52 -0
- package/build/main-CFmDHDls.js +35 -0
- package/build/main-D5xz2ZN1.js +5 -0
- package/build/main-kn40V-hF.js +2 -0
- package/build/main-q9TMzWUj.js +5 -0
- package/build/modules/ace/codemods.js +222 -477
- package/build/modules/ace/main.js +2 -41
- package/build/modules/app.js +4 -26
- package/build/modules/bodyparser/bodyparser_middleware.js +2 -14
- package/build/modules/bodyparser/main.js +4 -9
- package/build/modules/config.js +4 -26
- package/build/modules/container.js +4 -9
- package/build/modules/dumper/main.js +6 -32
- package/build/modules/dumper/plugins/edge.js +2 -62
- package/build/modules/encryption.js +4 -26
- package/build/modules/env/editor.js +2 -9
- package/build/modules/env/main.js +2 -28
- package/build/modules/events.js +4 -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/main.js +4 -15
- package/build/modules/http/url_builder_client.js +2 -9
- 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.js +147 -359
- package/build/providers/edge_provider.js +97 -165
- package/build/providers/hash_provider.js +29 -91
- package/build/providers/repl_provider.js +61 -152
- package/build/providers/vinejs_provider.d.ts +1 -1
- package/build/providers/vinejs_provider.js +20 -66
- package/build/repl-CumYg2V_.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.js +5 -17
- 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 +2 -78
- package/build/src/helpers/types.js +26 -135
- package/build/src/helpers/verification_token.js +2 -120
- package/build/src/test_utils/main.js +5 -77
- package/build/src/types.js +0 -8
- package/build/src/vine.js +2 -105
- package/build/string-CJ7ewUFq.js +28 -0
- package/build/test_utils-c_TEaEHW.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.js +2 -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-CNQ4tlGM.js +41 -0
- package/build/verification_token-DXsW81rl.js +46 -0
- package/build/vine-Bt4ymkM0.js +32 -0
- package/package.json +81 -31
- 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/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/controller.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
|
@@ -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/bodyparser/types';
|
|
1
|
+
export * from "@adonisjs/bodyparser/types";
|
|
2
|
+
export {};
|
package/build/types/common.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 '@poppinss/utils/types';
|
|
1
|
+
export * from "@poppinss/utils/types";
|
|
2
|
+
export {};
|
package/build/types/container.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/fold/types';
|
|
1
|
+
export * from "@adonisjs/fold/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/encryption/types';
|
|
1
|
+
export * from "@adonisjs/encryption/types";
|
|
2
|
+
export {};
|
package/build/types/events.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/events/types';
|
|
1
|
+
export * from "@adonisjs/events/types";
|
|
2
|
+
export {};
|
package/build/types/hash.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/hash/types';
|
|
1
|
+
export * from "@adonisjs/hash/types";
|
|
2
|
+
export {};
|
package/build/types/health.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/health/types';
|
|
1
|
+
export * from "@adonisjs/health/types";
|
|
2
|
+
export {};
|
package/build/types/helpers.js
CHANGED
package/build/types/http.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/http-server/types';
|
|
1
|
+
export * from "@adonisjs/http-server/types";
|
|
2
|
+
export {};
|
package/build/types/logger.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/logger/types';
|
|
1
|
+
export * from "@adonisjs/logger/types";
|
|
2
|
+
export {};
|
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,41 @@
|
|
|
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) {
|
|
12
|
+
const importsBuffer = buffer.create();
|
|
13
|
+
importsBuffer.write(`import type { InferData, InferVariants } from '@adonisjs/core/types/transformers'`);
|
|
14
|
+
if (withSharedProps) importsBuffer.write(`import type { InferSharedProps } from '@adonisjs/inertia/types'`);
|
|
15
|
+
buffer.writeLine(importsBuffer);
|
|
16
|
+
buffer.write("export namespace Data {").indent();
|
|
17
|
+
function generateNamespaceTree(input, parents) {
|
|
18
|
+
Object.keys(input).forEach((key) => {
|
|
19
|
+
const value = input[key];
|
|
20
|
+
if (typeof value === "string") {
|
|
21
|
+
const importName = `${parents.join()}${key}Transformer`;
|
|
22
|
+
importsBuffer.write(`import type ${importName} from '${value}'`);
|
|
23
|
+
buffer.write(`export type ${key} = InferData<${importName}>`);
|
|
24
|
+
buffer.write(`export namespace ${key} {`).indent();
|
|
25
|
+
buffer.write(`export type Variants = InferVariants<${importName}>`);
|
|
26
|
+
buffer.dedent().write("}");
|
|
27
|
+
} else {
|
|
28
|
+
buffer.write(`export namespace ${key} {`).indent();
|
|
29
|
+
generateNamespaceTree(value, [...parents, key]);
|
|
30
|
+
buffer.dedent().write(`}`);
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
generateNamespaceTree(transformersList, []);
|
|
35
|
+
if (withSharedProps) {
|
|
36
|
+
importsBuffer.write(`import type InertiaMiddleware from '#middleware/inertia_middleware'`);
|
|
37
|
+
buffer.write("export type SharedProps = InferSharedProps<InertiaMiddleware>");
|
|
38
|
+
}
|
|
39
|
+
buffer.dedent().write("}");
|
|
40
|
+
}
|
|
41
|
+
export { importTypeScript as n, outputTransformerDataObjects as r, importAssembler as t };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import string from "@poppinss/utils/string";
|
|
2
|
+
import base64 from "@poppinss/utils/base64";
|
|
3
|
+
import { Secret, safeEqual } from "@poppinss/utils";
|
|
4
|
+
import { createHash } from "node:crypto";
|
|
5
|
+
var VerificationToken = class {
|
|
6
|
+
static decode(value) {
|
|
7
|
+
if (typeof value !== "string") return null;
|
|
8
|
+
if (!value) return null;
|
|
9
|
+
const [identifier, ...tokenValue] = value.split(".");
|
|
10
|
+
if (!identifier || tokenValue.length === 0) return null;
|
|
11
|
+
const decodedIdentifier = base64.urlDecode(identifier);
|
|
12
|
+
const decodedSecret = base64.urlDecode(tokenValue.join("."));
|
|
13
|
+
if (!decodedIdentifier || !decodedSecret) return null;
|
|
14
|
+
return {
|
|
15
|
+
identifier: decodedIdentifier,
|
|
16
|
+
secret: new Secret(decodedSecret)
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
static createTransientToken(userId, size, expiresIn) {
|
|
20
|
+
const expiresAt = /* @__PURE__ */ new Date();
|
|
21
|
+
expiresAt.setSeconds(expiresAt.getSeconds() + string.seconds.parse(expiresIn));
|
|
22
|
+
return {
|
|
23
|
+
userId,
|
|
24
|
+
expiresAt,
|
|
25
|
+
...this.seed(size)
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
static seed(size) {
|
|
29
|
+
const secret = new Secret(string.random(size));
|
|
30
|
+
return {
|
|
31
|
+
secret,
|
|
32
|
+
hash: createHash("sha256").update(secret.release()).digest("hex")
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
computeValue(secret) {
|
|
36
|
+
this.value = new Secret(`${base64.urlEncode(String(this.identifier))}.${base64.urlEncode(secret.release())}`);
|
|
37
|
+
}
|
|
38
|
+
isExpired() {
|
|
39
|
+
return this.expiresAt < /* @__PURE__ */ new Date();
|
|
40
|
+
}
|
|
41
|
+
verify(secret) {
|
|
42
|
+
const newHash = createHash("sha256").update(secret.release()).digest("hex");
|
|
43
|
+
return safeEqual(this.hash, newHash);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
export { VerificationToken as t };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import vine, { BaseLiteralType, symbols } from "@vinejs/vine";
|
|
2
|
+
const MULTIPART_FILE = symbols.SUBTYPE ?? Symbol.for("subtype");
|
|
3
|
+
function isBodyParserFile(file) {
|
|
4
|
+
return !!(file && typeof file === "object" && "isMultipartFile" in file);
|
|
5
|
+
}
|
|
6
|
+
const isMultipartFile = vine.createRule((file, options, field) => {
|
|
7
|
+
if (!isBodyParserFile(file)) {
|
|
8
|
+
field.report("The {{ field }} must be a file", "file", field);
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
const validationOptions = typeof options === "function" ? options(field) : options;
|
|
12
|
+
if (file.sizeLimit === void 0 && validationOptions.size) file.sizeLimit = validationOptions.size;
|
|
13
|
+
if (file.allowedExtensions === void 0 && validationOptions.extnames) file.allowedExtensions = validationOptions.extnames;
|
|
14
|
+
file.validate();
|
|
15
|
+
file.errors.forEach((error) => {
|
|
16
|
+
field.report(error.message, `file.${error.type}`, field, validationOptions);
|
|
17
|
+
});
|
|
18
|
+
return file.isValid;
|
|
19
|
+
});
|
|
20
|
+
var VineMultipartFile = class VineMultipartFile extends BaseLiteralType {
|
|
21
|
+
#validationOptions;
|
|
22
|
+
[MULTIPART_FILE] = "multipartFile";
|
|
23
|
+
constructor(validationOptions, options, validations) {
|
|
24
|
+
super(options, validations || []);
|
|
25
|
+
this.#validationOptions = validationOptions;
|
|
26
|
+
this.dataTypeValidator = isMultipartFile(validationOptions || {});
|
|
27
|
+
}
|
|
28
|
+
clone() {
|
|
29
|
+
return new VineMultipartFile(this.#validationOptions, this.cloneOptions(), this.cloneValidations());
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
export { VineMultipartFile 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-next.
|
|
4
|
+
"version": "7.0.0-next.12",
|
|
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"
|
|
@@ -68,9 +60,9 @@
|
|
|
68
60
|
"pretest": "npm run lint",
|
|
69
61
|
"test": "cross-env NODE_DEBUG=adonisjs:core c8 npm run quick:test",
|
|
70
62
|
"clean": "del-cli build",
|
|
71
|
-
"copy:templates": "copyfiles \"stubs/**/**/*.stub\" build",
|
|
63
|
+
"copy:templates": "copyfiles \"stubs/**/**/*.stub\" --up=1 build",
|
|
72
64
|
"precompile": "npm run lint",
|
|
73
|
-
"compile": "npm run clean && tsc",
|
|
65
|
+
"compile": "npm run clean && tsdown && tsc --emitDeclarationOnly --declaration",
|
|
74
66
|
"postcompile": "npm run copy:templates && npm run index:commands",
|
|
75
67
|
"build": "npm run compile",
|
|
76
68
|
"docs": "typedoc",
|
|
@@ -85,20 +77,20 @@
|
|
|
85
77
|
"index:commands": "node --import=@poppinss/ts-exec toolkit/main.js index build/commands"
|
|
86
78
|
},
|
|
87
79
|
"devDependencies": {
|
|
88
|
-
"@adonisjs/assembler": "^8.0.0-next.
|
|
80
|
+
"@adonisjs/assembler": "^8.0.0-next.19",
|
|
89
81
|
"@adonisjs/eslint-config": "^3.0.0-next.4",
|
|
90
82
|
"@adonisjs/prettier-config": "^1.4.5",
|
|
91
|
-
"@adonisjs/tsconfig": "^2.0.0-next.
|
|
83
|
+
"@adonisjs/tsconfig": "^2.0.0-next.3",
|
|
92
84
|
"@japa/assert": "^4.1.1",
|
|
93
85
|
"@japa/expect-type": "^2.0.3",
|
|
94
86
|
"@japa/file-system": "^2.3.2",
|
|
95
87
|
"@japa/runner": "^4.4.0",
|
|
96
88
|
"@japa/snapshot": "^2.0.9",
|
|
97
89
|
"@poppinss/ts-exec": "^1.4.1",
|
|
98
|
-
"@release-it/conventional-changelog": "^10.0.
|
|
99
|
-
"@types/node": "^24.10.
|
|
90
|
+
"@release-it/conventional-changelog": "^10.0.2",
|
|
91
|
+
"@types/node": "^24.10.1",
|
|
100
92
|
"@types/pretty-hrtime": "^1.0.3",
|
|
101
|
-
"@types/sinon": "^
|
|
93
|
+
"@types/sinon": "^21.0.0",
|
|
102
94
|
"@types/supertest": "^6.0.3",
|
|
103
95
|
"@types/test-console": "^2.0.3",
|
|
104
96
|
"@vinejs/vine": "^4.1.0",
|
|
@@ -110,35 +102,37 @@
|
|
|
110
102
|
"del-cli": "^7.0.0",
|
|
111
103
|
"edge.js": "^6.3.0",
|
|
112
104
|
"eslint": "^9.39.1",
|
|
113
|
-
"execa": "^9.6.
|
|
105
|
+
"execa": "^9.6.1",
|
|
114
106
|
"get-port": "^7.1.0",
|
|
115
|
-
"
|
|
116
|
-
"
|
|
107
|
+
"pino-pretty": "^13.1.3",
|
|
108
|
+
"prettier": "^3.7.3",
|
|
109
|
+
"release-it": "^19.0.6",
|
|
117
110
|
"sinon": "^21.0.0",
|
|
118
111
|
"supertest": "^7.1.4",
|
|
119
112
|
"test-console": "^2.0.0",
|
|
120
113
|
"timekeeper": "^2.3.1",
|
|
121
|
-
"
|
|
114
|
+
"tsdown": "^0.17.0-beta.5",
|
|
115
|
+
"typedoc": "^0.28.15",
|
|
122
116
|
"typescript": "^5.9.3",
|
|
123
117
|
"youch": "^4.1.0-beta.11"
|
|
124
118
|
},
|
|
125
119
|
"dependencies": {
|
|
126
|
-
"@adonisjs/ace": "^14.0.1-next.
|
|
120
|
+
"@adonisjs/ace": "^14.0.1-next.3",
|
|
127
121
|
"@adonisjs/application": "^9.0.0-next.10",
|
|
128
|
-
"@adonisjs/bodyparser": "^11.0.0-next.
|
|
122
|
+
"@adonisjs/bodyparser": "^11.0.0-next.4",
|
|
129
123
|
"@adonisjs/config": "^6.0.0-next.1",
|
|
130
124
|
"@adonisjs/encryption": "^7.0.0-next.1",
|
|
131
|
-
"@adonisjs/env": "^7.0.0-next.
|
|
125
|
+
"@adonisjs/env": "^7.0.0-next.2",
|
|
132
126
|
"@adonisjs/events": "^10.1.0-next.2",
|
|
133
127
|
"@adonisjs/fold": "^11.0.0-next.3",
|
|
134
128
|
"@adonisjs/hash": "^10.0.0-next.1",
|
|
135
|
-
"@adonisjs/health": "^3.
|
|
136
|
-
"@adonisjs/http-server": "^8.0.0-next.
|
|
137
|
-
"@adonisjs/http-transformers": "^1.
|
|
129
|
+
"@adonisjs/health": "^3.1.0-next.0",
|
|
130
|
+
"@adonisjs/http-server": "^8.0.0-next.13",
|
|
131
|
+
"@adonisjs/http-transformers": "^1.6.0",
|
|
138
132
|
"@adonisjs/logger": "^7.1.0-next.2",
|
|
139
133
|
"@adonisjs/repl": "^5.0.0-next.0",
|
|
140
134
|
"@poppinss/colors": "^4.1.5",
|
|
141
|
-
"@poppinss/dumper": "^0.
|
|
135
|
+
"@poppinss/dumper": "^0.7.0",
|
|
142
136
|
"@poppinss/macroable": "^1.1.0",
|
|
143
137
|
"@poppinss/utils": "^7.0.0-next.3",
|
|
144
138
|
"@sindresorhus/is": "^7.1.1",
|
|
@@ -154,7 +148,8 @@
|
|
|
154
148
|
"argon2": "^0.43.0",
|
|
155
149
|
"bcrypt": "^6.0.0",
|
|
156
150
|
"edge.js": "^6.2.0",
|
|
157
|
-
"youch": "^4.1.0-beta.11"
|
|
151
|
+
"youch": "^4.1.0-beta.11",
|
|
152
|
+
"pino-pretty": "^13.1.3"
|
|
158
153
|
},
|
|
159
154
|
"peerDependenciesMeta": {
|
|
160
155
|
"argon2": {
|
|
@@ -174,6 +169,9 @@
|
|
|
174
169
|
},
|
|
175
170
|
"youch": {
|
|
176
171
|
"optional": true
|
|
172
|
+
},
|
|
173
|
+
"pino-pretty": {
|
|
174
|
+
"optional": true
|
|
177
175
|
}
|
|
178
176
|
},
|
|
179
177
|
"homepage": "https://github.com/adonisjs/core#readme",
|
|
@@ -217,6 +215,58 @@
|
|
|
217
215
|
"@commitlint/config-conventional"
|
|
218
216
|
]
|
|
219
217
|
},
|
|
218
|
+
"tsdown": {
|
|
219
|
+
"entry": [
|
|
220
|
+
"index.ts",
|
|
221
|
+
"commands/main.ts",
|
|
222
|
+
"commands/**/*.ts",
|
|
223
|
+
"factories/core/main.ts",
|
|
224
|
+
"factories/**/*.ts",
|
|
225
|
+
"src/types.ts",
|
|
226
|
+
"toolkit/main.ts",
|
|
227
|
+
"types/**/*.ts",
|
|
228
|
+
"services/**/*.ts",
|
|
229
|
+
"providers/**/*.ts",
|
|
230
|
+
"src/helpers/main.ts",
|
|
231
|
+
"src/helpers/**/*.ts",
|
|
232
|
+
"modules/ace/main.ts",
|
|
233
|
+
"modules/ace/codemods.ts",
|
|
234
|
+
"modules/bodyparser/main.ts",
|
|
235
|
+
"modules/bodyparser/bodyparser_middleware.ts",
|
|
236
|
+
"modules/hash/main.ts",
|
|
237
|
+
"modules/hash/phc_formatter.ts",
|
|
238
|
+
"modules/hash/drivers/argon.ts",
|
|
239
|
+
"modules/hash/drivers/bcrypt.ts",
|
|
240
|
+
"modules/hash/drivers/scrypt.ts",
|
|
241
|
+
"modules/app.ts",
|
|
242
|
+
"modules/config.ts",
|
|
243
|
+
"modules/container.ts",
|
|
244
|
+
"modules/encryption.ts",
|
|
245
|
+
"modules/env/main.ts",
|
|
246
|
+
"modules/dumper/main.ts",
|
|
247
|
+
"modules/dumper/plugins/edge.ts",
|
|
248
|
+
"modules/env/editor.ts",
|
|
249
|
+
"modules/events.ts",
|
|
250
|
+
"modules/http/main.ts",
|
|
251
|
+
"modules/http/url_builder_client.ts",
|
|
252
|
+
"modules/logger.ts",
|
|
253
|
+
"modules/repl.ts",
|
|
254
|
+
"modules/transformers/main.ts",
|
|
255
|
+
"src/exceptions.ts",
|
|
256
|
+
"src/test_utils/main.ts",
|
|
257
|
+
"modules/health.ts",
|
|
258
|
+
"src/vine.ts"
|
|
259
|
+
],
|
|
260
|
+
"outDir": "./build",
|
|
261
|
+
"clean": true,
|
|
262
|
+
"format": "esm",
|
|
263
|
+
"minify": "dce-only",
|
|
264
|
+
"fixedExtension": false,
|
|
265
|
+
"dts": false,
|
|
266
|
+
"treeshake": false,
|
|
267
|
+
"sourcemaps": false,
|
|
268
|
+
"target": "esnext"
|
|
269
|
+
},
|
|
220
270
|
"release-it": {
|
|
221
271
|
"git": {
|
|
222
272
|
"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
|
-
}
|