feat(misc): add nx package to make installing global cli easier

This commit is contained in:
Victor Savkin 2020-07-28 22:42:54 -04:00 committed by Victor Savkin
parent 93140c5ff4
commit 3cd9f4fe6c
89 changed files with 250 additions and 83 deletions

View File

@ -79,7 +79,7 @@ Select the preset that works best for you. You can always add plugins later.
? Default stylesheet format CSS ? 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 ## Serving Application

View File

@ -15,7 +15,7 @@ can see, for each package its dependencies.
| @nrwl/react | @nrwl/cypress, @nrwl/jest, @nrwl/web | @nrwl/workspace | | @nrwl/react | @nrwl/cypress, @nrwl/jest, @nrwl/web | @nrwl/workspace |
| @nrwl/next | @nrwl/cypress, @nrwl/jest, @nrwl/web, @nrwl/react | @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/web | @nrwl/cypress, @nrwl/jest, @nrwl/linter | @nrwl/workspace |
| @nrwl/workspace | @nrwl/cli | | | @nrwl/workspace | nx | |
## Angular ## Angular

View File

@ -8,7 +8,7 @@ Print applications affected by changes
nx affected:apps 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 ### Examples

View File

@ -8,7 +8,7 @@ Build applications and publishable libraries affected by changes
nx affected:build 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 ### Examples

View File

@ -8,7 +8,7 @@ Graph dependencies affected by changes
nx affected:dep-graph 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 ### Examples

View File

@ -8,7 +8,7 @@ Run e2e tests for the applications affected by changes
nx affected:e2e 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 ### Examples

View File

@ -8,7 +8,7 @@ Print libraries affected by changes
nx affected:libs 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 ### Examples

View File

@ -8,7 +8,7 @@ Lint projects affected by changes
nx affected:lint 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 ### Examples

View File

@ -8,7 +8,7 @@ Test projects affected by changes
nx affected:test 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 ### Examples

View File

@ -8,7 +8,7 @@ Run task for affected projects
nx affected 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 ### Examples

View File

@ -16,7 +16,7 @@ nx build <project> [options]
nx run <project>:build [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 ### Examples

View File

@ -8,7 +8,7 @@ Graph dependencies within workspace
nx dep-graph 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 ### Examples

View File

@ -16,7 +16,7 @@ nx e2e <project>
nx run <project>:e2e 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 ### Examples

View File

@ -8,7 +8,7 @@ Check for un-formatted files
nx format:check 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 ## Options

View File

@ -8,7 +8,7 @@ Overwrite un-formatted files
nx format:write 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 ## Options

View File

@ -12,7 +12,7 @@ nx generate <collection:schematic>
nx g <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 ### Examples

View File

@ -16,7 +16,7 @@ nx lint <project> [options]
nx run <project>:lint [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 ### Examples

View File

@ -8,7 +8,7 @@ Lists installed plugins, capabilities of installed plugins and other available p
nx list 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 ### Examples

View File

@ -10,7 +10,7 @@
nx migrate 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 ### Examples

View File

@ -8,7 +8,7 @@ Graph execution plan
nx print-affected 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 ### Examples

View File

@ -8,7 +8,7 @@ Reports useful version numbers to copy into the Nx issue template
nx report 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 ## Options

View File

@ -8,7 +8,7 @@ Run task for multiple projects
nx run-many 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 ### Examples

View File

@ -8,7 +8,7 @@ Runs an Architect target with an optional custom builder configuration defined i
nx run <target> [options] 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 ### Examples

View File

@ -16,7 +16,7 @@ nx serve <project> [options]
nx run <project>:serve [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 ### Examples

View File

@ -16,7 +16,7 @@ nx test <project> [options]
nx run <project>:test [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 ### Examples

View File

@ -8,7 +8,7 @@ Lint workspace or list of files. Note: To exclude files from this lint rule, you
nx workspace-lint 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 ## Options

View File

@ -8,7 +8,7 @@ Runs a workspace schematic from the tools/schematics directory
nx workspace-schematic 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 ## Options

View File

@ -30,13 +30,13 @@ Install the Nx CLI globally on your system using your preferred package manager:
Using npm: Using npm:
```bash ```bash
npm install -g @nrwl/cli npm install -g nx
``` ```
Using yarn: Using yarn:
```bash ```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. After that, you will have an `nx` executable you can use to run commands in your workspace.

View File

@ -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: To fix it, you can either install the `nx` cli globally by running:
```bash ```bash
npm install -g @nrwl/cli npm install -g nx
``` ```
or or
```bash ```bash
yarn global add @nrwl/cli yarn global add nx
``` ```
Or you can prepend every command with `npm run`: Or you can prepend every command with `npm run`:

View File

@ -5,7 +5,7 @@ can see, for each package its dependencies.
| PackageName | Dependencies | PeerDependencies | | PackageName | Dependencies | PeerDependencies |
| --------------- | ------------------------------------------------- | ---------------- | | --------------- | ------------------------------------------------- | ---------------- |
| @nrwl/workspace | @nrwl/cli | | | @nrwl/workspace | nx | |
| @nrwl/react | @nrwl/cypress, @nrwl/jest, @nrwl/web | @nrwl/workspace | | @nrwl/react | @nrwl/cypress, @nrwl/jest, @nrwl/web | @nrwl/workspace |
| @nrwl/next | @nrwl/cypress, @nrwl/jest, @nrwl/web, @nrwl/react | @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/web | @nrwl/cypress, @nrwl/jest, @nrwl/linter | @nrwl/workspace |

View File

@ -8,7 +8,7 @@ Print applications affected by changes
nx affected:apps 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 ### Examples

View File

@ -8,7 +8,7 @@ Build applications and publishable libraries affected by changes
nx affected:build 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 ### Examples

View File

@ -8,7 +8,7 @@ Graph dependencies affected by changes
nx affected:dep-graph 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 ### Examples

View File

@ -8,7 +8,7 @@ Run e2e tests for the applications affected by changes
nx affected:e2e 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 ### Examples

View File

@ -8,7 +8,7 @@ Print libraries affected by changes
nx affected:libs 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 ### Examples

View File

@ -8,7 +8,7 @@ Lint projects affected by changes
nx affected:lint 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 ### Examples

View File

@ -8,7 +8,7 @@ Test projects affected by changes
nx affected:test 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 ### Examples

View File

@ -8,7 +8,7 @@ Run task for affected projects
nx affected 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 ### Examples

View File

@ -16,7 +16,7 @@ nx build <project> [options]
nx run <project>:build [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 ### Examples

View File

@ -8,7 +8,7 @@ Graph dependencies within workspace
nx dep-graph 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 ### Examples

View File

@ -16,7 +16,7 @@ nx e2e <project>
nx run <project>:e2e 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 ### Examples

View File

@ -8,7 +8,7 @@ Check for un-formatted files
nx format:check 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 ## Options

View File

@ -8,7 +8,7 @@ Overwrite un-formatted files
nx format:write 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 ## Options

View File

@ -12,7 +12,7 @@ nx generate <collection:schematic>
nx g <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 ### Examples

View File

@ -16,7 +16,7 @@ nx lint <project> [options]
nx run <project>:lint [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 ### Examples

View File

@ -8,7 +8,7 @@ Lists installed plugins, capabilities of installed plugins and other available p
nx list 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 ### Examples

View File

@ -10,7 +10,7 @@
nx migrate 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 ### Examples

View File

@ -8,7 +8,7 @@ Graph execution plan
nx print-affected 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 ### Examples

View File

@ -8,7 +8,7 @@ Reports useful version numbers to copy into the Nx issue template
nx report 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 ## Options

View File

@ -8,7 +8,7 @@ Run task for multiple projects
nx run-many 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 ### Examples

View File

@ -8,7 +8,7 @@ Runs an Architect target with an optional custom builder configuration defined i
nx run <target> [options] 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 ### Examples

View File

@ -16,7 +16,7 @@ nx serve <project> [options]
nx run <project>:serve [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 ### Examples

View File

@ -16,7 +16,7 @@ nx test <project> [options]
nx run <project>:test [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 ### Examples

View File

@ -8,7 +8,7 @@ Lint workspace or list of files. Note: To exclude files from this lint rule, you
nx workspace-lint 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 ## Options

View File

@ -8,7 +8,7 @@ Runs a workspace schematic from the tools/schematics directory
nx workspace-schematic 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 ## Options

View File

@ -16,13 +16,13 @@ Install the Nx CLI globally on your system using your preferred package manager:
Using npm: Using npm:
```bash ```bash
npm install -g @nrwl/cli npm install -g nx
``` ```
Using yarn: Using yarn:
```bash ```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. After that, you will have an `nx` executable you can use to run commands in your workspace.

View File

@ -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: To fix it, you can either install the `nx` cli globally by running:
```bash ```bash
npm install -g @nrwl/cli npm install -g nx
``` ```
or or
```bash ```bash
yarn global add @nrwl/cli yarn global add nx
``` ```
Or you can prepend every command with `npm run`: Or you can prepend every command with `npm run`:

View File

@ -16,7 +16,7 @@ nx build <project> [options]
nx run <project>:build [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 ### Examples

View File

@ -16,7 +16,7 @@ nx e2e <project>
nx run <project>:e2e 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 ### Examples

View File

@ -12,7 +12,7 @@ nx generate <collection:schematic>
nx g <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 ### Examples

View File

@ -16,7 +16,7 @@ nx lint <project> [options]
nx run <project>:lint [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 ### Examples

View File

@ -8,7 +8,7 @@ Runs an Architect target with an optional custom builder configuration defined i
nx run <target> [options] 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 ### Examples

View File

@ -16,7 +16,7 @@ nx serve <project> [options]
nx run <project>:serve [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 ### Examples

View File

@ -16,7 +16,7 @@ nx test <project> [options]
nx run <project>:test [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 ### Examples

View File

@ -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. To debug failing tests using Chrome Devtools or an IDE you can run the test command through node's `--inspect-brk` flag.
```bash ```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. 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.

View File

@ -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: Once you've activated the `autoAttach` option, set a breakpoint in VSCode and execute your schematic with the `--inspect-brk` flag:
```sh ```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. You may want to use the `--dry-run` flag to not actually apply the changes to the file system.

View File

@ -27,6 +27,9 @@
"libsDir": "packages" "libsDir": "packages"
}, },
"projects": { "projects": {
"nx": {
"tags": []
},
"tao": { "tao": {
"tags": [] "tags": []
}, },

View File

@ -8,8 +8,12 @@
{{what-is-nx}} {{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}} {{resources}}

View File

@ -1,7 +1,7 @@
{ {
"name": "@nrwl/cli", "name": "@nrwl/cli",
"version": "0.0.1", "version": "0.0.1",
"description": "", "description": "Extensible Dev Tools for Monorepos",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git+https://github.com/nrwl/nx.git" "url": "git+https://github.com/nrwl/nx.git"

View File

@ -16,7 +16,7 @@ export function showNxWarning(workspaceName: string) {
title: `Nx CLI is not installed globally.`, title: `Nx CLI is not installed globally.`,
bodyLines: [ bodyLines: [
`This means that you might have to use "yarn nx" or "npm nx" to execute commands in the workspace.`, `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.`,
], ],
}); });
} }

View File

@ -17,7 +17,7 @@
? Default stylesheet format CSS ? 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 ## Serving Application

View File

@ -16,7 +16,7 @@ export function showNxWarning(workspaceName: string) {
title: `Nx CLI is not installed globally.`, title: `Nx CLI is not installed globally.`,
bodyLines: [ bodyLines: [
`This means that you might have to use "yarn nx" or "npm nx" to execute commands in the workspace.`, `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.`,
], ],
}); });
} }

View File

@ -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`. 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 ### Serving Application

View File

@ -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`. 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 ### Serving Application

View File

@ -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`. 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 ### Serving Application

1
packages/nx/.eslintrc Normal file
View File

@ -0,0 +1 @@
{ "extends": "../../.eslintrc", "rules": {}, "ignorePatterns": ["!**/*"] }

19
packages/nx/README.md Normal file
View 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}}

View 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
View 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
View File

@ -0,0 +1,16 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"types": ["node", "jest"]
},
"include": [],
"files": [],
"references": [
{
"path": "./tsconfig.lib.json"
},
{
"path": "./tsconfig.spec.json"
}
]
}

View 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"]
}

View 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"
]
}

View File

@ -17,7 +17,7 @@
? Default stylesheet format CSS ? 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 ### Serving Application

View File

@ -16,7 +16,7 @@ web components [a workspace with a single app built using web components] ?
Application name myapp ? Default stylesheet format CSS 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 ### Serving Application

View File

@ -10,7 +10,7 @@
{{getting-started}} {{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 ### Serving Application

View File

@ -5,6 +5,7 @@ import { appRootPath } from '../utils/app-root';
import { output } from '../utils/output'; import { output } from '../utils/output';
export const packagesWeCareAbout = [ export const packagesWeCareAbout = [
'nx',
'@nrwl/angular', '@nrwl/angular',
'@nrwl/cli', '@nrwl/cli',
'@nrwl/cypress', '@nrwl/cypress',

View File

@ -450,7 +450,7 @@ Promise.all(
nx ${command.command} 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) { if (examples[command.command] && examples[command.command].length > 0) {
template += `### Examples`; template += `### Examples`;

View File

@ -152,6 +152,7 @@ const pkgFiles = [
'build/npm/eslint-plugin-nx/package.json', 'build/npm/eslint-plugin-nx/package.json',
'build/npm/linter/package.json', 'build/npm/linter/package.json',
'build/npm/nx-plugin/package.json', 'build/npm/nx-plugin/package.json',
'build/npm/nx/package.json',
]; ];
/** /**
* Set the static options for release-it * Set the static options for release-it

View File

@ -1,6 +1,62 @@
{ {
"version": 1, "version": 1,
"projects": { "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": { "tao": {
"root": "packages/tao", "root": "packages/tao",
"sourceRoot": "packages/tao", "sourceRoot": "packages/tao",