Skip to content

Commit

Permalink
feat(core): remove @nrwl/cli
Browse files Browse the repository at this point in the history
  • Loading branch information
FrozenPandaz committed Apr 5, 2023
1 parent ee1f7c1 commit bf3a057
Show file tree
Hide file tree
Showing 22 changed files with 29 additions and 212 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion docs/generated/packages/jest/documents/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export default {
If your code editor doesn't provide a way to debug your tests, you can leverage the Chrome DevTools to debug your tests with the `--inspect-brk` flag for node.
```shell
node --inspect-brk ./node_modules/@nrwl/cli/bin/nx test <project-name>
node --inspect-brk ./node_modules/nx/bin/nx.js test <project-name>
```
Enter [chrome://inspect](chrome://inspect) in Chrome address bar and inspect the target to attach to the node process. Visit the official [Jest documentation](https://jestjs.io/docs/en/troubleshooting#tests-are-failing-and-you-don-t-know-why) to find out more.
Expand Down
2 changes: 1 addition & 1 deletion docs/shared/packages/jest/jest-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export default {
If your code editor doesn't provide a way to debug your tests, you can leverage the Chrome DevTools to debug your tests with the `--inspect-brk` flag for node.
```shell
node --inspect-brk ./node_modules/@nrwl/cli/bin/nx test <project-name>
node --inspect-brk ./node_modules/nx/bin/nx.js test <project-name>
```
Enter [chrome://inspect](chrome://inspect) in Chrome address bar and inspect the target to attach to the node process. Visit the official [Jest documentation](https://jestjs.io/docs/en/troubleshooting#tests-are-failing-and-you-don-t-know-why) to find out more.
Expand Down
19 changes: 0 additions & 19 deletions packages/cli/.eslintrc.json

This file was deleted.

11 changes: 0 additions & 11 deletions packages/cli/README.md

This file was deleted.

3 changes: 0 additions & 3 deletions packages/cli/bin/nx.ts

This file was deleted.

11 changes: 0 additions & 11 deletions packages/cli/jest.config.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/cli/lib/decorate-cli.ts

This file was deleted.

34 changes: 0 additions & 34 deletions packages/cli/package.json

This file was deleted.

66 changes: 0 additions & 66 deletions packages/cli/project.json

This file was deleted.

16 changes: 0 additions & 16 deletions packages/cli/tsconfig.json

This file was deleted.

17 changes: 0 additions & 17 deletions packages/cli/tsconfig.lib.json

This file was deleted.

22 changes: 0 additions & 22 deletions packages/cli/tsconfig.spec.json

This file was deleted.

2 changes: 2 additions & 0 deletions packages/nx/bin/nx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -164,6 +165,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 {
Expand Down
6 changes: 6 additions & 0 deletions packages/nx/migrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
1 change: 0 additions & 1 deletion packages/nx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@
"@nrwl/linter",
"@nrwl/workspace",
"@nrwl/angular",
"@nrwl/cli",
"@nrwl/cypress",
"@nrwl/detox",
"@nrwl/devkit",
Expand Down
3 changes: 0 additions & 3 deletions packages/nx/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down
1 change: 0 additions & 1 deletion packages/nx/src/command-line/migrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: '*' },
Expand Down
17 changes: 17 additions & 0 deletions packages/nx/src/migrations/update-16-0-0/remove-nrwl-cli.ts
Original file line number Diff line number Diff line change
@@ -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);
}
1 change: 0 additions & 1 deletion packages/workspace/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
"@nrwl/jest": "*",
"@nrwl/linter": "*",
"@nrwl/angular": "*",
"@nrwl/cli": "*",
"@nrwl/cypress": "*",
"@nrwl/detox": "*",
"@nrwl/devkit": "*",
Expand Down
2 changes: 1 addition & 1 deletion scripts/depcheck/missing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down

0 comments on commit bf3a057

Please sign in to comment.