@adonisjs/core 7.0.0-next.9 → 7.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +62 -1
- package/build/chunk-iKc69rpz.js +26 -0
- package/build/commands/add.d.ts +4 -3
- package/build/commands/add.js +73 -110
- package/build/commands/build.js +51 -107
- package/build/commands/commands.json +1 -1
- package/build/commands/configure.js +81 -177
- package/build/commands/eject.js +17 -60
- package/build/commands/env/add.js +55 -134
- package/build/commands/generate_key.js +22 -66
- package/build/commands/inspect_rcfile.js +27 -55
- package/build/commands/list/routes.js +246 -116
- package/build/commands/make/command.d.ts +5 -0
- package/build/commands/make/command.js +16 -57
- package/build/commands/make/controller.d.ts +5 -0
- package/build/commands/make/controller.js +44 -120
- package/build/commands/make/event.d.ts +5 -0
- package/build/commands/make/event.js +17 -62
- package/build/commands/make/exception.d.ts +5 -0
- package/build/commands/make/exception.js +17 -62
- package/build/commands/make/listener.d.ts +5 -0
- package/build/commands/make/listener.js +37 -93
- package/build/commands/make/middleware.d.ts +5 -0
- package/build/commands/make/middleware.js +42 -101
- package/build/commands/make/preload.d.ts +5 -0
- package/build/commands/make/preload.js +48 -113
- package/build/commands/make/provider.d.ts +5 -0
- package/build/commands/make/provider.js +48 -112
- package/build/commands/make/service.d.ts +5 -0
- package/build/commands/make/service.js +17 -55
- package/build/commands/make/test.d.ts +5 -0
- package/build/commands/make/test.js +48 -132
- package/build/commands/make/transformer.d.ts +5 -0
- package/build/commands/make/transformer.js +18 -64
- package/build/commands/make/validator.d.ts +5 -0
- package/build/commands/make/validator.js +21 -80
- package/build/commands/make/view.d.ts +5 -0
- package/build/commands/make/view.js +16 -56
- package/build/commands/repl.js +17 -50
- package/build/commands/serve.js +80 -150
- package/build/commands/test.js +92 -202
- package/build/config_provider-FIAUgvae.js +13 -0
- package/build/core-IpCOCkUL.js +146 -0
- package/build/create_kernel-B7ILNhuP.js +38 -0
- package/build/create_kernel-BD0Iqi8e.js +3 -0
- package/build/debug-CGQmxzGt.js +3 -0
- package/build/decorate-DmrZA614.js +7 -0
- package/build/define_config-0oHaj43l.js +86 -0
- package/build/dumper-BBgqFX5a.js +147 -0
- package/build/errors-CrCO-k44.js +8 -0
- package/build/factories/app.js +2 -9
- package/build/factories/bodyparser.js +2 -9
- package/build/factories/core/ace.js +22 -45
- package/build/factories/core/ignitor.js +74 -180
- package/build/factories/core/main.js +18 -11
- package/build/factories/core/test_utils.js +19 -42
- package/build/factories/encryption.d.ts +1 -1
- package/build/factories/encryption.js +2 -9
- package/build/factories/events.js +2 -9
- package/build/factories/hash.js +2 -9
- package/build/factories/http.js +2 -9
- package/build/factories/logger.js +2 -9
- package/build/factories/stubs.d.ts +1 -6
- package/build/factories/stubs.js +24 -91
- package/build/index.d.ts +1 -1
- package/build/index.js +10 -46
- package/build/main--nXd7T-C.js +73 -0
- package/build/main-Cxz0TyIw.js +173 -0
- package/build/main-DN2qEEg5.js +41 -0
- package/build/main-DkNgvceD.js +52 -0
- package/build/main-MBAMnmJb.js +81 -0
- package/build/main-kn40V-hF.js +2 -0
- package/build/{stubs/make → make}/health/controller.stub +5 -2
- package/build/modules/ace/codemods.d.ts +75 -23
- package/build/modules/ace/codemods.js +291 -476
- package/build/modules/ace/main.js +2 -41
- package/build/modules/app.js +6 -26
- package/build/modules/bodyparser/bodyparser_middleware.js +3 -14
- package/build/modules/bodyparser/main.js +6 -9
- package/build/modules/config.js +6 -26
- package/build/modules/container.js +6 -9
- package/build/modules/dumper/main.js +6 -32
- package/build/modules/dumper/plugins/edge.js +46 -61
- package/build/modules/encryption/define_config.d.ts +161 -0
- package/build/modules/encryption/drivers/aes_256_cbc.d.ts +20 -0
- package/build/modules/encryption/drivers/aes_256_cbc.js +2 -0
- package/build/modules/encryption/drivers/aes_256_gcm.d.ts +21 -0
- package/build/modules/encryption/drivers/aes_256_gcm.js +2 -0
- package/build/modules/encryption/drivers/aes_siv.d.ts +19 -0
- package/build/modules/encryption/drivers/aes_siv.js +2 -0
- package/build/modules/encryption/drivers/chacha20_poly1305.d.ts +21 -0
- package/build/modules/encryption/drivers/chacha20_poly1305.js +2 -0
- package/build/modules/encryption/drivers/legacy.d.ts +84 -0
- package/build/modules/encryption/drivers/legacy.js +57 -0
- package/build/modules/encryption/errors.d.ts +16 -0
- package/build/modules/encryption/main.d.ts +89 -0
- package/build/modules/encryption/main.js +6 -0
- package/build/modules/env/editor.js +2 -9
- package/build/modules/env/main.js +2 -28
- package/build/modules/events.js +6 -9
- package/build/modules/hash/drivers/argon.js +2 -9
- package/build/modules/hash/drivers/bcrypt.js +2 -20
- package/build/modules/hash/drivers/scrypt.js +2 -9
- package/build/modules/hash/main.js +6 -28
- package/build/modules/hash/phc_formatter.js +2 -9
- package/build/modules/health.js +2 -9
- package/build/modules/http/helpers.d.ts +1 -0
- package/build/modules/http/helpers.js +2 -0
- package/build/modules/http/main.js +4 -15
- package/build/modules/http/request_validator.d.ts +3 -4
- package/build/modules/http/url_builder_client.js +2 -9
- package/build/modules/logger.d.ts +30 -0
- package/build/modules/logger.js +14 -9
- package/build/modules/repl.js +6 -9
- package/build/modules/transformers/main.js +2 -9
- package/build/providers/app_provider.d.ts +5 -13
- package/build/providers/app_provider.js +153 -359
- package/build/providers/edge_provider.js +98 -164
- package/build/providers/hash_provider.js +29 -91
- package/build/providers/repl_provider.js +66 -152
- package/build/providers/vinejs_provider.d.ts +1 -1
- package/build/providers/vinejs_provider.js +21 -65
- package/build/services/ace.js +1 -16
- package/build/services/app.js +3 -19
- package/build/services/config.js +1 -12
- package/build/services/dumper.js +4 -20
- package/build/services/emitter.js +1 -13
- package/build/services/encryption.js +1 -13
- package/build/services/hash.js +1 -13
- package/build/services/logger.js +1 -13
- package/build/services/repl.js +1 -13
- package/build/services/router.js +1 -13
- package/build/services/server.js +1 -13
- package/build/services/test_utils.js +1 -16
- package/build/services/url_builder.d.ts +3 -3
- package/build/services/url_builder.js +4 -16
- package/build/src/assembler_hooks/index_entities.d.ts +34 -1
- package/build/src/debug.d.ts +1 -1
- package/build/src/exceptions.js +2 -49
- package/build/src/helpers/assert.js +2 -55
- package/build/src/helpers/http.js +2 -28
- package/build/src/helpers/is.js +3 -31
- package/build/src/helpers/main.js +5 -52
- package/build/src/helpers/string.js +26 -76
- package/build/src/helpers/types.js +25 -134
- package/build/src/helpers/verification_token.js +46 -120
- package/build/src/test_utils/main.js +8 -77
- package/build/src/types.d.ts +53 -99
- package/build/src/types.js +0 -8
- package/build/src/utils.d.ts +1 -1
- package/build/src/vine.js +29 -101
- package/build/toolkit/main.js +19 -21
- package/build/types/ace.js +2 -9
- package/build/types/app.js +2 -9
- package/build/types/bodyparser.js +2 -9
- package/build/types/common.js +2 -9
- package/build/types/container.js +2 -9
- package/build/types/encryption.d.ts +53 -1
- package/build/types/encryption.js +1 -9
- package/build/types/events.js +2 -9
- package/build/types/hash.js +2 -9
- package/build/types/health.js +2 -9
- package/build/types/helpers.js +0 -8
- package/build/types/http.js +2 -9
- package/build/types/logger.js +2 -9
- package/build/types/repl.js +2 -9
- package/build/types/transformers.js +2 -9
- package/build/utils-rRkbAPnP.js +42 -0
- package/package.json +117 -62
- package/build/modules/ace/commands.js +0 -157
- package/build/modules/ace/create_kernel.js +0 -91
- package/build/modules/ace/kernel.js +0 -40
- package/build/modules/dumper/define_config.js +0 -36
- package/build/modules/dumper/dumper.js +0 -266
- package/build/modules/dumper/errors.js +0 -119
- package/build/modules/encryption.d.ts +0 -18
- package/build/modules/encryption.js +0 -26
- package/build/modules/hash/define_config.js +0 -125
- package/build/modules/http/request_validator.js +0 -100
- package/build/src/assembler_hooks/index_entities.js +0 -112
- package/build/src/cli_formatters/routes_list.js +0 -397
- package/build/src/config_provider.js +0 -71
- package/build/src/debug.js +0 -25
- package/build/src/ignitor/ace.js +0 -102
- package/build/src/ignitor/http.js +0 -159
- package/build/src/ignitor/main.js +0 -124
- package/build/src/ignitor/test.js +0 -66
- package/build/src/test_utils/http.js +0 -82
- package/build/src/utils.js +0 -114
- package/build/stubs/main.js +0 -9
- package/build/toolkit/commands/index_commands.js +0 -30
- /package/build/{stubs/make → make}/command/main.stub +0 -0
- /package/build/{stubs/make → make}/controller/actions.stub +0 -0
- /package/build/{stubs/make → make}/controller/api.stub +0 -0
- /package/build/{stubs/make → make}/controller/main.stub +0 -0
- /package/build/{stubs/make → make}/controller/resource.stub +0 -0
- /package/build/{stubs/make → make}/event/main.stub +0 -0
- /package/build/{stubs/make → make}/exception/main.stub +0 -0
- /package/build/{stubs/make → make}/health/main.stub +0 -0
- /package/build/{stubs/make → make}/listener/for_event.stub +0 -0
- /package/build/{stubs/make → make}/listener/main.stub +0 -0
- /package/build/{stubs/make → make}/middleware/main.stub +0 -0
- /package/build/{stubs/make → make}/preload/main.stub +0 -0
- /package/build/{stubs/make → make}/provider/main.stub +0 -0
- /package/build/{stubs/make → make}/service/main.stub +0 -0
- /package/build/{stubs/make → make}/test/main.stub +0 -0
- /package/build/{stubs/make → make}/transformer/main.stub +0 -0
- /package/build/{stubs/make → make}/validator/main.stub +0 -0
- /package/build/{stubs/make → make}/validator/resource.stub +0 -0
- /package/build/{stubs/make → make}/view/main.stub +0 -0
|
@@ -1,180 +1,74 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
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-iKc69rpz.js";
|
|
2
|
+
import "../../debug-CGQmxzGt.js";
|
|
3
|
+
import { t as Ignitor } from "../../main-Cxz0TyIw.js";
|
|
4
|
+
import "../../config_provider-FIAUgvae.js";
|
|
5
|
+
import { t as logger_exports } from "../../modules/logger.js";
|
|
6
|
+
import { t as main_exports } from "../../main-DN2qEEg5.js";
|
|
7
|
+
import { n as drivers, t as defineConfig } from "../../define_config-0oHaj43l.js";
|
|
8
|
+
import { n as defineConfig$1, r as drivers$1 } from "../../main-DkNgvceD.js";
|
|
9
|
+
import { t as main_exports$1 } from "../../modules/bodyparser/main.js";
|
|
10
|
+
var IgnitorFactory = class {
|
|
11
|
+
#preloadActions = [];
|
|
12
|
+
#parameters = {};
|
|
13
|
+
#loadCoreProviders = false;
|
|
14
|
+
preload(action) {
|
|
15
|
+
this.#preloadActions.push(action);
|
|
16
|
+
return this;
|
|
17
|
+
}
|
|
18
|
+
#mergeCoreProviders(providers) {
|
|
19
|
+
return [
|
|
20
|
+
() => import("@adonisjs/core/providers/app_provider"),
|
|
21
|
+
() => import("@adonisjs/core/providers/hash_provider"),
|
|
22
|
+
() => import("@adonisjs/core/providers/repl_provider")
|
|
23
|
+
].concat(providers || []);
|
|
24
|
+
}
|
|
25
|
+
merge(params) {
|
|
26
|
+
if (params.config) this.#parameters.config = Object.assign(this.#parameters.config || {}, params.config);
|
|
27
|
+
if (params.rcFileContents) this.#parameters.rcFileContents = Object.assign(this.#parameters.rcFileContents || {}, params.rcFileContents);
|
|
28
|
+
return this;
|
|
29
|
+
}
|
|
30
|
+
withCoreProviders() {
|
|
31
|
+
this.#loadCoreProviders = true;
|
|
32
|
+
return this;
|
|
33
|
+
}
|
|
34
|
+
withCoreConfig() {
|
|
35
|
+
this.merge({ config: {
|
|
36
|
+
app: {
|
|
37
|
+
appUrl: "http://localhost:3333",
|
|
38
|
+
http: (0, main_exports.defineConfig)({})
|
|
39
|
+
},
|
|
40
|
+
validator: {},
|
|
41
|
+
encryption: defineConfig({
|
|
42
|
+
default: "gcm",
|
|
43
|
+
list: { gcm: drivers.aes256gcm({
|
|
44
|
+
id: "gcm",
|
|
45
|
+
keys: ["averylongrandomsecretkey"]
|
|
46
|
+
}) }
|
|
47
|
+
}),
|
|
48
|
+
bodyparser: (0, main_exports$1.defineConfig)({}),
|
|
49
|
+
hash: defineConfig$1({
|
|
50
|
+
default: "scrypt",
|
|
51
|
+
list: { scrypt: drivers$1.scrypt({}) }
|
|
52
|
+
}),
|
|
53
|
+
logger: (0, logger_exports.defineConfig)({
|
|
54
|
+
default: "app",
|
|
55
|
+
loggers: { app: {} }
|
|
56
|
+
})
|
|
57
|
+
} });
|
|
58
|
+
return this;
|
|
59
|
+
}
|
|
60
|
+
create(appRoot, options) {
|
|
61
|
+
return new Ignitor(appRoot, options).tap((app) => {
|
|
62
|
+
app.booted(async () => {
|
|
63
|
+
for (let action of this.#preloadActions) await action(app);
|
|
64
|
+
});
|
|
65
|
+
if (this.#loadCoreProviders) {
|
|
66
|
+
this.#parameters.rcFileContents = this.#parameters.rcFileContents || {};
|
|
67
|
+
this.#parameters.rcFileContents.providers = this.#mergeCoreProviders(this.#parameters.rcFileContents.providers);
|
|
68
|
+
}
|
|
69
|
+
this.#parameters.rcFileContents && app.rcContents(this.#parameters.rcFileContents);
|
|
70
|
+
this.#parameters.config && app.useConfig(this.#parameters.config);
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
export { IgnitorFactory };
|
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import "../../chunk-iKc69rpz.js";
|
|
2
|
+
import "../../main-kn40V-hF.js";
|
|
3
|
+
import "../../debug-CGQmxzGt.js";
|
|
4
|
+
import "../../main-Cxz0TyIw.js";
|
|
5
|
+
import "../../config_provider-FIAUgvae.js";
|
|
6
|
+
import "../../utils-rRkbAPnP.js";
|
|
7
|
+
import "../../core-IpCOCkUL.js";
|
|
8
|
+
import "../../main-MBAMnmJb.js";
|
|
9
|
+
import "../../main-DN2qEEg5.js";
|
|
10
|
+
import "../../errors-CrCO-k44.js";
|
|
11
|
+
import "../../define_config-0oHaj43l.js";
|
|
12
|
+
import "../../main-DkNgvceD.js";
|
|
13
|
+
import { IgnitorFactory } from "./ignitor.js";
|
|
14
|
+
import "../../create_kernel-B7ILNhuP.js";
|
|
15
|
+
import { AceFactory } from "./ace.js";
|
|
16
|
+
import "../../main--nXd7T-C.js";
|
|
17
|
+
import { TestUtilsFactory } from "./test_utils.js";
|
|
18
|
+
export { AceFactory, IgnitorFactory, TestUtilsFactory };
|
|
@@ -1,43 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import
|
|
1
|
+
import "../../chunk-iKc69rpz.js";
|
|
2
|
+
import "../../main-kn40V-hF.js";
|
|
3
|
+
import "../../debug-CGQmxzGt.js";
|
|
4
|
+
import { t as Ignitor } from "../../main-Cxz0TyIw.js";
|
|
5
|
+
import "../../config_provider-FIAUgvae.js";
|
|
6
|
+
import "../../utils-rRkbAPnP.js";
|
|
7
|
+
import "../../core-IpCOCkUL.js";
|
|
8
|
+
import "../../main-DN2qEEg5.js";
|
|
9
|
+
import "../../errors-CrCO-k44.js";
|
|
10
|
+
import "../../define_config-0oHaj43l.js";
|
|
11
|
+
import "../../main-DkNgvceD.js";
|
|
10
12
|
import { IgnitorFactory } from "./ignitor.js";
|
|
11
|
-
import { TestUtils } from "../../
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
* // Create from URL for testing
|
|
20
|
-
* const factory = new TestUtilsFactory()
|
|
21
|
-
* const testUtils = factory.create(new URL('../', import.meta.url))
|
|
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
|
-
}
|
|
13
|
+
import { t as TestUtils } from "../../main--nXd7T-C.js";
|
|
14
|
+
var TestUtilsFactory = class {
|
|
15
|
+
create(ignitorOrAppRoot, options) {
|
|
16
|
+
if (ignitorOrAppRoot instanceof Ignitor) return new TestUtils(ignitorOrAppRoot.createApp("test"));
|
|
17
|
+
return new TestUtils(new IgnitorFactory().withCoreConfig().withCoreProviders().create(ignitorOrAppRoot, options).createApp("console"));
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
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 {};
|
|
@@ -64,11 +64,6 @@ export declare class StubsFactory {
|
|
|
64
64
|
* console.log(preparedStub.contents)
|
|
65
65
|
* ```
|
|
66
66
|
*/
|
|
67
|
-
prepare(stubPath: string, data: Record<string, any>): Promise<
|
|
68
|
-
contents: string;
|
|
69
|
-
destination: any;
|
|
70
|
-
force: any;
|
|
71
|
-
attributes: Record<string, any>;
|
|
72
|
-
}>;
|
|
67
|
+
prepare(stubPath: string, data: Record<string, any>): Promise<import("@adonisjs/application/types").PreparedStub>;
|
|
73
68
|
}
|
|
74
69
|
export {};
|
package/build/factories/stubs.js
CHANGED
|
@@ -1,91 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
* entity: { name: 'User' },
|
|
26
|
-
* resourceful: true
|
|
27
|
-
* })
|
|
28
|
-
*
|
|
29
|
-
* console.log(preparedStub.contents)
|
|
30
|
-
* ```
|
|
31
|
-
*/
|
|
32
|
-
export class StubsFactory {
|
|
33
|
-
#parameters = {};
|
|
34
|
-
/**
|
|
35
|
-
* Returns an instance of application, either from parameters or creates a default one
|
|
36
|
-
*/
|
|
37
|
-
#getApp() {
|
|
38
|
-
return this.#parameters.app || new AppFactory().create(new URL('./', import.meta.url));
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Merge custom factory parameters to override defaults.
|
|
42
|
-
* This allows you to provide a custom application instance.
|
|
43
|
-
*
|
|
44
|
-
* @param params - Parameters to merge
|
|
45
|
-
* @param params.app - Custom application service instance
|
|
46
|
-
*
|
|
47
|
-
* @example
|
|
48
|
-
* ```ts
|
|
49
|
-
* const customApp = new AppFactory().create(appRoot)
|
|
50
|
-
* const stubsFactory = new StubsFactory().merge({ app: customApp })
|
|
51
|
-
* ```
|
|
52
|
-
*/
|
|
53
|
-
merge(params) {
|
|
54
|
-
this.#parameters = Object.assign(this.#parameters, params);
|
|
55
|
-
return this;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Prepare a stub template with the provided data and return the processed content.
|
|
59
|
-
* This method initializes the application, loads the stub, and processes it with
|
|
60
|
-
* the given template variables.
|
|
61
|
-
*
|
|
62
|
-
* @param stubPath - Path to the stub file relative to the stubs root
|
|
63
|
-
* @param data - Template data to populate the stub placeholders
|
|
64
|
-
*
|
|
65
|
-
* @example
|
|
66
|
-
* ```ts
|
|
67
|
-
* const stubsFactory = new StubsFactory()
|
|
68
|
-
* const preparedStub = await stubsFactory.prepare('controller.stub', {
|
|
69
|
-
* filename: 'UserController',
|
|
70
|
-
* entity: {
|
|
71
|
-
* name: 'User',
|
|
72
|
-
* modelName: 'User',
|
|
73
|
-
* pluralName: 'users'
|
|
74
|
-
* },
|
|
75
|
-
* resourceful: true
|
|
76
|
-
* })
|
|
77
|
-
*
|
|
78
|
-
* // Access the processed stub content
|
|
79
|
-
* console.log(preparedStub.contents)
|
|
80
|
-
* ```
|
|
81
|
-
*/
|
|
82
|
-
async prepare(stubPath, data) {
|
|
83
|
-
const app = this.#getApp();
|
|
84
|
-
await app.init();
|
|
85
|
-
const stubs = await app.stubs.create();
|
|
86
|
-
const stub = await stubs.build(stubPath, {
|
|
87
|
-
source: stubsRoot,
|
|
88
|
-
});
|
|
89
|
-
return stub.prepare(data);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
1
|
+
import "../chunk-iKc69rpz.js";
|
|
2
|
+
import { t as stubsRoot } from "../main-kn40V-hF.js";
|
|
3
|
+
import "../debug-CGQmxzGt.js";
|
|
4
|
+
import "../main-Cxz0TyIw.js";
|
|
5
|
+
import "../config_provider-FIAUgvae.js";
|
|
6
|
+
import "../utils-rRkbAPnP.js";
|
|
7
|
+
import "../core-IpCOCkUL.js";
|
|
8
|
+
import { AppFactory } from "@adonisjs/application/factories";
|
|
9
|
+
var StubsFactory = class {
|
|
10
|
+
#parameters = {};
|
|
11
|
+
#getApp() {
|
|
12
|
+
return this.#parameters.app || new AppFactory().create(new URL("./", import.meta.url));
|
|
13
|
+
}
|
|
14
|
+
merge(params) {
|
|
15
|
+
this.#parameters = Object.assign(this.#parameters, params);
|
|
16
|
+
return this;
|
|
17
|
+
}
|
|
18
|
+
async prepare(stubPath, data) {
|
|
19
|
+
const app = this.#getApp();
|
|
20
|
+
await app.init();
|
|
21
|
+
return (await (await app.stubs.create()).build(stubPath, { source: stubsRoot })).prepare(data);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
export { StubsFactory };
|
package/build/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { errors as aceErrors } from '@adonisjs/ace';
|
|
2
2
|
import { errors as envErrors } from '@adonisjs/env';
|
|
3
3
|
import { errors as appErrors } from '@adonisjs/application';
|
|
4
|
-
import { errors as encryptionErrors } from '@
|
|
4
|
+
import { errors as encryptionErrors } from '@boringnode/encryption';
|
|
5
5
|
import { errors as httpServerErrors } from '@adonisjs/http-server';
|
|
6
6
|
export { stubsRoot } from './stubs/main.ts';
|
|
7
7
|
export { inject } from './modules/container.ts';
|
package/build/index.js
CHANGED
|
@@ -1,46 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import { errors as appErrors } from '@adonisjs/application';
|
|
12
|
-
import { errors as encryptionErrors } from '@adonisjs/encryption';
|
|
13
|
-
import { errors as httpServerErrors } from '@adonisjs/http-server';
|
|
14
|
-
export { stubsRoot } from "./stubs/main.js";
|
|
15
|
-
export { inject } from "./modules/container.js";
|
|
16
|
-
export { Ignitor } from "./src/ignitor/main.js";
|
|
17
|
-
export { configProvider } from "./src/config_provider.js";
|
|
18
|
-
export { indexEntities } from "./src/assembler_hooks/index_entities.js";
|
|
19
|
-
/**
|
|
20
|
-
* Aggregated errors from all modules.
|
|
21
|
-
*/
|
|
22
|
-
export const errors = {
|
|
23
|
-
...encryptionErrors,
|
|
24
|
-
...httpServerErrors,
|
|
25
|
-
...appErrors,
|
|
26
|
-
...aceErrors,
|
|
27
|
-
...envErrors,
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* Pretty prints an error with colorful output using
|
|
31
|
-
* Youch terminal
|
|
32
|
-
*/
|
|
33
|
-
export async function prettyPrintError(error) {
|
|
34
|
-
if (error && typeof error === 'object' && error.code === 'E_DUMP_DIE_EXCEPTION') {
|
|
35
|
-
console.error(error);
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
try {
|
|
39
|
-
const { Youch } = await import('youch');
|
|
40
|
-
const youch = new Youch();
|
|
41
|
-
console.error(await youch.toANSI(error));
|
|
42
|
-
}
|
|
43
|
-
catch {
|
|
44
|
-
console.error(error);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
1
|
+
import "./chunk-iKc69rpz.js";
|
|
2
|
+
import { t as stubsRoot } from "./main-kn40V-hF.js";
|
|
3
|
+
import { t as container_exports } from "./modules/container.js";
|
|
4
|
+
import "./debug-CGQmxzGt.js";
|
|
5
|
+
import { t as Ignitor } from "./main-Cxz0TyIw.js";
|
|
6
|
+
import { t as configProvider } from "./config_provider-FIAUgvae.js";
|
|
7
|
+
import "./utils-rRkbAPnP.js";
|
|
8
|
+
import { n as prettyPrintError, r as indexEntities, t as errors } from "./core-IpCOCkUL.js";
|
|
9
|
+
var inject = container_exports.inject;
|
|
10
|
+
export { Ignitor, configProvider, errors, indexEntities, inject, prettyPrintError, stubsRoot };
|