@adonisjs/core 6.19.0 → 7.0.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/commands/add.d.ts +36 -5
- package/build/commands/add.js +24 -60
- package/build/commands/build.d.ts +23 -3
- package/build/commands/build.js +22 -36
- package/build/commands/commands.json +1 -1
- package/build/commands/configure.d.ts +35 -12
- package/build/commands/configure.js +39 -12
- package/build/commands/eject.d.ts +28 -3
- package/build/commands/eject.js +24 -5
- package/build/commands/env/add.d.ts +41 -4
- package/build/commands/env/add.js +32 -5
- package/build/commands/generate_key.d.ts +20 -1
- package/build/commands/generate_key.js +14 -1
- package/build/commands/inspect_rcfile.d.ts +20 -2
- package/build/commands/inspect_rcfile.js +20 -2
- package/build/commands/list/routes.d.ts +33 -11
- package/build/commands/list/routes.js +28 -5
- package/build/commands/make/command.d.ts +26 -3
- package/build/commands/make/command.js +25 -5
- package/build/commands/make/controller.d.ts +35 -2
- package/build/commands/make/controller.js +20 -2
- package/build/commands/make/event.d.ts +30 -4
- package/build/commands/make/event.js +27 -4
- package/build/commands/make/exception.d.ts +30 -4
- package/build/commands/make/exception.js +27 -4
- package/build/commands/make/listener.d.ts +38 -5
- package/build/commands/make/listener.js +32 -5
- package/build/commands/make/middleware.d.ts +25 -2
- package/build/commands/make/middleware.js +21 -4
- package/build/commands/make/preload.d.ts +31 -4
- package/build/commands/make/preload.js +28 -8
- package/build/commands/make/provider.d.ts +32 -3
- package/build/commands/make/provider.js +29 -7
- package/build/commands/make/service.d.ts +21 -2
- package/build/commands/make/service.js +18 -2
- package/build/commands/make/test.d.ts +27 -4
- package/build/commands/make/test.js +36 -8
- package/build/commands/make/transformer.d.ts +43 -0
- package/build/commands/make/transformer.js +65 -0
- package/build/commands/make/validator.d.ts +36 -5
- package/build/commands/make/validator.js +30 -5
- package/build/commands/make/view.d.ts +26 -3
- package/build/commands/make/view.js +24 -4
- package/build/commands/repl.d.ts +24 -4
- package/build/commands/repl.js +23 -3
- package/build/commands/serve.d.ts +38 -4
- package/build/commands/serve.js +34 -43
- package/build/commands/test.d.ts +68 -7
- package/build/commands/test.js +39 -37
- package/build/factories/core/ace.d.ts +31 -4
- package/build/factories/core/ace.js +20 -4
- package/build/factories/core/ignitor.d.ts +80 -9
- package/build/factories/core/ignitor.js +84 -13
- package/build/factories/core/main.d.ts +3 -3
- package/build/factories/core/main.js +3 -3
- package/build/factories/core/test_utils.d.ts +32 -4
- package/build/factories/core/test_utils.js +21 -4
- package/build/factories/stubs.d.ts +54 -5
- package/build/factories/stubs.js +55 -6
- package/build/index.d.ts +5 -4
- package/build/index.js +13 -9
- package/build/modules/ace/codemods.d.ts +71 -11
- package/build/modules/ace/codemods.js +90 -22
- package/build/modules/ace/commands.d.ts +48 -13
- package/build/modules/ace/commands.js +45 -10
- package/build/modules/ace/create_kernel.d.ts +19 -8
- package/build/modules/ace/create_kernel.js +19 -8
- package/build/modules/ace/kernel.d.ts +18 -4
- package/build/modules/ace/kernel.js +17 -3
- package/build/modules/ace/main.d.ts +3 -3
- package/build/modules/ace/main.js +3 -3
- package/build/modules/dumper/define_config.d.ts +25 -4
- package/build/modules/dumper/define_config.js +23 -2
- package/build/modules/dumper/dumper.d.ts +82 -12
- package/build/modules/dumper/dumper.js +82 -12
- package/build/modules/dumper/errors.d.ts +31 -10
- package/build/modules/dumper/errors.js +28 -7
- package/build/modules/dumper/main.d.ts +3 -3
- package/build/modules/dumper/main.js +3 -3
- package/build/modules/dumper/plugins/edge.d.ts +1 -1
- package/build/modules/hash/define_config.d.ts +53 -8
- package/build/modules/hash/define_config.js +51 -6
- package/build/modules/hash/main.d.ts +1 -1
- package/build/modules/hash/main.js +1 -1
- package/build/modules/http/main.d.ts +1 -1
- package/build/modules/http/main.js +1 -1
- package/build/modules/http/request_validator.d.ts +36 -9
- package/build/modules/http/request_validator.js +32 -5
- package/build/modules/transformers/main.d.ts +1 -0
- package/build/modules/transformers/main.js +9 -0
- package/build/providers/app_provider.d.ts +173 -1
- package/build/providers/app_provider.js +204 -8
- package/build/providers/edge_provider.d.ts +31 -2
- package/build/providers/edge_provider.js +31 -2
- package/build/providers/hash_provider.d.ts +38 -1
- package/build/providers/hash_provider.js +40 -3
- package/build/providers/repl_provider.d.ts +40 -1
- package/build/providers/repl_provider.js +52 -2
- package/build/providers/vinejs_provider.d.ts +32 -5
- package/build/providers/vinejs_provider.js +31 -4
- package/build/services/ace.d.ts +1 -1
- package/build/services/ace.js +1 -1
- package/build/services/app.d.ts +1 -1
- package/build/services/config.d.ts +1 -1
- package/build/services/config.js +1 -1
- package/build/services/dumper.js +1 -1
- package/build/services/emitter.d.ts +1 -1
- package/build/services/emitter.js +1 -1
- package/build/services/encryption.d.ts +1 -1
- package/build/services/encryption.js +1 -1
- package/build/services/hash.d.ts +1 -1
- package/build/services/hash.js +1 -1
- package/build/services/logger.d.ts +1 -1
- package/build/services/logger.js +1 -1
- package/build/services/repl.d.ts +1 -1
- package/build/services/repl.js +1 -1
- package/build/services/router.d.ts +1 -1
- package/build/services/router.js +1 -1
- package/build/services/server.d.ts +1 -1
- package/build/services/server.js +1 -1
- package/build/services/test_utils.d.ts +1 -1
- package/build/services/test_utils.js +1 -1
- package/build/services/url_builder.d.ts +4 -0
- package/build/services/url_builder.js +21 -0
- package/build/src/assembler_hooks/index_entities.d.ts +37 -0
- package/build/src/assembler_hooks/index_entities.js +106 -0
- package/build/src/cli_formatters/routes_list.d.ts +24 -12
- package/build/src/cli_formatters/routes_list.js +43 -46
- package/build/src/config_provider.d.ts +48 -3
- package/build/src/config_provider.js +47 -2
- package/build/src/debug.d.ts +15 -0
- package/build/src/debug.js +15 -0
- package/build/src/exceptions.d.ts +41 -1
- package/build/src/exceptions.js +41 -1
- package/build/src/helpers/assert.d.ts +47 -1
- package/build/src/helpers/assert.js +47 -1
- package/build/src/helpers/is.d.ts +21 -0
- package/build/src/helpers/is.js +21 -0
- package/build/src/helpers/main.d.ts +48 -5
- package/build/src/helpers/main.js +48 -5
- package/build/src/helpers/string.d.ts +89 -9
- package/build/src/helpers/string.js +21 -2
- package/build/src/helpers/types.d.ts +97 -2
- package/build/src/helpers/types.js +96 -2
- package/build/src/helpers/verification_token.d.ts +22 -1
- package/build/src/helpers/verification_token.js +24 -2
- package/build/src/ignitor/ace.d.ts +23 -3
- package/build/src/ignitor/ace.js +21 -1
- package/build/src/ignitor/http.d.ts +16 -3
- package/build/src/ignitor/http.js +16 -3
- package/build/src/ignitor/main.d.ts +29 -6
- package/build/src/ignitor/main.js +30 -7
- package/build/src/ignitor/test.d.ts +26 -3
- package/build/src/ignitor/test.js +24 -1
- package/build/src/test_utils/http.d.ts +19 -3
- package/build/src/test_utils/http.js +24 -3
- package/build/src/test_utils/main.d.ts +22 -4
- package/build/src/test_utils/main.js +21 -3
- package/build/src/types.d.ts +283 -26
- package/build/src/utils.d.ts +60 -0
- package/build/src/utils.js +104 -0
- package/build/src/vine.d.ts +24 -1
- package/build/src/vine.js +27 -1
- package/build/stubs/main.js +1 -2
- package/build/stubs/make/transformer/main.stub +18 -0
- package/build/toolkit/main.js +1 -1
- package/build/types/common.d.ts +1 -0
- package/build/types/common.js +9 -0
- package/build/types/helpers.d.ts +2 -1
- package/build/types/http.d.ts +1 -0
- package/build/types/transformers.d.ts +1 -0
- package/build/types/transformers.js +9 -0
- package/package.json +55 -52
- package/build/src/helpers/parse_binding_reference.d.ts +0 -45
- package/build/src/helpers/parse_binding_reference.js +0 -83
- package/build/src/internal_helpers.d.ts +0 -15
- package/build/src/internal_helpers.js +0 -63
package/build/commands/add.d.ts
CHANGED
|
@@ -1,23 +1,54 @@
|
|
|
1
|
-
import { CommandOptions } from '../types/ace.
|
|
2
|
-
import { BaseCommand } from '../modules/ace/main.
|
|
3
|
-
|
|
1
|
+
import { type CommandOptions } from '../types/ace.ts';
|
|
2
|
+
import { BaseCommand } from '../modules/ace/main.ts';
|
|
3
|
+
import { type SupportedPackageManager } from '@adonisjs/assembler/types';
|
|
4
4
|
/**
|
|
5
5
|
* The install command is used to `npm install` and `node ace configure` a new package
|
|
6
6
|
* in one go.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```
|
|
10
|
+
* ace add @adonisjs/lucid
|
|
11
|
+
* ace add @adonisjs/session --dev
|
|
12
|
+
* ace add vinejs --force
|
|
13
|
+
* ace add edge --package-manager=pnpm
|
|
14
|
+
* ```
|
|
7
15
|
*/
|
|
8
16
|
export default class Add extends BaseCommand {
|
|
9
17
|
#private;
|
|
18
|
+
/**
|
|
19
|
+
* The command name
|
|
20
|
+
*/
|
|
10
21
|
static commandName: string;
|
|
22
|
+
/**
|
|
23
|
+
* The command description
|
|
24
|
+
*/
|
|
11
25
|
static description: string;
|
|
26
|
+
/**
|
|
27
|
+
* Command options configuration
|
|
28
|
+
*/
|
|
12
29
|
static options: CommandOptions;
|
|
30
|
+
/**
|
|
31
|
+
* Package name to install and configure
|
|
32
|
+
*/
|
|
13
33
|
name: string;
|
|
34
|
+
/**
|
|
35
|
+
* Display logs in verbose mode
|
|
36
|
+
*/
|
|
14
37
|
verbose?: boolean;
|
|
15
|
-
|
|
38
|
+
/**
|
|
39
|
+
* Define the package manager you want to use
|
|
40
|
+
*/
|
|
41
|
+
packageManager?: SupportedPackageManager;
|
|
42
|
+
/**
|
|
43
|
+
* Should we install the package as a dev dependency
|
|
44
|
+
*/
|
|
16
45
|
dev?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Forcefully overwrite existing files
|
|
48
|
+
*/
|
|
17
49
|
force?: boolean;
|
|
18
50
|
/**
|
|
19
51
|
* Run method is invoked by ace automatically
|
|
20
52
|
*/
|
|
21
53
|
run(): Promise<void>;
|
|
22
54
|
}
|
|
23
|
-
export {};
|
package/build/commands/add.js
CHANGED
|
@@ -12,29 +12,34 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
12
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
13
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
14
14
|
};
|
|
15
|
-
import {
|
|
16
|
-
import { args, BaseCommand, flags } from '../modules/ace/main.js';
|
|
17
|
-
const KNOWN_PACKAGE_MANAGERS = ['npm', 'pnpm', 'bun', 'yarn', 'yarn@berry', 'pnpm@6'];
|
|
15
|
+
import { args, BaseCommand, flags } from "../modules/ace/main.js";
|
|
18
16
|
/**
|
|
19
17
|
* The install command is used to `npm install` and `node ace configure` a new package
|
|
20
18
|
* in one go.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```
|
|
22
|
+
* ace add @adonisjs/lucid
|
|
23
|
+
* ace add @adonisjs/session --dev
|
|
24
|
+
* ace add vinejs --force
|
|
25
|
+
* ace add edge --package-manager=pnpm
|
|
26
|
+
* ```
|
|
21
27
|
*/
|
|
22
28
|
export default class Add extends BaseCommand {
|
|
29
|
+
/**
|
|
30
|
+
* The command name
|
|
31
|
+
*/
|
|
23
32
|
static commandName = 'add';
|
|
33
|
+
/**
|
|
34
|
+
* The command description
|
|
35
|
+
*/
|
|
24
36
|
static description = 'Install and configure a package';
|
|
37
|
+
/**
|
|
38
|
+
* Command options configuration
|
|
39
|
+
*/
|
|
25
40
|
static options = {
|
|
26
41
|
allowUnknownFlags: true,
|
|
27
42
|
};
|
|
28
|
-
/**
|
|
29
|
-
* Detect the package manager to use
|
|
30
|
-
*/
|
|
31
|
-
async #getPackageManager() {
|
|
32
|
-
const packageManager = this.packageManager || (await detectPackageManager(this.app.makePath())) || 'npm';
|
|
33
|
-
if (KNOWN_PACKAGE_MANAGERS.some((knownPackageManager) => knownPackageManager === packageManager)) {
|
|
34
|
-
return packageManager;
|
|
35
|
-
}
|
|
36
|
-
throw new Error('Invalid package manager. Must be one of npm, pnpm, bun or yarn');
|
|
37
|
-
}
|
|
38
43
|
/**
|
|
39
44
|
* Configure the package by delegating the work to the `node ace configure` command
|
|
40
45
|
*/
|
|
@@ -53,40 +58,10 @@ export default class Add extends BaseCommand {
|
|
|
53
58
|
].filter(Boolean);
|
|
54
59
|
return await this.kernel.exec('configure', configureArgs);
|
|
55
60
|
}
|
|
56
|
-
/**
|
|
57
|
-
* Install the package using the selected package manager
|
|
58
|
-
*/
|
|
59
|
-
async #installPackage(npmPackageName) {
|
|
60
|
-
const colors = this.colors;
|
|
61
|
-
const spinner = this.logger
|
|
62
|
-
.await(`installing ${colors.green(this.name)} using ${colors.grey(this.packageManager)}`)
|
|
63
|
-
.start();
|
|
64
|
-
spinner.start();
|
|
65
|
-
try {
|
|
66
|
-
await installPackage(npmPackageName, {
|
|
67
|
-
dev: this.dev,
|
|
68
|
-
silent: this.verbose === true ? false : true,
|
|
69
|
-
cwd: this.app.makePath(),
|
|
70
|
-
packageManager: this.packageManager,
|
|
71
|
-
});
|
|
72
|
-
spinner.update('package installed successfully');
|
|
73
|
-
spinner.stop();
|
|
74
|
-
return true;
|
|
75
|
-
}
|
|
76
|
-
catch (error) {
|
|
77
|
-
spinner.update('unable to install the package');
|
|
78
|
-
spinner.stop();
|
|
79
|
-
this.logger.fatal(error);
|
|
80
|
-
this.exitCode = 1;
|
|
81
|
-
return false;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
61
|
/**
|
|
85
62
|
* Run method is invoked by ace automatically
|
|
86
63
|
*/
|
|
87
64
|
async run() {
|
|
88
|
-
const colors = this.colors;
|
|
89
|
-
this.packageManager = await this.#getPackageManager();
|
|
90
65
|
/**
|
|
91
66
|
* Handle special packages to configure
|
|
92
67
|
*/
|
|
@@ -97,23 +72,12 @@ export default class Add extends BaseCommand {
|
|
|
97
72
|
else if (this.name === 'edge') {
|
|
98
73
|
npmPackageName = 'edge.js';
|
|
99
74
|
}
|
|
100
|
-
/**
|
|
101
|
-
* Prompt the user to confirm the installation
|
|
102
|
-
*/
|
|
103
|
-
const cmd = colors.grey(`${this.packageManager} add ${this.dev ? '-D ' : ''}${this.name}`);
|
|
104
|
-
this.logger.info(`Installing the package using the following command : ${cmd}`);
|
|
105
|
-
const shouldInstall = await this.prompt.confirm('Continue ?', {
|
|
106
|
-
name: 'install',
|
|
107
|
-
default: true,
|
|
108
|
-
});
|
|
109
|
-
if (!shouldInstall) {
|
|
110
|
-
this.logger.info('Installation cancelled');
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
113
75
|
/**
|
|
114
76
|
* Install package
|
|
115
77
|
*/
|
|
116
|
-
const
|
|
78
|
+
const codemods = await this.createCodemods();
|
|
79
|
+
codemods.verboseInstallOutput = !!this.verbose;
|
|
80
|
+
const pkgWasInstalled = await codemods.installPackages([{ name: npmPackageName, isDevDependency: !!this.dev }], this.packageManager);
|
|
117
81
|
if (!pkgWasInstalled) {
|
|
118
82
|
return;
|
|
119
83
|
}
|
|
@@ -123,10 +87,10 @@ export default class Add extends BaseCommand {
|
|
|
123
87
|
const { exitCode } = await this.#configurePackage();
|
|
124
88
|
this.exitCode = exitCode;
|
|
125
89
|
if (exitCode === 0) {
|
|
126
|
-
this.logger.success(`Installed and configured ${colors.green(this.name)}`);
|
|
90
|
+
this.logger.success(`Installed and configured ${this.colors.green(this.name)}`);
|
|
127
91
|
}
|
|
128
92
|
else {
|
|
129
|
-
this.logger.fatal(`Unable to configure ${colors.green(this.name)}`);
|
|
93
|
+
this.logger.fatal(`Unable to configure ${this.colors.green(this.name)}`);
|
|
130
94
|
}
|
|
131
95
|
}
|
|
132
96
|
}
|
|
@@ -137,7 +101,7 @@ __decorate([
|
|
|
137
101
|
flags.boolean({ description: 'Display logs in verbose mode' })
|
|
138
102
|
], Add.prototype, "verbose", void 0);
|
|
139
103
|
__decorate([
|
|
140
|
-
flags.string({ description: '
|
|
104
|
+
flags.string({ description: 'Define the package manager you want to use' })
|
|
141
105
|
], Add.prototype, "packageManager", void 0);
|
|
142
106
|
__decorate([
|
|
143
107
|
flags.boolean({ description: 'Should we install the package as a dev dependency', alias: 'D' })
|
|
@@ -1,17 +1,37 @@
|
|
|
1
|
-
import { BaseCommand } from '../modules/ace/main.
|
|
1
|
+
import { BaseCommand } from '../modules/ace/main.ts';
|
|
2
2
|
/**
|
|
3
3
|
* Create the production build by compiling TypeScript source and the
|
|
4
4
|
* frontend assets
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```
|
|
8
|
+
* ace build
|
|
9
|
+
* ace build --ignore-ts-errors
|
|
10
|
+
* ace build --package-manager=pnpm
|
|
11
|
+
* ```
|
|
5
12
|
*/
|
|
6
13
|
export default class Build extends BaseCommand {
|
|
7
14
|
#private;
|
|
15
|
+
/**
|
|
16
|
+
* The command name
|
|
17
|
+
*/
|
|
8
18
|
static commandName: string;
|
|
19
|
+
/**
|
|
20
|
+
* The command description
|
|
21
|
+
*/
|
|
9
22
|
static description: string;
|
|
23
|
+
/**
|
|
24
|
+
* Help text for the command
|
|
25
|
+
*/
|
|
10
26
|
static help: string[];
|
|
27
|
+
/**
|
|
28
|
+
* Ignore TypeScript errors and continue with the build process
|
|
29
|
+
*/
|
|
11
30
|
ignoreTsErrors?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Define the package manager to copy the appropriate lock file
|
|
33
|
+
*/
|
|
12
34
|
packageManager?: 'npm' | 'pnpm' | 'yarn' | 'yarn@berry' | 'bun';
|
|
13
|
-
assets?: boolean;
|
|
14
|
-
assetsArgs?: string[];
|
|
15
35
|
/**
|
|
16
36
|
* Build application
|
|
17
37
|
*/
|
package/build/commands/build.js
CHANGED
|
@@ -12,15 +12,31 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
12
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
13
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
14
14
|
};
|
|
15
|
-
import { BaseCommand, flags } from
|
|
16
|
-
import {
|
|
15
|
+
import { BaseCommand, flags } from "../modules/ace/main.js";
|
|
16
|
+
import { importAssembler, importTypeScript } from "../src/utils.js";
|
|
17
17
|
/**
|
|
18
18
|
* Create the production build by compiling TypeScript source and the
|
|
19
19
|
* frontend assets
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```
|
|
23
|
+
* ace build
|
|
24
|
+
* ace build --ignore-ts-errors
|
|
25
|
+
* ace build --package-manager=pnpm
|
|
26
|
+
* ```
|
|
20
27
|
*/
|
|
21
28
|
export default class Build extends BaseCommand {
|
|
29
|
+
/**
|
|
30
|
+
* The command name
|
|
31
|
+
*/
|
|
22
32
|
static commandName = 'build';
|
|
33
|
+
/**
|
|
34
|
+
* The command description
|
|
35
|
+
*/
|
|
23
36
|
static description = 'Build application for production by compiling frontend assets and TypeScript source to JavaScript';
|
|
37
|
+
/**
|
|
38
|
+
* Help text for the command
|
|
39
|
+
*/
|
|
24
40
|
static help = [
|
|
25
41
|
'Create the production build using the following command.',
|
|
26
42
|
'```',
|
|
@@ -35,6 +51,8 @@ export default class Build extends BaseCommand {
|
|
|
35
51
|
];
|
|
36
52
|
/**
|
|
37
53
|
* Log a development dependency is missing
|
|
54
|
+
*
|
|
55
|
+
* @param dependency - The name of the missing dependency
|
|
38
56
|
*/
|
|
39
57
|
#logMissingDevelopmentDependency(dependency) {
|
|
40
58
|
this.logger.error([
|
|
@@ -45,22 +63,6 @@ export default class Build extends BaseCommand {
|
|
|
45
63
|
'If you are using the build command inside a CI or with a deployment platform, make sure the NODE_ENV is set to "development"',
|
|
46
64
|
].join('\n'));
|
|
47
65
|
}
|
|
48
|
-
/**
|
|
49
|
-
* Returns the assets bundler config
|
|
50
|
-
*/
|
|
51
|
-
async #getAssetsBundlerConfig() {
|
|
52
|
-
const assetsBundler = await detectAssetsBundler(this.app);
|
|
53
|
-
return assetsBundler
|
|
54
|
-
? {
|
|
55
|
-
enabled: this.assets === false ? false : true,
|
|
56
|
-
driver: assetsBundler.name,
|
|
57
|
-
cmd: assetsBundler.build.command,
|
|
58
|
-
args: (assetsBundler.build.args || []).concat(this.assetsArgs || []),
|
|
59
|
-
}
|
|
60
|
-
: {
|
|
61
|
-
enabled: false,
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
66
|
/**
|
|
65
67
|
* Build application
|
|
66
68
|
*/
|
|
@@ -78,18 +80,14 @@ export default class Build extends BaseCommand {
|
|
|
78
80
|
return;
|
|
79
81
|
}
|
|
80
82
|
const bundler = new assembler.Bundler(this.app.appRoot, ts, {
|
|
81
|
-
assets: await this.#getAssetsBundlerConfig(),
|
|
82
83
|
metaFiles: this.app.rcFile.metaFiles,
|
|
83
|
-
hooks:
|
|
84
|
-
onBuildStarting: this.app.rcFile.hooks?.onBuildStarting,
|
|
85
|
-
onBuildCompleted: this.app.rcFile.hooks?.onBuildCompleted,
|
|
86
|
-
},
|
|
84
|
+
hooks: this.app.rcFile.hooks,
|
|
87
85
|
});
|
|
88
86
|
/**
|
|
89
87
|
* Share command logger with assembler, so that CLI flags like --no-ansi has
|
|
90
88
|
* similar impact for assembler logs as well.
|
|
91
89
|
*/
|
|
92
|
-
bundler.
|
|
90
|
+
bundler.ui.logger = this.logger;
|
|
93
91
|
/**
|
|
94
92
|
* Bundle project for production
|
|
95
93
|
*/
|
|
@@ -108,15 +106,3 @@ __decorate([
|
|
|
108
106
|
description: 'Define the package manager to copy the appropriate lock file',
|
|
109
107
|
})
|
|
110
108
|
], Build.prototype, "packageManager", void 0);
|
|
111
|
-
__decorate([
|
|
112
|
-
flags.boolean({
|
|
113
|
-
description: 'Build frontend assets',
|
|
114
|
-
showNegatedVariantInHelp: true,
|
|
115
|
-
default: true,
|
|
116
|
-
})
|
|
117
|
-
], Build.prototype, "assets", void 0);
|
|
118
|
-
__decorate([
|
|
119
|
-
flags.array({
|
|
120
|
-
description: 'Define CLI arguments to pass to the assets bundler',
|
|
121
|
-
})
|
|
122
|
-
], Build.prototype, "assetsArgs", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"commands":[{"commandName":"add","description":"Install and configure a package","help":"","namespace":null,"aliases":[],"flags":[{"name":"verbose","flagName":"verbose","required":false,"type":"boolean","description":"Display logs in verbose mode"},{"name":"packageManager","flagName":"package-manager","required":false,"type":"string","description":"Select the package manager you want to use"},{"name":"dev","flagName":"dev","required":false,"type":"boolean","description":"Should we install the package as a dev dependency","alias":"D"},{"name":"force","flagName":"force","required":false,"type":"boolean","description":"Forcefully overwrite existing files"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Package name","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"add.js"},{"commandName":"build","description":"Build application for production by compiling frontend assets and TypeScript source to JavaScript","help":["Create the production build using the following command.","```","{{ binaryName }} build","```","","The assets bundler dev server runs automatically after detecting vite config or webpack config files","You may pass vite CLI args using the --assets-args command line flag.","```","{{ binaryName }} build --assets-args=\"--debug --base=/public\"","```"],"namespace":null,"aliases":[],"flags":[{"name":"ignoreTsErrors","flagName":"ignore-ts-errors","required":false,"type":"boolean","description":"Ignore TypeScript errors and continue with the build process"},{"name":"packageManager","flagName":"package-manager","required":false,"type":"string","description":"Define the package manager to copy the appropriate lock file"},{"name":"assets","flagName":"assets","required":false,"type":"boolean","description":"Build frontend assets","showNegatedVariantInHelp":true,"default":true},{"name":"assetsArgs","flagName":"assets-args","required":false,"type":"array","description":"Define CLI arguments to pass to the assets bundler"}],"args":[],"options":{},"filePath":"build.js"},{"commandName":"configure","description":"Configure a package after it has been installed","help":"","namespace":null,"aliases":[],"flags":[{"name":"verbose","flagName":"verbose","required":false,"type":"boolean","description":"Display logs in verbose mode","alias":"v"},{"name":"force","flagName":"force","required":false,"type":"boolean","description":"Forcefully overwrite existing files","alias":"f"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Package name","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"configure.js"},{"commandName":"eject","description":"Eject scaffolding stubs to your application root","help":"","namespace":null,"aliases":[],"flags":[{"name":"pkg","flagName":"pkg","required":false,"type":"string","description":"Mention package name for searching stubs","default":"@adonisjs/core"}],"args":[{"name":"stubPath","argumentName":"stub-path","required":true,"description":"Path to the stubs directory or a single stub file","type":"string"}],"options":{},"filePath":"eject.js"},{"commandName":"env:add","description":"Add a new environment variable","help":"","namespace":"env","aliases":[],"flags":[{"name":"type","flagName":"type","required":false,"type":"string","description":"Type of the variable"},{"name":"enumValues","flagName":"enum-values","required":false,"type":"array","description":"Allowed values for the enum type in a comma-separated list","default":[""]}],"args":[{"name":"name","argumentName":"name","required":false,"description":"Variable name. Will be converted to screaming snake case","type":"string"},{"name":"value","argumentName":"value","required":false,"description":"Variable value","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"env/add.js"},{"commandName":"generate:key","description":"Generate a cryptographically secure random application key","help":"","namespace":"generate","aliases":[],"flags":[{"name":"show","flagName":"show","required":false,"type":"boolean","description":"Display the key on the terminal, instead of writing it to .env file"},{"name":"force","flagName":"force","required":false,"type":"boolean","description":"Force update .env file in production environment"}],"args":[],"options":{},"filePath":"generate_key.js"},{"commandName":"inspect:rcfile","description":"Inspect the RC file with its default values","help":"","namespace":"inspect","aliases":[],"flags":[],"args":[],"options":{},"filePath":"inspect_rcfile.js"},{"commandName":"list:routes","description":"List application routes. This command will boot the application in the console environment","help":"","namespace":"list","aliases":[],"flags":[{"name":"middleware","flagName":"middleware","required":false,"type":"array","description":"View routes that includes all the mentioned middleware names. Use * to see routes that are using one or more middleware"},{"name":"ignoreMiddleware","flagName":"ignore-middleware","required":false,"type":"array","description":"View routes that does not include all the mentioned middleware names. Use * to see routes that are using zero middleware"},{"name":"json","flagName":"json","required":false,"type":"boolean","description":"Get routes list as a JSON string"},{"name":"table","flagName":"table","required":false,"type":"boolean","description":"View list of routes as a table"}],"args":[{"name":"match","argumentName":"match","required":false,"description":"Find routes matching the given keyword. Route name, pattern and controller name will be searched against the keyword","type":"string"}],"options":{"startApp":true},"filePath":"list/routes.js"},{"commandName":"make:command","description":"Create a new ace command class","help":"","namespace":"make","aliases":[],"flags":[],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the command","type":"string"}],"options":{},"filePath":"make/command.js"},{"commandName":"make:controller","description":"Create a new HTTP controller class","help":"","namespace":"make","aliases":[],"flags":[{"name":"singular","flagName":"singular","required":false,"type":"boolean","description":"Generate controller in singular form","alias":"s"},{"name":"resource","flagName":"resource","required":false,"type":"boolean","description":"Generate resourceful controller with methods to perform CRUD actions on a resource","alias":"r"},{"name":"api","flagName":"api","required":false,"type":"boolean","description":"Generate resourceful controller without the \"edit\" and the \"create\" methods","alias":"a"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"The name of the controller","type":"string"},{"name":"actions","argumentName":"actions","required":false,"description":"Create controller with custom method names","type":"spread"}],"options":{"allowUnknownFlags":true},"filePath":"make/controller.js"},{"commandName":"make:event","description":"Create a new event class","help":"","namespace":"make","aliases":[],"flags":[],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the event","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/event.js"},{"commandName":"make:exception","description":"Create a new custom exception class","help":"","namespace":"make","aliases":[],"flags":[],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the exception","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/exception.js"},{"commandName":"make:listener","description":"Create a new event listener class","help":"","namespace":"make","aliases":[],"flags":[{"name":"event","flagName":"event","required":false,"type":"string","description":"Generate an event class alongside the listener","alias":"e"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the event listener","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/listener.js"},{"commandName":"make:middleware","description":"Create a new middleware class for HTTP requests","help":"","namespace":"make","aliases":[],"flags":[{"name":"stack","flagName":"stack","required":false,"type":"string","description":"The stack in which to register the middleware","alias":"s"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the middleware","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/middleware.js"},{"commandName":"make:preload","description":"Create a new preload file inside the start directory","help":"","namespace":"make","aliases":[],"flags":[{"name":"register","flagName":"register","required":false,"type":"boolean","description":"Auto register the preload file inside the .adonisrc.ts file","showNegatedVariantInHelp":true,"alias":"r"},{"name":"environments","flagName":"environments","required":false,"type":"array","description":"Define the preload file's environment. Accepted values are \"web,console,test,repl\"","alias":"e"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the preload file","type":"string"}],"options":{},"filePath":"make/preload.js"},{"commandName":"make:provider","description":"Create a new service provider class","help":"","namespace":"make","aliases":[],"flags":[{"name":"register","flagName":"register","required":false,"type":"boolean","description":"Auto register the provider inside the .adonisrc.ts file","showNegatedVariantInHelp":true,"alias":"r"},{"name":"environments","flagName":"environments","required":false,"type":"array","description":"Define the provider environment. Accepted values are \"web,console,test,repl\"","alias":"e"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the provider","type":"string"}],"options":{},"filePath":"make/provider.js"},{"commandName":"make:service","description":"Create a new service class","help":"","namespace":"make","aliases":[],"flags":[],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the service","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/service.js"},{"commandName":"make:test","description":"Create a new Japa test file","help":"","namespace":"make","aliases":[],"flags":[{"name":"suite","flagName":"suite","required":false,"type":"string","description":"The suite for which to create the test file","alias":"s"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the test file","type":"string"}],"options":{},"filePath":"make/test.js"},{"commandName":"make:validator","description":"Create a new file to define VineJS validators","help":"","namespace":"make","aliases":[],"flags":[{"name":"resource","flagName":"resource","required":false,"type":"boolean","description":"Create a file with pre-defined validators for create and update actions"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the validator file","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/validator.js"},{"commandName":"make:view","description":"Create a new Edge.js template file","help":"","namespace":"make","aliases":[],"flags":[],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the template","type":"string"}],"options":{},"filePath":"make/view.js"},{"commandName":"repl","description":"Start a new REPL session","help":"","namespace":null,"aliases":[],"flags":[],"args":[],"options":{"startApp":true,"staysAlive":true},"filePath":"repl.js"},{"commandName":"serve","description":"Start the development HTTP server along with the file watcher to perform restarts on file change","help":["Start the development server with file watcher using the following command.","```","{{ binaryName }} serve --watch","```","","You can also start the server with HMR support using the following command.","```","{{ binaryName }} serve --hmr","```","","The assets bundler dev server runs automatically after detecting vite config or webpack config files","You may pass vite CLI args using the --assets-args command line flag.","```","{{ binaryName }} serve --assets-args=\"--debug --base=/public\"","```"],"namespace":null,"aliases":[],"flags":[{"name":"hmr","flagName":"hmr","required":false,"type":"boolean","description":"Start the server with HMR support"},{"name":"watch","flagName":"watch","required":false,"type":"boolean","description":"Watch filesystem and restart the HTTP server on file change","alias":"w"},{"name":"poll","flagName":"poll","required":false,"type":"boolean","description":"Use polling to detect filesystem changes","alias":"p"},{"name":"clear","flagName":"clear","required":false,"type":"boolean","description":"Clear the terminal for new logs after file change","showNegatedVariantInHelp":true,"default":true},{"name":"assets","flagName":"assets","required":false,"type":"boolean","description":"Start assets bundler dev server","showNegatedVariantInHelp":true,"default":true},{"name":"assetsArgs","flagName":"assets-args","required":false,"type":"array","description":"Define CLI arguments to pass to the assets bundler"}],"args":[],"options":{"staysAlive":true},"filePath":"serve.js"},{"commandName":"test","description":"Run tests along with the file watcher to re-run tests on file change","help":"","namespace":null,"aliases":[],"flags":[{"name":"files","flagName":"files","required":false,"type":"array","description":"Filter tests by the filename"},{"name":"tags","flagName":"tags","required":false,"type":"array","description":"Filter tests by tags"},{"name":"groups","flagName":"groups","required":false,"type":"array","description":"Filter tests by parent group title"},{"name":"tests","flagName":"tests","required":false,"type":"array","description":"Filter tests by test title"},{"name":"reporters","flagName":"reporters","required":false,"type":"array","description":"Activate one or more test reporters"},{"name":"watch","flagName":"watch","required":false,"type":"boolean","description":"Watch filesystem and re-run tests on file change"},{"name":"poll","flagName":"poll","required":false,"type":"boolean","description":"Use polling to detect filesystem changes"},{"name":"timeout","flagName":"timeout","required":false,"type":"number","description":"Define default timeout for all tests"},{"name":"retries","flagName":"retries","required":false,"type":"number","description":"Define default retries for all tests"},{"name":"failed","flagName":"failed","required":false,"type":"boolean","description":"Execute tests failed during the last run"},{"name":"clear","flagName":"clear","required":false,"type":"boolean","description":"Clear the terminal for new logs after file change","showNegatedVariantInHelp":true,"default":true},{"name":"assets","flagName":"assets","required":false,"type":"boolean","description":"Start assets bundler dev server.","showNegatedVariantInHelp":true,"default":true},{"name":"assetsArgs","flagName":"assets-args","required":false,"type":"array","description":"Define CLI arguments to pass to the assets bundler"}],"args":[{"name":"suites","argumentName":"suites","required":false,"description":"Mention suite names to run tests for selected suites","type":"spread"}],"options":{"allowUnknownFlags":true,"staysAlive":true},"filePath":"test.js"}],"version":1}
|
|
1
|
+
{"commands":[{"commandName":"add","description":"Install and configure a package","help":"","namespace":null,"aliases":[],"flags":[{"name":"verbose","flagName":"verbose","required":false,"type":"boolean","description":"Display logs in verbose mode"},{"name":"packageManager","flagName":"package-manager","required":false,"type":"string","description":"Define the package manager you want to use"},{"name":"dev","flagName":"dev","required":false,"type":"boolean","description":"Should we install the package as a dev dependency","alias":"D"},{"name":"force","flagName":"force","required":false,"type":"boolean","description":"Forcefully overwrite existing files"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Package name","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"add.js"},{"commandName":"build","description":"Build application for production by compiling frontend assets and TypeScript source to JavaScript","help":["Create the production build using the following command.","```","{{ binaryName }} build","```","","The assets bundler dev server runs automatically after detecting vite config or webpack config files","You may pass vite CLI args using the --assets-args command line flag.","```","{{ binaryName }} build --assets-args=\"--debug --base=/public\"","```"],"namespace":null,"aliases":[],"flags":[{"name":"ignoreTsErrors","flagName":"ignore-ts-errors","required":false,"type":"boolean","description":"Ignore TypeScript errors and continue with the build process"},{"name":"packageManager","flagName":"package-manager","required":false,"type":"string","description":"Define the package manager to copy the appropriate lock file"}],"args":[],"options":{},"filePath":"build.js"},{"commandName":"configure","description":"Configure a package after it has been installed","help":"","namespace":null,"aliases":[],"flags":[{"name":"verbose","flagName":"verbose","required":false,"type":"boolean","description":"Display logs in verbose mode","alias":"v"},{"name":"force","flagName":"force","required":false,"type":"boolean","description":"Forcefully overwrite existing files","alias":"f"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Package name","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"configure.js"},{"commandName":"eject","description":"Eject scaffolding stubs to your application root","help":"","namespace":null,"aliases":[],"flags":[{"name":"pkg","flagName":"pkg","required":false,"type":"string","description":"Mention package name for searching stubs","default":"@adonisjs/core"}],"args":[{"name":"stubPath","argumentName":"stub-path","required":true,"description":"Path to the stubs directory or a single stub file","type":"string"}],"options":{},"filePath":"eject.js"},{"commandName":"env:add","description":"Add a new environment variable","help":"","namespace":"env","aliases":[],"flags":[{"name":"type","flagName":"type","required":false,"type":"string","description":"Type of the variable"},{"name":"enumValues","flagName":"enum-values","required":false,"type":"array","description":"Allowed values for the enum type in a comma-separated list","default":[""]}],"args":[{"name":"name","argumentName":"name","required":false,"description":"Variable name. Will be converted to screaming snake case","type":"string"},{"name":"value","argumentName":"value","required":false,"description":"Variable value","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"env/add.js"},{"commandName":"generate:key","description":"Generate a cryptographically secure random application key","help":"","namespace":"generate","aliases":[],"flags":[{"name":"show","flagName":"show","required":false,"type":"boolean","description":"Display the key on the terminal, instead of writing it to .env file"},{"name":"force","flagName":"force","required":false,"type":"boolean","description":"Force update .env file in production environment"}],"args":[],"options":{},"filePath":"generate_key.js"},{"commandName":"inspect:rcfile","description":"Inspect the RC file with its default values","help":"","namespace":"inspect","aliases":[],"flags":[],"args":[],"options":{},"filePath":"inspect_rcfile.js"},{"commandName":"list:routes","description":"List application routes. This command will boot the application in the console environment","help":"","namespace":"list","aliases":[],"flags":[{"name":"middleware","flagName":"middleware","required":false,"type":"array","description":"View routes that includes all the mentioned middleware names. Use * to see routes that are using one or more middleware"},{"name":"ignoreMiddleware","flagName":"ignore-middleware","required":false,"type":"array","description":"View routes that does not include all the mentioned middleware names. Use * to see routes that are using zero middleware"},{"name":"json","flagName":"json","required":false,"type":"boolean","description":"Get routes list as a JSON string"},{"name":"table","flagName":"table","required":false,"type":"boolean","description":"View list of routes as a table"}],"args":[{"name":"match","argumentName":"match","required":false,"description":"Find routes matching the given keyword. Route name, pattern and controller name will be searched against the keyword","type":"string"}],"options":{"startApp":true},"filePath":"list/routes.js"},{"commandName":"make:command","description":"Create a new ace command class","help":"","namespace":"make","aliases":[],"flags":[],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the command","type":"string"}],"options":{},"filePath":"make/command.js"},{"commandName":"make:controller","description":"Create a new HTTP controller class","help":"","namespace":"make","aliases":[],"flags":[{"name":"singular","flagName":"singular","required":false,"type":"boolean","description":"Generate controller in singular form","alias":"s"},{"name":"resource","flagName":"resource","required":false,"type":"boolean","description":"Generate resourceful controller with methods to perform CRUD actions on a resource","alias":"r"},{"name":"api","flagName":"api","required":false,"type":"boolean","description":"Generate resourceful controller without the \"edit\" and the \"create\" methods","alias":"a"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"The name of the controller","type":"string"},{"name":"actions","argumentName":"actions","required":false,"description":"Create controller with custom method names","type":"spread"}],"options":{"allowUnknownFlags":true},"filePath":"make/controller.js"},{"commandName":"make:event","description":"Create a new event class","help":"","namespace":"make","aliases":[],"flags":[],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the event","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/event.js"},{"commandName":"make:exception","description":"Create a new custom exception class","help":"","namespace":"make","aliases":[],"flags":[],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the exception","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/exception.js"},{"commandName":"make:listener","description":"Create a new event listener class","help":"","namespace":"make","aliases":[],"flags":[{"name":"event","flagName":"event","required":false,"type":"string","description":"Generate an event class alongside the listener","alias":"e"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the event listener","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/listener.js"},{"commandName":"make:middleware","description":"Create a new middleware class for HTTP requests","help":"","namespace":"make","aliases":[],"flags":[{"name":"stack","flagName":"stack","required":false,"type":"string","description":"The stack in which to register the middleware","alias":"s"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the middleware","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/middleware.js"},{"commandName":"make:preload","description":"Create a new preload file inside the start directory","help":"","namespace":"make","aliases":[],"flags":[{"name":"register","flagName":"register","required":false,"type":"boolean","description":"Auto register the preload file inside the .adonisrc.ts file","showNegatedVariantInHelp":true,"alias":"r"},{"name":"environments","flagName":"environments","required":false,"type":"array","description":"Define the preload file's environment. Accepted values are \"web,console,test,repl\"","alias":"e"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the preload file","type":"string"}],"options":{},"filePath":"make/preload.js"},{"commandName":"make:provider","description":"Create a new service provider class","help":"","namespace":"make","aliases":[],"flags":[{"name":"register","flagName":"register","required":false,"type":"boolean","description":"Auto register the provider inside the .adonisrc.ts file","showNegatedVariantInHelp":true,"alias":"r"},{"name":"environments","flagName":"environments","required":false,"type":"array","description":"Define the provider environment. Accepted values are \"web,console,test,repl\"","alias":"e"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the provider","type":"string"}],"options":{},"filePath":"make/provider.js"},{"commandName":"make:service","description":"Create a new service class","help":"","namespace":"make","aliases":[],"flags":[],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the service","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/service.js"},{"commandName":"make:test","description":"Create a new Japa test file","help":"","namespace":"make","aliases":[],"flags":[{"name":"suite","flagName":"suite","required":false,"type":"string","description":"The suite for which to create the test file","alias":"s"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the test file","type":"string"}],"options":{},"filePath":"make/test.js"},{"commandName":"make:transformer","description":"Create a new transformer class","help":"","namespace":"make","aliases":[],"flags":[],"args":[{"name":"name","argumentName":"name","required":true,"description":"Entity name for which to generate the transformer","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/transformer.js"},{"commandName":"make:validator","description":"Create a new file to define VineJS validators","help":"","namespace":"make","aliases":[],"flags":[{"name":"resource","flagName":"resource","required":false,"type":"boolean","description":"Create a file with pre-defined validators for create and update actions"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the validator file","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/validator.js"},{"commandName":"make:view","description":"Create a new Edge.js template file","help":"","namespace":"make","aliases":[],"flags":[],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the template","type":"string"}],"options":{},"filePath":"make/view.js"},{"commandName":"repl","description":"Start a new REPL session","help":"","namespace":null,"aliases":[],"flags":[],"args":[],"options":{"startApp":true,"staysAlive":true},"filePath":"repl.js"},{"commandName":"serve","description":"Start the development HTTP server along with the file watcher to perform restarts on file change","help":["Start the development server with file watcher using the following command.","```","{{ binaryName }} serve --watch","```","","You can also start the server with HMR support using the following command.","```","{{ binaryName }} serve --hmr","```","","The assets bundler dev server runs automatically after detecting vite config or webpack config files","You may pass vite CLI args using the --assets-args command line flag.","```","{{ binaryName }} serve --assets-args=\"--debug --base=/public\"","```"],"namespace":null,"aliases":[],"flags":[{"name":"hmr","flagName":"hmr","required":false,"type":"boolean","description":"Start the server with HMR support"},{"name":"watch","flagName":"watch","required":false,"type":"boolean","description":"Watch filesystem and restart the HTTP server on file change","alias":"w"},{"name":"poll","flagName":"poll","required":false,"type":"boolean","description":"Use polling to detect filesystem changes","alias":"p"},{"name":"clear","flagName":"clear","required":false,"type":"boolean","description":"Clear the terminal for new logs after file change","showNegatedVariantInHelp":true,"default":true}],"args":[],"options":{"staysAlive":true},"filePath":"serve.js"},{"commandName":"test","description":"Run tests along with the file watcher to re-run tests on file change","help":"","namespace":null,"aliases":[],"flags":[{"name":"files","flagName":"files","required":false,"type":"array","description":"Filter tests by the filename"},{"name":"tags","flagName":"tags","required":false,"type":"array","description":"Filter tests by tags"},{"name":"groups","flagName":"groups","required":false,"type":"array","description":"Filter tests by parent group title"},{"name":"tests","flagName":"tests","required":false,"type":"array","description":"Filter tests by test title"},{"name":"reporters","flagName":"reporters","required":false,"type":"array","description":"Activate one or more test reporters"},{"name":"watch","flagName":"watch","required":false,"type":"boolean","description":"Watch filesystem and re-run tests on file change"},{"name":"poll","flagName":"poll","required":false,"type":"boolean","description":"Use polling to detect filesystem changes"},{"name":"timeout","flagName":"timeout","required":false,"type":"number","description":"Define default timeout for all tests"},{"name":"retries","flagName":"retries","required":false,"type":"number","description":"Define default retries for all tests"},{"name":"failed","flagName":"failed","required":false,"type":"boolean","description":"Execute tests failed during the last run"},{"name":"clear","flagName":"clear","required":false,"type":"boolean","description":"Clear the terminal for new logs after file change","showNegatedVariantInHelp":true,"default":true}],"args":[{"name":"suites","argumentName":"suites","required":false,"description":"Mention suite names to run tests for selected suites","type":"spread"}],"options":{"allowUnknownFlags":true,"staysAlive":true},"filePath":"test.js"}],"version":1}
|
|
@@ -1,21 +1,42 @@
|
|
|
1
|
-
import type { CommandOptions } from '../types/ace.
|
|
2
|
-
import { BaseCommand } from '../modules/ace/main.
|
|
1
|
+
import type { CommandOptions } from '../types/ace.ts';
|
|
2
|
+
import { BaseCommand } from '../modules/ace/main.ts';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Command to configure packages after installation by running their configuration hooks.
|
|
5
|
+
* Supports built-in configurations for VineJS, Edge, and health checks, or can execute
|
|
6
|
+
* custom configure functions exported by packages.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```
|
|
10
|
+
* ace configure @adonisjs/lucid
|
|
11
|
+
* ace configure vinejs
|
|
12
|
+
* ace configure edge
|
|
13
|
+
* ace configure health_checks
|
|
14
|
+
* ace configure @adonisjs/auth --force --verbose
|
|
15
|
+
* ```
|
|
5
16
|
*/
|
|
6
17
|
export default class Configure extends BaseCommand {
|
|
7
18
|
#private;
|
|
19
|
+
/**
|
|
20
|
+
* The command name
|
|
21
|
+
*/
|
|
8
22
|
static commandName: string;
|
|
23
|
+
/**
|
|
24
|
+
* The command description
|
|
25
|
+
*/
|
|
9
26
|
static description: string;
|
|
27
|
+
/**
|
|
28
|
+
* Command options configuration.
|
|
29
|
+
* Allows unknown flags to be passed to package configure functions.
|
|
30
|
+
*/
|
|
10
31
|
static options: CommandOptions;
|
|
11
32
|
/**
|
|
12
|
-
*
|
|
33
|
+
* Expose all flags from the protected property "parsed" for access by package configure functions
|
|
13
34
|
*/
|
|
14
35
|
get parsedFlags(): {
|
|
15
36
|
[argName: string]: any;
|
|
16
37
|
};
|
|
17
38
|
/**
|
|
18
|
-
*
|
|
39
|
+
* Expose all arguments from the protected property "parsed" for access by package configure functions
|
|
19
40
|
*/
|
|
20
41
|
get parsedArgs(): (string | number)[];
|
|
21
42
|
/**
|
|
@@ -23,24 +44,26 @@ export default class Configure extends BaseCommand {
|
|
|
23
44
|
*/
|
|
24
45
|
name: string;
|
|
25
46
|
/**
|
|
26
|
-
*
|
|
47
|
+
* Enable verbose logging during package installation and configuration
|
|
27
48
|
*/
|
|
28
49
|
verbose?: boolean;
|
|
29
50
|
/**
|
|
30
|
-
* Forcefully overwrite existing files
|
|
51
|
+
* Forcefully overwrite existing files during configuration
|
|
31
52
|
*/
|
|
32
53
|
force?: boolean;
|
|
33
54
|
/**
|
|
34
|
-
* The root of the stubs
|
|
35
|
-
* the package
|
|
55
|
+
* The root directory path of the package's stubs.
|
|
56
|
+
* Set automatically when the package exports a stubsRoot property.
|
|
36
57
|
*/
|
|
37
58
|
stubsRoot: string;
|
|
38
59
|
/**
|
|
39
|
-
*
|
|
60
|
+
* Create a codemods instance configured with command options.
|
|
61
|
+
* Sets overwrite and verbose flags based on command arguments.
|
|
40
62
|
*/
|
|
41
|
-
createCodemods(): Promise<import("../modules/ace/codemods.
|
|
63
|
+
createCodemods(): Promise<import("../modules/ace/codemods.ts").Codemods>;
|
|
42
64
|
/**
|
|
43
|
-
*
|
|
65
|
+
* Execute the configure command. Handles built-in configurations for VineJS, Edge,
|
|
66
|
+
* and health checks, or imports and executes the configure function from the specified package.
|
|
44
67
|
*/
|
|
45
68
|
run(): Promise<void>;
|
|
46
69
|
}
|
|
@@ -12,32 +12,57 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
12
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
13
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
14
14
|
};
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
15
|
+
import { RuntimeException } from '@poppinss/utils/exception';
|
|
16
|
+
import { stubsRoot } from "../stubs/main.js";
|
|
17
|
+
import { args, BaseCommand, flags } from "../modules/ace/main.js";
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* Command to configure packages after installation by running their configuration hooks.
|
|
20
|
+
* Supports built-in configurations for VineJS, Edge, and health checks, or can execute
|
|
21
|
+
* custom configure functions exported by packages.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```
|
|
25
|
+
* ace configure @adonisjs/lucid
|
|
26
|
+
* ace configure vinejs
|
|
27
|
+
* ace configure edge
|
|
28
|
+
* ace configure health_checks
|
|
29
|
+
* ace configure @adonisjs/auth --force --verbose
|
|
30
|
+
* ```
|
|
20
31
|
*/
|
|
21
32
|
export default class Configure extends BaseCommand {
|
|
33
|
+
/**
|
|
34
|
+
* The command name
|
|
35
|
+
*/
|
|
22
36
|
static commandName = 'configure';
|
|
37
|
+
/**
|
|
38
|
+
* The command description
|
|
39
|
+
*/
|
|
23
40
|
static description = 'Configure a package after it has been installed';
|
|
41
|
+
/**
|
|
42
|
+
* Command options configuration.
|
|
43
|
+
* Allows unknown flags to be passed to package configure functions.
|
|
44
|
+
*/
|
|
24
45
|
static options = {
|
|
25
46
|
allowUnknownFlags: true,
|
|
26
47
|
};
|
|
27
48
|
/**
|
|
28
|
-
*
|
|
49
|
+
* Expose all flags from the protected property "parsed" for access by package configure functions
|
|
29
50
|
*/
|
|
30
51
|
get parsedFlags() {
|
|
31
52
|
return this.parsed.flags;
|
|
32
53
|
}
|
|
33
54
|
/**
|
|
34
|
-
*
|
|
55
|
+
* Expose all arguments from the protected property "parsed" for access by package configure functions
|
|
35
56
|
*/
|
|
36
57
|
get parsedArgs() {
|
|
37
58
|
return this.parsed._;
|
|
38
59
|
}
|
|
39
60
|
/**
|
|
40
|
-
*
|
|
61
|
+
* Import and return the main exports of a package.
|
|
62
|
+
* Returns null if the package is not found, rethrows other errors.
|
|
63
|
+
*
|
|
64
|
+
* @param packageName - The name of the package to import
|
|
65
|
+
* @returns The package exports or null if not found
|
|
41
66
|
*/
|
|
42
67
|
async #getPackageSource(packageName) {
|
|
43
68
|
try {
|
|
@@ -53,7 +78,7 @@ export default class Configure extends BaseCommand {
|
|
|
53
78
|
}
|
|
54
79
|
}
|
|
55
80
|
/**
|
|
56
|
-
*
|
|
81
|
+
* Configure VineJS validation library by registering its provider in the RC file
|
|
57
82
|
*/
|
|
58
83
|
async #configureVineJS() {
|
|
59
84
|
const codemods = await this.createCodemods();
|
|
@@ -62,7 +87,7 @@ export default class Configure extends BaseCommand {
|
|
|
62
87
|
});
|
|
63
88
|
}
|
|
64
89
|
/**
|
|
65
|
-
*
|
|
90
|
+
* Configure Edge template engine by registering its provider and adding view meta files
|
|
66
91
|
*/
|
|
67
92
|
async #configureEdge() {
|
|
68
93
|
const codemods = await this.createCodemods();
|
|
@@ -72,7 +97,7 @@ export default class Configure extends BaseCommand {
|
|
|
72
97
|
});
|
|
73
98
|
}
|
|
74
99
|
/**
|
|
75
|
-
* Configure health checks
|
|
100
|
+
* Configure health checks feature by generating the main health file and controller
|
|
76
101
|
*/
|
|
77
102
|
async #configureHealthChecks() {
|
|
78
103
|
const codemods = await this.createCodemods();
|
|
@@ -86,7 +111,8 @@ export default class Configure extends BaseCommand {
|
|
|
86
111
|
});
|
|
87
112
|
}
|
|
88
113
|
/**
|
|
89
|
-
*
|
|
114
|
+
* Create a codemods instance configured with command options.
|
|
115
|
+
* Sets overwrite and verbose flags based on command arguments.
|
|
90
116
|
*/
|
|
91
117
|
async createCodemods() {
|
|
92
118
|
const codemods = await super.createCodemods();
|
|
@@ -95,7 +121,8 @@ export default class Configure extends BaseCommand {
|
|
|
95
121
|
return codemods;
|
|
96
122
|
}
|
|
97
123
|
/**
|
|
98
|
-
*
|
|
124
|
+
* Execute the configure command. Handles built-in configurations for VineJS, Edge,
|
|
125
|
+
* and health checks, or imports and executes the configure function from the specified package.
|
|
99
126
|
*/
|
|
100
127
|
async run() {
|
|
101
128
|
if (this.name === 'vinejs') {
|