From 3cd9f4fe6c2f4ad51576b8aae4301e7da31e4775 Mon Sep 17 00:00:00 2001 From: Victor Savkin Date: Tue, 28 Jul 2020 22:42:54 -0400 Subject: [PATCH] feat(misc): add nx package to make installing global cli easier --- README.md | 2 +- docs/angular/api/home.md | 2 +- docs/angular/cli/affected-apps.md | 2 +- docs/angular/cli/affected-build.md | 2 +- docs/angular/cli/affected-dep-graph.md | 2 +- docs/angular/cli/affected-e2e.md | 2 +- docs/angular/cli/affected-libs.md | 2 +- docs/angular/cli/affected-lint.md | 2 +- docs/angular/cli/affected-test.md | 2 +- docs/angular/cli/affected.md | 2 +- docs/angular/cli/build.md | 2 +- docs/angular/cli/dep-graph.md | 2 +- docs/angular/cli/e2e.md | 2 +- docs/angular/cli/format-check.md | 2 +- docs/angular/cli/format-write.md | 2 +- docs/angular/cli/generate.md | 2 +- docs/angular/cli/lint.md | 2 +- docs/angular/cli/list.md | 2 +- docs/angular/cli/migrate.md | 2 +- docs/angular/cli/print-affected.md | 2 +- docs/angular/cli/report.md | 2 +- docs/angular/cli/run-many.md | 2 +- docs/angular/cli/run.md | 2 +- docs/angular/cli/serve.md | 2 +- docs/angular/cli/test.md | 2 +- docs/angular/cli/workspace-lint.md | 2 +- docs/angular/cli/workspace-schematic.md | 2 +- docs/angular/guides/cli-overview.md | 4 +- .../angular/tutorial/01-create-application.md | 4 +- docs/react/api/home.md | 2 +- docs/react/cli/affected-apps.md | 2 +- docs/react/cli/affected-build.md | 2 +- docs/react/cli/affected-dep-graph.md | 2 +- docs/react/cli/affected-e2e.md | 2 +- docs/react/cli/affected-libs.md | 2 +- docs/react/cli/affected-lint.md | 2 +- docs/react/cli/affected-test.md | 2 +- docs/react/cli/affected.md | 2 +- docs/react/cli/build.md | 2 +- docs/react/cli/dep-graph.md | 2 +- docs/react/cli/e2e.md | 2 +- docs/react/cli/format-check.md | 2 +- docs/react/cli/format-write.md | 2 +- docs/react/cli/generate.md | 2 +- docs/react/cli/lint.md | 2 +- docs/react/cli/list.md | 2 +- docs/react/cli/migrate.md | 2 +- docs/react/cli/print-affected.md | 2 +- docs/react/cli/report.md | 2 +- docs/react/cli/run-many.md | 2 +- docs/react/cli/run.md | 2 +- docs/react/cli/serve.md | 2 +- docs/react/cli/test.md | 2 +- docs/react/cli/workspace-lint.md | 2 +- docs/react/cli/workspace-schematic.md | 2 +- docs/react/guides/cli-overview.md | 4 +- docs/react/tutorial/01-create-application.md | 4 +- docs/shared/cli/build.md | 2 +- docs/shared/cli/e2e.md | 2 +- docs/shared/cli/generate.md | 2 +- docs/shared/cli/lint.md | 2 +- docs/shared/cli/run.md | 2 +- docs/shared/cli/serve.md | 2 +- docs/shared/cli/test.md | 2 +- docs/shared/jest-plugin.md | 2 +- docs/shared/tools-workspace-schematics.md | 2 +- nx.json | 3 + packages/cli/README.md | 8 ++- packages/cli/package.json | 2 +- packages/create-nx-plugin/bin/shared.ts | 2 +- packages/create-nx-workspace/README.md | 2 +- packages/create-nx-workspace/bin/shared.ts | 2 +- packages/express/README.md | 2 +- packages/nest/README.md | 2 +- packages/next/README.md | 2 +- packages/nx/.eslintrc | 1 + packages/nx/README.md | 19 +++++++ packages/nx/jest.config.js | 9 +++ packages/nx/package.json | 29 ++++++++++ packages/nx/tsconfig.json | 16 ++++++ packages/nx/tsconfig.lib.json | 12 ++++ packages/nx/tsconfig.spec.json | 16 ++++++ packages/react/README.md | 2 +- packages/web/README.md | 2 +- packages/workspace/README.md | 2 +- packages/workspace/src/command-line/report.ts | 1 + scripts/documentation/generate-cli-data.ts | 2 +- scripts/nx-release.js | 1 + workspace.json | 56 +++++++++++++++++++ 89 files changed, 250 insertions(+), 83 deletions(-) create mode 100644 packages/nx/.eslintrc create mode 100644 packages/nx/README.md create mode 100644 packages/nx/jest.config.js create mode 100644 packages/nx/package.json create mode 100644 packages/nx/tsconfig.json create mode 100644 packages/nx/tsconfig.lib.json create mode 100644 packages/nx/tsconfig.spec.json diff --git a/README.md b/README.md index 14d5ae132b..a90737e4e3 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/docs/angular/api/home.md b/docs/angular/api/home.md index d18e9dbd71..13e2de346c 100644 --- a/docs/angular/api/home.md +++ b/docs/angular/api/home.md @@ -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 diff --git a/docs/angular/cli/affected-apps.md b/docs/angular/cli/affected-apps.md index 3dbe88433c..a3a0b085a3 100644 --- a/docs/angular/cli/affected-apps.md +++ b/docs/angular/cli/affected-apps.md @@ -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 diff --git a/docs/angular/cli/affected-build.md b/docs/angular/cli/affected-build.md index 57581fbb1e..71838d1d62 100644 --- a/docs/angular/cli/affected-build.md +++ b/docs/angular/cli/affected-build.md @@ -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 diff --git a/docs/angular/cli/affected-dep-graph.md b/docs/angular/cli/affected-dep-graph.md index d9526a1c0a..62c9b47cf5 100644 --- a/docs/angular/cli/affected-dep-graph.md +++ b/docs/angular/cli/affected-dep-graph.md @@ -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 diff --git a/docs/angular/cli/affected-e2e.md b/docs/angular/cli/affected-e2e.md index cdc327b33f..978a4c0bcb 100644 --- a/docs/angular/cli/affected-e2e.md +++ b/docs/angular/cli/affected-e2e.md @@ -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 diff --git a/docs/angular/cli/affected-libs.md b/docs/angular/cli/affected-libs.md index 173921ce4b..f9648615be 100644 --- a/docs/angular/cli/affected-libs.md +++ b/docs/angular/cli/affected-libs.md @@ -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 diff --git a/docs/angular/cli/affected-lint.md b/docs/angular/cli/affected-lint.md index 90754cb9f0..7b19356910 100644 --- a/docs/angular/cli/affected-lint.md +++ b/docs/angular/cli/affected-lint.md @@ -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 diff --git a/docs/angular/cli/affected-test.md b/docs/angular/cli/affected-test.md index 146f0771da..f4ac477c09 100644 --- a/docs/angular/cli/affected-test.md +++ b/docs/angular/cli/affected-test.md @@ -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 diff --git a/docs/angular/cli/affected.md b/docs/angular/cli/affected.md index 5ecefb34f6..af8eb1161d 100644 --- a/docs/angular/cli/affected.md +++ b/docs/angular/cli/affected.md @@ -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 diff --git a/docs/angular/cli/build.md b/docs/angular/cli/build.md index d67121ae03..8a398ba7e3 100644 --- a/docs/angular/cli/build.md +++ b/docs/angular/cli/build.md @@ -16,7 +16,7 @@ nx build [options] nx run :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 diff --git a/docs/angular/cli/dep-graph.md b/docs/angular/cli/dep-graph.md index 3bd4ac0a81..5ab0a9faeb 100644 --- a/docs/angular/cli/dep-graph.md +++ b/docs/angular/cli/dep-graph.md @@ -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 diff --git a/docs/angular/cli/e2e.md b/docs/angular/cli/e2e.md index f266c74be2..11ec046c24 100644 --- a/docs/angular/cli/e2e.md +++ b/docs/angular/cli/e2e.md @@ -16,7 +16,7 @@ nx e2e nx run :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 diff --git a/docs/angular/cli/format-check.md b/docs/angular/cli/format-check.md index 2352460216..c14001f96f 100644 --- a/docs/angular/cli/format-check.md +++ b/docs/angular/cli/format-check.md @@ -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 diff --git a/docs/angular/cli/format-write.md b/docs/angular/cli/format-write.md index 2f85f2248c..bec61afa0c 100644 --- a/docs/angular/cli/format-write.md +++ b/docs/angular/cli/format-write.md @@ -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 diff --git a/docs/angular/cli/generate.md b/docs/angular/cli/generate.md index 6f1e520722..033fcfd871 100644 --- a/docs/angular/cli/generate.md +++ b/docs/angular/cli/generate.md @@ -12,7 +12,7 @@ nx generate nx g ``` -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 diff --git a/docs/angular/cli/lint.md b/docs/angular/cli/lint.md index a2e82a6961..19efd0e2af 100644 --- a/docs/angular/cli/lint.md +++ b/docs/angular/cli/lint.md @@ -16,7 +16,7 @@ nx lint [options] nx run :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 diff --git a/docs/angular/cli/list.md b/docs/angular/cli/list.md index 8af2eb8b31..09742dbc9b 100644 --- a/docs/angular/cli/list.md +++ b/docs/angular/cli/list.md @@ -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 diff --git a/docs/angular/cli/migrate.md b/docs/angular/cli/migrate.md index fcf70c24ee..4ce4814282 100644 --- a/docs/angular/cli/migrate.md +++ b/docs/angular/cli/migrate.md @@ -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 diff --git a/docs/angular/cli/print-affected.md b/docs/angular/cli/print-affected.md index 79d01f68bc..3064c879cc 100644 --- a/docs/angular/cli/print-affected.md +++ b/docs/angular/cli/print-affected.md @@ -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 diff --git a/docs/angular/cli/report.md b/docs/angular/cli/report.md index e6639dc48d..0d7c3480d5 100644 --- a/docs/angular/cli/report.md +++ b/docs/angular/cli/report.md @@ -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 diff --git a/docs/angular/cli/run-many.md b/docs/angular/cli/run-many.md index 9d3f9b2797..11f3319105 100644 --- a/docs/angular/cli/run-many.md +++ b/docs/angular/cli/run-many.md @@ -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 diff --git a/docs/angular/cli/run.md b/docs/angular/cli/run.md index 7bc272331f..87df36051c 100644 --- a/docs/angular/cli/run.md +++ b/docs/angular/cli/run.md @@ -8,7 +8,7 @@ Runs an Architect target with an optional custom builder configuration defined i nx run [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 diff --git a/docs/angular/cli/serve.md b/docs/angular/cli/serve.md index 9d714c54c4..6a87bc9776 100644 --- a/docs/angular/cli/serve.md +++ b/docs/angular/cli/serve.md @@ -16,7 +16,7 @@ nx serve [options] nx run :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 diff --git a/docs/angular/cli/test.md b/docs/angular/cli/test.md index 5f9b37d466..84d7e9db86 100644 --- a/docs/angular/cli/test.md +++ b/docs/angular/cli/test.md @@ -16,7 +16,7 @@ nx test [options] nx run :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 diff --git a/docs/angular/cli/workspace-lint.md b/docs/angular/cli/workspace-lint.md index b5e78ebee6..d3eeca5b2b 100644 --- a/docs/angular/cli/workspace-lint.md +++ b/docs/angular/cli/workspace-lint.md @@ -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 diff --git a/docs/angular/cli/workspace-schematic.md b/docs/angular/cli/workspace-schematic.md index 52b2e34f03..1935090762 100644 --- a/docs/angular/cli/workspace-schematic.md +++ b/docs/angular/cli/workspace-schematic.md @@ -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 diff --git a/docs/angular/guides/cli-overview.md b/docs/angular/guides/cli-overview.md index 7410b2ea52..4881187995 100644 --- a/docs/angular/guides/cli-overview.md +++ b/docs/angular/guides/cli-overview.md @@ -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. diff --git a/docs/angular/tutorial/01-create-application.md b/docs/angular/tutorial/01-create-application.md index f55dd98519..40b33ba570 100644 --- a/docs/angular/tutorial/01-create-application.md +++ b/docs/angular/tutorial/01-create-application.md @@ -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`: diff --git a/docs/react/api/home.md b/docs/react/api/home.md index f218eead9f..cac22a054a 100644 --- a/docs/react/api/home.md +++ b/docs/react/api/home.md @@ -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 | diff --git a/docs/react/cli/affected-apps.md b/docs/react/cli/affected-apps.md index 3dbe88433c..a3a0b085a3 100644 --- a/docs/react/cli/affected-apps.md +++ b/docs/react/cli/affected-apps.md @@ -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 diff --git a/docs/react/cli/affected-build.md b/docs/react/cli/affected-build.md index 57581fbb1e..71838d1d62 100644 --- a/docs/react/cli/affected-build.md +++ b/docs/react/cli/affected-build.md @@ -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 diff --git a/docs/react/cli/affected-dep-graph.md b/docs/react/cli/affected-dep-graph.md index d9526a1c0a..62c9b47cf5 100644 --- a/docs/react/cli/affected-dep-graph.md +++ b/docs/react/cli/affected-dep-graph.md @@ -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 diff --git a/docs/react/cli/affected-e2e.md b/docs/react/cli/affected-e2e.md index cdc327b33f..978a4c0bcb 100644 --- a/docs/react/cli/affected-e2e.md +++ b/docs/react/cli/affected-e2e.md @@ -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 diff --git a/docs/react/cli/affected-libs.md b/docs/react/cli/affected-libs.md index 173921ce4b..f9648615be 100644 --- a/docs/react/cli/affected-libs.md +++ b/docs/react/cli/affected-libs.md @@ -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 diff --git a/docs/react/cli/affected-lint.md b/docs/react/cli/affected-lint.md index 90754cb9f0..7b19356910 100644 --- a/docs/react/cli/affected-lint.md +++ b/docs/react/cli/affected-lint.md @@ -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 diff --git a/docs/react/cli/affected-test.md b/docs/react/cli/affected-test.md index 146f0771da..f4ac477c09 100644 --- a/docs/react/cli/affected-test.md +++ b/docs/react/cli/affected-test.md @@ -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 diff --git a/docs/react/cli/affected.md b/docs/react/cli/affected.md index 5ecefb34f6..af8eb1161d 100644 --- a/docs/react/cli/affected.md +++ b/docs/react/cli/affected.md @@ -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 diff --git a/docs/react/cli/build.md b/docs/react/cli/build.md index d67121ae03..8a398ba7e3 100644 --- a/docs/react/cli/build.md +++ b/docs/react/cli/build.md @@ -16,7 +16,7 @@ nx build [options] nx run :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 diff --git a/docs/react/cli/dep-graph.md b/docs/react/cli/dep-graph.md index 3bd4ac0a81..5ab0a9faeb 100644 --- a/docs/react/cli/dep-graph.md +++ b/docs/react/cli/dep-graph.md @@ -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 diff --git a/docs/react/cli/e2e.md b/docs/react/cli/e2e.md index f266c74be2..11ec046c24 100644 --- a/docs/react/cli/e2e.md +++ b/docs/react/cli/e2e.md @@ -16,7 +16,7 @@ nx e2e nx run :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 diff --git a/docs/react/cli/format-check.md b/docs/react/cli/format-check.md index 2352460216..c14001f96f 100644 --- a/docs/react/cli/format-check.md +++ b/docs/react/cli/format-check.md @@ -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 diff --git a/docs/react/cli/format-write.md b/docs/react/cli/format-write.md index 2f85f2248c..bec61afa0c 100644 --- a/docs/react/cli/format-write.md +++ b/docs/react/cli/format-write.md @@ -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 diff --git a/docs/react/cli/generate.md b/docs/react/cli/generate.md index 6f1e520722..033fcfd871 100644 --- a/docs/react/cli/generate.md +++ b/docs/react/cli/generate.md @@ -12,7 +12,7 @@ nx generate nx g ``` -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 diff --git a/docs/react/cli/lint.md b/docs/react/cli/lint.md index a2e82a6961..19efd0e2af 100644 --- a/docs/react/cli/lint.md +++ b/docs/react/cli/lint.md @@ -16,7 +16,7 @@ nx lint [options] nx run :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 diff --git a/docs/react/cli/list.md b/docs/react/cli/list.md index 8af2eb8b31..09742dbc9b 100644 --- a/docs/react/cli/list.md +++ b/docs/react/cli/list.md @@ -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 diff --git a/docs/react/cli/migrate.md b/docs/react/cli/migrate.md index fcf70c24ee..4ce4814282 100644 --- a/docs/react/cli/migrate.md +++ b/docs/react/cli/migrate.md @@ -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 diff --git a/docs/react/cli/print-affected.md b/docs/react/cli/print-affected.md index 79d01f68bc..3064c879cc 100644 --- a/docs/react/cli/print-affected.md +++ b/docs/react/cli/print-affected.md @@ -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 diff --git a/docs/react/cli/report.md b/docs/react/cli/report.md index e6639dc48d..0d7c3480d5 100644 --- a/docs/react/cli/report.md +++ b/docs/react/cli/report.md @@ -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 diff --git a/docs/react/cli/run-many.md b/docs/react/cli/run-many.md index 9d3f9b2797..11f3319105 100644 --- a/docs/react/cli/run-many.md +++ b/docs/react/cli/run-many.md @@ -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 diff --git a/docs/react/cli/run.md b/docs/react/cli/run.md index 7bc272331f..87df36051c 100644 --- a/docs/react/cli/run.md +++ b/docs/react/cli/run.md @@ -8,7 +8,7 @@ Runs an Architect target with an optional custom builder configuration defined i nx run [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 diff --git a/docs/react/cli/serve.md b/docs/react/cli/serve.md index 9d714c54c4..6a87bc9776 100644 --- a/docs/react/cli/serve.md +++ b/docs/react/cli/serve.md @@ -16,7 +16,7 @@ nx serve [options] nx run :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 diff --git a/docs/react/cli/test.md b/docs/react/cli/test.md index 5f9b37d466..84d7e9db86 100644 --- a/docs/react/cli/test.md +++ b/docs/react/cli/test.md @@ -16,7 +16,7 @@ nx test [options] nx run :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 diff --git a/docs/react/cli/workspace-lint.md b/docs/react/cli/workspace-lint.md index b5e78ebee6..d3eeca5b2b 100644 --- a/docs/react/cli/workspace-lint.md +++ b/docs/react/cli/workspace-lint.md @@ -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 diff --git a/docs/react/cli/workspace-schematic.md b/docs/react/cli/workspace-schematic.md index 52b2e34f03..1935090762 100644 --- a/docs/react/cli/workspace-schematic.md +++ b/docs/react/cli/workspace-schematic.md @@ -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 diff --git a/docs/react/guides/cli-overview.md b/docs/react/guides/cli-overview.md index e7f33cfbd3..82a94514c7 100644 --- a/docs/react/guides/cli-overview.md +++ b/docs/react/guides/cli-overview.md @@ -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. diff --git a/docs/react/tutorial/01-create-application.md b/docs/react/tutorial/01-create-application.md index ffdfb9bac7..363ac86a9b 100644 --- a/docs/react/tutorial/01-create-application.md +++ b/docs/react/tutorial/01-create-application.md @@ -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`: diff --git a/docs/shared/cli/build.md b/docs/shared/cli/build.md index d67121ae03..8a398ba7e3 100644 --- a/docs/shared/cli/build.md +++ b/docs/shared/cli/build.md @@ -16,7 +16,7 @@ nx build [options] nx run :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 diff --git a/docs/shared/cli/e2e.md b/docs/shared/cli/e2e.md index f266c74be2..11ec046c24 100644 --- a/docs/shared/cli/e2e.md +++ b/docs/shared/cli/e2e.md @@ -16,7 +16,7 @@ nx e2e nx run :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 diff --git a/docs/shared/cli/generate.md b/docs/shared/cli/generate.md index 6f1e520722..033fcfd871 100644 --- a/docs/shared/cli/generate.md +++ b/docs/shared/cli/generate.md @@ -12,7 +12,7 @@ nx generate nx g ``` -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 diff --git a/docs/shared/cli/lint.md b/docs/shared/cli/lint.md index a2e82a6961..19efd0e2af 100644 --- a/docs/shared/cli/lint.md +++ b/docs/shared/cli/lint.md @@ -16,7 +16,7 @@ nx lint [options] nx run :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 diff --git a/docs/shared/cli/run.md b/docs/shared/cli/run.md index 7bc272331f..87df36051c 100644 --- a/docs/shared/cli/run.md +++ b/docs/shared/cli/run.md @@ -8,7 +8,7 @@ Runs an Architect target with an optional custom builder configuration defined i nx run [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 diff --git a/docs/shared/cli/serve.md b/docs/shared/cli/serve.md index 9d714c54c4..6a87bc9776 100644 --- a/docs/shared/cli/serve.md +++ b/docs/shared/cli/serve.md @@ -16,7 +16,7 @@ nx serve [options] nx run :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 diff --git a/docs/shared/cli/test.md b/docs/shared/cli/test.md index 5f9b37d466..84d7e9db86 100644 --- a/docs/shared/cli/test.md +++ b/docs/shared/cli/test.md @@ -16,7 +16,7 @@ nx test [options] nx run :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 diff --git a/docs/shared/jest-plugin.md b/docs/shared/jest-plugin.md index 3be58ecea5..a85dc68adb 100644 --- a/docs/shared/jest-plugin.md +++ b/docs/shared/jest-plugin.md @@ -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. diff --git a/docs/shared/tools-workspace-schematics.md b/docs/shared/tools-workspace-schematics.md index 10a4b30344..36a8e3fdd9 100644 --- a/docs/shared/tools-workspace-schematics.md +++ b/docs/shared/tools-workspace-schematics.md @@ -296,7 +296,7 @@ Alternatively press Cmd+P (or Ctrl+P 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. diff --git a/nx.json b/nx.json index c785670f9c..a6e2301eed 100644 --- a/nx.json +++ b/nx.json @@ -27,6 +27,9 @@ "libsDir": "packages" }, "projects": { + "nx": { + "tags": [] + }, "tao": { "tags": [] }, diff --git a/packages/cli/README.md b/packages/cli/README.md index 4b42ab61cd..2291f29cde 100644 --- a/packages/cli/README.md +++ b/packages/cli/README.md @@ -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}} diff --git a/packages/cli/package.json b/packages/cli/package.json index 14bb6fba67..59363a6149 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -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" diff --git a/packages/create-nx-plugin/bin/shared.ts b/packages/create-nx-plugin/bin/shared.ts index 35d417e66d..5641d327a4 100644 --- a/packages/create-nx-plugin/bin/shared.ts +++ b/packages/create-nx-plugin/bin/shared.ts @@ -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.`, ], }); } diff --git a/packages/create-nx-workspace/README.md b/packages/create-nx-workspace/README.md index 34abdf717d..edead203a3 100644 --- a/packages/create-nx-workspace/README.md +++ b/packages/create-nx-workspace/README.md @@ -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 diff --git a/packages/create-nx-workspace/bin/shared.ts b/packages/create-nx-workspace/bin/shared.ts index 35d417e66d..5641d327a4 100644 --- a/packages/create-nx-workspace/bin/shared.ts +++ b/packages/create-nx-workspace/bin/shared.ts @@ -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.`, ], }); } diff --git a/packages/express/README.md b/packages/express/README.md index a0f263cc84..7c76de5a08 100644 --- a/packages/express/README.md +++ b/packages/express/README.md @@ -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 diff --git a/packages/nest/README.md b/packages/nest/README.md index ea09ef9c4e..54900f1e6f 100644 --- a/packages/nest/README.md +++ b/packages/nest/README.md @@ -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 diff --git a/packages/next/README.md b/packages/next/README.md index 0e5ba4db4e..5d9e5fb3c1 100644 --- a/packages/next/README.md +++ b/packages/next/README.md @@ -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 diff --git a/packages/nx/.eslintrc b/packages/nx/.eslintrc new file mode 100644 index 0000000000..ab8f38339c --- /dev/null +++ b/packages/nx/.eslintrc @@ -0,0 +1 @@ +{ "extends": "../../.eslintrc", "rules": {}, "ignorePatterns": ["!**/*"] } diff --git a/packages/nx/README.md b/packages/nx/README.md new file mode 100644 index 0000000000..2291f29cde --- /dev/null +++ b/packages/nx/README.md @@ -0,0 +1,19 @@ +

+ +{{links}} + +
+ +# 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}} diff --git a/packages/nx/jest.config.js b/packages/nx/jest.config.js new file mode 100644 index 0000000000..5d0990534a --- /dev/null +++ b/packages/nx/jest.config.js @@ -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: '/tsconfig.spec.json' } }, +}; diff --git a/packages/nx/package.json b/packages/nx/package.json new file mode 100644 index 0000000000..048df189f9 --- /dev/null +++ b/packages/nx/package.json @@ -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": "*" + } +} diff --git a/packages/nx/tsconfig.json b/packages/nx/tsconfig.json new file mode 100644 index 0000000000..58bd2c97a6 --- /dev/null +++ b/packages/nx/tsconfig.json @@ -0,0 +1,16 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "types": ["node", "jest"] + }, + "include": [], + "files": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] +} diff --git a/packages/nx/tsconfig.lib.json b/packages/nx/tsconfig.lib.json new file mode 100644 index 0000000000..e8dbe47d78 --- /dev/null +++ b/packages/nx/tsconfig.lib.json @@ -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"] +} diff --git a/packages/nx/tsconfig.spec.json b/packages/nx/tsconfig.spec.json new file mode 100644 index 0000000000..d6ae6669d7 --- /dev/null +++ b/packages/nx/tsconfig.spec.json @@ -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" + ] +} diff --git a/packages/react/README.md b/packages/react/README.md index 03e5e51f0f..61f6a30a41 100644 --- a/packages/react/README.md +++ b/packages/react/README.md @@ -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 diff --git a/packages/web/README.md b/packages/web/README.md index 05b28d69fc..d0fcc09be6 100644 --- a/packages/web/README.md +++ b/packages/web/README.md @@ -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 diff --git a/packages/workspace/README.md b/packages/workspace/README.md index 3f8fabc7aa..9c49ecb1ad 100644 --- a/packages/workspace/README.md +++ b/packages/workspace/README.md @@ -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 diff --git a/packages/workspace/src/command-line/report.ts b/packages/workspace/src/command-line/report.ts index b16d44ccd9..6d0c03e647 100644 --- a/packages/workspace/src/command-line/report.ts +++ b/packages/workspace/src/command-line/report.ts @@ -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', diff --git a/scripts/documentation/generate-cli-data.ts b/scripts/documentation/generate-cli-data.ts index 9a522295de..a62fed421d 100644 --- a/scripts/documentation/generate-cli-data.ts +++ b/scripts/documentation/generate-cli-data.ts @@ -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`; diff --git a/scripts/nx-release.js b/scripts/nx-release.js index abfcf56568..b5cf2db4cb 100755 --- a/scripts/nx-release.js +++ b/scripts/nx-release.js @@ -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 diff --git a/workspace.json b/workspace.json index 91ae489588..1b8b44d65f 100644 --- a/workspace.json +++ b/workspace.json @@ -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",