@adonisjs/core 7.0.0-next.1 → 7.0.0-next.11

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 (145) hide show
  1. package/build/commands/add.js +40 -110
  2. package/build/commands/build.js +51 -107
  3. package/build/commands/configure.js +82 -177
  4. package/build/commands/eject.js +17 -60
  5. package/build/commands/env/add.js +55 -134
  6. package/build/commands/generate_key.js +22 -66
  7. package/build/commands/inspect_rcfile.js +27 -55
  8. package/build/commands/list/routes.js +246 -116
  9. package/build/commands/make/command.js +15 -57
  10. package/build/commands/make/controller.js +43 -120
  11. package/build/commands/make/event.js +16 -62
  12. package/build/commands/make/exception.js +16 -62
  13. package/build/commands/make/listener.js +36 -93
  14. package/build/commands/make/middleware.js +41 -101
  15. package/build/commands/make/preload.js +47 -113
  16. package/build/commands/make/provider.js +47 -112
  17. package/build/commands/make/service.js +16 -55
  18. package/build/commands/make/test.js +47 -132
  19. package/build/commands/make/transformer.js +17 -64
  20. package/build/commands/make/validator.js +20 -80
  21. package/build/commands/make/view.js +15 -56
  22. package/build/commands/repl.js +17 -50
  23. package/build/commands/serve.js +80 -156
  24. package/build/commands/test.js +92 -208
  25. package/build/factories/app.js +2 -9
  26. package/build/factories/bodyparser.js +2 -9
  27. package/build/factories/core/ace.js +15 -46
  28. package/build/factories/core/ignitor.js +12 -180
  29. package/build/factories/core/main.js +22 -11
  30. package/build/factories/core/test_utils.js +19 -43
  31. package/build/factories/encryption.js +2 -9
  32. package/build/factories/events.js +2 -9
  33. package/build/factories/hash.js +2 -9
  34. package/build/factories/http.js +2 -9
  35. package/build/factories/logger.js +2 -9
  36. package/build/factories/stubs.js +28 -91
  37. package/build/index.js +13 -46
  38. package/build/modules/ace/codemods.d.ts +109 -14
  39. package/build/modules/ace/codemods.js +222 -374
  40. package/build/modules/ace/main.d.ts +30 -0
  41. package/build/modules/ace/main.js +2 -11
  42. package/build/modules/app.d.ts +17 -0
  43. package/build/modules/app.js +4 -9
  44. package/build/modules/bodyparser/bodyparser_middleware.js +2 -14
  45. package/build/modules/bodyparser/main.js +4 -9
  46. package/build/modules/config.d.ts +17 -0
  47. package/build/modules/config.js +4 -9
  48. package/build/modules/container.js +4 -9
  49. package/build/modules/dumper/dumper.d.ts +5 -0
  50. package/build/modules/dumper/main.d.ts +21 -0
  51. package/build/modules/dumper/main.js +6 -11
  52. package/build/modules/dumper/plugins/edge.js +2 -62
  53. package/build/modules/encryption.d.ts +17 -0
  54. package/build/modules/encryption.js +4 -9
  55. package/build/modules/env/editor.js +2 -9
  56. package/build/modules/env/main.d.ts +19 -0
  57. package/build/modules/env/main.js +2 -9
  58. package/build/modules/events.js +4 -9
  59. package/build/modules/hash/drivers/argon.js +2 -9
  60. package/build/modules/hash/drivers/bcrypt.d.ts +11 -0
  61. package/build/modules/hash/drivers/bcrypt.js +2 -9
  62. package/build/modules/hash/drivers/scrypt.js +2 -9
  63. package/build/modules/hash/main.d.ts +18 -0
  64. package/build/modules/hash/main.js +6 -10
  65. package/build/modules/hash/phc_formatter.js +2 -9
  66. package/build/modules/health.js +2 -9
  67. package/build/modules/http/main.js +4 -15
  68. package/build/modules/http/url_builder_client.d.ts +1 -0
  69. package/build/modules/http/url_builder_client.js +2 -0
  70. package/build/modules/logger.d.ts +30 -0
  71. package/build/modules/logger.js +4 -9
  72. package/build/modules/repl.js +4 -9
  73. package/build/modules/transformers/main.js +4 -9
  74. package/build/providers/app_provider.d.ts +9 -21
  75. package/build/providers/app_provider.js +147 -363
  76. package/build/providers/edge_provider.js +97 -104
  77. package/build/providers/hash_provider.js +29 -91
  78. package/build/providers/repl_provider.js +61 -152
  79. package/build/providers/vinejs_provider.d.ts +1 -1
  80. package/build/providers/vinejs_provider.js +20 -66
  81. package/build/services/ace.js +2 -17
  82. package/build/services/app.js +2 -21
  83. package/build/services/config.js +2 -13
  84. package/build/services/dumper.js +5 -21
  85. package/build/services/emitter.js +2 -14
  86. package/build/services/encryption.js +2 -14
  87. package/build/services/hash.js +2 -14
  88. package/build/services/logger.js +2 -14
  89. package/build/services/repl.js +2 -14
  90. package/build/services/router.js +2 -14
  91. package/build/services/server.js +2 -14
  92. package/build/services/test_utils.js +2 -17
  93. package/build/services/url_builder.js +5 -17
  94. package/build/src/exceptions.js +2 -49
  95. package/build/src/helpers/assert.js +2 -55
  96. package/build/src/helpers/http.d.ts +20 -0
  97. package/build/src/helpers/http.js +2 -0
  98. package/build/src/helpers/is.js +3 -31
  99. package/build/src/helpers/main.d.ts +1 -5
  100. package/build/src/helpers/main.js +5 -56
  101. package/build/src/helpers/string.js +2 -60
  102. package/build/src/helpers/types.js +26 -135
  103. package/build/src/helpers/verification_token.js +2 -120
  104. package/build/src/test_utils/main.js +5 -77
  105. package/build/src/types.d.ts +1 -0
  106. package/build/src/types.js +0 -8
  107. package/build/src/utils.d.ts +1 -1
  108. package/build/src/vine.js +2 -97
  109. package/build/types/ace.js +2 -9
  110. package/build/types/app.js +2 -9
  111. package/build/types/bodyparser.js +2 -9
  112. package/build/types/common.js +2 -9
  113. package/build/types/container.js +2 -9
  114. package/build/types/encryption.js +2 -9
  115. package/build/types/events.js +2 -9
  116. package/build/types/hash.js +2 -9
  117. package/build/types/health.js +2 -9
  118. package/build/types/helpers.d.ts +20 -0
  119. package/build/types/helpers.js +0 -8
  120. package/build/types/http.js +2 -9
  121. package/build/types/logger.js +2 -9
  122. package/build/types/repl.js +2 -9
  123. package/build/types/transformers.js +2 -9
  124. package/package.json +88 -30
  125. package/build/modules/ace/commands.js +0 -157
  126. package/build/modules/ace/create_kernel.js +0 -91
  127. package/build/modules/ace/kernel.js +0 -40
  128. package/build/modules/dumper/define_config.js +0 -36
  129. package/build/modules/dumper/dumper.js +0 -256
  130. package/build/modules/dumper/errors.js +0 -119
  131. package/build/modules/hash/define_config.js +0 -125
  132. package/build/modules/http/request_validator.js +0 -100
  133. package/build/src/assembler_hooks/index_entities.js +0 -106
  134. package/build/src/cli_formatters/routes_list.js +0 -381
  135. package/build/src/config_provider.js +0 -71
  136. package/build/src/debug.js +0 -25
  137. package/build/src/ignitor/ace.js +0 -102
  138. package/build/src/ignitor/http.js +0 -146
  139. package/build/src/ignitor/main.js +0 -124
  140. package/build/src/ignitor/test.js +0 -66
  141. package/build/src/test_utils/http.js +0 -82
  142. package/build/src/utils.js +0 -104
  143. package/build/stubs/main.js +0 -9
  144. package/build/toolkit/commands/index_commands.js +0 -30
  145. package/build/toolkit/main.js +0 -27
@@ -1,104 +1,97 @@
1
- /*
2
- * @adonisjs/core
3
- *
4
- * (c) AdonisJS
5
- *
6
- * For the full copyright and license information, please view the LICENSE
7
- * file that was distributed with this source code.
8
- */
9
- import edge from 'edge.js';
10
- import { pluginEdgeDumper } from "../modules/dumper/plugins/edge.js";
11
- import { BriskRoute, HttpContext } from "../modules/http/main.js";
12
- /**
13
- * The Edge service provider configures Edge to work within
14
- * an AdonisJS application environment
15
- *
16
- * This provider integrates EdgeJS template engine with AdonisJS by:
17
- * - Mounting the views directory
18
- * - Configuring template caching for production
19
- * - Adding global helpers for route generation
20
- * - Creating isolated renderer instances for HTTP contexts
21
- * - Adding render macro to BriskRoute for template rendering
22
- *
23
- * @example
24
- * const provider = new EdgeServiceProvider(app)
25
- * await provider.boot()
26
- */
27
- export default class EdgeServiceProvider {
28
- app;
29
- /**
30
- * Edge service provider constructor
31
- *
32
- * Sets the usingEdgeJS flag to true to indicate EdgeJS is being used.
33
- *
34
- * @param app - The application service instance
35
- */
36
- constructor(app) {
37
- this.app = app;
38
- this.app.usingEdgeJS = true;
39
- }
40
- /**
41
- * Bridge AdonisJS and Edge
42
- *
43
- * Configures EdgeJS integration by:
44
- * - Setting up template mounting and caching
45
- * - Defining global helpers (route, signedRoute, app, config)
46
- * - Adding view getter to HttpContext for isolated rendering
47
- * - Adding render macro to BriskRoute
48
- * - Registering dumper plugin
49
- *
50
- * @example
51
- * await provider.boot()
52
- * // Now edge templates can use {{ route('home') }} helper
53
- */
54
- async boot() {
55
- const app = this.app;
56
- const router = await this.app.container.make('router');
57
- const dumper = await this.app.container.make('dumper');
58
- function edgeConfigResolver(key, defaultValue) {
59
- return app.config.get(key, defaultValue);
60
- }
61
- edgeConfigResolver.has = function (key) {
62
- return app.config.has(key);
63
- };
64
- /**
65
- * Mount the default disk
66
- */
67
- edge.mount(app.viewsPath());
68
- /**
69
- * Cache templates in production
70
- */
71
- edge.configure({ cache: app.inProduction });
72
- /**
73
- * Define Edge global helpers
74
- */
75
- edge.global('route', function (...args) {
76
- return router.makeUrl(...args);
77
- });
78
- edge.global('signedRoute', function (...args) {
79
- return router.makeSignedUrl(...args);
80
- });
81
- edge.global('app', app);
82
- edge.global('config', edgeConfigResolver);
83
- /**
84
- * Creating a isolated instance of edge renderer
85
- */
86
- HttpContext.getter('view', function () {
87
- return edge.createRenderer().share({
88
- request: this.request,
89
- });
90
- }, true);
91
- /**
92
- * Adding brisk route to render templates without an
93
- * explicit handler
94
- */
95
- BriskRoute.macro('render', function (template, data) {
96
- function rendersTemplate({ view }) {
97
- return view.render(template, data);
98
- }
99
- Object.defineProperty(rendersTemplate, 'listArgs', { value: template, writable: false });
100
- return this.setHandler(rendersTemplate);
101
- });
102
- edge.use(pluginEdgeDumper(dumper));
103
- }
104
- }
1
+ import "../chunk-MjwdjG2f.js";
2
+ import { t as main_exports } from "../main-CFmDHDls.js";
3
+ import { t as pluginEdgeDumper } from "../edge-LQdCc1L3.js";
4
+ import edge from "edge.js";
5
+ var EdgeServiceProvider = class {
6
+ constructor(app) {
7
+ this.app = app;
8
+ this.app.usingEdgeJS = true;
9
+ }
10
+ async boot() {
11
+ const app = this.app;
12
+ const qs = new main_exports.Qs(app.config.get("app.http.qs", {}));
13
+ const router = await this.app.container.make("router");
14
+ const dumper = await this.app.container.make("dumper");
15
+ function edgeConfigResolver(key, defaultValue) {
16
+ return app.config.get(key, defaultValue);
17
+ }
18
+ edgeConfigResolver.has = function(key) {
19
+ return app.config.has(key);
20
+ };
21
+ function clientRoutes() {
22
+ const routes = router.toJSON();
23
+ return Object.keys(routes).reduce((result, domain) => {
24
+ result[domain] = routes[domain].reduce((routesResult, route) => {
25
+ if (!route.name) return routesResult;
26
+ routesResult.push({
27
+ domain: route.domain,
28
+ methods: route.methods,
29
+ pattern: route.pattern,
30
+ tokens: route.tokens,
31
+ name: route.name
32
+ });
33
+ return routesResult;
34
+ }, []);
35
+ return result;
36
+ }, {});
37
+ }
38
+ edge.mount(app.viewsPath());
39
+ edge.configure({ cache: app.inProduction });
40
+ edge.global("route", function(...args) {
41
+ return router.makeUrl(...args);
42
+ });
43
+ edge.global("signedRoute", function(...args) {
44
+ return router.makeSignedUrl(...args);
45
+ });
46
+ edge.global("app", app);
47
+ edge.global("config", edgeConfigResolver);
48
+ edge.global("routes", function() {
49
+ return clientRoutes();
50
+ });
51
+ edge.global("routesJSON", function() {
52
+ return JSON.stringify(clientRoutes());
53
+ });
54
+ edge.global("urlFor", function(...args) {
55
+ return router.urlBuilder.urlFor(...args);
56
+ });
57
+ edge.global("signedUrlFor", function(...args) {
58
+ return router.urlBuilder.signedUrlFor(...args);
59
+ });
60
+ edge.global("qs", qs);
61
+ edge.global("formAttributes", function(route, method, params, options) {
62
+ options = options ?? {};
63
+ method = method.toUpperCase();
64
+ const original = method;
65
+ if (method !== "GET" && method !== "POST") {
66
+ method = "POST";
67
+ options = {
68
+ ...options,
69
+ qs: {
70
+ _method: original,
71
+ ...options.qs
72
+ }
73
+ };
74
+ }
75
+ const { action } = router.urlBuilder.urlFor.method(original, route, params, options).form;
76
+ return {
77
+ action,
78
+ method
79
+ };
80
+ });
81
+ main_exports.HttpContext.getter("view", function() {
82
+ return edge.createRenderer().share({ request: this.request });
83
+ }, true);
84
+ main_exports.BriskRoute.macro("render", function(template, data) {
85
+ function rendersTemplate({ view }) {
86
+ return view.render(template, data);
87
+ }
88
+ Object.defineProperty(rendersTemplate, "listArgs", {
89
+ value: template,
90
+ writable: false
91
+ });
92
+ return this.setHandler(rendersTemplate);
93
+ });
94
+ edge.use(pluginEdgeDumper(dumper));
95
+ }
96
+ };
97
+ export { EdgeServiceProvider as default };
@@ -1,91 +1,29 @@
1
- /*
2
- * @adonisjs/core
3
- *
4
- * (c) AdonisJS
5
- *
6
- * For the full copyright and license information, please view the LICENSE
7
- * file that was distributed with this source code.
8
- */
9
- import { RuntimeException } from '@poppinss/utils/exception';
10
- import { Hash } from "../modules/hash/main.js";
11
- import { configProvider } from "../src/config_provider.js";
12
- /**
13
- * Registers the passwords hasher with the container
14
- *
15
- * This provider sets up password hashing functionality by:
16
- * - Registering the HashManager with configuration from config/hash.ts
17
- * - Providing a Hash class that uses the default hasher
18
- * - Supporting multiple hashing drivers (bcrypt, argon2, etc.)
19
- *
20
- * @example
21
- * const provider = new HashServiceProvider(app)
22
- * provider.register()
23
- * const hash = await app.container.make('hash')
24
- */
25
- export default class HashServiceProvider {
26
- app;
27
- /**
28
- * Hash service provider constructor
29
- *
30
- * @param app - The application service instance
31
- */
32
- constructor(app) {
33
- this.app = app;
34
- }
35
- /**
36
- * Registering the hash class to resolve an instance with the
37
- * default hasher.
38
- *
39
- * Creates a singleton binding for the Hash class that resolves
40
- * the default hasher from the hash manager.
41
- *
42
- * @example
43
- * const hash = await container.make(Hash)
44
- * const hashed = await hash.make('password')
45
- */
46
- registerHash() {
47
- this.app.container.singleton(Hash, async (resolver) => {
48
- const hashManager = await resolver.make('hash');
49
- return hashManager.use();
50
- });
51
- }
52
- /**
53
- * Registers the hash manager with the container
54
- *
55
- * Creates a singleton binding for 'hash' that instantiates
56
- * the HashManager with configuration from config/hash.ts file.
57
- * Throws an error if the configuration is invalid.
58
- *
59
- * @example
60
- * const hashManager = await container.make('hash')
61
- * const bcryptHasher = hashManager.use('bcrypt')
62
- */
63
- registerHashManager() {
64
- this.app.container.singleton('hash', async () => {
65
- const hashConfigProvider = this.app.config.get('hash');
66
- /**
67
- * Resolve config from the provider
68
- */
69
- const config = await configProvider.resolve(this.app, hashConfigProvider);
70
- if (!config) {
71
- throw new RuntimeException('Invalid "config/hash.ts" file. Make sure you are using the "defineConfig" method');
72
- }
73
- const { HashManager } = await import('../modules/hash/main.js');
74
- return new HashManager(config);
75
- });
76
- }
77
- /**
78
- * Registers bindings
79
- *
80
- * Called during the application bootstrap phase to register
81
- * the hash manager and hash class with the IoC container.
82
- *
83
- * @example
84
- * const provider = new HashServiceProvider(app)
85
- * provider.register() // Registers hash services
86
- */
87
- register() {
88
- this.registerHashManager();
89
- this.registerHash();
90
- }
91
- }
1
+ import "../chunk-MjwdjG2f.js";
2
+ import "../debug-DURPi9xn.js";
3
+ import { t as configProvider } from "../config_provider-CY-xuo2R.js";
4
+ import { t as main_exports } from "../main-BrJQ1VAM.js";
5
+ import { RuntimeException } from "@poppinss/utils/exception";
6
+ var HashServiceProvider = class {
7
+ constructor(app) {
8
+ this.app = app;
9
+ }
10
+ registerHash() {
11
+ this.app.container.singleton(main_exports.Hash, async (resolver) => {
12
+ return (await resolver.make("hash")).use();
13
+ });
14
+ }
15
+ registerHashManager() {
16
+ this.app.container.singleton("hash", async () => {
17
+ const hashConfigProvider = this.app.config.get("hash");
18
+ const config = await configProvider.resolve(this.app, hashConfigProvider);
19
+ if (!config) throw new RuntimeException("Invalid \"config/hash.ts\" file. Make sure you are using the \"defineConfig\" method");
20
+ const { HashManager } = await import("../modules/hash/main.js");
21
+ return new HashManager(config);
22
+ });
23
+ }
24
+ register() {
25
+ this.registerHashManager();
26
+ this.registerHash();
27
+ }
28
+ };
29
+ export { HashServiceProvider as default };
@@ -1,154 +1,63 @@
1
- /*
2
- * @adonisjs/core
3
- *
4
- * (c) AdonisJS
5
- *
6
- * For the full copyright and license information, please view the LICENSE
7
- * file that was distributed with this source code.
8
- */
9
- import { join } from 'node:path';
10
- import { homedir } from 'node:os';
11
- import { fsImportAll } from '@poppinss/utils/fs';
12
- import { Repl } from "../modules/repl.js";
13
- /**
14
- * Resolves a container binding and sets it on the REPL
15
- * context
16
- *
17
- * This helper function makes a service from the container and
18
- * adds it to the REPL context with a notification message.
19
- *
20
- * @param app - The application service instance
21
- * @param repl - The REPL instance to add the binding to
22
- * @param binding - The container binding key to resolve
23
- *
24
- * @example
25
- * await resolveBindingForRepl(app, repl, 'router')
26
- * // Now 'router' variable is available in REPL
27
- */
1
+ import "../chunk-MjwdjG2f.js";
2
+ import { t as repl_exports } from "../repl-CumYg2V_.js";
3
+ import { join } from "node:path";
4
+ import { homedir } from "node:os";
5
+ import { fsImportAll } from "@poppinss/utils/fs";
28
6
  async function resolveBindingForRepl(app, repl, binding) {
29
- repl.server.context[binding] = await app.container.make(binding);
30
- repl.notify(`Loaded "${binding}" service. You can access it using the "${repl.colors.underline(binding)}" variable`);
31
- }
32
- /**
33
- * REPL Service Provider configures the interactive Node.js REPL
34
- * for AdonisJS applications
35
- *
36
- * This provider sets up:
37
- * - REPL instance with history file support
38
- * - Helper methods for importing modules and making container bindings
39
- * - Quick access methods for loading common services (app, router, etc.)
40
- * - Utility methods for development and debugging
41
- *
42
- * @example
43
- * const provider = new ReplServiceProvider(app)
44
- * provider.register()
45
- * await provider.boot()
46
- */
47
- export default class ReplServiceProvider {
48
- app;
49
- /**
50
- * REPL service provider constructor
51
- *
52
- * @param app - The application service instance
53
- */
54
- constructor(app) {
55
- this.app = app;
56
- }
57
- /**
58
- * Registers the REPL binding
59
- *
60
- * Creates a singleton binding for the REPL with history file
61
- * support in the user's home directory.
62
- *
63
- * @example
64
- * const provider = new ReplServiceProvider(app)
65
- * provider.register()
66
- * const repl = await app.container.make('repl')
67
- */
68
- register() {
69
- this.app.container.singleton(Repl, async () => {
70
- return new Repl({
71
- historyFilePath: join(homedir(), '.adonisjs_v6_repl_history'),
72
- });
73
- });
74
- this.app.container.alias('repl', Repl);
75
- }
76
- /**
77
- * Registering REPL bindings during provider boot
78
- *
79
- * Adds helper methods to the REPL instance including:
80
- * - importDefault: Import default export from modules
81
- * - importAll: Import all files from a directory
82
- * - make: Create instances using container.make
83
- * - load* methods: Quick access to common services
84
- * - loadHelpers: Load utility helper functions
85
- *
86
- * @example
87
- * await provider.boot()
88
- * // REPL now has helper methods available
89
- */
90
- async boot() {
91
- this.app.container.resolving('repl', (repl) => {
92
- repl.addMethod('importDefault', (_, modulePath) => {
93
- return this.app.importDefault(modulePath);
94
- }, {
95
- description: 'Returns the default export for a module',
96
- });
97
- repl.addMethod('importAll', (_, dirPath) => {
98
- return fsImportAll(this.app.makeURL(dirPath), {
99
- ignoreMissingRoot: false,
100
- });
101
- }, {
102
- description: 'Import all files from a directory and assign them to a variable',
103
- });
104
- repl.addMethod('make', (_, service, runtimeValues) => {
105
- return this.app.container.make(service, runtimeValues);
106
- }, {
107
- description: 'Make class instance using "container.make" method',
108
- });
109
- repl.addMethod('loadApp', () => {
110
- return resolveBindingForRepl(this.app, repl, 'app');
111
- }, {
112
- description: 'Load "app" service in the REPL context',
113
- });
114
- repl.addMethod('loadEncryption', () => {
115
- return resolveBindingForRepl(this.app, repl, 'encryption');
116
- }, {
117
- description: 'Load "encryption" service in the REPL context',
118
- });
119
- repl.addMethod('loadHash', () => {
120
- return resolveBindingForRepl(this.app, repl, 'hash');
121
- }, {
122
- description: 'Load "hash" service in the REPL context',
123
- });
124
- repl.addMethod('loadRouter', () => {
125
- return resolveBindingForRepl(this.app, repl, 'router');
126
- }, {
127
- description: 'Load "router" service in the REPL context',
128
- });
129
- repl.addMethod('loadConfig', () => {
130
- return resolveBindingForRepl(this.app, repl, 'config');
131
- }, {
132
- description: 'Load "config" service in the REPL context',
133
- });
134
- repl.addMethod('loadTestUtils', () => {
135
- return resolveBindingForRepl(this.app, repl, 'testUtils');
136
- }, {
137
- description: 'Load "testUtils" service in the REPL context',
138
- });
139
- repl.addMethod('loadHelpers', async () => {
140
- const { default: isModule } = await import('../src/helpers/is.js');
141
- const { default: stringModule } = await import('../src/helpers/string.js');
142
- const helpers = await import('../src/helpers/main.js');
143
- repl.server.context.helpers = {
144
- string: stringModule,
145
- is: isModule,
146
- ...helpers,
147
- };
148
- repl.notify(`Loaded "helpers" module. You can access it using the "${repl.colors.underline('helpers')}" variable`);
149
- }, {
150
- description: 'Load "helpers" module in the REPL context',
151
- });
152
- });
153
- }
7
+ repl.server.context[binding] = await app.container.make(binding);
8
+ repl.notify(`Loaded "${binding}" service. You can access it using the "${repl.colors.underline(binding)}" variable`);
154
9
  }
10
+ var ReplServiceProvider = class {
11
+ constructor(app) {
12
+ this.app = app;
13
+ }
14
+ register() {
15
+ this.app.container.singleton(repl_exports.Repl, async () => {
16
+ return new repl_exports.Repl({ historyFilePath: join(homedir(), ".adonisjs_v6_repl_history") });
17
+ });
18
+ this.app.container.alias("repl", repl_exports.Repl);
19
+ }
20
+ async boot() {
21
+ this.app.container.resolving("repl", (repl) => {
22
+ repl.addMethod("importDefault", (_, modulePath) => {
23
+ return this.app.importDefault(modulePath);
24
+ }, { description: "Returns the default export for a module" });
25
+ repl.addMethod("importAll", (_, dirPath) => {
26
+ return fsImportAll(this.app.makeURL(dirPath), { ignoreMissingRoot: false });
27
+ }, { description: "Import all files from a directory and assign them to a variable" });
28
+ repl.addMethod("make", (_, service, runtimeValues) => {
29
+ return this.app.container.make(service, runtimeValues);
30
+ }, { description: "Make class instance using \"container.make\" method" });
31
+ repl.addMethod("loadApp", () => {
32
+ return resolveBindingForRepl(this.app, repl, "app");
33
+ }, { description: "Load \"app\" service in the REPL context" });
34
+ repl.addMethod("loadEncryption", () => {
35
+ return resolveBindingForRepl(this.app, repl, "encryption");
36
+ }, { description: "Load \"encryption\" service in the REPL context" });
37
+ repl.addMethod("loadHash", () => {
38
+ return resolveBindingForRepl(this.app, repl, "hash");
39
+ }, { description: "Load \"hash\" service in the REPL context" });
40
+ repl.addMethod("loadRouter", () => {
41
+ return resolveBindingForRepl(this.app, repl, "router");
42
+ }, { description: "Load \"router\" service in the REPL context" });
43
+ repl.addMethod("loadConfig", () => {
44
+ return resolveBindingForRepl(this.app, repl, "config");
45
+ }, { description: "Load \"config\" service in the REPL context" });
46
+ repl.addMethod("loadTestUtils", () => {
47
+ return resolveBindingForRepl(this.app, repl, "testUtils");
48
+ }, { description: "Load \"testUtils\" service in the REPL context" });
49
+ repl.addMethod("loadHelpers", async () => {
50
+ const { default: isModule } = await import("../src/helpers/is.js");
51
+ const { default: stringModule } = await import("../src/helpers/string.js");
52
+ const helpers = await import("../src/helpers/main.js");
53
+ repl.server.context.helpers = {
54
+ string: stringModule,
55
+ is: isModule,
56
+ ...helpers
57
+ };
58
+ repl.notify(`Loaded "helpers" module. You can access it using the "${repl.colors.underline("helpers")}" variable`);
59
+ }, { description: "Load \"helpers\" module in the REPL context" });
60
+ });
61
+ }
62
+ };
63
+ export { ReplServiceProvider as default };
@@ -13,7 +13,7 @@ declare module '@vinejs/vine' {
13
13
  * Extend HTTP request class
14
14
  */
15
15
  declare module '@adonisjs/core/http' {
16
- interface Request extends RequestValidator {
16
+ interface HttpRequest extends RequestValidator {
17
17
  }
18
18
  }
19
19
  /**
@@ -1,66 +1,20 @@
1
- /*
2
- * @adonisjs/core
3
- *
4
- * (c) AdonisJS
5
- *
6
- * For the full copyright and license information, please view the LICENSE
7
- * file that was distributed with this source code.
8
- */
9
- import { Vine } from '@vinejs/vine';
10
- import { Request, RequestValidator } from "../modules/http/main.js";
11
- import { VineMultipartFile } from "../src/vine.js";
12
- /**
13
- * The VineJS service provider integrates VineJS validation
14
- * library with AdonisJS application environment
15
- *
16
- * This provider sets up:
17
- * - File validation rule for multipart file uploads
18
- * - Request validation macro for easy validation in HTTP contexts
19
- * - Extension of VineJS with AdonisJS-specific validation features
20
- *
21
- * @example
22
- * const provider = new VineJSServiceProvider(app)
23
- * provider.boot()
24
- * // Now Request has validateUsing method
25
- */
26
- export default class VineJSServiceProvider {
27
- app;
28
- /**
29
- * VineJS service provider constructor
30
- *
31
- * Sets the usingVineJS flag to true to indicate VineJS is being used.
32
- *
33
- * @param app - The application service instance
34
- */
35
- constructor(app) {
36
- this.app = app;
37
- this.app.usingVineJS = true;
38
- }
39
- /**
40
- * Boot the VineJS service provider
41
- *
42
- * Extends VineJS with file validation macro and adds validateUsing
43
- * method to the Request class for easy validation in HTTP contexts.
44
- *
45
- * @example
46
- * provider.boot()
47
- * // Now vine.file() and request.validateUsing() are available
48
- */
49
- boot() {
50
- const experimentalFlags = this.app.experimentalFlags;
51
- /**
52
- * The file method is used to validate a field to be a valid
53
- * multipart file.
54
- */
55
- Vine.macro('file', function (options) {
56
- return new VineMultipartFile(options);
57
- });
58
- /**
59
- * The validate method can be used to validate the request
60
- * data for the current request using VineJS validators
61
- */
62
- Request.macro('validateUsing', function (...args) {
63
- return new RequestValidator(this.ctx, experimentalFlags).validateUsing(...args);
64
- });
65
- }
66
- }
1
+ import "../chunk-MjwdjG2f.js";
2
+ import { n as RequestValidator, t as main_exports } from "../main-CFmDHDls.js";
3
+ import { t as VineMultipartFile } from "../vine-Bt4ymkM0.js";
4
+ import { Vine } from "@vinejs/vine";
5
+ var VineJSServiceProvider = class {
6
+ constructor(app) {
7
+ this.app = app;
8
+ this.app.usingVineJS = true;
9
+ }
10
+ boot() {
11
+ const experimentalFlags = this.app.experimentalFlags;
12
+ Vine.macro("file", function(options) {
13
+ return new VineMultipartFile(options);
14
+ });
15
+ main_exports.HttpRequest.macro("validateUsing", function(...args) {
16
+ return new RequestValidator(this.ctx, experimentalFlags).validateUsing(...args);
17
+ });
18
+ }
19
+ };
20
+ export { VineJSServiceProvider as default };
@@ -1,21 +1,6 @@
1
- /*
2
- * @adonisjs/core
3
- *
4
- * (c) AdonisJS
5
- *
6
- * For the full copyright and license information, please view the LICENSE
7
- * file that was distributed with this source code.
8
- */
9
- import app from "./app.js";
1
+ import { t as app } from "../app-B6oge7b3.js";
10
2
  let ace;
11
- /**
12
- * Returns a singleton instance of the ace kernel
13
- * from the container.
14
- *
15
- * ace service is an instance of the "Kernel" class stored inside
16
- * the "modules/ace/kernel.ts" file
17
- */
18
3
  await app.booted(async () => {
19
- ace = await app.container.make('ace');
4
+ ace = await app.container.make("ace");
20
5
  });
21
6
  export { ace as default };