@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
@@ -0,0 +1,53 @@
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
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
10
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
11
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
12
+ 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;
13
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
14
+ };
15
+ import { stubsRoot } from '../../stubs/main.js';
16
+ import { args, flags, BaseCommand } from '../../modules/ace/main.js';
17
+ /**
18
+ * Make a new VineJS validator
19
+ */
20
+ export default class MakeValidator extends BaseCommand {
21
+ static commandName = 'make:validator';
22
+ static description = 'Create a new file to define VineJS validators';
23
+ /**
24
+ * The stub to use for generating the validator
25
+ */
26
+ stubPath = 'make/validator/main.stub';
27
+ /**
28
+ * Preparing the command state
29
+ */
30
+ async prepare() {
31
+ /**
32
+ * Use resource stub
33
+ */
34
+ if (this.resource) {
35
+ this.stubPath = 'make/validator/resource.stub';
36
+ }
37
+ }
38
+ async run() {
39
+ const codemods = await this.createCodemods();
40
+ await codemods.makeUsingStub(stubsRoot, this.stubPath, {
41
+ flags: this.parsed.flags,
42
+ entity: this.app.generators.createEntity(this.name),
43
+ });
44
+ }
45
+ }
46
+ __decorate([
47
+ args.string({ description: 'Name of the validator file' })
48
+ ], MakeValidator.prototype, "name", void 0);
49
+ __decorate([
50
+ flags.boolean({
51
+ description: 'Create a file with pre-defined validators for create and update actions',
52
+ })
53
+ ], MakeValidator.prototype, "resource", void 0);
@@ -0,0 +1,14 @@
1
+ import { BaseCommand } from '../../modules/ace/main.js';
2
+ /**
3
+ * Make a new EdgeJS template file
4
+ */
5
+ export default class MakeView extends BaseCommand {
6
+ static commandName: string;
7
+ static description: string;
8
+ name: string;
9
+ /**
10
+ * The stub to use for generating the template
11
+ */
12
+ protected stubPath: string;
13
+ run(): Promise<void>;
14
+ }
@@ -0,0 +1,37 @@
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
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
10
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
11
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
12
+ 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;
13
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
14
+ };
15
+ import { stubsRoot } from '../../stubs/main.js';
16
+ import { args, BaseCommand } from '../../modules/ace/main.js';
17
+ /**
18
+ * Make a new EdgeJS template file
19
+ */
20
+ export default class MakeView extends BaseCommand {
21
+ static commandName = 'make:view';
22
+ static description = 'Create a new Edge.js template file';
23
+ /**
24
+ * The stub to use for generating the template
25
+ */
26
+ stubPath = 'make/view/main.stub';
27
+ async run() {
28
+ const codemods = await this.createCodemods();
29
+ await codemods.makeUsingStub(stubsRoot, this.stubPath, {
30
+ flags: this.parsed.flags,
31
+ entity: this.app.generators.createEntity(this.name),
32
+ });
33
+ }
34
+ }
35
+ __decorate([
36
+ args.string({ description: 'Name of the template' })
37
+ ], MakeView.prototype, "name", void 0);
@@ -56,13 +56,13 @@ export default class Serve extends BaseCommand {
56
56
  const assetsBundler = await detectAssetsBundler(this.app);
57
57
  return assetsBundler
58
58
  ? {
59
- serve: this.assets === false ? false : true,
59
+ enabled: this.assets === false ? false : true,
60
60
  driver: assetsBundler.name,
61
61
  cmd: assetsBundler.devServer.command,
62
62
  args: (assetsBundler.devServer.args || []).concat(this.assetsArgs || []),
63
63
  }
64
64
  : {
65
- serve: false,
65
+ enabled: false,
66
66
  };
67
67
  }
68
68
  /**
@@ -119,10 +119,13 @@ export default class Serve extends BaseCommand {
119
119
  }
120
120
  }
121
121
  __decorate([
122
- flags.boolean({ description: 'Watch filesystem and restart the HTTP server on file change' })
122
+ flags.boolean({
123
+ description: 'Watch filesystem and restart the HTTP server on file change',
124
+ alias: 'w',
125
+ })
123
126
  ], Serve.prototype, "watch", void 0);
124
127
  __decorate([
125
- flags.boolean({ description: 'Use polling to detect filesystem changes' })
128
+ flags.boolean({ description: 'Use polling to detect filesystem changes', alias: 'p' })
126
129
  ], Serve.prototype, "poll", void 0);
127
130
  __decorate([
128
131
  flags.boolean({
@@ -67,13 +67,13 @@ export default class Test extends BaseCommand {
67
67
  const assetsBundler = await detectAssetsBundler(this.app);
68
68
  return assetsBundler
69
69
  ? {
70
- serve: this.assets === false ? false : true,
70
+ enabled: this.assets === false ? false : true,
71
71
  driver: assetsBundler.name,
72
72
  cmd: assetsBundler.devServer.command,
73
73
  args: (assetsBundler.devServer.args || []).concat(this.assetsArgs || []),
74
74
  }
75
75
  : {
76
- serve: false,
76
+ enabled: false,
77
77
  };
78
78
  }
79
79
  /**
@@ -1,4 +1,4 @@
1
- /// <reference types="@types/node" resolution-mode="require"/>
1
+ /// <reference types="node" resolution-mode="require"/>
2
2
  import { Ignitor } from '../../src/ignitor/main.js';
3
3
  import type { IgnitorOptions } from '../../src/types.js';
4
4
  import type { Kernel } from '../../modules/ace/kernel.js';
@@ -7,5 +7,5 @@ import type { Kernel } from '../../modules/ace/kernel.js';
7
7
  */
8
8
  export declare class AceFactory {
9
9
  make(ignitor: Ignitor): Promise<Kernel>;
10
- make(appRoot: URL, options: IgnitorOptions): Promise<Kernel>;
10
+ make(appRoot: URL, options?: IgnitorOptions): Promise<Kernel>;
11
11
  }
@@ -1,4 +1,4 @@
1
- /// <reference types="@types/node" resolution-mode="require"/>
1
+ /// <reference types="node" resolution-mode="require"/>
2
2
  import { Ignitor } from '../../src/ignitor/main.js';
3
3
  import type { ApplicationService, IgnitorOptions } from '../../src/types.js';
4
4
  type FactoryParameters = {
@@ -30,6 +30,6 @@ export declare class IgnitorFactory {
30
30
  /**
31
31
  * Create ignitor instance
32
32
  */
33
- create(appRoot: URL, options: IgnitorOptions): Ignitor;
33
+ create(appRoot: URL, options?: IgnitorOptions): Ignitor;
34
34
  }
35
35
  export {};
@@ -7,7 +7,8 @@
7
7
  * file that was distributed with this source code.
8
8
  */
9
9
  import { Ignitor } from '../../src/ignitor/main.js';
10
- import { defineConfig as defineHttpConfig } from '../../modules/http.js';
10
+ import { drivers } from '../../modules/hash/define_config.js';
11
+ import { defineConfig as defineHttpConfig } from '../../modules/http/main.js';
11
12
  import { defineConfig as defineLoggerConfig } from '../../modules/logger.js';
12
13
  import { defineConfig as defineHashConfig } from '../../modules/hash/main.js';
13
14
  import { defineConfig as defineBodyParserConfig } from '../../modules/bodyparser/main.js';
@@ -32,12 +33,12 @@ export class IgnitorFactory {
32
33
  * Merge core providers with user defined providers
33
34
  */
34
35
  #mergeCoreProviders(providers) {
35
- return [
36
- '@adonisjs/core/providers/app_provider',
37
- '@adonisjs/core/providers/hash_provider',
38
- '@adonisjs/core/providers/http_provider',
39
- '@adonisjs/core/providers/repl_provider',
40
- ].concat(providers || []);
36
+ const coreProviders = [
37
+ () => import('@adonisjs/core/providers/app_provider'),
38
+ () => import('@adonisjs/core/providers/hash_provider'),
39
+ () => import('@adonisjs/core/providers/repl_provider'),
40
+ ];
41
+ return coreProviders.concat(providers || []);
41
42
  }
42
43
  /**
43
44
  * Merge custom factory parameters
@@ -74,9 +75,7 @@ export class IgnitorFactory {
74
75
  hash: defineHashConfig({
75
76
  default: 'scrypt',
76
77
  list: {
77
- scrypt: {
78
- driver: 'scrypt',
79
- },
78
+ scrypt: drivers.scrypt({}),
80
79
  },
81
80
  }),
82
81
  logger: defineLoggerConfig({
@@ -1,4 +1,3 @@
1
1
  export { AceFactory } from './ace.js';
2
- export { StubsFactory } from '../stubs.js';
3
2
  export { IgnitorFactory } from './ignitor.js';
4
3
  export { TestUtilsFactory } from './test_utils.js';
@@ -7,6 +7,5 @@
7
7
  * file that was distributed with this source code.
8
8
  */
9
9
  export { AceFactory } from './ace.js';
10
- export { StubsFactory } from '../stubs.js';
11
10
  export { IgnitorFactory } from './ignitor.js';
12
11
  export { TestUtilsFactory } from './test_utils.js';
@@ -1,4 +1,4 @@
1
- /// <reference types="@types/node" resolution-mode="require"/>
1
+ /// <reference types="node" resolution-mode="require"/>
2
2
  import { Ignitor } from '../../index.js';
3
3
  import type { IgnitorOptions } from '../../src/types.js';
4
4
  import { TestUtils } from '../../src/test_utils/main.js';
@@ -7,5 +7,5 @@ import { TestUtils } from '../../src/test_utils/main.js';
7
7
  */
8
8
  export declare class TestUtilsFactory {
9
9
  create(ignitor: Ignitor): TestUtils;
10
- create(appRoot: URL, options: IgnitorOptions): TestUtils;
10
+ create(appRoot: URL, options?: IgnitorOptions): TestUtils;
11
11
  }
@@ -16,10 +16,10 @@ export declare class StubsFactory {
16
16
  * Prepares a stub
17
17
  */
18
18
  prepare(stubPath: string, data: Record<string, any>): Promise<{
19
- contents: any;
19
+ contents: string;
20
20
  destination: any;
21
21
  force: any;
22
- attributes: any;
22
+ attributes: Record<string, any>;
23
23
  }>;
24
24
  }
25
25
  export {};
@@ -18,7 +18,7 @@ export class StubsFactory {
18
18
  * Returns an instance of application
19
19
  */
20
20
  #getApp() {
21
- return this.#parameters.app || new AppFactory().create(new URL('./', import.meta.url), () => { });
21
+ return this.#parameters.app || new AppFactory().create(new URL('./', import.meta.url));
22
22
  }
23
23
  /**
24
24
  * Merge custom factory parameters
@@ -33,7 +33,8 @@ export class StubsFactory {
33
33
  async prepare(stubPath, data) {
34
34
  const app = this.#getApp();
35
35
  await app.init();
36
- const stub = await app.stubs.build(stubPath, {
36
+ const stubs = await app.stubs.create();
37
+ const stub = await stubs.build(stubPath, {
37
38
  source: stubsRoot,
38
39
  });
39
40
  return stub.prepare(data);
package/build/index.d.ts CHANGED
@@ -1,145 +1,16 @@
1
- /// <reference types="@types/node" resolution-mode="require"/>
2
- export { stubsRoot } from './stubs/index.js';
1
+ import { errors as aceErrors } from '@adonisjs/ace';
2
+ import { errors as envErrors } from '@adonisjs/env';
3
+ import { errors as appErrors } from '@adonisjs/application';
4
+ import { errors as encryptionErrors } from '@adonisjs/encryption';
5
+ import { errors as httpServerErrors } from '@adonisjs/http-server';
6
+ export { stubsRoot } from './stubs/main.js';
3
7
  export { inject } from './modules/container.js';
4
8
  export { Ignitor } from './src/ignitor/main.js';
5
- export declare const errors: {
6
- E_INVALID_ENV_VARIABLES: {
7
- new (message?: string | undefined, options?: (ErrorOptions & {
8
- code?: string | undefined;
9
- status?: number | undefined;
10
- }) | undefined): {
11
- help: string;
12
- name: string;
13
- code?: string | undefined;
14
- status: number;
15
- toString(): string;
16
- message: string;
17
- stack?: string | undefined;
18
- cause?: unknown;
19
- readonly [Symbol.toStringTag]: string;
20
- };
21
- message: string;
22
- code: string;
23
- help?: string | undefined;
24
- status?: number | undefined;
25
- captureStackTrace(targetObject: object, constructorOpt?: Function | undefined): void;
26
- prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
27
- stackTraceLimit: number;
28
- };
29
- E_MISSING_COMMAND_NAME: new (args: [command: string], options?: ErrorOptions | undefined) => import("@poppinss/utils").Exception;
30
- E_COMMAND_NOT_FOUND: {
31
- new (args: [command: string]): {
32
- commandName: string;
33
- name: string;
34
- help?: string | undefined;
35
- code?: string | undefined;
36
- status: number;
37
- toString(): string;
38
- message: string;
39
- stack?: string | undefined;
40
- cause?: unknown;
41
- readonly [Symbol.toStringTag]: string;
42
- };
43
- help?: string | undefined;
44
- code?: string | undefined;
45
- status?: number | undefined;
46
- message?: string | undefined;
47
- captureStackTrace(targetObject: object, constructorOpt?: Function | undefined): void;
48
- prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
49
- stackTraceLimit: number;
50
- };
51
- E_MISSING_FLAG: new (args: [flag: string], options?: ErrorOptions | undefined) => import("@poppinss/utils").Exception;
52
- E_MISSING_FLAG_VALUE: new (args: [flag: string], options?: ErrorOptions | undefined) => import("@poppinss/utils").Exception;
53
- E_MISSING_ARG: new (args: [arg: string], options?: ErrorOptions | undefined) => import("@poppinss/utils").Exception;
54
- E_MISSING_ARG_VALUE: new (args: [arg: string], options?: ErrorOptions | undefined) => import("@poppinss/utils").Exception;
55
- E_UNKNOWN_FLAG: new (args: [flag: string], options?: ErrorOptions | undefined) => import("@poppinss/utils").Exception;
56
- E_INVALID_FLAG: new (args: [flag: string, expectedDataType: string], options?: ErrorOptions | undefined) => import("@poppinss/utils").Exception;
57
- E_MISSING_METAFILE_PATTERN: new (args: [fileProperty: string], options?: ErrorOptions | undefined) => import("@poppinss/utils").Exception;
58
- E_MISSING_PRELOAD_FILE: new (args: [preloadProperty: string], options?: ErrorOptions | undefined) => import("@poppinss/utils").Exception;
59
- E_MISSING_PROVIDER_FILE: new (args: [preloadProperty: string], options?: ErrorOptions | undefined) => import("@poppinss/utils").Exception;
60
- E_MISSING_SUITE_NAME: new (args: [suiteProperty: string], options?: ErrorOptions | undefined) => import("@poppinss/utils").Exception;
61
- E_MISSING_SUITE_FILES: new (args: [suiteProperty: string], options?: ErrorOptions | undefined) => import("@poppinss/utils").Exception;
62
- E_MISSING_BUNDLER_DEV_COMMAND: new (args?: any, options?: ErrorOptions | undefined) => import("@poppinss/utils").Exception;
63
- E_MISSING_BUNDLER_BUILD_COMMAND: new (args?: any, options?: ErrorOptions | undefined) => import("@poppinss/utils").Exception;
64
- E_MISSING_BUNDLER_NAME: new (args?: any, options?: ErrorOptions | undefined) => import("@poppinss/utils").Exception;
65
- E_ROUTE_NOT_FOUND: new (args: [method: string, url: string], options?: ErrorOptions | undefined) => import("@poppinss/utils").Exception;
66
- E_CANNOT_LOOKUP_ROUTE: new (args: [routeIdentifier: string], options?: ErrorOptions | undefined) => import("@poppinss/utils").Exception;
67
- E_HTTP_EXCEPTION: {
68
- new (message?: string | undefined, options?: (ErrorOptions & {
69
- code?: string | undefined;
70
- status?: number | undefined;
71
- }) | undefined): {
72
- body: any;
73
- name: string;
74
- help?: string | undefined;
75
- code?: string | undefined;
76
- status: number;
77
- toString(): string;
78
- message: string;
79
- stack?: string | undefined;
80
- cause?: unknown;
81
- readonly [Symbol.toStringTag]: string;
82
- };
83
- code: string;
84
- invoke(body: any, status: number, code?: string | undefined): {
85
- body: any;
86
- name: string;
87
- help?: string | undefined;
88
- code?: string | undefined;
89
- status: number;
90
- toString(): string;
91
- message: string;
92
- stack?: string | undefined;
93
- cause?: unknown;
94
- readonly [Symbol.toStringTag]: string;
95
- };
96
- help?: string | undefined;
97
- status?: number | undefined;
98
- message?: string | undefined;
99
- captureStackTrace(targetObject: object, constructorOpt?: Function | undefined): void;
100
- prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
101
- stackTraceLimit: number;
102
- };
103
- E_HTTP_REQUEST_ABORTED: {
104
- new (message?: string | undefined, options?: (ErrorOptions & {
105
- code?: string | undefined;
106
- status?: number | undefined;
107
- }) | undefined): {
108
- handle(error: any, ctx: import("@adonisjs/http-server").HttpContext): void;
109
- body: any;
110
- name: string;
111
- help?: string | undefined;
112
- code?: string | undefined;
113
- status: number;
114
- toString(): string;
115
- message: string;
116
- stack?: string | undefined;
117
- cause?: unknown;
118
- readonly [Symbol.toStringTag]: string;
119
- };
120
- code: string;
121
- invoke(body: any, status: number, code?: string | undefined): {
122
- body: any;
123
- name: string;
124
- help?: string | undefined;
125
- code?: string | undefined;
126
- status: number;
127
- toString(): string;
128
- message: string;
129
- stack?: string | undefined;
130
- cause?: unknown;
131
- readonly [Symbol.toStringTag]: string;
132
- };
133
- help?: string | undefined;
134
- status?: number | undefined;
135
- message?: string | undefined;
136
- captureStackTrace(targetObject: object, constructorOpt?: Function | undefined): void;
137
- prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
138
- stackTraceLimit: number;
139
- };
140
- E_INSECURE_APP_KEY: new (args?: any, options?: ErrorOptions | undefined) => import("@poppinss/utils").Exception;
141
- E_MISSING_APP_KEY: new (args?: any, options?: ErrorOptions | undefined) => import("@poppinss/utils").Exception;
142
- };
9
+ export { configProvider } from './src/config_provider.js';
10
+ /**
11
+ * Aggregated errors from all modules.
12
+ */
13
+ export declare const errors: typeof encryptionErrors & typeof httpServerErrors & typeof appErrors & typeof aceErrors & typeof envErrors;
143
14
  /**
144
15
  * Pretty prints an error with colorful output using
145
16
  * Youch terminal
package/build/index.js CHANGED
@@ -11,9 +11,13 @@ import { errors as envErrors } from '@adonisjs/env';
11
11
  import { errors as appErrors } from '@adonisjs/application';
12
12
  import { errors as encryptionErrors } from '@adonisjs/encryption';
13
13
  import { errors as httpServerErrors } from '@adonisjs/http-server';
14
- export { stubsRoot } from './stubs/index.js';
14
+ export { stubsRoot } from './stubs/main.js';
15
15
  export { inject } from './modules/container.js';
16
16
  export { Ignitor } from './src/ignitor/main.js';
17
+ export { configProvider } from './src/config_provider.js';
18
+ /**
19
+ * Aggregated errors from all modules.
20
+ */
17
21
  export const errors = {
18
22
  ...encryptionErrors,
19
23
  ...httpServerErrors,
@@ -0,0 +1,93 @@
1
+ /// <reference types="node" resolution-mode="require"/>
2
+ import { EventEmitter } from 'node:events';
3
+ import type { UIPrimitives } from '@adonisjs/ace/types';
4
+ import type { CodeTransformer } from '@adonisjs/assembler/code_transformer';
5
+ import type { MiddlewareNode, EnvValidationNode, BouncerPolicyNode } from '@adonisjs/assembler/types';
6
+ import type { Application } from '../app.js';
7
+ /**
8
+ * Codemods to modify AdonisJS source files. The codemod APIs relies on
9
+ * "@adonisjs/assembler" package and it must be installed as a dependency
10
+ * inside user application.
11
+ */
12
+ export declare class Codemods extends EventEmitter {
13
+ #private;
14
+ /**
15
+ * Overwrite existing files when generating files
16
+ * from stubs
17
+ */
18
+ overwriteExisting: boolean;
19
+ /**
20
+ * Display verbose logs for package installation
21
+ */
22
+ verboseInstallOutput: boolean;
23
+ constructor(app: Application<any>, cliLogger: UIPrimitives['logger']);
24
+ /**
25
+ * Define one or more environment variables
26
+ */
27
+ defineEnvVariables(environmentVariables: Record<string, number | string | boolean>): Promise<void>;
28
+ /**
29
+ * Define validations for the environment variables
30
+ */
31
+ defineEnvValidations(validations: EnvValidationNode): Promise<void>;
32
+ /**
33
+ * Define validations for the environment variables
34
+ */
35
+ registerMiddleware(stack: 'server' | 'router' | 'named', middleware: MiddlewareNode[]): Promise<void>;
36
+ /**
37
+ * Register bouncer policies to the list of policies
38
+ * collection exported from the "app/policies/main.ts"
39
+ * file.
40
+ */
41
+ registerPolicies(policies: BouncerPolicyNode[]): Promise<void>;
42
+ /**
43
+ * Update RCFile
44
+ */
45
+ updateRcFile(...params: Parameters<CodeTransformer['updateRcFile']>): Promise<void>;
46
+ /**
47
+ * Generats the stub
48
+ */
49
+ makeUsingStub(stubsRoot: string, stubPath: string, stubState: Record<string, any>): Promise<{
50
+ relativeFileName: string;
51
+ contents: string;
52
+ destination: any;
53
+ attributes: Record<string, any>;
54
+ status: "created";
55
+ skipReason: null;
56
+ } | {
57
+ relativeFileName: string;
58
+ contents: string;
59
+ destination: any; /**
60
+ * Reference to lazily imported assembler code transformer
61
+ */
62
+ attributes: Record<string, any>;
63
+ status: "force_created";
64
+ skipReason: null;
65
+ } | {
66
+ relativeFileName: string;
67
+ contents: string;
68
+ destination: any;
69
+ attributes: Record<string, any>;
70
+ status: "skipped";
71
+ skipReason: string;
72
+ }>;
73
+ /**
74
+ * Install packages using the correct package manager
75
+ * You can specify version of each package by setting it in the
76
+ * name like :
77
+ *
78
+ * ```
79
+ * this.installPackages(['@adonisjs/lucid@next', '@adonisjs/auth@3.0.0'])
80
+ * ```
81
+ */
82
+ installPackages(packages: {
83
+ name: string;
84
+ isDevDependency: boolean;
85
+ }[]): Promise<void>;
86
+ /**
87
+ * List the packages one should install before using the packages
88
+ */
89
+ listPackagesToInstall(packages: {
90
+ name: string;
91
+ isDevDependency: boolean;
92
+ }[]): Promise<void>;
93
+ }