@adonisjs/core 7.0.0-next.2 → 7.0.0-next.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/ace-sWl9sgM1.js +16 -0
- package/build/app-B6oge7b3.js +5 -0
- package/build/app-DNvbxVWl.js +5 -0
- package/build/bodyparser_middleware-BmARtnYe.js +3 -0
- package/build/chunk-B88MteZI.js +26 -0
- package/build/commands/add.d.ts +4 -3
- package/build/commands/add.js +76 -110
- package/build/commands/build.js +51 -107
- package/build/commands/commands.json +1 -1
- package/build/commands/configure.js +82 -177
- package/build/commands/eject.js +17 -60
- package/build/commands/env/add.js +55 -134
- package/build/commands/generate_key.js +22 -66
- package/build/commands/inspect_rcfile.js +27 -55
- package/build/commands/list/routes.js +246 -116
- package/build/commands/make/command.js +15 -57
- package/build/commands/make/controller.js +43 -120
- package/build/commands/make/event.js +16 -62
- package/build/commands/make/exception.js +16 -62
- package/build/commands/make/listener.js +36 -93
- package/build/commands/make/middleware.js +41 -101
- package/build/commands/make/preload.js +47 -113
- package/build/commands/make/provider.js +47 -112
- package/build/commands/make/service.js +16 -55
- package/build/commands/make/test.js +47 -132
- package/build/commands/make/transformer.js +17 -64
- package/build/commands/make/validator.js +20 -80
- package/build/commands/make/view.js +15 -56
- package/build/commands/repl.js +17 -50
- package/build/commands/serve.js +80 -156
- package/build/commands/test.js +92 -208
- package/build/config-Dd2H6-_e.js +5 -0
- package/build/config_provider-DWVFHOQX.js +15 -0
- package/build/container-uxa8LpGI.js +5 -0
- package/build/core-BuPP8K6N.js +140 -0
- package/build/create_kernel-Cn8zVtvt.js +3 -0
- package/build/create_kernel-Cpqqa931.js +38 -0
- package/build/decorate-CJcHOoD-.js +7 -0
- package/build/define_config-CoWy5lbf.js +62 -0
- package/build/dumper-BTjb8j4y.js +147 -0
- package/build/edge-BVYR-Vjr.js +47 -0
- package/build/events-C4d0OPUI.js +5 -0
- package/build/exceptions-DNMesP42.js +2 -0
- package/build/factories/app.js +2 -9
- package/build/factories/bodyparser.js +2 -9
- package/build/factories/core/ace.js +16 -46
- package/build/factories/core/ignitor.js +13 -180
- package/build/factories/core/main.js +24 -11
- package/build/factories/core/test_utils.js +21 -43
- package/build/factories/encryption.d.ts +1 -1
- package/build/factories/encryption.js +2 -9
- package/build/factories/events.js +2 -9
- package/build/factories/hash.js +2 -9
- package/build/factories/http.js +2 -9
- package/build/factories/logger.js +2 -9
- package/build/factories/stubs.js +27 -91
- package/build/ignitor-BrmVPN5N.js +71 -0
- package/build/index.d.ts +1 -1
- package/build/index.js +12 -46
- package/build/logger-0KKSqgPG.js +13 -0
- package/build/main-BU8NWUEG.js +73 -0
- package/build/main-Bfnr5tAw.js +2 -0
- package/build/main-BlJhxJJ2.js +81 -0
- package/build/main-C4B2SPOT.js +5 -0
- package/build/main-CZZ21eXm.js +171 -0
- package/build/main-D-WhqOOn.js +51 -0
- package/build/main-DOY5Q8Av.js +5 -0
- package/build/main-kn40V-hF.js +2 -0
- package/build/main-nojlltNo.js +30 -0
- package/build/{stubs/make → make}/health/controller.stub +5 -2
- package/build/modules/ace/codemods.d.ts +109 -14
- package/build/modules/ace/codemods.js +222 -382
- package/build/modules/ace/main.d.ts +30 -0
- package/build/modules/ace/main.js +2 -11
- package/build/modules/app.d.ts +17 -0
- package/build/modules/app.js +4 -9
- package/build/modules/bodyparser/bodyparser_middleware.js +2 -14
- package/build/modules/bodyparser/main.js +4 -9
- package/build/modules/config.d.ts +17 -0
- package/build/modules/config.js +4 -9
- package/build/modules/container.js +4 -9
- package/build/modules/dumper/dumper.d.ts +5 -0
- package/build/modules/dumper/main.d.ts +21 -0
- package/build/modules/dumper/main.js +6 -11
- package/build/modules/dumper/plugins/edge.js +2 -62
- package/build/modules/encryption/define_config.d.ts +128 -0
- package/build/modules/encryption/drivers/aes_256_cbc.d.ts +20 -0
- package/build/modules/encryption/drivers/aes_256_cbc.js +2 -0
- package/build/modules/encryption/drivers/aes_256_gcm.d.ts +21 -0
- package/build/modules/encryption/drivers/aes_256_gcm.js +2 -0
- package/build/modules/encryption/drivers/chacha20_poly1305.d.ts +21 -0
- package/build/modules/encryption/drivers/chacha20_poly1305.js +2 -0
- package/build/modules/encryption/main.d.ts +85 -0
- package/build/modules/encryption/main.js +5 -0
- package/build/modules/env/editor.js +2 -9
- package/build/modules/env/main.d.ts +19 -0
- package/build/modules/env/main.js +2 -9
- package/build/modules/events.js +4 -9
- package/build/modules/hash/drivers/argon.js +2 -9
- package/build/modules/hash/drivers/bcrypt.d.ts +11 -0
- package/build/modules/hash/drivers/bcrypt.js +2 -9
- package/build/modules/hash/drivers/scrypt.js +2 -9
- package/build/modules/hash/main.d.ts +18 -0
- package/build/modules/hash/main.js +5 -10
- package/build/modules/hash/phc_formatter.js +2 -9
- package/build/modules/health.js +2 -9
- package/build/modules/http/main.js +4 -15
- package/build/modules/http/request_validator.d.ts +1 -3
- package/build/modules/http/url_builder_client.d.ts +1 -0
- package/build/modules/http/url_builder_client.js +2 -0
- package/build/modules/logger.d.ts +30 -0
- package/build/modules/logger.js +4 -9
- package/build/modules/repl.js +4 -9
- package/build/modules/transformers/main.js +4 -9
- package/build/providers/app_provider.d.ts +14 -25
- package/build/providers/app_provider.js +155 -363
- package/build/providers/edge_provider.js +97 -114
- package/build/providers/hash_provider.js +28 -91
- package/build/providers/repl_provider.js +66 -152
- package/build/providers/vinejs_provider.d.ts +1 -1
- package/build/providers/vinejs_provider.js +19 -66
- package/build/repl-GSxgovJQ.js +5 -0
- package/build/services/ace.js +2 -17
- package/build/services/app.js +2 -21
- package/build/services/config.js +2 -13
- package/build/services/dumper.js +5 -21
- package/build/services/emitter.js +2 -14
- package/build/services/encryption.js +2 -14
- package/build/services/hash.js +2 -14
- package/build/services/logger.js +2 -14
- package/build/services/repl.js +2 -14
- package/build/services/router.js +2 -14
- package/build/services/server.js +2 -14
- package/build/services/test_utils.js +2 -17
- package/build/services/url_builder.d.ts +3 -3
- package/build/services/url_builder.js +5 -17
- package/build/src/assembler_hooks/index_entities.d.ts +29 -1
- package/build/src/debug.d.ts +1 -1
- package/build/src/exceptions.js +2 -49
- package/build/src/helpers/assert.js +2 -55
- package/build/src/helpers/http.d.ts +20 -0
- package/build/src/helpers/http.js +2 -0
- package/build/src/helpers/is.js +3 -31
- package/build/src/helpers/main.d.ts +1 -5
- package/build/src/helpers/main.js +5 -56
- package/build/src/helpers/string.js +2 -60
- package/build/src/helpers/types.js +26 -135
- package/build/src/helpers/verification_token.js +2 -120
- package/build/src/test_utils/main.js +8 -77
- package/build/src/types.d.ts +53 -99
- package/build/src/types.js +0 -8
- package/build/src/utils.d.ts +1 -1
- package/build/src/vine.js +2 -97
- package/build/string-Cx6q_win.js +28 -0
- package/build/test_utils-hkQDmNpX.js +10 -0
- package/build/toolkit/main.js +19 -21
- package/build/types/ace.js +2 -9
- package/build/types/app.js +2 -9
- package/build/types/bodyparser.js +2 -9
- package/build/types/common.js +2 -9
- package/build/types/container.js +2 -9
- package/build/types/encryption.d.ts +39 -1
- package/build/types/encryption.js +1 -9
- package/build/types/events.js +2 -9
- package/build/types/hash.js +2 -9
- package/build/types/health.js +2 -9
- package/build/types/helpers.d.ts +20 -0
- package/build/types/helpers.js +0 -8
- package/build/types/http.js +2 -9
- package/build/types/logger.js +2 -9
- package/build/types/repl.js +2 -9
- package/build/types/transformers.js +2 -9
- package/build/utils-CtGytdtt.js +42 -0
- package/build/verification_token-DrdoU4RH.js +46 -0
- package/build/vine-DGint2rk.js +32 -0
- package/package.json +113 -60
- package/build/modules/ace/commands.js +0 -157
- package/build/modules/ace/create_kernel.js +0 -91
- package/build/modules/ace/kernel.js +0 -40
- package/build/modules/dumper/define_config.js +0 -36
- package/build/modules/dumper/dumper.js +0 -256
- package/build/modules/dumper/errors.js +0 -119
- package/build/modules/encryption.d.ts +0 -1
- package/build/modules/encryption.js +0 -9
- package/build/modules/hash/define_config.js +0 -125
- package/build/modules/http/request_validator.js +0 -100
- package/build/src/assembler_hooks/index_entities.js +0 -107
- package/build/src/cli_formatters/routes_list.js +0 -381
- package/build/src/config_provider.js +0 -71
- package/build/src/debug.js +0 -25
- package/build/src/ignitor/ace.js +0 -102
- package/build/src/ignitor/http.js +0 -146
- package/build/src/ignitor/main.js +0 -124
- package/build/src/ignitor/test.js +0 -66
- package/build/src/test_utils/http.js +0 -82
- package/build/src/utils.js +0 -104
- package/build/stubs/main.js +0 -9
- package/build/toolkit/commands/index_commands.js +0 -30
- /package/build/{stubs/make → make}/command/main.stub +0 -0
- /package/build/{stubs/make → make}/controller/actions.stub +0 -0
- /package/build/{stubs/make → make}/controller/api.stub +0 -0
- /package/build/{stubs/make → make}/controller/main.stub +0 -0
- /package/build/{stubs/make → make}/controller/resource.stub +0 -0
- /package/build/{stubs/make → make}/event/main.stub +0 -0
- /package/build/{stubs/make → make}/exception/main.stub +0 -0
- /package/build/{stubs/make → make}/health/main.stub +0 -0
- /package/build/{stubs/make → make}/listener/for_event.stub +0 -0
- /package/build/{stubs/make → make}/listener/main.stub +0 -0
- /package/build/{stubs/make → make}/middleware/main.stub +0 -0
- /package/build/{stubs/make → make}/preload/main.stub +0 -0
- /package/build/{stubs/make → make}/provider/main.stub +0 -0
- /package/build/{stubs/make → make}/service/main.stub +0 -0
- /package/build/{stubs/make → make}/test/main.stub +0 -0
- /package/build/{stubs/make → make}/transformer/main.stub +0 -0
- /package/build/{stubs/make → make}/validator/main.stub +0 -0
- /package/build/{stubs/make → make}/validator/resource.stub +0 -0
- /package/build/{stubs/make → make}/view/main.stub +0 -0
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { t as __exportAll } from "./chunk-B88MteZI.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__ */ __exportAll({ 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 };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { Exception as Exception$1, InvalidArgumentsException as InvalidArgumentsException$1, RuntimeException as RuntimeException$1, createError } from "@poppinss/utils/exception";
|
|
2
|
+
export { createError as i, InvalidArgumentsException$1 as n, RuntimeException$1 as r, Exception$1 as t };
|
package/build/factories/app.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/application/factories';
|
|
1
|
+
export * from "@adonisjs/application/factories";
|
|
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/bodyparser/factories';
|
|
1
|
+
export * from "@adonisjs/bodyparser/factories";
|
|
2
|
+
export {};
|
|
@@ -1,46 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
* @example
|
|
18
|
-
* ```ts
|
|
19
|
-
* // Create from URL
|
|
20
|
-
* const aceFactory = new AceFactory()
|
|
21
|
-
* const kernel = await aceFactory.make(new URL('../', import.meta.url))
|
|
22
|
-
*
|
|
23
|
-
* // Create from existing ignitor
|
|
24
|
-
* const ignitor = new Ignitor(appRoot)
|
|
25
|
-
* const kernel = await aceFactory.make(ignitor)
|
|
26
|
-
*
|
|
27
|
-
* // Run commands
|
|
28
|
-
* await kernel.handle(['make:controller', 'UserController'])
|
|
29
|
-
* ```
|
|
30
|
-
*/
|
|
31
|
-
export class AceFactory {
|
|
32
|
-
async make(ignitorOrAppRoot, options) {
|
|
33
|
-
if (ignitorOrAppRoot instanceof Ignitor) {
|
|
34
|
-
const app = ignitorOrAppRoot.createApp('console');
|
|
35
|
-
await app.init();
|
|
36
|
-
return createAceKernel(app);
|
|
37
|
-
}
|
|
38
|
-
const app = new IgnitorFactory()
|
|
39
|
-
.withCoreConfig()
|
|
40
|
-
.withCoreProviders()
|
|
41
|
-
.create(ignitorOrAppRoot, options)
|
|
42
|
-
.createApp('console');
|
|
43
|
-
await app.init();
|
|
44
|
-
return createAceKernel(app);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
1
|
+
import "../../chunk-B88MteZI.js";
|
|
2
|
+
import "../../config_provider-DWVFHOQX.js";
|
|
3
|
+
import "../../main-CZZ21eXm.js";
|
|
4
|
+
import "../../app-B6oge7b3.js";
|
|
5
|
+
import "../../app-DNvbxVWl.js";
|
|
6
|
+
import "../../main-BlJhxJJ2.js";
|
|
7
|
+
import "../../logger-0KKSqgPG.js";
|
|
8
|
+
import "../../main-nojlltNo.js";
|
|
9
|
+
import "../../exceptions-DNMesP42.js";
|
|
10
|
+
import "../../define_config-CoWy5lbf.js";
|
|
11
|
+
import "../../main-D-WhqOOn.js";
|
|
12
|
+
import "../../main-DOY5Q8Av.js";
|
|
13
|
+
import "../../ignitor-BrmVPN5N.js";
|
|
14
|
+
import "../../create_kernel-Cpqqa931.js";
|
|
15
|
+
import { t as AceFactory } from "../../ace-sWl9sgM1.js";
|
|
16
|
+
export { AceFactory };
|
|
@@ -1,180 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
import { defineConfig as defineBodyParserConfig } from "../../modules/bodyparser/main.js";
|
|
15
|
-
/**
|
|
16
|
-
* Factory for creating and configuring AdonisJS Ignitor instances.
|
|
17
|
-
* This factory provides a fluent API to set up applications with core providers,
|
|
18
|
-
* configurations, and preload actions for testing and development scenarios.
|
|
19
|
-
*
|
|
20
|
-
* @example
|
|
21
|
-
* ```ts
|
|
22
|
-
* const ignitor = new IgnitorFactory()
|
|
23
|
-
* .withCoreProviders()
|
|
24
|
-
* .withCoreConfig()
|
|
25
|
-
* .preload((app) => {
|
|
26
|
-
* // Custom initialization logic
|
|
27
|
-
* })
|
|
28
|
-
* .create(new URL('../', import.meta.url))
|
|
29
|
-
*
|
|
30
|
-
* const app = ignitor.createApp('web')
|
|
31
|
-
* await app.boot()
|
|
32
|
-
* ```
|
|
33
|
-
*/
|
|
34
|
-
export class IgnitorFactory {
|
|
35
|
-
#preloadActions = [];
|
|
36
|
-
#parameters = {};
|
|
37
|
-
/**
|
|
38
|
-
* A flag to know if we should load the core providers
|
|
39
|
-
*/
|
|
40
|
-
#loadCoreProviders = false;
|
|
41
|
-
/**
|
|
42
|
-
* Define preload actions to run during application initialization.
|
|
43
|
-
* These actions are executed after the application is booted.
|
|
44
|
-
*
|
|
45
|
-
* @param action - Function to execute during preload phase
|
|
46
|
-
*
|
|
47
|
-
* @example
|
|
48
|
-
* ```ts
|
|
49
|
-
* factory.preload((app) => {
|
|
50
|
-
* // Register custom bindings
|
|
51
|
-
* app.container.bind('customService', () => new CustomService())
|
|
52
|
-
* })
|
|
53
|
-
* ```
|
|
54
|
-
*/
|
|
55
|
-
preload(action) {
|
|
56
|
-
this.#preloadActions.push(action);
|
|
57
|
-
return this;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Merge core providers with user defined providers
|
|
61
|
-
*/
|
|
62
|
-
#mergeCoreProviders(providers) {
|
|
63
|
-
const coreProviders = [
|
|
64
|
-
() => import('@adonisjs/core/providers/app_provider'),
|
|
65
|
-
() => import('@adonisjs/core/providers/hash_provider'),
|
|
66
|
-
() => import('@adonisjs/core/providers/repl_provider'),
|
|
67
|
-
];
|
|
68
|
-
return coreProviders.concat(providers || []);
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Merge custom factory parameters with existing ones.
|
|
72
|
-
* This allows you to customize RC file contents and application configuration.
|
|
73
|
-
*
|
|
74
|
-
* @param params - Parameters to merge
|
|
75
|
-
* @param params.config - Application configuration to merge
|
|
76
|
-
* @param params.rcFileContents - RC file contents to merge
|
|
77
|
-
*
|
|
78
|
-
* @example
|
|
79
|
-
* ```ts
|
|
80
|
-
* factory.merge({
|
|
81
|
-
* config: {
|
|
82
|
-
* database: { connection: 'mysql' }
|
|
83
|
-
* },
|
|
84
|
-
* rcFileContents: {
|
|
85
|
-
* commands: ['./commands/CustomCommand']
|
|
86
|
-
* }
|
|
87
|
-
* })
|
|
88
|
-
* ```
|
|
89
|
-
*/
|
|
90
|
-
merge(params) {
|
|
91
|
-
if (params.config) {
|
|
92
|
-
this.#parameters.config = Object.assign(this.#parameters.config || {}, params.config);
|
|
93
|
-
}
|
|
94
|
-
if (params.rcFileContents) {
|
|
95
|
-
this.#parameters.rcFileContents = Object.assign(this.#parameters.rcFileContents || {}, params.rcFileContents);
|
|
96
|
-
}
|
|
97
|
-
return this;
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Include core AdonisJS providers when booting the application.
|
|
101
|
-
* This adds essential providers like app, hash, and REPL providers.
|
|
102
|
-
*
|
|
103
|
-
* @example
|
|
104
|
-
* ```ts
|
|
105
|
-
* const ignitor = new IgnitorFactory()
|
|
106
|
-
* .withCoreProviders()
|
|
107
|
-
* .create(appRoot)
|
|
108
|
-
* ```
|
|
109
|
-
*/
|
|
110
|
-
withCoreProviders() {
|
|
111
|
-
this.#loadCoreProviders = true;
|
|
112
|
-
return this;
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* Merge default configuration for core AdonisJS features.
|
|
116
|
-
* This includes configurations for HTTP, hash, logger, and bodyparser.
|
|
117
|
-
* A shallow merge is performed with existing config.
|
|
118
|
-
*
|
|
119
|
-
* @example
|
|
120
|
-
* ```ts
|
|
121
|
-
* const ignitor = new IgnitorFactory()
|
|
122
|
-
* .withCoreConfig()
|
|
123
|
-
* .create(appRoot)
|
|
124
|
-
* ```
|
|
125
|
-
*/
|
|
126
|
-
withCoreConfig() {
|
|
127
|
-
this.merge({
|
|
128
|
-
config: {
|
|
129
|
-
app: {
|
|
130
|
-
appKey: 'averylongrandomsecretkey',
|
|
131
|
-
http: defineHttpConfig({}),
|
|
132
|
-
},
|
|
133
|
-
validator: {},
|
|
134
|
-
bodyparser: defineBodyParserConfig({}),
|
|
135
|
-
hash: defineHashConfig({
|
|
136
|
-
default: 'scrypt',
|
|
137
|
-
list: {
|
|
138
|
-
scrypt: drivers.scrypt({}),
|
|
139
|
-
},
|
|
140
|
-
}),
|
|
141
|
-
logger: defineLoggerConfig({
|
|
142
|
-
default: 'app',
|
|
143
|
-
loggers: {
|
|
144
|
-
app: {},
|
|
145
|
-
},
|
|
146
|
-
}),
|
|
147
|
-
},
|
|
148
|
-
});
|
|
149
|
-
return this;
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* Create a configured Ignitor instance with all specified parameters.
|
|
153
|
-
*
|
|
154
|
-
* @param appRoot - Application root directory URL
|
|
155
|
-
* @param options - Optional Ignitor configuration options
|
|
156
|
-
*
|
|
157
|
-
* @example
|
|
158
|
-
* ```ts
|
|
159
|
-
* const ignitor = new IgnitorFactory()
|
|
160
|
-
* .withCoreConfig()
|
|
161
|
-
* .withCoreProviders()
|
|
162
|
-
* .create(new URL('../', import.meta.url))
|
|
163
|
-
* ```
|
|
164
|
-
*/
|
|
165
|
-
create(appRoot, options) {
|
|
166
|
-
return new Ignitor(appRoot, options).tap((app) => {
|
|
167
|
-
app.booted(async () => {
|
|
168
|
-
for (let action of this.#preloadActions) {
|
|
169
|
-
await action(app);
|
|
170
|
-
}
|
|
171
|
-
});
|
|
172
|
-
if (this.#loadCoreProviders) {
|
|
173
|
-
this.#parameters.rcFileContents = this.#parameters.rcFileContents || {};
|
|
174
|
-
this.#parameters.rcFileContents.providers = this.#mergeCoreProviders(this.#parameters.rcFileContents.providers);
|
|
175
|
-
}
|
|
176
|
-
this.#parameters.rcFileContents && app.rcContents(this.#parameters.rcFileContents);
|
|
177
|
-
this.#parameters.config && app.useConfig(this.#parameters.config);
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
|
-
}
|
|
1
|
+
import "../../chunk-B88MteZI.js";
|
|
2
|
+
import "../../config_provider-DWVFHOQX.js";
|
|
3
|
+
import "../../main-CZZ21eXm.js";
|
|
4
|
+
import "../../app-B6oge7b3.js";
|
|
5
|
+
import "../../app-DNvbxVWl.js";
|
|
6
|
+
import "../../logger-0KKSqgPG.js";
|
|
7
|
+
import "../../main-nojlltNo.js";
|
|
8
|
+
import "../../exceptions-DNMesP42.js";
|
|
9
|
+
import "../../define_config-CoWy5lbf.js";
|
|
10
|
+
import "../../main-D-WhqOOn.js";
|
|
11
|
+
import "../../main-DOY5Q8Av.js";
|
|
12
|
+
import { t as IgnitorFactory } from "../../ignitor-BrmVPN5N.js";
|
|
13
|
+
export { IgnitorFactory };
|
|
@@ -1,11 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import "../../chunk-B88MteZI.js";
|
|
2
|
+
import "../../main-kn40V-hF.js";
|
|
3
|
+
import "../../container-uxa8LpGI.js";
|
|
4
|
+
import "../../config_provider-DWVFHOQX.js";
|
|
5
|
+
import "../../main-CZZ21eXm.js";
|
|
6
|
+
import "../../app-B6oge7b3.js";
|
|
7
|
+
import "../../app-DNvbxVWl.js";
|
|
8
|
+
import "../../string-Cx6q_win.js";
|
|
9
|
+
import "../../utils-CtGytdtt.js";
|
|
10
|
+
import "../../core-BuPP8K6N.js";
|
|
11
|
+
import "../../main-BlJhxJJ2.js";
|
|
12
|
+
import "../../logger-0KKSqgPG.js";
|
|
13
|
+
import "../../main-nojlltNo.js";
|
|
14
|
+
import "../../exceptions-DNMesP42.js";
|
|
15
|
+
import "../../define_config-CoWy5lbf.js";
|
|
16
|
+
import "../../main-Bfnr5tAw.js";
|
|
17
|
+
import "../../main-D-WhqOOn.js";
|
|
18
|
+
import "../../main-DOY5Q8Av.js";
|
|
19
|
+
import { t as IgnitorFactory } from "../../ignitor-BrmVPN5N.js";
|
|
20
|
+
import "../../create_kernel-Cpqqa931.js";
|
|
21
|
+
import { t as AceFactory } from "../../ace-sWl9sgM1.js";
|
|
22
|
+
import "../../main-BU8NWUEG.js";
|
|
23
|
+
import { t as TestUtilsFactory } from "../../test_utils-hkQDmNpX.js";
|
|
24
|
+
export { AceFactory, IgnitorFactory, TestUtilsFactory };
|
|
@@ -1,43 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
*
|
|
23
|
-
* // Use in tests
|
|
24
|
-
* const app = testUtils.app()
|
|
25
|
-
* await app.boot()
|
|
26
|
-
*
|
|
27
|
-
* // Create HTTP client
|
|
28
|
-
* const client = testUtils.httpClient()
|
|
29
|
-
* const response = await client.get('/users')
|
|
30
|
-
* ```
|
|
31
|
-
*/
|
|
32
|
-
export class TestUtilsFactory {
|
|
33
|
-
create(ignitorOrAppRoot, options) {
|
|
34
|
-
if (ignitorOrAppRoot instanceof Ignitor) {
|
|
35
|
-
return new TestUtils(ignitorOrAppRoot.createApp('test'));
|
|
36
|
-
}
|
|
37
|
-
return new TestUtils(new IgnitorFactory()
|
|
38
|
-
.withCoreConfig()
|
|
39
|
-
.withCoreProviders()
|
|
40
|
-
.create(ignitorOrAppRoot, options)
|
|
41
|
-
.createApp('console'));
|
|
42
|
-
}
|
|
43
|
-
}
|
|
1
|
+
import "../../chunk-B88MteZI.js";
|
|
2
|
+
import "../../main-kn40V-hF.js";
|
|
3
|
+
import "../../container-uxa8LpGI.js";
|
|
4
|
+
import "../../config_provider-DWVFHOQX.js";
|
|
5
|
+
import "../../main-CZZ21eXm.js";
|
|
6
|
+
import "../../app-B6oge7b3.js";
|
|
7
|
+
import "../../app-DNvbxVWl.js";
|
|
8
|
+
import "../../string-Cx6q_win.js";
|
|
9
|
+
import "../../utils-CtGytdtt.js";
|
|
10
|
+
import "../../core-BuPP8K6N.js";
|
|
11
|
+
import "../../logger-0KKSqgPG.js";
|
|
12
|
+
import "../../main-nojlltNo.js";
|
|
13
|
+
import "../../exceptions-DNMesP42.js";
|
|
14
|
+
import "../../define_config-CoWy5lbf.js";
|
|
15
|
+
import "../../main-Bfnr5tAw.js";
|
|
16
|
+
import "../../main-D-WhqOOn.js";
|
|
17
|
+
import "../../main-DOY5Q8Av.js";
|
|
18
|
+
import "../../ignitor-BrmVPN5N.js";
|
|
19
|
+
import "../../main-BU8NWUEG.js";
|
|
20
|
+
import { t as TestUtilsFactory } from "../../test_utils-hkQDmNpX.js";
|
|
21
|
+
export { TestUtilsFactory };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from '@
|
|
1
|
+
export * from '@boringnode/encryption/factories';
|
|
@@ -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/factories';
|
|
1
|
+
export * from "@boringnode/encryption/factories";
|
|
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/events/factories';
|
|
1
|
+
export * from "@adonisjs/events/factories";
|
|
2
|
+
export {};
|
package/build/factories/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/factories';
|
|
1
|
+
export * from "@adonisjs/hash/factories";
|
|
2
|
+
export {};
|
package/build/factories/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/factories';
|
|
1
|
+
export * from "@adonisjs/http-server/factories";
|
|
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/logger/factories';
|
|
1
|
+
export * from "@adonisjs/logger/factories";
|
|
2
|
+
export {};
|