@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.
Files changed (210) hide show
  1. package/README.md +62 -1
  2. package/build/chunk-iKc69rpz.js +26 -0
  3. package/build/commands/add.d.ts +4 -3
  4. package/build/commands/add.js +73 -110
  5. package/build/commands/build.js +51 -107
  6. package/build/commands/commands.json +1 -1
  7. package/build/commands/configure.js +81 -177
  8. package/build/commands/eject.js +17 -60
  9. package/build/commands/env/add.js +55 -134
  10. package/build/commands/generate_key.js +22 -66
  11. package/build/commands/inspect_rcfile.js +27 -55
  12. package/build/commands/list/routes.js +246 -116
  13. package/build/commands/make/command.d.ts +5 -0
  14. package/build/commands/make/command.js +16 -57
  15. package/build/commands/make/controller.d.ts +5 -0
  16. package/build/commands/make/controller.js +44 -120
  17. package/build/commands/make/event.d.ts +5 -0
  18. package/build/commands/make/event.js +17 -62
  19. package/build/commands/make/exception.d.ts +5 -0
  20. package/build/commands/make/exception.js +17 -62
  21. package/build/commands/make/listener.d.ts +5 -0
  22. package/build/commands/make/listener.js +37 -93
  23. package/build/commands/make/middleware.d.ts +5 -0
  24. package/build/commands/make/middleware.js +42 -101
  25. package/build/commands/make/preload.d.ts +5 -0
  26. package/build/commands/make/preload.js +48 -113
  27. package/build/commands/make/provider.d.ts +5 -0
  28. package/build/commands/make/provider.js +48 -112
  29. package/build/commands/make/service.d.ts +5 -0
  30. package/build/commands/make/service.js +17 -55
  31. package/build/commands/make/test.d.ts +5 -0
  32. package/build/commands/make/test.js +48 -132
  33. package/build/commands/make/transformer.d.ts +5 -0
  34. package/build/commands/make/transformer.js +18 -64
  35. package/build/commands/make/validator.d.ts +5 -0
  36. package/build/commands/make/validator.js +21 -80
  37. package/build/commands/make/view.d.ts +5 -0
  38. package/build/commands/make/view.js +16 -56
  39. package/build/commands/repl.js +17 -50
  40. package/build/commands/serve.js +80 -150
  41. package/build/commands/test.js +92 -202
  42. package/build/config_provider-FIAUgvae.js +13 -0
  43. package/build/core-IpCOCkUL.js +146 -0
  44. package/build/create_kernel-B7ILNhuP.js +38 -0
  45. package/build/create_kernel-BD0Iqi8e.js +3 -0
  46. package/build/debug-CGQmxzGt.js +3 -0
  47. package/build/decorate-DmrZA614.js +7 -0
  48. package/build/define_config-0oHaj43l.js +86 -0
  49. package/build/dumper-BBgqFX5a.js +147 -0
  50. package/build/errors-CrCO-k44.js +8 -0
  51. package/build/factories/app.js +2 -9
  52. package/build/factories/bodyparser.js +2 -9
  53. package/build/factories/core/ace.js +22 -45
  54. package/build/factories/core/ignitor.js +74 -180
  55. package/build/factories/core/main.js +18 -11
  56. package/build/factories/core/test_utils.js +19 -42
  57. package/build/factories/encryption.d.ts +1 -1
  58. package/build/factories/encryption.js +2 -9
  59. package/build/factories/events.js +2 -9
  60. package/build/factories/hash.js +2 -9
  61. package/build/factories/http.js +2 -9
  62. package/build/factories/logger.js +2 -9
  63. package/build/factories/stubs.d.ts +1 -6
  64. package/build/factories/stubs.js +24 -91
  65. package/build/index.d.ts +1 -1
  66. package/build/index.js +10 -46
  67. package/build/main--nXd7T-C.js +73 -0
  68. package/build/main-Cxz0TyIw.js +173 -0
  69. package/build/main-DN2qEEg5.js +41 -0
  70. package/build/main-DkNgvceD.js +52 -0
  71. package/build/main-MBAMnmJb.js +81 -0
  72. package/build/main-kn40V-hF.js +2 -0
  73. package/build/{stubs/make → make}/health/controller.stub +5 -2
  74. package/build/modules/ace/codemods.d.ts +75 -23
  75. package/build/modules/ace/codemods.js +291 -476
  76. package/build/modules/ace/main.js +2 -41
  77. package/build/modules/app.js +6 -26
  78. package/build/modules/bodyparser/bodyparser_middleware.js +3 -14
  79. package/build/modules/bodyparser/main.js +6 -9
  80. package/build/modules/config.js +6 -26
  81. package/build/modules/container.js +6 -9
  82. package/build/modules/dumper/main.js +6 -32
  83. package/build/modules/dumper/plugins/edge.js +46 -61
  84. package/build/modules/encryption/define_config.d.ts +161 -0
  85. package/build/modules/encryption/drivers/aes_256_cbc.d.ts +20 -0
  86. package/build/modules/encryption/drivers/aes_256_cbc.js +2 -0
  87. package/build/modules/encryption/drivers/aes_256_gcm.d.ts +21 -0
  88. package/build/modules/encryption/drivers/aes_256_gcm.js +2 -0
  89. package/build/modules/encryption/drivers/aes_siv.d.ts +19 -0
  90. package/build/modules/encryption/drivers/aes_siv.js +2 -0
  91. package/build/modules/encryption/drivers/chacha20_poly1305.d.ts +21 -0
  92. package/build/modules/encryption/drivers/chacha20_poly1305.js +2 -0
  93. package/build/modules/encryption/drivers/legacy.d.ts +84 -0
  94. package/build/modules/encryption/drivers/legacy.js +57 -0
  95. package/build/modules/encryption/errors.d.ts +16 -0
  96. package/build/modules/encryption/main.d.ts +89 -0
  97. package/build/modules/encryption/main.js +6 -0
  98. package/build/modules/env/editor.js +2 -9
  99. package/build/modules/env/main.js +2 -28
  100. package/build/modules/events.js +6 -9
  101. package/build/modules/hash/drivers/argon.js +2 -9
  102. package/build/modules/hash/drivers/bcrypt.js +2 -20
  103. package/build/modules/hash/drivers/scrypt.js +2 -9
  104. package/build/modules/hash/main.js +6 -28
  105. package/build/modules/hash/phc_formatter.js +2 -9
  106. package/build/modules/health.js +2 -9
  107. package/build/modules/http/helpers.d.ts +1 -0
  108. package/build/modules/http/helpers.js +2 -0
  109. package/build/modules/http/main.js +4 -15
  110. package/build/modules/http/request_validator.d.ts +3 -4
  111. package/build/modules/http/url_builder_client.js +2 -9
  112. package/build/modules/logger.d.ts +30 -0
  113. package/build/modules/logger.js +14 -9
  114. package/build/modules/repl.js +6 -9
  115. package/build/modules/transformers/main.js +2 -9
  116. package/build/providers/app_provider.d.ts +5 -13
  117. package/build/providers/app_provider.js +153 -359
  118. package/build/providers/edge_provider.js +98 -164
  119. package/build/providers/hash_provider.js +29 -91
  120. package/build/providers/repl_provider.js +66 -152
  121. package/build/providers/vinejs_provider.d.ts +1 -1
  122. package/build/providers/vinejs_provider.js +21 -65
  123. package/build/services/ace.js +1 -16
  124. package/build/services/app.js +3 -19
  125. package/build/services/config.js +1 -12
  126. package/build/services/dumper.js +4 -20
  127. package/build/services/emitter.js +1 -13
  128. package/build/services/encryption.js +1 -13
  129. package/build/services/hash.js +1 -13
  130. package/build/services/logger.js +1 -13
  131. package/build/services/repl.js +1 -13
  132. package/build/services/router.js +1 -13
  133. package/build/services/server.js +1 -13
  134. package/build/services/test_utils.js +1 -16
  135. package/build/services/url_builder.d.ts +3 -3
  136. package/build/services/url_builder.js +4 -16
  137. package/build/src/assembler_hooks/index_entities.d.ts +34 -1
  138. package/build/src/debug.d.ts +1 -1
  139. package/build/src/exceptions.js +2 -49
  140. package/build/src/helpers/assert.js +2 -55
  141. package/build/src/helpers/http.js +2 -28
  142. package/build/src/helpers/is.js +3 -31
  143. package/build/src/helpers/main.js +5 -52
  144. package/build/src/helpers/string.js +26 -76
  145. package/build/src/helpers/types.js +25 -134
  146. package/build/src/helpers/verification_token.js +46 -120
  147. package/build/src/test_utils/main.js +8 -77
  148. package/build/src/types.d.ts +53 -99
  149. package/build/src/types.js +0 -8
  150. package/build/src/utils.d.ts +1 -1
  151. package/build/src/vine.js +29 -101
  152. package/build/toolkit/main.js +19 -21
  153. package/build/types/ace.js +2 -9
  154. package/build/types/app.js +2 -9
  155. package/build/types/bodyparser.js +2 -9
  156. package/build/types/common.js +2 -9
  157. package/build/types/container.js +2 -9
  158. package/build/types/encryption.d.ts +53 -1
  159. package/build/types/encryption.js +1 -9
  160. package/build/types/events.js +2 -9
  161. package/build/types/hash.js +2 -9
  162. package/build/types/health.js +2 -9
  163. package/build/types/helpers.js +0 -8
  164. package/build/types/http.js +2 -9
  165. package/build/types/logger.js +2 -9
  166. package/build/types/repl.js +2 -9
  167. package/build/types/transformers.js +2 -9
  168. package/build/utils-rRkbAPnP.js +42 -0
  169. package/package.json +117 -62
  170. package/build/modules/ace/commands.js +0 -157
  171. package/build/modules/ace/create_kernel.js +0 -91
  172. package/build/modules/ace/kernel.js +0 -40
  173. package/build/modules/dumper/define_config.js +0 -36
  174. package/build/modules/dumper/dumper.js +0 -266
  175. package/build/modules/dumper/errors.js +0 -119
  176. package/build/modules/encryption.d.ts +0 -18
  177. package/build/modules/encryption.js +0 -26
  178. package/build/modules/hash/define_config.js +0 -125
  179. package/build/modules/http/request_validator.js +0 -100
  180. package/build/src/assembler_hooks/index_entities.js +0 -112
  181. package/build/src/cli_formatters/routes_list.js +0 -397
  182. package/build/src/config_provider.js +0 -71
  183. package/build/src/debug.js +0 -25
  184. package/build/src/ignitor/ace.js +0 -102
  185. package/build/src/ignitor/http.js +0 -159
  186. package/build/src/ignitor/main.js +0 -124
  187. package/build/src/ignitor/test.js +0 -66
  188. package/build/src/test_utils/http.js +0 -82
  189. package/build/src/utils.js +0 -114
  190. package/build/stubs/main.js +0 -9
  191. package/build/toolkit/commands/index_commands.js +0 -30
  192. /package/build/{stubs/make → make}/command/main.stub +0 -0
  193. /package/build/{stubs/make → make}/controller/actions.stub +0 -0
  194. /package/build/{stubs/make → make}/controller/api.stub +0 -0
  195. /package/build/{stubs/make → make}/controller/main.stub +0 -0
  196. /package/build/{stubs/make → make}/controller/resource.stub +0 -0
  197. /package/build/{stubs/make → make}/event/main.stub +0 -0
  198. /package/build/{stubs/make → make}/exception/main.stub +0 -0
  199. /package/build/{stubs/make → make}/health/main.stub +0 -0
  200. /package/build/{stubs/make → make}/listener/for_event.stub +0 -0
  201. /package/build/{stubs/make → make}/listener/main.stub +0 -0
  202. /package/build/{stubs/make → make}/middleware/main.stub +0 -0
  203. /package/build/{stubs/make → make}/preload/main.stub +0 -0
  204. /package/build/{stubs/make → make}/provider/main.stub +0 -0
  205. /package/build/{stubs/make → make}/service/main.stub +0 -0
  206. /package/build/{stubs/make → make}/test/main.stub +0 -0
  207. /package/build/{stubs/make → make}/transformer/main.stub +0 -0
  208. /package/build/{stubs/make → make}/validator/main.stub +0 -0
  209. /package/build/{stubs/make → make}/validator/resource.stub +0 -0
  210. /package/build/{stubs/make → make}/view/main.stub +0 -0
@@ -0,0 +1,146 @@
1
+ import stringHelpers from "./src/helpers/string.js";
2
+ import { r as outputTransformerDataObjects } from "./utils-rRkbAPnP.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 "@boringnode/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
+ skipSegments: ["events"],
14
+ output: ".adonisjs/server/events.ts"
15
+ }, entities.events);
16
+ const listeners = Object.assign({
17
+ enabled: true,
18
+ source: "app/listeners",
19
+ importAlias: "#listeners",
20
+ skipSegments: ["listeners"],
21
+ output: ".adonisjs/server/listeners.ts"
22
+ }, entities.listeners);
23
+ const controllers = Object.assign({
24
+ enabled: true,
25
+ source: "app/controllers",
26
+ importAlias: "#controllers",
27
+ skipSegments: ["controllers"],
28
+ output: ".adonisjs/server/controllers.ts"
29
+ }, entities.controllers);
30
+ const transformers = Object.assign({
31
+ enabled: false,
32
+ source: "app/transformers",
33
+ importAlias: "#transformers",
34
+ withSharedProps: false,
35
+ inertiaMiddlewareImportPath: "#middleware/inertia_middleware",
36
+ skipSegments: ["transformers"],
37
+ output: ".adonisjs/client/data.d.ts"
38
+ }, entities.transformers);
39
+ const manifest = {
40
+ enabled: entities.manifest?.enabled === false ? false : transformers.enabled,
41
+ source: "config",
42
+ output: ".adonisjs/client/manifest.d.ts",
43
+ exclude: entities.manifest?.exclude ?? [
44
+ "app.ts",
45
+ "bodyparser.ts",
46
+ "cors.ts",
47
+ "database.ts",
48
+ "encryption.ts",
49
+ "inertia.ts",
50
+ "session.ts",
51
+ "shield.ts",
52
+ "static.ts",
53
+ "vite.ts"
54
+ ]
55
+ };
56
+ return { run(_, __, indexGenerator) {
57
+ if (events.enabled) indexGenerator.add("events", {
58
+ source: events.source,
59
+ disableLazyImports: true,
60
+ glob: events.glob,
61
+ as: "barrelFile",
62
+ exportName: "events",
63
+ importAlias: events.importAlias,
64
+ skipSegments: events.skipSegments,
65
+ output: events.output,
66
+ comment: true
67
+ });
68
+ if (listeners.enabled) indexGenerator.add("listeners", {
69
+ source: listeners.source,
70
+ glob: listeners.glob,
71
+ as: "barrelFile",
72
+ exportName: "listeners",
73
+ importAlias: listeners.importAlias,
74
+ skipSegments: listeners.skipSegments,
75
+ output: listeners.output,
76
+ comment: true
77
+ });
78
+ if (controllers.enabled) indexGenerator.add("controllers", {
79
+ source: controllers.source,
80
+ glob: controllers.glob,
81
+ as: "barrelFile",
82
+ exportName: "controllers",
83
+ importAlias: controllers.importAlias,
84
+ skipSegments: controllers.skipSegments,
85
+ removeSuffix: "controller",
86
+ output: controllers.output,
87
+ comment: true
88
+ });
89
+ if (transformers.enabled) indexGenerator.add("transformers", {
90
+ source: transformers.source,
91
+ glob: transformers.glob,
92
+ as(vfs, buffer, ___, helpers) {
93
+ outputTransformerDataObjects(vfs.asTree({
94
+ transformKey(key) {
95
+ let segments = key.split("/");
96
+ const baseName = segments.pop();
97
+ if (transformers.skipSegments?.length) segments = segments.filter((s) => !transformers.skipSegments.includes(s));
98
+ return [...segments.map((segment) => stringHelpers.pascalCase(segment)), stringHelpers.create(baseName).removeSuffix("transformer").pascalCase()].join("/");
99
+ },
100
+ transformValue: helpers.toImportPath
101
+ }), buffer, transformers.withSharedProps, transformers.inertiaMiddlewareImportPath);
102
+ },
103
+ importAlias: transformers.importAlias,
104
+ output: transformers.output,
105
+ comment: true
106
+ });
107
+ if (manifest.enabled) indexGenerator.add("manifest", {
108
+ source: manifest.source,
109
+ filter: (filePath, isDirectory) => {
110
+ if (isDirectory) return true;
111
+ if (!manifest.exclude?.length) return true;
112
+ return !manifest.exclude.find((include) => filePath.endsWith(include));
113
+ },
114
+ as(vfs, buffer, ___, helpers) {
115
+ const configFilesList = vfs.asList();
116
+ buffer.write(`/// <reference path="../../adonisrc.ts" />`);
117
+ Object.values(configFilesList).forEach((value) => {
118
+ buffer.write(`/// <reference path="${helpers.toImportPath(value)}" />`);
119
+ });
120
+ },
121
+ output: manifest.output,
122
+ comment: true
123
+ });
124
+ } };
125
+ }
126
+ const errors$5 = {
127
+ ...errors$3,
128
+ ...errors$4,
129
+ ...errors$2,
130
+ ...errors,
131
+ ...errors$1
132
+ };
133
+ async function prettyPrintError(error) {
134
+ if (error && typeof error === "object" && error.code === "E_DUMP_DIE_EXCEPTION") {
135
+ console.error(error);
136
+ return;
137
+ }
138
+ try {
139
+ const { Youch } = await import("youch");
140
+ const youch = new Youch();
141
+ console.error(await youch.toANSI(error));
142
+ } catch {
143
+ console.error(error);
144
+ }
145
+ }
146
+ 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-MBAMnmJb.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,3 @@
1
+ import "./main-MBAMnmJb.js";
2
+ import { t as createAceKernel } from "./create_kernel-B7ILNhuP.js";
3
+ export { createAceKernel };
@@ -0,0 +1,3 @@
1
+ import { debuglog } from "node:util";
2
+ var debug_default = debuglog("adonisjs:core");
3
+ export { debug_default 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,86 @@
1
+ import { t as debug_default } from "./debug-CGQmxzGt.js";
2
+ import { t as configProvider } from "./config_provider-FIAUgvae.js";
3
+ import { InvalidArgumentsException } from "./src/exceptions.js";
4
+ function defineConfig(config) {
5
+ if (!config.list) throw new InvalidArgumentsException("Missing \"list\" property in encryption config");
6
+ if (config.default && !config.list[config.default]) throw new InvalidArgumentsException(`Missing "list.${String(config.default)}" in encryption config. It is referenced by the "default" property`);
7
+ return configProvider.create(async (app) => {
8
+ debug_default("resolving encryption config");
9
+ const encryptorsList = Object.keys(config.list);
10
+ const encryptors = {};
11
+ for (let encryptorName of encryptorsList) {
12
+ const encryptor = config.list[encryptorName];
13
+ if ("resolver" in encryptor) encryptors[encryptorName] = await encryptor.resolver(app);
14
+ else encryptors[encryptorName] = encryptor;
15
+ }
16
+ return {
17
+ default: config.default,
18
+ list: encryptors
19
+ };
20
+ });
21
+ }
22
+ const drivers = {
23
+ chacha20: (config) => {
24
+ return configProvider.create(async () => {
25
+ const { ChaCha20Poly1305 } = await import("./modules/encryption/drivers/chacha20_poly1305.js");
26
+ debug_default("configuring chacha20 encryption driver");
27
+ return {
28
+ driver: (key) => new ChaCha20Poly1305({
29
+ id: config.id,
30
+ key
31
+ }),
32
+ keys: config.keys.filter((key) => !!key)
33
+ };
34
+ });
35
+ },
36
+ aes256cbc: (config) => {
37
+ return configProvider.create(async () => {
38
+ const { AES256CBC } = await import("./modules/encryption/drivers/aes_256_cbc.js");
39
+ debug_default("configuring aes256cbc encryption driver");
40
+ return {
41
+ driver: (key) => new AES256CBC({
42
+ id: config.id,
43
+ key
44
+ }),
45
+ keys: config.keys.filter((key) => !!key)
46
+ };
47
+ });
48
+ },
49
+ aes256gcm: (config) => {
50
+ return configProvider.create(async () => {
51
+ const { AES256GCM } = await import("./modules/encryption/drivers/aes_256_gcm.js");
52
+ debug_default("configuring aes256gcm encryption driver");
53
+ return {
54
+ driver: (key) => new AES256GCM({
55
+ id: config.id,
56
+ key
57
+ }),
58
+ keys: config.keys.filter((key) => !!key)
59
+ };
60
+ });
61
+ },
62
+ aessiv: (config) => {
63
+ return configProvider.create(async () => {
64
+ const { AESSIV } = await import("./modules/encryption/drivers/aes_siv.js");
65
+ debug_default("configuring aessiv encryption driver");
66
+ return {
67
+ driver: (key) => new AESSIV({
68
+ id: config.id,
69
+ key
70
+ }),
71
+ keys: [config.key].filter((key) => !!key)
72
+ };
73
+ });
74
+ },
75
+ legacy: (config) => {
76
+ return configProvider.create(async () => {
77
+ const { Legacy } = await import("./modules/encryption/drivers/legacy.js");
78
+ debug_default("configuring legacy encryption driver");
79
+ return {
80
+ driver: (key) => new Legacy({ key }),
81
+ keys: config.keys.filter((key) => !!key)
82
+ };
83
+ });
84
+ }
85
+ };
86
+ export { drivers as n, defineConfig as t };
@@ -0,0 +1,147 @@
1
+ import { t as __exportAll } from "./chunk-iKc69rpz.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,8 @@
1
+ import { createError } from "./src/exceptions.js";
2
+ import { errors } from "@boringnode/encryption";
3
+ const E_BLIND_INDEX_NOT_SUPPORTED = createError("Blind indexes are not supported by the \"%s\" encryption driver", "E_BLIND_INDEX_NOT_SUPPORTED");
4
+ const errors$1 = {
5
+ ...errors,
6
+ E_BLIND_INDEX_NOT_SUPPORTED
7
+ };
8
+ export { errors$1 as n, E_BLIND_INDEX_NOT_SUPPORTED as t };
@@ -1,9 +1,2 @@
1
- /*
2
- * @adonisjs/core
3
- *
4
- * (c) AdonisJS
5
- *
6
- * For the full copyright and license information, please view the LICENSE
7
- * file that was distributed with this source code.
8
- */
9
- export * from '@adonisjs/application/factories';
1
+ export * from "@adonisjs/application/factories";
2
+ export {};
@@ -1,9 +1,2 @@
1
- /*
2
- * @adonisjs/core
3
- *
4
- * (c) AdonisJS
5
- *
6
- * For the full copyright and license information, please view the LICENSE
7
- * file that was distributed with this source code.
8
- */
9
- export * from '@adonisjs/bodyparser/factories';
1
+ export * from "@adonisjs/bodyparser/factories";
2
+ export {};
@@ -1,46 +1,23 @@
1
- /*
2
- * @adonisjs/core
3
- *
4
- * (c) AdonisJS
5
- *
6
- * For the full copyright and license information, please view the LICENSE
7
- * file that was distributed with this source code.
8
- */
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 "../../main-MBAMnmJb.js";
6
+ import "../../main-DN2qEEg5.js";
7
+ import "../../define_config-0oHaj43l.js";
8
+ import "../../main-DkNgvceD.js";
9
9
  import { IgnitorFactory } from "./ignitor.js";
10
- import { Ignitor } from "../../src/ignitor/main.js";
11
- import { createAceKernel } from "../../modules/ace/create_kernel.js";
12
- /**
13
- * Factory for creating and configuring Ace command kernel instances.
14
- * This factory provides a convenient way to create Ace kernels either from
15
- * an existing Ignitor instance or by creating a new one from scratch.
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
- }
10
+ import { t as createAceKernel } from "../../create_kernel-B7ILNhuP.js";
11
+ var AceFactory = class {
12
+ async make(ignitorOrAppRoot, options) {
13
+ if (ignitorOrAppRoot instanceof Ignitor) {
14
+ const app = ignitorOrAppRoot.createApp("console");
15
+ await app.init();
16
+ return createAceKernel(app);
17
+ }
18
+ const app = new IgnitorFactory().withCoreConfig().withCoreProviders().create(ignitorOrAppRoot, options).createApp("console");
19
+ await app.init();
20
+ return createAceKernel(app);
21
+ }
22
+ };
23
+ export { AceFactory };