@adonisjs/core 6.1.5-8 → 6.2.0

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 (135) hide show
  1. package/README.md +3 -5
  2. package/build/commands/build.d.ts +3 -5
  3. package/build/commands/build.js +5 -9
  4. package/build/commands/commands.json +1 -1
  5. package/build/commands/configure.d.ts +21 -28
  6. package/build/commands/configure.js +60 -118
  7. package/build/commands/eject.js +2 -1
  8. package/build/commands/generate_key.js +2 -2
  9. package/build/commands/inspect_rcfile.js +19 -2
  10. package/build/commands/main.d.ts +4 -0
  11. package/build/commands/make/command.d.ts +1 -1
  12. package/build/commands/make/command.js +5 -2
  13. package/build/commands/make/controller.d.ts +2 -1
  14. package/build/commands/make/controller.js +33 -10
  15. package/build/commands/make/event.d.ts +1 -1
  16. package/build/commands/make/event.js +5 -3
  17. package/build/commands/make/exception.d.ts +1 -1
  18. package/build/commands/make/exception.js +6 -4
  19. package/build/commands/make/listener.d.ts +1 -1
  20. package/build/commands/make/listener.js +9 -6
  21. package/build/commands/make/middleware.d.ts +2 -1
  22. package/build/commands/make/middleware.js +50 -4
  23. package/build/commands/make/preload.d.ts +4 -3
  24. package/build/commands/make/preload.js +34 -35
  25. package/build/commands/make/provider.d.ts +7 -1
  26. package/build/commands/make/provider.js +57 -7
  27. package/build/commands/make/service.d.ts +1 -1
  28. package/build/commands/make/service.js +5 -3
  29. package/build/commands/make/test.d.ts +1 -1
  30. package/build/commands/make/test.js +7 -5
  31. package/build/commands/make/validator.d.ts +19 -0
  32. package/build/commands/make/validator.js +53 -0
  33. package/build/commands/make/view.d.ts +14 -0
  34. package/build/commands/make/view.js +37 -0
  35. package/build/commands/serve.js +7 -4
  36. package/build/commands/test.js +2 -2
  37. package/build/factories/core/ace.d.ts +2 -2
  38. package/build/factories/core/ignitor.d.ts +2 -2
  39. package/build/factories/core/ignitor.js +9 -10
  40. package/build/factories/core/main.d.ts +0 -1
  41. package/build/factories/core/main.js +0 -1
  42. package/build/factories/core/test_utils.d.ts +2 -2
  43. package/build/factories/stubs.d.ts +2 -2
  44. package/build/factories/stubs.js +3 -2
  45. package/build/index.d.ts +11 -140
  46. package/build/index.js +5 -1
  47. package/build/modules/ace/codemods.d.ts +93 -0
  48. package/build/modules/ace/codemods.js +259 -0
  49. package/build/modules/ace/commands.d.ts +6 -81
  50. package/build/modules/ace/commands.js +12 -33
  51. package/build/modules/ace/create_kernel.d.ts +1 -1
  52. package/build/modules/ace/create_kernel.js +19 -3
  53. package/build/modules/env/editor.d.ts +1 -0
  54. package/build/modules/{http.js → env/editor.js} +1 -1
  55. package/build/modules/hash/define_config.d.ts +29 -12
  56. package/build/modules/hash/define_config.js +52 -11
  57. package/build/modules/hash/drivers/argon.d.ts +1 -0
  58. package/build/modules/hash/drivers/argon.js +9 -0
  59. package/build/modules/hash/drivers/bcrypt.d.ts +1 -0
  60. package/build/modules/hash/drivers/bcrypt.js +9 -0
  61. package/build/modules/hash/drivers/scrypt.d.ts +1 -0
  62. package/build/modules/hash/drivers/scrypt.js +9 -0
  63. package/build/modules/hash/main.d.ts +1 -2
  64. package/build/modules/hash/main.js +1 -2
  65. package/build/modules/hash/phc_formatter.d.ts +1 -0
  66. package/build/modules/hash/phc_formatter.js +9 -0
  67. package/build/modules/http/main.d.ts +7 -0
  68. package/build/modules/http/main.js +15 -0
  69. package/build/modules/http/request_validator.d.ts +34 -0
  70. package/build/modules/http/request_validator.js +66 -0
  71. package/build/providers/app_provider.d.ts +14 -0
  72. package/build/providers/app_provider.js +47 -3
  73. package/build/providers/edge_provider.d.ts +31 -0
  74. package/build/providers/edge_provider.js +70 -0
  75. package/build/providers/hash_provider.d.ts +0 -4
  76. package/build/providers/hash_provider.js +11 -11
  77. package/build/providers/repl_provider.js +83 -8
  78. package/build/providers/vinejs_provider.d.ts +43 -0
  79. package/build/providers/vinejs_provider.js +97 -0
  80. package/build/src/cli_formatters/routes_list.d.ts +1 -1
  81. package/build/src/config_provider.d.ts +9 -0
  82. package/build/src/config_provider.js +26 -0
  83. package/build/src/debug.d.ts +1 -1
  84. package/build/src/helpers/assert.d.ts +1 -0
  85. package/build/src/helpers/assert.js +9 -0
  86. package/build/src/helpers/main.d.ts +2 -2
  87. package/build/src/helpers/main.js +2 -2
  88. package/build/src/helpers/types.d.ts +109 -16
  89. package/build/src/helpers/types.js +3 -3
  90. package/build/src/ignitor/ace.js +3 -1
  91. package/build/src/ignitor/http.d.ts +2 -2
  92. package/build/src/ignitor/http.js +5 -1
  93. package/build/src/ignitor/main.d.ts +2 -2
  94. package/build/src/ignitor/main.js +1 -1
  95. package/build/src/test_utils/http.d.ts +2 -2
  96. package/build/src/test_utils/main.d.ts +3 -3
  97. package/build/src/test_utils/main.js +1 -1
  98. package/build/src/types.d.ts +18 -18
  99. package/build/stubs/make/command/main.stub +6 -4
  100. package/build/stubs/make/controller/actions.stub +14 -0
  101. package/build/stubs/make/controller/api.stub +6 -4
  102. package/build/stubs/make/controller/main.stub +6 -4
  103. package/build/stubs/make/controller/resource.stub +6 -4
  104. package/build/stubs/make/event/main.stub +5 -3
  105. package/build/stubs/make/exception/main.stub +5 -3
  106. package/build/stubs/make/listener/for_event.stub +6 -4
  107. package/build/stubs/make/listener/main.stub +5 -3
  108. package/build/stubs/make/middleware/main.stub +7 -5
  109. package/build/stubs/make/{preload_file → preload}/main.stub +5 -3
  110. package/build/stubs/make/provider/main.stub +6 -4
  111. package/build/stubs/make/service/main.stub +5 -3
  112. package/build/stubs/make/test/main.stub +5 -3
  113. package/build/stubs/make/validator/main.stub +7 -0
  114. package/build/stubs/make/validator/resource.stub +26 -0
  115. package/build/stubs/make/view/main.stub +6 -0
  116. package/build/types/bodyparser.js +1 -1
  117. package/build/types/helpers.d.ts +1 -0
  118. package/build/types/helpers.js +9 -0
  119. package/build/types/http.d.ts +7 -0
  120. package/package.json +71 -56
  121. package/build/commands/make/_base.d.ts +0 -36
  122. package/build/commands/make/_base.js +0 -27
  123. package/build/modules/ace/shell.d.ts +0 -12
  124. package/build/modules/ace/shell.js +0 -49
  125. package/build/modules/hash/drivers_collection.d.ts +0 -21
  126. package/build/modules/hash/drivers_collection.js +0 -45
  127. package/build/modules/http.d.ts +0 -1
  128. package/build/providers/http_provider.d.ts +0 -26
  129. package/build/providers/http_provider.js +0 -61
  130. package/build/src/bindings/repl.d.ts +0 -6
  131. package/build/src/bindings/repl.js +0 -78
  132. /package/build/modules/{env.d.ts → env/main.d.ts} +0 -0
  133. /package/build/modules/{env.js → env/main.js} +0 -0
  134. /package/build/stubs/{index.d.ts → main.d.ts} +0 -0
  135. /package/build/stubs/{index.js → main.js} +0 -0
@@ -1,61 +0,0 @@
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 { Router, Server } from '../modules/http.js';
10
- import BodyParserMiddleware from '../modules/bodyparser/bodyparser_middleware.js';
11
- /**
12
- * Http Service provider binds the router and the HTTP server to
13
- * the container.
14
- */
15
- export default class HttpServiceProvider {
16
- app;
17
- constructor(app) {
18
- this.app = app;
19
- }
20
- /**
21
- * Registers the HTTP server with the container as a singleton
22
- */
23
- registerServer() {
24
- this.app.container.singleton(Server, async (resolver) => {
25
- const encryption = await resolver.make('encryption');
26
- const emitter = await resolver.make('emitter');
27
- const logger = await resolver.make('logger');
28
- const config = this.app.config.get('app.http');
29
- return new Server(this.app, encryption, emitter, logger, config);
30
- });
31
- this.app.container.alias('server', Server);
32
- }
33
- /**
34
- * Registers router with the container as a singleton
35
- */
36
- registerRouter() {
37
- this.app.container.singleton(Router, async (resolver) => {
38
- const server = await resolver.make('server');
39
- return server.getRouter();
40
- });
41
- this.app.container.alias('router', Router);
42
- }
43
- /**
44
- * Self construct bodyparser middleware class, since it needs
45
- * config that cannot be resolved by the container
46
- */
47
- registerBodyParserMiddleware() {
48
- this.app.container.bind(BodyParserMiddleware, () => {
49
- const config = this.app.config.get('bodyparser');
50
- return new BodyParserMiddleware(config);
51
- });
52
- }
53
- /**
54
- * Registers bindings
55
- */
56
- register() {
57
- this.registerServer();
58
- this.registerRouter();
59
- this.registerBodyParserMiddleware();
60
- }
61
- }
@@ -1,6 +0,0 @@
1
- import type { Repl } from '../../modules/repl.js';
2
- import { ApplicationService } from '../types.js';
3
- /**
4
- * Registers REPL methods
5
- */
6
- export declare function defineReplBindings(app: ApplicationService, repl: Repl): void;
@@ -1,78 +0,0 @@
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
- /**
10
- * Resolves a container binding and sets it on the REPL
11
- * context
12
- */
13
- async function resolveBindingForRepl(app, repl, binding) {
14
- repl.server.context[binding] = await app.container.make(binding);
15
- repl.notify(`Loaded "${binding}" service. You can access it using the "${repl.colors.underline(binding)}" variable`);
16
- }
17
- /**
18
- * Registers REPL methods
19
- */
20
- export function defineReplBindings(app, repl) {
21
- repl.addMethod('importDefault', (_, modulePath) => {
22
- return app.importDefault(modulePath);
23
- }, {
24
- description: 'Returns the default export for a module',
25
- });
26
- repl.addMethod('make', (_, service, runtimeValues) => {
27
- return app.container.make(service, runtimeValues);
28
- }, {
29
- description: 'Make class instance using "container.make" method',
30
- });
31
- repl.addMethod('loadApp', () => {
32
- return resolveBindingForRepl(app, repl, 'app');
33
- }, {
34
- description: 'Load "app" service in the REPL context',
35
- });
36
- repl.addMethod('loadEncryption', () => {
37
- return resolveBindingForRepl(app, repl, 'encryption');
38
- }, {
39
- description: 'Load "encryption" service in the REPL context',
40
- });
41
- repl.addMethod('loadHash', () => {
42
- return resolveBindingForRepl(app, repl, 'hash');
43
- }, {
44
- description: 'Load "hash" service in the REPL context',
45
- });
46
- repl.addMethod('loadRouter', () => {
47
- return resolveBindingForRepl(app, repl, 'router');
48
- }, {
49
- description: 'Load "router" service in the REPL context',
50
- });
51
- repl.addMethod('loadConfig', () => {
52
- return resolveBindingForRepl(app, repl, 'config');
53
- }, {
54
- description: 'Load "config" service in the REPL context',
55
- });
56
- repl.addMethod('loadTestUtils', () => {
57
- return resolveBindingForRepl(app, repl, 'testUtils');
58
- }, {
59
- description: 'Load "testUtils" service in the REPL context',
60
- });
61
- repl.addMethod('loadHelpers', async () => {
62
- const { default: isModule } = await import('../helpers/is.js');
63
- const { default: stringModule } = await import('../helpers/string.js');
64
- const { base64, cuid, fsReadAll, slash, parseImports } = await import('../helpers/main.js');
65
- repl.server.context.helpers = {
66
- string: stringModule,
67
- is: isModule,
68
- base64,
69
- cuid,
70
- fsReadAll,
71
- slash,
72
- parseImports,
73
- };
74
- repl.notify(`Loaded "helpers" module. You can access it using the "${repl.colors.underline('helpers')}" variable`);
75
- }, {
76
- description: 'Load "helpers" module in the REPL context',
77
- });
78
- }
File without changes
File without changes
File without changes
File without changes