feat(misc): add nx package to make installing global cli easier
This commit is contained in:
parent
93140c5ff4
commit
3cd9f4fe6c
@ -79,7 +79,7 @@ Select the preset that works best for you. You can always add plugins later.
|
||||
? Default stylesheet format CSS
|
||||
```
|
||||
|
||||
If it's your first Nx project, the command will recommend you to install `@nrwl/cli` globally, so you can invoke `nx` directly without going through yarn or npm.
|
||||
If it's your first Nx project, the command will recommend you to install the `nx` package globally, so you can invoke `nx` directly without going through yarn or npm.
|
||||
|
||||
## Serving Application
|
||||
|
||||
|
||||
@ -15,7 +15,7 @@ can see, for each package its dependencies.
|
||||
| @nrwl/react | @nrwl/cypress, @nrwl/jest, @nrwl/web | @nrwl/workspace |
|
||||
| @nrwl/next | @nrwl/cypress, @nrwl/jest, @nrwl/web, @nrwl/react | @nrwl/workspace |
|
||||
| @nrwl/web | @nrwl/cypress, @nrwl/jest, @nrwl/linter | @nrwl/workspace |
|
||||
| @nrwl/workspace | @nrwl/cli | |
|
||||
| @nrwl/workspace | nx | |
|
||||
|
||||
## Angular
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ Print applications affected by changes
|
||||
nx affected:apps
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install `nx` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ Build applications and publishable libraries affected by changes
|
||||
nx affected:build
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install `nx` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ Graph dependencies affected by changes
|
||||
nx affected:dep-graph
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install `nx` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ Run e2e tests for the applications affected by changes
|
||||
nx affected:e2e
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install `nx` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ Print libraries affected by changes
|
||||
nx affected:libs
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install `nx` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ Lint projects affected by changes
|
||||
nx affected:lint
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install `nx` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ Test projects affected by changes
|
||||
nx affected:test
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install `nx` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ Run task for affected projects
|
||||
nx affected
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install `nx` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@ -16,7 +16,7 @@ nx build <project> [options]
|
||||
nx run <project>:build [options]
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install the `nx` package globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ Graph dependencies within workspace
|
||||
nx dep-graph
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install `nx` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@ -16,7 +16,7 @@ nx e2e <project>
|
||||
nx run <project>:e2e
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install the `nx` package globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ Check for un-formatted files
|
||||
nx format:check
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install `nx` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
## Options
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ Overwrite un-formatted files
|
||||
nx format:write
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install `nx` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
## Options
|
||||
|
||||
|
||||
@ -12,7 +12,7 @@ nx generate <collection:schematic>
|
||||
nx g <schematic>
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install the `nx` package globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@ -16,7 +16,7 @@ nx lint <project> [options]
|
||||
nx run <project>:lint [options]
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install the `nx` package globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ Lists installed plugins, capabilities of installed plugins and other available p
|
||||
nx list
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install `nx` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
nx migrate
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install `nx` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ Graph execution plan
|
||||
nx print-affected
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install `nx` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ Reports useful version numbers to copy into the Nx issue template
|
||||
nx report
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install `nx` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
## Options
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ Run task for multiple projects
|
||||
nx run-many
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install `nx` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ Runs an Architect target with an optional custom builder configuration defined i
|
||||
nx run <target> [options]
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install the `nx` package globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@ -16,7 +16,7 @@ nx serve <project> [options]
|
||||
nx run <project>:serve [options]
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install the `nx` package globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@ -16,7 +16,7 @@ nx test <project> [options]
|
||||
nx run <project>:test [options]
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install the `nx` package globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ Lint workspace or list of files. Note: To exclude files from this lint rule, you
|
||||
nx workspace-lint
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install `nx` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
## Options
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ Runs a workspace schematic from the tools/schematics directory
|
||||
nx workspace-schematic
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install `nx` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
## Options
|
||||
|
||||
|
||||
@ -30,13 +30,13 @@ Install the Nx CLI globally on your system using your preferred package manager:
|
||||
Using npm:
|
||||
|
||||
```bash
|
||||
npm install -g @nrwl/cli
|
||||
npm install -g nx
|
||||
```
|
||||
|
||||
Using yarn:
|
||||
|
||||
```bash
|
||||
yarn global add @nrwl/cli
|
||||
yarn global add nx
|
||||
```
|
||||
|
||||
After that, you will have an `nx` executable you can use to run commands in your workspace.
|
||||
|
||||
@ -85,13 +85,13 @@ Depending on how your dev env is set up, the command above might result in `Comm
|
||||
To fix it, you can either install the `nx` cli globally by running:
|
||||
|
||||
```bash
|
||||
npm install -g @nrwl/cli
|
||||
npm install -g nx
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```bash
|
||||
yarn global add @nrwl/cli
|
||||
yarn global add nx
|
||||
```
|
||||
|
||||
Or you can prepend every command with `npm run`:
|
||||
|
||||
@ -5,7 +5,7 @@ can see, for each package its dependencies.
|
||||
|
||||
| PackageName | Dependencies | PeerDependencies |
|
||||
| --------------- | ------------------------------------------------- | ---------------- |
|
||||
| @nrwl/workspace | @nrwl/cli | |
|
||||
| @nrwl/workspace | nx | |
|
||||
| @nrwl/react | @nrwl/cypress, @nrwl/jest, @nrwl/web | @nrwl/workspace |
|
||||
| @nrwl/next | @nrwl/cypress, @nrwl/jest, @nrwl/web, @nrwl/react | @nrwl/workspace |
|
||||
| @nrwl/web | @nrwl/cypress, @nrwl/jest, @nrwl/linter | @nrwl/workspace |
|
||||
|
||||
@ -8,7 +8,7 @@ Print applications affected by changes
|
||||
nx affected:apps
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install `nx` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ Build applications and publishable libraries affected by changes
|
||||
nx affected:build
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install `nx` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ Graph dependencies affected by changes
|
||||
nx affected:dep-graph
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install `nx` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ Run e2e tests for the applications affected by changes
|
||||
nx affected:e2e
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install `nx` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ Print libraries affected by changes
|
||||
nx affected:libs
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install `nx` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ Lint projects affected by changes
|
||||
nx affected:lint
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install `nx` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ Test projects affected by changes
|
||||
nx affected:test
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install `nx` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ Run task for affected projects
|
||||
nx affected
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install `nx` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@ -16,7 +16,7 @@ nx build <project> [options]
|
||||
nx run <project>:build [options]
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install the `nx` package globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ Graph dependencies within workspace
|
||||
nx dep-graph
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install `nx` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@ -16,7 +16,7 @@ nx e2e <project>
|
||||
nx run <project>:e2e
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install the `nx` package globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ Check for un-formatted files
|
||||
nx format:check
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install `nx` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
## Options
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ Overwrite un-formatted files
|
||||
nx format:write
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install `nx` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
## Options
|
||||
|
||||
|
||||
@ -12,7 +12,7 @@ nx generate <collection:schematic>
|
||||
nx g <schematic>
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install the `nx` package globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@ -16,7 +16,7 @@ nx lint <project> [options]
|
||||
nx run <project>:lint [options]
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install the `nx` package globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ Lists installed plugins, capabilities of installed plugins and other available p
|
||||
nx list
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install `nx` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
nx migrate
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install `nx` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ Graph execution plan
|
||||
nx print-affected
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install `nx` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ Reports useful version numbers to copy into the Nx issue template
|
||||
nx report
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install `nx` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
## Options
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ Run task for multiple projects
|
||||
nx run-many
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install `nx` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ Runs an Architect target with an optional custom builder configuration defined i
|
||||
nx run <target> [options]
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install the `nx` package globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@ -16,7 +16,7 @@ nx serve <project> [options]
|
||||
nx run <project>:serve [options]
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install the `nx` package globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@ -16,7 +16,7 @@ nx test <project> [options]
|
||||
nx run <project>:test [options]
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install the `nx` package globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ Lint workspace or list of files. Note: To exclude files from this lint rule, you
|
||||
nx workspace-lint
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install `nx` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
## Options
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ Runs a workspace schematic from the tools/schematics directory
|
||||
nx workspace-schematic
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install `nx` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
## Options
|
||||
|
||||
|
||||
@ -16,13 +16,13 @@ Install the Nx CLI globally on your system using your preferred package manager:
|
||||
Using npm:
|
||||
|
||||
```bash
|
||||
npm install -g @nrwl/cli
|
||||
npm install -g nx
|
||||
```
|
||||
|
||||
Using yarn:
|
||||
|
||||
```bash
|
||||
yarn global add @nrwl/cli
|
||||
yarn global add nx
|
||||
```
|
||||
|
||||
After that, you will have an `nx` executable you can use to run commands in your workspace.
|
||||
|
||||
@ -81,13 +81,13 @@ Depending on how your dev env is set up, the command above might result in `Comm
|
||||
To fix it, you can either install the `nx` cli globally by running:
|
||||
|
||||
```bash
|
||||
npm install -g @nrwl/cli
|
||||
npm install -g nx
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```bash
|
||||
yarn global add @nrwl/cli
|
||||
yarn global add nx
|
||||
```
|
||||
|
||||
Or you can prepend every command with `npm run`:
|
||||
|
||||
@ -16,7 +16,7 @@ nx build <project> [options]
|
||||
nx run <project>:build [options]
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install the `nx` package globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@ -16,7 +16,7 @@ nx e2e <project>
|
||||
nx run <project>:e2e
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install the `nx` package globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@ -12,7 +12,7 @@ nx generate <collection:schematic>
|
||||
nx g <schematic>
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install the `nx` package globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@ -16,7 +16,7 @@ nx lint <project> [options]
|
||||
nx run <project>:lint [options]
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install the `nx` package globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ Runs an Architect target with an optional custom builder configuration defined i
|
||||
nx run <target> [options]
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install the `nx` package globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@ -16,7 +16,7 @@ nx serve <project> [options]
|
||||
nx run <project>:serve [options]
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install the `nx` package globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@ -16,7 +16,7 @@ nx test <project> [options]
|
||||
nx run <project>:test [options]
|
||||
```
|
||||
|
||||
Install `@nrwl/cli` globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
Install the `nx` package globally to invoke the command directly using `nx`, or use `npm run nx` or `yarn nx`.
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@ -104,7 +104,7 @@ nx test libname --watch
|
||||
To debug failing tests using Chrome Devtools or an IDE you can run the test command through node's `--inspect-brk` flag.
|
||||
|
||||
```bash
|
||||
node --inspect-brk ./node_modules/@nrwl/cli/bin/nx test libname
|
||||
node --inspect-brk ./node_modules/nx/bin/nx test libname
|
||||
```
|
||||
|
||||
Now, you can visit [chrome://inspect](chrome://inspect) in Chrome and inspect the target to attach to the node process. You can now use Chrome Devtools to step through your code line by line and debug the cause of the failing tests. Visit the official [Jest documentation](https://jestjs.io/docs/en/troubleshooting#tests-are-failing-and-you-don-t-know-why) to find out more.
|
||||
|
||||
@ -296,7 +296,7 @@ Alternatively press <kbd>Cmd</kbd>+<kbd>P</kbd> (or <kbd>Ctrl</kbd>+<kbd>P</kbd>
|
||||
Once you've activated the `autoAttach` option, set a breakpoint in VSCode and execute your schematic with the `--inspect-brk` flag:
|
||||
|
||||
```sh
|
||||
node --inspect-brk ./node_modules/@nrwl/cli/bin/nx.js workspace-schematic my-schematic mylib --dry-run
|
||||
node --inspect-brk ./node_modules/nx/bin/nx.js workspace-schematic my-schematic mylib --dry-run
|
||||
```
|
||||
|
||||
You may want to use the `--dry-run` flag to not actually apply the changes to the file system.
|
||||
|
||||
3
nx.json
3
nx.json
@ -27,6 +27,9 @@
|
||||
"libsDir": "packages"
|
||||
},
|
||||
"projects": {
|
||||
"nx": {
|
||||
"tags": []
|
||||
},
|
||||
"tao": {
|
||||
"tags": []
|
||||
},
|
||||
|
||||
@ -8,8 +8,12 @@
|
||||
|
||||
{{what-is-nx}}
|
||||
|
||||
## How to Use
|
||||
{{getting-started}}
|
||||
|
||||
This package is used by the `@nrwl/workspace`. See [https://github.com/nrwl/nx](https://github.com/nrwl/nx) for more information.
|
||||
### Serving Application
|
||||
|
||||
- Run `nx serve myapp` to serve the newly generated application!
|
||||
- Run `nx test myapp` to test it.
|
||||
- Run `nx e2e myapp-e2e` to run e2e tests for it.
|
||||
|
||||
{{resources}}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@nrwl/cli",
|
||||
"version": "0.0.1",
|
||||
"description": "",
|
||||
"description": "Extensible Dev Tools for Monorepos",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/nrwl/nx.git"
|
||||
|
||||
@ -16,7 +16,7 @@ export function showNxWarning(workspaceName: string) {
|
||||
title: `Nx CLI is not installed globally.`,
|
||||
bodyLines: [
|
||||
`This means that you might have to use "yarn nx" or "npm nx" to execute commands in the workspace.`,
|
||||
`Run "yarn global add @nrwl/cli" or "npm install -g @nrwl/cli" to be able to execute command directly.`,
|
||||
`Run "yarn global add nx" or "npm install -g nx" to be able to execute command directly.`,
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
? Default stylesheet format CSS
|
||||
```
|
||||
|
||||
If it's your first Nx project, the command will recommend you to install `@nrwl/cli` globally, so you can invoke `nx` directly without going through yarn or npm.
|
||||
If it's your first Nx project, the command will recommend you to install the `nx` package globally, so you can invoke `nx` directly without going through yarn or npm.
|
||||
|
||||
## Serving Application
|
||||
|
||||
|
||||
@ -16,7 +16,7 @@ export function showNxWarning(workspaceName: string) {
|
||||
title: `Nx CLI is not installed globally.`,
|
||||
bodyLines: [
|
||||
`This means that you might have to use "yarn nx" or "npm nx" to execute commands in the workspace.`,
|
||||
`Run "yarn global add @nrwl/cli" or "npm install -g @nrwl/cli" to be able to execute command directly.`,
|
||||
`Run "yarn global add nx" or "npm install -g nx" to be able to execute command directly.`,
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
@ -33,7 +33,7 @@ Select the preset that works best for you.
|
||||
|
||||
You can also select `empty` and add `@nrwl/express` plugin using yarn or npm, and then generate a new express app using `nx g @nrwl/express:app myapp`.
|
||||
|
||||
If it's your first Nx project, the command will recommend you to install `@nrwl/cli` globally, so you can invoke `nx` directly without going through yarn or npm.
|
||||
If it's your first Nx project, the command will recommend you to install the `nx` package globally, so you can invoke `nx` directly without going through yarn or npm.
|
||||
|
||||
### Serving Application
|
||||
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
You can also select `empty` and add `@nrwl/nest` plugin using yarn or npm, and then generate a new express app using `nx g @nrwl/nest:app myapp`.
|
||||
|
||||
If it's your first Nx project, the command will recommend you to install `@nrwl/cli` globally, so you can invoke `nx` directly without going through yarn or npm.
|
||||
If it's your first Nx project, the command will recommend you to install the `nx` package globally, so you can invoke `nx` directly without going through yarn or npm.
|
||||
|
||||
### Serving Application
|
||||
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
You can also select `empty` and add `@nrwl/next` plugin using yarn or npm, and then generate a new express app using `nx g @nrwl/next:app myapp`.
|
||||
|
||||
If it's your first Nx project, the command will recommend you to install `@nrwl/cli` globally, so you can invoke `nx` directly without going through yarn or npm.
|
||||
If it's your first Nx project, the command will recommend you to install the `nx` package globally, so you can invoke `nx` directly without going through yarn or npm.
|
||||
|
||||
### Serving Application
|
||||
|
||||
|
||||
1
packages/nx/.eslintrc
Normal file
1
packages/nx/.eslintrc
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "../../.eslintrc", "rules": {}, "ignorePatterns": ["!**/*"] }
|
||||
19
packages/nx/README.md
Normal file
19
packages/nx/README.md
Normal file
@ -0,0 +1,19 @@
|
||||
<p align="center"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx.png" width="600"></p>
|
||||
|
||||
{{links}}
|
||||
|
||||
<hr>
|
||||
|
||||
# Nx CLI
|
||||
|
||||
{{what-is-nx}}
|
||||
|
||||
{{getting-started}}
|
||||
|
||||
### Serving Application
|
||||
|
||||
- Run `nx serve myapp` to serve the newly generated application!
|
||||
- Run `nx test myapp` to test it.
|
||||
- Run `nx e2e myapp-e2e` to run e2e tests for it.
|
||||
|
||||
{{resources}}
|
||||
9
packages/nx/jest.config.js
Normal file
9
packages/nx/jest.config.js
Normal file
@ -0,0 +1,9 @@
|
||||
module.exports = {
|
||||
name: 'cli',
|
||||
preset: '../../jest.config.js',
|
||||
transform: {
|
||||
'^.+\\.[tj]sx?$': 'ts-jest',
|
||||
},
|
||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
|
||||
globals: { 'ts-jest': { tsConfig: '<rootDir>/tsconfig.spec.json' } },
|
||||
};
|
||||
29
packages/nx/package.json
Normal file
29
packages/nx/package.json
Normal file
@ -0,0 +1,29 @@
|
||||
{
|
||||
"name": "nx",
|
||||
"version": "0.0.1",
|
||||
"description": "Extensible Dev Tools for Monorepos",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/nrwl/nx.git"
|
||||
},
|
||||
"keywords": [
|
||||
"Monorepo",
|
||||
"Angular",
|
||||
"React",
|
||||
"Web",
|
||||
"Node",
|
||||
"Nest",
|
||||
"Jest",
|
||||
"Cypress",
|
||||
"CLI"
|
||||
],
|
||||
"author": "Victor Savkin",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/nrwl/nx/issues"
|
||||
},
|
||||
"homepage": "https://nx.dev",
|
||||
"dependencies": {
|
||||
"@nrwl/cli": "*"
|
||||
}
|
||||
}
|
||||
16
packages/nx/tsconfig.json
Normal file
16
packages/nx/tsconfig.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"types": ["node", "jest"]
|
||||
},
|
||||
"include": [],
|
||||
"files": [],
|
||||
"references": [
|
||||
{
|
||||
"path": "./tsconfig.lib.json"
|
||||
},
|
||||
{
|
||||
"path": "./tsconfig.spec.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
12
packages/nx/tsconfig.lib.json
Normal file
12
packages/nx/tsconfig.lib.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"outDir": "../../dist/out-tsc",
|
||||
"declaration": true,
|
||||
"rootDir": "./",
|
||||
"types": ["node"]
|
||||
},
|
||||
"exclude": ["**/*.spec.ts", "**/*_spec.ts"],
|
||||
"include": ["**/*.ts"]
|
||||
}
|
||||
16
packages/nx/tsconfig.spec.json
Normal file
16
packages/nx/tsconfig.spec.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../../dist/out-tsc",
|
||||
"module": "commonjs",
|
||||
"types": ["jest", "node"]
|
||||
},
|
||||
"include": [
|
||||
"**/*.spec.ts",
|
||||
"**/*_spec.ts",
|
||||
"**/*.spec.tsx",
|
||||
"**/*.spec.js",
|
||||
"**/*.spec.jsx",
|
||||
"**/*.d.ts"
|
||||
]
|
||||
}
|
||||
@ -17,7 +17,7 @@
|
||||
? Default stylesheet format CSS
|
||||
```
|
||||
|
||||
If it's your first Nx project, the command will recommend you to install `@nrwl/cli` globally, so you can invoke `nx` directly without going through yarn or npm.
|
||||
If it's your first Nx project, the command will recommend you to install the `nx` package globally, so you can invoke `nx` directly without going through yarn or npm.
|
||||
|
||||
### Serving Application
|
||||
|
||||
|
||||
@ -16,7 +16,7 @@ web components [a workspace with a single app built using web components] ?
|
||||
Application name myapp ? Default stylesheet format CSS
|
||||
```
|
||||
|
||||
If it's your first Nx project, the command will recommend you to install `@nrwl/cli` globally, so you can invoke `nx` directly without going through yarn or npm.
|
||||
If it's your first Nx project, the command will recommend you to install the `nx` package globally, so you can invoke `nx` directly without going through yarn or npm.
|
||||
|
||||
### Serving Application
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
|
||||
{{getting-started}}
|
||||
|
||||
If it's your first Nx project, the command will recommend you to install `@nrwl/cli` globally, so you can invoke `nx` directly without going through yarn or npm.
|
||||
If it's your first Nx project, the command will recommend you to install the `nx` package globally, so you can invoke `nx` directly without going through yarn or npm.
|
||||
|
||||
### Serving Application
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ import { appRootPath } from '../utils/app-root';
|
||||
import { output } from '../utils/output';
|
||||
|
||||
export const packagesWeCareAbout = [
|
||||
'nx',
|
||||
'@nrwl/angular',
|
||||
'@nrwl/cli',
|
||||
'@nrwl/cypress',
|
||||
|
||||
@ -450,7 +450,7 @@ Promise.all(
|
||||
nx ${command.command}
|
||||
\`\`\`
|
||||
|
||||
Install \`@nrwl/cli\` globally to invoke the command directly using \`nx\`, or use \`npm run nx\` or \`yarn nx\`.\n`;
|
||||
Install \`nx\` globally to invoke the command directly using \`nx\`, or use \`npm run nx\` or \`yarn nx\`.\n`;
|
||||
|
||||
if (examples[command.command] && examples[command.command].length > 0) {
|
||||
template += `### Examples`;
|
||||
|
||||
@ -152,6 +152,7 @@ const pkgFiles = [
|
||||
'build/npm/eslint-plugin-nx/package.json',
|
||||
'build/npm/linter/package.json',
|
||||
'build/npm/nx-plugin/package.json',
|
||||
'build/npm/nx/package.json',
|
||||
];
|
||||
/**
|
||||
* Set the static options for release-it
|
||||
|
||||
@ -1,6 +1,62 @@
|
||||
{
|
||||
"version": 1,
|
||||
"projects": {
|
||||
"nx": {
|
||||
"root": "packages/nx",
|
||||
"sourceRoot": "packages/nx",
|
||||
"projectType": "library",
|
||||
"schematics": {},
|
||||
"architect": {
|
||||
"build-base": {
|
||||
"builder": "@nrwl/node:package",
|
||||
"options": {
|
||||
"outputPath": "build/packages/nx",
|
||||
"tsConfig": "packages/nx/tsconfig.lib.json",
|
||||
"packageJson": "packages/nx/package.json",
|
||||
"main": "packages/nx/index.ts",
|
||||
"updateBuildableProjectDepsInPackageJson": false,
|
||||
"assets": [
|
||||
{
|
||||
"input": "packages/nx",
|
||||
"glob": "**/files/**",
|
||||
"output": "/"
|
||||
},
|
||||
{
|
||||
"input": "packages/nx",
|
||||
"glob": "**/files/**/.gitkeep",
|
||||
"output": "/"
|
||||
},
|
||||
{
|
||||
"input": "packages/nx",
|
||||
"glob": "**/*.json",
|
||||
"output": "/"
|
||||
},
|
||||
{
|
||||
"input": "packages/nx",
|
||||
"glob": "**/*.js",
|
||||
"output": "/"
|
||||
},
|
||||
"LICENSE"
|
||||
]
|
||||
}
|
||||
},
|
||||
"build": {
|
||||
"builder": "@nrwl/workspace:run-commands",
|
||||
"outputs": ["build/packages/nx"],
|
||||
"options": {
|
||||
"commands": [
|
||||
{
|
||||
"command": "nx build-base nx"
|
||||
},
|
||||
{
|
||||
"command": "node ./scripts/copy-readme.js nx"
|
||||
}
|
||||
],
|
||||
"parallel": false
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"tao": {
|
||||
"root": "packages/tao",
|
||||
"sourceRoot": "packages/tao",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user