@adonisjs/core 6.1.5-9 → 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.
- package/README.md +3 -5
- package/build/commands/build.d.ts +3 -5
- package/build/commands/build.js +5 -9
- package/build/commands/commands.json +1 -1
- package/build/commands/configure.d.ts +21 -28
- package/build/commands/configure.js +60 -118
- package/build/commands/eject.js +2 -1
- package/build/commands/generate_key.js +2 -2
- package/build/commands/inspect_rcfile.js +19 -2
- package/build/commands/main.d.ts +4 -0
- package/build/commands/make/command.d.ts +1 -1
- package/build/commands/make/command.js +5 -2
- package/build/commands/make/controller.d.ts +2 -1
- package/build/commands/make/controller.js +33 -10
- package/build/commands/make/event.d.ts +1 -1
- package/build/commands/make/event.js +5 -3
- package/build/commands/make/exception.d.ts +1 -1
- package/build/commands/make/exception.js +6 -4
- package/build/commands/make/listener.d.ts +1 -1
- package/build/commands/make/listener.js +9 -6
- package/build/commands/make/middleware.d.ts +2 -1
- package/build/commands/make/middleware.js +50 -4
- package/build/commands/make/preload.d.ts +4 -3
- package/build/commands/make/preload.js +34 -35
- package/build/commands/make/provider.d.ts +7 -1
- package/build/commands/make/provider.js +57 -7
- package/build/commands/make/service.d.ts +1 -1
- package/build/commands/make/service.js +5 -3
- package/build/commands/make/test.d.ts +1 -1
- package/build/commands/make/test.js +7 -5
- package/build/commands/make/validator.d.ts +19 -0
- package/build/commands/make/validator.js +53 -0
- package/build/commands/make/view.d.ts +14 -0
- package/build/commands/make/view.js +37 -0
- package/build/commands/serve.js +7 -4
- package/build/commands/test.js +2 -2
- package/build/factories/core/ace.d.ts +2 -2
- package/build/factories/core/ignitor.d.ts +2 -2
- package/build/factories/core/ignitor.js +8 -9
- package/build/factories/core/main.d.ts +0 -1
- package/build/factories/core/main.js +0 -1
- package/build/factories/core/test_utils.d.ts +2 -2
- package/build/factories/stubs.d.ts +2 -2
- package/build/factories/stubs.js +3 -2
- package/build/index.d.ts +11 -140
- package/build/index.js +5 -1
- package/build/modules/ace/codemods.d.ts +93 -0
- package/build/modules/ace/codemods.js +259 -0
- package/build/modules/ace/commands.d.ts +6 -81
- package/build/modules/ace/commands.js +12 -33
- package/build/modules/ace/create_kernel.d.ts +1 -1
- package/build/modules/ace/create_kernel.js +19 -3
- package/build/modules/env/editor.d.ts +1 -0
- package/build/modules/env/editor.js +9 -0
- package/build/modules/hash/define_config.d.ts +29 -12
- package/build/modules/hash/define_config.js +52 -11
- package/build/modules/hash/drivers/argon.d.ts +1 -0
- package/build/modules/hash/drivers/argon.js +9 -0
- package/build/modules/hash/drivers/bcrypt.d.ts +1 -0
- package/build/modules/hash/drivers/bcrypt.js +9 -0
- package/build/modules/hash/drivers/scrypt.d.ts +1 -0
- package/build/modules/hash/drivers/scrypt.js +9 -0
- package/build/modules/hash/main.d.ts +1 -2
- package/build/modules/hash/main.js +1 -2
- package/build/modules/hash/phc_formatter.d.ts +1 -0
- package/build/modules/hash/phc_formatter.js +9 -0
- package/build/modules/http/main.d.ts +5 -0
- package/build/modules/http/main.js +5 -0
- package/build/modules/http/request_validator.d.ts +4 -14
- package/build/modules/http/request_validator.js +2 -10
- package/build/providers/app_provider.d.ts +14 -0
- package/build/providers/app_provider.js +47 -3
- package/build/providers/edge_provider.d.ts +31 -0
- package/build/providers/edge_provider.js +70 -0
- package/build/providers/hash_provider.d.ts +0 -4
- package/build/providers/hash_provider.js +11 -11
- package/build/providers/repl_provider.js +78 -7
- package/build/providers/vinejs_provider.d.ts +43 -0
- package/build/{src/vinejs/extensions/validates_files.js → providers/vinejs_provider.js} +26 -5
- package/build/src/config_provider.d.ts +9 -0
- package/build/src/config_provider.js +26 -0
- package/build/src/debug.d.ts +1 -1
- package/build/src/helpers/assert.d.ts +1 -0
- package/build/src/helpers/assert.js +9 -0
- package/build/src/helpers/main.d.ts +2 -2
- package/build/src/helpers/main.js +2 -2
- package/build/src/helpers/types.d.ts +109 -16
- package/build/src/helpers/types.js +3 -3
- package/build/src/ignitor/ace.js +3 -1
- package/build/src/ignitor/http.d.ts +2 -2
- package/build/src/ignitor/http.js +5 -1
- package/build/src/ignitor/main.d.ts +2 -2
- package/build/src/ignitor/main.js +1 -1
- package/build/src/test_utils/http.d.ts +2 -2
- package/build/src/test_utils/main.d.ts +3 -3
- package/build/src/types.d.ts +17 -17
- package/build/stubs/make/command/main.stub +6 -4
- package/build/stubs/make/controller/actions.stub +14 -0
- package/build/stubs/make/controller/api.stub +6 -4
- package/build/stubs/make/controller/main.stub +6 -4
- package/build/stubs/make/controller/resource.stub +6 -4
- package/build/stubs/make/event/main.stub +5 -3
- package/build/stubs/make/exception/main.stub +5 -3
- package/build/stubs/make/listener/for_event.stub +6 -4
- package/build/stubs/make/listener/main.stub +5 -3
- package/build/stubs/make/middleware/main.stub +7 -5
- package/build/stubs/make/{preload_file → preload}/main.stub +5 -3
- package/build/stubs/make/provider/main.stub +6 -4
- package/build/stubs/make/service/main.stub +5 -3
- package/build/stubs/make/test/main.stub +5 -3
- package/build/stubs/make/validator/main.stub +7 -0
- package/build/stubs/make/validator/resource.stub +26 -0
- package/build/stubs/make/view/main.stub +6 -0
- package/build/types/bodyparser.js +1 -1
- package/build/types/helpers.d.ts +1 -0
- package/build/{src/vinejs/extensions/main.js → types/helpers.js} +1 -1
- package/build/types/http.d.ts +7 -0
- package/package.json +68 -59
- package/build/commands/make/_base.d.ts +0 -36
- package/build/commands/make/_base.js +0 -27
- package/build/modules/ace/shell.d.ts +0 -12
- package/build/modules/ace/shell.js +0 -49
- package/build/modules/hash/drivers_collection.d.ts +0 -21
- package/build/modules/hash/drivers_collection.js +0 -45
- package/build/providers/http_provider.d.ts +0 -26
- package/build/providers/http_provider.js +0 -61
- package/build/src/bindings/repl.d.ts +0 -6
- package/build/src/bindings/repl.js +0 -78
- package/build/src/vinejs/extensions/main.d.ts +0 -1
- package/build/src/vinejs/extensions/validates_files.d.ts +0 -22
- /package/build/modules/{env.d.ts → env/main.d.ts} +0 -0
- /package/build/modules/{env.js → env/main.js} +0 -0
- /package/build/stubs/{index.d.ts → main.d.ts} +0 -0
- /package/build/stubs/{index.js → main.js} +0 -0
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
<div align="center">
|
|
16
16
|
|
|
17
|
-
[![gh-workflow-image]][gh-workflow-url] [![npm-image]][npm-url] ![][typescript-image] [![license-image]][license-url]
|
|
17
|
+
[![gh-workflow-image]][gh-workflow-url] [![npm-image]][npm-url] ![][typescript-image] [![license-image]][license-url]
|
|
18
18
|
|
|
19
19
|
</div>
|
|
20
20
|
|
|
@@ -38,12 +38,10 @@
|
|
|
38
38
|
<sub>Built with ❤︎ by <a href="https://github.com/thetutlage">Harminder Virk</a>
|
|
39
39
|
</div>
|
|
40
40
|
|
|
41
|
-
[gh-workflow-image]: https://img.shields.io/github/actions/workflow/status/adonisjs/core/
|
|
42
|
-
[gh-workflow-url]: https://github.com/adonisjs/core/actions/workflows/
|
|
41
|
+
[gh-workflow-image]: https://img.shields.io/github/actions/workflow/status/adonisjs/core/checks.yml?branch=develop&label=Tests&style=for-the-badge
|
|
42
|
+
[gh-workflow-url]: https://github.com/adonisjs/core/actions/workflows/checks.yml 'Github action'
|
|
43
43
|
[npm-image]: https://img.shields.io/npm/v/@adonisjs/core/latest.svg?style=for-the-badge&logo=npm
|
|
44
44
|
[npm-url]: https://www.npmjs.com/package/@adonisjs/core/v/latest 'npm'
|
|
45
45
|
[typescript-image]: https://img.shields.io/badge/Typescript-294E80.svg?style=for-the-badge&logo=typescript
|
|
46
46
|
[license-url]: LICENSE.md
|
|
47
47
|
[license-image]: https://img.shields.io/github/license/adonisjs/adonis-framework?style=for-the-badge
|
|
48
|
-
[snyk-image]: https://img.shields.io/snyk/vulnerabilities/github/adonisjs/core?label=Snyk%20Vulnerabilities&style=for-the-badge
|
|
49
|
-
[snyk-url]: https://snyk.io/test/github/adonisjs/core?targetFile=package.json 'snyk'
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import { BaseCommand } from '../modules/ace/main.js';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* system changes
|
|
3
|
+
* Create the production build by compiling TypeScript source and the
|
|
4
|
+
* frontend assets
|
|
6
5
|
*/
|
|
7
6
|
export default class Build extends BaseCommand {
|
|
8
7
|
#private;
|
|
9
8
|
static commandName: string;
|
|
10
9
|
static description: string;
|
|
11
10
|
static help: string[];
|
|
12
|
-
watch?: boolean;
|
|
13
11
|
ignoreTsErrors?: boolean;
|
|
14
|
-
packageManager?: 'npm' | 'pnpm' | 'yarn';
|
|
12
|
+
packageManager?: 'npm' | 'pnpm' | 'yarn' | 'bun';
|
|
15
13
|
assets?: boolean;
|
|
16
14
|
assetsArgs?: string[];
|
|
17
15
|
/**
|
package/build/commands/build.js
CHANGED
|
@@ -15,9 +15,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
15
15
|
import { BaseCommand, flags } from '../modules/ace/main.js';
|
|
16
16
|
import { detectAssetsBundler, importAssembler, importTypeScript } from '../src/internal_helpers.js';
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* system changes
|
|
18
|
+
* Create the production build by compiling TypeScript source and the
|
|
19
|
+
* frontend assets
|
|
21
20
|
*/
|
|
22
21
|
export default class Build extends BaseCommand {
|
|
23
22
|
static commandName = 'build';
|
|
@@ -53,13 +52,13 @@ export default class Build extends BaseCommand {
|
|
|
53
52
|
const assetsBundler = await detectAssetsBundler(this.app);
|
|
54
53
|
return assetsBundler
|
|
55
54
|
? {
|
|
56
|
-
|
|
55
|
+
enabled: this.assets === false ? false : true,
|
|
57
56
|
driver: assetsBundler.name,
|
|
58
57
|
cmd: assetsBundler.build.command,
|
|
59
58
|
args: (assetsBundler.build.args || []).concat(this.assetsArgs || []),
|
|
60
59
|
}
|
|
61
60
|
: {
|
|
62
|
-
|
|
61
|
+
enabled: false,
|
|
63
62
|
};
|
|
64
63
|
}
|
|
65
64
|
/**
|
|
@@ -97,15 +96,12 @@ export default class Build extends BaseCommand {
|
|
|
97
96
|
}
|
|
98
97
|
}
|
|
99
98
|
}
|
|
100
|
-
__decorate([
|
|
101
|
-
flags.boolean({ description: 'Watch filesystem and restart the HTTP server on file change' })
|
|
102
|
-
], Build.prototype, "watch", void 0);
|
|
103
99
|
__decorate([
|
|
104
100
|
flags.boolean({ description: 'Ignore TypeScript errors and continue with the build process' })
|
|
105
101
|
], Build.prototype, "ignoreTsErrors", void 0);
|
|
106
102
|
__decorate([
|
|
107
103
|
flags.string({
|
|
108
|
-
description: '
|
|
104
|
+
description: 'Define the package manager to copy the appropriate lock file',
|
|
109
105
|
})
|
|
110
106
|
], Build.prototype, "packageManager", void 0);
|
|
111
107
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"commands":[{"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":"watch","flagName":"watch","required":false,"type":"boolean","description":"Watch filesystem and restart the HTTP server on file change"},{"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":"Select the package manager you want to use to install production dependencies"},{"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","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/build.js"},{"commandName":"configure","description":"Configure a package post installation","help":"","namespace":null,"aliases":[],"flags":[{"name":"verbose","flagName":"verbose","required":false,"type":"boolean","description":"Display logs in verbose mode"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Package name","type":"string"}],"options":{},"filePath":"configure.js","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/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","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/eject.js"},{"commandName":"generate:key","description":"Generate a 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","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/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","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/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","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/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":{"allowUnknownFlags":true},"filePath":"make/command.js","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/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":"Convert controller class and file name to its singular form","alias":"r"},{"name":"resource","flagName":"resource","required":false,"type":"boolean","description":"Generate controller with resource actions","alias":"r"},{"name":"api","flagName":"api","required":false,"type":"boolean","description":"Generate controller with api resource actions","alias":"a"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"The name of the controller","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/controller.js","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/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","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/make/event.js"},{"commandName":"make:exception","description":"Create a new ace 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","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/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 listener","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/listener.js","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/make/listener.js"},{"commandName":"make:middleware","description":"Create a new middleware class","help":"","namespace":"make","aliases":[],"flags":[],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the middleware","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/middleware.js","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/make/middleware.js"},{"commandName":"make:preload","description":"Create a new preload file inside the start directory","help":"","namespace":"make","aliases":[],"flags":[{"name":"environments","flagName":"environments","required":false,"type":"array","description":"Define the preload file's environment. Accepted values are \"web,console,test,repl\""}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the preload file","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/preload.js","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/make/preload.js"},{"commandName":"make:provider","description":"Create a new service provider class","help":"","namespace":"make","aliases":[],"flags":[],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the provider","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/provider.js","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/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","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/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"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the test file","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/test.js","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/make/test.js"},{"commandName":"repl","description":"Start a new REPL session","help":"","namespace":null,"aliases":[],"flags":[],"args":[],"options":{"startApp":true,"staysAlive":true},"filePath":"repl.js","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/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","```","","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":"watch","flagName":"watch","required":false,"type":"boolean","description":"Watch filesystem and restart the HTTP server on file change"},{"name":"poll","flagName":"poll","required":false,"type":"boolean","description":"Use polling to detect filesystem changes"},{"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","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/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","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/test.js"}],"version":1}
|
|
1
|
+
{"commands":[{"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","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/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","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/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","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/eject.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","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/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","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/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","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/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","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/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 controller with methods to perform CRUD actions on a resource","alias":"r"},{"name":"api","flagName":"api","required":false,"type":"boolean","description":"Generate resourceful controller with 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":{},"filePath":"make/controller.js","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/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":{},"filePath":"make/event.js","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/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":{},"filePath":"make/exception.js","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/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":{},"filePath":"make/listener.js","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/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":{},"filePath":"make/middleware.js","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/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","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/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","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/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":{},"filePath":"make/service.js","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/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","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/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":{},"filePath":"make/validator.js","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/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","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/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","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/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","```","","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":"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","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/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","absoluteFilePath":"/Users/virk/code/adonisjs/core/core/build/commands/test.js"}],"version":1}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CommandOptions } from '../types/ace.js';
|
|
2
2
|
import { BaseCommand } from '../modules/ace/main.js';
|
|
3
3
|
/**
|
|
4
4
|
* The configure command is used to configure packages after installation
|
|
@@ -7,45 +7,38 @@ export default class Configure extends BaseCommand {
|
|
|
7
7
|
#private;
|
|
8
8
|
static commandName: string;
|
|
9
9
|
static description: string;
|
|
10
|
-
|
|
11
|
-
verbose?: boolean;
|
|
10
|
+
static options: CommandOptions;
|
|
12
11
|
/**
|
|
13
|
-
*
|
|
14
|
-
* the package
|
|
12
|
+
* Exposing all flags from the protected property "parsed"
|
|
15
13
|
*/
|
|
16
|
-
|
|
14
|
+
get parsedFlags(): {
|
|
15
|
+
[argName: string]: any;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Exposing all args from the protected property "parsed"
|
|
19
|
+
*/
|
|
20
|
+
get parsedArgs(): (string | number)[];
|
|
17
21
|
/**
|
|
18
|
-
*
|
|
22
|
+
* Name of the package to configure
|
|
19
23
|
*/
|
|
20
|
-
|
|
24
|
+
name: string;
|
|
21
25
|
/**
|
|
22
|
-
*
|
|
26
|
+
* Turn on verbose mode for packages installation
|
|
23
27
|
*/
|
|
24
|
-
|
|
28
|
+
verbose?: boolean;
|
|
25
29
|
/**
|
|
26
|
-
*
|
|
30
|
+
* Forcefully overwrite existing files.
|
|
27
31
|
*/
|
|
28
|
-
|
|
32
|
+
force?: boolean;
|
|
29
33
|
/**
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* name like :
|
|
33
|
-
*
|
|
34
|
-
* ```
|
|
35
|
-
* installPackages(['@adonisjs/lucid@next', '@adonisjs/auth@3.0.0'])
|
|
36
|
-
* ```
|
|
34
|
+
* The root of the stubs directory. The value is defined after we import
|
|
35
|
+
* the package
|
|
37
36
|
*/
|
|
38
|
-
|
|
39
|
-
name: string;
|
|
40
|
-
isDevDependency: boolean;
|
|
41
|
-
}[]): Promise<void>;
|
|
37
|
+
stubsRoot: string;
|
|
42
38
|
/**
|
|
43
|
-
*
|
|
39
|
+
* Creates codemods as per configure command options
|
|
44
40
|
*/
|
|
45
|
-
|
|
46
|
-
name: string;
|
|
47
|
-
isDevDependency: boolean;
|
|
48
|
-
}[]): void;
|
|
41
|
+
createCodemods(): Promise<import("../modules/ace/codemods.js").Codemods>;
|
|
49
42
|
/**
|
|
50
43
|
* Run method is invoked by ace automatically
|
|
51
44
|
*/
|
|
@@ -12,163 +12,102 @@ 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 { slash } from '@poppinss/utils';
|
|
16
|
-
import { installPackage, detectPackageManager } from '@antfu/install-pkg';
|
|
17
|
-
import { EnvEditor } from '../modules/env.js';
|
|
18
15
|
import { args, BaseCommand, flags } from '../modules/ace/main.js';
|
|
19
16
|
/**
|
|
20
17
|
* The configure command is used to configure packages after installation
|
|
21
18
|
*/
|
|
22
19
|
export default class Configure extends BaseCommand {
|
|
23
20
|
static commandName = 'configure';
|
|
24
|
-
static description = 'Configure a package
|
|
21
|
+
static description = 'Configure a package after it has been installed';
|
|
22
|
+
static options = {
|
|
23
|
+
allowUnknownFlags: true,
|
|
24
|
+
};
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
26
|
+
* Exposing all flags from the protected property "parsed"
|
|
27
27
|
*/
|
|
28
|
-
|
|
29
|
-
return this.
|
|
28
|
+
get parsedFlags() {
|
|
29
|
+
return this.parsed.flags;
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
33
|
-
* package managers
|
|
32
|
+
* Exposing all args from the protected property "parsed"
|
|
34
33
|
*/
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return '';
|
|
38
|
-
}
|
|
39
|
-
const devFlag = isDev ? ' -D' : '';
|
|
40
|
-
switch (packageManager) {
|
|
41
|
-
case 'npm':
|
|
42
|
-
return `${this.colors.yellow(`npm i${devFlag}`)} ${packages.join(' ')}`;
|
|
43
|
-
case 'yarn':
|
|
44
|
-
return `${this.colors.yellow(`yarn add${devFlag}`)} ${packages.join(' ')}`;
|
|
45
|
-
case 'pnpm':
|
|
46
|
-
return `${this.colors.yellow(`pnpm add${devFlag}`)} ${packages.join(' ')}`;
|
|
47
|
-
}
|
|
34
|
+
get parsedArgs() {
|
|
35
|
+
return this.parsed._;
|
|
48
36
|
}
|
|
49
37
|
/**
|
|
50
|
-
*
|
|
38
|
+
* Returns the package main exports
|
|
51
39
|
*/
|
|
52
|
-
async
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
40
|
+
async #getPackageSource(packageName) {
|
|
41
|
+
try {
|
|
42
|
+
const packageExports = await this.app.import(packageName);
|
|
43
|
+
return packageExports;
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
if ((error.code && error.code === 'ERR_MODULE_NOT_FOUND') ||
|
|
47
|
+
error.message.startsWith('Cannot find module')) {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
throw error;
|
|
63
51
|
}
|
|
64
|
-
this.logger.action(`create ${entityFileName}`).succeeded();
|
|
65
52
|
}
|
|
66
53
|
/**
|
|
67
|
-
*
|
|
54
|
+
* Registers VineJS provider
|
|
68
55
|
*/
|
|
69
|
-
async
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
Object.keys(environmentVariables).forEach((key) => {
|
|
74
|
-
const value = environmentVariables[key];
|
|
75
|
-
editor.add(key, value);
|
|
76
|
-
logs.push(` ${this.colors.dim(`${key}=${value}`)}`);
|
|
56
|
+
async #configureVineJS() {
|
|
57
|
+
const codemods = await this.createCodemods();
|
|
58
|
+
await codemods.updateRcFile((rcFile) => {
|
|
59
|
+
rcFile.addProvider('@adonisjs/core/providers/vinejs_provider');
|
|
77
60
|
});
|
|
78
|
-
await editor.save();
|
|
79
|
-
this.logger.action('update .env file').succeeded();
|
|
80
|
-
this.logger.log(logs.join('\n'));
|
|
81
61
|
}
|
|
82
62
|
/**
|
|
83
|
-
*
|
|
63
|
+
* Registers Edge provider
|
|
84
64
|
*/
|
|
85
|
-
async
|
|
86
|
-
await
|
|
87
|
-
await
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
* Install packages using the correct package manager
|
|
92
|
-
* You can specify version of each package by setting it in the
|
|
93
|
-
* name like :
|
|
94
|
-
*
|
|
95
|
-
* ```
|
|
96
|
-
* installPackages(['@adonisjs/lucid@next', '@adonisjs/auth@3.0.0'])
|
|
97
|
-
* ```
|
|
98
|
-
*/
|
|
99
|
-
async installPackages(packages) {
|
|
100
|
-
const appPath = this.app.makePath();
|
|
101
|
-
const silent = this.verbose === true ? false : true;
|
|
102
|
-
const devDeps = packages.filter((pkg) => pkg.isDevDependency).map(({ name }) => name);
|
|
103
|
-
const deps = packages.filter((pkg) => !pkg.isDevDependency).map(({ name }) => name);
|
|
104
|
-
const packageManager = await detectPackageManager(appPath);
|
|
105
|
-
let spinner = this.logger
|
|
106
|
-
.await(`installing dependencies using ${packageManager || 'npm'}`)
|
|
107
|
-
.start();
|
|
108
|
-
try {
|
|
109
|
-
await installPackage(deps, { cwd: appPath, silent });
|
|
110
|
-
await installPackage(devDeps, { dev: true, cwd: appPath, silent });
|
|
111
|
-
spinner.stop();
|
|
112
|
-
this.logger.success('dependencies installed');
|
|
113
|
-
this.logger.log(devDeps.map((dep) => ` ${this.colors.dim('dev')} ${dep}`).join('\n'));
|
|
114
|
-
this.logger.log(deps.map((dep) => ` ${this.colors.dim('prod')} ${dep}`).join('\n'));
|
|
115
|
-
}
|
|
116
|
-
catch (error) {
|
|
117
|
-
spinner.update('unable to install dependencies');
|
|
118
|
-
spinner.stop();
|
|
119
|
-
this.exitCode = 1;
|
|
120
|
-
this.logger.fatal(error);
|
|
121
|
-
}
|
|
65
|
+
async #configureEdge() {
|
|
66
|
+
const codemods = await this.createCodemods();
|
|
67
|
+
await codemods.updateRcFile((rcFile) => {
|
|
68
|
+
rcFile.addProvider('@adonisjs/core/providers/edge_provider');
|
|
69
|
+
rcFile.addMetaFile('resources/views/**/*.edge', false);
|
|
70
|
+
});
|
|
122
71
|
}
|
|
123
72
|
/**
|
|
124
|
-
*
|
|
73
|
+
* Creates codemods as per configure command options
|
|
125
74
|
*/
|
|
126
|
-
|
|
127
|
-
const
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
this.colors.dim('# npm'),
|
|
132
|
-
this.#getInstallationCommands(devDependencies, 'npm', true),
|
|
133
|
-
this.#getInstallationCommands(prodDependencies, 'npm', false),
|
|
134
|
-
' ',
|
|
135
|
-
]
|
|
136
|
-
.concat([
|
|
137
|
-
this.colors.dim('# yarn'),
|
|
138
|
-
this.#getInstallationCommands(devDependencies, 'yarn', true),
|
|
139
|
-
this.#getInstallationCommands(prodDependencies, 'yarn', false),
|
|
140
|
-
' ',
|
|
141
|
-
])
|
|
142
|
-
.concat([
|
|
143
|
-
this.colors.dim('# pnpm'),
|
|
144
|
-
this.#getInstallationCommands(devDependencies, 'pnpm', true),
|
|
145
|
-
this.#getInstallationCommands(prodDependencies, 'pnpm', false),
|
|
146
|
-
])
|
|
147
|
-
.filter((line) => line.length)
|
|
148
|
-
.forEach((line) => instructions.add(line));
|
|
149
|
-
instructions.render();
|
|
75
|
+
async createCodemods() {
|
|
76
|
+
const codemods = await super.createCodemods();
|
|
77
|
+
codemods.overwriteExisting = this.force === true;
|
|
78
|
+
codemods.verboseInstallOutput = this.verbose === true;
|
|
79
|
+
return codemods;
|
|
150
80
|
}
|
|
151
81
|
/**
|
|
152
82
|
* Run method is invoked by ace automatically
|
|
153
83
|
*/
|
|
154
84
|
async run() {
|
|
85
|
+
if (this.name === 'vinejs') {
|
|
86
|
+
return this.#configureVineJS();
|
|
87
|
+
}
|
|
88
|
+
if (this.name === 'edge') {
|
|
89
|
+
return this.#configureEdge();
|
|
90
|
+
}
|
|
155
91
|
const packageExports = await this.#getPackageSource(this.name);
|
|
92
|
+
if (!packageExports) {
|
|
93
|
+
this.logger.error(`Cannot find module "${this.name}". Make sure to install it`);
|
|
94
|
+
this.exitCode = 1;
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
156
97
|
/**
|
|
157
98
|
* Warn, there are not instructions to run
|
|
158
99
|
*/
|
|
159
100
|
if (!packageExports.configure) {
|
|
160
|
-
this.logger.
|
|
101
|
+
this.logger.error(`Cannot configure module "${this.name}". The module does not export the configure hook`);
|
|
102
|
+
this.exitCode = 1;
|
|
161
103
|
return;
|
|
162
104
|
}
|
|
163
105
|
/**
|
|
164
|
-
*
|
|
106
|
+
* Set stubsRoot property when package exports it
|
|
165
107
|
*/
|
|
166
|
-
if (
|
|
167
|
-
this.
|
|
168
|
-
this.exitCode = 1;
|
|
169
|
-
return;
|
|
108
|
+
if (packageExports.stubsRoot) {
|
|
109
|
+
this.stubsRoot = packageExports.stubsRoot;
|
|
170
110
|
}
|
|
171
|
-
this.stubsRoot = packageExports.stubsRoot;
|
|
172
111
|
/**
|
|
173
112
|
* Run instructions
|
|
174
113
|
*/
|
|
@@ -179,5 +118,8 @@ __decorate([
|
|
|
179
118
|
args.string({ description: 'Package name' })
|
|
180
119
|
], Configure.prototype, "name", void 0);
|
|
181
120
|
__decorate([
|
|
182
|
-
flags.boolean({ description: 'Display logs in verbose mode' })
|
|
121
|
+
flags.boolean({ description: 'Display logs in verbose mode', alias: 'v' })
|
|
183
122
|
], Configure.prototype, "verbose", void 0);
|
|
123
|
+
__decorate([
|
|
124
|
+
flags.boolean({ description: 'Forcefully overwrite existing files', alias: 'f' })
|
|
125
|
+
], Configure.prototype, "force", void 0);
|
package/build/commands/eject.js
CHANGED
|
@@ -22,7 +22,8 @@ export default class Eject extends BaseCommand {
|
|
|
22
22
|
static commandName = 'eject';
|
|
23
23
|
static description = 'Eject scaffolding stubs to your application root';
|
|
24
24
|
async run() {
|
|
25
|
-
const
|
|
25
|
+
const stubs = await this.app.stubs.create();
|
|
26
|
+
const copied = await stubs.copy(this.stubPath, {
|
|
26
27
|
pkg: this.pkg,
|
|
27
28
|
});
|
|
28
29
|
copied.forEach((stubPath) => {
|
|
@@ -13,7 +13,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
13
13
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
14
14
|
};
|
|
15
15
|
import string from '@poppinss/utils/string';
|
|
16
|
-
import { EnvEditor } from '
|
|
16
|
+
import { EnvEditor } from '@adonisjs/env/editor';
|
|
17
17
|
import { BaseCommand, flags } from '../modules/ace/main.js';
|
|
18
18
|
/**
|
|
19
19
|
* The generate key command is used to generate the app key
|
|
@@ -21,7 +21,7 @@ import { BaseCommand, flags } from '../modules/ace/main.js';
|
|
|
21
21
|
*/
|
|
22
22
|
export default class GenerateKey extends BaseCommand {
|
|
23
23
|
static commandName = 'generate:key';
|
|
24
|
-
static description = 'Generate a secure random application key';
|
|
24
|
+
static description = 'Generate a cryptographically secure random application key';
|
|
25
25
|
async run() {
|
|
26
26
|
let writeToFile = process.env.NODE_ENV !== 'production';
|
|
27
27
|
if (this.force) {
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
* For the full copyright and license information, please view the LICENSE
|
|
7
7
|
* file that was distributed with this source code.
|
|
8
8
|
*/
|
|
9
|
-
import lodash from '@poppinss/utils/lodash';
|
|
10
9
|
import { BaseCommand } from '../modules/ace/main.js';
|
|
11
10
|
/**
|
|
12
11
|
* Prints the RcFile file contents to the terminal
|
|
@@ -15,6 +14,24 @@ export default class InspectRCFile extends BaseCommand {
|
|
|
15
14
|
static commandName = 'inspect:rcfile';
|
|
16
15
|
static description = 'Inspect the RC file with its default values';
|
|
17
16
|
async run() {
|
|
18
|
-
|
|
17
|
+
const { raw, providers, preloads, commands, ...rest } = this.app.rcFile;
|
|
18
|
+
this.logger.log(JSON.stringify({
|
|
19
|
+
...rest,
|
|
20
|
+
providers: providers.map((provider) => {
|
|
21
|
+
return {
|
|
22
|
+
...provider,
|
|
23
|
+
file: provider.file.toString(),
|
|
24
|
+
};
|
|
25
|
+
}),
|
|
26
|
+
preloads: preloads.map((preload) => {
|
|
27
|
+
return {
|
|
28
|
+
...preload,
|
|
29
|
+
file: preload.file.toString(),
|
|
30
|
+
};
|
|
31
|
+
}),
|
|
32
|
+
commands: commands.map((command) => {
|
|
33
|
+
return command.toString();
|
|
34
|
+
}),
|
|
35
|
+
}, null, 2));
|
|
19
36
|
}
|
|
20
37
|
}
|
|
@@ -12,8 +12,9 @@ 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
|
|
15
|
+
import { stubsRoot } from '../../stubs/main.js';
|
|
16
16
|
import { args } from '../../modules/ace/main.js';
|
|
17
|
+
import { BaseCommand } from '../../modules/ace/main.js';
|
|
17
18
|
/**
|
|
18
19
|
* Make a new ace command
|
|
19
20
|
*/
|
|
@@ -25,7 +26,9 @@ export default class MakeCommand extends BaseCommand {
|
|
|
25
26
|
*/
|
|
26
27
|
stubPath = 'make/command/main.stub';
|
|
27
28
|
async run() {
|
|
28
|
-
await this.
|
|
29
|
+
const codemods = await this.createCodemods();
|
|
30
|
+
await codemods.makeUsingStub(stubsRoot, this.stubPath, {
|
|
31
|
+
flags: this.parsed.flags,
|
|
29
32
|
entity: this.app.generators.createEntity(this.name),
|
|
30
33
|
});
|
|
31
34
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import BaseCommand from '
|
|
1
|
+
import { BaseCommand } from '../../modules/ace/main.js';
|
|
2
2
|
/**
|
|
3
3
|
* The make controller command to create an HTTP controller
|
|
4
4
|
*/
|
|
@@ -6,6 +6,7 @@ export default class MakeController extends BaseCommand {
|
|
|
6
6
|
static commandName: string;
|
|
7
7
|
static description: string;
|
|
8
8
|
name: string;
|
|
9
|
+
actions?: string[];
|
|
9
10
|
singular: boolean;
|
|
10
11
|
resource: boolean;
|
|
11
12
|
api: boolean;
|