docs(misc): expose nx init command flags in docs and the terminal help (#16433)

This commit is contained in:
Leosvel Pérez Espinosa 2023-04-27 23:20:36 +01:00 committed by GitHub
parent afa5eb59fa
commit 13a35bfb89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 92 additions and 7 deletions

View File

@ -17,14 +17,60 @@ Install `nx` globally to invoke the command directly using `nx`, or use `npx nx`
## Options ## Options
### addE2e
Type: `boolean`
Default: `false`
Set up Cypress E2E tests in integrated workspaces. Only for CRA projects.
### force
Type: `boolean`
Default: `false`
Force the migration to continue and ignore custom webpack setup or uncommitted changes. Only for CRA projects.
### help ### help
Type: `boolean` Type: `boolean`
Show help Show help
### integrated
Type: `boolean`
Default: `false`
Migrate to an Nx integrated layout workspace. Only for Angular CLI workspaces and CRA projects.
### interactive
Type: `boolean`
Default: `true`
When false disables interactive input prompts for options.
### nxCloud
Type: `boolean`
Set up distributed caching with Nx Cloud.
### version ### version
Type: `boolean` Type: `boolean`
Show version number Show version number
### vite
Type: `boolean`
Default: `true`
Use Vite as the bundler. Only for CRA projects.

View File

@ -17,14 +17,60 @@ Install `nx` globally to invoke the command directly using `nx`, or use `npx nx`
## Options ## Options
### addE2e
Type: `boolean`
Default: `false`
Set up Cypress E2E tests in integrated workspaces. Only for CRA projects.
### force
Type: `boolean`
Default: `false`
Force the migration to continue and ignore custom webpack setup or uncommitted changes. Only for CRA projects.
### help ### help
Type: `boolean` Type: `boolean`
Show help Show help
### integrated
Type: `boolean`
Default: `false`
Migrate to an Nx integrated layout workspace. Only for Angular CLI workspaces and CRA projects.
### interactive
Type: `boolean`
Default: `true`
When false disables interactive input prompts for options.
### nxCloud
Type: `boolean`
Set up distributed caching with Nx Cloud.
### version ### version
Type: `boolean` Type: `boolean`
Show version number Show version number
### vite
Type: `boolean`
Default: `true`
Use Vite as the bundler. Only for CRA projects.

View File

@ -953,45 +953,38 @@ function withListOptions(yargs) {
} }
function withInitOptions(yargs: yargs.Argv) { function withInitOptions(yargs: yargs.Argv) {
// TODO(leo): make them visible in docs/help once the feature is released in Nx 16
return yargs return yargs
.options('nxCloud', { .options('nxCloud', {
type: 'boolean', type: 'boolean',
description: 'Set up distributed caching with Nx Cloud.', description: 'Set up distributed caching with Nx Cloud.',
hidden: true,
}) })
.option('interactive', { .option('interactive', {
describe: 'When false disables interactive input prompts for options.', describe: 'When false disables interactive input prompts for options.',
type: 'boolean', type: 'boolean',
default: true, default: true,
hidden: true,
}) })
.option('integrated', { .option('integrated', {
type: 'boolean', type: 'boolean',
description: description:
'Migrate to an Nx integrated layout workspace. Only for Angular CLI workspaces and CRA projects.', 'Migrate to an Nx integrated layout workspace. Only for Angular CLI workspaces and CRA projects.',
default: false, default: false,
hidden: true,
}) })
.option('addE2e', { .option('addE2e', {
describe: describe:
'Set up Cypress E2E tests in integrated workspaces. Only for CRA projects.', 'Set up Cypress E2E tests in integrated workspaces. Only for CRA projects.',
type: 'boolean', type: 'boolean',
default: false, default: false,
hidden: true,
}) })
.option('force', { .option('force', {
describe: describe:
'Force the migration to continue and ignore custom webpack setup or uncommitted changes. Only for CRA projects.', 'Force the migration to continue and ignore custom webpack setup or uncommitted changes. Only for CRA projects.',
type: 'boolean', type: 'boolean',
default: false, default: false,
hidden: true,
}) })
.options('vite', { .options('vite', {
type: 'boolean', type: 'boolean',
description: 'Use Vite as the bundler. Only for CRA projects.', description: 'Use Vite as the bundler. Only for CRA projects.',
default: true, default: true,
hidden: true,
}) })
.options('cacheable', { .options('cacheable', {
type: 'string', type: 'string',