fix(core): replace @nrwl with @nx in nx core packages (#16344)

This commit is contained in:
Jason Jean 2023-04-17 17:28:40 -04:00 committed by GitHub
parent df81c0d8d5
commit 4ee1ba56e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
101 changed files with 368 additions and 338 deletions

View File

@ -67,7 +67,7 @@ describe('Nx Commands', () => {
expect(listOutput).toContain('NX Installed plugins'); expect(listOutput).toContain('NX Installed plugins');
// just check for some, not all // 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 // temporarily make it look like this isn't installed
renameSync( renameSync(

View File

@ -3,12 +3,12 @@
"rules": { "rules": {
"no-restricted-imports": [ "no-restricted-imports": [
"error", "error",
"@nrwl/workspace", "@nx/workspace",
"@angular-devkit/core", "@angular-devkit/core",
"@angular-devkit/architect", "@angular-devkit/architect",
"@angular-devkit/schematics", "@angular-devkit/schematics",
"nx", "nx",
"@nrwl/devkit" "@nx/devkit"
] ]
}, },
"ignorePatterns": ["!**/*"], "ignorePatterns": ["!**/*"],

View File

@ -136,7 +136,7 @@ async function main(parsedArgs: yargs.Arguments<CreateNxPluginArguments>) {
}); });
const workspaceInfo = await createWorkspace( const workspaceInfo = await createWorkspace(
'@nrwl/nx-plugin', '@nx/nx-plugin',
populatedArguments populatedArguments
); );

View File

@ -3,12 +3,12 @@
"rules": { "rules": {
"no-restricted-imports": [ "no-restricted-imports": [
"error", "error",
"@nrwl/workspace", "@nx/workspace",
"@angular-devkit/core", "@angular-devkit/core",
"@angular-devkit/architect", "@angular-devkit/architect",
"@angular-devkit/schematics", "@angular-devkit/schematics",
"nx", "nx",
"@nrwl/devkit" "@nx/devkit"
] ]
}, },
"ignorePatterns": ["!**/*"], "ignorePatterns": ["!**/*"],

View File

@ -32,7 +32,7 @@ export async function createSandbox(packageManager: PackageManager) {
JSON.stringify({ JSON.stringify({
dependencies: { dependencies: {
nx: nxVersion, nx: nxVersion,
'@nrwl/workspace': nxVersion, '@nx/workspace': nxVersion,
}, },
license: 'MIT', license: 'MIT',
}) })

View File

@ -42,7 +42,7 @@ export async function createWorkspace<T extends CreateWorkspaceOptions>(
// If the preset is a third-party preset, we need to call createPreset to install it // 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. // 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); const thirdPartyPreset = await getThirdPartyPreset(preset);
if (thirdPartyPreset) { if (thirdPartyPreset) {
await createPreset(thirdPartyPreset, options, packageManager, directory); await createPreset(thirdPartyPreset, options, packageManager, directory);

View File

@ -26,7 +26,7 @@ export async function setupCI(
try { try {
const pmc = getPackageManagerCommand(packageManager); const pmc = getPackageManagerCommand(packageManager);
const res = await execAndWait( 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)) join(process.cwd(), getFileName(name))
); );
ciSpinner.succeed('CI workflow has been generated successfully'); ciSpinner.succeed('CI workflow has been generated successfully');

View File

@ -1,8 +1,8 @@
import { execSync } from 'child_process'; import { execSync } from 'child_process';
/* /*
* Because we don't want to depend on @nrwl/workspace (to speed up the workspace creation) * Because we don't want to depend on @nx/workspace (to speed up the workspace creation)
* we duplicate the helper functions from @nrwl/workspace in this file. * we duplicate the helper functions from @nx/workspace in this file.
*/ */
export function deduceDefaultBase(): string { export function deduceDefaultBase(): string {
const nxDefaultBase = 'main'; const nxDefaultBase = 'main';

View File

@ -1,6 +1,6 @@
/* /*
* Because we don't want to depend on @nrwl/workspace (to speed up the workspace creation) * Because we don't want to depend on @nx/workspace (to speed up the workspace creation)
* we duplicate the helper functions from @nrwl/workspace in this file. * we duplicate the helper functions from @nx/workspace in this file.
*/ */
import * as chalk from 'chalk'; import * as chalk from 'chalk';

View File

@ -3,8 +3,8 @@ import { existsSync, writeFileSync } from 'fs';
import { join } from 'path'; import { join } from 'path';
/* /*
* Because we don't want to depend on @nrwl/workspace (to speed up the workspace creation) * Because we don't want to depend on @nx/workspace (to speed up the workspace creation)
* we duplicate the helper functions from @nrwl/workspace in this file. * we duplicate the helper functions from @nx/workspace in this file.
*/ */
export const packageManagerList = ['pnpm', 'yarn', 'npm'] as const; export const packageManagerList = ['pnpm', 'yarn', 'npm'] as const;

View File

@ -5,7 +5,7 @@
"error", "error",
{ {
"paths": [ "paths": [
"@nrwl/workspace", "@nx/workspace",
"@angular-devkit/core", "@angular-devkit/core",
"@angular-devkit/architect", "@angular-devkit/architect",
"@angular-devkit/schematics" "@angular-devkit/schematics"
@ -17,7 +17,7 @@
"allowTypeImports": true "allowTypeImports": true
}, },
{ {
"group": ["@nrwl/devkit/**/*"], "group": ["@nx/devkit/**/*"],
"message": "Use a relative import" "message": "Use a relative import"
} }
] ]

View File

@ -1,7 +1,7 @@
/** /**
* Note to developers: STOP! This is the Public API of @nrwl/devkit. * Note to developers: STOP! This is the Public API of @nx/devkit.
* @nrwl/devkit should be compatible with versions of Nx 1 major version prior. * @nx/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. * 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. * 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. * 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.

View File

@ -77,12 +77,12 @@ describe('addDependenciesToPackageJson', () => {
tree, tree,
{}, {},
{ {
'@nrwl/react': 'latest', '@nx/react': 'latest',
} }
); );
expect(readJson(tree, 'package.json').devDependencies).toEqual({ expect(readJson(tree, 'package.json').devDependencies).toEqual({
jest: 'latest', jest: 'latest',
'@nrwl/react': 'latest', '@nx/react': 'latest',
}); });
expect(installTask).toBeDefined(); expect(installTask).toBeDefined();
}); });
@ -105,10 +105,10 @@ describe('addDependenciesToPackageJson', () => {
// ARRANGE // ARRANGE
writeJson(tree, 'package.json', { writeJson(tree, 'package.json', {
dependencies: { dependencies: {
'@nrwl/angular': 'latest', '@nx/angular': 'latest',
}, },
devDependencies: { devDependencies: {
'@nrwl/next': 'latest', '@nx/next': 'latest',
}, },
}); });
@ -116,20 +116,20 @@ describe('addDependenciesToPackageJson', () => {
const installTask = addDependenciesToPackageJson( const installTask = addDependenciesToPackageJson(
tree, tree,
{ {
'@nrwl/next': 'next', '@nx/next': 'next',
}, },
{ {
'@nrwl/angular': 'next', '@nx/angular': 'next',
} }
); );
// ASSERT // ASSERT
const { dependencies, devDependencies } = readJson(tree, 'package.json'); const { dependencies, devDependencies } = readJson(tree, 'package.json');
expect(dependencies).toEqual({ expect(dependencies).toEqual({
'@nrwl/angular': 'next', '@nx/angular': 'next',
}); });
expect(devDependencies).toEqual({ expect(devDependencies).toEqual({
'@nrwl/next': 'next', '@nx/next': 'next',
}); });
expect(installTask).toBeDefined(); expect(installTask).toBeDefined();
}); });
@ -138,10 +138,10 @@ describe('addDependenciesToPackageJson', () => {
// ARRANGE // ARRANGE
writeJson(tree, 'package.json', { writeJson(tree, 'package.json', {
dependencies: { dependencies: {
'@nrwl/angular': 'next', '@nx/angular': 'next',
}, },
devDependencies: { devDependencies: {
'@nrwl/next': 'next', '@nx/next': 'next',
}, },
}); });
@ -149,20 +149,20 @@ describe('addDependenciesToPackageJson', () => {
const installTask = addDependenciesToPackageJson( const installTask = addDependenciesToPackageJson(
tree, tree,
{ {
'@nrwl/next': 'latest', '@nx/next': 'latest',
}, },
{ {
'@nrwl/angular': 'latest', '@nx/angular': 'latest',
} }
); );
// ASSERT // ASSERT
const { dependencies, devDependencies } = readJson(tree, 'package.json'); const { dependencies, devDependencies } = readJson(tree, 'package.json');
expect(dependencies).toEqual({ expect(dependencies).toEqual({
'@nrwl/angular': 'next', '@nx/angular': 'next',
}); });
expect(devDependencies).toEqual({ expect(devDependencies).toEqual({
'@nrwl/next': 'next', '@nx/next': 'next',
}); });
expect(installTask).toBeDefined(); expect(installTask).toBeDefined();
}); });
@ -171,10 +171,10 @@ describe('addDependenciesToPackageJson', () => {
// ARRANGE // ARRANGE
writeJson(tree, 'package.json', { writeJson(tree, 'package.json', {
dependencies: { dependencies: {
'@nrwl/angular': '14.0.0', '@nx/angular': '14.0.0',
}, },
devDependencies: { devDependencies: {
'@nrwl/next': '14.0.0', '@nx/next': '14.0.0',
}, },
}); });
@ -182,20 +182,20 @@ describe('addDependenciesToPackageJson', () => {
const installTask = addDependenciesToPackageJson( const installTask = addDependenciesToPackageJson(
tree, tree,
{ {
'@nrwl/next': '14.1.0', '@nx/next': '14.1.0',
}, },
{ {
'@nrwl/angular': '14.1.0', '@nx/angular': '14.1.0',
} }
); );
// ASSERT // ASSERT
const { dependencies, devDependencies } = readJson(tree, 'package.json'); const { dependencies, devDependencies } = readJson(tree, 'package.json');
expect(dependencies).toEqual({ expect(dependencies).toEqual({
'@nrwl/angular': '14.1.0', '@nx/angular': '14.1.0',
}); });
expect(devDependencies).toEqual({ expect(devDependencies).toEqual({
'@nrwl/next': '14.1.0', '@nx/next': '14.1.0',
}); });
expect(installTask).toBeDefined(); expect(installTask).toBeDefined();
}); });
@ -204,10 +204,10 @@ describe('addDependenciesToPackageJson', () => {
// ARRANGE // ARRANGE
writeJson(tree, 'package.json', { writeJson(tree, 'package.json', {
dependencies: { dependencies: {
'@nrwl/angular': '14.1.0', '@nx/angular': '14.1.0',
}, },
devDependencies: { devDependencies: {
'@nrwl/next': '14.1.0', '@nx/next': '14.1.0',
}, },
}); });
@ -215,20 +215,20 @@ describe('addDependenciesToPackageJson', () => {
const installTask = addDependenciesToPackageJson( const installTask = addDependenciesToPackageJson(
tree, tree,
{ {
'@nrwl/next': '14.0.0', '@nx/next': '14.0.0',
}, },
{ {
'@nrwl/angular': '14.0.0', '@nx/angular': '14.0.0',
} }
); );
// ASSERT // ASSERT
const { dependencies, devDependencies } = readJson(tree, 'package.json'); const { dependencies, devDependencies } = readJson(tree, 'package.json');
expect(dependencies).toEqual({ expect(dependencies).toEqual({
'@nrwl/angular': '14.1.0', '@nx/angular': '14.1.0',
}); });
expect(devDependencies).toEqual({ expect(devDependencies).toEqual({
'@nrwl/next': '14.1.0', '@nx/next': '14.1.0',
}); });
expect(installTask).toBeDefined(); expect(installTask).toBeDefined();
}); });
@ -237,12 +237,12 @@ describe('addDependenciesToPackageJson', () => {
// ARRANGE // ARRANGE
writeJson(tree, 'package.json', { writeJson(tree, 'package.json', {
dependencies: { dependencies: {
'@nrwl/angular': '14.2.0', '@nx/angular': '14.2.0',
'@nrwl/cypress': '14.1.1', '@nx/cypress': '14.1.1',
}, },
devDependencies: { devDependencies: {
'@nrwl/next': '14.0.0', '@nx/next': '14.0.0',
'@nrwl/vite': '14.1.0', '@nx/vite': '14.1.0',
}, },
}); });
@ -250,22 +250,22 @@ describe('addDependenciesToPackageJson', () => {
const installTask = addDependenciesToPackageJson( const installTask = addDependenciesToPackageJson(
tree, tree,
{ {
'@nrwl/angular': '14.1.0', '@nx/angular': '14.1.0',
}, },
{ {
'@nrwl/next': '14.1.0', '@nx/next': '14.1.0',
} }
); );
// ASSERT // ASSERT
const { dependencies, devDependencies } = readJson(tree, 'package.json'); const { dependencies, devDependencies } = readJson(tree, 'package.json');
expect(dependencies).toEqual({ expect(dependencies).toEqual({
'@nrwl/angular': '14.2.0', '@nx/angular': '14.2.0',
'@nrwl/cypress': '14.1.1', '@nx/cypress': '14.1.1',
}); });
expect(devDependencies).toEqual({ expect(devDependencies).toEqual({
'@nrwl/next': '14.1.0', '@nx/next': '14.1.0',
'@nrwl/vite': '14.1.0', '@nx/vite': '14.1.0',
}); });
expect(installTask).toBeDefined(); expect(installTask).toBeDefined();
}); });
@ -274,12 +274,12 @@ describe('addDependenciesToPackageJson', () => {
// ARRANGE // ARRANGE
writeJson(tree, 'package.json', { writeJson(tree, 'package.json', {
dependencies: { dependencies: {
'@nrwl/angular': '14.0.0', '@nx/angular': '14.0.0',
'@nrwl/cypress': '14.1.1', '@nx/cypress': '14.1.1',
}, },
devDependencies: { devDependencies: {
'@nrwl/next': '14.2.0', '@nx/next': '14.2.0',
'@nrwl/vite': '14.1.0', '@nx/vite': '14.1.0',
}, },
}); });
@ -287,22 +287,22 @@ describe('addDependenciesToPackageJson', () => {
const installTask = addDependenciesToPackageJson( const installTask = addDependenciesToPackageJson(
tree, tree,
{ {
'@nrwl/angular': '14.1.0', '@nx/angular': '14.1.0',
}, },
{ {
'@nrwl/next': '14.1.0', '@nx/next': '14.1.0',
} }
); );
// ASSERT // ASSERT
const { dependencies, devDependencies } = readJson(tree, 'package.json'); const { dependencies, devDependencies } = readJson(tree, 'package.json');
expect(dependencies).toEqual({ expect(dependencies).toEqual({
'@nrwl/angular': '14.1.0', '@nx/angular': '14.1.0',
'@nrwl/cypress': '14.1.1', '@nx/cypress': '14.1.1',
}); });
expect(devDependencies).toEqual({ expect(devDependencies).toEqual({
'@nrwl/next': '14.2.0', '@nx/next': '14.2.0',
'@nrwl/vite': '14.1.0', '@nx/vite': '14.1.0',
}); });
expect(installTask).toBeDefined(); expect(installTask).toBeDefined();
}); });
@ -311,10 +311,10 @@ describe('addDependenciesToPackageJson', () => {
// ARRANGE // ARRANGE
writeJson(tree, 'package.json', { writeJson(tree, 'package.json', {
dependencies: { dependencies: {
'@nrwl/angular': '14.0.0', '@nx/angular': '14.0.0',
}, },
devDependencies: { devDependencies: {
'@nrwl/next': '14.1.0', '@nx/next': '14.1.0',
}, },
}); });
@ -322,20 +322,20 @@ describe('addDependenciesToPackageJson', () => {
const installTask = addDependenciesToPackageJson( const installTask = addDependenciesToPackageJson(
tree, tree,
{ {
'@nrwl/next': '14.0.0', '@nx/next': '14.0.0',
}, },
{ {
'@nrwl/angular': '14.1.0', '@nx/angular': '14.1.0',
} }
); );
// ASSERT // ASSERT
const { dependencies, devDependencies } = readJson(tree, 'package.json'); const { dependencies, devDependencies } = readJson(tree, 'package.json');
expect(dependencies).toEqual({ expect(dependencies).toEqual({
'@nrwl/angular': '14.1.0', '@nx/angular': '14.1.0',
}); });
expect(devDependencies).toEqual({ expect(devDependencies).toEqual({
'@nrwl/next': '14.1.0', '@nx/next': '14.1.0',
}); });
expect(installTask).toBeDefined(); expect(installTask).toBeDefined();
}); });
@ -344,11 +344,11 @@ describe('addDependenciesToPackageJson', () => {
// ARRANGE // ARRANGE
writeJson(tree, 'package.json', { writeJson(tree, 'package.json', {
dependencies: { dependencies: {
'@nrwl/angular': 'github:reponame/packageNameOne', '@nx/angular': 'github:reponame/packageNameOne',
'@nrwl/vite': 'git://github.com/npm/cli.git#v14.2.0', // this format is parsable '@nx/vite': 'git://github.com/npm/cli.git#v14.2.0', // this format is parsable
}, },
devDependencies: { devDependencies: {
'@nrwl/next': '14.1.0', '@nx/next': '14.1.0',
}, },
}); });
@ -356,26 +356,25 @@ describe('addDependenciesToPackageJson', () => {
const installTask = addDependenciesToPackageJson( const installTask = addDependenciesToPackageJson(
tree, tree,
{ {
'@nrwl/next': 'github:reponame/packageNameTwo', '@nx/next': 'github:reponame/packageNameTwo',
'@nrwl/cypress': '@nx/cypress':
'git+https://username@github.com/reponame/packagename.git', '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 // ASSERT
const { dependencies, devDependencies } = readJson(tree, 'package.json'); const { dependencies, devDependencies } = readJson(tree, 'package.json');
expect(dependencies).toEqual({ expect(dependencies).toEqual({
'@nrwl/angular': '14.1.0', '@nx/angular': '14.1.0',
'@nrwl/cypress': '@nx/cypress': 'git+https://username@github.com/reponame/packagename.git',
'git+https://username@github.com/reponame/packagename.git', '@nx/vite': 'git://github.com/npm/cli.git#v14.2.0',
'@nrwl/vite': 'git://github.com/npm/cli.git#v14.2.0',
}); });
expect(devDependencies).toEqual({ expect(devDependencies).toEqual({
'@nrwl/next': 'github:reponame/packageNameTwo', '@nx/next': 'github:reponame/packageNameTwo',
}); });
expect(installTask).toBeDefined(); expect(installTask).toBeDefined();
}); });
@ -384,10 +383,10 @@ describe('addDependenciesToPackageJson', () => {
// ARRANGE // ARRANGE
writeJson(tree, 'package.json', { writeJson(tree, 'package.json', {
dependencies: { dependencies: {
'@nrwl/angular': 'latest', '@nx/angular': 'latest',
}, },
devDependencies: { devDependencies: {
'@nrwl/next': 'latest', '@nx/next': 'latest',
}, },
}); });
@ -395,22 +394,22 @@ describe('addDependenciesToPackageJson', () => {
const installTask = addDependenciesToPackageJson( const installTask = addDependenciesToPackageJson(
tree, tree,
{ {
'@nrwl/next': 'next', '@nx/next': 'next',
'@nrwl/cypress': 'latest', '@nx/cypress': 'latest',
}, },
{ {
'@nrwl/angular': 'next', '@nx/angular': 'next',
} }
); );
// ASSERT // ASSERT
const { dependencies, devDependencies } = readJson(tree, 'package.json'); const { dependencies, devDependencies } = readJson(tree, 'package.json');
expect(dependencies).toEqual({ expect(dependencies).toEqual({
'@nrwl/angular': 'next', '@nx/angular': 'next',
'@nrwl/cypress': 'latest', '@nx/cypress': 'latest',
}); });
expect(devDependencies).toEqual({ expect(devDependencies).toEqual({
'@nrwl/next': 'next', '@nx/next': 'next',
}); });
expect(installTask).toBeDefined(); expect(installTask).toBeDefined();
}); });

View File

@ -24,7 +24,7 @@
"@angular-devkit/architect", "@angular-devkit/architect",
"@angular-devkit/core", "@angular-devkit/core",
"@angular-devkit/schematics", "@angular-devkit/schematics",
"@nrwl/workspace" "@nx/workspace"
] ]
} }
}, },

View File

@ -1,7 +1,7 @@
{ {
"name": "nx/plugin", "name": "nx/plugin",
"version": "0.1", "version": "0.1",
"extends": ["@nrwl/workspace"], "extends": ["@nx/workspace"],
"generators": { "generators": {
"plugin": { "plugin": {
"factory": "./src/generators/plugin/plugin", "factory": "./src/generators/plugin/plugin",

View File

@ -12,7 +12,7 @@ import { JestExecutorOptions } from '@nx/jest/src/executors/jest/schema';
import { jestExecutor } from '@nx/jest/src/executors/jest/jest.impl'; import { jestExecutor } from '@nx/jest/src/executors/jest/jest.impl';
import type { NxPluginE2EExecutorOptions } from './schema'; 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( export async function* nxPluginE2EExecutor(
options: NxPluginE2EExecutorOptions, options: NxPluginE2EExecutorOptions,
context: ExecutorContext context: ExecutorContext

View File

@ -116,7 +116,7 @@ describe('NxPlugin e2e-project Generator', () => {
expect(project.root).toEqual('apps/my-plugin-e2e'); expect(project.root).toEqual('apps/my-plugin-e2e');
expect(project.targets.e2e).toBeTruthy(); expect(project.targets.e2e).toBeTruthy();
expect(project.targets.e2e).toMatchObject({ expect(project.targets.e2e).toMatchObject({
executor: '@nrwl/nx-plugin:e2e', executor: '@nx/nx-plugin:e2e',
options: expect.objectContaining({ target: 'my-plugin:build' }), options: expect.objectContaining({ target: 'my-plugin:build' }),
}); });
}); });

View File

@ -78,7 +78,7 @@ function updateWorkspaceConfiguration(host: Tree, options: NormalizedSchema) {
sourceRoot: `${options.projectRoot}/src`, sourceRoot: `${options.projectRoot}/src`,
targets: { targets: {
e2e: { e2e: {
executor: '@nrwl/nx-plugin:e2e', executor: '@nx/nx-plugin:e2e',
options: { target: `${options.pluginName}:build` }, options: { target: `${options.pluginName}:build` },
}, },
}, },

View File

@ -4,7 +4,7 @@ import {
readJson, readJson,
runNxCommandAsync, runNxCommandAsync,
uniq, uniq,
} from '@nrwl/nx-plugin/testing'; } from '@nx/nx-plugin/testing';
describe('<%= pluginName %> e2e', () => { describe('<%= pluginName %> e2e', () => {
// Setting up individual workspaces per // Setting up individual workspaces per

View File

@ -150,7 +150,7 @@ describe('NxPlugin Executor Generator', () => {
.read('libs/my-plugin/src/executors/my-executor/hasher.ts') .read('libs/my-plugin/src/executors/my-executor/hasher.ts')
.toString() .toString()
).toMatchInlineSnapshot(` ).toMatchInlineSnapshot(`
"import { CustomHasher } from '@nrwl/devkit'; "import { CustomHasher } from '@nx/devkit';
/** /**
* This is a boilerplate custom hasher that matches * This is a boilerplate custom hasher that matches

View File

@ -1,4 +1,4 @@
import { Hasher, HasherContext } from '@nrwl/devkit'; import { Hasher, HasherContext } from '@nx/devkit';
import { <%=propertyName%>Hasher } from './hasher'; import { <%=propertyName%>Hasher } from './hasher';

View File

@ -1,4 +1,4 @@
import { CustomHasher } from '@nrwl/devkit'; import { CustomHasher } from '@nx/devkit';
/** /**
* This is a boilerplate custom hasher that matches * This is a boilerplate custom hasher that matches

View File

@ -1,5 +1,5 @@
import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing';
import { Tree, readProjectConfiguration } from '@nrwl/devkit'; import { Tree, readProjectConfiguration } from '@nx/devkit';
import generator from './generator'; import generator from './generator';
import { <%= className %>GeneratorSchema } from './schema'; import { <%= className %>GeneratorSchema } from './schema';

View File

@ -6,7 +6,7 @@ import {
names, names,
offsetFromRoot, offsetFromRoot,
Tree, Tree,
} from '@nrwl/devkit'; } from '@nx/devkit';
import * as path from 'path'; import * as path from 'path';
import { <%= className %>GeneratorSchema } from './schema'; import { <%= className %>GeneratorSchema } from './schema';

View File

@ -107,8 +107,10 @@ export function addMigrationJsonChecks(
host, host,
`${projectConfiguration.root}/.eslintrc.json`, `${projectConfiguration.root}/.eslintrc.json`,
(c) => { (c) => {
const override = c.overrides.find((o) => const override = c.overrides.find(
Object.keys(o.rules ?? {})?.includes('@nrwl/nx/nx-plugin-checks') (o) =>
Object.keys(o.rules ?? {})?.includes('@nx/nx/nx-plugin-checks') ||
Object.keys(o.rules ?? {})?.includes('@nrwl/nx/nx-plugin-checks')
); );
if ( if (
Array.isArray(override?.files) && Array.isArray(override?.files) &&
@ -133,7 +135,10 @@ function updateProjectTarget(
} }
for (const [target, configuration] of Object.entries(project.targets)) { 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 ?? {}; const opts: EsLintExecutorOptions = configuration.options ?? {};
opts.lintFilePatterns ??= []; opts.lintFilePatterns ??= [];
@ -182,8 +187,10 @@ function updateProjectEslintConfig(
const eslintConfig = readJson<ESLint.Config>(host, eslintPath); const eslintConfig = readJson<ESLint.Config>(host, eslintPath);
eslintConfig.overrides ??= []; eslintConfig.overrides ??= [];
if ( if (
!eslintConfig.overrides.some((x) => !eslintConfig.overrides.some(
Object.keys(x.rules ?? {}).includes('@nrwl/nx/nx-plugin-checks') (x) =>
Object.keys(x.rules ?? {}).includes('@nx/nx/nx-plugin-checks') ||
Object.keys(x.rules ?? {}).includes('@nrwl/nx/nx-plugin-checks')
) )
) { ) {
eslintConfig.overrides.push({ eslintConfig.overrides.push({
@ -254,6 +261,7 @@ export function getEsLintOptions(
project: ProjectConfiguration project: ProjectConfiguration
): [target: string, configuration: TargetConfiguration<EsLintExecutorOptions>] { ): [target: string, configuration: TargetConfiguration<EsLintExecutorOptions>] {
return Object.entries(project.targets || {}).find( return Object.entries(project.targets || {}).find(
([, x]) => x.executor === '@nrwl/linter:eslint' ([, x]) =>
x.executor === '@nx/linter:eslint' || x.executor === '@nrwl/linter:eslint'
); );
} }

View File

@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/no-unused-vars */ /* eslint-disable @typescript-eslint/no-unused-vars */
import { Tree } from '@nrwl/devkit'; import { Tree } from '@nx/devkit';
export default function update(host: Tree) { export default function update(host: Tree) {
// ... // ...

View File

@ -101,12 +101,13 @@ export async function pluginGenerator(host: Tree, schema: Schema) {
addDependenciesToPackageJson( addDependenciesToPackageJson(
host, host,
{ {
'@nrwl/devkit': nxVersion, '@nx/devkit': nxVersion,
tslib: tsLibVersion, tslib: tsLibVersion,
}, },
{ {
'@nrwl/jest': nxVersion, '@nx/jest': nxVersion,
'@nrwl/js': nxVersion, '@nx/js': nxVersion,
'@nx/nx-plugin': nxVersion,
'@swc-node/register': swcNodeVersion, '@swc-node/register': swcNodeVersion,
} }
); );

View File

@ -37,9 +37,9 @@ function removeNpmScope(tree: Tree) {
} }
function moveNxPluginToDevDeps(tree: Tree) { function moveNxPluginToDevDeps(tree: Tree) {
updateJson<PackageJson>(tree, 'package.json', (json) => { updateJson<PackageJson>(tree, 'package.json', (json) => {
const nxPluginEntry = json.dependencies['@nrwl/nx-plugin']; const nxPluginEntry = json.dependencies['@nx/nx-plugin'];
delete json.dependencies['@nrwl/nx-plugin']; delete json.dependencies['@nx/nx-plugin'];
json.devDependencies['@nrwl/nx-plugin'] = nxPluginEntry; json.devDependencies['@nx/nx-plugin'] = nxPluginEntry;
return json; return json;
}); });
} }

View File

@ -15,7 +15,7 @@ function runNxNewCommand(args?: string, silent?: boolean) {
return execSync( return execSync(
`node ${require.resolve( `node ${require.resolve(
'nx' '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 || '' args || ''
}`, }`,
{ {
@ -76,7 +76,7 @@ export function newNxProject(
/** /**
* Ensures that a project has been setup in the e2e directory * 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( export function ensureNxProject(
npmPackageName?: string, npmPackageName?: string,

View File

@ -1,3 +1,3 @@
# `nx-darwin-arm64` # `nx-darwin-arm64`
This is the **aarch64-apple-darwin** binary for `@nrwl/nx` This is the **aarch64-apple-darwin** binary for `@nx/nx`

View File

@ -1,3 +1,3 @@
# `nx-darwin-x64` # `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`

View File

@ -1,3 +1,3 @@
# `nx-linux-arm-gnueabihf` # `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`

View File

@ -1,3 +1,3 @@
# `nx-linux-arm64-gnu` # `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`

View File

@ -1,3 +1,3 @@
# `nx-linux-arm64-musl` # `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`

View File

@ -1,3 +1,3 @@
# `nx-linux-x64-gnu` # `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`

View File

@ -1,3 +1,3 @@
# `nx-linux-x64-musl` # `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`

View File

@ -1,3 +1,3 @@
# `nx-win32-arm64-msvc` # `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`

View File

@ -1,3 +1,3 @@
# `nx-win32-x64-msvc` # `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`

View File

@ -8,7 +8,7 @@
} }
}, },
"pluginsConfig": { "pluginsConfig": {
"@nrwl/js": { "@nx/js": {
"analyzeSourceFiles": false "analyzeSourceFiles": false
} }
} }

View File

@ -17,8 +17,8 @@ export function shouldMergeAngularProjects(
// Include projects from angular.json if explicitly required. // Include projects from angular.json if explicitly required.
// e.g. when invoked from `packages/devkit/src/utils/convert-nx-executor.ts` // e.g. when invoked from `packages/devkit/src/utils/convert-nx-executor.ts`
(includeProjectsFromAngularJson || (includeProjectsFromAngularJson ||
// Or if a workspace has `@nrwl/angular` installed then projects from `angular.json` to be considered by Nx. // Or if a workspace has `@nrwl/angular`/`@nx/angular` installed then projects from `angular.json` to be considered by Nx.
isNrwlAngularInstalled()) isAngularPluginInstalled())
) { ) {
return true; return true;
} else { } else {
@ -26,7 +26,7 @@ export function shouldMergeAngularProjects(
} }
} }
function isNrwlAngularInstalled() { function isAngularPluginInstalled() {
try { try {
require.resolve('@nx/angular'); require.resolve('@nx/angular');
return true; return true;

View File

@ -506,8 +506,7 @@ describe('Migration', () => {
it('should not throw when packages are missing', async () => { it('should not throw when packages are missing', async () => {
const migrator = new Migrator({ const migrator = new Migrator({
packageJson: createPackageJson(), packageJson: createPackageJson(),
getInstalledPackageVersion: (p) => getInstalledPackageVersion: (p) => (p === '@nx/nest' ? null : '1.0.0'),
p === '@nrwl/nest' ? null : '1.0.0',
fetch: (_p, _v) => fetch: (_p, _v) =>
Promise.resolve({ Promise.resolve({
version: '2.0.0', version: '2.0.0',
@ -516,16 +515,15 @@ describe('Migration', () => {
from: {}, from: {},
to: {}, 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 () => { it('should only fetch packages that are installed', async () => {
const migrator = new Migrator({ const migrator = new Migrator({
packageJson: createPackageJson(), packageJson: createPackageJson(),
getInstalledPackageVersion: (p) => getInstalledPackageVersion: (p) => (p === '@nx/nest' ? null : '1.0.0'),
p === '@nrwl/nest' ? null : '1.0.0',
fetch: (p, _v) => { fetch: (p, _v) => {
if (p === '@nrwl/nest') { if (p === '@nx/nest') {
throw new Error('Boom'); throw new Error('Boom');
} }
return Promise.resolve({ return Promise.resolve({
@ -536,7 +534,7 @@ describe('Migration', () => {
from: {}, from: {},
to: {}, 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 () => { it('should only fetch packages that are top-level deps', async () => {
@ -1582,10 +1580,10 @@ describe('Migration', () => {
}); });
expect( expect(
await parseMigrationsOptions({ await parseMigrationsOptions({
packageAndVersion: '@nrwl/workspace@8.12', packageAndVersion: '@nx/workspace@8.12',
}) })
).toMatchObject({ ).toMatchObject({
targetPackage: '@nrwl/workspace', targetPackage: '@nx/workspace',
targetVersion: '8.12.0', targetVersion: '8.12.0',
}); });
expect( expect(
@ -1608,18 +1606,18 @@ describe('Migration', () => {
}); });
expect( expect(
await parseMigrationsOptions({ await parseMigrationsOptions({
packageAndVersion: '@nrwl/workspace@latest', packageAndVersion: '@nx/workspace@latest',
}) })
).toMatchObject({ ).toMatchObject({
targetPackage: '@nrwl/workspace', targetPackage: '@nx/workspace',
targetVersion: 'latest', targetVersion: 'latest',
}); });
expect( expect(
await parseMigrationsOptions({ await parseMigrationsOptions({
packageAndVersion: '@nrwl/workspace@alpha', packageAndVersion: '@nx/workspace@alpha',
}) })
).toMatchObject({ ).toMatchObject({
targetPackage: '@nrwl/workspace', targetPackage: '@nx/workspace',
targetVersion: 'alpha', targetVersion: 'alpha',
}); });
}); });
@ -1674,13 +1672,13 @@ describe('Migration', () => {
it('should handle backslashes in package names', async () => { it('should handle backslashes in package names', async () => {
const r = await parseMigrationsOptions({ 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', from: '@myscope\\a@12.3,@myscope\\b@1.1.1',
to: '@myscope\\c@12.3.1', to: '@myscope\\c@12.3.1',
}); });
expect(r).toEqual({ expect(r).toEqual({
type: 'generateMigrations', type: 'generateMigrations',
targetPackage: '@nrwl/workspace', targetPackage: '@nx/workspace',
targetVersion: '8.12.0', targetVersion: '8.12.0',
from: { from: {
'@myscope/a': '12.3.0', '@myscope/a': '12.3.0',

View File

@ -1147,6 +1147,8 @@ function readNxVersion(packageJson: PackageJson) {
return ( return (
packageJson?.devDependencies?.['nx'] ?? packageJson?.devDependencies?.['nx'] ??
packageJson?.dependencies?.['nx'] ?? packageJson?.dependencies?.['nx'] ??
packageJson?.devDependencies?.['@nx/workspace'] ??
packageJson?.dependencies?.['@nx/workspace'] ??
packageJson?.devDependencies?.['@nrwl/workspace'] ?? packageJson?.devDependencies?.['@nrwl/workspace'] ??
packageJson?.dependencies?.['@nrwl/workspace'] packageJson?.dependencies?.['@nrwl/workspace']
); );

View File

@ -18,11 +18,11 @@ export async function newWorkspace(cwd: string, args: { [k: string]: any }) {
async () => { async () => {
const isInteractive = args.interactive; const isInteractive = args.interactive;
const { normalizedGeneratorName, schema, implementationFactory } = const { normalizedGeneratorName, schema, implementationFactory } =
ws.readGenerator('@nrwl/workspace/generators.json', 'new'); ws.readGenerator('@nx/workspace/generators.json', 'new');
removeSpecialFlags(args); removeSpecialFlags(args);
const combinedOpts = await combineOptionsForGenerator( const combinedOpts = await combineOptionsForGenerator(
args, args,
'@nrwl/workspace/generators.json', '@nx/workspace/generators.json',
normalizedGeneratorName, normalizedGeneratorName,
null, null,
null, null,

View File

@ -39,7 +39,7 @@ interface NxInstallationConfiguration {
version: string; version: string;
/** /**
* Record<pluginPackageName, pluginVersion>. e.g. * Record<pluginPackageName, pluginVersion>. e.g.
* plugins: { '@nrwl/angular': '1.0.0' } * plugins: { '@nx/angular': '1.0.0' }
*/ */
plugins?: Record<string, string>; plugins?: Record<string, string>;
} }
@ -106,7 +106,7 @@ export interface NxJsonConfiguration<T = '*' | string[]> {
* *
* ``` * ```
* { * {
* "@nrwl/react": { * "@nx/react": {
* "library": { * "library": {
* "style": "scss" * "style": "scss"
* } * }

View File

@ -74,7 +74,7 @@ export interface ProjectConfiguration {
* *
* ``` * ```
* { * {
* "@nrwl/react": { * "@nx/react": {
* "library": { * "library": {
* "style": "scss" * "style": "scss"
* } * }
@ -136,7 +136,7 @@ export interface TargetConfiguration<T = any> {
/** /**
* The executor/builder used to implement the target. * The executor/builder used to implement the target.
* *
* Example: '@nrwl/web:rollup' * Example: '@nx/web:rollup'
*/ */
executor?: string; executor?: string;

View File

@ -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. * Todo: Should refactor, not duplicate.
*/ */
export function toProjectName(fileName: string): string { export function toProjectName(fileName: string): string {

View File

@ -57,7 +57,7 @@ export async function subscribeToWorkspaceChanges(
cb: FileWatcherCallback cb: FileWatcherCallback
): Promise<AsyncSubscription> { ): Promise<AsyncSubscription> {
/** /**
* 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 * 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. * executed by packages which do not have its necessary native binaries available.
*/ */

View File

@ -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. * Try hard to not add to this API to reduce the surface area we need to maintain.
*/ */

View File

@ -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'; import type { Observable } from 'rxjs';

View File

@ -27,8 +27,8 @@ describe('Hasher', () => {
const tsConfigBaseJson = JSON.stringify({ const tsConfigBaseJson = JSON.stringify({
compilerOptions: { compilerOptions: {
paths: { paths: {
'@nrwl/parent': ['libs/parent/src/index.ts'], '@nx/parent': ['libs/parent/src/index.ts'],
'@nrwl/child': ['libs/child/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.command).toEqual('parent|build||{"prop":"prop-value"}');
expect(hash.details.nodes).toEqual({ expect(hash.details.nodes).toEqual({
'parent:{projectRoot}/**/*': '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', parent: 'unknown',
'{workspaceRoot}/nx.json': 'nx.json.hash', '{workspaceRoot}/nx.json': 'nx.json.hash',
'{workspaceRoot}/.gitignore': '', '{workspaceRoot}/.gitignore': '',
@ -444,7 +444,7 @@ describe('Hasher', () => {
data: { data: {
root: 'libs/parent', root: 'libs/parent',
targets: { targets: {
build: { executor: '@nrwl/workspace:run-commands' }, build: { executor: '@nx/workspace:run-commands' },
}, },
files: [ files: [
{ file: 'libs/parent/filea.ts', hash: 'a.hash' }, { file: 'libs/parent/filea.ts', hash: 'a.hash' },
@ -457,7 +457,7 @@ describe('Hasher', () => {
type: 'lib', type: 'lib',
data: { data: {
root: 'libs/child', root: 'libs/child',
targets: { build: { executor: '@nrwl/workspace:run-commands' } }, targets: { build: { executor: '@nx/workspace:run-commands' } },
files: [ files: [
{ file: 'libs/child/fileb.ts', hash: 'b.hash' }, { file: 'libs/child/fileb.ts', hash: 'b.hash' },
{ file: 'libs/child/fileb.spec.ts', hash: 'b.spec.hash' }, { file: 'libs/child/fileb.spec.ts', hash: 'b.spec.hash' },
@ -511,7 +511,7 @@ describe('Hasher', () => {
type: 'lib', type: 'lib',
data: { data: {
root: 'libs/parent', root: 'libs/parent',
targets: { build: { executor: '@nrwl/workspace:run-commands' } }, targets: { build: { executor: '@nx/workspace:run-commands' } },
files: [{ file: '/file', hash: 'file.hash' }], files: [{ file: '/file', hash: 'file.hash' }],
}, },
}, },
@ -560,7 +560,7 @@ describe('Hasher', () => {
type: 'lib', type: 'lib',
data: { data: {
root: 'libs/parent', root: 'libs/parent',
targets: { build: { executor: '@nrwl/workspace:run-commands' } }, targets: { build: { executor: '@nx/workspace:run-commands' } },
files: [{ file: '/filea.ts', hash: 'a.hash' }], files: [{ file: '/filea.ts', hash: 'a.hash' }],
}, },
}, },
@ -569,7 +569,7 @@ describe('Hasher', () => {
type: 'lib', type: 'lib',
data: { data: {
root: 'libs/child', root: 'libs/child',
targets: { build: { executor: '@nrwl/workspace:run-commands' } }, targets: { build: { executor: '@nx/workspace:run-commands' } },
files: [{ file: '/fileb.ts', hash: 'b.hash' }], files: [{ file: '/fileb.ts', hash: 'b.hash' }],
}, },
}, },
@ -641,7 +641,7 @@ describe('Hasher', () => {
type: 'lib', type: 'lib',
data: { data: {
root: 'libs/parent', root: 'libs/parent',
targets: { build: { executor: '@nrwl/workspace:run-commands' } }, targets: { build: { executor: '@nx/workspace:run-commands' } },
files: [{ file: '/file', hash: 'some-hash' }], files: [{ file: '/file', hash: 'some-hash' }],
}, },
}, },
@ -683,7 +683,7 @@ describe('Hasher', () => {
type: 'app', type: 'app',
data: { data: {
root: 'apps/app', root: 'apps/app',
targets: { build: { executor: '@nrwl/workspace:run-commands' } }, targets: { build: { executor: '@nx/workspace:run-commands' } },
files: [{ file: '/filea.ts', hash: 'a.hash' }], files: [{ file: '/filea.ts', hash: 'a.hash' }],
}, },
}, },
@ -732,7 +732,7 @@ describe('Hasher', () => {
type: 'app', type: 'app',
data: { data: {
root: 'apps/app', root: 'apps/app',
targets: { build: { executor: '@nrwl/workspace:run-commands' } }, targets: { build: { executor: '@nx/workspace:run-commands' } },
files: [{ file: '/filea.ts', hash: 'a.hash' }], files: [{ file: '/filea.ts', hash: 'a.hash' }],
}, },
}, },

View File

@ -369,8 +369,8 @@ class TaskHasher {
// if it's "run commands" we skip traversing since we have no info what this command depends on // 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 // for everything else we take the hash of the @nrwl package dependency tree
if ( if (
target.executor.startsWith(`@nrwl/`) && target.executor.startsWith(`@nrwl/`) ||
target.executor !== `@nrwl/workspace:run-commands` target.executor.startsWith(`@nx/`)
) { ) {
const executorPackage = target.executor.split(':')[0]; const executorPackage = target.executor.split(':')[0];
const executorNode = `npm:${executorPackage}`; const executorNode = `npm:${executorPackage}`;

View File

@ -13,10 +13,10 @@ import { PackageJson } from '../../utils/package-json';
const skippedFiles = [ const skippedFiles = [
'package.json', // Not to be added to filesets 'package.json', // Not to be added to filesets
'babel.config.json', // Will be handled by various plugins 'babel.config.json', // Will be handled by various plugins
'karma.conf.js', // Will be handled by @nrwl/angular 'karma.conf.js', // Will be handled by @nx/angular
'jest.preset.js', // Will be handled by @nrwl/jest 'jest.preset.js', // Will be handled by @nx/jest
'.storybook', // Will be handled by @nrwl/storybook '.storybook', // Will be handled by @nx/storybook
// Will be handled by @nrwl/linter // Will be handled by @nx/linter
'.eslintrc.json', '.eslintrc.json',
'.eslintrc.js', '.eslintrc.js',
]; ];

View File

@ -149,8 +149,8 @@ export async function addNxToNest(packageJson: PackageJson) {
function addNestPluginToPackageJson(repoRoot: string) { function addNestPluginToPackageJson(repoRoot: string) {
const path = join(repoRoot, `package.json`); const path = join(repoRoot, `package.json`);
const json: PackageJson = readJsonFile(path); const json: PackageJson = readJsonFile(path);
json.devDependencies['@nrwl/nest'] = require('../../package.json').version; json.devDependencies['@nx/nest'] = require('../../package.json').version;
json.devDependencies['@nrwl/jest'] = require('../../package.json').version; json.devDependencies['@nx/jest'] = require('../../package.json').version;
writeJsonFile(path, json); writeJsonFile(path, json);
} }
@ -173,7 +173,7 @@ function createProjectJson(
if (nestCLIOptions.language !== 'js') { if (nestCLIOptions.language !== 'js') {
json.targets['serve'] = { json.targets['serve'] = {
executor: '@nrwl/js:node', executor: '@nx/js:node',
options: { options: {
buildTarget: `${packageName}:build`, buildTarget: `${packageName}:build`,
}, },
@ -183,7 +183,7 @@ function createProjectJson(
if (nestCLIOptions.webpackOptions) { if (nestCLIOptions.webpackOptions) {
json.targets['build'] = { json.targets['build'] = {
executor: '@nrwl/webpack:webpack', executor: '@nx/webpack:webpack',
outputs: ['{options.outputPath}'], outputs: ['{options.outputPath}'],
options: { options: {
target: 'node', target: 'node',
@ -210,7 +210,7 @@ function createProjectJson(
}; };
} else { } else {
json.targets['build'] = { json.targets['build'] = {
executor: '@nrwl/js:tsc', executor: '@nx/js:tsc',
outputs: ['{options.outputPath}'], outputs: ['{options.outputPath}'],
options: { options: {
outputPath: `dist/${packageName}`, outputPath: `dist/${packageName}`,
@ -233,7 +233,7 @@ function createProjectJson(
// lint // lint
json.targets['lint'] = { json.targets['lint'] = {
executor: '@nrwl/linter:eslint', executor: '@nx/linter:eslint',
outputs: ['{options.outputFile}'], outputs: ['{options.outputFile}'],
options: { options: {
lintFilePatterns: ['src/**/*.ts', 'test/**/*.ts'], lintFilePatterns: ['src/**/*.ts', 'test/**/*.ts'],
@ -337,7 +337,7 @@ function addJestTargets(
); );
projectJson.targets['test'] = { projectJson.targets['test'] = {
executor: '@nrwl/jest:jest', executor: '@nx/jest:jest',
outputs: [`{workspaceRoot}/coverage/${packageName}`], outputs: [`{workspaceRoot}/coverage/${packageName}`],
options: { options: {
passWithNoTests: true, passWithNoTests: true,
@ -346,7 +346,7 @@ function addJestTargets(
}; };
projectJson.targets['e2e'] = { projectJson.targets['e2e'] = {
executor: '@nrwl/jest:jest', executor: '@nx/jest:jest',
options: { options: {
passWithNoTests: true, passWithNoTests: true,
jestConfig: e2eTestConfigPath, jestConfig: e2eTestConfigPath,
@ -363,7 +363,7 @@ function addNrwlJsPluginsConfig(repoRoot: string) {
if (!json.pluginsConfig) { if (!json.pluginsConfig) {
json.pluginsConfig = { json.pluginsConfig = {
'@nrwl/js': { '@nx/js': {
analyzeSourceFiles: true, analyzeSourceFiles: true,
} as NrwlJsPluginConfig, } as NrwlJsPluginConfig,
}; };

View File

@ -127,8 +127,8 @@ function addPluginDependencies(): void {
const nxVersion = require('../../../package.json').version; const nxVersion = require('../../../package.json').version;
packageJson.devDependencies ??= {}; packageJson.devDependencies ??= {};
packageJson.devDependencies['@nrwl/angular'] = nxVersion; packageJson.devDependencies['@nx/angular'] = nxVersion;
packageJson.devDependencies['@nrwl/workspace'] = nxVersion; packageJson.devDependencies['@nx/workspace'] = nxVersion;
const peerDepsToInstall = [ const peerDepsToInstall = [
'@angular-devkit/core', '@angular-devkit/core',

View File

@ -3,5 +3,5 @@ import { getPackageManagerCommand } from '../../utils/package-manager';
export function setupIntegratedWorkspace(): void { export function setupIntegratedWorkspace(): void {
const pmc = getPackageManagerCommand(); 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] });
} }

View File

@ -10,7 +10,7 @@ export function setupE2eProject(appName: string) {
}, },
}; };
json.targets['e2e-run'] = { json.targets['e2e-run'] = {
executor: '@nrwl/cypress:cypress', executor: '@nx/cypress:cypress',
options: { options: {
cypressConfig: `apps/${appName}-e2e/cypress.json`, cypressConfig: `apps/${appName}-e2e/cypress.json`,
tsConfig: `apps/${appName}-e2e/tsconfig.e2e.json`, tsConfig: `apps/${appName}-e2e/tsconfig.e2e.json`,

View File

@ -30,8 +30,8 @@ const defaultTsConfigApp = (relativePathToRoot: string) => ({
types: ['node'], types: ['node'],
}, },
files: [ files: [
join(relativePathToRoot, 'node_modules/@nrwl/react/typings/cssmodule.d.ts'), join(relativePathToRoot, 'node_modules/@nx/react/typings/cssmodule.d.ts'),
join(relativePathToRoot, 'node_modules/@nrwl/react/typings/image.d.ts'), join(relativePathToRoot, 'node_modules/@nx/react/typings/image.d.ts'),
], ],
exclude: ['**/*.spec.ts', '**/*.spec.tsx'], exclude: ['**/*.spec.ts', '**/*.spec.tsx'],
include: ['**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx'], include: ['**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx'],
@ -52,8 +52,8 @@ const defaultTsConfigSpec = (relativePathToRoot: string) => ({
'**/*.d.ts', '**/*.d.ts',
], ],
files: [ files: [
join(relativePathToRoot, 'node_modules/@nrwl/react/typings/cssmodule.d.ts'), join(relativePathToRoot, 'node_modules/@nx/react/typings/cssmodule.d.ts'),
join(relativePathToRoot, 'node_modules/@nrwl/react/typings/image.d.ts'), join(relativePathToRoot, 'node_modules/@nx/react/typings/image.d.ts'),
], ],
}); });

View File

@ -55,7 +55,7 @@ export function writeCracoConfig(
}, },
jest: { jest: {
configure: (config) => { configure: (config) => {
config.resolver = '@nrwl/jest/plugins/resolver'; config.resolver = '@nx/jest/plugins/resolver';
return config; return config;
}, },
}, },

View File

@ -59,6 +59,10 @@ function writeLastProcessedLockfileHash(hash: string) {
} }
function jsPluginConfig(nxJson: NxJsonConfiguration): NrwlJsPluginConfig { function jsPluginConfig(nxJson: NxJsonConfiguration): NrwlJsPluginConfig {
if (nxJson?.pluginsConfig?.['@nx/js']) {
return nxJson?.pluginsConfig?.['@nx/js'];
}
if (nxJson?.pluginsConfig?.['@nrwl/js']) { if (nxJson?.pluginsConfig?.['@nrwl/js']) {
return nxJson?.pluginsConfig?.['@nrwl/js']; return nxJson?.pluginsConfig?.['@nrwl/js'];
} }
@ -79,6 +83,13 @@ function jsPluginConfig(nxJson: NxJsonConfiguration): NrwlJsPluginConfig {
...packageJson.devDependencies, ...packageJson.devDependencies,
}; };
if ( 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/workspace'] ||
packageJsonDeps['@nrwl/js'] || packageJsonDeps['@nrwl/js'] ||
packageJsonDeps['@nrwl/node'] || packageJsonDeps['@nrwl/node'] ||

View File

@ -17,27 +17,27 @@ describe('project graph', () => {
beforeEach(async () => { beforeEach(async () => {
packageJson = { packageJson = {
name: '@nrwl/workspace-src', name: '@nx/workspace-src',
version: '0.0.0', version: '0.0.0',
dependencies: { dependencies: {
express: '4.0.0', express: '4.0.0',
'happy-nrwl': '1.0.0', 'happy-nrwl': '1.0.0',
}, },
devDependencies: { devDependencies: {
'@nrwl/workspace': '*', '@nx/workspace': '*',
}, },
}; };
packageLockJson = { packageLockJson = {
name: '@nrwl/workspace-src', name: '@nx/workspace-src',
version: '0.0.0', version: '0.0.0',
lockfileVersion: 2, lockfileVersion: 2,
requires: true, requires: true,
packages: { packages: {
'': packageJson, '': packageJson,
'node_modules/@nrwl/workspace': { 'node_modules/@nx/workspace': {
version: '15.0.0', version: '15.0.0',
resolved: 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==', integrity: 'sha512-12345678==',
dev: true, dev: true,
}, },
@ -57,10 +57,10 @@ describe('project graph', () => {
}, },
}, },
dependencies: { dependencies: {
'@nrwl/workspace': { '@nx/workspace': {
version: '15.0.0', version: '15.0.0',
resolved: 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==', integrity: 'sha512-12345678==',
dev: true, dev: true,
}, },
@ -136,10 +136,10 @@ describe('project graph', () => {
compilerOptions: { compilerOptions: {
baseUrl: '.', baseUrl: '.',
paths: { paths: {
'@nrwl/shared/util': ['libs/shared/util/src/index.ts'], '@nx/shared/util': ['libs/shared/util/src/index.ts'],
'@nrwl/shared-util-data': ['libs/shared/util/data/src/index.ts'], '@nx/shared-util-data': ['libs/shared/util/data/src/index.ts'],
'@nrwl/ui': ['libs/ui/src/index.ts'], '@nx/ui': ['libs/ui/src/index.ts'],
'@nrwl/lazy-lib': ['libs/lazy-lib/src/index.ts'], '@nx/lazy-lib': ['libs/lazy-lib/src/index.ts'],
}, },
}, },
}; };
@ -149,16 +149,16 @@ describe('project graph', () => {
require('express'); require('express');
`, `,
'./apps/demo/src/index.ts': stripIndents` './apps/demo/src/index.ts': stripIndents`
import * as ui from '@nrwl/ui'; import * as ui from '@nx/ui';
import * as data from '@nrwl/shared-util-data; import * as data from '@nx/shared-util-data;
const s = { loadChildren: '@nrwl/lazy-lib#LAZY' } const s = { loadChildren: '@nx/lazy-lib#LAZY' }
`, `,
'./apps/demo-e2e/src/integration/app.spec.ts': stripIndents` './apps/demo-e2e/src/integration/app.spec.ts': stripIndents`
describe('whatever', () => {}); describe('whatever', () => {});
`, `,
'./libs/ui/src/index.ts': stripIndents` './libs/ui/src/index.ts': stripIndents`
import * as util from '@nrwl/shared/util'; import * as util from '@nx/shared/util';
import('@nrwl/lazy-lib'); import('@nx/lazy-lib');
`, `,
'./libs/shared/util/src/index.ts': stripIndents` './libs/shared/util/src/index.ts': stripIndents`
import * as happyNrwl from 'happy-nrwl/a/b/c'; import * as happyNrwl from 'happy-nrwl/a/b/c';
@ -265,7 +265,7 @@ describe('project graph', () => {
it('should handle circular dependencies', async () => { it('should handle circular dependencies', async () => {
tempFs.writeFile( tempFs.writeFile(
'libs/shared/util/src/index.ts', 'libs/shared/util/src/index.ts',
`import * as ui from '@nrwl/ui';` `import * as ui from '@nx/ui';`
); );
const graph = await buildProjectGraph(); const graph = await buildProjectGraph();

View File

@ -39,7 +39,7 @@ describe('nx deps utils', () => {
shouldRecomputeWholeGraph( shouldRecomputeWholeGraph(
createCache({ createCache({
deps: { deps: {
'@nrwl/workspace': '12.0.1', '@nx/workspace': '12.0.1',
plugin: '1.0.0', plugin: '1.0.0',
}, },
}), }),
@ -318,7 +318,7 @@ describe('nx deps utils', () => {
const defaults: ProjectGraphCache = { const defaults: ProjectGraphCache = {
version: '5.1', version: '5.1',
deps: { deps: {
'@nrwl/workspace': '12.0.0', '@nx/workspace': '12.0.0',
plugin: '1.0.0', plugin: '1.0.0',
}, },
pathMappings: { pathMappings: {
@ -337,7 +337,7 @@ describe('nx deps utils', () => {
p: Record<string, string> p: Record<string, string>
): Record<string, string> { ): Record<string, string> {
const defaults = { const defaults = {
'@nrwl/workspace': '12.0.0', '@nx/workspace': '12.0.0',
plugin: '1.0.0', plugin: '1.0.0',
}; };
return { ...defaults, ...p }; return { ...defaults, ...p };

View File

@ -149,7 +149,10 @@ export function shouldRecomputeWholeGraph(
if (cache.version !== '5.1') { if (cache.version !== '5.1') {
return true; 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; return true;
} }
if (cache.deps['nx'] !== packageJsonDeps['nx']) { if (cache.deps['nx'] !== packageJsonDeps['nx']) {

View File

@ -24,7 +24,7 @@ describe('fileutils', () => {
}); });
it('should return false for absolute imports', () => { it('should return false for absolute imports', () => {
expect(isRelativePath('file')).toEqual(false); expect(isRelativePath('file')).toEqual(false);
expect(isRelativePath('@nrwl/angular')).toEqual(false); expect(isRelativePath('@nx/angular')).toEqual(false);
}); });
}); });
}); });

View File

@ -349,9 +349,14 @@ function readPluginMainFromProjectConfiguration(
): string | null { ): string | null {
const { main } = const { main } =
Object.values(plugin.targets).find((x) => 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 || )?.options ||
plugin.targets?.build?.options || plugin.targets?.build?.options ||
{}; {};

View File

@ -32,7 +32,7 @@ describe('params', () => {
it('should use target options', () => { it('should use target options', () => {
const commandLineOpts = {}; const commandLineOpts = {};
const target: TargetConfiguration = { const target: TargetConfiguration = {
executor: '@nrwl/do:stuff', executor: '@nx/do:stuff',
options: { options: {
overriddenOpt: 'target value', overriddenOpt: 'target value',
}, },
@ -58,7 +58,7 @@ describe('params', () => {
it('should combine target, configuration', () => { it('should combine target, configuration', () => {
const commandLineOpts = {}; const commandLineOpts = {};
const target: TargetConfiguration = { const target: TargetConfiguration = {
executor: '@nrwl/do:stuff', executor: '@nx/do:stuff',
options: { options: {
overriddenOpt: 'target value', overriddenOpt: 'target value',
}, },
@ -88,7 +88,7 @@ describe('params', () => {
overriddenOpt: 'command value', overriddenOpt: 'command value',
}; };
const target: TargetConfiguration = { const target: TargetConfiguration = {
executor: '@nrwl/do:stuff', executor: '@nx/do:stuff',
options: { options: {
overriddenOpt: 'target value', overriddenOpt: 'target value',
}, },
@ -118,7 +118,7 @@ describe('params', () => {
overriddenOpt: 'command value', overriddenOpt: 'command value',
}; };
const target: TargetConfiguration = { const target: TargetConfiguration = {
executor: '@nrwl/do:stuff', executor: '@nx/do:stuff',
options: { options: {
overriddenOptAlias: 'target value', overriddenOptAlias: 'target value',
}, },
@ -148,7 +148,7 @@ describe('params', () => {
overriddenOptAlias: 'command value', overriddenOptAlias: 'command value',
}; };
const target: TargetConfiguration = { const target: TargetConfiguration = {
executor: '@nrwl/do:stuff', executor: '@nx/do:stuff',
options: { options: {
overriddenOpt: 'target value', overriddenOpt: 'target value',
}, },
@ -176,7 +176,7 @@ describe('params', () => {
it('should handle targets without options', () => { it('should handle targets without options', () => {
const commandLineOpts = {}; const commandLineOpts = {};
const target: TargetConfiguration = { const target: TargetConfiguration = {
executor: '@nrwl/do:stuff', executor: '@nx/do:stuff',
}; };
const options = combineOptionsForExecutor( const options = combineOptionsForExecutor(

View File

@ -36,9 +36,9 @@ describe('printHelp', () => {
let output = ''; let output = '';
jest.spyOn(logger, 'info').mockImplementation((x) => (output = x)); jest.spyOn(logger, 'info').mockImplementation((x) => (output = x));
printHelp('nx g @nrwl/demo:example', schema, { printHelp('nx g @nx/demo:example', schema, {
mode: 'generate', mode: 'generate',
plugin: '@nrwl/demo', plugin: '@nx/demo',
entity: 'example', entity: 'example',
aliases: ['ex'], aliases: ['ex'],
}); });

View File

@ -107,7 +107,7 @@ function generateGeneratorOverviewOutput({
{ {
text: text:
pluginName + pluginName +
(pluginName.startsWith('@nrwl/') (pluginName.startsWith('@nx/') || pluginName.startsWith('@nrwl/')
? chalk.dim(` (v${nxVersion})`) ? chalk.dim(` (v${nxVersion})`)
: ''), : ''),
padding: [1, 0, 0, 2], padding: [1, 0, 0, 2],
@ -327,13 +327,19 @@ function generateLinkOutput({
name: string; name: string;
type: 'generators' | 'executors'; type: 'generators' | 'executors';
}): string { }): string {
const nxPackagePrefix = '@nx/';
const nrwlPackagePrefix = '@nrwl/'; const nrwlPackagePrefix = '@nrwl/';
if (!pluginName.startsWith(nrwlPackagePrefix)) { if (
!pluginName.startsWith(nxPackagePrefix) &&
!pluginName.startsWith(nrwlPackagePrefix)
) {
return ''; return '';
} }
const link = `https://nx.dev/packages/${pluginName.substring( const link = `https://nx.dev/packages/${pluginName.substring(
nrwlPackagePrefix.length pluginName.startsWith(nxPackagePrefix)
? nxPackagePrefix.length
: nrwlPackagePrefix.length
)}/${type}/${name}`; )}/${type}/${name}`;
return `\n\n${chalk.dim( return `\n\n${chalk.dim(

View File

@ -11,7 +11,7 @@ export function workspaceConfigurationCheck() {
title: 'workspace.json is ignored', title: 'workspace.json is ignored',
bodyLines: [ bodyLines: [
'Nx no longer reads configuration from workspace.json.', '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; return;
@ -27,8 +27,8 @@ export function workspaceConfigurationCheck() {
title: 'angular.json format is incorrect', title: 'angular.json format is incorrect',
bodyLines: [ bodyLines: [
'Nx no longer supports the v2 format of angular.json.', '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)', '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 @nrwl/workspace:fix-configuration --reformat"', 'If you want to preserve angular.json, run "nx g @nx/workspace:fix-configuration --reformat"',
], ],
}); });
process.exit(1); process.exit(1);

View File

@ -25,7 +25,7 @@ export function workspaceRootInner(
// This handles the case where we have a workspace which uses npm / yarn / pnpm // 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. // 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 // thus located in //packages/my-lib/node_modules/nx/package.json
} else if (fileExists(path.join(dir, 'node_modules', 'nx', 'package.json'))) { } else if (fileExists(path.join(dir, 'node_modules', 'nx', 'package.json'))) {
return workspaceRootInner(path.dirname(dir), dir); return workspaceRootInner(path.dirname(dir), dir);

View File

@ -3,7 +3,7 @@
"rules": { "rules": {
"no-restricted-imports": [ "no-restricted-imports": [
"error", "error",
"@nrwl/workspace", "@nx/workspace",
"@angular-devkit/core", "@angular-devkit/core",
"@angular-devkit/architect", "@angular-devkit/architect",
"@angular-devkit/schematics" "@angular-devkit/schematics"

View File

@ -12,7 +12,7 @@
"rules": { "rules": {
"no-restricted-imports": [ "no-restricted-imports": [
"error", "error",
"@nrwl/workspace", "@nx/workspace",
"@angular-devkit/core", "@angular-devkit/core",
"@angular-devkit/architect", "@angular-devkit/architect",
"@angular-devkit/schematics" "@angular-devkit/schematics"

View File

@ -109,7 +109,7 @@ describe('moveProjectConfiguration', () => {
}, },
}, },
test: { test: {
executor: '@nrwl/jest:jest', executor: '@nx/jest:jest',
options: { options: {
jestConfig: 'apps/my-source/jest.config.js', jestConfig: 'apps/my-source/jest.config.js',
tsConfig: 'apps/my-source/tsconfig.spec.json', tsConfig: 'apps/my-source/tsconfig.spec.json',
@ -127,7 +127,7 @@ describe('moveProjectConfiguration', () => {
projectType: 'application', projectType: 'application',
targets: { targets: {
e2e: { e2e: {
executor: '@nrwl/cypress:cypress', executor: '@nx/cypress:cypress',
options: { options: {
cypressConfig: 'apps/my-source-e2e/cypress.json', cypressConfig: 'apps/my-source-e2e/cypress.json',
tsConfig: 'apps/my-source-e2e/tsconfig.e2e.json', tsConfig: 'apps/my-source-e2e/tsconfig.e2e.json',

View File

@ -27,7 +27,7 @@ describe('updateBuildTargets', () => {
root: 'libs/my-source', root: 'libs/my-source',
targets: { targets: {
storybook: { storybook: {
executor: '@nrwl/storybook:storybook', executor: '@nx/storybook:storybook',
}, },
}, },
}); });
@ -76,7 +76,7 @@ describe('updateBuildTargets', () => {
expect(myProject).toBeDefined(); expect(myProject).toBeDefined();
expect(myProject.targets.storybook.executor).toBe( expect(myProject.targets.storybook.executor).toBe(
'@nrwl/storybook:storybook' '@nx/storybook:storybook'
); );
expect(e2eProject).toBeDefined(); expect(e2eProject).toBeDefined();

View File

@ -85,7 +85,7 @@ describe('updateCypressConfig', () => {
'/libs/my-destination/cypress.config.ts', '/libs/my-destination/cypress.config.ts',
` `
import { defineConfig } from 'cypress'; import { defineConfig } from 'cypress';
import { nxE2EPreset } from '@nrwl/cypress/plugins/cypress-preset'; import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset';
export default defineConfig({ export default defineConfig({
e2e: { e2e: {

View File

@ -100,7 +100,7 @@ describe('updateEslint', () => {
}); });
updateJson(tree, 'libs/my-lib/.eslintrc.json', (eslintRcJson) => { updateJson(tree, 'libs/my-lib/.eslintrc.json', (eslintRcJson) => {
eslintRcJson.extends = [ eslintRcJson.extends = [
'plugin:@nrwl/nx/react', 'plugin:@nx/nx/react',
'../../.eslintrc.json', '../../.eslintrc.json',
'./customrc.json', './customrc.json',
]; ];
@ -120,7 +120,7 @@ describe('updateEslint', () => {
).toEqual( ).toEqual(
expect.objectContaining({ expect.objectContaining({
extends: [ extends: [
'plugin:@nrwl/nx/react', 'plugin:@nx/nx/react',
'../../../.eslintrc.json', '../../../.eslintrc.json',
'./customrc.json', './customrc.json',
], ],

View File

@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP // 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 "# Proj
<a alt="Nx logo" href="https://nx.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="45"></a> <a alt="Nx logo" href="https://nx.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="45"></a>
@ -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 "# Proj
<a alt="Nx logo" href="https://nx.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="45"></a> <a alt="Nx logo" href="https://nx.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="45"></a>
@ -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 "# Proj
<a alt="Nx logo" href="https://nx.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="45"></a> <a alt="Nx logo" href="https://nx.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="45"></a>
@ -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 "# Proj
<a alt="Nx logo" href="https://nx.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="45"></a> <a alt="Nx logo" href="https://nx.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="45"></a>
@ -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 "# Proj
<a alt="Nx logo" href="https://nx.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="45"></a> <a alt="Nx logo" href="https://nx.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="45"></a>
@ -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 "# Proj
<a alt="Nx logo" href="https://nx.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="45"></a> <a alt="Nx logo" href="https://nx.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="45"></a>
@ -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 "# Proj
<a alt="Nx logo" href="https://nx.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="45"></a> <a alt="Nx logo" href="https://nx.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="45"></a>
@ -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 "# Proj
<a alt="Nx logo" href="https://nx.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="45"></a> <a alt="Nx logo" href="https://nx.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="45"></a>
@ -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 "# Proj
<a alt="Nx logo" href="https://nx.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="45"></a> <a alt="Nx logo" href="https://nx.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="45"></a>
@ -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 "# Proj
<a alt="Nx logo" href="https://nx.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="45"></a> <a alt="Nx logo" href="https://nx.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="45"></a>
@ -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 "# Proj
<a alt="Nx logo" href="https://nx.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="45"></a> <a alt="Nx logo" href="https://nx.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="45"></a>
@ -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 "# Proj
<a alt="Nx logo" href="https://nx.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="45"></a> <a alt="Nx logo" href="https://nx.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="45"></a>
@ -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 "# Proj
<a alt="Nx logo" href="https://nx.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="45"></a> <a alt="Nx logo" href="https://nx.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="45"></a>
@ -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 "# Proj
<a alt="Nx logo" href="https://nx.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="45"></a> <a alt="Nx logo" href="https://nx.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="45"></a>
@ -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 "# Proj
<a alt="Nx logo" href="https://nx.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="45"></a> <a alt="Nx logo" href="https://nx.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="45"></a>
@ -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 "# Proj
<a alt="Nx logo" href="https://nx.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="45"></a> <a alt="Nx logo" href="https://nx.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="45"></a>
@ -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 "# Proj
<a alt="Nx logo" href="https://nx.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="45"></a> <a alt="Nx logo" href="https://nx.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="45"></a>
@ -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", "nrwl.angular-console",
"esbenp.prettier-vscode", "esbenp.prettier-vscode",
] ]
`; `;
exports[`@nrwl/workspace:generateWorkspaceFiles should recommend vscode extensions 1`] = ` exports[`@nx/workspace:generateWorkspaceFiles should recommend vscode extensions 1`] = `
[ [
"nrwl.angular-console", "nrwl.angular-console",
"esbenp.prettier-vscode", "esbenp.prettier-vscode",

View File

@ -4,7 +4,7 @@ exports[`new --preset should generate necessary npm dependencies for empty prese
{ {
"dependencies": {}, "dependencies": {},
"devDependencies": { "devDependencies": {
"@nrwl/workspace": "0.0.1", "@nx/workspace": "0.0.1",
"nx": "0.0.1", "nx": "0.0.1",
}, },
"license": "MIT", "license": "MIT",

View File

@ -9,6 +9,6 @@
}, },
"devDependencies": { "devDependencies": {
"nx": "<%= nxVersion %>", "nx": "<%= nxVersion %>",
"@nrwl/workspace": "<%= nxVersion %>" "@nx/workspace": "<%= nxVersion %>"
} }
} }

View File

@ -8,7 +8,7 @@
"dependencies": { "dependencies": {
}, },
"devDependencies": { "devDependencies": {
"@nrwl/workspace": "<%= nxVersion %>", "@nx/workspace": "<%= nxVersion %>",
"nx": "<%= nxVersion %>" "nx": "<%= nxVersion %>"
} }
} }

View File

@ -68,7 +68,7 @@ export function generatePreset(host: Tree, opts: NormalizedSchema) {
function getDefaultArgs(opts: NormalizedSchema) { function getDefaultArgs(opts: NormalizedSchema) {
return [ return [
`g`, `g`,
`@nrwl/workspace:preset`, `@nx/workspace:preset`,
`--name=${opts.appName}`, `--name=${opts.appName}`,
opts.style ? `--style=${opts.style}` : null, opts.style ? `--style=${opts.style}` : null,
opts.linter ? `--linter=${opts.linter}` : null, opts.linter ? `--linter=${opts.linter}` : null,
@ -94,12 +94,12 @@ function getPresetDependencies({
}: NormalizedSchema) { }: NormalizedSchema) {
switch (preset) { switch (preset) {
case Preset.TS: case Preset.TS:
return { dependencies: {}, dev: { '@nrwl/js': nxVersion } }; return { dependencies: {}, dev: { '@nx/js': nxVersion } };
case Preset.AngularMonorepo: case Preset.AngularMonorepo:
case Preset.AngularStandalone: case Preset.AngularStandalone:
return { return {
dependencies: { '@nrwl/angular': nxVersion }, dependencies: { '@nx/angular': nxVersion },
dev: { dev: {
'@angular-devkit/core': angularCliVersion, '@angular-devkit/core': angularCliVersion,
typescript: typescriptVersion, typescript: typescriptVersion,
@ -107,44 +107,44 @@ function getPresetDependencies({
}; };
case Preset.Express: case Preset.Express:
return { dependencies: {}, dev: { '@nrwl/express': nxVersion } }; return { dependencies: {}, dev: { '@nx/express': nxVersion } };
case Preset.Nest: case Preset.Nest:
return { return {
dependencies: {}, dependencies: {},
dev: { '@nrwl/nest': nxVersion, typescript: typescriptVersion }, dev: { '@nx/nest': nxVersion, typescript: typescriptVersion },
}; };
case Preset.NextJs: case Preset.NextJs:
return { dependencies: { '@nrwl/next': nxVersion }, dev: {} }; return { dependencies: { '@nx/next': nxVersion }, dev: {} };
case Preset.ReactMonorepo: case Preset.ReactMonorepo:
case Preset.ReactStandalone: case Preset.ReactStandalone:
return { return {
dependencies: {}, dependencies: {},
dev: { dev: {
'@nrwl/react': nxVersion, '@nx/react': nxVersion,
'@nrwl/cypress': nxVersion, '@nx/cypress': nxVersion,
'@nrwl/jest': bundler !== 'vite' ? nxVersion : undefined, '@nx/jest': bundler !== 'vite' ? nxVersion : undefined,
'@nrwl/vite': bundler === 'vite' ? nxVersion : undefined, '@nx/vite': bundler === 'vite' ? nxVersion : undefined,
'@nrwl/webpack': bundler === 'webpack' ? nxVersion : undefined, '@nx/webpack': bundler === 'webpack' ? nxVersion : undefined,
}, },
}; };
case Preset.ReactNative: case Preset.ReactNative:
return { dependencies: {}, dev: { '@nrwl/react-native': nxVersion } }; return { dependencies: {}, dev: { '@nx/react-native': nxVersion } };
case Preset.Expo: case Preset.Expo:
return { dependencies: {}, dev: { '@nrwl/expo': nxVersion } }; return { dependencies: {}, dev: { '@nx/expo': nxVersion } };
case Preset.WebComponents: case Preset.WebComponents:
return { return {
dependencies: {}, dependencies: {},
dev: { '@nrwl/web': nxVersion, typescript: typescriptVersion }, dev: { '@nx/web': nxVersion, typescript: typescriptVersion },
}; };
case Preset.NodeStandalone: case Preset.NodeStandalone:
return { dependencies: {}, dev: { '@nrwl/node': nxVersion } }; return { dependencies: {}, dev: { '@nx/node': nxVersion } };
default: { default: {
return { return {

View File

@ -6,7 +6,7 @@ import { createTree } from '@nx/devkit/testing';
import { Preset } from '../utils/presets'; import { Preset } from '../utils/presets';
import * as nxSchema from '../../../../nx/schemas/nx-schema.json'; import * as nxSchema from '../../../../nx/schemas/nx-schema.json';
describe('@nrwl/workspace:generateWorkspaceFiles', () => { describe('@nx/workspace:generateWorkspaceFiles', () => {
let tree: Tree; let tree: Tree;
beforeEach(() => { beforeEach(() => {

View File

@ -72,10 +72,10 @@ describe('new', () => {
const { devDependencies } = readJson(tree, 'my-workspace/package.json'); const { devDependencies } = readJson(tree, 'my-workspace/package.json');
expect(devDependencies).toStrictEqual({ expect(devDependencies).toStrictEqual({
'@nrwl/react': nxVersion, '@nx/react': nxVersion,
'@nrwl/cypress': nxVersion, '@nx/cypress': nxVersion,
'@nrwl/vite': nxVersion, '@nx/vite': nxVersion,
'@nrwl/workspace': nxVersion, '@nx/workspace': nxVersion,
nx: nxVersion, nx: nxVersion,
}); });
}); });
@ -94,10 +94,10 @@ describe('new', () => {
tree, tree,
'my-workspace/package.json' 'my-workspace/package.json'
); );
expect(dependencies).toStrictEqual({ '@nrwl/angular': nxVersion }); expect(dependencies).toStrictEqual({ '@nx/angular': nxVersion });
expect(devDependencies).toStrictEqual({ expect(devDependencies).toStrictEqual({
'@angular-devkit/core': angularCliVersion, '@angular-devkit/core': angularCliVersion,
'@nrwl/workspace': nxVersion, '@nx/workspace': nxVersion,
nx: nxVersion, nx: nxVersion,
typescript: typescriptVersion, typescript: typescriptVersion,
}); });

View File

@ -9,7 +9,7 @@ import {
import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing';
import { npmPackageGenerator } from './npm-package'; import { npmPackageGenerator } from './npm-package';
describe('@nrwl/workspace:npm-package', () => { describe('@nx/workspace:npm-package', () => {
let tree: Tree; let tree: Tree;
beforeEach(() => { beforeEach(() => {
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' }); tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });

View File

@ -11,26 +11,23 @@ describe('preset', () => {
beforeEach(() => { beforeEach(() => {
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' }); tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
overrideCollectionResolutionForTesting({ overrideCollectionResolutionForTesting({
'@nrwl/workspace': path.join( '@nx/workspace': path.join(
__dirname, __dirname,
'../../../../workspace/generators.json' '../../../../workspace/generators.json'
), ),
'@nrwl/angular': path.join( '@nx/angular': path.join(
__dirname, __dirname,
'../../../../angular/generators.json' '../../../../angular/generators.json'
), ),
'@nrwl/linter': path.join( '@nx/linter': path.join(__dirname, '../../../../linter/generators.json'),
__dirname, '@nx/nest': path.join(__dirname, '../../../../nest/generators.json'),
'../../../../linter/generators.json' '@nx/node': path.join(__dirname, '../../../../node/generators.json'),
), '@nx/jest': path.join(__dirname, '../../../../jest/generators.json'),
'@nrwl/nest': path.join(__dirname, '../../../../nest/generators.json'), '@nx/cypress': path.join(
'@nrwl/node': path.join(__dirname, '../../../../node/generators.json'),
'@nrwl/jest': path.join(__dirname, '../../../../jest/generators.json'),
'@nrwl/cypress': path.join(
__dirname, __dirname,
'../../../../cypress/generators.json' '../../../../cypress/generators.json'
), ),
'@nrwl/express': path.join( '@nx/express': path.join(
__dirname, __dirname,
'../../../../express/generators.json' '../../../../express/generators.json'
), ),

View File

@ -38,7 +38,7 @@ describe('checkTargets', () => {
options: {}, options: {},
}, },
storybook: { storybook: {
executor: '@nrwl/storybook:storybook', executor: '@nx/storybook:storybook',
options: {}, options: {},
}, },
}, },
@ -50,7 +50,7 @@ describe('checkTargets', () => {
sourceRoot: 'apps/storybook/src', sourceRoot: 'apps/storybook/src',
targets: { targets: {
storybook: { storybook: {
executor: '@nrwl/storybook:storybook', executor: '@nx/storybook:storybook',
}, },
}, },
}); });
@ -61,7 +61,7 @@ describe('checkTargets', () => {
projectType: 'application', projectType: 'application',
targets: { targets: {
e2e: { e2e: {
executor: '@nrwl/cypress:cypress', executor: '@nx/cypress:cypress',
options: { options: {
cypressConfig: 'apps/ng-app-e2e/cypress.json', cypressConfig: 'apps/ng-app-e2e/cypress.json',
tsConfig: 'apps/ng-app-e2e/tsconfig.e2e.json', tsConfig: 'apps/ng-app-e2e/tsconfig.e2e.json',

View File

@ -35,7 +35,7 @@ describe('removeProjectReferencesInConfig', () => {
projectType: 'application', projectType: 'application',
targets: { targets: {
e2e: { e2e: {
executor: '@nrwl/cypress:cypress', executor: '@nx/cypress:cypress',
options: { options: {
cypressConfig: 'apps/ng-app-e2e/cypress.json', cypressConfig: 'apps/ng-app-e2e/cypress.json',
tsConfig: 'apps/ng-app-e2e/tsconfig.e2e.json', tsConfig: 'apps/ng-app-e2e/tsconfig.e2e.json',

View File

@ -1,5 +1,5 @@
import { Tree, formatFiles, installPackagesTask } from '@nrwl/devkit'; import { Tree, formatFiles, installPackagesTask } from '@nx/devkit';
import { libraryGenerator } from '@nrwl/js'; import { libraryGenerator } from '@nx/js';
export default async function(tree: Tree, schema: any) { export default async function(tree: Tree, schema: any) {
await libraryGenerator(tree, {name: schema.name}); await libraryGenerator(tree, {name: schema.name});

View File

@ -23,7 +23,7 @@ export default async function (host: Tree, schema: Schema) {
host, host,
{}, {},
{ {
'@nrwl/devkit': nxVersion, '@nx/devkit': nxVersion,
// types/node is neccessary for pnpm since it's used in tsconfig and transitive // types/node is neccessary for pnpm since it's used in tsconfig and transitive
// dependencies are not resolved correctly // dependencies are not resolved correctly
'@types/node': 'latest', '@types/node': 'latest',

View File

@ -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 = { export type DependentBuildableProjectNode = {
name: string; 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( export function calculateProjectDependencies(
projGraph: ProjectGraph, 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( export function createTmpTsConfig(
tsconfigPath: string, 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( export function checkDependentProjectsHaveBeenBuilt(
root: string, 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( export function findMissingBuildDependencies(
root: string, 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( export function updatePaths(
dependencies: DependentBuildableProjectNode[], dependencies: DependentBuildableProjectNode[],
@ -361,7 +361,7 @@ export function updatePaths(
/** /**
* Updates the peerDependencies section in the `dist/lib/xyz/package.json` with * Updates the peerDependencies section in the `dist/lib/xyz/package.json` with
* the proper dependency and version * 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( export function updateBuildableProjectPackageJsonDependencies(
root: string, root: string,

View File

@ -24,7 +24,7 @@ describe('fileutils', () => {
}); });
it('should return false for absolute imports', () => { it('should return false for absolute imports', () => {
expect(isRelativePath('file')).toEqual(false); expect(isRelativePath('file')).toEqual(false);
expect(isRelativePath('@nrwl/angular')).toEqual(false); expect(isRelativePath('@nx/angular')).toEqual(false);
}); });
}); });
}); });

View File

@ -3,7 +3,7 @@ import type { GeneratorCallback } from '@nx/devkit';
/** /**
* Run tasks in serial * 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. * @param tasks The tasks to run in serial.
*/ */
export function runTasksInSerial( export function runTasksInSerial(

View File

@ -93,14 +93,14 @@ import {
} from './ts-config'; } 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) { export function getRelativePathToRootTsConfig(tree: Tree, targetPath: string) {
return _getRelativePathToRootTsConfig(tree, targetPath); 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) { export function getRootTsConfigPathInTree(tree: Tree) {
return _getRootTsConfigPathInTree(tree); return _getRootTsConfigPathInTree(tree);

View File

@ -1,7 +1,7 @@
import type * as ts from 'typescript'; 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[] { export function getSourceNodes(sourceFile: ts.SourceFile): ts.Node[] {
const nodes: ts.Node[] = [sourceFile]; const nodes: ts.Node[] = [sourceFile];

View File

@ -1,12 +1,12 @@
import { checkAndCleanWithSemver as _checkAndCleanWithSemver } from '@nx/devkit/src/utils/semver'; import { checkAndCleanWithSemver as _checkAndCleanWithSemver } from '@nx/devkit/src/utils/semver';
import { logger } from '@nx/devkit'; 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). * 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) { export function checkAndCleanWithSemver(pkgName: string, version: string) {
logger.warn( 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); return _checkAndCleanWithSemver(pkgName, version);
} }

View File

@ -3,7 +3,7 @@ import type { Rule } from '@angular-devkit/schematics';
let installAdded = false; 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( export function addInstallTask(
options: { skipInstall: boolean } = { skipInstall: false } options: { skipInstall: boolean } = { skipInstall: false }

View File

@ -2,7 +2,7 @@ import type { Rule, Tree } from '@angular-devkit/schematics';
/** /**
* Remove a file from the Virtual Schematic Tree * 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 { export function deleteFile(from: string): Rule {
return (host: Tree) => host.delete(from); return (host: Tree) => host.delete(from);

View File

@ -12,7 +12,7 @@ import * as path from 'path';
import { workspaceRoot } from '@nx/devkit'; 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( export function formatFiles(
options: { skipFormat: boolean } = { skipFormat: false }, options: { skipFormat: boolean } = { skipFormat: false },

View File

@ -8,7 +8,7 @@ import {
import ignore, { Ignore } from 'ignore'; 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( export function visitNotIgnoredFiles(
visitor: (file: Path, host: Tree, context: SchematicContext) => void | Rule, visitor: (file: Path, host: Tree, context: SchematicContext) => void | Rule,

View File

@ -22,7 +22,7 @@ const STRING_UNDERSCORE_REGEXP_2 = /-|\s+/g;
``` ```
@method decamelize @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. @param {String} str The string to decamelize.
@return {String} the decamelized string. @return {String} the decamelized string.
*/ */
@ -42,7 +42,7 @@ export function decamelize(str: string): string {
``` ```
@method dasherize @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. @param {String} str The string to dasherize.
@return {String} the dasherized string. @return {String} the dasherized string.
*/ */
@ -62,7 +62,7 @@ export function dasherize(str?: string): string {
``` ```
@method camelize @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. @param {String} str The string to camelize.
@return {String} the camelized string. @return {String} the camelized string.
*/ */
@ -88,7 +88,7 @@ export function camelize(str: string): string {
``` ```
@method classify @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 @param {String} str the string to classify
@return {String} the classified string @return {String} the classified string
*/ */
@ -111,7 +111,7 @@ export function classify(str: string): string {
``` ```
@method underscore @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. @param {String} str The string to underscore.
@return {String} the underscored string. @return {String} the underscored string.
*/ */
@ -133,7 +133,7 @@ export function underscore(str: string): string {
``` ```
@method capitalize @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. @param {String} str The string to capitalize.
@return {String} The capitalized string. @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) { export function group(name: string, group: string | undefined) {
return group ? `${group}/${name}` : name; 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( export function featurePath(
group: boolean | undefined, group: boolean | undefined,

View File

@ -11,7 +11,7 @@ import { ScheduleOptions } from '@angular-devkit/architect/src/api';
import { LoggerApi, LogLevel } from '@angular-devkit/core/src/logger'; 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 { export function getFileContent(tree: Tree, path: string): string {
const fileEntry = tree.get(path); 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 { export function createEmptyWorkspace(tree: Tree): Tree {
_test_addWorkspaceFile('workspace.json', WorkspaceFormat.JSON); _test_addWorkspaceFile('workspace.json', WorkspaceFormat.JSON);
@ -119,7 +119,7 @@ class NoopLogger implements LoggerApi {
/** /**
* Mock context which makes testing builders easier * 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 { export class MockBuilderContext implements BuilderContext {
id: 0; id: 0;

Some files were not shown because too many files have changed in this diff Show More