@adonisjs/core 7.0.0-next.11 → 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 +1 -1
- package/build/commands/build.js +1 -1
- package/build/commands/configure.js +1 -1
- package/build/commands/eject.js +1 -1
- package/build/commands/env/add.js +1 -1
- package/build/commands/generate_key.js +1 -1
- package/build/commands/inspect_rcfile.js +1 -1
- package/build/commands/list/routes.js +1 -1
- package/build/commands/make/command.js +1 -1
- package/build/commands/make/controller.js +1 -1
- package/build/commands/make/event.js +1 -1
- package/build/commands/make/exception.js +1 -1
- package/build/commands/make/listener.js +1 -1
- package/build/commands/make/middleware.js +1 -1
- package/build/commands/make/preload.js +1 -1
- package/build/commands/make/provider.js +1 -1
- package/build/commands/make/service.js +1 -1
- package/build/commands/make/test.js +1 -1
- package/build/commands/make/transformer.js +1 -1
- package/build/commands/make/validator.js +1 -1
- package/build/commands/make/view.js +1 -1
- package/build/commands/repl.js +1 -1
- package/build/commands/serve.js +1 -1
- package/build/commands/test.js +1 -1
- 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/core/ace.js +5 -5
- package/build/factories/core/ignitor.js +2 -2
- package/build/factories/core/main.js +6 -6
- package/build/factories/core/test_utils.js +3 -3
- package/build/factories/stubs.js +1 -1
- package/build/ignitor-Dil-rtCo.js +63 -0
- package/build/index.js +1 -1
- 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/main.js +1 -1
- package/build/providers/app_provider.js +1 -1
- package/build/repl-CumYg2V_.js +5 -0
- package/build/string-CJ7ewUFq.js +28 -0
- package/build/test_utils-c_TEaEHW.js +10 -0
- package/build/toolkit/main.js +25 -0
- 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 +6 -13
- /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
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { t as Ignitor } from "./main-BTUXw6He.js";
|
|
2
|
+
import { t as IgnitorFactory } from "./ignitor-Dil-rtCo.js";
|
|
3
|
+
import { t as createAceKernel } from "./create_kernel-B7zWS8Zz.js";
|
|
4
|
+
var AceFactory = class {
|
|
5
|
+
async make(ignitorOrAppRoot, options) {
|
|
6
|
+
if (ignitorOrAppRoot instanceof Ignitor) {
|
|
7
|
+
const app$1 = ignitorOrAppRoot.createApp("console");
|
|
8
|
+
await app$1.init();
|
|
9
|
+
return createAceKernel(app$1);
|
|
10
|
+
}
|
|
11
|
+
const app = new IgnitorFactory().withCoreConfig().withCoreProviders().create(ignitorOrAppRoot, options).createApp("console");
|
|
12
|
+
await app.init();
|
|
13
|
+
return createAceKernel(app);
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
export { AceFactory as t };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import "node:module";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (all, symbols) => {
|
|
7
|
+
let target = {};
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
|
+
if (symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
13
|
+
return target;
|
|
14
|
+
};
|
|
15
|
+
var __copyProps = (to, from, except, desc) => {
|
|
16
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
17
|
+
key = keys[i];
|
|
18
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
19
|
+
get: ((k) => from[k]).bind(null, key),
|
|
20
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
return to;
|
|
24
|
+
};
|
|
25
|
+
var __reExport = (target, mod, secondTarget, symbols) => {
|
|
26
|
+
if (symbols) {
|
|
27
|
+
__defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
28
|
+
secondTarget && __defProp(secondTarget, Symbol.toStringTag, { value: "Module" });
|
|
29
|
+
}
|
|
30
|
+
__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default");
|
|
31
|
+
};
|
|
32
|
+
export { __reExport as n, __export as t };
|
package/build/commands/add.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as BaseCommand, l as flags, o as args } from "../main-
|
|
1
|
+
import { f as BaseCommand, l as flags, o as args } from "../main-BWftwyAK.js";
|
|
2
2
|
import { t as __decorate } from "../decorate-DM0Sx1ye.js";
|
|
3
3
|
var Add = class extends BaseCommand {
|
|
4
4
|
static commandName = "add";
|
package/build/commands/build.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as importTypeScript, t as importAssembler } from "../utils-CNQ4tlGM.js";
|
|
2
|
-
import { f as BaseCommand, l as flags } from "../main-
|
|
2
|
+
import { f as BaseCommand, l as flags } from "../main-BWftwyAK.js";
|
|
3
3
|
import { t as __decorate } from "../decorate-DM0Sx1ye.js";
|
|
4
4
|
var Build = class extends BaseCommand {
|
|
5
5
|
static commandName = "build";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as stubsRoot } from "../main-kn40V-hF.js";
|
|
2
|
-
import { f as BaseCommand, l as flags, o as args } from "../main-
|
|
2
|
+
import { f as BaseCommand, l as flags, o as args } from "../main-BWftwyAK.js";
|
|
3
3
|
import { t as __decorate } from "../decorate-DM0Sx1ye.js";
|
|
4
4
|
import { RuntimeException } from "@poppinss/utils/exception";
|
|
5
5
|
var Configure = class extends BaseCommand {
|
package/build/commands/eject.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as string_default } from "../string-CJ7ewUFq.js";
|
|
2
|
-
import { f as BaseCommand, l as flags, o as args } from "../main-
|
|
2
|
+
import { f as BaseCommand, l as flags, o as args } from "../main-BWftwyAK.js";
|
|
3
3
|
import { t as __decorate } from "../decorate-DM0Sx1ye.js";
|
|
4
4
|
var Eject = class extends BaseCommand {
|
|
5
5
|
static commandName = "eject";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as string_default } from "../../string-CJ7ewUFq.js";
|
|
2
|
-
import { f as BaseCommand, l as flags, o as args } from "../../main-
|
|
2
|
+
import { f as BaseCommand, l as flags, o as args } from "../../main-BWftwyAK.js";
|
|
3
3
|
import { t as __decorate } from "../../decorate-DM0Sx1ye.js";
|
|
4
4
|
const ALLOWED_TYPES = [
|
|
5
5
|
"string",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as BaseCommand, l as flags } from "../main-
|
|
1
|
+
import { f as BaseCommand, l as flags } from "../main-BWftwyAK.js";
|
|
2
2
|
import { t as __decorate } from "../decorate-DM0Sx1ye.js";
|
|
3
3
|
import string from "@poppinss/utils/string";
|
|
4
4
|
import { EnvEditor } from "@adonisjs/env/editor";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as BaseCommand } from "../main-
|
|
1
|
+
import { f as BaseCommand } from "../main-BWftwyAK.js";
|
|
2
2
|
var InspectRCFile = class extends BaseCommand {
|
|
3
3
|
static commandName = "inspect:rcfile";
|
|
4
4
|
static description = "Inspect the RC file with its default values";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as BaseCommand, l as flags, o as args, s as cliHelpers } from "../../main-
|
|
1
|
+
import { f as BaseCommand, l as flags, o as args, s as cliHelpers } from "../../main-BWftwyAK.js";
|
|
2
2
|
import { t as __decorate } from "../../decorate-DM0Sx1ye.js";
|
|
3
3
|
import stringWidth from "string-width";
|
|
4
4
|
import { middlewareInfo, routeInfo } from "@adonisjs/http-server/helpers";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as stubsRoot } from "../../main-kn40V-hF.js";
|
|
2
|
-
import { f as BaseCommand, o as args } from "../../main-
|
|
2
|
+
import { f as BaseCommand, o as args } from "../../main-BWftwyAK.js";
|
|
3
3
|
import { t as __decorate } from "../../decorate-DM0Sx1ye.js";
|
|
4
4
|
var MakeCommand = class extends BaseCommand {
|
|
5
5
|
static commandName = "make:command";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as stubsRoot } from "../../main-kn40V-hF.js";
|
|
2
|
-
import { f as BaseCommand, l as flags, o as args } from "../../main-
|
|
2
|
+
import { f as BaseCommand, l as flags, o as args } from "../../main-BWftwyAK.js";
|
|
3
3
|
import { t as __decorate } from "../../decorate-DM0Sx1ye.js";
|
|
4
4
|
import string from "@poppinss/utils/string";
|
|
5
5
|
var MakeController = class extends BaseCommand {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as stubsRoot } from "../../main-kn40V-hF.js";
|
|
2
|
-
import { f as BaseCommand, o as args } from "../../main-
|
|
2
|
+
import { f as BaseCommand, o as args } from "../../main-BWftwyAK.js";
|
|
3
3
|
import { t as __decorate } from "../../decorate-DM0Sx1ye.js";
|
|
4
4
|
var MakeEvent = class extends BaseCommand {
|
|
5
5
|
static commandName = "make:event";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as stubsRoot } from "../../main-kn40V-hF.js";
|
|
2
|
-
import { f as BaseCommand, o as args } from "../../main-
|
|
2
|
+
import { f as BaseCommand, o as args } from "../../main-BWftwyAK.js";
|
|
3
3
|
import { t as __decorate } from "../../decorate-DM0Sx1ye.js";
|
|
4
4
|
var MakeException = class extends BaseCommand {
|
|
5
5
|
static commandName = "make:exception";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as stubsRoot } from "../../main-kn40V-hF.js";
|
|
2
|
-
import { f as BaseCommand, l as flags, o as args } from "../../main-
|
|
2
|
+
import { f as BaseCommand, l as flags, o as args } from "../../main-BWftwyAK.js";
|
|
3
3
|
import { t as __decorate } from "../../decorate-DM0Sx1ye.js";
|
|
4
4
|
var MakeListener = class extends BaseCommand {
|
|
5
5
|
static commandName = "make:listener";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as stubsRoot } from "../../main-kn40V-hF.js";
|
|
2
2
|
import { t as string_default } from "../../string-CJ7ewUFq.js";
|
|
3
|
-
import { f as BaseCommand, l as flags, o as args } from "../../main-
|
|
3
|
+
import { f as BaseCommand, l as flags, o as args } from "../../main-BWftwyAK.js";
|
|
4
4
|
import { t as __decorate } from "../../decorate-DM0Sx1ye.js";
|
|
5
5
|
import string from "@poppinss/utils/string";
|
|
6
6
|
import { basename, extname, relative } from "node:path";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as stubsRoot } from "../../main-kn40V-hF.js";
|
|
2
2
|
import { t as string_default } from "../../string-CJ7ewUFq.js";
|
|
3
|
-
import { f as BaseCommand, l as flags, o as args } from "../../main-
|
|
3
|
+
import { f as BaseCommand, l as flags, o as args } from "../../main-BWftwyAK.js";
|
|
4
4
|
import { t as __decorate } from "../../decorate-DM0Sx1ye.js";
|
|
5
5
|
import { extname, relative } from "node:path";
|
|
6
6
|
const ALLOWED_ENVIRONMENTS = [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as stubsRoot } from "../../main-kn40V-hF.js";
|
|
2
2
|
import { t as string_default } from "../../string-CJ7ewUFq.js";
|
|
3
|
-
import { f as BaseCommand, l as flags, o as args } from "../../main-
|
|
3
|
+
import { f as BaseCommand, l as flags, o as args } from "../../main-BWftwyAK.js";
|
|
4
4
|
import { t as __decorate } from "../../decorate-DM0Sx1ye.js";
|
|
5
5
|
import { extname, relative } from "node:path";
|
|
6
6
|
const ALLOWED_ENVIRONMENTS = [
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as stubsRoot } from "../../main-kn40V-hF.js";
|
|
2
|
-
import { f as BaseCommand, o as args } from "../../main-
|
|
2
|
+
import { f as BaseCommand, o as args } from "../../main-BWftwyAK.js";
|
|
3
3
|
import { t as __decorate } from "../../decorate-DM0Sx1ye.js";
|
|
4
4
|
var MakeService = class extends BaseCommand {
|
|
5
5
|
static commandName = "make:service";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as stubsRoot } from "../../main-kn40V-hF.js";
|
|
2
|
-
import { f as BaseCommand, l as flags, o as args } from "../../main-
|
|
2
|
+
import { f as BaseCommand, l as flags, o as args } from "../../main-BWftwyAK.js";
|
|
3
3
|
import { t as __decorate } from "../../decorate-DM0Sx1ye.js";
|
|
4
4
|
var MakeTest = class extends BaseCommand {
|
|
5
5
|
static commandName = "make:test";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as stubsRoot } from "../../main-kn40V-hF.js";
|
|
2
|
-
import { f as BaseCommand, o as args } from "../../main-
|
|
2
|
+
import { f as BaseCommand, o as args } from "../../main-BWftwyAK.js";
|
|
3
3
|
import { t as __decorate } from "../../decorate-DM0Sx1ye.js";
|
|
4
4
|
var MakeTransformer = class extends BaseCommand {
|
|
5
5
|
static commandName = "make:transformer";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as stubsRoot } from "../../main-kn40V-hF.js";
|
|
2
|
-
import { f as BaseCommand, l as flags, o as args } from "../../main-
|
|
2
|
+
import { f as BaseCommand, l as flags, o as args } from "../../main-BWftwyAK.js";
|
|
3
3
|
import { t as __decorate } from "../../decorate-DM0Sx1ye.js";
|
|
4
4
|
var MakeValidator = class extends BaseCommand {
|
|
5
5
|
static commandName = "make:validator";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as stubsRoot } from "../../main-kn40V-hF.js";
|
|
2
|
-
import { f as BaseCommand, o as args } from "../../main-
|
|
2
|
+
import { f as BaseCommand, o as args } from "../../main-BWftwyAK.js";
|
|
3
3
|
import { t as __decorate } from "../../decorate-DM0Sx1ye.js";
|
|
4
4
|
var MakeView = class extends BaseCommand {
|
|
5
5
|
static commandName = "make:view";
|
package/build/commands/repl.js
CHANGED
package/build/commands/serve.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as importAssembler } from "../utils-CNQ4tlGM.js";
|
|
2
|
-
import { f as BaseCommand, l as flags } from "../main-
|
|
2
|
+
import { f as BaseCommand, l as flags } from "../main-BWftwyAK.js";
|
|
3
3
|
import { t as __decorate } from "../decorate-DM0Sx1ye.js";
|
|
4
4
|
var Serve = class extends BaseCommand {
|
|
5
5
|
static commandName = "serve";
|
package/build/commands/test.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as importAssembler } from "../utils-CNQ4tlGM.js";
|
|
2
|
-
import { f as BaseCommand, l as flags, o as args } from "../main-
|
|
2
|
+
import { f as BaseCommand, l as flags, o as args } from "../main-BWftwyAK.js";
|
|
3
3
|
import { t as __decorate } from "../decorate-DM0Sx1ye.js";
|
|
4
4
|
var Test = class extends BaseCommand {
|
|
5
5
|
static commandName = "test";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const configProvider = {
|
|
2
|
+
create(resolver) {
|
|
3
|
+
return {
|
|
4
|
+
type: "provider",
|
|
5
|
+
resolver
|
|
6
|
+
};
|
|
7
|
+
},
|
|
8
|
+
async resolve(app, provider) {
|
|
9
|
+
if (provider && typeof provider === "object" && "type" in provider) return provider.resolver(app);
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
export { configProvider as t };
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { t as string_default } from "./string-CJ7ewUFq.js";
|
|
2
|
+
import { r as outputTransformerDataObjects } from "./utils-CNQ4tlGM.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 "@adonisjs/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
|
+
}, entities.events);
|
|
14
|
+
const listeners = Object.assign({
|
|
15
|
+
enabled: true,
|
|
16
|
+
source: "app/listeners",
|
|
17
|
+
importAlias: "#listeners"
|
|
18
|
+
}, entities.listeners);
|
|
19
|
+
const controllers = Object.assign({
|
|
20
|
+
enabled: true,
|
|
21
|
+
source: "app/controllers",
|
|
22
|
+
importAlias: "#controllers"
|
|
23
|
+
}, entities.controllers);
|
|
24
|
+
const transformers = Object.assign({
|
|
25
|
+
enabled: false,
|
|
26
|
+
source: "app/transformers",
|
|
27
|
+
importAlias: "#transformers",
|
|
28
|
+
withSharedProps: false
|
|
29
|
+
}, entities.transformers);
|
|
30
|
+
return { run(_, indexGenerator) {
|
|
31
|
+
if (events.enabled) indexGenerator.add("events", {
|
|
32
|
+
source: events.source,
|
|
33
|
+
disableLazyImports: true,
|
|
34
|
+
glob: events.glob,
|
|
35
|
+
as: "barrelFile",
|
|
36
|
+
exportName: "events",
|
|
37
|
+
importAlias: events.importAlias,
|
|
38
|
+
output: ".adonisjs/server/events.ts"
|
|
39
|
+
});
|
|
40
|
+
if (listeners.enabled) indexGenerator.add("listeners", {
|
|
41
|
+
source: listeners.source,
|
|
42
|
+
glob: listeners.glob,
|
|
43
|
+
as: "barrelFile",
|
|
44
|
+
exportName: "listeners",
|
|
45
|
+
importAlias: listeners.importAlias,
|
|
46
|
+
output: ".adonisjs/server/listeners.ts"
|
|
47
|
+
});
|
|
48
|
+
if (controllers.enabled) indexGenerator.add("controllers", {
|
|
49
|
+
source: controllers.source,
|
|
50
|
+
glob: controllers.glob,
|
|
51
|
+
as: "barrelFile",
|
|
52
|
+
exportName: "controllers",
|
|
53
|
+
importAlias: controllers.importAlias,
|
|
54
|
+
removeSuffix: "controller",
|
|
55
|
+
output: ".adonisjs/server/controllers.ts"
|
|
56
|
+
});
|
|
57
|
+
if (transformers.enabled) indexGenerator.add("transformers", {
|
|
58
|
+
source: transformers.source,
|
|
59
|
+
glob: transformers.glob,
|
|
60
|
+
as(vfs, buffer, __, helpers) {
|
|
61
|
+
outputTransformerDataObjects(vfs.asTree({
|
|
62
|
+
transformKey(key) {
|
|
63
|
+
const segments = key.split("/");
|
|
64
|
+
const baseName = segments.pop();
|
|
65
|
+
return [...segments.map((segment) => string_default.pascalCase(segment)), string_default.create(baseName).removeSuffix("transformer").pascalCase()].join("/");
|
|
66
|
+
},
|
|
67
|
+
transformValue: helpers.toImportPath
|
|
68
|
+
}), buffer, transformers.withSharedProps);
|
|
69
|
+
},
|
|
70
|
+
importAlias: transformers.importAlias,
|
|
71
|
+
output: ".adonisjs/client/data.d.ts"
|
|
72
|
+
});
|
|
73
|
+
} };
|
|
74
|
+
}
|
|
75
|
+
const errors$5 = {
|
|
76
|
+
...errors$3,
|
|
77
|
+
...errors$4,
|
|
78
|
+
...errors$2,
|
|
79
|
+
...errors,
|
|
80
|
+
...errors$1
|
|
81
|
+
};
|
|
82
|
+
async function prettyPrintError(error) {
|
|
83
|
+
if (error && typeof error === "object" && error.code === "E_DUMP_DIE_EXCEPTION") {
|
|
84
|
+
console.error(error);
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
try {
|
|
88
|
+
const { Youch } = await import("youch");
|
|
89
|
+
const youch = new Youch();
|
|
90
|
+
console.error(await youch.toANSI(error));
|
|
91
|
+
} catch {
|
|
92
|
+
console.error(error);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
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-BWftwyAK.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,147 @@
|
|
|
1
|
+
import { t as __export } from "./chunk-MjwdjG2f.js";
|
|
2
|
+
import { inspect } from "node:util";
|
|
3
|
+
import { Exception } from "@poppinss/utils/exception";
|
|
4
|
+
import useColors from "@poppinss/colors";
|
|
5
|
+
import { dump } from "@poppinss/dumper/console";
|
|
6
|
+
import { createScript, createStyleSheet, dump as dump$1 } from "@poppinss/dumper/html";
|
|
7
|
+
import { parse } from "error-stack-parser-es";
|
|
8
|
+
var errors_exports = /* @__PURE__ */ __export({ E_DUMP_DIE_EXCEPTION: () => E_DUMP_DIE_EXCEPTION });
|
|
9
|
+
var DumpDieException = class extends Exception {
|
|
10
|
+
static status = 500;
|
|
11
|
+
static code = "E_DUMP_DIE_EXCEPTION";
|
|
12
|
+
#dumper;
|
|
13
|
+
#traceSourceIndex = 1;
|
|
14
|
+
value;
|
|
15
|
+
constructor(value, dumper) {
|
|
16
|
+
super("Dump and Die exception");
|
|
17
|
+
this.#dumper = dumper;
|
|
18
|
+
this.value = value;
|
|
19
|
+
}
|
|
20
|
+
#getErrorSource() {
|
|
21
|
+
if (this.fileName && this.lineNumber) return {
|
|
22
|
+
location: this.fileName,
|
|
23
|
+
line: this.lineNumber
|
|
24
|
+
};
|
|
25
|
+
const source = parse(this)[this.#traceSourceIndex];
|
|
26
|
+
if (!source.fileName || !source.lineNumber) return;
|
|
27
|
+
return {
|
|
28
|
+
location: source.fileName,
|
|
29
|
+
line: source.lineNumber
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
setTraceSourceIndex(index) {
|
|
33
|
+
this.#traceSourceIndex = index;
|
|
34
|
+
return this;
|
|
35
|
+
}
|
|
36
|
+
report() {}
|
|
37
|
+
async handle(error, ctx) {
|
|
38
|
+
const source = this.#getErrorSource();
|
|
39
|
+
const cspNonce = "nonce" in ctx.response ? ctx.response.nonce : void 0;
|
|
40
|
+
ctx.response.status(500).send(`<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width">${this.#dumper.getHeadElements(cspNonce)}</head><body>${this.#dumper.dumpToHtml(error.value, {
|
|
41
|
+
cspNonce,
|
|
42
|
+
source,
|
|
43
|
+
title: "DUMP DIE"
|
|
44
|
+
})}</body></html>`);
|
|
45
|
+
}
|
|
46
|
+
async render(error, kernel) {
|
|
47
|
+
const source = this.#getErrorSource();
|
|
48
|
+
kernel.ui.logger.log(this.#dumper.dumpToAnsi(error.value, {
|
|
49
|
+
source,
|
|
50
|
+
title: "DUMP DIE"
|
|
51
|
+
}));
|
|
52
|
+
}
|
|
53
|
+
[inspect.custom]() {
|
|
54
|
+
const source = this.#getErrorSource();
|
|
55
|
+
return this.#dumper.dumpToAnsi(this.value, {
|
|
56
|
+
source,
|
|
57
|
+
title: "DUMP DIE"
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
const E_DUMP_DIE_EXCEPTION = DumpDieException;
|
|
62
|
+
const colors = useColors.ansi();
|
|
63
|
+
const DUMP_TITLE_STYLES = `
|
|
64
|
+
.adonisjs-dump-header {
|
|
65
|
+
font-family: JetBrains Mono, monaspace argon, Menlo, Monaco, Consolas, monospace;
|
|
66
|
+
background: #ff1639;
|
|
67
|
+
border-radius: 4px;
|
|
68
|
+
color: #fff;
|
|
69
|
+
border-bottom-left-radius: 0;
|
|
70
|
+
border-bottom-right-radius: 0;
|
|
71
|
+
padding: 0.4rem 1.2rem;
|
|
72
|
+
font-size: 1em;
|
|
73
|
+
display: flex;
|
|
74
|
+
justify-content: space-between;
|
|
75
|
+
}
|
|
76
|
+
.adonisjs-dump-header .adonisjs-dump-header-title {
|
|
77
|
+
font-weight: bold;
|
|
78
|
+
text-transform: uppercase;
|
|
79
|
+
}
|
|
80
|
+
.adonisjs-dump-header .adonisjs-dump-header-source {
|
|
81
|
+
font-weight: bold;
|
|
82
|
+
color: inherit;
|
|
83
|
+
text-decoration: underline;
|
|
84
|
+
}
|
|
85
|
+
.dumper-dump pre {
|
|
86
|
+
border-radius: 4px;
|
|
87
|
+
border-top-left-radius: 0;
|
|
88
|
+
border-top-right-radius: 0;
|
|
89
|
+
}`;
|
|
90
|
+
const IDE = process.env.ADONIS_IDE ?? process.env.EDITOR ?? "";
|
|
91
|
+
var Dumper = class {
|
|
92
|
+
#app;
|
|
93
|
+
#htmlConfig = {};
|
|
94
|
+
#consoleConfig = { collapse: ["DateTime", "Date"] };
|
|
95
|
+
#editors = {
|
|
96
|
+
textmate: "txmt://open?url=file://%f&line=%l",
|
|
97
|
+
macvim: "mvim://open?url=file://%f&line=%l",
|
|
98
|
+
emacs: "emacs://open?url=file://%f&line=%l",
|
|
99
|
+
sublime: "subl://open?url=file://%f&line=%l",
|
|
100
|
+
phpstorm: "phpstorm://open?file=%f&line=%l",
|
|
101
|
+
atom: "atom://core/open/file?filename=%f&line=%l",
|
|
102
|
+
vscode: "vscode://file/%f:%l"
|
|
103
|
+
};
|
|
104
|
+
constructor(app) {
|
|
105
|
+
this.#app = app;
|
|
106
|
+
}
|
|
107
|
+
#getEditorLink(source) {
|
|
108
|
+
const editorURL = this.#editors[IDE] || IDE;
|
|
109
|
+
if (!editorURL || !source) return;
|
|
110
|
+
return {
|
|
111
|
+
href: editorURL.replace("%f", source.location).replace("%l", String(source.line)),
|
|
112
|
+
text: `${this.#app.relativePath(source.location)}:${source.line}`
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
configureHtmlOutput(config) {
|
|
116
|
+
this.#htmlConfig = config;
|
|
117
|
+
return this;
|
|
118
|
+
}
|
|
119
|
+
configureAnsiOutput(config) {
|
|
120
|
+
this.#consoleConfig = config;
|
|
121
|
+
return this;
|
|
122
|
+
}
|
|
123
|
+
getHeadElements(cspNonce) {
|
|
124
|
+
return `<style id="dumper-styles">` + createStyleSheet() + DUMP_TITLE_STYLES + `</style><script id="dumper-script"${cspNonce ? ` nonce="${cspNonce}"` : ""}>` + createScript() + "<\/script>";
|
|
125
|
+
}
|
|
126
|
+
dumpToHtml(value, options = {}) {
|
|
127
|
+
const link = this.#getEditorLink(options.source) ?? null;
|
|
128
|
+
return `<div class="adonisjs-dump-header"><span class="adonisjs-dump-header-title">${options.title || "DUMP"}</span>` + (link ? `<a href="${link.href}" class="adonisjs-dump-header-source">${link.text}</a>` : "") + "</div>" + dump$1(value, {
|
|
129
|
+
cspNonce: options.cspNonce,
|
|
130
|
+
...this.#htmlConfig
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
dumpToAnsi(value, options = {}) {
|
|
134
|
+
const columns = process.stdout.columns;
|
|
135
|
+
const link = `${this.#getEditorLink(options.source)?.text ?? ""} `;
|
|
136
|
+
const title = ` ${options.title || "DUMP"}`;
|
|
137
|
+
const whiteSpaceLength = columns ? columns - link.length - title.length - 4 : 2;
|
|
138
|
+
const whiteSpace = new Array(whiteSpaceLength <= 0 ? 2 : whiteSpaceLength).join(" ");
|
|
139
|
+
return `${colors.bgRed().bold(`${title}${whiteSpace}${link}`)}\n${dump(value, this.#consoleConfig)}`;
|
|
140
|
+
}
|
|
141
|
+
dd(value, traceSourceIndex = 1) {
|
|
142
|
+
const error = new E_DUMP_DIE_EXCEPTION(value, this);
|
|
143
|
+
error.setTraceSourceIndex(traceSourceIndex);
|
|
144
|
+
throw error;
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
export { errors_exports as n, Dumper as t };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Template } from "edge.js";
|
|
2
|
+
function pluginEdgeDumper(dumper) {
|
|
3
|
+
Template.macro("dumper", dumper);
|
|
4
|
+
return (edge$1) => {
|
|
5
|
+
edge$1.registerTag({
|
|
6
|
+
tagName: "dump",
|
|
7
|
+
block: false,
|
|
8
|
+
seekable: true,
|
|
9
|
+
noNewLine: true,
|
|
10
|
+
compile(parser, buffer, token) {
|
|
11
|
+
const parsed = parser.utils.transformAst(parser.utils.generateAST(token.properties.jsArg, token.loc, token.filename), token.filename, parser);
|
|
12
|
+
buffer.writeExpression(`template.stacks.pushOnceTo('dumper', 'dumper_globals', template.dumper.getHeadElements(state.cspNonce))`, token.filename, token.loc.start.line);
|
|
13
|
+
buffer.outputExpression(`template.dumper.dumpToHtml(${parser.utils.stringify(parsed)}, { cspNonce: state.cspNonce, source: { location: $filename, line: $lineNumber } })`, token.filename, token.loc.start.line, true);
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
edge$1.registerTag({
|
|
17
|
+
tagName: "dd",
|
|
18
|
+
block: false,
|
|
19
|
+
seekable: true,
|
|
20
|
+
noNewLine: true,
|
|
21
|
+
compile(parser, buffer, token) {
|
|
22
|
+
const parsed = parser.utils.transformAst(parser.utils.generateAST(token.properties.jsArg, token.loc, token.filename), token.filename, parser);
|
|
23
|
+
const ddStatement = [
|
|
24
|
+
"try {",
|
|
25
|
+
` template.dumper.dd(${parser.utils.stringify(parsed)})`,
|
|
26
|
+
"} catch (error) {",
|
|
27
|
+
` if (error.code === 'E_DUMP_DIE_EXCEPTION') {`,
|
|
28
|
+
" const edgeError = template.createError(error.message, $filename, $lineNumber)",
|
|
29
|
+
" error.fileName = $filename",
|
|
30
|
+
" error.lineNumber = $lineNumber",
|
|
31
|
+
" edgeError.handle = function (_, ctx) {",
|
|
32
|
+
" return error.handle(error, ctx)",
|
|
33
|
+
" }",
|
|
34
|
+
" edgeError.report = function () {",
|
|
35
|
+
" return error.report(error)",
|
|
36
|
+
" }",
|
|
37
|
+
" throw edgeError",
|
|
38
|
+
" }",
|
|
39
|
+
" throw error",
|
|
40
|
+
"}"
|
|
41
|
+
].join("\n");
|
|
42
|
+
buffer.writeStatement(ddStatement, token.filename, token.loc.start.line);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
export { pluginEdgeDumper as t };
|