Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core): toggle additional prompts in CNW with a flag #9546

Merged
merged 6 commits into from Mar 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
80 changes: 80 additions & 0 deletions docs/generated/cli/create-nx-workspace.md
@@ -0,0 +1,80 @@
---
title: 'create-nx-workspace - CLI command'
description: 'Create a new Nx workspace'
---

# create-nx-workspace

Create a new Nx workspace

## Usage

```bash
create-nx-workspace [name] [options]
```

Install `create-nx-workspace` globally to invoke the command directly, or use `npx create-nx-workspace`, `yarn create nx-workspace`, or `pnpx create-nx-workspace`.

## Options

### allPrompts

Default: `false`

Show all prompts

### appName

The name of the application when a preset with pregenerated app is selected

### cli

Choices: `["nx", "angular"]`

CLI to power the Nx workspace

### defaultBase

Default: `main`

Default base to use for new projects

### help

Show help

### interactive

Enable interactive mode with presets

### name

Workspace name (e.g. org name)

### nxCloud

Default: `true`

Use Nx Cloud

### packageManager

Default: `npm`

Choices: `["npm", "pnpm", "yarn"]`

Package manager to use

### preset

Choices: `["apps", "empty", "core", "npm", "ts", "web-components", "angular", "angular-nest", "react", "react-express", "react-native", "next", "nest", "express"]`

Customizes the initial content of your workspace. To build your own see https://nx.dev/nx-plugin/overview#preset

### style

Style option to be used when a preset with pregenerated app is selected

### version

Show version number
5 changes: 5 additions & 0 deletions docs/map.json
Expand Up @@ -360,6 +360,11 @@
"name": "CLI",
"id": "cli",
"itemList": [
{
"name": "create-nx-workspace",
"id": "create-nx-workspace",
"file": "generated/cli/create-nx-workspace"
},
{
"name": "generate",
"id": "generate",
Expand Down
11 changes: 10 additions & 1 deletion e2e/utils/index.ts
Expand Up @@ -10,6 +10,7 @@ import {
copySync,
createFileSync,
ensureDirSync,
existsSync,
moveSync,
readdirSync,
readFileSync,
Expand All @@ -28,7 +29,15 @@ import chalk = require('chalk');
import isCI = require('is-ci');
import treeKill = require('tree-kill');
import { Workspaces } from '../../packages/nx/src/shared/workspace';
import { detectPackageManager } from '../../packages/create-nx-workspace/bin/package-manager';
import { PackageManager } from 'nx/src/utils/package-manager';

export function detectPackageManager(dir: string = ''): PackageManager {
return existsSync(join(dir, 'yarn.lock'))
? 'yarn'
: existsSync(join(dir, 'pnpm-lock.yaml'))
? 'pnpm'
: 'npm';
}

const kill = require('kill-port');
export const isWindows = require('is-windows');
Expand Down