diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 5e55a4e9a1165..3020277a7ee8e 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -70,7 +70,7 @@ If you have problems publishing, make sure you use Node 18 and NPM 8.
**NOTE:** After you finish with local testing don't forget to stop the local registry (e.g. closing the Terminal 1) and disabling the local registy using `yarn local-registry disable`. Keeping local registry enabled will change your lock file resolutions to `localhost:4873` on the next `yarn install`. You can also run `yarn local-registry clear` to clean all packages in that local registry.
-**NOTE:** To use this newly published local version, you need to make a new workspace or change all of your target packages to this new version, eg: `"@nrwl/cli": "^16.0.0",` and re-run `yarn install` in your testing project.
+**NOTE:** To use this newly published local version, you need to make a new workspace or change all of your target packages to this new version, eg: `"nx": "^16.0.0",` and re-run `yarn install` in your testing project.
### Publishing for Yarn 2+ (Berry)
diff --git a/packages/cli/.eslintrc.json b/packages/cli/.eslintrc.json
deleted file mode 100644
index 5354eb31ef704..0000000000000
--- a/packages/cli/.eslintrc.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "extends": "../../.eslintrc",
- "rules": {},
- "ignorePatterns": ["!**/*"],
- "overrides": [
- {
- "files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
- "rules": {}
- },
- {
- "files": ["*.ts", "*.tsx"],
- "rules": {}
- },
- {
- "files": ["*.js", "*.jsx"],
- "rules": {}
- }
- ]
-}
diff --git a/packages/cli/README.md b/packages/cli/README.md
deleted file mode 100644
index 37eb64ddbdbef..0000000000000
--- a/packages/cli/README.md
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-{{links}}
-
-
-
-# Nx: Smart, Fast and Extensible Build System
-
-Nx is a next generation build system with first class monorepo support and powerful integrations.
-
-{{content}}
diff --git a/packages/cli/bin/nx.ts b/packages/cli/bin/nx.ts
deleted file mode 100644
index e906e77b5a003..0000000000000
--- a/packages/cli/bin/nx.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/usr/bin/env node
-
-require('nx/bin/nx');
diff --git a/packages/cli/jest.config.ts b/packages/cli/jest.config.ts
deleted file mode 100644
index f3ac86d00561e..0000000000000
--- a/packages/cli/jest.config.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-/* eslint-disable */
-export default {
- transform: {
- '^.+\\.[tj]sx?$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }],
- },
- moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
- globals: {},
- displayName: 'cli',
- testEnvironment: 'node',
- preset: '../../jest.preset.js',
-};
diff --git a/packages/cli/lib/decorate-cli.ts b/packages/cli/lib/decorate-cli.ts
deleted file mode 100644
index fbb9636c447e0..0000000000000
--- a/packages/cli/lib/decorate-cli.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from 'nx/src/adapter/decorate-cli';
diff --git a/packages/cli/package.json b/packages/cli/package.json
deleted file mode 100644
index 9c5ad8ce71426..0000000000000
--- a/packages/cli/package.json
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "name": "@nrwl/cli",
- "version": "0.0.1",
- "private": false,
- "description": "Smart, Fast and Extensible Build System",
- "repository": {
- "type": "git",
- "url": "https://github.com/nrwl/nx.git",
- "directory": "packages/cli"
- },
- "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": {
- "nx": "file:../nx"
- },
- "publishConfig": {
- "access": "public"
- }
-}
diff --git a/packages/cli/project.json b/packages/cli/project.json
deleted file mode 100644
index ff54093a3ebf4..0000000000000
--- a/packages/cli/project.json
+++ /dev/null
@@ -1,66 +0,0 @@
-{
- "name": "cli",
- "$schema": "../../node_modules/nx/schemas/project-schema.json",
- "sourceRoot": "packages/cli",
- "projectType": "library",
- "targets": {
- "test": {},
- "build-base": {
- "executor": "@nrwl/js:tsc",
- "options": {
- "main": "packages/cli/bin/nx.ts",
- "assets": [
- {
- "input": "packages/cli",
- "glob": "**/files/**",
- "output": "/"
- },
- {
- "input": "packages/cli",
- "glob": "**/files/**/.gitkeep",
- "output": "/"
- },
- {
- "input": "packages/cli",
- "glob": "**/*.json",
- "ignore": ["**/tsconfig*.json", "project.json", ".eslintrc.json"],
- "output": "/"
- },
- {
- "input": "packages/cli",
- "glob": "**/*.js",
- "ignore": ["**/jest.config.js"],
- "output": "/"
- },
- {
- "input": "packages/cli",
- "glob": "**/*.d.ts",
- "output": "/"
- },
- {
- "input": "",
- "glob": "LICENSE",
- "output": "/"
- }
- ]
- }
- },
- "build": {
- "executor": "nx:run-commands",
- "outputs": ["{workspaceRoot}/build/packages/cli"],
- "options": {
- "commands": [
- {
- "command": "node ./scripts/chmod build/packages/cli/bin/nx.js"
- },
- {
- "command": "node ./scripts/copy-readme.js cli"
- }
- ],
- "parallel": false
- }
- },
- "lint": {}
- },
- "implicitDependencies": ["workspace"]
-}
diff --git a/packages/cli/tsconfig.json b/packages/cli/tsconfig.json
deleted file mode 100644
index 58bd2c97a66f5..0000000000000
--- a/packages/cli/tsconfig.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "extends": "../../tsconfig.base.json",
- "compilerOptions": {
- "types": ["node", "jest"]
- },
- "include": [],
- "files": [],
- "references": [
- {
- "path": "./tsconfig.lib.json"
- },
- {
- "path": "./tsconfig.spec.json"
- }
- ]
-}
diff --git a/packages/cli/tsconfig.lib.json b/packages/cli/tsconfig.lib.json
deleted file mode 100644
index 1d2ddef3c1be3..0000000000000
--- a/packages/cli/tsconfig.lib.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "extends": "./tsconfig.json",
- "compilerOptions": {
- "module": "commonjs",
- "outDir": "../../dist/out-tsc",
- "declaration": true,
- "types": ["node"]
- },
- "exclude": [
- "**/*.spec.ts",
- "**/*.test.ts",
- "**/*_spec.ts",
- "**/*_test.ts",
- "jest.config.ts"
- ],
- "include": ["**/*.ts"]
-}
diff --git a/packages/cli/tsconfig.spec.json b/packages/cli/tsconfig.spec.json
deleted file mode 100644
index 869c90c526a0f..0000000000000
--- a/packages/cli/tsconfig.spec.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "extends": "./tsconfig.json",
- "compilerOptions": {
- "outDir": "../../dist/out-tsc",
- "module": "commonjs",
- "types": ["jest", "node"]
- },
- "include": [
- "**/*.spec.ts",
- "**/*.test.ts",
- "**/*_spec.ts",
- "**/*_test.ts",
- "**/*.spec.tsx",
- "**/*.test.tsx",
- "**/*.spec.js",
- "**/*.test.js",
- "**/*.spec.jsx",
- "**/*.test.jsx",
- "**/*.d.ts",
- "jest.config.ts"
- ]
-}
diff --git a/packages/nx/bin/nx.ts b/packages/nx/bin/nx.ts
index 7d12b37a8b745..ec68413f38293 100644
--- a/packages/nx/bin/nx.ts
+++ b/packages/nx/bin/nx.ts
@@ -115,6 +115,7 @@ function resolveNx(workspace: WorkspaceTypeAndRoot | null) {
paths: workspace ? [workspace.dir] : undefined,
});
} catch {
+ // TODO(v17): Remove this
// fallback for old CLI install setup
return require.resolve('@nrwl/cli/bin/nx.js', {
paths: workspace ? [workspace.dir] : undefined,
@@ -169,6 +170,7 @@ function warnIfUsingOutdatedGlobalInstall(
}
function getLocalNxVersion(workspace: WorkspaceTypeAndRoot): string | null {
+ // TODO(v17): Remove @nrwl/cli from this list
const localNxPackages = ['nx', '@nrwl/tao', '@nrwl/cli'];
for (const pkg of localNxPackages) {
try {
diff --git a/packages/nx/migrations.json b/packages/nx/migrations.json
index 6611c37444a87..d944ff976f5a1 100644
--- a/packages/nx/migrations.json
+++ b/packages/nx/migrations.json
@@ -53,6 +53,12 @@
"version": "15.8.2-beta.0",
"description": "Updates the nx wrapper.",
"implementation": "./src/migrations/update-15-8-2/update-nxw"
+ },
+ "16.0.0-remove-nrwl-cli": {
+ "cli": "nx",
+ "version": "16.0.0-beta.0",
+ "description": "Remove @nrwl/cli.",
+ "implementation": "./src/migrations/update-16-0-0/remove-nrwl-cli"
}
}
}
diff --git a/packages/nx/package.json b/packages/nx/package.json
index 1a4bc29f0ce84..2a0cdb17dae9f 100644
--- a/packages/nx/package.json
+++ b/packages/nx/package.json
@@ -97,7 +97,6 @@
"@nrwl/linter",
"@nrwl/workspace",
"@nrwl/angular",
- "@nrwl/cli",
"@nrwl/cypress",
"@nrwl/detox",
"@nrwl/devkit",
diff --git a/packages/nx/project.json b/packages/nx/project.json
index 95c2bc6d70aa4..944192a27e340 100644
--- a/packages/nx/project.json
+++ b/packages/nx/project.json
@@ -86,9 +86,6 @@
{
"command": "node ./scripts/copy-readme.js nx"
},
- {
- "command": "node ./scripts/add-dependency-to-build.js nx @nrwl/cli"
- },
{
"command": "node ./scripts/add-dependency-to-build.js nx @nrwl/tao"
}
diff --git a/packages/nx/src/command-line/migrate.ts b/packages/nx/src/command-line/migrate.ts
index b94fd8d669247..52dc38d646657 100644
--- a/packages/nx/src/command-line/migrate.ts
+++ b/packages/nx/src/command-line/migrate.ts
@@ -610,7 +610,6 @@ const LEGACY_NRWL_PACKAGE_GROUP: ArrayPackageGroup = [
{ package: '@nrwl/storybook', version: '*' },
{ package: '@nrwl/web', version: '*' },
{ package: '@nrwl/js', version: '*' },
- { package: '@nrwl/cli', version: '*' },
{ package: '@nrwl/nx-cloud', version: 'latest' },
{ package: '@nrwl/react-native', version: '*' },
{ package: '@nrwl/detox', version: '*' },
diff --git a/packages/nx/src/migrations/update-16-0-0/remove-nrwl-cli.ts b/packages/nx/src/migrations/update-16-0-0/remove-nrwl-cli.ts
new file mode 100644
index 0000000000000..f13430e58ec2b
--- /dev/null
+++ b/packages/nx/src/migrations/update-16-0-0/remove-nrwl-cli.ts
@@ -0,0 +1,17 @@
+import { Tree } from '../../generators/tree';
+import { formatChangedFilesWithPrettierIfAvailable } from '../../generators/internal-utils/format-changed-files-with-prettier-if-available';
+import { updateJson } from '../../generators/utils/json';
+
+export default async function (tree: Tree) {
+ updateJson(tree, 'package.json', (json) => {
+ for (const deps of [json.dependencies, json.devDependencies]) {
+ if (deps) {
+ delete deps['@nrwl/cli'];
+ }
+ }
+
+ return json;
+ });
+
+ await formatChangedFilesWithPrettierIfAvailable(tree);
+}
diff --git a/packages/workspace/package.json b/packages/workspace/package.json
index 0910daf7445e6..1648a980f92aa 100644
--- a/packages/workspace/package.json
+++ b/packages/workspace/package.json
@@ -37,7 +37,6 @@
"@nrwl/jest": "*",
"@nrwl/linter": "*",
"@nrwl/angular": "*",
- "@nrwl/cli": "*",
"@nrwl/cypress": "*",
"@nrwl/detox": "*",
"@nrwl/devkit": "*",
diff --git a/scripts/depcheck/missing.ts b/scripts/depcheck/missing.ts
index 174c6adbbf417..b653377f9f950 100644
--- a/scripts/depcheck/missing.ts
+++ b/scripts/depcheck/missing.ts
@@ -8,7 +8,6 @@ const IGNORE_MATCHES_IN_PACKAGE = {
'prettier',
'typescript',
'rxjs',
- '@nrwl/cli',
'@nrwl/workspace',
// These are installed as needed and should not be added to package.json
'@nrwl/cypress',
@@ -138,6 +137,7 @@ const IGNORE_MATCHES_IN_PACKAGE = {
'@angular-devkit/architect',
'@angular/cli',
'@nrwl/angular',
+ '@nrwl/cli',
'@nestjs/cli', // nx init nest makes use of nestjs cli (which should be available in NestJS CLI app) to parse the nest-cli.json file
'ts-node', // We *may* fall back on ts-node, but we want to encourage the use of @swc-node instead so we don't explicitly list ts-node as an optional dep
'@nrwl/nx-android-arm-eabi', // native optional deps
diff --git a/tsconfig.base.json b/tsconfig.base.json
index 88456cbebb59b..4673491aff46c 100644
--- a/tsconfig.base.json
+++ b/tsconfig.base.json
@@ -19,8 +19,6 @@
"paths": {
"@nrwl/angular": ["packages/angular"],
"@nrwl/angular/*": ["packages/angular/*"],
- "@nrwl/cli": ["packages/cli"],
- "@nrwl/cli/*": ["packages/cli/*"],
"@nrwl/cypress": ["packages/cypress"],
"@nrwl/cypress/*": ["packages/cypress/*"],
"@nrwl/detox": ["packages/detox"],