cli: new new command

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2022-08-31 18:51:46 +02:00
parent ef8d8d88e5
commit 8d886dd33e
6 changed files with 64 additions and 36 deletions
+27 -3
View File
@@ -198,7 +198,7 @@ export function registerMigrateCommand(program: Command) {
export function registerCommands(program: Command) {
program
.command('create')
.command('new')
.storeOptionsAsProperties(false)
.description(
'Open up an interactive guide to creating new things in your app',
@@ -222,12 +222,36 @@ export function registerCommands(program: Command) {
.action(lazy(() => import('./create/create').then(m => m.default)));
program
.command('create-plugin')
.command('create', { hidden: true })
.storeOptionsAsProperties(false)
.description(
'Open up an interactive guide to creating new things in your app [DEPRECATED]',
)
.option(
'--select <name>',
'Select the thing you want to be creating upfront',
)
.option(
'--option <name>=<value>',
'Pre-fill options for the creation process',
(opt, arr: string[]) => [...arr, opt],
[],
)
.option('--scope <scope>', 'The scope to use for new packages')
.option(
'--npm-registry <URL>',
'The package registry to use for new packages',
)
.option('--no-private', 'Do not mark new packages as private')
.action(lazy(() => import('./create/create').then(m => m.default)));
program
.command('create-plugin', { hidden: true })
.option(
'--backend',
'Create plugin with the backend dependencies as default',
)
.description('Creates a new plugin in the current repository')
.description('Creates a new plugin in the current repository [DEPRECATED]')
.option('--scope <scope>', 'npm scope')
.option('--npm-registry <URL>', 'npm registry URL')
.option('--no-private', 'Public npm package')