From 0269a10cd9ef6f87b45d20cb827a1b23371c091b Mon Sep 17 00:00:00 2001 From: FrozenPandaz Date: Mon, 17 Apr 2023 11:10:20 -0400 Subject: [PATCH] fix(core): replace @nrwl with @nx in nx core packages --- e2e/nx-misc/src/misc.test.ts | 2 +- packages/create-nx-plugin/.eslintrc.json | 4 +- .../create-nx-plugin/bin/create-nx-plugin.ts | 2 +- packages/create-nx-workspace/.eslintrc.json | 4 +- .../create-nx-workspace/src/create-sandbox.ts | 2 +- .../src/create-workspace.ts | 2 +- .../src/utils/ci/setup-ci.ts | 2 +- .../src/utils/git/default-base.ts | 4 +- .../create-nx-workspace/src/utils/output.ts | 4 +- .../src/utils/package-manager.ts | 4 +- packages/devkit/.eslintrc.json | 4 +- packages/devkit/public-api.ts | 6 +- .../devkit/src/utils/package-json.spec.ts | 143 +++++++++--------- packages/nx-plugin/.eslintrc.json | 2 +- packages/nx-plugin/generators.json | 2 +- .../nx-plugin/src/executors/e2e/e2e.impl.ts | 2 +- .../src/generators/e2e-project/e2e.spec.ts | 2 +- .../src/generators/e2e-project/e2e.ts | 2 +- .../tests/__pluginName__.spec.ts__tmpl__ | 2 +- .../src/generators/executor/executor.spec.ts | 2 +- .../__fileName__/hasher.spec.ts__tmpl__ | 2 +- .../hasher/__fileName__/hasher.ts__tmpl__ | 2 +- .../__fileName__/generator.spec.ts__tmpl__ | 4 +- .../__fileName__/generator.ts__tmpl__ | 2 +- .../src/generators/lint-checks/generator.ts | 20 ++- .../migration/__name__/__name__.ts__tmpl__ | 2 +- .../nx-plugin/src/generators/plugin/plugin.ts | 7 +- .../src/generators/preset/generator.ts | 6 +- .../src/utils/testing-utils/nx-project.ts | 4 +- .../nx/native-packages/darwin-arm64/README.md | 2 +- .../nx/native-packages/darwin-x64/README.md | 2 +- .../linux-arm-gnueabihf/README.md | 2 +- .../native-packages/linux-arm64-gnu/README.md | 2 +- .../linux-arm64-musl/README.md | 2 +- .../native-packages/linux-x64-gnu/README.md | 2 +- .../native-packages/linux-x64-musl/README.md | 2 +- .../win32-arm64-msvc/README.md | 2 +- .../native-packages/win32-x64-msvc/README.md | 2 +- packages/nx/presets/npm.json | 2 +- packages/nx/src/adapter/angular-json.ts | 6 +- packages/nx/src/command-line/migrate.spec.ts | 28 ++-- packages/nx/src/command-line/migrate.ts | 2 + packages/nx/src/command-line/new.ts | 4 +- packages/nx/src/config/nx-json.ts | 4 +- .../src/config/workspace-json-project-json.ts | 4 +- packages/nx/src/config/workspaces.ts | 2 +- packages/nx/src/daemon/server/watcher.ts | 2 +- packages/nx/src/devkit-exports.ts | 2 +- .../executors/utils/convert-nx-executor.ts | 2 +- packages/nx/src/hasher/hasher.spec.ts | 22 +-- packages/nx/src/hasher/hasher.ts | 4 +- .../update-15-0-0/migrate-to-inputs.ts | 8 +- packages/nx/src/nx-init/add-nx-to-nest.ts | 18 +-- packages/nx/src/nx-init/angular/index.ts | 4 +- .../nx-init/angular/integrated-workspace.ts | 2 +- .../nx/src/nx-init/react/setup-e2e-project.ts | 2 +- .../nx/src/nx-init/react/tsconfig-setup.ts | 8 +- .../src/nx-init/react/write-craco-config.ts | 2 +- packages/nx/src/plugins/js/index.ts | 11 ++ .../project-graph/build-project-graph.spec.ts | 34 ++--- .../src/project-graph/nx-deps-cache.spec.ts | 6 +- .../nx/src/project-graph/nx-deps-cache.ts | 5 +- packages/nx/src/utils/fileutils.spec.ts | 2 +- packages/nx/src/utils/nx-plugin.ts | 11 +- packages/nx/src/utils/params.spec.ts | 12 +- packages/nx/src/utils/print-help.spec.ts | 4 +- packages/nx/src/utils/print-help.ts | 12 +- .../utils/workspace-configuration-check.ts | 6 +- packages/nx/src/utils/workspace-root.ts | 2 +- packages/tao/.eslintrc.json | 2 +- packages/workspace/.eslintrc.json | 2 +- ...t-configuration-in-new-destination.spec.ts | 4 +- .../move/lib/update-build-targets.spec.ts | 4 +- .../move/lib/update-cypress-config.spec.ts | 2 +- .../move/lib/update-eslintrc-json.spec.ts | 4 +- .../generate-workspace-files.spec.ts.snap | 38 ++--- .../new/__snapshots__/new.spec.ts.snap | 2 +- .../package.json__tmpl__ | 2 +- .../new/files-root-app/package.json__tmpl__ | 2 +- .../src/generators/new/generate-preset.ts | 30 ++-- .../new/generate-workspace-files.spec.ts | 2 +- .../workspace/src/generators/new/new.spec.ts | 12 +- .../npm-package/npm-package.spec.ts | 2 +- .../src/generators/preset/preset.spec.ts | 19 +-- .../remove/lib/check-targets.spec.ts | 6 +- ...emove-project-references-in-config.spec.ts | 2 +- .../files/index.ts__tmpl__ | 4 +- .../workspace-generator.ts | 2 +- .../src/utilities/buildable-libs-utils.ts | 14 +- .../workspace/src/utilities/fileutils.spec.ts | 2 +- .../src/utilities/run-tasks-in-serial.ts | 2 +- .../workspace/src/utilities/typescript.ts | 4 +- .../utilities/typescript/get-source-nodes.ts | 2 +- .../workspace/src/utilities/version-utils.ts | 4 +- .../src/utils/rules/add-install-task.ts | 2 +- .../workspace/src/utils/rules/deleteFile.ts | 2 +- .../workspace/src/utils/rules/format-files.ts | 2 +- .../utils/rules/visit-not-ignored-files.ts | 2 +- packages/workspace/src/utils/strings.ts | 16 +- packages/workspace/src/utils/testing-utils.ts | 6 +- packages/workspace/src/utils/workspace.ts | 10 +- 101 files changed, 368 insertions(+), 338 deletions(-) diff --git a/e2e/nx-misc/src/misc.test.ts b/e2e/nx-misc/src/misc.test.ts index 2a4602e06f7c9..aee625037171e 100644 --- a/e2e/nx-misc/src/misc.test.ts +++ b/e2e/nx-misc/src/misc.test.ts @@ -67,7 +67,7 @@ describe('Nx Commands', () => { expect(listOutput).toContain('NX Installed plugins'); // just check for some, not all - expect(listOutput).toContain('@nrwl/workspace'); + expect(listOutput).toContain('@nx/workspace'); // temporarily make it look like this isn't installed renameSync( diff --git a/packages/create-nx-plugin/.eslintrc.json b/packages/create-nx-plugin/.eslintrc.json index 02cba1766ad6d..b7717ac0ddf9a 100644 --- a/packages/create-nx-plugin/.eslintrc.json +++ b/packages/create-nx-plugin/.eslintrc.json @@ -3,12 +3,12 @@ "rules": { "no-restricted-imports": [ "error", - "@nrwl/workspace", + "@nx/workspace", "@angular-devkit/core", "@angular-devkit/architect", "@angular-devkit/schematics", "nx", - "@nrwl/devkit" + "@nx/devkit" ] }, "ignorePatterns": ["!**/*"], diff --git a/packages/create-nx-plugin/bin/create-nx-plugin.ts b/packages/create-nx-plugin/bin/create-nx-plugin.ts index 00ff5a91469d8..dc0e7f1497ecb 100644 --- a/packages/create-nx-plugin/bin/create-nx-plugin.ts +++ b/packages/create-nx-plugin/bin/create-nx-plugin.ts @@ -136,7 +136,7 @@ async function main(parsedArgs: yargs.Arguments) { }); const workspaceInfo = await createWorkspace( - '@nrwl/nx-plugin', + '@nx/nx-plugin', populatedArguments ); diff --git a/packages/create-nx-workspace/.eslintrc.json b/packages/create-nx-workspace/.eslintrc.json index 02cba1766ad6d..b7717ac0ddf9a 100644 --- a/packages/create-nx-workspace/.eslintrc.json +++ b/packages/create-nx-workspace/.eslintrc.json @@ -3,12 +3,12 @@ "rules": { "no-restricted-imports": [ "error", - "@nrwl/workspace", + "@nx/workspace", "@angular-devkit/core", "@angular-devkit/architect", "@angular-devkit/schematics", "nx", - "@nrwl/devkit" + "@nx/devkit" ] }, "ignorePatterns": ["!**/*"], diff --git a/packages/create-nx-workspace/src/create-sandbox.ts b/packages/create-nx-workspace/src/create-sandbox.ts index fe531b77d57cb..b159d3316d2f4 100644 --- a/packages/create-nx-workspace/src/create-sandbox.ts +++ b/packages/create-nx-workspace/src/create-sandbox.ts @@ -32,7 +32,7 @@ export async function createSandbox(packageManager: PackageManager) { JSON.stringify({ dependencies: { nx: nxVersion, - '@nrwl/workspace': nxVersion, + '@nx/workspace': nxVersion, }, license: 'MIT', }) diff --git a/packages/create-nx-workspace/src/create-workspace.ts b/packages/create-nx-workspace/src/create-workspace.ts index 0489c43f715b7..cb9a0bccf05b5 100644 --- a/packages/create-nx-workspace/src/create-workspace.ts +++ b/packages/create-nx-workspace/src/create-workspace.ts @@ -42,7 +42,7 @@ export async function createWorkspace( // If the preset is a third-party preset, we need to call createPreset to install it // For first-party presets, it will created by createEmptyWorkspace instead. - // In createEmptyWorkspace, it will call `nx new` -> `@nrwl/workspace newGenerator` -> `@nrwl/workspace generatePreset`. + // In createEmptyWorkspace, it will call `nx new` -> `@nx/workspace newGenerator` -> `@nx/workspace generatePreset`. const thirdPartyPreset = await getThirdPartyPreset(preset); if (thirdPartyPreset) { await createPreset(thirdPartyPreset, options, packageManager, directory); diff --git a/packages/create-nx-workspace/src/utils/ci/setup-ci.ts b/packages/create-nx-workspace/src/utils/ci/setup-ci.ts index dedff15a26b60..76ab094011910 100644 --- a/packages/create-nx-workspace/src/utils/ci/setup-ci.ts +++ b/packages/create-nx-workspace/src/utils/ci/setup-ci.ts @@ -26,7 +26,7 @@ export async function setupCI( try { const pmc = getPackageManagerCommand(packageManager); const res = await execAndWait( - `${pmc.exec} nx g @nrwl/workspace:ci-workflow --ci=${ci}`, + `${pmc.exec} nx g @nx/workspace:ci-workflow --ci=${ci}`, join(process.cwd(), getFileName(name)) ); ciSpinner.succeed('CI workflow has been generated successfully'); diff --git a/packages/create-nx-workspace/src/utils/git/default-base.ts b/packages/create-nx-workspace/src/utils/git/default-base.ts index e94f951707b1d..30ba50f22aa1a 100644 --- a/packages/create-nx-workspace/src/utils/git/default-base.ts +++ b/packages/create-nx-workspace/src/utils/git/default-base.ts @@ -1,8 +1,8 @@ import { execSync } from 'child_process'; /* - * Because we don't want to depend on @nrwl/workspace (to speed up the workspace creation) - * we duplicate the helper functions from @nrwl/workspace in this file. + * Because we don't want to depend on @nx/workspace (to speed up the workspace creation) + * we duplicate the helper functions from @nx/workspace in this file. */ export function deduceDefaultBase(): string { const nxDefaultBase = 'main'; diff --git a/packages/create-nx-workspace/src/utils/output.ts b/packages/create-nx-workspace/src/utils/output.ts index b74be435f1c90..3f1bf07ac1b5f 100644 --- a/packages/create-nx-workspace/src/utils/output.ts +++ b/packages/create-nx-workspace/src/utils/output.ts @@ -1,6 +1,6 @@ /* - * Because we don't want to depend on @nrwl/workspace (to speed up the workspace creation) - * we duplicate the helper functions from @nrwl/workspace in this file. + * Because we don't want to depend on @nx/workspace (to speed up the workspace creation) + * we duplicate the helper functions from @nx/workspace in this file. */ import * as chalk from 'chalk'; diff --git a/packages/create-nx-workspace/src/utils/package-manager.ts b/packages/create-nx-workspace/src/utils/package-manager.ts index 47845e6d7004c..13481326b7859 100644 --- a/packages/create-nx-workspace/src/utils/package-manager.ts +++ b/packages/create-nx-workspace/src/utils/package-manager.ts @@ -3,8 +3,8 @@ import { existsSync, writeFileSync } from 'fs'; import { join } from 'path'; /* - * Because we don't want to depend on @nrwl/workspace (to speed up the workspace creation) - * we duplicate the helper functions from @nrwl/workspace in this file. + * Because we don't want to depend on @nx/workspace (to speed up the workspace creation) + * we duplicate the helper functions from @nx/workspace in this file. */ export const packageManagerList = ['pnpm', 'yarn', 'npm'] as const; diff --git a/packages/devkit/.eslintrc.json b/packages/devkit/.eslintrc.json index 479820e7f5e21..645aac9a7f3be 100644 --- a/packages/devkit/.eslintrc.json +++ b/packages/devkit/.eslintrc.json @@ -5,7 +5,7 @@ "error", { "paths": [ - "@nrwl/workspace", + "@nx/workspace", "@angular-devkit/core", "@angular-devkit/architect", "@angular-devkit/schematics" @@ -17,7 +17,7 @@ "allowTypeImports": true }, { - "group": ["@nrwl/devkit/**/*"], + "group": ["@nx/devkit/**/*"], "message": "Use a relative import" } ] diff --git a/packages/devkit/public-api.ts b/packages/devkit/public-api.ts index 8dc5f665ef530..4b27c27f2ad4f 100644 --- a/packages/devkit/public-api.ts +++ b/packages/devkit/public-api.ts @@ -1,7 +1,7 @@ /** - * Note to developers: STOP! This is the Public API of @nrwl/devkit. - * @nrwl/devkit should be compatible with versions of Nx 1 major version prior. - * This is so that plugins can use the latest @nrwl/devkit while their users may use versions +/- 1 of Nx. + * Note to developers: STOP! This is the Public API of @nx/devkit. + * @nx/devkit should be compatible with versions of Nx 1 major version prior. + * This is so that plugins can use the latest @nx/devkit while their users may use versions +/- 1 of Nx. * * 1. Try hard to not add to this API to reduce the surface area we need to maintain. * 2. Do not add newly created paths from the nx package to this file as they will not be available in older versions of Nx. diff --git a/packages/devkit/src/utils/package-json.spec.ts b/packages/devkit/src/utils/package-json.spec.ts index e066a6a068852..607df2bec761a 100644 --- a/packages/devkit/src/utils/package-json.spec.ts +++ b/packages/devkit/src/utils/package-json.spec.ts @@ -77,12 +77,12 @@ describe('addDependenciesToPackageJson', () => { tree, {}, { - '@nrwl/react': 'latest', + '@nx/react': 'latest', } ); expect(readJson(tree, 'package.json').devDependencies).toEqual({ jest: 'latest', - '@nrwl/react': 'latest', + '@nx/react': 'latest', }); expect(installTask).toBeDefined(); }); @@ -105,10 +105,10 @@ describe('addDependenciesToPackageJson', () => { // ARRANGE writeJson(tree, 'package.json', { dependencies: { - '@nrwl/angular': 'latest', + '@nx/angular': 'latest', }, devDependencies: { - '@nrwl/next': 'latest', + '@nx/next': 'latest', }, }); @@ -116,20 +116,20 @@ describe('addDependenciesToPackageJson', () => { const installTask = addDependenciesToPackageJson( tree, { - '@nrwl/next': 'next', + '@nx/next': 'next', }, { - '@nrwl/angular': 'next', + '@nx/angular': 'next', } ); // ASSERT const { dependencies, devDependencies } = readJson(tree, 'package.json'); expect(dependencies).toEqual({ - '@nrwl/angular': 'next', + '@nx/angular': 'next', }); expect(devDependencies).toEqual({ - '@nrwl/next': 'next', + '@nx/next': 'next', }); expect(installTask).toBeDefined(); }); @@ -138,10 +138,10 @@ describe('addDependenciesToPackageJson', () => { // ARRANGE writeJson(tree, 'package.json', { dependencies: { - '@nrwl/angular': 'next', + '@nx/angular': 'next', }, devDependencies: { - '@nrwl/next': 'next', + '@nx/next': 'next', }, }); @@ -149,20 +149,20 @@ describe('addDependenciesToPackageJson', () => { const installTask = addDependenciesToPackageJson( tree, { - '@nrwl/next': 'latest', + '@nx/next': 'latest', }, { - '@nrwl/angular': 'latest', + '@nx/angular': 'latest', } ); // ASSERT const { dependencies, devDependencies } = readJson(tree, 'package.json'); expect(dependencies).toEqual({ - '@nrwl/angular': 'next', + '@nx/angular': 'next', }); expect(devDependencies).toEqual({ - '@nrwl/next': 'next', + '@nx/next': 'next', }); expect(installTask).toBeDefined(); }); @@ -171,10 +171,10 @@ describe('addDependenciesToPackageJson', () => { // ARRANGE writeJson(tree, 'package.json', { dependencies: { - '@nrwl/angular': '14.0.0', + '@nx/angular': '14.0.0', }, devDependencies: { - '@nrwl/next': '14.0.0', + '@nx/next': '14.0.0', }, }); @@ -182,20 +182,20 @@ describe('addDependenciesToPackageJson', () => { const installTask = addDependenciesToPackageJson( tree, { - '@nrwl/next': '14.1.0', + '@nx/next': '14.1.0', }, { - '@nrwl/angular': '14.1.0', + '@nx/angular': '14.1.0', } ); // ASSERT const { dependencies, devDependencies } = readJson(tree, 'package.json'); expect(dependencies).toEqual({ - '@nrwl/angular': '14.1.0', + '@nx/angular': '14.1.0', }); expect(devDependencies).toEqual({ - '@nrwl/next': '14.1.0', + '@nx/next': '14.1.0', }); expect(installTask).toBeDefined(); }); @@ -204,10 +204,10 @@ describe('addDependenciesToPackageJson', () => { // ARRANGE writeJson(tree, 'package.json', { dependencies: { - '@nrwl/angular': '14.1.0', + '@nx/angular': '14.1.0', }, devDependencies: { - '@nrwl/next': '14.1.0', + '@nx/next': '14.1.0', }, }); @@ -215,20 +215,20 @@ describe('addDependenciesToPackageJson', () => { const installTask = addDependenciesToPackageJson( tree, { - '@nrwl/next': '14.0.0', + '@nx/next': '14.0.0', }, { - '@nrwl/angular': '14.0.0', + '@nx/angular': '14.0.0', } ); // ASSERT const { dependencies, devDependencies } = readJson(tree, 'package.json'); expect(dependencies).toEqual({ - '@nrwl/angular': '14.1.0', + '@nx/angular': '14.1.0', }); expect(devDependencies).toEqual({ - '@nrwl/next': '14.1.0', + '@nx/next': '14.1.0', }); expect(installTask).toBeDefined(); }); @@ -237,12 +237,12 @@ describe('addDependenciesToPackageJson', () => { // ARRANGE writeJson(tree, 'package.json', { dependencies: { - '@nrwl/angular': '14.2.0', - '@nrwl/cypress': '14.1.1', + '@nx/angular': '14.2.0', + '@nx/cypress': '14.1.1', }, devDependencies: { - '@nrwl/next': '14.0.0', - '@nrwl/vite': '14.1.0', + '@nx/next': '14.0.0', + '@nx/vite': '14.1.0', }, }); @@ -250,22 +250,22 @@ describe('addDependenciesToPackageJson', () => { const installTask = addDependenciesToPackageJson( tree, { - '@nrwl/angular': '14.1.0', + '@nx/angular': '14.1.0', }, { - '@nrwl/next': '14.1.0', + '@nx/next': '14.1.0', } ); // ASSERT const { dependencies, devDependencies } = readJson(tree, 'package.json'); expect(dependencies).toEqual({ - '@nrwl/angular': '14.2.0', - '@nrwl/cypress': '14.1.1', + '@nx/angular': '14.2.0', + '@nx/cypress': '14.1.1', }); expect(devDependencies).toEqual({ - '@nrwl/next': '14.1.0', - '@nrwl/vite': '14.1.0', + '@nx/next': '14.1.0', + '@nx/vite': '14.1.0', }); expect(installTask).toBeDefined(); }); @@ -274,12 +274,12 @@ describe('addDependenciesToPackageJson', () => { // ARRANGE writeJson(tree, 'package.json', { dependencies: { - '@nrwl/angular': '14.0.0', - '@nrwl/cypress': '14.1.1', + '@nx/angular': '14.0.0', + '@nx/cypress': '14.1.1', }, devDependencies: { - '@nrwl/next': '14.2.0', - '@nrwl/vite': '14.1.0', + '@nx/next': '14.2.0', + '@nx/vite': '14.1.0', }, }); @@ -287,22 +287,22 @@ describe('addDependenciesToPackageJson', () => { const installTask = addDependenciesToPackageJson( tree, { - '@nrwl/angular': '14.1.0', + '@nx/angular': '14.1.0', }, { - '@nrwl/next': '14.1.0', + '@nx/next': '14.1.0', } ); // ASSERT const { dependencies, devDependencies } = readJson(tree, 'package.json'); expect(dependencies).toEqual({ - '@nrwl/angular': '14.1.0', - '@nrwl/cypress': '14.1.1', + '@nx/angular': '14.1.0', + '@nx/cypress': '14.1.1', }); expect(devDependencies).toEqual({ - '@nrwl/next': '14.2.0', - '@nrwl/vite': '14.1.0', + '@nx/next': '14.2.0', + '@nx/vite': '14.1.0', }); expect(installTask).toBeDefined(); }); @@ -311,10 +311,10 @@ describe('addDependenciesToPackageJson', () => { // ARRANGE writeJson(tree, 'package.json', { dependencies: { - '@nrwl/angular': '14.0.0', + '@nx/angular': '14.0.0', }, devDependencies: { - '@nrwl/next': '14.1.0', + '@nx/next': '14.1.0', }, }); @@ -322,20 +322,20 @@ describe('addDependenciesToPackageJson', () => { const installTask = addDependenciesToPackageJson( tree, { - '@nrwl/next': '14.0.0', + '@nx/next': '14.0.0', }, { - '@nrwl/angular': '14.1.0', + '@nx/angular': '14.1.0', } ); // ASSERT const { dependencies, devDependencies } = readJson(tree, 'package.json'); expect(dependencies).toEqual({ - '@nrwl/angular': '14.1.0', + '@nx/angular': '14.1.0', }); expect(devDependencies).toEqual({ - '@nrwl/next': '14.1.0', + '@nx/next': '14.1.0', }); expect(installTask).toBeDefined(); }); @@ -344,11 +344,11 @@ describe('addDependenciesToPackageJson', () => { // ARRANGE writeJson(tree, 'package.json', { dependencies: { - '@nrwl/angular': 'github:reponame/packageNameOne', - '@nrwl/vite': 'git://github.com/npm/cli.git#v14.2.0', // this format is parsable + '@nx/angular': 'github:reponame/packageNameOne', + '@nx/vite': 'git://github.com/npm/cli.git#v14.2.0', // this format is parsable }, devDependencies: { - '@nrwl/next': '14.1.0', + '@nx/next': '14.1.0', }, }); @@ -356,26 +356,25 @@ describe('addDependenciesToPackageJson', () => { const installTask = addDependenciesToPackageJson( tree, { - '@nrwl/next': 'github:reponame/packageNameTwo', - '@nrwl/cypress': + '@nx/next': 'github:reponame/packageNameTwo', + '@nx/cypress': 'git+https://username@github.com/reponame/packagename.git', - '@nrwl/vite': '14.0.1', + '@nx/vite': '14.0.1', }, { - '@nrwl/angular': '14.1.0', + '@nx/angular': '14.1.0', } ); // ASSERT const { dependencies, devDependencies } = readJson(tree, 'package.json'); expect(dependencies).toEqual({ - '@nrwl/angular': '14.1.0', - '@nrwl/cypress': - 'git+https://username@github.com/reponame/packagename.git', - '@nrwl/vite': 'git://github.com/npm/cli.git#v14.2.0', + '@nx/angular': '14.1.0', + '@nx/cypress': 'git+https://username@github.com/reponame/packagename.git', + '@nx/vite': 'git://github.com/npm/cli.git#v14.2.0', }); expect(devDependencies).toEqual({ - '@nrwl/next': 'github:reponame/packageNameTwo', + '@nx/next': 'github:reponame/packageNameTwo', }); expect(installTask).toBeDefined(); }); @@ -384,10 +383,10 @@ describe('addDependenciesToPackageJson', () => { // ARRANGE writeJson(tree, 'package.json', { dependencies: { - '@nrwl/angular': 'latest', + '@nx/angular': 'latest', }, devDependencies: { - '@nrwl/next': 'latest', + '@nx/next': 'latest', }, }); @@ -395,22 +394,22 @@ describe('addDependenciesToPackageJson', () => { const installTask = addDependenciesToPackageJson( tree, { - '@nrwl/next': 'next', - '@nrwl/cypress': 'latest', + '@nx/next': 'next', + '@nx/cypress': 'latest', }, { - '@nrwl/angular': 'next', + '@nx/angular': 'next', } ); // ASSERT const { dependencies, devDependencies } = readJson(tree, 'package.json'); expect(dependencies).toEqual({ - '@nrwl/angular': 'next', - '@nrwl/cypress': 'latest', + '@nx/angular': 'next', + '@nx/cypress': 'latest', }); expect(devDependencies).toEqual({ - '@nrwl/next': 'next', + '@nx/next': 'next', }); expect(installTask).toBeDefined(); }); diff --git a/packages/nx-plugin/.eslintrc.json b/packages/nx-plugin/.eslintrc.json index cc515a27eb399..1c6dadd2c16dc 100644 --- a/packages/nx-plugin/.eslintrc.json +++ b/packages/nx-plugin/.eslintrc.json @@ -24,7 +24,7 @@ "@angular-devkit/architect", "@angular-devkit/core", "@angular-devkit/schematics", - "@nrwl/workspace" + "@nx/workspace" ] } }, diff --git a/packages/nx-plugin/generators.json b/packages/nx-plugin/generators.json index 31c8ebbe99d89..ca7f38473fc1b 100644 --- a/packages/nx-plugin/generators.json +++ b/packages/nx-plugin/generators.json @@ -1,7 +1,7 @@ { "name": "nx/plugin", "version": "0.1", - "extends": ["@nrwl/workspace"], + "extends": ["@nx/workspace"], "generators": { "plugin": { "factory": "./src/generators/plugin/plugin", diff --git a/packages/nx-plugin/src/executors/e2e/e2e.impl.ts b/packages/nx-plugin/src/executors/e2e/e2e.impl.ts index 5deaccee97b1c..75678f9f00b7c 100644 --- a/packages/nx-plugin/src/executors/e2e/e2e.impl.ts +++ b/packages/nx-plugin/src/executors/e2e/e2e.impl.ts @@ -12,7 +12,7 @@ import { JestExecutorOptions } from '@nx/jest/src/executors/jest/schema'; import { jestExecutor } from '@nx/jest/src/executors/jest/jest.impl'; import type { NxPluginE2EExecutorOptions } from './schema'; -// TODO(Caleb & Craigory): can we get rid of this and just use @nrwl/jest directly? +// TODO(Caleb & Craigory): can we get rid of this and just use @nx/jest directly? export async function* nxPluginE2EExecutor( options: NxPluginE2EExecutorOptions, context: ExecutorContext diff --git a/packages/nx-plugin/src/generators/e2e-project/e2e.spec.ts b/packages/nx-plugin/src/generators/e2e-project/e2e.spec.ts index 03976dbec1036..ceea685e40e99 100644 --- a/packages/nx-plugin/src/generators/e2e-project/e2e.spec.ts +++ b/packages/nx-plugin/src/generators/e2e-project/e2e.spec.ts @@ -116,7 +116,7 @@ describe('NxPlugin e2e-project Generator', () => { expect(project.root).toEqual('apps/my-plugin-e2e'); expect(project.targets.e2e).toBeTruthy(); expect(project.targets.e2e).toMatchObject({ - executor: '@nrwl/nx-plugin:e2e', + executor: '@nx/nx-plugin:e2e', options: expect.objectContaining({ target: 'my-plugin:build' }), }); }); diff --git a/packages/nx-plugin/src/generators/e2e-project/e2e.ts b/packages/nx-plugin/src/generators/e2e-project/e2e.ts index 00f81fd91e109..c4e5c07153751 100644 --- a/packages/nx-plugin/src/generators/e2e-project/e2e.ts +++ b/packages/nx-plugin/src/generators/e2e-project/e2e.ts @@ -78,7 +78,7 @@ function updateWorkspaceConfiguration(host: Tree, options: NormalizedSchema) { sourceRoot: `${options.projectRoot}/src`, targets: { e2e: { - executor: '@nrwl/nx-plugin:e2e', + executor: '@nx/nx-plugin:e2e', options: { target: `${options.pluginName}:build` }, }, }, diff --git a/packages/nx-plugin/src/generators/e2e-project/files/tests/__pluginName__.spec.ts__tmpl__ b/packages/nx-plugin/src/generators/e2e-project/files/tests/__pluginName__.spec.ts__tmpl__ index e4c62d874ea8d..db259c61cc59e 100644 --- a/packages/nx-plugin/src/generators/e2e-project/files/tests/__pluginName__.spec.ts__tmpl__ +++ b/packages/nx-plugin/src/generators/e2e-project/files/tests/__pluginName__.spec.ts__tmpl__ @@ -4,7 +4,7 @@ import { readJson, runNxCommandAsync, uniq, -} from '@nrwl/nx-plugin/testing'; +} from '@nx/nx-plugin/testing'; describe('<%= pluginName %> e2e', () => { // Setting up individual workspaces per diff --git a/packages/nx-plugin/src/generators/executor/executor.spec.ts b/packages/nx-plugin/src/generators/executor/executor.spec.ts index e8516168a51f6..dfeca846f5a77 100644 --- a/packages/nx-plugin/src/generators/executor/executor.spec.ts +++ b/packages/nx-plugin/src/generators/executor/executor.spec.ts @@ -150,7 +150,7 @@ describe('NxPlugin Executor Generator', () => { .read('libs/my-plugin/src/executors/my-executor/hasher.ts') .toString() ).toMatchInlineSnapshot(` - "import { CustomHasher } from '@nrwl/devkit'; + "import { CustomHasher } from '@nx/devkit'; /** * This is a boilerplate custom hasher that matches diff --git a/packages/nx-plugin/src/generators/executor/files/hasher/__fileName__/hasher.spec.ts__tmpl__ b/packages/nx-plugin/src/generators/executor/files/hasher/__fileName__/hasher.spec.ts__tmpl__ index 115ddb410a363..650bf4713df72 100644 --- a/packages/nx-plugin/src/generators/executor/files/hasher/__fileName__/hasher.spec.ts__tmpl__ +++ b/packages/nx-plugin/src/generators/executor/files/hasher/__fileName__/hasher.spec.ts__tmpl__ @@ -1,4 +1,4 @@ -import { Hasher, HasherContext } from '@nrwl/devkit'; +import { Hasher, HasherContext } from '@nx/devkit'; import { <%=propertyName%>Hasher } from './hasher'; diff --git a/packages/nx-plugin/src/generators/executor/files/hasher/__fileName__/hasher.ts__tmpl__ b/packages/nx-plugin/src/generators/executor/files/hasher/__fileName__/hasher.ts__tmpl__ index 215ed61755f79..96f2a77e13060 100644 --- a/packages/nx-plugin/src/generators/executor/files/hasher/__fileName__/hasher.ts__tmpl__ +++ b/packages/nx-plugin/src/generators/executor/files/hasher/__fileName__/hasher.ts__tmpl__ @@ -1,4 +1,4 @@ -import { CustomHasher } from '@nrwl/devkit'; +import { CustomHasher } from '@nx/devkit'; /** * This is a boilerplate custom hasher that matches diff --git a/packages/nx-plugin/src/generators/generator/files/generator/__fileName__/generator.spec.ts__tmpl__ b/packages/nx-plugin/src/generators/generator/files/generator/__fileName__/generator.spec.ts__tmpl__ index ef7b64c77767f..6f48151dcc906 100644 --- a/packages/nx-plugin/src/generators/generator/files/generator/__fileName__/generator.spec.ts__tmpl__ +++ b/packages/nx-plugin/src/generators/generator/files/generator/__fileName__/generator.spec.ts__tmpl__ @@ -1,5 +1,5 @@ -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { Tree, readProjectConfiguration } from '@nrwl/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { Tree, readProjectConfiguration } from '@nx/devkit'; import generator from './generator'; import { <%= className %>GeneratorSchema } from './schema'; diff --git a/packages/nx-plugin/src/generators/generator/files/generator/__fileName__/generator.ts__tmpl__ b/packages/nx-plugin/src/generators/generator/files/generator/__fileName__/generator.ts__tmpl__ index afe33d1e0303d..ed05aae07e2f4 100644 --- a/packages/nx-plugin/src/generators/generator/files/generator/__fileName__/generator.ts__tmpl__ +++ b/packages/nx-plugin/src/generators/generator/files/generator/__fileName__/generator.ts__tmpl__ @@ -6,7 +6,7 @@ import { names, offsetFromRoot, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import * as path from 'path'; import { <%= className %>GeneratorSchema } from './schema'; diff --git a/packages/nx-plugin/src/generators/lint-checks/generator.ts b/packages/nx-plugin/src/generators/lint-checks/generator.ts index 027753403decb..880e5bb82fefe 100644 --- a/packages/nx-plugin/src/generators/lint-checks/generator.ts +++ b/packages/nx-plugin/src/generators/lint-checks/generator.ts @@ -107,8 +107,10 @@ export function addMigrationJsonChecks( host, `${projectConfiguration.root}/.eslintrc.json`, (c) => { - const override = c.overrides.find((o) => - Object.keys(o.rules ?? {})?.includes('@nrwl/nx/nx-plugin-checks') + const override = c.overrides.find( + (o) => + Object.keys(o.rules ?? {})?.includes('@nx/nx/nx-plugin-checks') || + Object.keys(o.rules ?? {})?.includes('@nrwl/nx/nx-plugin-checks') ); if ( Array.isArray(override?.files) && @@ -133,7 +135,10 @@ function updateProjectTarget( } for (const [target, configuration] of Object.entries(project.targets)) { - if (configuration.executor === '@nrwl/linter:eslint') { + if ( + configuration.executor === '@nx/linter:eslint' || + configuration.executor === '@nrwl/linter:eslint' + ) { const opts: EsLintExecutorOptions = configuration.options ?? {}; opts.lintFilePatterns ??= []; @@ -182,8 +187,10 @@ function updateProjectEslintConfig( const eslintConfig = readJson(host, eslintPath); eslintConfig.overrides ??= []; if ( - !eslintConfig.overrides.some((x) => - Object.keys(x.rules ?? {}).includes('@nrwl/nx/nx-plugin-checks') + !eslintConfig.overrides.some( + (x) => + Object.keys(x.rules ?? {}).includes('@nx/nx/nx-plugin-checks') || + Object.keys(x.rules ?? {}).includes('@nrwl/nx/nx-plugin-checks') ) ) { eslintConfig.overrides.push({ @@ -254,6 +261,7 @@ export function getEsLintOptions( project: ProjectConfiguration ): [target: string, configuration: TargetConfiguration] { return Object.entries(project.targets || {}).find( - ([, x]) => x.executor === '@nrwl/linter:eslint' + ([, x]) => + x.executor === '@nx/linter:eslint' || x.executor === '@nrwl/linter:eslint' ); } diff --git a/packages/nx-plugin/src/generators/migration/files/migration/__name__/__name__.ts__tmpl__ b/packages/nx-plugin/src/generators/migration/files/migration/__name__/__name__.ts__tmpl__ index c16470b439d2d..b8a9ebbe87826 100644 --- a/packages/nx-plugin/src/generators/migration/files/migration/__name__/__name__.ts__tmpl__ +++ b/packages/nx-plugin/src/generators/migration/files/migration/__name__/__name__.ts__tmpl__ @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ -import { Tree } from '@nrwl/devkit'; +import { Tree } from '@nx/devkit'; export default function update(host: Tree) { // ... diff --git a/packages/nx-plugin/src/generators/plugin/plugin.ts b/packages/nx-plugin/src/generators/plugin/plugin.ts index 9911a4cda06f4..3cf724f196950 100644 --- a/packages/nx-plugin/src/generators/plugin/plugin.ts +++ b/packages/nx-plugin/src/generators/plugin/plugin.ts @@ -101,12 +101,13 @@ export async function pluginGenerator(host: Tree, schema: Schema) { addDependenciesToPackageJson( host, { - '@nrwl/devkit': nxVersion, + '@nx/devkit': nxVersion, tslib: tsLibVersion, }, { - '@nrwl/jest': nxVersion, - '@nrwl/js': nxVersion, + '@nx/jest': nxVersion, + '@nx/js': nxVersion, + '@nx/nx-plugin': nxVersion, '@swc-node/register': swcNodeVersion, } ); diff --git a/packages/nx-plugin/src/generators/preset/generator.ts b/packages/nx-plugin/src/generators/preset/generator.ts index 3169c26075776..fcdc3950f958f 100644 --- a/packages/nx-plugin/src/generators/preset/generator.ts +++ b/packages/nx-plugin/src/generators/preset/generator.ts @@ -37,9 +37,9 @@ function removeNpmScope(tree: Tree) { } function moveNxPluginToDevDeps(tree: Tree) { updateJson(tree, 'package.json', (json) => { - const nxPluginEntry = json.dependencies['@nrwl/nx-plugin']; - delete json.dependencies['@nrwl/nx-plugin']; - json.devDependencies['@nrwl/nx-plugin'] = nxPluginEntry; + const nxPluginEntry = json.dependencies['@nx/nx-plugin']; + delete json.dependencies['@nx/nx-plugin']; + json.devDependencies['@nx/nx-plugin'] = nxPluginEntry; return json; }); } diff --git a/packages/nx-plugin/src/utils/testing-utils/nx-project.ts b/packages/nx-plugin/src/utils/testing-utils/nx-project.ts index e8a5af6a7eac4..706d7289b8628 100644 --- a/packages/nx-plugin/src/utils/testing-utils/nx-project.ts +++ b/packages/nx-plugin/src/utils/testing-utils/nx-project.ts @@ -15,7 +15,7 @@ function runNxNewCommand(args?: string, silent?: boolean) { return execSync( `node ${require.resolve( 'nx' - )} new proj --nx-workspace-root=${localTmpDir} --no-interactive --skip-install --collection=@nrwl/workspace --npmScope=proj --preset=empty ${ + )} new proj --nx-workspace-root=${localTmpDir} --no-interactive --skip-install --collection=@nx/workspace --npmScope=proj --preset=empty ${ args || '' }`, { @@ -76,7 +76,7 @@ export function newNxProject( /** * Ensures that a project has been setup in the e2e directory - * It will also copy `@nrwl` packages to the e2e directory + * It will also copy `@nx` packages to the e2e directory */ export function ensureNxProject( npmPackageName?: string, diff --git a/packages/nx/native-packages/darwin-arm64/README.md b/packages/nx/native-packages/darwin-arm64/README.md index 1a9accd0fce8c..78b499ea93293 100644 --- a/packages/nx/native-packages/darwin-arm64/README.md +++ b/packages/nx/native-packages/darwin-arm64/README.md @@ -1,3 +1,3 @@ # `nx-darwin-arm64` -This is the **aarch64-apple-darwin** binary for `@nrwl/nx` +This is the **aarch64-apple-darwin** binary for `@nx/nx` diff --git a/packages/nx/native-packages/darwin-x64/README.md b/packages/nx/native-packages/darwin-x64/README.md index bb198003e67c2..7ad571753ba57 100644 --- a/packages/nx/native-packages/darwin-x64/README.md +++ b/packages/nx/native-packages/darwin-x64/README.md @@ -1,3 +1,3 @@ # `nx-darwin-x64` -This is the **x86_64-apple-darwin** binary for `@nrwl/nx` +This is the **x86_64-apple-darwin** binary for `@nx/nx` diff --git a/packages/nx/native-packages/linux-arm-gnueabihf/README.md b/packages/nx/native-packages/linux-arm-gnueabihf/README.md index 6e9794594c131..410137cecb6ba 100644 --- a/packages/nx/native-packages/linux-arm-gnueabihf/README.md +++ b/packages/nx/native-packages/linux-arm-gnueabihf/README.md @@ -1,3 +1,3 @@ # `nx-linux-arm-gnueabihf` -This is the **armv7-unknown-linux-gnueabihf** binary for `@nrwl/nx` +This is the **armv7-unknown-linux-gnueabihf** binary for `@nx/nx` diff --git a/packages/nx/native-packages/linux-arm64-gnu/README.md b/packages/nx/native-packages/linux-arm64-gnu/README.md index 8d1887d7f27bb..a87379c7e9c05 100644 --- a/packages/nx/native-packages/linux-arm64-gnu/README.md +++ b/packages/nx/native-packages/linux-arm64-gnu/README.md @@ -1,3 +1,3 @@ # `nx-linux-arm64-gnu` -This is the **aarch64-unknown-linux-gnu** binary for `@nrwl/nx` +This is the **aarch64-unknown-linux-gnu** binary for `@nx/nx` diff --git a/packages/nx/native-packages/linux-arm64-musl/README.md b/packages/nx/native-packages/linux-arm64-musl/README.md index 31788ae4f6bb6..4930582867cef 100644 --- a/packages/nx/native-packages/linux-arm64-musl/README.md +++ b/packages/nx/native-packages/linux-arm64-musl/README.md @@ -1,3 +1,3 @@ # `nx-linux-arm64-musl` -This is the **aarch64-unknown-linux-musl** binary for `@nrwl/nx` +This is the **aarch64-unknown-linux-musl** binary for `@nx/nx` diff --git a/packages/nx/native-packages/linux-x64-gnu/README.md b/packages/nx/native-packages/linux-x64-gnu/README.md index 889d3c5a567b0..706329e3bd3fc 100644 --- a/packages/nx/native-packages/linux-x64-gnu/README.md +++ b/packages/nx/native-packages/linux-x64-gnu/README.md @@ -1,3 +1,3 @@ # `nx-linux-x64-gnu` -This is the **x86_64-unknown-linux-gnu** binary for `@nrwl/nx` +This is the **x86_64-unknown-linux-gnu** binary for `@nx/nx` diff --git a/packages/nx/native-packages/linux-x64-musl/README.md b/packages/nx/native-packages/linux-x64-musl/README.md index d007b0902f69e..22e6da1a8fe4b 100644 --- a/packages/nx/native-packages/linux-x64-musl/README.md +++ b/packages/nx/native-packages/linux-x64-musl/README.md @@ -1,3 +1,3 @@ # `nx-linux-x64-musl` -This is the **x86_64-unknown-linux-musl** binary for `@nrwl/nx` +This is the **x86_64-unknown-linux-musl** binary for `@nx/nx` diff --git a/packages/nx/native-packages/win32-arm64-msvc/README.md b/packages/nx/native-packages/win32-arm64-msvc/README.md index a75b7bcf1f256..a3a3fb9682575 100644 --- a/packages/nx/native-packages/win32-arm64-msvc/README.md +++ b/packages/nx/native-packages/win32-arm64-msvc/README.md @@ -1,3 +1,3 @@ # `nx-win32-arm64-msvc` -This is the **aarch64-pc-windows-msvc** binary for `@nrwl/nx` +This is the **aarch64-pc-windows-msvc** binary for `@nx/nx` diff --git a/packages/nx/native-packages/win32-x64-msvc/README.md b/packages/nx/native-packages/win32-x64-msvc/README.md index bedb1b96bf4a5..1484554df7a3c 100644 --- a/packages/nx/native-packages/win32-x64-msvc/README.md +++ b/packages/nx/native-packages/win32-x64-msvc/README.md @@ -1,3 +1,3 @@ # `nx-win32-x64-msvc` -This is the **x86_64-pc-windows-msvc** binary for `@nrwl/nx` +This is the **x86_64-pc-windows-msvc** binary for `@nx/nx` diff --git a/packages/nx/presets/npm.json b/packages/nx/presets/npm.json index 5a2a979443575..21aa44f550942 100644 --- a/packages/nx/presets/npm.json +++ b/packages/nx/presets/npm.json @@ -8,7 +8,7 @@ } }, "pluginsConfig": { - "@nrwl/js": { + "@nx/js": { "analyzeSourceFiles": false } } diff --git a/packages/nx/src/adapter/angular-json.ts b/packages/nx/src/adapter/angular-json.ts index f5d782ca11d19..cf55622a9f8a4 100644 --- a/packages/nx/src/adapter/angular-json.ts +++ b/packages/nx/src/adapter/angular-json.ts @@ -17,8 +17,8 @@ export function shouldMergeAngularProjects( // Include projects from angular.json if explicitly required. // e.g. when invoked from `packages/devkit/src/utils/convert-nx-executor.ts` (includeProjectsFromAngularJson || - // Or if a workspace has `@nrwl/angular` installed then projects from `angular.json` to be considered by Nx. - isNrwlAngularInstalled()) + // Or if a workspace has `@nrwl/angular`/`@nx/angular` installed then projects from `angular.json` to be considered by Nx. + isAngularPluginInstalled()) ) { return true; } else { @@ -26,7 +26,7 @@ export function shouldMergeAngularProjects( } } -function isNrwlAngularInstalled() { +function isAngularPluginInstalled() { try { require.resolve('@nx/angular'); return true; diff --git a/packages/nx/src/command-line/migrate.spec.ts b/packages/nx/src/command-line/migrate.spec.ts index adad105d9dfb9..dc550cb342632 100644 --- a/packages/nx/src/command-line/migrate.spec.ts +++ b/packages/nx/src/command-line/migrate.spec.ts @@ -506,8 +506,7 @@ describe('Migration', () => { it('should not throw when packages are missing', async () => { const migrator = new Migrator({ packageJson: createPackageJson(), - getInstalledPackageVersion: (p) => - p === '@nrwl/nest' ? null : '1.0.0', + getInstalledPackageVersion: (p) => (p === '@nx/nest' ? null : '1.0.0'), fetch: (_p, _v) => Promise.resolve({ version: '2.0.0', @@ -516,16 +515,15 @@ describe('Migration', () => { from: {}, to: {}, }); - await migrator.migrate('@nrwl/workspace', '2.0.0'); + await migrator.migrate('@nx/workspace', '2.0.0'); }); it('should only fetch packages that are installed', async () => { const migrator = new Migrator({ packageJson: createPackageJson(), - getInstalledPackageVersion: (p) => - p === '@nrwl/nest' ? null : '1.0.0', + getInstalledPackageVersion: (p) => (p === '@nx/nest' ? null : '1.0.0'), fetch: (p, _v) => { - if (p === '@nrwl/nest') { + if (p === '@nx/nest') { throw new Error('Boom'); } return Promise.resolve({ @@ -536,7 +534,7 @@ describe('Migration', () => { from: {}, to: {}, }); - await migrator.migrate('@nrwl/workspace', '2.0.0'); + await migrator.migrate('@nx/workspace', '2.0.0'); }); it('should only fetch packages that are top-level deps', async () => { @@ -1582,10 +1580,10 @@ describe('Migration', () => { }); expect( await parseMigrationsOptions({ - packageAndVersion: '@nrwl/workspace@8.12', + packageAndVersion: '@nx/workspace@8.12', }) ).toMatchObject({ - targetPackage: '@nrwl/workspace', + targetPackage: '@nx/workspace', targetVersion: '8.12.0', }); expect( @@ -1608,18 +1606,18 @@ describe('Migration', () => { }); expect( await parseMigrationsOptions({ - packageAndVersion: '@nrwl/workspace@latest', + packageAndVersion: '@nx/workspace@latest', }) ).toMatchObject({ - targetPackage: '@nrwl/workspace', + targetPackage: '@nx/workspace', targetVersion: 'latest', }); expect( await parseMigrationsOptions({ - packageAndVersion: '@nrwl/workspace@alpha', + packageAndVersion: '@nx/workspace@alpha', }) ).toMatchObject({ - targetPackage: '@nrwl/workspace', + targetPackage: '@nx/workspace', targetVersion: 'alpha', }); }); @@ -1674,13 +1672,13 @@ describe('Migration', () => { it('should handle backslashes in package names', async () => { const r = await parseMigrationsOptions({ - packageAndVersion: '@nrwl\\workspace@8.12.0', + packageAndVersion: '@nx\\workspace@8.12.0', from: '@myscope\\a@12.3,@myscope\\b@1.1.1', to: '@myscope\\c@12.3.1', }); expect(r).toEqual({ type: 'generateMigrations', - targetPackage: '@nrwl/workspace', + targetPackage: '@nx/workspace', targetVersion: '8.12.0', from: { '@myscope/a': '12.3.0', diff --git a/packages/nx/src/command-line/migrate.ts b/packages/nx/src/command-line/migrate.ts index f1a0afc0d38b4..5bc0f16831430 100644 --- a/packages/nx/src/command-line/migrate.ts +++ b/packages/nx/src/command-line/migrate.ts @@ -1147,6 +1147,8 @@ function readNxVersion(packageJson: PackageJson) { return ( packageJson?.devDependencies?.['nx'] ?? packageJson?.dependencies?.['nx'] ?? + packageJson?.devDependencies?.['@nx/workspace'] ?? + packageJson?.dependencies?.['@nx/workspace'] ?? packageJson?.devDependencies?.['@nrwl/workspace'] ?? packageJson?.dependencies?.['@nrwl/workspace'] ); diff --git a/packages/nx/src/command-line/new.ts b/packages/nx/src/command-line/new.ts index 6e2d47852e71b..1f1212392ada3 100644 --- a/packages/nx/src/command-line/new.ts +++ b/packages/nx/src/command-line/new.ts @@ -18,11 +18,11 @@ export async function newWorkspace(cwd: string, args: { [k: string]: any }) { async () => { const isInteractive = args.interactive; const { normalizedGeneratorName, schema, implementationFactory } = - ws.readGenerator('@nrwl/workspace/generators.json', 'new'); + ws.readGenerator('@nx/workspace/generators.json', 'new'); removeSpecialFlags(args); const combinedOpts = await combineOptionsForGenerator( args, - '@nrwl/workspace/generators.json', + '@nx/workspace/generators.json', normalizedGeneratorName, null, null, diff --git a/packages/nx/src/config/nx-json.ts b/packages/nx/src/config/nx-json.ts index 3a159b38cf2bd..c539e25c2f8ab 100644 --- a/packages/nx/src/config/nx-json.ts +++ b/packages/nx/src/config/nx-json.ts @@ -39,7 +39,7 @@ interface NxInstallationConfiguration { version: string; /** * Record. e.g. - * plugins: { '@nrwl/angular': '1.0.0' } + * plugins: { '@nx/angular': '1.0.0' } */ plugins?: Record; } @@ -106,7 +106,7 @@ export interface NxJsonConfiguration { * * ``` * { - * "@nrwl/react": { + * "@nx/react": { * "library": { * "style": "scss" * } diff --git a/packages/nx/src/config/workspace-json-project-json.ts b/packages/nx/src/config/workspace-json-project-json.ts index 2212dec313b79..a1847f6c69803 100644 --- a/packages/nx/src/config/workspace-json-project-json.ts +++ b/packages/nx/src/config/workspace-json-project-json.ts @@ -74,7 +74,7 @@ export interface ProjectConfiguration { * * ``` * { - * "@nrwl/react": { + * "@nx/react": { * "library": { * "style": "scss" * } @@ -136,7 +136,7 @@ export interface TargetConfiguration { /** * The executor/builder used to implement the target. * - * Example: '@nrwl/web:rollup' + * Example: '@nx/web:rollup' */ executor?: string; diff --git a/packages/nx/src/config/workspaces.ts b/packages/nx/src/config/workspaces.ts index 050972cc3ac96..bfe50cf131df5 100644 --- a/packages/nx/src/config/workspaces.ts +++ b/packages/nx/src/config/workspaces.ts @@ -519,7 +519,7 @@ function findFullGeneratorName( } /** - * Pulled from toFileName in names from @nrwl/devkit. + * Pulled from toFileName in names from @nx/devkit. * Todo: Should refactor, not duplicate. */ export function toProjectName(fileName: string): string { diff --git a/packages/nx/src/daemon/server/watcher.ts b/packages/nx/src/daemon/server/watcher.ts index 2a6a9eb7ddc97..c60d55996664d 100644 --- a/packages/nx/src/daemon/server/watcher.ts +++ b/packages/nx/src/daemon/server/watcher.ts @@ -57,7 +57,7 @@ export async function subscribeToWorkspaceChanges( cb: FileWatcherCallback ): Promise { /** - * The imports and exports of @nrwl/workspace are somewhat messy and far reaching across the repo (and beyond), + * The imports and exports of @nx/workspace are somewhat messy and far reaching across the repo (and beyond), * and so it is much safer for us to lazily load here `@parcel/watcher` so that its inclusion is not inadvertently * executed by packages which do not have its necessary native binaries available. */ diff --git a/packages/nx/src/devkit-exports.ts b/packages/nx/src/devkit-exports.ts index 9919f56218c64..1342f4e77a09b 100644 --- a/packages/nx/src/devkit-exports.ts +++ b/packages/nx/src/devkit-exports.ts @@ -1,5 +1,5 @@ /** - * Note to developers: STOP! These exports end up as the public API of @nrwl/devkit. + * Note to developers: STOP! These exports end up as the public API of @nx/devkit. * Try hard to not add to this API to reduce the surface area we need to maintain. */ diff --git a/packages/nx/src/executors/utils/convert-nx-executor.ts b/packages/nx/src/executors/utils/convert-nx-executor.ts index 57a8f4759e4b7..061009dbf2dba 100644 --- a/packages/nx/src/executors/utils/convert-nx-executor.ts +++ b/packages/nx/src/executors/utils/convert-nx-executor.ts @@ -1,5 +1,5 @@ /** - * This is a copy of the @nrwl/devkit utility but this should not be used outside of the nx package + * This is a copy of the @nx/devkit utility but this should not be used outside of the nx package */ import type { Observable } from 'rxjs'; diff --git a/packages/nx/src/hasher/hasher.spec.ts b/packages/nx/src/hasher/hasher.spec.ts index a23fa9b60f769..21dd6ccbdf50c 100644 --- a/packages/nx/src/hasher/hasher.spec.ts +++ b/packages/nx/src/hasher/hasher.spec.ts @@ -27,8 +27,8 @@ describe('Hasher', () => { const tsConfigBaseJson = JSON.stringify({ compilerOptions: { paths: { - '@nrwl/parent': ['libs/parent/src/index.ts'], - '@nrwl/child': ['libs/child/src/index.ts'], + '@nx/parent': ['libs/parent/src/index.ts'], + '@nx/child': ['libs/child/src/index.ts'], }, }, }); @@ -123,7 +123,7 @@ describe('Hasher', () => { expect(hash.details.command).toEqual('parent|build||{"prop":"prop-value"}'); expect(hash.details.nodes).toEqual({ 'parent:{projectRoot}/**/*': - '/file|file.hash|{"root":"libs/parent","targets":{"build":{"executor":"unknown","inputs":["default","^default",{"runtime":"echo runtime123"},{"env":"TESTENV"},{"env":"NONEXISTENTENV"}]}}}|{"compilerOptions":{"paths":{"@nrwl/parent":["libs/parent/src/index.ts"],"@nrwl/child":["libs/child/src/index.ts"]}}}', + '/file|file.hash|{"root":"libs/parent","targets":{"build":{"executor":"unknown","inputs":["default","^default",{"runtime":"echo runtime123"},{"env":"TESTENV"},{"env":"NONEXISTENTENV"}]}}}|{"compilerOptions":{"paths":{"@nx/parent":["libs/parent/src/index.ts"],"@nx/child":["libs/child/src/index.ts"]}}}', parent: 'unknown', '{workspaceRoot}/nx.json': 'nx.json.hash', '{workspaceRoot}/.gitignore': '', @@ -444,7 +444,7 @@ describe('Hasher', () => { data: { root: 'libs/parent', targets: { - build: { executor: '@nrwl/workspace:run-commands' }, + build: { executor: '@nx/workspace:run-commands' }, }, files: [ { file: 'libs/parent/filea.ts', hash: 'a.hash' }, @@ -457,7 +457,7 @@ describe('Hasher', () => { type: 'lib', data: { root: 'libs/child', - targets: { build: { executor: '@nrwl/workspace:run-commands' } }, + targets: { build: { executor: '@nx/workspace:run-commands' } }, files: [ { file: 'libs/child/fileb.ts', hash: 'b.hash' }, { file: 'libs/child/fileb.spec.ts', hash: 'b.spec.hash' }, @@ -511,7 +511,7 @@ describe('Hasher', () => { type: 'lib', data: { root: 'libs/parent', - targets: { build: { executor: '@nrwl/workspace:run-commands' } }, + targets: { build: { executor: '@nx/workspace:run-commands' } }, files: [{ file: '/file', hash: 'file.hash' }], }, }, @@ -560,7 +560,7 @@ describe('Hasher', () => { type: 'lib', data: { root: 'libs/parent', - targets: { build: { executor: '@nrwl/workspace:run-commands' } }, + targets: { build: { executor: '@nx/workspace:run-commands' } }, files: [{ file: '/filea.ts', hash: 'a.hash' }], }, }, @@ -569,7 +569,7 @@ describe('Hasher', () => { type: 'lib', data: { root: 'libs/child', - targets: { build: { executor: '@nrwl/workspace:run-commands' } }, + targets: { build: { executor: '@nx/workspace:run-commands' } }, files: [{ file: '/fileb.ts', hash: 'b.hash' }], }, }, @@ -641,7 +641,7 @@ describe('Hasher', () => { type: 'lib', data: { root: 'libs/parent', - targets: { build: { executor: '@nrwl/workspace:run-commands' } }, + targets: { build: { executor: '@nx/workspace:run-commands' } }, files: [{ file: '/file', hash: 'some-hash' }], }, }, @@ -683,7 +683,7 @@ describe('Hasher', () => { type: 'app', data: { root: 'apps/app', - targets: { build: { executor: '@nrwl/workspace:run-commands' } }, + targets: { build: { executor: '@nx/workspace:run-commands' } }, files: [{ file: '/filea.ts', hash: 'a.hash' }], }, }, @@ -732,7 +732,7 @@ describe('Hasher', () => { type: 'app', data: { root: 'apps/app', - targets: { build: { executor: '@nrwl/workspace:run-commands' } }, + targets: { build: { executor: '@nx/workspace:run-commands' } }, files: [{ file: '/filea.ts', hash: 'a.hash' }], }, }, diff --git a/packages/nx/src/hasher/hasher.ts b/packages/nx/src/hasher/hasher.ts index 1b33607f7e5f1..7611e408a49fa 100644 --- a/packages/nx/src/hasher/hasher.ts +++ b/packages/nx/src/hasher/hasher.ts @@ -369,8 +369,8 @@ class TaskHasher { // if it's "run commands" we skip traversing since we have no info what this command depends on // for everything else we take the hash of the @nrwl package dependency tree if ( - target.executor.startsWith(`@nrwl/`) && - target.executor !== `@nrwl/workspace:run-commands` + target.executor.startsWith(`@nrwl/`) || + target.executor.startsWith(`@nx/`) ) { const executorPackage = target.executor.split(':')[0]; const executorNode = `npm:${executorPackage}`; diff --git a/packages/nx/src/migrations/update-15-0-0/migrate-to-inputs.ts b/packages/nx/src/migrations/update-15-0-0/migrate-to-inputs.ts index 9942050b6d5f2..bbd9f4205578d 100644 --- a/packages/nx/src/migrations/update-15-0-0/migrate-to-inputs.ts +++ b/packages/nx/src/migrations/update-15-0-0/migrate-to-inputs.ts @@ -13,10 +13,10 @@ import { PackageJson } from '../../utils/package-json'; const skippedFiles = [ 'package.json', // Not to be added to filesets 'babel.config.json', // Will be handled by various plugins - 'karma.conf.js', // Will be handled by @nrwl/angular - 'jest.preset.js', // Will be handled by @nrwl/jest - '.storybook', // Will be handled by @nrwl/storybook - // Will be handled by @nrwl/linter + 'karma.conf.js', // Will be handled by @nx/angular + 'jest.preset.js', // Will be handled by @nx/jest + '.storybook', // Will be handled by @nx/storybook + // Will be handled by @nx/linter '.eslintrc.json', '.eslintrc.js', ]; diff --git a/packages/nx/src/nx-init/add-nx-to-nest.ts b/packages/nx/src/nx-init/add-nx-to-nest.ts index 04b9e735c059c..3a871b6e4afdf 100644 --- a/packages/nx/src/nx-init/add-nx-to-nest.ts +++ b/packages/nx/src/nx-init/add-nx-to-nest.ts @@ -149,8 +149,8 @@ export async function addNxToNest(packageJson: PackageJson) { function addNestPluginToPackageJson(repoRoot: string) { const path = join(repoRoot, `package.json`); const json: PackageJson = readJsonFile(path); - json.devDependencies['@nrwl/nest'] = require('../../package.json').version; - json.devDependencies['@nrwl/jest'] = require('../../package.json').version; + json.devDependencies['@nx/nest'] = require('../../package.json').version; + json.devDependencies['@nx/jest'] = require('../../package.json').version; writeJsonFile(path, json); } @@ -173,7 +173,7 @@ function createProjectJson( if (nestCLIOptions.language !== 'js') { json.targets['serve'] = { - executor: '@nrwl/js:node', + executor: '@nx/js:node', options: { buildTarget: `${packageName}:build`, }, @@ -183,7 +183,7 @@ function createProjectJson( if (nestCLIOptions.webpackOptions) { json.targets['build'] = { - executor: '@nrwl/webpack:webpack', + executor: '@nx/webpack:webpack', outputs: ['{options.outputPath}'], options: { target: 'node', @@ -210,7 +210,7 @@ function createProjectJson( }; } else { json.targets['build'] = { - executor: '@nrwl/js:tsc', + executor: '@nx/js:tsc', outputs: ['{options.outputPath}'], options: { outputPath: `dist/${packageName}`, @@ -233,7 +233,7 @@ function createProjectJson( // lint json.targets['lint'] = { - executor: '@nrwl/linter:eslint', + executor: '@nx/linter:eslint', outputs: ['{options.outputFile}'], options: { lintFilePatterns: ['src/**/*.ts', 'test/**/*.ts'], @@ -337,7 +337,7 @@ function addJestTargets( ); projectJson.targets['test'] = { - executor: '@nrwl/jest:jest', + executor: '@nx/jest:jest', outputs: [`{workspaceRoot}/coverage/${packageName}`], options: { passWithNoTests: true, @@ -346,7 +346,7 @@ function addJestTargets( }; projectJson.targets['e2e'] = { - executor: '@nrwl/jest:jest', + executor: '@nx/jest:jest', options: { passWithNoTests: true, jestConfig: e2eTestConfigPath, @@ -363,7 +363,7 @@ function addNrwlJsPluginsConfig(repoRoot: string) { if (!json.pluginsConfig) { json.pluginsConfig = { - '@nrwl/js': { + '@nx/js': { analyzeSourceFiles: true, } as NrwlJsPluginConfig, }; diff --git a/packages/nx/src/nx-init/angular/index.ts b/packages/nx/src/nx-init/angular/index.ts index c143bd5222c3a..bd6c87867e7fa 100644 --- a/packages/nx/src/nx-init/angular/index.ts +++ b/packages/nx/src/nx-init/angular/index.ts @@ -127,8 +127,8 @@ function addPluginDependencies(): void { const nxVersion = require('../../../package.json').version; packageJson.devDependencies ??= {}; - packageJson.devDependencies['@nrwl/angular'] = nxVersion; - packageJson.devDependencies['@nrwl/workspace'] = nxVersion; + packageJson.devDependencies['@nx/angular'] = nxVersion; + packageJson.devDependencies['@nx/workspace'] = nxVersion; const peerDepsToInstall = [ '@angular-devkit/core', diff --git a/packages/nx/src/nx-init/angular/integrated-workspace.ts b/packages/nx/src/nx-init/angular/integrated-workspace.ts index 71d17706a32e6..792c13ba184a7 100644 --- a/packages/nx/src/nx-init/angular/integrated-workspace.ts +++ b/packages/nx/src/nx-init/angular/integrated-workspace.ts @@ -3,5 +3,5 @@ import { getPackageManagerCommand } from '../../utils/package-manager'; export function setupIntegratedWorkspace(): void { const pmc = getPackageManagerCommand(); - execSync(`${pmc.exec} ng g @nrwl/angular:ng-add`, { stdio: [0, 1, 2] }); + execSync(`${pmc.exec} ng g @nx/angular:ng-add`, { stdio: [0, 1, 2] }); } diff --git a/packages/nx/src/nx-init/react/setup-e2e-project.ts b/packages/nx/src/nx-init/react/setup-e2e-project.ts index 95acd28d64bfe..50cda33c84199 100644 --- a/packages/nx/src/nx-init/react/setup-e2e-project.ts +++ b/packages/nx/src/nx-init/react/setup-e2e-project.ts @@ -10,7 +10,7 @@ export function setupE2eProject(appName: string) { }, }; json.targets['e2e-run'] = { - executor: '@nrwl/cypress:cypress', + executor: '@nx/cypress:cypress', options: { cypressConfig: `apps/${appName}-e2e/cypress.json`, tsConfig: `apps/${appName}-e2e/tsconfig.e2e.json`, diff --git a/packages/nx/src/nx-init/react/tsconfig-setup.ts b/packages/nx/src/nx-init/react/tsconfig-setup.ts index 3c2a8ab4cb409..1dff06eff0dd0 100644 --- a/packages/nx/src/nx-init/react/tsconfig-setup.ts +++ b/packages/nx/src/nx-init/react/tsconfig-setup.ts @@ -30,8 +30,8 @@ const defaultTsConfigApp = (relativePathToRoot: string) => ({ types: ['node'], }, files: [ - join(relativePathToRoot, 'node_modules/@nrwl/react/typings/cssmodule.d.ts'), - join(relativePathToRoot, 'node_modules/@nrwl/react/typings/image.d.ts'), + join(relativePathToRoot, 'node_modules/@nx/react/typings/cssmodule.d.ts'), + join(relativePathToRoot, 'node_modules/@nx/react/typings/image.d.ts'), ], exclude: ['**/*.spec.ts', '**/*.spec.tsx'], include: ['**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx'], @@ -52,8 +52,8 @@ const defaultTsConfigSpec = (relativePathToRoot: string) => ({ '**/*.d.ts', ], files: [ - join(relativePathToRoot, 'node_modules/@nrwl/react/typings/cssmodule.d.ts'), - join(relativePathToRoot, 'node_modules/@nrwl/react/typings/image.d.ts'), + join(relativePathToRoot, 'node_modules/@nx/react/typings/cssmodule.d.ts'), + join(relativePathToRoot, 'node_modules/@nx/react/typings/image.d.ts'), ], }); diff --git a/packages/nx/src/nx-init/react/write-craco-config.ts b/packages/nx/src/nx-init/react/write-craco-config.ts index 8953c8282f572..cf6194ad36e51 100644 --- a/packages/nx/src/nx-init/react/write-craco-config.ts +++ b/packages/nx/src/nx-init/react/write-craco-config.ts @@ -55,7 +55,7 @@ export function writeCracoConfig( }, jest: { configure: (config) => { - config.resolver = '@nrwl/jest/plugins/resolver'; + config.resolver = '@nx/jest/plugins/resolver'; return config; }, }, diff --git a/packages/nx/src/plugins/js/index.ts b/packages/nx/src/plugins/js/index.ts index deb4a55aeab02..0dfd80f66bef1 100644 --- a/packages/nx/src/plugins/js/index.ts +++ b/packages/nx/src/plugins/js/index.ts @@ -59,6 +59,10 @@ function writeLastProcessedLockfileHash(hash: string) { } function jsPluginConfig(nxJson: NxJsonConfiguration): NrwlJsPluginConfig { + if (nxJson?.pluginsConfig?.['@nx/js']) { + return nxJson?.pluginsConfig?.['@nx/js']; + } + if (nxJson?.pluginsConfig?.['@nrwl/js']) { return nxJson?.pluginsConfig?.['@nrwl/js']; } @@ -79,6 +83,13 @@ function jsPluginConfig(nxJson: NxJsonConfiguration): NrwlJsPluginConfig { ...packageJson.devDependencies, }; if ( + packageJsonDeps['@nx/workspace'] || + packageJsonDeps['@nx/js'] || + packageJsonDeps['@nx/node'] || + packageJsonDeps['@nx/next'] || + packageJsonDeps['@nx/react'] || + packageJsonDeps['@nx/angular'] || + packageJsonDeps['@nx/web'] || packageJsonDeps['@nrwl/workspace'] || packageJsonDeps['@nrwl/js'] || packageJsonDeps['@nrwl/node'] || diff --git a/packages/nx/src/project-graph/build-project-graph.spec.ts b/packages/nx/src/project-graph/build-project-graph.spec.ts index 1d83923030b52..72985f0dc8b8f 100644 --- a/packages/nx/src/project-graph/build-project-graph.spec.ts +++ b/packages/nx/src/project-graph/build-project-graph.spec.ts @@ -17,27 +17,27 @@ describe('project graph', () => { beforeEach(async () => { packageJson = { - name: '@nrwl/workspace-src', + name: '@nx/workspace-src', version: '0.0.0', dependencies: { express: '4.0.0', 'happy-nrwl': '1.0.0', }, devDependencies: { - '@nrwl/workspace': '*', + '@nx/workspace': '*', }, }; packageLockJson = { - name: '@nrwl/workspace-src', + name: '@nx/workspace-src', version: '0.0.0', lockfileVersion: 2, requires: true, packages: { '': packageJson, - 'node_modules/@nrwl/workspace': { + 'node_modules/@nx/workspace': { version: '15.0.0', resolved: - 'https://registry.npmjs.org/@nrwl/workspace/-/@nrwl/workspace-15.0.0.tgz', + 'https://registry.npmjs.org/@nx/workspace/-/@nx/workspace-15.0.0.tgz', integrity: 'sha512-12345678==', dev: true, }, @@ -57,10 +57,10 @@ describe('project graph', () => { }, }, dependencies: { - '@nrwl/workspace': { + '@nx/workspace': { version: '15.0.0', resolved: - 'https://registry.npmjs.org/@nrwl/workspace/-/@nrwl/workspace-15.0.0.tgz', + 'https://registry.npmjs.org/@nx/workspace/-/@nx/workspace-15.0.0.tgz', integrity: 'sha512-12345678==', dev: true, }, @@ -136,10 +136,10 @@ describe('project graph', () => { compilerOptions: { baseUrl: '.', paths: { - '@nrwl/shared/util': ['libs/shared/util/src/index.ts'], - '@nrwl/shared-util-data': ['libs/shared/util/data/src/index.ts'], - '@nrwl/ui': ['libs/ui/src/index.ts'], - '@nrwl/lazy-lib': ['libs/lazy-lib/src/index.ts'], + '@nx/shared/util': ['libs/shared/util/src/index.ts'], + '@nx/shared-util-data': ['libs/shared/util/data/src/index.ts'], + '@nx/ui': ['libs/ui/src/index.ts'], + '@nx/lazy-lib': ['libs/lazy-lib/src/index.ts'], }, }, }; @@ -149,16 +149,16 @@ describe('project graph', () => { require('express'); `, './apps/demo/src/index.ts': stripIndents` - import * as ui from '@nrwl/ui'; - import * as data from '@nrwl/shared-util-data; - const s = { loadChildren: '@nrwl/lazy-lib#LAZY' } + import * as ui from '@nx/ui'; + import * as data from '@nx/shared-util-data; + const s = { loadChildren: '@nx/lazy-lib#LAZY' } `, './apps/demo-e2e/src/integration/app.spec.ts': stripIndents` describe('whatever', () => {}); `, './libs/ui/src/index.ts': stripIndents` - import * as util from '@nrwl/shared/util'; - import('@nrwl/lazy-lib'); + import * as util from '@nx/shared/util'; + import('@nx/lazy-lib'); `, './libs/shared/util/src/index.ts': stripIndents` import * as happyNrwl from 'happy-nrwl/a/b/c'; @@ -265,7 +265,7 @@ describe('project graph', () => { it('should handle circular dependencies', async () => { tempFs.writeFile( 'libs/shared/util/src/index.ts', - `import * as ui from '@nrwl/ui';` + `import * as ui from '@nx/ui';` ); const graph = await buildProjectGraph(); diff --git a/packages/nx/src/project-graph/nx-deps-cache.spec.ts b/packages/nx/src/project-graph/nx-deps-cache.spec.ts index 94b48d69fe481..99ec136ba1de6 100644 --- a/packages/nx/src/project-graph/nx-deps-cache.spec.ts +++ b/packages/nx/src/project-graph/nx-deps-cache.spec.ts @@ -39,7 +39,7 @@ describe('nx deps utils', () => { shouldRecomputeWholeGraph( createCache({ deps: { - '@nrwl/workspace': '12.0.1', + '@nx/workspace': '12.0.1', plugin: '1.0.0', }, }), @@ -318,7 +318,7 @@ describe('nx deps utils', () => { const defaults: ProjectGraphCache = { version: '5.1', deps: { - '@nrwl/workspace': '12.0.0', + '@nx/workspace': '12.0.0', plugin: '1.0.0', }, pathMappings: { @@ -337,7 +337,7 @@ describe('nx deps utils', () => { p: Record ): Record { const defaults = { - '@nrwl/workspace': '12.0.0', + '@nx/workspace': '12.0.0', plugin: '1.0.0', }; return { ...defaults, ...p }; diff --git a/packages/nx/src/project-graph/nx-deps-cache.ts b/packages/nx/src/project-graph/nx-deps-cache.ts index 10a5101d9c20d..cdb1f9631e165 100644 --- a/packages/nx/src/project-graph/nx-deps-cache.ts +++ b/packages/nx/src/project-graph/nx-deps-cache.ts @@ -149,7 +149,10 @@ export function shouldRecomputeWholeGraph( if (cache.version !== '5.1') { return true; } - if (cache.deps['@nrwl/workspace'] !== packageJsonDeps['@nrwl/workspace']) { + if ( + cache.deps['@nx/workspace'] !== packageJsonDeps['@nx/workspace'] || + cache.deps['@nrwl/workspace'] !== packageJsonDeps['@nrwl/workspace'] + ) { return true; } if (cache.deps['nx'] !== packageJsonDeps['nx']) { diff --git a/packages/nx/src/utils/fileutils.spec.ts b/packages/nx/src/utils/fileutils.spec.ts index d3acf32602a6a..e4707e961de72 100644 --- a/packages/nx/src/utils/fileutils.spec.ts +++ b/packages/nx/src/utils/fileutils.spec.ts @@ -24,7 +24,7 @@ describe('fileutils', () => { }); it('should return false for absolute imports', () => { expect(isRelativePath('file')).toEqual(false); - expect(isRelativePath('@nrwl/angular')).toEqual(false); + expect(isRelativePath('@nx/angular')).toEqual(false); }); }); }); diff --git a/packages/nx/src/utils/nx-plugin.ts b/packages/nx/src/utils/nx-plugin.ts index 883e49f9328d4..bdcbf67011d42 100644 --- a/packages/nx/src/utils/nx-plugin.ts +++ b/packages/nx/src/utils/nx-plugin.ts @@ -349,9 +349,14 @@ function readPluginMainFromProjectConfiguration( ): string | null { const { main } = Object.values(plugin.targets).find((x) => - ['@nrwl/js:tsc', '@nrwl/js:swc', '@nrwl/node:package'].includes( - x.executor - ) + [ + '@nx/js:tsc', + '@nrwl/js:tsc', + '@nx/js:swc', + '@nrwl/js:swc', + '@nx/node:package', + '@nrwl/node:package', + ].includes(x.executor) )?.options || plugin.targets?.build?.options || {}; diff --git a/packages/nx/src/utils/params.spec.ts b/packages/nx/src/utils/params.spec.ts index b9528605264c6..bd3abfbfcd7f3 100644 --- a/packages/nx/src/utils/params.spec.ts +++ b/packages/nx/src/utils/params.spec.ts @@ -32,7 +32,7 @@ describe('params', () => { it('should use target options', () => { const commandLineOpts = {}; const target: TargetConfiguration = { - executor: '@nrwl/do:stuff', + executor: '@nx/do:stuff', options: { overriddenOpt: 'target value', }, @@ -58,7 +58,7 @@ describe('params', () => { it('should combine target, configuration', () => { const commandLineOpts = {}; const target: TargetConfiguration = { - executor: '@nrwl/do:stuff', + executor: '@nx/do:stuff', options: { overriddenOpt: 'target value', }, @@ -88,7 +88,7 @@ describe('params', () => { overriddenOpt: 'command value', }; const target: TargetConfiguration = { - executor: '@nrwl/do:stuff', + executor: '@nx/do:stuff', options: { overriddenOpt: 'target value', }, @@ -118,7 +118,7 @@ describe('params', () => { overriddenOpt: 'command value', }; const target: TargetConfiguration = { - executor: '@nrwl/do:stuff', + executor: '@nx/do:stuff', options: { overriddenOptAlias: 'target value', }, @@ -148,7 +148,7 @@ describe('params', () => { overriddenOptAlias: 'command value', }; const target: TargetConfiguration = { - executor: '@nrwl/do:stuff', + executor: '@nx/do:stuff', options: { overriddenOpt: 'target value', }, @@ -176,7 +176,7 @@ describe('params', () => { it('should handle targets without options', () => { const commandLineOpts = {}; const target: TargetConfiguration = { - executor: '@nrwl/do:stuff', + executor: '@nx/do:stuff', }; const options = combineOptionsForExecutor( diff --git a/packages/nx/src/utils/print-help.spec.ts b/packages/nx/src/utils/print-help.spec.ts index 2feee4e94d291..f85ca0d7e662e 100644 --- a/packages/nx/src/utils/print-help.spec.ts +++ b/packages/nx/src/utils/print-help.spec.ts @@ -36,9 +36,9 @@ describe('printHelp', () => { let output = ''; jest.spyOn(logger, 'info').mockImplementation((x) => (output = x)); - printHelp('nx g @nrwl/demo:example', schema, { + printHelp('nx g @nx/demo:example', schema, { mode: 'generate', - plugin: '@nrwl/demo', + plugin: '@nx/demo', entity: 'example', aliases: ['ex'], }); diff --git a/packages/nx/src/utils/print-help.ts b/packages/nx/src/utils/print-help.ts index bff800fdb75a1..27100904bb022 100644 --- a/packages/nx/src/utils/print-help.ts +++ b/packages/nx/src/utils/print-help.ts @@ -107,7 +107,7 @@ function generateGeneratorOverviewOutput({ { text: pluginName + - (pluginName.startsWith('@nrwl/') + (pluginName.startsWith('@nx/') || pluginName.startsWith('@nrwl/') ? chalk.dim(` (v${nxVersion})`) : ''), padding: [1, 0, 0, 2], @@ -327,13 +327,19 @@ function generateLinkOutput({ name: string; type: 'generators' | 'executors'; }): string { + const nxPackagePrefix = '@nx/'; const nrwlPackagePrefix = '@nrwl/'; - if (!pluginName.startsWith(nrwlPackagePrefix)) { + if ( + !pluginName.startsWith(nxPackagePrefix) && + !pluginName.startsWith(nrwlPackagePrefix) + ) { return ''; } const link = `https://nx.dev/packages/${pluginName.substring( - nrwlPackagePrefix.length + pluginName.startsWith(nxPackagePrefix) + ? nxPackagePrefix.length + : nrwlPackagePrefix.length )}/${type}/${name}`; return `\n\n${chalk.dim( diff --git a/packages/nx/src/utils/workspace-configuration-check.ts b/packages/nx/src/utils/workspace-configuration-check.ts index 75e2faa2c557f..8899ea8de0fad 100644 --- a/packages/nx/src/utils/workspace-configuration-check.ts +++ b/packages/nx/src/utils/workspace-configuration-check.ts @@ -11,7 +11,7 @@ export function workspaceConfigurationCheck() { title: 'workspace.json is ignored', bodyLines: [ 'Nx no longer reads configuration from workspace.json.', - 'Run "nx g @nrwl/workspace:fix-configuration" to split workspace.json into individual project.json files.', + 'Run "nx g @nx/workspace:fix-configuration" to split workspace.json into individual project.json files.', ], }); return; @@ -27,8 +27,8 @@ export function workspaceConfigurationCheck() { title: 'angular.json format is incorrect', bodyLines: [ 'Nx no longer supports the v2 format of angular.json.', - 'Run "nx g @nrwl/workspace:fix-configuration" to split angular.json into individual project.json files. (Recommended)', - 'If you want to preserve angular.json, run "nx g @nrwl/workspace:fix-configuration --reformat"', + 'Run "nx g @nx/workspace:fix-configuration" to split angular.json into individual project.json files. (Recommended)', + 'If you want to preserve angular.json, run "nx g @nx/workspace:fix-configuration --reformat"', ], }); process.exit(1); diff --git a/packages/nx/src/utils/workspace-root.ts b/packages/nx/src/utils/workspace-root.ts index 0ad6091765250..64c62d7d23631 100644 --- a/packages/nx/src/utils/workspace-root.ts +++ b/packages/nx/src/utils/workspace-root.ts @@ -25,7 +25,7 @@ export function workspaceRootInner( // This handles the case where we have a workspace which uses npm / yarn / pnpm // workspaces, and has a project which contains Nx in its dependency tree. - // e.g. packages/my-lib/package.json contains @nrwl/devkit, which references Nx and is + // e.g. packages/my-lib/package.json contains @nx/devkit, which references Nx and is // thus located in //packages/my-lib/node_modules/nx/package.json } else if (fileExists(path.join(dir, 'node_modules', 'nx', 'package.json'))) { return workspaceRootInner(path.dirname(dir), dir); diff --git a/packages/tao/.eslintrc.json b/packages/tao/.eslintrc.json index ff47ddace4d51..a40930e8b428f 100644 --- a/packages/tao/.eslintrc.json +++ b/packages/tao/.eslintrc.json @@ -3,7 +3,7 @@ "rules": { "no-restricted-imports": [ "error", - "@nrwl/workspace", + "@nx/workspace", "@angular-devkit/core", "@angular-devkit/architect", "@angular-devkit/schematics" diff --git a/packages/workspace/.eslintrc.json b/packages/workspace/.eslintrc.json index 29c949912ce49..7d791d6f9975b 100644 --- a/packages/workspace/.eslintrc.json +++ b/packages/workspace/.eslintrc.json @@ -12,7 +12,7 @@ "rules": { "no-restricted-imports": [ "error", - "@nrwl/workspace", + "@nx/workspace", "@angular-devkit/core", "@angular-devkit/architect", "@angular-devkit/schematics" diff --git a/packages/workspace/src/generators/move/lib/create-project-configuration-in-new-destination.spec.ts b/packages/workspace/src/generators/move/lib/create-project-configuration-in-new-destination.spec.ts index 1ebc1f1bf1160..43e1688a82d92 100644 --- a/packages/workspace/src/generators/move/lib/create-project-configuration-in-new-destination.spec.ts +++ b/packages/workspace/src/generators/move/lib/create-project-configuration-in-new-destination.spec.ts @@ -109,7 +109,7 @@ describe('moveProjectConfiguration', () => { }, }, test: { - executor: '@nrwl/jest:jest', + executor: '@nx/jest:jest', options: { jestConfig: 'apps/my-source/jest.config.js', tsConfig: 'apps/my-source/tsconfig.spec.json', @@ -127,7 +127,7 @@ describe('moveProjectConfiguration', () => { projectType: 'application', targets: { e2e: { - executor: '@nrwl/cypress:cypress', + executor: '@nx/cypress:cypress', options: { cypressConfig: 'apps/my-source-e2e/cypress.json', tsConfig: 'apps/my-source-e2e/tsconfig.e2e.json', diff --git a/packages/workspace/src/generators/move/lib/update-build-targets.spec.ts b/packages/workspace/src/generators/move/lib/update-build-targets.spec.ts index f1f8197e706b3..e6a3d1d154861 100644 --- a/packages/workspace/src/generators/move/lib/update-build-targets.spec.ts +++ b/packages/workspace/src/generators/move/lib/update-build-targets.spec.ts @@ -27,7 +27,7 @@ describe('updateBuildTargets', () => { root: 'libs/my-source', targets: { storybook: { - executor: '@nrwl/storybook:storybook', + executor: '@nx/storybook:storybook', }, }, }); @@ -76,7 +76,7 @@ describe('updateBuildTargets', () => { expect(myProject).toBeDefined(); expect(myProject.targets.storybook.executor).toBe( - '@nrwl/storybook:storybook' + '@nx/storybook:storybook' ); expect(e2eProject).toBeDefined(); diff --git a/packages/workspace/src/generators/move/lib/update-cypress-config.spec.ts b/packages/workspace/src/generators/move/lib/update-cypress-config.spec.ts index 12d10e20eefba..5ac417fc5ffcd 100644 --- a/packages/workspace/src/generators/move/lib/update-cypress-config.spec.ts +++ b/packages/workspace/src/generators/move/lib/update-cypress-config.spec.ts @@ -85,7 +85,7 @@ describe('updateCypressConfig', () => { '/libs/my-destination/cypress.config.ts', ` import { defineConfig } from 'cypress'; -import { nxE2EPreset } from '@nrwl/cypress/plugins/cypress-preset'; +import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset'; export default defineConfig({ e2e: { diff --git a/packages/workspace/src/generators/move/lib/update-eslintrc-json.spec.ts b/packages/workspace/src/generators/move/lib/update-eslintrc-json.spec.ts index 311b996e1a5e9..3922510d777db 100644 --- a/packages/workspace/src/generators/move/lib/update-eslintrc-json.spec.ts +++ b/packages/workspace/src/generators/move/lib/update-eslintrc-json.spec.ts @@ -100,7 +100,7 @@ describe('updateEslint', () => { }); updateJson(tree, 'libs/my-lib/.eslintrc.json', (eslintRcJson) => { eslintRcJson.extends = [ - 'plugin:@nrwl/nx/react', + 'plugin:@nx/nx/react', '../../.eslintrc.json', './customrc.json', ]; @@ -120,7 +120,7 @@ describe('updateEslint', () => { ).toEqual( expect.objectContaining({ extends: [ - 'plugin:@nrwl/nx/react', + 'plugin:@nx/nx/react', '../../../.eslintrc.json', './customrc.json', ], diff --git a/packages/workspace/src/generators/new/__snapshots__/generate-workspace-files.spec.ts.snap b/packages/workspace/src/generators/new/__snapshots__/generate-workspace-files.spec.ts.snap index 13859c65d7c60..b41c8cdda6ba7 100644 --- a/packages/workspace/src/generators/new/__snapshots__/generate-workspace-files.spec.ts.snap +++ b/packages/workspace/src/generators/new/__snapshots__/generate-workspace-files.spec.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`@nrwl/workspace:generateWorkspaceFiles README.md should be created for AngularMonorepo preset 1`] = ` +exports[`@nx/workspace:generateWorkspaceFiles README.md should be created for AngularMonorepo preset 1`] = ` "# Proj @@ -25,7 +25,7 @@ Visit the [Nx Documentation](https://nx.dev) to learn more. " `; -exports[`@nrwl/workspace:generateWorkspaceFiles README.md should be created for AngularStandalone preset 1`] = ` +exports[`@nx/workspace:generateWorkspaceFiles README.md should be created for AngularStandalone preset 1`] = ` "# Proj @@ -50,7 +50,7 @@ Visit the [Nx Documentation](https://nx.dev) to learn more. " `; -exports[`@nrwl/workspace:generateWorkspaceFiles README.md should be created for Apps preset 1`] = ` +exports[`@nx/workspace:generateWorkspaceFiles README.md should be created for Apps preset 1`] = ` "# Proj @@ -71,7 +71,7 @@ Visit the [Nx Documentation](https://nx.dev) to learn more. " `; -exports[`@nrwl/workspace:generateWorkspaceFiles README.md should be created for Core preset 1`] = ` +exports[`@nx/workspace:generateWorkspaceFiles README.md should be created for Core preset 1`] = ` "# Proj @@ -92,7 +92,7 @@ Visit the [Nx Documentation](https://nx.dev) to learn more. " `; -exports[`@nrwl/workspace:generateWorkspaceFiles README.md should be created for Empty preset 1`] = ` +exports[`@nx/workspace:generateWorkspaceFiles README.md should be created for Empty preset 1`] = ` "# Proj @@ -113,7 +113,7 @@ Visit the [Nx Documentation](https://nx.dev) to learn more. " `; -exports[`@nrwl/workspace:generateWorkspaceFiles README.md should be created for Expo preset 1`] = ` +exports[`@nx/workspace:generateWorkspaceFiles README.md should be created for Expo preset 1`] = ` "# Proj @@ -134,7 +134,7 @@ Visit the [Nx Documentation](https://nx.dev) to learn more. " `; -exports[`@nrwl/workspace:generateWorkspaceFiles README.md should be created for Express preset 1`] = ` +exports[`@nx/workspace:generateWorkspaceFiles README.md should be created for Express preset 1`] = ` "# Proj @@ -159,7 +159,7 @@ Visit the [Nx Documentation](https://nx.dev) to learn more. " `; -exports[`@nrwl/workspace:generateWorkspaceFiles README.md should be created for NPM preset 1`] = ` +exports[`@nx/workspace:generateWorkspaceFiles README.md should be created for NPM preset 1`] = ` "# Proj @@ -180,7 +180,7 @@ Visit the [Nx Documentation](https://nx.dev) to learn more. " `; -exports[`@nrwl/workspace:generateWorkspaceFiles README.md should be created for Nest preset 1`] = ` +exports[`@nx/workspace:generateWorkspaceFiles README.md should be created for Nest preset 1`] = ` "# Proj @@ -205,7 +205,7 @@ Visit the [Nx Documentation](https://nx.dev) to learn more. " `; -exports[`@nrwl/workspace:generateWorkspaceFiles README.md should be created for NextJs preset 1`] = ` +exports[`@nx/workspace:generateWorkspaceFiles README.md should be created for NextJs preset 1`] = ` "# Proj @@ -230,7 +230,7 @@ Visit the [Nx Documentation](https://nx.dev) to learn more. " `; -exports[`@nrwl/workspace:generateWorkspaceFiles README.md should be created for NodeStandalone preset 1`] = ` +exports[`@nx/workspace:generateWorkspaceFiles README.md should be created for NodeStandalone preset 1`] = ` "# Proj @@ -255,7 +255,7 @@ Visit the [Nx Documentation](https://nx.dev) to learn more. " `; -exports[`@nrwl/workspace:generateWorkspaceFiles README.md should be created for ReactMonorepo preset 1`] = ` +exports[`@nx/workspace:generateWorkspaceFiles README.md should be created for ReactMonorepo preset 1`] = ` "# Proj @@ -280,7 +280,7 @@ Visit the [Nx Documentation](https://nx.dev) to learn more. " `; -exports[`@nrwl/workspace:generateWorkspaceFiles README.md should be created for ReactNative preset 1`] = ` +exports[`@nx/workspace:generateWorkspaceFiles README.md should be created for ReactNative preset 1`] = ` "# Proj @@ -301,7 +301,7 @@ Visit the [Nx Documentation](https://nx.dev) to learn more. " `; -exports[`@nrwl/workspace:generateWorkspaceFiles README.md should be created for ReactStandalone preset 1`] = ` +exports[`@nx/workspace:generateWorkspaceFiles README.md should be created for ReactStandalone preset 1`] = ` "# Proj @@ -326,7 +326,7 @@ Visit the [Nx Documentation](https://nx.dev) to learn more. " `; -exports[`@nrwl/workspace:generateWorkspaceFiles README.md should be created for TS preset 1`] = ` +exports[`@nx/workspace:generateWorkspaceFiles README.md should be created for TS preset 1`] = ` "# Proj @@ -347,7 +347,7 @@ Visit the [Nx Documentation](https://nx.dev) to learn more. " `; -exports[`@nrwl/workspace:generateWorkspaceFiles README.md should be created for WebComponents preset 1`] = ` +exports[`@nx/workspace:generateWorkspaceFiles README.md should be created for WebComponents preset 1`] = ` "# Proj @@ -372,7 +372,7 @@ Visit the [Nx Documentation](https://nx.dev) to learn more. " `; -exports[`@nrwl/workspace:generateWorkspaceFiles README.md should be created for custom plugins 1`] = ` +exports[`@nx/workspace:generateWorkspaceFiles README.md should be created for custom plugins 1`] = ` "# Proj @@ -393,14 +393,14 @@ Visit the [Nx Documentation](https://nx.dev) to learn more. " `; -exports[`@nrwl/workspace:generateWorkspaceFiles should recommend vscode extensions (angular) 1`] = ` +exports[`@nx/workspace:generateWorkspaceFiles should recommend vscode extensions (angular) 1`] = ` [ "nrwl.angular-console", "esbenp.prettier-vscode", ] `; -exports[`@nrwl/workspace:generateWorkspaceFiles should recommend vscode extensions 1`] = ` +exports[`@nx/workspace:generateWorkspaceFiles should recommend vscode extensions 1`] = ` [ "nrwl.angular-console", "esbenp.prettier-vscode", diff --git a/packages/workspace/src/generators/new/__snapshots__/new.spec.ts.snap b/packages/workspace/src/generators/new/__snapshots__/new.spec.ts.snap index 07609c3f586e3..013558dbb4a3b 100644 --- a/packages/workspace/src/generators/new/__snapshots__/new.spec.ts.snap +++ b/packages/workspace/src/generators/new/__snapshots__/new.spec.ts.snap @@ -4,7 +4,7 @@ exports[`new --preset should generate necessary npm dependencies for empty prese { "dependencies": {}, "devDependencies": { - "@nrwl/workspace": "0.0.1", + "@nx/workspace": "0.0.1", "nx": "0.0.1", }, "license": "MIT", diff --git a/packages/workspace/src/generators/new/files-integrated-repo/package.json__tmpl__ b/packages/workspace/src/generators/new/files-integrated-repo/package.json__tmpl__ index e1620d9df744e..b9ad488b5f2c6 100644 --- a/packages/workspace/src/generators/new/files-integrated-repo/package.json__tmpl__ +++ b/packages/workspace/src/generators/new/files-integrated-repo/package.json__tmpl__ @@ -9,6 +9,6 @@ }, "devDependencies": { "nx": "<%= nxVersion %>", - "@nrwl/workspace": "<%= nxVersion %>" + "@nx/workspace": "<%= nxVersion %>" } } diff --git a/packages/workspace/src/generators/new/files-root-app/package.json__tmpl__ b/packages/workspace/src/generators/new/files-root-app/package.json__tmpl__ index d1e1aee40ad8a..43ba92facc48f 100644 --- a/packages/workspace/src/generators/new/files-root-app/package.json__tmpl__ +++ b/packages/workspace/src/generators/new/files-root-app/package.json__tmpl__ @@ -8,7 +8,7 @@ "dependencies": { }, "devDependencies": { - "@nrwl/workspace": "<%= nxVersion %>", + "@nx/workspace": "<%= nxVersion %>", "nx": "<%= nxVersion %>" } } diff --git a/packages/workspace/src/generators/new/generate-preset.ts b/packages/workspace/src/generators/new/generate-preset.ts index e79133e6c5731..78e06135ff1ce 100644 --- a/packages/workspace/src/generators/new/generate-preset.ts +++ b/packages/workspace/src/generators/new/generate-preset.ts @@ -68,7 +68,7 @@ export function generatePreset(host: Tree, opts: NormalizedSchema) { function getDefaultArgs(opts: NormalizedSchema) { return [ `g`, - `@nrwl/workspace:preset`, + `@nx/workspace:preset`, `--name=${opts.appName}`, opts.style ? `--style=${opts.style}` : null, opts.linter ? `--linter=${opts.linter}` : null, @@ -94,12 +94,12 @@ function getPresetDependencies({ }: NormalizedSchema) { switch (preset) { case Preset.TS: - return { dependencies: {}, dev: { '@nrwl/js': nxVersion } }; + return { dependencies: {}, dev: { '@nx/js': nxVersion } }; case Preset.AngularMonorepo: case Preset.AngularStandalone: return { - dependencies: { '@nrwl/angular': nxVersion }, + dependencies: { '@nx/angular': nxVersion }, dev: { '@angular-devkit/core': angularCliVersion, typescript: typescriptVersion, @@ -107,44 +107,44 @@ function getPresetDependencies({ }; case Preset.Express: - return { dependencies: {}, dev: { '@nrwl/express': nxVersion } }; + return { dependencies: {}, dev: { '@nx/express': nxVersion } }; case Preset.Nest: return { dependencies: {}, - dev: { '@nrwl/nest': nxVersion, typescript: typescriptVersion }, + dev: { '@nx/nest': nxVersion, typescript: typescriptVersion }, }; case Preset.NextJs: - return { dependencies: { '@nrwl/next': nxVersion }, dev: {} }; + return { dependencies: { '@nx/next': nxVersion }, dev: {} }; case Preset.ReactMonorepo: case Preset.ReactStandalone: return { dependencies: {}, dev: { - '@nrwl/react': nxVersion, - '@nrwl/cypress': nxVersion, - '@nrwl/jest': bundler !== 'vite' ? nxVersion : undefined, - '@nrwl/vite': bundler === 'vite' ? nxVersion : undefined, - '@nrwl/webpack': bundler === 'webpack' ? nxVersion : undefined, + '@nx/react': nxVersion, + '@nx/cypress': nxVersion, + '@nx/jest': bundler !== 'vite' ? nxVersion : undefined, + '@nx/vite': bundler === 'vite' ? nxVersion : undefined, + '@nx/webpack': bundler === 'webpack' ? nxVersion : undefined, }, }; case Preset.ReactNative: - return { dependencies: {}, dev: { '@nrwl/react-native': nxVersion } }; + return { dependencies: {}, dev: { '@nx/react-native': nxVersion } }; case Preset.Expo: - return { dependencies: {}, dev: { '@nrwl/expo': nxVersion } }; + return { dependencies: {}, dev: { '@nx/expo': nxVersion } }; case Preset.WebComponents: return { dependencies: {}, - dev: { '@nrwl/web': nxVersion, typescript: typescriptVersion }, + dev: { '@nx/web': nxVersion, typescript: typescriptVersion }, }; case Preset.NodeStandalone: - return { dependencies: {}, dev: { '@nrwl/node': nxVersion } }; + return { dependencies: {}, dev: { '@nx/node': nxVersion } }; default: { return { diff --git a/packages/workspace/src/generators/new/generate-workspace-files.spec.ts b/packages/workspace/src/generators/new/generate-workspace-files.spec.ts index c56d1157d1abf..273d3df1acc6d 100644 --- a/packages/workspace/src/generators/new/generate-workspace-files.spec.ts +++ b/packages/workspace/src/generators/new/generate-workspace-files.spec.ts @@ -6,7 +6,7 @@ import { createTree } from '@nx/devkit/testing'; import { Preset } from '../utils/presets'; import * as nxSchema from '../../../../nx/schemas/nx-schema.json'; -describe('@nrwl/workspace:generateWorkspaceFiles', () => { +describe('@nx/workspace:generateWorkspaceFiles', () => { let tree: Tree; beforeEach(() => { diff --git a/packages/workspace/src/generators/new/new.spec.ts b/packages/workspace/src/generators/new/new.spec.ts index af8dbb3ca2e37..4ffe203d3a150 100644 --- a/packages/workspace/src/generators/new/new.spec.ts +++ b/packages/workspace/src/generators/new/new.spec.ts @@ -64,10 +64,10 @@ describe('new', () => { const { devDependencies } = readJson(tree, 'my-workspace/package.json'); expect(devDependencies).toStrictEqual({ - '@nrwl/react': nxVersion, - '@nrwl/cypress': nxVersion, - '@nrwl/vite': nxVersion, - '@nrwl/workspace': nxVersion, + '@nx/react': nxVersion, + '@nx/cypress': nxVersion, + '@nx/vite': nxVersion, + '@nx/workspace': nxVersion, nx: nxVersion, }); }); @@ -86,10 +86,10 @@ describe('new', () => { tree, 'my-workspace/package.json' ); - expect(dependencies).toStrictEqual({ '@nrwl/angular': nxVersion }); + expect(dependencies).toStrictEqual({ '@nx/angular': nxVersion }); expect(devDependencies).toStrictEqual({ '@angular-devkit/core': angularCliVersion, - '@nrwl/workspace': nxVersion, + '@nx/workspace': nxVersion, nx: nxVersion, typescript: typescriptVersion, }); diff --git a/packages/workspace/src/generators/npm-package/npm-package.spec.ts b/packages/workspace/src/generators/npm-package/npm-package.spec.ts index daf0ba0a58aba..c4e8d3aec6474 100644 --- a/packages/workspace/src/generators/npm-package/npm-package.spec.ts +++ b/packages/workspace/src/generators/npm-package/npm-package.spec.ts @@ -9,7 +9,7 @@ import { import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { npmPackageGenerator } from './npm-package'; -describe('@nrwl/workspace:npm-package', () => { +describe('@nx/workspace:npm-package', () => { let tree: Tree; beforeEach(() => { tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' }); diff --git a/packages/workspace/src/generators/preset/preset.spec.ts b/packages/workspace/src/generators/preset/preset.spec.ts index 12f26974f7b9e..a1dd868413054 100644 --- a/packages/workspace/src/generators/preset/preset.spec.ts +++ b/packages/workspace/src/generators/preset/preset.spec.ts @@ -11,26 +11,23 @@ describe('preset', () => { beforeEach(() => { tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' }); overrideCollectionResolutionForTesting({ - '@nrwl/workspace': path.join( + '@nx/workspace': path.join( __dirname, '../../../../workspace/generators.json' ), - '@nrwl/angular': path.join( + '@nx/angular': path.join( __dirname, '../../../../angular/generators.json' ), - '@nrwl/linter': path.join( - __dirname, - '../../../../linter/generators.json' - ), - '@nrwl/nest': path.join(__dirname, '../../../../nest/generators.json'), - '@nrwl/node': path.join(__dirname, '../../../../node/generators.json'), - '@nrwl/jest': path.join(__dirname, '../../../../jest/generators.json'), - '@nrwl/cypress': path.join( + '@nx/linter': path.join(__dirname, '../../../../linter/generators.json'), + '@nx/nest': path.join(__dirname, '../../../../nest/generators.json'), + '@nx/node': path.join(__dirname, '../../../../node/generators.json'), + '@nx/jest': path.join(__dirname, '../../../../jest/generators.json'), + '@nx/cypress': path.join( __dirname, '../../../../cypress/generators.json' ), - '@nrwl/express': path.join( + '@nx/express': path.join( __dirname, '../../../../express/generators.json' ), diff --git a/packages/workspace/src/generators/remove/lib/check-targets.spec.ts b/packages/workspace/src/generators/remove/lib/check-targets.spec.ts index 3379a5dd1396a..b2124a03f1a8e 100644 --- a/packages/workspace/src/generators/remove/lib/check-targets.spec.ts +++ b/packages/workspace/src/generators/remove/lib/check-targets.spec.ts @@ -38,7 +38,7 @@ describe('checkTargets', () => { options: {}, }, storybook: { - executor: '@nrwl/storybook:storybook', + executor: '@nx/storybook:storybook', options: {}, }, }, @@ -50,7 +50,7 @@ describe('checkTargets', () => { sourceRoot: 'apps/storybook/src', targets: { storybook: { - executor: '@nrwl/storybook:storybook', + executor: '@nx/storybook:storybook', }, }, }); @@ -61,7 +61,7 @@ describe('checkTargets', () => { projectType: 'application', targets: { e2e: { - executor: '@nrwl/cypress:cypress', + executor: '@nx/cypress:cypress', options: { cypressConfig: 'apps/ng-app-e2e/cypress.json', tsConfig: 'apps/ng-app-e2e/tsconfig.e2e.json', diff --git a/packages/workspace/src/generators/remove/lib/remove-project-references-in-config.spec.ts b/packages/workspace/src/generators/remove/lib/remove-project-references-in-config.spec.ts index 732758447b9c9..4f9fe19ed505d 100644 --- a/packages/workspace/src/generators/remove/lib/remove-project-references-in-config.spec.ts +++ b/packages/workspace/src/generators/remove/lib/remove-project-references-in-config.spec.ts @@ -35,7 +35,7 @@ describe('removeProjectReferencesInConfig', () => { projectType: 'application', targets: { e2e: { - executor: '@nrwl/cypress:cypress', + executor: '@nx/cypress:cypress', options: { cypressConfig: 'apps/ng-app-e2e/cypress.json', tsConfig: 'apps/ng-app-e2e/tsconfig.e2e.json', diff --git a/packages/workspace/src/generators/workspace-generator/files/index.ts__tmpl__ b/packages/workspace/src/generators/workspace-generator/files/index.ts__tmpl__ index a3857c16f3353..e33c339f6ca84 100644 --- a/packages/workspace/src/generators/workspace-generator/files/index.ts__tmpl__ +++ b/packages/workspace/src/generators/workspace-generator/files/index.ts__tmpl__ @@ -1,5 +1,5 @@ -import { Tree, formatFiles, installPackagesTask } from '@nrwl/devkit'; -import { libraryGenerator } from '@nrwl/js'; +import { Tree, formatFiles, installPackagesTask } from '@nx/devkit'; +import { libraryGenerator } from '@nx/js'; export default async function(tree: Tree, schema: any) { await libraryGenerator(tree, {name: schema.name}); diff --git a/packages/workspace/src/generators/workspace-generator/workspace-generator.ts b/packages/workspace/src/generators/workspace-generator/workspace-generator.ts index 0f09d0fbbe96f..a6904cb052619 100644 --- a/packages/workspace/src/generators/workspace-generator/workspace-generator.ts +++ b/packages/workspace/src/generators/workspace-generator/workspace-generator.ts @@ -23,7 +23,7 @@ export default async function (host: Tree, schema: Schema) { host, {}, { - '@nrwl/devkit': nxVersion, + '@nx/devkit': nxVersion, // types/node is neccessary for pnpm since it's used in tsconfig and transitive // dependencies are not resolved correctly '@types/node': 'latest', diff --git a/packages/workspace/src/utilities/buildable-libs-utils.ts b/packages/workspace/src/utilities/buildable-libs-utils.ts index fd2228a19cdf8..413ee4637ddbd 100644 --- a/packages/workspace/src/utilities/buildable-libs-utils.ts +++ b/packages/workspace/src/utilities/buildable-libs-utils.ts @@ -25,7 +25,7 @@ function isBuildable(target: string, node: ProjectGraphProjectNode): boolean { } /** - * @deprecated This type will be removed from @nrwl/workspace in version 17. Prefer importing from @nrwl/js. + * @deprecated This type will be removed from @nx/workspace in version 17. Prefer importing from @nx/js. */ export type DependentBuildableProjectNode = { name: string; @@ -34,7 +34,7 @@ export type DependentBuildableProjectNode = { }; /** - * @deprecated This function will be removed from @nrwl/workspace in version 17. Prefer importing from @nrwl/js. + * @deprecated This function will be removed from @nx/workspace in version 17. Prefer importing from @nx/js. */ export function calculateProjectDependencies( projGraph: ProjectGraph, @@ -223,7 +223,7 @@ function readPaths(tsConfig: string | ts.ParsedCommandLine) { } /** - * @deprecated This function will be removed from @nrwl/workspace in version 17. Prefer importing from @nrwl/js. + * @deprecated This function will be removed from @nx/workspace in version 17. Prefer importing from @nx/js. */ export function createTmpTsConfig( tsconfigPath: string, @@ -256,7 +256,7 @@ function cleanupTmpTsConfigFile(tmpTsConfigPath) { } /** - * @deprecated This function will be removed from @nrwl/workspace in version 17. Prefer importing from @nrwl/js. + * @deprecated This function will be removed from @nx/workspace in version 17. Prefer importing from @nx/js. */ export function checkDependentProjectsHaveBeenBuilt( root: string, @@ -285,7 +285,7 @@ export function checkDependentProjectsHaveBeenBuilt( } /** - * @deprecated This function will be removed from @nrwl/workspace in version 17. Prefer importing from @nrwl/js. + * @deprecated This function will be removed from @nx/workspace in version 17. Prefer importing from @nx/js. */ export function findMissingBuildDependencies( root: string, @@ -312,7 +312,7 @@ export function findMissingBuildDependencies( } /** - * @deprecated This function will be removed from @nrwl/workspace in version 17. Prefer importing from @nrwl/js. + * @deprecated This function will be removed from @nx/workspace in version 17. Prefer importing from @nx/js. */ export function updatePaths( dependencies: DependentBuildableProjectNode[], @@ -361,7 +361,7 @@ export function updatePaths( /** * Updates the peerDependencies section in the `dist/lib/xyz/package.json` with * the proper dependency and version - * @deprecated This function will be removed from @nrwl/workspace in version 17. Prefer importing from @nrwl/js. + * @deprecated This function will be removed from @nx/workspace in version 17. Prefer importing from @nx/js. */ export function updateBuildableProjectPackageJsonDependencies( root: string, diff --git a/packages/workspace/src/utilities/fileutils.spec.ts b/packages/workspace/src/utilities/fileutils.spec.ts index d3acf32602a6a..e4707e961de72 100644 --- a/packages/workspace/src/utilities/fileutils.spec.ts +++ b/packages/workspace/src/utilities/fileutils.spec.ts @@ -24,7 +24,7 @@ describe('fileutils', () => { }); it('should return false for absolute imports', () => { expect(isRelativePath('file')).toEqual(false); - expect(isRelativePath('@nrwl/angular')).toEqual(false); + expect(isRelativePath('@nx/angular')).toEqual(false); }); }); }); diff --git a/packages/workspace/src/utilities/run-tasks-in-serial.ts b/packages/workspace/src/utilities/run-tasks-in-serial.ts index 6e9d3492636cf..8aaabc8ae30be 100644 --- a/packages/workspace/src/utilities/run-tasks-in-serial.ts +++ b/packages/workspace/src/utilities/run-tasks-in-serial.ts @@ -3,7 +3,7 @@ import type { GeneratorCallback } from '@nx/devkit'; /** * Run tasks in serial * - * @deprecated This function will be removed from `@nrwl/workspace` in version 17. Prefer importing it from `@nrwl/devkit`. + * @deprecated This function will be removed from `@nx/workspace` in version 17. Prefer importing it from `@nx/devkit`. * @param tasks The tasks to run in serial. */ export function runTasksInSerial( diff --git a/packages/workspace/src/utilities/typescript.ts b/packages/workspace/src/utilities/typescript.ts index d4952d22860f0..ede5ebf3b5014 100644 --- a/packages/workspace/src/utilities/typescript.ts +++ b/packages/workspace/src/utilities/typescript.ts @@ -93,14 +93,14 @@ import { } from './ts-config'; /** - * @deprecated Please import this from @nrwl/js instead. This function will be removed in v17 + * @deprecated Please import this from @nx/js instead. This function will be removed in v17 */ export function getRelativePathToRootTsConfig(tree: Tree, targetPath: string) { return _getRelativePathToRootTsConfig(tree, targetPath); } /** - * @deprecated Please import this from @nrwl/js instead. This function will be removed in v17 + * @deprecated Please import this from @nx/js instead. This function will be removed in v17 */ export function getRootTsConfigPathInTree(tree: Tree) { return _getRootTsConfigPathInTree(tree); diff --git a/packages/workspace/src/utilities/typescript/get-source-nodes.ts b/packages/workspace/src/utilities/typescript/get-source-nodes.ts index 227c0c0f3ab5c..6c3ce9c83b2df 100644 --- a/packages/workspace/src/utilities/typescript/get-source-nodes.ts +++ b/packages/workspace/src/utilities/typescript/get-source-nodes.ts @@ -1,7 +1,7 @@ import type * as ts from 'typescript'; /** - * @deprecated This function will be removed from @nrwl/workspace in version 17. Prefer importing from @nrwl/js. + * @deprecated This function will be removed from @nx/workspace in version 17. Prefer importing from @nx/js. */ export function getSourceNodes(sourceFile: ts.SourceFile): ts.Node[] { const nodes: ts.Node[] = [sourceFile]; diff --git a/packages/workspace/src/utilities/version-utils.ts b/packages/workspace/src/utilities/version-utils.ts index 690fa960a0219..90b9d78a0f8d4 100644 --- a/packages/workspace/src/utilities/version-utils.ts +++ b/packages/workspace/src/utilities/version-utils.ts @@ -1,12 +1,12 @@ import { checkAndCleanWithSemver as _checkAndCleanWithSemver } from '@nx/devkit/src/utils/semver'; import { logger } from '@nx/devkit'; -/** @deprecated Use checkAndCleanWithSemver from @nrwl/devkit/src/utils/semver instead. +/** @deprecated Use checkAndCleanWithSemver from @nx/devkit/src/utils/semver instead. * TODO(v17): Remove this function from workspace. Keep it for now since there are projects that use it (e.g. https://github.com/gperdomor/nx-tools). */ export function checkAndCleanWithSemver(pkgName: string, version: string) { logger.warn( - `checkAndCleanWithSemver has been moved to @nrwl/devkit/src/utils/semver` + `checkAndCleanWithSemver has been moved to @nx/devkit/src/utils/semver` ); return _checkAndCleanWithSemver(pkgName, version); } diff --git a/packages/workspace/src/utils/rules/add-install-task.ts b/packages/workspace/src/utils/rules/add-install-task.ts index 9c184b9943735..9fe4d381801fd 100644 --- a/packages/workspace/src/utils/rules/add-install-task.ts +++ b/packages/workspace/src/utils/rules/add-install-task.ts @@ -3,7 +3,7 @@ import type { Rule } from '@angular-devkit/schematics'; let installAdded = false; /** - * @deprecated This will be removed in v17. Prefer writing Nx Generators with @nrwl/devkit. This function can be replaced with 'addDependenciesToPackageJson' from @nrwl/devkit. + * @deprecated This will be removed in v17. Prefer writing Nx Generators with @nx/devkit. This function can be replaced with 'addDependenciesToPackageJson' from @nx/devkit. */ export function addInstallTask( options: { skipInstall: boolean } = { skipInstall: false } diff --git a/packages/workspace/src/utils/rules/deleteFile.ts b/packages/workspace/src/utils/rules/deleteFile.ts index b0018f1b4e9d1..bfe6b45b79f5e 100644 --- a/packages/workspace/src/utils/rules/deleteFile.ts +++ b/packages/workspace/src/utils/rules/deleteFile.ts @@ -2,7 +2,7 @@ import type { Rule, Tree } from '@angular-devkit/schematics'; /** * Remove a file from the Virtual Schematic Tree - * @deprecated This will be removed in v17. Prefer writing Nx Generators with @nrwl/devkit. This function can be replaced with 'Tree.delete' from @nrwl/devkit. + * @deprecated This will be removed in v17. Prefer writing Nx Generators with @nx/devkit. This function can be replaced with 'Tree.delete' from @nx/devkit. */ export function deleteFile(from: string): Rule { return (host: Tree) => host.delete(from); diff --git a/packages/workspace/src/utils/rules/format-files.ts b/packages/workspace/src/utils/rules/format-files.ts index c5afdab2e7e32..2304b3b73a466 100644 --- a/packages/workspace/src/utils/rules/format-files.ts +++ b/packages/workspace/src/utils/rules/format-files.ts @@ -12,7 +12,7 @@ import * as path from 'path'; import { workspaceRoot } from '@nx/devkit'; /** - * @deprecated This will be removed in v17. Prefer writing Nx Generators with @nrwl/devkit. This function can be replaced with 'formatFiles' from @nrwl/devkit. + * @deprecated This will be removed in v17. Prefer writing Nx Generators with @nx/devkit. This function can be replaced with 'formatFiles' from @nx/devkit. */ export function formatFiles( options: { skipFormat: boolean } = { skipFormat: false }, diff --git a/packages/workspace/src/utils/rules/visit-not-ignored-files.ts b/packages/workspace/src/utils/rules/visit-not-ignored-files.ts index 0f91d8988af13..8271c75e76a3d 100644 --- a/packages/workspace/src/utils/rules/visit-not-ignored-files.ts +++ b/packages/workspace/src/utils/rules/visit-not-ignored-files.ts @@ -8,7 +8,7 @@ import { import ignore, { Ignore } from 'ignore'; /** - * @deprecated This will be removed in v17. Prefer writing Nx Generators with @nrwl/devkit. This function can be replaced with 'visitNotIgnoredFiles' from @nrwl/devkit. + * @deprecated This will be removed in v17. Prefer writing Nx Generators with @nx/devkit. This function can be replaced with 'visitNotIgnoredFiles' from @nx/devkit. */ export function visitNotIgnoredFiles( visitor: (file: Path, host: Tree, context: SchematicContext) => void | Rule, diff --git a/packages/workspace/src/utils/strings.ts b/packages/workspace/src/utils/strings.ts index 83e2b586743ad..546cb2b23441b 100644 --- a/packages/workspace/src/utils/strings.ts +++ b/packages/workspace/src/utils/strings.ts @@ -22,7 +22,7 @@ const STRING_UNDERSCORE_REGEXP_2 = /-|\s+/g; ``` @method decamelize - @deprecated This will be removed from `@nrwl/workspace` in version 17. Prefer `@nrwl/js` when importing. + @deprecated This will be removed from `@nx/workspace` in version 17. Prefer `@nx/js` when importing. @param {String} str The string to decamelize. @return {String} the decamelized string. */ @@ -42,7 +42,7 @@ export function decamelize(str: string): string { ``` @method dasherize - @deprecated This will be removed from `@nrwl/workspace` in version 17. Prefer `@nrwl/js` when importing. + @deprecated This will be removed from `@nx/workspace` in version 17. Prefer `@nx/js` when importing. @param {String} str The string to dasherize. @return {String} the dasherized string. */ @@ -62,7 +62,7 @@ export function dasherize(str?: string): string { ``` @method camelize - @deprecated This will be removed from `@nrwl/workspace` in version 17. Prefer `@nrwl/js` when importing. + @deprecated This will be removed from `@nx/workspace` in version 17. Prefer `@nx/js` when importing. @param {String} str The string to camelize. @return {String} the camelized string. */ @@ -88,7 +88,7 @@ export function camelize(str: string): string { ``` @method classify - @deprecated This will be removed from `@nrwl/workspace` in version 17. Prefer `@nrwl/js` when importing. + @deprecated This will be removed from `@nx/workspace` in version 17. Prefer `@nx/js` when importing. @param {String} str the string to classify @return {String} the classified string */ @@ -111,7 +111,7 @@ export function classify(str: string): string { ``` @method underscore - @deprecated This will be removed from `@nrwl/workspace` in version 17. Prefer `@nrwl/js` when importing. + @deprecated This will be removed from `@nx/workspace` in version 17. Prefer `@nx/js` when importing. @param {String} str The string to underscore. @return {String} the underscored string. */ @@ -133,7 +133,7 @@ export function underscore(str: string): string { ``` @method capitalize - @deprecated This will be removed from `@nrwl/workspace` in version 17. Prefer `@nrwl/js` when importing. + @deprecated This will be removed from `@nx/workspace` in version 17. Prefer `@nx/js` when importing. @param {String} str The string to capitalize. @return {String} The capitalized string. */ @@ -142,14 +142,14 @@ export function capitalize(str: string): string { } /** - * @deprecated This will be removed from `@nrwl/workspace` in version 17. Prefer `@nrwl/js` when importing. + * @deprecated This will be removed from `@nx/workspace` in version 17. Prefer `@nx/js` when importing. */ export function group(name: string, group: string | undefined) { return group ? `${group}/${name}` : name; } /** - * @deprecated This will be removed from `@nrwl/workspace` in version 17. Prefer `@nrwl/js` when importing. + * @deprecated This will be removed from `@nx/workspace` in version 17. Prefer `@nx/js` when importing. */ export function featurePath( group: boolean | undefined, diff --git a/packages/workspace/src/utils/testing-utils.ts b/packages/workspace/src/utils/testing-utils.ts index f452588414e51..2a65c737a042d 100644 --- a/packages/workspace/src/utils/testing-utils.ts +++ b/packages/workspace/src/utils/testing-utils.ts @@ -11,7 +11,7 @@ import { ScheduleOptions } from '@angular-devkit/architect/src/api'; import { LoggerApi, LogLevel } from '@angular-devkit/core/src/logger'; /** - * @deprecated This will be removed in v17. Prefer writing Nx Generators with @nrwl/devkit. Use tree.read(filePath, 'utf-8') instead. + * @deprecated This will be removed in v17. Prefer writing Nx Generators with @nx/devkit. Use tree.read(filePath, 'utf-8') instead. */ export function getFileContent(tree: Tree, path: string): string { const fileEntry = tree.get(path); @@ -24,7 +24,7 @@ export function getFileContent(tree: Tree, path: string): string { } /** - * @deprecated This will be removed in v17. Prefer writing Nx Generators with @nrwl/devkit. Tests for Generators can use 'createTreeWithEmptyWorkspace()' from @nrwl/devkit/testing. + * @deprecated This will be removed in v17. Prefer writing Nx Generators with @nx/devkit. Tests for Generators can use 'createTreeWithEmptyWorkspace()' from @nx/devkit/testing. */ export function createEmptyWorkspace(tree: Tree): Tree { _test_addWorkspaceFile('workspace.json', WorkspaceFormat.JSON); @@ -119,7 +119,7 @@ class NoopLogger implements LoggerApi { /** * Mock context which makes testing builders easier - * @deprecated This will be removed in v17. Prefer writing Nx Generators with @nrwl/devkit. + * @deprecated This will be removed in v17. Prefer writing Nx Generators with @nx/devkit. */ export class MockBuilderContext implements BuilderContext { id: 0; diff --git a/packages/workspace/src/utils/workspace.ts b/packages/workspace/src/utils/workspace.ts index c00b40f88d0d2..f264b88649b28 100644 --- a/packages/workspace/src/utils/workspace.ts +++ b/packages/workspace/src/utils/workspace.ts @@ -31,7 +31,7 @@ function createHost(tree: Tree): workspaces.WorkspaceHost { } /** - * @deprecated This will be removed in v17. Prefer writing Nx Generators with @nrwl/devkit. This function can be replaced with 'getProjects' with Nx Devkit. + * @deprecated This will be removed in v17. Prefer writing Nx Generators with @nx/devkit. This function can be replaced with 'getProjects' with Nx Devkit. */ export async function getWorkspace(tree: Tree, path = '/') { const host = createHost(tree); @@ -42,7 +42,7 @@ export async function getWorkspace(tree: Tree, path = '/') { } /** - * @deprecated This will be removed in v17. Prefer writing Nx Generators with @nrwl/devkit. This function can be replaced with 'updateProjectConfiguration' with Nx Devkit. + * @deprecated This will be removed in v17. Prefer writing Nx Generators with @nx/devkit. This function can be replaced with 'updateProjectConfiguration' with Nx Devkit. */ export function updateWorkspace( updater: ( @@ -50,13 +50,13 @@ export function updateWorkspace( ) => void | PromiseLike ): Rule; /** - * @deprecated This will be removed in v17. Prefer writing Nx Generators with @nrwl/devkit. This function can be replaced with 'updateProjectConfiguration' with Nx Devkit. + * @deprecated This will be removed in v17. Prefer writing Nx Generators with @nx/devkit. This function can be replaced with 'updateProjectConfiguration' with Nx Devkit. */ export function updateWorkspace( workspace: workspaces.WorkspaceDefinition ): Rule; /** - * @deprecated This will be removed in v17. Prefer writing Nx Generators with @nrwl/devkit. This function can be replaced with 'updateProjectConfiguration' with Nx Devkit. + * @deprecated This will be removed in v17. Prefer writing Nx Generators with @nx/devkit. This function can be replaced with 'updateProjectConfiguration' with Nx Devkit. */ export function updateWorkspace( updaterOrWorkspace: @@ -83,7 +83,7 @@ export function updateWorkspace( /** * Updates builder options for options and configurations for given builder names - * @deprecated This will be removed in v17. Prefer writing Nx Generators with @nrwl/devkit. This function can be replaced with 'forEachExecutorOptions' with Nx Devkit. + * @deprecated This will be removed in v17. Prefer writing Nx Generators with @nx/devkit. This function can be replaced with 'forEachExecutorOptions' with Nx Devkit. */ export function updateBuilderConfig( updater: (