fix(core): replace @nrwl with @nx in nx core packages (#16344)
This commit is contained in:
parent
df81c0d8d5
commit
4ee1ba56e7
@ -67,7 +67,7 @@ describe('Nx Commands', () => {
|
||||
expect(listOutput).toContain('NX Installed plugins');
|
||||
|
||||
// just check for some, not all
|
||||
expect(listOutput).toContain('@nrwl/workspace');
|
||||
expect(listOutput).toContain('@nx/workspace');
|
||||
|
||||
// temporarily make it look like this isn't installed
|
||||
renameSync(
|
||||
|
||||
@ -3,12 +3,12 @@
|
||||
"rules": {
|
||||
"no-restricted-imports": [
|
||||
"error",
|
||||
"@nrwl/workspace",
|
||||
"@nx/workspace",
|
||||
"@angular-devkit/core",
|
||||
"@angular-devkit/architect",
|
||||
"@angular-devkit/schematics",
|
||||
"nx",
|
||||
"@nrwl/devkit"
|
||||
"@nx/devkit"
|
||||
]
|
||||
},
|
||||
"ignorePatterns": ["!**/*"],
|
||||
|
||||
@ -136,7 +136,7 @@ async function main(parsedArgs: yargs.Arguments<CreateNxPluginArguments>) {
|
||||
});
|
||||
|
||||
const workspaceInfo = await createWorkspace(
|
||||
'@nrwl/nx-plugin',
|
||||
'@nx/nx-plugin',
|
||||
populatedArguments
|
||||
);
|
||||
|
||||
|
||||
@ -3,12 +3,12 @@
|
||||
"rules": {
|
||||
"no-restricted-imports": [
|
||||
"error",
|
||||
"@nrwl/workspace",
|
||||
"@nx/workspace",
|
||||
"@angular-devkit/core",
|
||||
"@angular-devkit/architect",
|
||||
"@angular-devkit/schematics",
|
||||
"nx",
|
||||
"@nrwl/devkit"
|
||||
"@nx/devkit"
|
||||
]
|
||||
},
|
||||
"ignorePatterns": ["!**/*"],
|
||||
|
||||
@ -32,7 +32,7 @@ export async function createSandbox(packageManager: PackageManager) {
|
||||
JSON.stringify({
|
||||
dependencies: {
|
||||
nx: nxVersion,
|
||||
'@nrwl/workspace': nxVersion,
|
||||
'@nx/workspace': nxVersion,
|
||||
},
|
||||
license: 'MIT',
|
||||
})
|
||||
|
||||
@ -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
|
||||
// For first-party presets, it will created by createEmptyWorkspace instead.
|
||||
// In createEmptyWorkspace, it will call `nx new` -> `@nrwl/workspace newGenerator` -> `@nrwl/workspace generatePreset`.
|
||||
// In createEmptyWorkspace, it will call `nx new` -> `@nx/workspace newGenerator` -> `@nx/workspace generatePreset`.
|
||||
const thirdPartyPreset = await getThirdPartyPreset(preset);
|
||||
if (thirdPartyPreset) {
|
||||
await createPreset(thirdPartyPreset, options, packageManager, directory);
|
||||
|
||||
@ -26,7 +26,7 @@ export async function setupCI(
|
||||
try {
|
||||
const pmc = getPackageManagerCommand(packageManager);
|
||||
const res = await execAndWait(
|
||||
`${pmc.exec} nx g @nrwl/workspace:ci-workflow --ci=${ci}`,
|
||||
`${pmc.exec} nx g @nx/workspace:ci-workflow --ci=${ci}`,
|
||||
join(process.cwd(), getFileName(name))
|
||||
);
|
||||
ciSpinner.succeed('CI workflow has been generated successfully');
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import { execSync } from 'child_process';
|
||||
|
||||
/*
|
||||
* Because we don't want to depend on @nrwl/workspace (to speed up the workspace creation)
|
||||
* we duplicate the helper functions from @nrwl/workspace in this file.
|
||||
* Because we don't want to depend on @nx/workspace (to speed up the workspace creation)
|
||||
* we duplicate the helper functions from @nx/workspace in this file.
|
||||
*/
|
||||
export function deduceDefaultBase(): string {
|
||||
const nxDefaultBase = 'main';
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Because we don't want to depend on @nrwl/workspace (to speed up the workspace creation)
|
||||
* we duplicate the helper functions from @nrwl/workspace in this file.
|
||||
* Because we don't want to depend on @nx/workspace (to speed up the workspace creation)
|
||||
* we duplicate the helper functions from @nx/workspace in this file.
|
||||
*/
|
||||
|
||||
import * as chalk from 'chalk';
|
||||
|
||||
@ -3,8 +3,8 @@ import { existsSync, writeFileSync } from 'fs';
|
||||
import { join } from 'path';
|
||||
|
||||
/*
|
||||
* Because we don't want to depend on @nrwl/workspace (to speed up the workspace creation)
|
||||
* we duplicate the helper functions from @nrwl/workspace in this file.
|
||||
* Because we don't want to depend on @nx/workspace (to speed up the workspace creation)
|
||||
* we duplicate the helper functions from @nx/workspace in this file.
|
||||
*/
|
||||
|
||||
export const packageManagerList = ['pnpm', 'yarn', 'npm'] as const;
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
"error",
|
||||
{
|
||||
"paths": [
|
||||
"@nrwl/workspace",
|
||||
"@nx/workspace",
|
||||
"@angular-devkit/core",
|
||||
"@angular-devkit/architect",
|
||||
"@angular-devkit/schematics"
|
||||
@ -17,7 +17,7 @@
|
||||
"allowTypeImports": true
|
||||
},
|
||||
{
|
||||
"group": ["@nrwl/devkit/**/*"],
|
||||
"group": ["@nx/devkit/**/*"],
|
||||
"message": "Use a relative import"
|
||||
}
|
||||
]
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/**
|
||||
* Note to developers: STOP! This is the Public API of @nrwl/devkit.
|
||||
* @nrwl/devkit should be compatible with versions of Nx 1 major version prior.
|
||||
* This is so that plugins can use the latest @nrwl/devkit while their users may use versions +/- 1 of Nx.
|
||||
* Note to developers: STOP! This is the Public API of @nx/devkit.
|
||||
* @nx/devkit should be compatible with versions of Nx 1 major version prior.
|
||||
* This is so that plugins can use the latest @nx/devkit while their users may use versions +/- 1 of Nx.
|
||||
*
|
||||
* 1. Try hard to not add to this API to reduce the surface area we need to maintain.
|
||||
* 2. Do not add newly created paths from the nx package to this file as they will not be available in older versions of Nx.
|
||||
|
||||
@ -77,12 +77,12 @@ describe('addDependenciesToPackageJson', () => {
|
||||
tree,
|
||||
{},
|
||||
{
|
||||
'@nrwl/react': 'latest',
|
||||
'@nx/react': 'latest',
|
||||
}
|
||||
);
|
||||
expect(readJson(tree, 'package.json').devDependencies).toEqual({
|
||||
jest: 'latest',
|
||||
'@nrwl/react': 'latest',
|
||||
'@nx/react': 'latest',
|
||||
});
|
||||
expect(installTask).toBeDefined();
|
||||
});
|
||||
@ -105,10 +105,10 @@ describe('addDependenciesToPackageJson', () => {
|
||||
// ARRANGE
|
||||
writeJson(tree, 'package.json', {
|
||||
dependencies: {
|
||||
'@nrwl/angular': 'latest',
|
||||
'@nx/angular': 'latest',
|
||||
},
|
||||
devDependencies: {
|
||||
'@nrwl/next': 'latest',
|
||||
'@nx/next': 'latest',
|
||||
},
|
||||
});
|
||||
|
||||
@ -116,20 +116,20 @@ describe('addDependenciesToPackageJson', () => {
|
||||
const installTask = addDependenciesToPackageJson(
|
||||
tree,
|
||||
{
|
||||
'@nrwl/next': 'next',
|
||||
'@nx/next': 'next',
|
||||
},
|
||||
{
|
||||
'@nrwl/angular': 'next',
|
||||
'@nx/angular': 'next',
|
||||
}
|
||||
);
|
||||
|
||||
// ASSERT
|
||||
const { dependencies, devDependencies } = readJson(tree, 'package.json');
|
||||
expect(dependencies).toEqual({
|
||||
'@nrwl/angular': 'next',
|
||||
'@nx/angular': 'next',
|
||||
});
|
||||
expect(devDependencies).toEqual({
|
||||
'@nrwl/next': 'next',
|
||||
'@nx/next': 'next',
|
||||
});
|
||||
expect(installTask).toBeDefined();
|
||||
});
|
||||
@ -138,10 +138,10 @@ describe('addDependenciesToPackageJson', () => {
|
||||
// ARRANGE
|
||||
writeJson(tree, 'package.json', {
|
||||
dependencies: {
|
||||
'@nrwl/angular': 'next',
|
||||
'@nx/angular': 'next',
|
||||
},
|
||||
devDependencies: {
|
||||
'@nrwl/next': 'next',
|
||||
'@nx/next': 'next',
|
||||
},
|
||||
});
|
||||
|
||||
@ -149,20 +149,20 @@ describe('addDependenciesToPackageJson', () => {
|
||||
const installTask = addDependenciesToPackageJson(
|
||||
tree,
|
||||
{
|
||||
'@nrwl/next': 'latest',
|
||||
'@nx/next': 'latest',
|
||||
},
|
||||
{
|
||||
'@nrwl/angular': 'latest',
|
||||
'@nx/angular': 'latest',
|
||||
}
|
||||
);
|
||||
|
||||
// ASSERT
|
||||
const { dependencies, devDependencies } = readJson(tree, 'package.json');
|
||||
expect(dependencies).toEqual({
|
||||
'@nrwl/angular': 'next',
|
||||
'@nx/angular': 'next',
|
||||
});
|
||||
expect(devDependencies).toEqual({
|
||||
'@nrwl/next': 'next',
|
||||
'@nx/next': 'next',
|
||||
});
|
||||
expect(installTask).toBeDefined();
|
||||
});
|
||||
@ -171,10 +171,10 @@ describe('addDependenciesToPackageJson', () => {
|
||||
// ARRANGE
|
||||
writeJson(tree, 'package.json', {
|
||||
dependencies: {
|
||||
'@nrwl/angular': '14.0.0',
|
||||
'@nx/angular': '14.0.0',
|
||||
},
|
||||
devDependencies: {
|
||||
'@nrwl/next': '14.0.0',
|
||||
'@nx/next': '14.0.0',
|
||||
},
|
||||
});
|
||||
|
||||
@ -182,20 +182,20 @@ describe('addDependenciesToPackageJson', () => {
|
||||
const installTask = addDependenciesToPackageJson(
|
||||
tree,
|
||||
{
|
||||
'@nrwl/next': '14.1.0',
|
||||
'@nx/next': '14.1.0',
|
||||
},
|
||||
{
|
||||
'@nrwl/angular': '14.1.0',
|
||||
'@nx/angular': '14.1.0',
|
||||
}
|
||||
);
|
||||
|
||||
// ASSERT
|
||||
const { dependencies, devDependencies } = readJson(tree, 'package.json');
|
||||
expect(dependencies).toEqual({
|
||||
'@nrwl/angular': '14.1.0',
|
||||
'@nx/angular': '14.1.0',
|
||||
});
|
||||
expect(devDependencies).toEqual({
|
||||
'@nrwl/next': '14.1.0',
|
||||
'@nx/next': '14.1.0',
|
||||
});
|
||||
expect(installTask).toBeDefined();
|
||||
});
|
||||
@ -204,10 +204,10 @@ describe('addDependenciesToPackageJson', () => {
|
||||
// ARRANGE
|
||||
writeJson(tree, 'package.json', {
|
||||
dependencies: {
|
||||
'@nrwl/angular': '14.1.0',
|
||||
'@nx/angular': '14.1.0',
|
||||
},
|
||||
devDependencies: {
|
||||
'@nrwl/next': '14.1.0',
|
||||
'@nx/next': '14.1.0',
|
||||
},
|
||||
});
|
||||
|
||||
@ -215,20 +215,20 @@ describe('addDependenciesToPackageJson', () => {
|
||||
const installTask = addDependenciesToPackageJson(
|
||||
tree,
|
||||
{
|
||||
'@nrwl/next': '14.0.0',
|
||||
'@nx/next': '14.0.0',
|
||||
},
|
||||
{
|
||||
'@nrwl/angular': '14.0.0',
|
||||
'@nx/angular': '14.0.0',
|
||||
}
|
||||
);
|
||||
|
||||
// ASSERT
|
||||
const { dependencies, devDependencies } = readJson(tree, 'package.json');
|
||||
expect(dependencies).toEqual({
|
||||
'@nrwl/angular': '14.1.0',
|
||||
'@nx/angular': '14.1.0',
|
||||
});
|
||||
expect(devDependencies).toEqual({
|
||||
'@nrwl/next': '14.1.0',
|
||||
'@nx/next': '14.1.0',
|
||||
});
|
||||
expect(installTask).toBeDefined();
|
||||
});
|
||||
@ -237,12 +237,12 @@ describe('addDependenciesToPackageJson', () => {
|
||||
// ARRANGE
|
||||
writeJson(tree, 'package.json', {
|
||||
dependencies: {
|
||||
'@nrwl/angular': '14.2.0',
|
||||
'@nrwl/cypress': '14.1.1',
|
||||
'@nx/angular': '14.2.0',
|
||||
'@nx/cypress': '14.1.1',
|
||||
},
|
||||
devDependencies: {
|
||||
'@nrwl/next': '14.0.0',
|
||||
'@nrwl/vite': '14.1.0',
|
||||
'@nx/next': '14.0.0',
|
||||
'@nx/vite': '14.1.0',
|
||||
},
|
||||
});
|
||||
|
||||
@ -250,22 +250,22 @@ describe('addDependenciesToPackageJson', () => {
|
||||
const installTask = addDependenciesToPackageJson(
|
||||
tree,
|
||||
{
|
||||
'@nrwl/angular': '14.1.0',
|
||||
'@nx/angular': '14.1.0',
|
||||
},
|
||||
{
|
||||
'@nrwl/next': '14.1.0',
|
||||
'@nx/next': '14.1.0',
|
||||
}
|
||||
);
|
||||
|
||||
// ASSERT
|
||||
const { dependencies, devDependencies } = readJson(tree, 'package.json');
|
||||
expect(dependencies).toEqual({
|
||||
'@nrwl/angular': '14.2.0',
|
||||
'@nrwl/cypress': '14.1.1',
|
||||
'@nx/angular': '14.2.0',
|
||||
'@nx/cypress': '14.1.1',
|
||||
});
|
||||
expect(devDependencies).toEqual({
|
||||
'@nrwl/next': '14.1.0',
|
||||
'@nrwl/vite': '14.1.0',
|
||||
'@nx/next': '14.1.0',
|
||||
'@nx/vite': '14.1.0',
|
||||
});
|
||||
expect(installTask).toBeDefined();
|
||||
});
|
||||
@ -274,12 +274,12 @@ describe('addDependenciesToPackageJson', () => {
|
||||
// ARRANGE
|
||||
writeJson(tree, 'package.json', {
|
||||
dependencies: {
|
||||
'@nrwl/angular': '14.0.0',
|
||||
'@nrwl/cypress': '14.1.1',
|
||||
'@nx/angular': '14.0.0',
|
||||
'@nx/cypress': '14.1.1',
|
||||
},
|
||||
devDependencies: {
|
||||
'@nrwl/next': '14.2.0',
|
||||
'@nrwl/vite': '14.1.0',
|
||||
'@nx/next': '14.2.0',
|
||||
'@nx/vite': '14.1.0',
|
||||
},
|
||||
});
|
||||
|
||||
@ -287,22 +287,22 @@ describe('addDependenciesToPackageJson', () => {
|
||||
const installTask = addDependenciesToPackageJson(
|
||||
tree,
|
||||
{
|
||||
'@nrwl/angular': '14.1.0',
|
||||
'@nx/angular': '14.1.0',
|
||||
},
|
||||
{
|
||||
'@nrwl/next': '14.1.0',
|
||||
'@nx/next': '14.1.0',
|
||||
}
|
||||
);
|
||||
|
||||
// ASSERT
|
||||
const { dependencies, devDependencies } = readJson(tree, 'package.json');
|
||||
expect(dependencies).toEqual({
|
||||
'@nrwl/angular': '14.1.0',
|
||||
'@nrwl/cypress': '14.1.1',
|
||||
'@nx/angular': '14.1.0',
|
||||
'@nx/cypress': '14.1.1',
|
||||
});
|
||||
expect(devDependencies).toEqual({
|
||||
'@nrwl/next': '14.2.0',
|
||||
'@nrwl/vite': '14.1.0',
|
||||
'@nx/next': '14.2.0',
|
||||
'@nx/vite': '14.1.0',
|
||||
});
|
||||
expect(installTask).toBeDefined();
|
||||
});
|
||||
@ -311,10 +311,10 @@ describe('addDependenciesToPackageJson', () => {
|
||||
// ARRANGE
|
||||
writeJson(tree, 'package.json', {
|
||||
dependencies: {
|
||||
'@nrwl/angular': '14.0.0',
|
||||
'@nx/angular': '14.0.0',
|
||||
},
|
||||
devDependencies: {
|
||||
'@nrwl/next': '14.1.0',
|
||||
'@nx/next': '14.1.0',
|
||||
},
|
||||
});
|
||||
|
||||
@ -322,20 +322,20 @@ describe('addDependenciesToPackageJson', () => {
|
||||
const installTask = addDependenciesToPackageJson(
|
||||
tree,
|
||||
{
|
||||
'@nrwl/next': '14.0.0',
|
||||
'@nx/next': '14.0.0',
|
||||
},
|
||||
{
|
||||
'@nrwl/angular': '14.1.0',
|
||||
'@nx/angular': '14.1.0',
|
||||
}
|
||||
);
|
||||
|
||||
// ASSERT
|
||||
const { dependencies, devDependencies } = readJson(tree, 'package.json');
|
||||
expect(dependencies).toEqual({
|
||||
'@nrwl/angular': '14.1.0',
|
||||
'@nx/angular': '14.1.0',
|
||||
});
|
||||
expect(devDependencies).toEqual({
|
||||
'@nrwl/next': '14.1.0',
|
||||
'@nx/next': '14.1.0',
|
||||
});
|
||||
expect(installTask).toBeDefined();
|
||||
});
|
||||
@ -344,11 +344,11 @@ describe('addDependenciesToPackageJson', () => {
|
||||
// ARRANGE
|
||||
writeJson(tree, 'package.json', {
|
||||
dependencies: {
|
||||
'@nrwl/angular': 'github:reponame/packageNameOne',
|
||||
'@nrwl/vite': 'git://github.com/npm/cli.git#v14.2.0', // this format is parsable
|
||||
'@nx/angular': 'github:reponame/packageNameOne',
|
||||
'@nx/vite': 'git://github.com/npm/cli.git#v14.2.0', // this format is parsable
|
||||
},
|
||||
devDependencies: {
|
||||
'@nrwl/next': '14.1.0',
|
||||
'@nx/next': '14.1.0',
|
||||
},
|
||||
});
|
||||
|
||||
@ -356,26 +356,25 @@ describe('addDependenciesToPackageJson', () => {
|
||||
const installTask = addDependenciesToPackageJson(
|
||||
tree,
|
||||
{
|
||||
'@nrwl/next': 'github:reponame/packageNameTwo',
|
||||
'@nrwl/cypress':
|
||||
'@nx/next': 'github:reponame/packageNameTwo',
|
||||
'@nx/cypress':
|
||||
'git+https://username@github.com/reponame/packagename.git',
|
||||
'@nrwl/vite': '14.0.1',
|
||||
'@nx/vite': '14.0.1',
|
||||
},
|
||||
{
|
||||
'@nrwl/angular': '14.1.0',
|
||||
'@nx/angular': '14.1.0',
|
||||
}
|
||||
);
|
||||
|
||||
// ASSERT
|
||||
const { dependencies, devDependencies } = readJson(tree, 'package.json');
|
||||
expect(dependencies).toEqual({
|
||||
'@nrwl/angular': '14.1.0',
|
||||
'@nrwl/cypress':
|
||||
'git+https://username@github.com/reponame/packagename.git',
|
||||
'@nrwl/vite': 'git://github.com/npm/cli.git#v14.2.0',
|
||||
'@nx/angular': '14.1.0',
|
||||
'@nx/cypress': 'git+https://username@github.com/reponame/packagename.git',
|
||||
'@nx/vite': 'git://github.com/npm/cli.git#v14.2.0',
|
||||
});
|
||||
expect(devDependencies).toEqual({
|
||||
'@nrwl/next': 'github:reponame/packageNameTwo',
|
||||
'@nx/next': 'github:reponame/packageNameTwo',
|
||||
});
|
||||
expect(installTask).toBeDefined();
|
||||
});
|
||||
@ -384,10 +383,10 @@ describe('addDependenciesToPackageJson', () => {
|
||||
// ARRANGE
|
||||
writeJson(tree, 'package.json', {
|
||||
dependencies: {
|
||||
'@nrwl/angular': 'latest',
|
||||
'@nx/angular': 'latest',
|
||||
},
|
||||
devDependencies: {
|
||||
'@nrwl/next': 'latest',
|
||||
'@nx/next': 'latest',
|
||||
},
|
||||
});
|
||||
|
||||
@ -395,22 +394,22 @@ describe('addDependenciesToPackageJson', () => {
|
||||
const installTask = addDependenciesToPackageJson(
|
||||
tree,
|
||||
{
|
||||
'@nrwl/next': 'next',
|
||||
'@nrwl/cypress': 'latest',
|
||||
'@nx/next': 'next',
|
||||
'@nx/cypress': 'latest',
|
||||
},
|
||||
{
|
||||
'@nrwl/angular': 'next',
|
||||
'@nx/angular': 'next',
|
||||
}
|
||||
);
|
||||
|
||||
// ASSERT
|
||||
const { dependencies, devDependencies } = readJson(tree, 'package.json');
|
||||
expect(dependencies).toEqual({
|
||||
'@nrwl/angular': 'next',
|
||||
'@nrwl/cypress': 'latest',
|
||||
'@nx/angular': 'next',
|
||||
'@nx/cypress': 'latest',
|
||||
});
|
||||
expect(devDependencies).toEqual({
|
||||
'@nrwl/next': 'next',
|
||||
'@nx/next': 'next',
|
||||
});
|
||||
expect(installTask).toBeDefined();
|
||||
});
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
"@angular-devkit/architect",
|
||||
"@angular-devkit/core",
|
||||
"@angular-devkit/schematics",
|
||||
"@nrwl/workspace"
|
||||
"@nx/workspace"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "nx/plugin",
|
||||
"version": "0.1",
|
||||
"extends": ["@nrwl/workspace"],
|
||||
"extends": ["@nx/workspace"],
|
||||
"generators": {
|
||||
"plugin": {
|
||||
"factory": "./src/generators/plugin/plugin",
|
||||
|
||||
@ -12,7 +12,7 @@ import { JestExecutorOptions } from '@nx/jest/src/executors/jest/schema';
|
||||
import { jestExecutor } from '@nx/jest/src/executors/jest/jest.impl';
|
||||
import type { NxPluginE2EExecutorOptions } from './schema';
|
||||
|
||||
// TODO(Caleb & Craigory): can we get rid of this and just use @nrwl/jest directly?
|
||||
// TODO(Caleb & Craigory): can we get rid of this and just use @nx/jest directly?
|
||||
export async function* nxPluginE2EExecutor(
|
||||
options: NxPluginE2EExecutorOptions,
|
||||
context: ExecutorContext
|
||||
|
||||
@ -116,7 +116,7 @@ describe('NxPlugin e2e-project Generator', () => {
|
||||
expect(project.root).toEqual('apps/my-plugin-e2e');
|
||||
expect(project.targets.e2e).toBeTruthy();
|
||||
expect(project.targets.e2e).toMatchObject({
|
||||
executor: '@nrwl/nx-plugin:e2e',
|
||||
executor: '@nx/nx-plugin:e2e',
|
||||
options: expect.objectContaining({ target: 'my-plugin:build' }),
|
||||
});
|
||||
});
|
||||
|
||||
@ -78,7 +78,7 @@ function updateWorkspaceConfiguration(host: Tree, options: NormalizedSchema) {
|
||||
sourceRoot: `${options.projectRoot}/src`,
|
||||
targets: {
|
||||
e2e: {
|
||||
executor: '@nrwl/nx-plugin:e2e',
|
||||
executor: '@nx/nx-plugin:e2e',
|
||||
options: { target: `${options.pluginName}:build` },
|
||||
},
|
||||
},
|
||||
|
||||
@ -4,7 +4,7 @@ import {
|
||||
readJson,
|
||||
runNxCommandAsync,
|
||||
uniq,
|
||||
} from '@nrwl/nx-plugin/testing';
|
||||
} from '@nx/nx-plugin/testing';
|
||||
|
||||
describe('<%= pluginName %> e2e', () => {
|
||||
// Setting up individual workspaces per
|
||||
|
||||
@ -150,7 +150,7 @@ describe('NxPlugin Executor Generator', () => {
|
||||
.read('libs/my-plugin/src/executors/my-executor/hasher.ts')
|
||||
.toString()
|
||||
).toMatchInlineSnapshot(`
|
||||
"import { CustomHasher } from '@nrwl/devkit';
|
||||
"import { CustomHasher } from '@nx/devkit';
|
||||
|
||||
/**
|
||||
* This is a boilerplate custom hasher that matches
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Hasher, HasherContext } from '@nrwl/devkit';
|
||||
import { Hasher, HasherContext } from '@nx/devkit';
|
||||
|
||||
import { <%=propertyName%>Hasher } from './hasher';
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { CustomHasher } from '@nrwl/devkit';
|
||||
import { CustomHasher } from '@nx/devkit';
|
||||
|
||||
/**
|
||||
* This is a boilerplate custom hasher that matches
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing';
|
||||
import { Tree, readProjectConfiguration } from '@nrwl/devkit';
|
||||
import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing';
|
||||
import { Tree, readProjectConfiguration } from '@nx/devkit';
|
||||
|
||||
import generator from './generator';
|
||||
import { <%= className %>GeneratorSchema } from './schema';
|
||||
|
||||
@ -6,7 +6,7 @@ import {
|
||||
names,
|
||||
offsetFromRoot,
|
||||
Tree,
|
||||
} from '@nrwl/devkit';
|
||||
} from '@nx/devkit';
|
||||
import * as path from 'path';
|
||||
import { <%= className %>GeneratorSchema } from './schema';
|
||||
|
||||
|
||||
@ -107,7 +107,9 @@ export function addMigrationJsonChecks(
|
||||
host,
|
||||
`${projectConfiguration.root}/.eslintrc.json`,
|
||||
(c) => {
|
||||
const override = c.overrides.find((o) =>
|
||||
const override = c.overrides.find(
|
||||
(o) =>
|
||||
Object.keys(o.rules ?? {})?.includes('@nx/nx/nx-plugin-checks') ||
|
||||
Object.keys(o.rules ?? {})?.includes('@nrwl/nx/nx-plugin-checks')
|
||||
);
|
||||
if (
|
||||
@ -133,7 +135,10 @@ function updateProjectTarget(
|
||||
}
|
||||
|
||||
for (const [target, configuration] of Object.entries(project.targets)) {
|
||||
if (configuration.executor === '@nrwl/linter:eslint') {
|
||||
if (
|
||||
configuration.executor === '@nx/linter:eslint' ||
|
||||
configuration.executor === '@nrwl/linter:eslint'
|
||||
) {
|
||||
const opts: EsLintExecutorOptions = configuration.options ?? {};
|
||||
opts.lintFilePatterns ??= [];
|
||||
|
||||
@ -182,7 +187,9 @@ function updateProjectEslintConfig(
|
||||
const eslintConfig = readJson<ESLint.Config>(host, eslintPath);
|
||||
eslintConfig.overrides ??= [];
|
||||
if (
|
||||
!eslintConfig.overrides.some((x) =>
|
||||
!eslintConfig.overrides.some(
|
||||
(x) =>
|
||||
Object.keys(x.rules ?? {}).includes('@nx/nx/nx-plugin-checks') ||
|
||||
Object.keys(x.rules ?? {}).includes('@nrwl/nx/nx-plugin-checks')
|
||||
)
|
||||
) {
|
||||
@ -254,6 +261,7 @@ export function getEsLintOptions(
|
||||
project: ProjectConfiguration
|
||||
): [target: string, configuration: TargetConfiguration<EsLintExecutorOptions>] {
|
||||
return Object.entries(project.targets || {}).find(
|
||||
([, x]) => x.executor === '@nrwl/linter:eslint'
|
||||
([, x]) =>
|
||||
x.executor === '@nx/linter:eslint' || x.executor === '@nrwl/linter:eslint'
|
||||
);
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||
import { Tree } from '@nrwl/devkit';
|
||||
import { Tree } from '@nx/devkit';
|
||||
|
||||
export default function update(host: Tree) {
|
||||
// ...
|
||||
|
||||
@ -101,12 +101,13 @@ export async function pluginGenerator(host: Tree, schema: Schema) {
|
||||
addDependenciesToPackageJson(
|
||||
host,
|
||||
{
|
||||
'@nrwl/devkit': nxVersion,
|
||||
'@nx/devkit': nxVersion,
|
||||
tslib: tsLibVersion,
|
||||
},
|
||||
{
|
||||
'@nrwl/jest': nxVersion,
|
||||
'@nrwl/js': nxVersion,
|
||||
'@nx/jest': nxVersion,
|
||||
'@nx/js': nxVersion,
|
||||
'@nx/nx-plugin': nxVersion,
|
||||
'@swc-node/register': swcNodeVersion,
|
||||
}
|
||||
);
|
||||
|
||||
@ -37,9 +37,9 @@ function removeNpmScope(tree: Tree) {
|
||||
}
|
||||
function moveNxPluginToDevDeps(tree: Tree) {
|
||||
updateJson<PackageJson>(tree, 'package.json', (json) => {
|
||||
const nxPluginEntry = json.dependencies['@nrwl/nx-plugin'];
|
||||
delete json.dependencies['@nrwl/nx-plugin'];
|
||||
json.devDependencies['@nrwl/nx-plugin'] = nxPluginEntry;
|
||||
const nxPluginEntry = json.dependencies['@nx/nx-plugin'];
|
||||
delete json.dependencies['@nx/nx-plugin'];
|
||||
json.devDependencies['@nx/nx-plugin'] = nxPluginEntry;
|
||||
return json;
|
||||
});
|
||||
}
|
||||
|
||||
@ -15,7 +15,7 @@ function runNxNewCommand(args?: string, silent?: boolean) {
|
||||
return execSync(
|
||||
`node ${require.resolve(
|
||||
'nx'
|
||||
)} new proj --nx-workspace-root=${localTmpDir} --no-interactive --skip-install --collection=@nrwl/workspace --npmScope=proj --preset=empty ${
|
||||
)} new proj --nx-workspace-root=${localTmpDir} --no-interactive --skip-install --collection=@nx/workspace --npmScope=proj --preset=empty ${
|
||||
args || ''
|
||||
}`,
|
||||
{
|
||||
@ -76,7 +76,7 @@ export function newNxProject(
|
||||
|
||||
/**
|
||||
* Ensures that a project has been setup in the e2e directory
|
||||
* It will also copy `@nrwl` packages to the e2e directory
|
||||
* It will also copy `@nx` packages to the e2e directory
|
||||
*/
|
||||
export function ensureNxProject(
|
||||
npmPackageName?: string,
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
# `nx-darwin-arm64`
|
||||
|
||||
This is the **aarch64-apple-darwin** binary for `@nrwl/nx`
|
||||
This is the **aarch64-apple-darwin** binary for `@nx/nx`
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
# `nx-darwin-x64`
|
||||
|
||||
This is the **x86_64-apple-darwin** binary for `@nrwl/nx`
|
||||
This is the **x86_64-apple-darwin** binary for `@nx/nx`
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
# `nx-linux-arm-gnueabihf`
|
||||
|
||||
This is the **armv7-unknown-linux-gnueabihf** binary for `@nrwl/nx`
|
||||
This is the **armv7-unknown-linux-gnueabihf** binary for `@nx/nx`
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
# `nx-linux-arm64-gnu`
|
||||
|
||||
This is the **aarch64-unknown-linux-gnu** binary for `@nrwl/nx`
|
||||
This is the **aarch64-unknown-linux-gnu** binary for `@nx/nx`
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
# `nx-linux-arm64-musl`
|
||||
|
||||
This is the **aarch64-unknown-linux-musl** binary for `@nrwl/nx`
|
||||
This is the **aarch64-unknown-linux-musl** binary for `@nx/nx`
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
# `nx-linux-x64-gnu`
|
||||
|
||||
This is the **x86_64-unknown-linux-gnu** binary for `@nrwl/nx`
|
||||
This is the **x86_64-unknown-linux-gnu** binary for `@nx/nx`
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
# `nx-linux-x64-musl`
|
||||
|
||||
This is the **x86_64-unknown-linux-musl** binary for `@nrwl/nx`
|
||||
This is the **x86_64-unknown-linux-musl** binary for `@nx/nx`
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
# `nx-win32-arm64-msvc`
|
||||
|
||||
This is the **aarch64-pc-windows-msvc** binary for `@nrwl/nx`
|
||||
This is the **aarch64-pc-windows-msvc** binary for `@nx/nx`
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
# `nx-win32-x64-msvc`
|
||||
|
||||
This is the **x86_64-pc-windows-msvc** binary for `@nrwl/nx`
|
||||
This is the **x86_64-pc-windows-msvc** binary for `@nx/nx`
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
}
|
||||
},
|
||||
"pluginsConfig": {
|
||||
"@nrwl/js": {
|
||||
"@nx/js": {
|
||||
"analyzeSourceFiles": false
|
||||
}
|
||||
}
|
||||
|
||||
@ -17,8 +17,8 @@ export function shouldMergeAngularProjects(
|
||||
// Include projects from angular.json if explicitly required.
|
||||
// e.g. when invoked from `packages/devkit/src/utils/convert-nx-executor.ts`
|
||||
(includeProjectsFromAngularJson ||
|
||||
// Or if a workspace has `@nrwl/angular` installed then projects from `angular.json` to be considered by Nx.
|
||||
isNrwlAngularInstalled())
|
||||
// Or if a workspace has `@nrwl/angular`/`@nx/angular` installed then projects from `angular.json` to be considered by Nx.
|
||||
isAngularPluginInstalled())
|
||||
) {
|
||||
return true;
|
||||
} else {
|
||||
@ -26,7 +26,7 @@ export function shouldMergeAngularProjects(
|
||||
}
|
||||
}
|
||||
|
||||
function isNrwlAngularInstalled() {
|
||||
function isAngularPluginInstalled() {
|
||||
try {
|
||||
require.resolve('@nx/angular');
|
||||
return true;
|
||||
|
||||
@ -506,8 +506,7 @@ describe('Migration', () => {
|
||||
it('should not throw when packages are missing', async () => {
|
||||
const migrator = new Migrator({
|
||||
packageJson: createPackageJson(),
|
||||
getInstalledPackageVersion: (p) =>
|
||||
p === '@nrwl/nest' ? null : '1.0.0',
|
||||
getInstalledPackageVersion: (p) => (p === '@nx/nest' ? null : '1.0.0'),
|
||||
fetch: (_p, _v) =>
|
||||
Promise.resolve({
|
||||
version: '2.0.0',
|
||||
@ -516,16 +515,15 @@ describe('Migration', () => {
|
||||
from: {},
|
||||
to: {},
|
||||
});
|
||||
await migrator.migrate('@nrwl/workspace', '2.0.0');
|
||||
await migrator.migrate('@nx/workspace', '2.0.0');
|
||||
});
|
||||
|
||||
it('should only fetch packages that are installed', async () => {
|
||||
const migrator = new Migrator({
|
||||
packageJson: createPackageJson(),
|
||||
getInstalledPackageVersion: (p) =>
|
||||
p === '@nrwl/nest' ? null : '1.0.0',
|
||||
getInstalledPackageVersion: (p) => (p === '@nx/nest' ? null : '1.0.0'),
|
||||
fetch: (p, _v) => {
|
||||
if (p === '@nrwl/nest') {
|
||||
if (p === '@nx/nest') {
|
||||
throw new Error('Boom');
|
||||
}
|
||||
return Promise.resolve({
|
||||
@ -536,7 +534,7 @@ describe('Migration', () => {
|
||||
from: {},
|
||||
to: {},
|
||||
});
|
||||
await migrator.migrate('@nrwl/workspace', '2.0.0');
|
||||
await migrator.migrate('@nx/workspace', '2.0.0');
|
||||
});
|
||||
|
||||
it('should only fetch packages that are top-level deps', async () => {
|
||||
@ -1582,10 +1580,10 @@ describe('Migration', () => {
|
||||
});
|
||||
expect(
|
||||
await parseMigrationsOptions({
|
||||
packageAndVersion: '@nrwl/workspace@8.12',
|
||||
packageAndVersion: '@nx/workspace@8.12',
|
||||
})
|
||||
).toMatchObject({
|
||||
targetPackage: '@nrwl/workspace',
|
||||
targetPackage: '@nx/workspace',
|
||||
targetVersion: '8.12.0',
|
||||
});
|
||||
expect(
|
||||
@ -1608,18 +1606,18 @@ describe('Migration', () => {
|
||||
});
|
||||
expect(
|
||||
await parseMigrationsOptions({
|
||||
packageAndVersion: '@nrwl/workspace@latest',
|
||||
packageAndVersion: '@nx/workspace@latest',
|
||||
})
|
||||
).toMatchObject({
|
||||
targetPackage: '@nrwl/workspace',
|
||||
targetPackage: '@nx/workspace',
|
||||
targetVersion: 'latest',
|
||||
});
|
||||
expect(
|
||||
await parseMigrationsOptions({
|
||||
packageAndVersion: '@nrwl/workspace@alpha',
|
||||
packageAndVersion: '@nx/workspace@alpha',
|
||||
})
|
||||
).toMatchObject({
|
||||
targetPackage: '@nrwl/workspace',
|
||||
targetPackage: '@nx/workspace',
|
||||
targetVersion: 'alpha',
|
||||
});
|
||||
});
|
||||
@ -1674,13 +1672,13 @@ describe('Migration', () => {
|
||||
|
||||
it('should handle backslashes in package names', async () => {
|
||||
const r = await parseMigrationsOptions({
|
||||
packageAndVersion: '@nrwl\\workspace@8.12.0',
|
||||
packageAndVersion: '@nx\\workspace@8.12.0',
|
||||
from: '@myscope\\a@12.3,@myscope\\b@1.1.1',
|
||||
to: '@myscope\\c@12.3.1',
|
||||
});
|
||||
expect(r).toEqual({
|
||||
type: 'generateMigrations',
|
||||
targetPackage: '@nrwl/workspace',
|
||||
targetPackage: '@nx/workspace',
|
||||
targetVersion: '8.12.0',
|
||||
from: {
|
||||
'@myscope/a': '12.3.0',
|
||||
|
||||
@ -1147,6 +1147,8 @@ function readNxVersion(packageJson: PackageJson) {
|
||||
return (
|
||||
packageJson?.devDependencies?.['nx'] ??
|
||||
packageJson?.dependencies?.['nx'] ??
|
||||
packageJson?.devDependencies?.['@nx/workspace'] ??
|
||||
packageJson?.dependencies?.['@nx/workspace'] ??
|
||||
packageJson?.devDependencies?.['@nrwl/workspace'] ??
|
||||
packageJson?.dependencies?.['@nrwl/workspace']
|
||||
);
|
||||
|
||||
@ -18,11 +18,11 @@ export async function newWorkspace(cwd: string, args: { [k: string]: any }) {
|
||||
async () => {
|
||||
const isInteractive = args.interactive;
|
||||
const { normalizedGeneratorName, schema, implementationFactory } =
|
||||
ws.readGenerator('@nrwl/workspace/generators.json', 'new');
|
||||
ws.readGenerator('@nx/workspace/generators.json', 'new');
|
||||
removeSpecialFlags(args);
|
||||
const combinedOpts = await combineOptionsForGenerator(
|
||||
args,
|
||||
'@nrwl/workspace/generators.json',
|
||||
'@nx/workspace/generators.json',
|
||||
normalizedGeneratorName,
|
||||
null,
|
||||
null,
|
||||
|
||||
@ -39,7 +39,7 @@ interface NxInstallationConfiguration {
|
||||
version: string;
|
||||
/**
|
||||
* Record<pluginPackageName, pluginVersion>. e.g.
|
||||
* plugins: { '@nrwl/angular': '1.0.0' }
|
||||
* plugins: { '@nx/angular': '1.0.0' }
|
||||
*/
|
||||
plugins?: Record<string, string>;
|
||||
}
|
||||
@ -106,7 +106,7 @@ export interface NxJsonConfiguration<T = '*' | string[]> {
|
||||
*
|
||||
* ```
|
||||
* {
|
||||
* "@nrwl/react": {
|
||||
* "@nx/react": {
|
||||
* "library": {
|
||||
* "style": "scss"
|
||||
* }
|
||||
|
||||
@ -74,7 +74,7 @@ export interface ProjectConfiguration {
|
||||
*
|
||||
* ```
|
||||
* {
|
||||
* "@nrwl/react": {
|
||||
* "@nx/react": {
|
||||
* "library": {
|
||||
* "style": "scss"
|
||||
* }
|
||||
@ -136,7 +136,7 @@ export interface TargetConfiguration<T = any> {
|
||||
/**
|
||||
* The executor/builder used to implement the target.
|
||||
*
|
||||
* Example: '@nrwl/web:rollup'
|
||||
* Example: '@nx/web:rollup'
|
||||
*/
|
||||
executor?: string;
|
||||
|
||||
|
||||
@ -519,7 +519,7 @@ function findFullGeneratorName(
|
||||
}
|
||||
|
||||
/**
|
||||
* Pulled from toFileName in names from @nrwl/devkit.
|
||||
* Pulled from toFileName in names from @nx/devkit.
|
||||
* Todo: Should refactor, not duplicate.
|
||||
*/
|
||||
export function toProjectName(fileName: string): string {
|
||||
|
||||
@ -57,7 +57,7 @@ export async function subscribeToWorkspaceChanges(
|
||||
cb: FileWatcherCallback
|
||||
): 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
|
||||
* executed by packages which do not have its necessary native binaries available.
|
||||
*/
|
||||
|
||||
@ -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.
|
||||
*/
|
||||
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -27,8 +27,8 @@ describe('Hasher', () => {
|
||||
const tsConfigBaseJson = JSON.stringify({
|
||||
compilerOptions: {
|
||||
paths: {
|
||||
'@nrwl/parent': ['libs/parent/src/index.ts'],
|
||||
'@nrwl/child': ['libs/child/src/index.ts'],
|
||||
'@nx/parent': ['libs/parent/src/index.ts'],
|
||||
'@nx/child': ['libs/child/src/index.ts'],
|
||||
},
|
||||
},
|
||||
});
|
||||
@ -123,7 +123,7 @@ describe('Hasher', () => {
|
||||
expect(hash.details.command).toEqual('parent|build||{"prop":"prop-value"}');
|
||||
expect(hash.details.nodes).toEqual({
|
||||
'parent:{projectRoot}/**/*':
|
||||
'/file|file.hash|{"root":"libs/parent","targets":{"build":{"executor":"unknown","inputs":["default","^default",{"runtime":"echo runtime123"},{"env":"TESTENV"},{"env":"NONEXISTENTENV"}]}}}|{"compilerOptions":{"paths":{"@nrwl/parent":["libs/parent/src/index.ts"],"@nrwl/child":["libs/child/src/index.ts"]}}}',
|
||||
'/file|file.hash|{"root":"libs/parent","targets":{"build":{"executor":"unknown","inputs":["default","^default",{"runtime":"echo runtime123"},{"env":"TESTENV"},{"env":"NONEXISTENTENV"}]}}}|{"compilerOptions":{"paths":{"@nx/parent":["libs/parent/src/index.ts"],"@nx/child":["libs/child/src/index.ts"]}}}',
|
||||
parent: 'unknown',
|
||||
'{workspaceRoot}/nx.json': 'nx.json.hash',
|
||||
'{workspaceRoot}/.gitignore': '',
|
||||
@ -444,7 +444,7 @@ describe('Hasher', () => {
|
||||
data: {
|
||||
root: 'libs/parent',
|
||||
targets: {
|
||||
build: { executor: '@nrwl/workspace:run-commands' },
|
||||
build: { executor: '@nx/workspace:run-commands' },
|
||||
},
|
||||
files: [
|
||||
{ file: 'libs/parent/filea.ts', hash: 'a.hash' },
|
||||
@ -457,7 +457,7 @@ describe('Hasher', () => {
|
||||
type: 'lib',
|
||||
data: {
|
||||
root: 'libs/child',
|
||||
targets: { build: { executor: '@nrwl/workspace:run-commands' } },
|
||||
targets: { build: { executor: '@nx/workspace:run-commands' } },
|
||||
files: [
|
||||
{ file: 'libs/child/fileb.ts', hash: 'b.hash' },
|
||||
{ file: 'libs/child/fileb.spec.ts', hash: 'b.spec.hash' },
|
||||
@ -511,7 +511,7 @@ describe('Hasher', () => {
|
||||
type: 'lib',
|
||||
data: {
|
||||
root: 'libs/parent',
|
||||
targets: { build: { executor: '@nrwl/workspace:run-commands' } },
|
||||
targets: { build: { executor: '@nx/workspace:run-commands' } },
|
||||
files: [{ file: '/file', hash: 'file.hash' }],
|
||||
},
|
||||
},
|
||||
@ -560,7 +560,7 @@ describe('Hasher', () => {
|
||||
type: 'lib',
|
||||
data: {
|
||||
root: 'libs/parent',
|
||||
targets: { build: { executor: '@nrwl/workspace:run-commands' } },
|
||||
targets: { build: { executor: '@nx/workspace:run-commands' } },
|
||||
files: [{ file: '/filea.ts', hash: 'a.hash' }],
|
||||
},
|
||||
},
|
||||
@ -569,7 +569,7 @@ describe('Hasher', () => {
|
||||
type: 'lib',
|
||||
data: {
|
||||
root: 'libs/child',
|
||||
targets: { build: { executor: '@nrwl/workspace:run-commands' } },
|
||||
targets: { build: { executor: '@nx/workspace:run-commands' } },
|
||||
files: [{ file: '/fileb.ts', hash: 'b.hash' }],
|
||||
},
|
||||
},
|
||||
@ -641,7 +641,7 @@ describe('Hasher', () => {
|
||||
type: 'lib',
|
||||
data: {
|
||||
root: 'libs/parent',
|
||||
targets: { build: { executor: '@nrwl/workspace:run-commands' } },
|
||||
targets: { build: { executor: '@nx/workspace:run-commands' } },
|
||||
files: [{ file: '/file', hash: 'some-hash' }],
|
||||
},
|
||||
},
|
||||
@ -683,7 +683,7 @@ describe('Hasher', () => {
|
||||
type: 'app',
|
||||
data: {
|
||||
root: 'apps/app',
|
||||
targets: { build: { executor: '@nrwl/workspace:run-commands' } },
|
||||
targets: { build: { executor: '@nx/workspace:run-commands' } },
|
||||
files: [{ file: '/filea.ts', hash: 'a.hash' }],
|
||||
},
|
||||
},
|
||||
@ -732,7 +732,7 @@ describe('Hasher', () => {
|
||||
type: 'app',
|
||||
data: {
|
||||
root: 'apps/app',
|
||||
targets: { build: { executor: '@nrwl/workspace:run-commands' } },
|
||||
targets: { build: { executor: '@nx/workspace:run-commands' } },
|
||||
files: [{ file: '/filea.ts', hash: 'a.hash' }],
|
||||
},
|
||||
},
|
||||
|
||||
@ -369,8 +369,8 @@ class TaskHasher {
|
||||
// if it's "run commands" we skip traversing since we have no info what this command depends on
|
||||
// for everything else we take the hash of the @nrwl package dependency tree
|
||||
if (
|
||||
target.executor.startsWith(`@nrwl/`) &&
|
||||
target.executor !== `@nrwl/workspace:run-commands`
|
||||
target.executor.startsWith(`@nrwl/`) ||
|
||||
target.executor.startsWith(`@nx/`)
|
||||
) {
|
||||
const executorPackage = target.executor.split(':')[0];
|
||||
const executorNode = `npm:${executorPackage}`;
|
||||
|
||||
@ -13,10 +13,10 @@ import { PackageJson } from '../../utils/package-json';
|
||||
const skippedFiles = [
|
||||
'package.json', // Not to be added to filesets
|
||||
'babel.config.json', // Will be handled by various plugins
|
||||
'karma.conf.js', // Will be handled by @nrwl/angular
|
||||
'jest.preset.js', // Will be handled by @nrwl/jest
|
||||
'.storybook', // Will be handled by @nrwl/storybook
|
||||
// Will be handled by @nrwl/linter
|
||||
'karma.conf.js', // Will be handled by @nx/angular
|
||||
'jest.preset.js', // Will be handled by @nx/jest
|
||||
'.storybook', // Will be handled by @nx/storybook
|
||||
// Will be handled by @nx/linter
|
||||
'.eslintrc.json',
|
||||
'.eslintrc.js',
|
||||
];
|
||||
|
||||
@ -149,8 +149,8 @@ export async function addNxToNest(packageJson: PackageJson) {
|
||||
function addNestPluginToPackageJson(repoRoot: string) {
|
||||
const path = join(repoRoot, `package.json`);
|
||||
const json: PackageJson = readJsonFile(path);
|
||||
json.devDependencies['@nrwl/nest'] = require('../../package.json').version;
|
||||
json.devDependencies['@nrwl/jest'] = require('../../package.json').version;
|
||||
json.devDependencies['@nx/nest'] = require('../../package.json').version;
|
||||
json.devDependencies['@nx/jest'] = require('../../package.json').version;
|
||||
writeJsonFile(path, json);
|
||||
}
|
||||
|
||||
@ -173,7 +173,7 @@ function createProjectJson(
|
||||
|
||||
if (nestCLIOptions.language !== 'js') {
|
||||
json.targets['serve'] = {
|
||||
executor: '@nrwl/js:node',
|
||||
executor: '@nx/js:node',
|
||||
options: {
|
||||
buildTarget: `${packageName}:build`,
|
||||
},
|
||||
@ -183,7 +183,7 @@ function createProjectJson(
|
||||
|
||||
if (nestCLIOptions.webpackOptions) {
|
||||
json.targets['build'] = {
|
||||
executor: '@nrwl/webpack:webpack',
|
||||
executor: '@nx/webpack:webpack',
|
||||
outputs: ['{options.outputPath}'],
|
||||
options: {
|
||||
target: 'node',
|
||||
@ -210,7 +210,7 @@ function createProjectJson(
|
||||
};
|
||||
} else {
|
||||
json.targets['build'] = {
|
||||
executor: '@nrwl/js:tsc',
|
||||
executor: '@nx/js:tsc',
|
||||
outputs: ['{options.outputPath}'],
|
||||
options: {
|
||||
outputPath: `dist/${packageName}`,
|
||||
@ -233,7 +233,7 @@ function createProjectJson(
|
||||
|
||||
// lint
|
||||
json.targets['lint'] = {
|
||||
executor: '@nrwl/linter:eslint',
|
||||
executor: '@nx/linter:eslint',
|
||||
outputs: ['{options.outputFile}'],
|
||||
options: {
|
||||
lintFilePatterns: ['src/**/*.ts', 'test/**/*.ts'],
|
||||
@ -337,7 +337,7 @@ function addJestTargets(
|
||||
);
|
||||
|
||||
projectJson.targets['test'] = {
|
||||
executor: '@nrwl/jest:jest',
|
||||
executor: '@nx/jest:jest',
|
||||
outputs: [`{workspaceRoot}/coverage/${packageName}`],
|
||||
options: {
|
||||
passWithNoTests: true,
|
||||
@ -346,7 +346,7 @@ function addJestTargets(
|
||||
};
|
||||
|
||||
projectJson.targets['e2e'] = {
|
||||
executor: '@nrwl/jest:jest',
|
||||
executor: '@nx/jest:jest',
|
||||
options: {
|
||||
passWithNoTests: true,
|
||||
jestConfig: e2eTestConfigPath,
|
||||
@ -363,7 +363,7 @@ function addNrwlJsPluginsConfig(repoRoot: string) {
|
||||
|
||||
if (!json.pluginsConfig) {
|
||||
json.pluginsConfig = {
|
||||
'@nrwl/js': {
|
||||
'@nx/js': {
|
||||
analyzeSourceFiles: true,
|
||||
} as NrwlJsPluginConfig,
|
||||
};
|
||||
|
||||
@ -127,8 +127,8 @@ function addPluginDependencies(): void {
|
||||
const nxVersion = require('../../../package.json').version;
|
||||
|
||||
packageJson.devDependencies ??= {};
|
||||
packageJson.devDependencies['@nrwl/angular'] = nxVersion;
|
||||
packageJson.devDependencies['@nrwl/workspace'] = nxVersion;
|
||||
packageJson.devDependencies['@nx/angular'] = nxVersion;
|
||||
packageJson.devDependencies['@nx/workspace'] = nxVersion;
|
||||
|
||||
const peerDepsToInstall = [
|
||||
'@angular-devkit/core',
|
||||
|
||||
@ -3,5 +3,5 @@ import { getPackageManagerCommand } from '../../utils/package-manager';
|
||||
|
||||
export function setupIntegratedWorkspace(): void {
|
||||
const pmc = getPackageManagerCommand();
|
||||
execSync(`${pmc.exec} ng g @nrwl/angular:ng-add`, { stdio: [0, 1, 2] });
|
||||
execSync(`${pmc.exec} ng g @nx/angular:ng-add`, { stdio: [0, 1, 2] });
|
||||
}
|
||||
|
||||
@ -10,7 +10,7 @@ export function setupE2eProject(appName: string) {
|
||||
},
|
||||
};
|
||||
json.targets['e2e-run'] = {
|
||||
executor: '@nrwl/cypress:cypress',
|
||||
executor: '@nx/cypress:cypress',
|
||||
options: {
|
||||
cypressConfig: `apps/${appName}-e2e/cypress.json`,
|
||||
tsConfig: `apps/${appName}-e2e/tsconfig.e2e.json`,
|
||||
|
||||
@ -30,8 +30,8 @@ const defaultTsConfigApp = (relativePathToRoot: string) => ({
|
||||
types: ['node'],
|
||||
},
|
||||
files: [
|
||||
join(relativePathToRoot, 'node_modules/@nrwl/react/typings/cssmodule.d.ts'),
|
||||
join(relativePathToRoot, 'node_modules/@nrwl/react/typings/image.d.ts'),
|
||||
join(relativePathToRoot, 'node_modules/@nx/react/typings/cssmodule.d.ts'),
|
||||
join(relativePathToRoot, 'node_modules/@nx/react/typings/image.d.ts'),
|
||||
],
|
||||
exclude: ['**/*.spec.ts', '**/*.spec.tsx'],
|
||||
include: ['**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx'],
|
||||
@ -52,8 +52,8 @@ const defaultTsConfigSpec = (relativePathToRoot: string) => ({
|
||||
'**/*.d.ts',
|
||||
],
|
||||
files: [
|
||||
join(relativePathToRoot, 'node_modules/@nrwl/react/typings/cssmodule.d.ts'),
|
||||
join(relativePathToRoot, 'node_modules/@nrwl/react/typings/image.d.ts'),
|
||||
join(relativePathToRoot, 'node_modules/@nx/react/typings/cssmodule.d.ts'),
|
||||
join(relativePathToRoot, 'node_modules/@nx/react/typings/image.d.ts'),
|
||||
],
|
||||
});
|
||||
|
||||
|
||||
@ -55,7 +55,7 @@ export function writeCracoConfig(
|
||||
},
|
||||
jest: {
|
||||
configure: (config) => {
|
||||
config.resolver = '@nrwl/jest/plugins/resolver';
|
||||
config.resolver = '@nx/jest/plugins/resolver';
|
||||
return config;
|
||||
},
|
||||
},
|
||||
|
||||
@ -59,6 +59,10 @@ function writeLastProcessedLockfileHash(hash: string) {
|
||||
}
|
||||
|
||||
function jsPluginConfig(nxJson: NxJsonConfiguration): NrwlJsPluginConfig {
|
||||
if (nxJson?.pluginsConfig?.['@nx/js']) {
|
||||
return nxJson?.pluginsConfig?.['@nx/js'];
|
||||
}
|
||||
|
||||
if (nxJson?.pluginsConfig?.['@nrwl/js']) {
|
||||
return nxJson?.pluginsConfig?.['@nrwl/js'];
|
||||
}
|
||||
@ -79,6 +83,13 @@ function jsPluginConfig(nxJson: NxJsonConfiguration): NrwlJsPluginConfig {
|
||||
...packageJson.devDependencies,
|
||||
};
|
||||
if (
|
||||
packageJsonDeps['@nx/workspace'] ||
|
||||
packageJsonDeps['@nx/js'] ||
|
||||
packageJsonDeps['@nx/node'] ||
|
||||
packageJsonDeps['@nx/next'] ||
|
||||
packageJsonDeps['@nx/react'] ||
|
||||
packageJsonDeps['@nx/angular'] ||
|
||||
packageJsonDeps['@nx/web'] ||
|
||||
packageJsonDeps['@nrwl/workspace'] ||
|
||||
packageJsonDeps['@nrwl/js'] ||
|
||||
packageJsonDeps['@nrwl/node'] ||
|
||||
|
||||
@ -17,27 +17,27 @@ describe('project graph', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
packageJson = {
|
||||
name: '@nrwl/workspace-src',
|
||||
name: '@nx/workspace-src',
|
||||
version: '0.0.0',
|
||||
dependencies: {
|
||||
express: '4.0.0',
|
||||
'happy-nrwl': '1.0.0',
|
||||
},
|
||||
devDependencies: {
|
||||
'@nrwl/workspace': '*',
|
||||
'@nx/workspace': '*',
|
||||
},
|
||||
};
|
||||
packageLockJson = {
|
||||
name: '@nrwl/workspace-src',
|
||||
name: '@nx/workspace-src',
|
||||
version: '0.0.0',
|
||||
lockfileVersion: 2,
|
||||
requires: true,
|
||||
packages: {
|
||||
'': packageJson,
|
||||
'node_modules/@nrwl/workspace': {
|
||||
'node_modules/@nx/workspace': {
|
||||
version: '15.0.0',
|
||||
resolved:
|
||||
'https://registry.npmjs.org/@nrwl/workspace/-/@nrwl/workspace-15.0.0.tgz',
|
||||
'https://registry.npmjs.org/@nx/workspace/-/@nx/workspace-15.0.0.tgz',
|
||||
integrity: 'sha512-12345678==',
|
||||
dev: true,
|
||||
},
|
||||
@ -57,10 +57,10 @@ describe('project graph', () => {
|
||||
},
|
||||
},
|
||||
dependencies: {
|
||||
'@nrwl/workspace': {
|
||||
'@nx/workspace': {
|
||||
version: '15.0.0',
|
||||
resolved:
|
||||
'https://registry.npmjs.org/@nrwl/workspace/-/@nrwl/workspace-15.0.0.tgz',
|
||||
'https://registry.npmjs.org/@nx/workspace/-/@nx/workspace-15.0.0.tgz',
|
||||
integrity: 'sha512-12345678==',
|
||||
dev: true,
|
||||
},
|
||||
@ -136,10 +136,10 @@ describe('project graph', () => {
|
||||
compilerOptions: {
|
||||
baseUrl: '.',
|
||||
paths: {
|
||||
'@nrwl/shared/util': ['libs/shared/util/src/index.ts'],
|
||||
'@nrwl/shared-util-data': ['libs/shared/util/data/src/index.ts'],
|
||||
'@nrwl/ui': ['libs/ui/src/index.ts'],
|
||||
'@nrwl/lazy-lib': ['libs/lazy-lib/src/index.ts'],
|
||||
'@nx/shared/util': ['libs/shared/util/src/index.ts'],
|
||||
'@nx/shared-util-data': ['libs/shared/util/data/src/index.ts'],
|
||||
'@nx/ui': ['libs/ui/src/index.ts'],
|
||||
'@nx/lazy-lib': ['libs/lazy-lib/src/index.ts'],
|
||||
},
|
||||
},
|
||||
};
|
||||
@ -149,16 +149,16 @@ describe('project graph', () => {
|
||||
require('express');
|
||||
`,
|
||||
'./apps/demo/src/index.ts': stripIndents`
|
||||
import * as ui from '@nrwl/ui';
|
||||
import * as data from '@nrwl/shared-util-data;
|
||||
const s = { loadChildren: '@nrwl/lazy-lib#LAZY' }
|
||||
import * as ui from '@nx/ui';
|
||||
import * as data from '@nx/shared-util-data;
|
||||
const s = { loadChildren: '@nx/lazy-lib#LAZY' }
|
||||
`,
|
||||
'./apps/demo-e2e/src/integration/app.spec.ts': stripIndents`
|
||||
describe('whatever', () => {});
|
||||
`,
|
||||
'./libs/ui/src/index.ts': stripIndents`
|
||||
import * as util from '@nrwl/shared/util';
|
||||
import('@nrwl/lazy-lib');
|
||||
import * as util from '@nx/shared/util';
|
||||
import('@nx/lazy-lib');
|
||||
`,
|
||||
'./libs/shared/util/src/index.ts': stripIndents`
|
||||
import * as happyNrwl from 'happy-nrwl/a/b/c';
|
||||
@ -265,7 +265,7 @@ describe('project graph', () => {
|
||||
it('should handle circular dependencies', async () => {
|
||||
tempFs.writeFile(
|
||||
'libs/shared/util/src/index.ts',
|
||||
`import * as ui from '@nrwl/ui';`
|
||||
`import * as ui from '@nx/ui';`
|
||||
);
|
||||
|
||||
const graph = await buildProjectGraph();
|
||||
|
||||
@ -39,7 +39,7 @@ describe('nx deps utils', () => {
|
||||
shouldRecomputeWholeGraph(
|
||||
createCache({
|
||||
deps: {
|
||||
'@nrwl/workspace': '12.0.1',
|
||||
'@nx/workspace': '12.0.1',
|
||||
plugin: '1.0.0',
|
||||
},
|
||||
}),
|
||||
@ -318,7 +318,7 @@ describe('nx deps utils', () => {
|
||||
const defaults: ProjectGraphCache = {
|
||||
version: '5.1',
|
||||
deps: {
|
||||
'@nrwl/workspace': '12.0.0',
|
||||
'@nx/workspace': '12.0.0',
|
||||
plugin: '1.0.0',
|
||||
},
|
||||
pathMappings: {
|
||||
@ -337,7 +337,7 @@ describe('nx deps utils', () => {
|
||||
p: Record<string, string>
|
||||
): Record<string, string> {
|
||||
const defaults = {
|
||||
'@nrwl/workspace': '12.0.0',
|
||||
'@nx/workspace': '12.0.0',
|
||||
plugin: '1.0.0',
|
||||
};
|
||||
return { ...defaults, ...p };
|
||||
|
||||
@ -149,7 +149,10 @@ export function shouldRecomputeWholeGraph(
|
||||
if (cache.version !== '5.1') {
|
||||
return true;
|
||||
}
|
||||
if (cache.deps['@nrwl/workspace'] !== packageJsonDeps['@nrwl/workspace']) {
|
||||
if (
|
||||
cache.deps['@nx/workspace'] !== packageJsonDeps['@nx/workspace'] ||
|
||||
cache.deps['@nrwl/workspace'] !== packageJsonDeps['@nrwl/workspace']
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
if (cache.deps['nx'] !== packageJsonDeps['nx']) {
|
||||
|
||||
@ -24,7 +24,7 @@ describe('fileutils', () => {
|
||||
});
|
||||
it('should return false for absolute imports', () => {
|
||||
expect(isRelativePath('file')).toEqual(false);
|
||||
expect(isRelativePath('@nrwl/angular')).toEqual(false);
|
||||
expect(isRelativePath('@nx/angular')).toEqual(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@ -349,9 +349,14 @@ function readPluginMainFromProjectConfiguration(
|
||||
): string | null {
|
||||
const { main } =
|
||||
Object.values(plugin.targets).find((x) =>
|
||||
['@nrwl/js:tsc', '@nrwl/js:swc', '@nrwl/node:package'].includes(
|
||||
x.executor
|
||||
)
|
||||
[
|
||||
'@nx/js:tsc',
|
||||
'@nrwl/js:tsc',
|
||||
'@nx/js:swc',
|
||||
'@nrwl/js:swc',
|
||||
'@nx/node:package',
|
||||
'@nrwl/node:package',
|
||||
].includes(x.executor)
|
||||
)?.options ||
|
||||
plugin.targets?.build?.options ||
|
||||
{};
|
||||
|
||||
@ -32,7 +32,7 @@ describe('params', () => {
|
||||
it('should use target options', () => {
|
||||
const commandLineOpts = {};
|
||||
const target: TargetConfiguration = {
|
||||
executor: '@nrwl/do:stuff',
|
||||
executor: '@nx/do:stuff',
|
||||
options: {
|
||||
overriddenOpt: 'target value',
|
||||
},
|
||||
@ -58,7 +58,7 @@ describe('params', () => {
|
||||
it('should combine target, configuration', () => {
|
||||
const commandLineOpts = {};
|
||||
const target: TargetConfiguration = {
|
||||
executor: '@nrwl/do:stuff',
|
||||
executor: '@nx/do:stuff',
|
||||
options: {
|
||||
overriddenOpt: 'target value',
|
||||
},
|
||||
@ -88,7 +88,7 @@ describe('params', () => {
|
||||
overriddenOpt: 'command value',
|
||||
};
|
||||
const target: TargetConfiguration = {
|
||||
executor: '@nrwl/do:stuff',
|
||||
executor: '@nx/do:stuff',
|
||||
options: {
|
||||
overriddenOpt: 'target value',
|
||||
},
|
||||
@ -118,7 +118,7 @@ describe('params', () => {
|
||||
overriddenOpt: 'command value',
|
||||
};
|
||||
const target: TargetConfiguration = {
|
||||
executor: '@nrwl/do:stuff',
|
||||
executor: '@nx/do:stuff',
|
||||
options: {
|
||||
overriddenOptAlias: 'target value',
|
||||
},
|
||||
@ -148,7 +148,7 @@ describe('params', () => {
|
||||
overriddenOptAlias: 'command value',
|
||||
};
|
||||
const target: TargetConfiguration = {
|
||||
executor: '@nrwl/do:stuff',
|
||||
executor: '@nx/do:stuff',
|
||||
options: {
|
||||
overriddenOpt: 'target value',
|
||||
},
|
||||
@ -176,7 +176,7 @@ describe('params', () => {
|
||||
it('should handle targets without options', () => {
|
||||
const commandLineOpts = {};
|
||||
const target: TargetConfiguration = {
|
||||
executor: '@nrwl/do:stuff',
|
||||
executor: '@nx/do:stuff',
|
||||
};
|
||||
|
||||
const options = combineOptionsForExecutor(
|
||||
|
||||
@ -36,9 +36,9 @@ describe('printHelp', () => {
|
||||
let output = '';
|
||||
jest.spyOn(logger, 'info').mockImplementation((x) => (output = x));
|
||||
|
||||
printHelp('nx g @nrwl/demo:example', schema, {
|
||||
printHelp('nx g @nx/demo:example', schema, {
|
||||
mode: 'generate',
|
||||
plugin: '@nrwl/demo',
|
||||
plugin: '@nx/demo',
|
||||
entity: 'example',
|
||||
aliases: ['ex'],
|
||||
});
|
||||
|
||||
@ -107,7 +107,7 @@ function generateGeneratorOverviewOutput({
|
||||
{
|
||||
text:
|
||||
pluginName +
|
||||
(pluginName.startsWith('@nrwl/')
|
||||
(pluginName.startsWith('@nx/') || pluginName.startsWith('@nrwl/')
|
||||
? chalk.dim(` (v${nxVersion})`)
|
||||
: ''),
|
||||
padding: [1, 0, 0, 2],
|
||||
@ -327,13 +327,19 @@ function generateLinkOutput({
|
||||
name: string;
|
||||
type: 'generators' | 'executors';
|
||||
}): string {
|
||||
const nxPackagePrefix = '@nx/';
|
||||
const nrwlPackagePrefix = '@nrwl/';
|
||||
if (!pluginName.startsWith(nrwlPackagePrefix)) {
|
||||
if (
|
||||
!pluginName.startsWith(nxPackagePrefix) &&
|
||||
!pluginName.startsWith(nrwlPackagePrefix)
|
||||
) {
|
||||
return '';
|
||||
}
|
||||
|
||||
const link = `https://nx.dev/packages/${pluginName.substring(
|
||||
nrwlPackagePrefix.length
|
||||
pluginName.startsWith(nxPackagePrefix)
|
||||
? nxPackagePrefix.length
|
||||
: nrwlPackagePrefix.length
|
||||
)}/${type}/${name}`;
|
||||
|
||||
return `\n\n${chalk.dim(
|
||||
|
||||
@ -11,7 +11,7 @@ export function workspaceConfigurationCheck() {
|
||||
title: 'workspace.json is ignored',
|
||||
bodyLines: [
|
||||
'Nx no longer reads configuration from workspace.json.',
|
||||
'Run "nx g @nrwl/workspace:fix-configuration" to split workspace.json into individual project.json files.',
|
||||
'Run "nx g @nx/workspace:fix-configuration" to split workspace.json into individual project.json files.',
|
||||
],
|
||||
});
|
||||
return;
|
||||
@ -27,8 +27,8 @@ export function workspaceConfigurationCheck() {
|
||||
title: 'angular.json format is incorrect',
|
||||
bodyLines: [
|
||||
'Nx no longer supports the v2 format of angular.json.',
|
||||
'Run "nx g @nrwl/workspace:fix-configuration" to split angular.json into individual project.json files. (Recommended)',
|
||||
'If you want to preserve angular.json, run "nx g @nrwl/workspace:fix-configuration --reformat"',
|
||||
'Run "nx g @nx/workspace:fix-configuration" to split angular.json into individual project.json files. (Recommended)',
|
||||
'If you want to preserve angular.json, run "nx g @nx/workspace:fix-configuration --reformat"',
|
||||
],
|
||||
});
|
||||
process.exit(1);
|
||||
|
||||
@ -25,7 +25,7 @@ export function workspaceRootInner(
|
||||
|
||||
// This handles the case where we have a workspace which uses npm / yarn / pnpm
|
||||
// workspaces, and has a project which contains Nx in its dependency tree.
|
||||
// e.g. packages/my-lib/package.json contains @nrwl/devkit, which references Nx and is
|
||||
// e.g. packages/my-lib/package.json contains @nx/devkit, which references Nx and is
|
||||
// thus located in //packages/my-lib/node_modules/nx/package.json
|
||||
} else if (fileExists(path.join(dir, 'node_modules', 'nx', 'package.json'))) {
|
||||
return workspaceRootInner(path.dirname(dir), dir);
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
"rules": {
|
||||
"no-restricted-imports": [
|
||||
"error",
|
||||
"@nrwl/workspace",
|
||||
"@nx/workspace",
|
||||
"@angular-devkit/core",
|
||||
"@angular-devkit/architect",
|
||||
"@angular-devkit/schematics"
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
"rules": {
|
||||
"no-restricted-imports": [
|
||||
"error",
|
||||
"@nrwl/workspace",
|
||||
"@nx/workspace",
|
||||
"@angular-devkit/core",
|
||||
"@angular-devkit/architect",
|
||||
"@angular-devkit/schematics"
|
||||
|
||||
@ -109,7 +109,7 @@ describe('moveProjectConfiguration', () => {
|
||||
},
|
||||
},
|
||||
test: {
|
||||
executor: '@nrwl/jest:jest',
|
||||
executor: '@nx/jest:jest',
|
||||
options: {
|
||||
jestConfig: 'apps/my-source/jest.config.js',
|
||||
tsConfig: 'apps/my-source/tsconfig.spec.json',
|
||||
@ -127,7 +127,7 @@ describe('moveProjectConfiguration', () => {
|
||||
projectType: 'application',
|
||||
targets: {
|
||||
e2e: {
|
||||
executor: '@nrwl/cypress:cypress',
|
||||
executor: '@nx/cypress:cypress',
|
||||
options: {
|
||||
cypressConfig: 'apps/my-source-e2e/cypress.json',
|
||||
tsConfig: 'apps/my-source-e2e/tsconfig.e2e.json',
|
||||
|
||||
@ -27,7 +27,7 @@ describe('updateBuildTargets', () => {
|
||||
root: 'libs/my-source',
|
||||
targets: {
|
||||
storybook: {
|
||||
executor: '@nrwl/storybook:storybook',
|
||||
executor: '@nx/storybook:storybook',
|
||||
},
|
||||
},
|
||||
});
|
||||
@ -76,7 +76,7 @@ describe('updateBuildTargets', () => {
|
||||
|
||||
expect(myProject).toBeDefined();
|
||||
expect(myProject.targets.storybook.executor).toBe(
|
||||
'@nrwl/storybook:storybook'
|
||||
'@nx/storybook:storybook'
|
||||
);
|
||||
|
||||
expect(e2eProject).toBeDefined();
|
||||
|
||||
@ -85,7 +85,7 @@ describe('updateCypressConfig', () => {
|
||||
'/libs/my-destination/cypress.config.ts',
|
||||
`
|
||||
import { defineConfig } from 'cypress';
|
||||
import { nxE2EPreset } from '@nrwl/cypress/plugins/cypress-preset';
|
||||
import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset';
|
||||
|
||||
export default defineConfig({
|
||||
e2e: {
|
||||
|
||||
@ -100,7 +100,7 @@ describe('updateEslint', () => {
|
||||
});
|
||||
updateJson(tree, 'libs/my-lib/.eslintrc.json', (eslintRcJson) => {
|
||||
eslintRcJson.extends = [
|
||||
'plugin:@nrwl/nx/react',
|
||||
'plugin:@nx/nx/react',
|
||||
'../../.eslintrc.json',
|
||||
'./customrc.json',
|
||||
];
|
||||
@ -120,7 +120,7 @@ describe('updateEslint', () => {
|
||||
).toEqual(
|
||||
expect.objectContaining({
|
||||
extends: [
|
||||
'plugin:@nrwl/nx/react',
|
||||
'plugin:@nx/nx/react',
|
||||
'../../../.eslintrc.json',
|
||||
'./customrc.json',
|
||||
],
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`@nrwl/workspace:generateWorkspaceFiles README.md should be created for AngularMonorepo preset 1`] = `
|
||||
exports[`@nx/workspace:generateWorkspaceFiles README.md should be created for AngularMonorepo preset 1`] = `
|
||||
"# Proj
|
||||
|
||||
<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
|
||||
|
||||
<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
|
||||
|
||||
<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
|
||||
|
||||
<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
|
||||
|
||||
<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
|
||||
|
||||
<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
|
||||
|
||||
<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
|
||||
|
||||
<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
|
||||
|
||||
<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
|
||||
|
||||
<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
|
||||
|
||||
<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
|
||||
|
||||
<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
|
||||
|
||||
<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
|
||||
|
||||
<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
|
||||
|
||||
<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
|
||||
|
||||
<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
|
||||
|
||||
<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",
|
||||
"esbenp.prettier-vscode",
|
||||
]
|
||||
`;
|
||||
|
||||
exports[`@nrwl/workspace:generateWorkspaceFiles should recommend vscode extensions 1`] = `
|
||||
exports[`@nx/workspace:generateWorkspaceFiles should recommend vscode extensions 1`] = `
|
||||
[
|
||||
"nrwl.angular-console",
|
||||
"esbenp.prettier-vscode",
|
||||
|
||||
@ -4,7 +4,7 @@ exports[`new --preset should generate necessary npm dependencies for empty prese
|
||||
{
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"@nrwl/workspace": "0.0.1",
|
||||
"@nx/workspace": "0.0.1",
|
||||
"nx": "0.0.1",
|
||||
},
|
||||
"license": "MIT",
|
||||
|
||||
@ -9,6 +9,6 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"nx": "<%= nxVersion %>",
|
||||
"@nrwl/workspace": "<%= nxVersion %>"
|
||||
"@nx/workspace": "<%= nxVersion %>"
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
"dependencies": {
|
||||
},
|
||||
"devDependencies": {
|
||||
"@nrwl/workspace": "<%= nxVersion %>",
|
||||
"@nx/workspace": "<%= nxVersion %>",
|
||||
"nx": "<%= nxVersion %>"
|
||||
}
|
||||
}
|
||||
|
||||
@ -68,7 +68,7 @@ export function generatePreset(host: Tree, opts: NormalizedSchema) {
|
||||
function getDefaultArgs(opts: NormalizedSchema) {
|
||||
return [
|
||||
`g`,
|
||||
`@nrwl/workspace:preset`,
|
||||
`@nx/workspace:preset`,
|
||||
`--name=${opts.appName}`,
|
||||
opts.style ? `--style=${opts.style}` : null,
|
||||
opts.linter ? `--linter=${opts.linter}` : null,
|
||||
@ -94,12 +94,12 @@ function getPresetDependencies({
|
||||
}: NormalizedSchema) {
|
||||
switch (preset) {
|
||||
case Preset.TS:
|
||||
return { dependencies: {}, dev: { '@nrwl/js': nxVersion } };
|
||||
return { dependencies: {}, dev: { '@nx/js': nxVersion } };
|
||||
|
||||
case Preset.AngularMonorepo:
|
||||
case Preset.AngularStandalone:
|
||||
return {
|
||||
dependencies: { '@nrwl/angular': nxVersion },
|
||||
dependencies: { '@nx/angular': nxVersion },
|
||||
dev: {
|
||||
'@angular-devkit/core': angularCliVersion,
|
||||
typescript: typescriptVersion,
|
||||
@ -107,44 +107,44 @@ function getPresetDependencies({
|
||||
};
|
||||
|
||||
case Preset.Express:
|
||||
return { dependencies: {}, dev: { '@nrwl/express': nxVersion } };
|
||||
return { dependencies: {}, dev: { '@nx/express': nxVersion } };
|
||||
|
||||
case Preset.Nest:
|
||||
return {
|
||||
dependencies: {},
|
||||
dev: { '@nrwl/nest': nxVersion, typescript: typescriptVersion },
|
||||
dev: { '@nx/nest': nxVersion, typescript: typescriptVersion },
|
||||
};
|
||||
|
||||
case Preset.NextJs:
|
||||
return { dependencies: { '@nrwl/next': nxVersion }, dev: {} };
|
||||
return { dependencies: { '@nx/next': nxVersion }, dev: {} };
|
||||
|
||||
case Preset.ReactMonorepo:
|
||||
case Preset.ReactStandalone:
|
||||
return {
|
||||
dependencies: {},
|
||||
dev: {
|
||||
'@nrwl/react': nxVersion,
|
||||
'@nrwl/cypress': nxVersion,
|
||||
'@nrwl/jest': bundler !== 'vite' ? nxVersion : undefined,
|
||||
'@nrwl/vite': bundler === 'vite' ? nxVersion : undefined,
|
||||
'@nrwl/webpack': bundler === 'webpack' ? nxVersion : undefined,
|
||||
'@nx/react': nxVersion,
|
||||
'@nx/cypress': nxVersion,
|
||||
'@nx/jest': bundler !== 'vite' ? nxVersion : undefined,
|
||||
'@nx/vite': bundler === 'vite' ? nxVersion : undefined,
|
||||
'@nx/webpack': bundler === 'webpack' ? nxVersion : undefined,
|
||||
},
|
||||
};
|
||||
|
||||
case Preset.ReactNative:
|
||||
return { dependencies: {}, dev: { '@nrwl/react-native': nxVersion } };
|
||||
return { dependencies: {}, dev: { '@nx/react-native': nxVersion } };
|
||||
|
||||
case Preset.Expo:
|
||||
return { dependencies: {}, dev: { '@nrwl/expo': nxVersion } };
|
||||
return { dependencies: {}, dev: { '@nx/expo': nxVersion } };
|
||||
|
||||
case Preset.WebComponents:
|
||||
return {
|
||||
dependencies: {},
|
||||
dev: { '@nrwl/web': nxVersion, typescript: typescriptVersion },
|
||||
dev: { '@nx/web': nxVersion, typescript: typescriptVersion },
|
||||
};
|
||||
|
||||
case Preset.NodeStandalone:
|
||||
return { dependencies: {}, dev: { '@nrwl/node': nxVersion } };
|
||||
return { dependencies: {}, dev: { '@nx/node': nxVersion } };
|
||||
|
||||
default: {
|
||||
return {
|
||||
|
||||
@ -6,7 +6,7 @@ import { createTree } from '@nx/devkit/testing';
|
||||
import { Preset } from '../utils/presets';
|
||||
import * as nxSchema from '../../../../nx/schemas/nx-schema.json';
|
||||
|
||||
describe('@nrwl/workspace:generateWorkspaceFiles', () => {
|
||||
describe('@nx/workspace:generateWorkspaceFiles', () => {
|
||||
let tree: Tree;
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
@ -72,10 +72,10 @@ describe('new', () => {
|
||||
|
||||
const { devDependencies } = readJson(tree, 'my-workspace/package.json');
|
||||
expect(devDependencies).toStrictEqual({
|
||||
'@nrwl/react': nxVersion,
|
||||
'@nrwl/cypress': nxVersion,
|
||||
'@nrwl/vite': nxVersion,
|
||||
'@nrwl/workspace': nxVersion,
|
||||
'@nx/react': nxVersion,
|
||||
'@nx/cypress': nxVersion,
|
||||
'@nx/vite': nxVersion,
|
||||
'@nx/workspace': nxVersion,
|
||||
nx: nxVersion,
|
||||
});
|
||||
});
|
||||
@ -94,10 +94,10 @@ describe('new', () => {
|
||||
tree,
|
||||
'my-workspace/package.json'
|
||||
);
|
||||
expect(dependencies).toStrictEqual({ '@nrwl/angular': nxVersion });
|
||||
expect(dependencies).toStrictEqual({ '@nx/angular': nxVersion });
|
||||
expect(devDependencies).toStrictEqual({
|
||||
'@angular-devkit/core': angularCliVersion,
|
||||
'@nrwl/workspace': nxVersion,
|
||||
'@nx/workspace': nxVersion,
|
||||
nx: nxVersion,
|
||||
typescript: typescriptVersion,
|
||||
});
|
||||
|
||||
@ -9,7 +9,7 @@ import {
|
||||
import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing';
|
||||
import { npmPackageGenerator } from './npm-package';
|
||||
|
||||
describe('@nrwl/workspace:npm-package', () => {
|
||||
describe('@nx/workspace:npm-package', () => {
|
||||
let tree: Tree;
|
||||
beforeEach(() => {
|
||||
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
|
||||
|
||||
@ -11,26 +11,23 @@ describe('preset', () => {
|
||||
beforeEach(() => {
|
||||
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
|
||||
overrideCollectionResolutionForTesting({
|
||||
'@nrwl/workspace': path.join(
|
||||
'@nx/workspace': path.join(
|
||||
__dirname,
|
||||
'../../../../workspace/generators.json'
|
||||
),
|
||||
'@nrwl/angular': path.join(
|
||||
'@nx/angular': path.join(
|
||||
__dirname,
|
||||
'../../../../angular/generators.json'
|
||||
),
|
||||
'@nrwl/linter': path.join(
|
||||
__dirname,
|
||||
'../../../../linter/generators.json'
|
||||
),
|
||||
'@nrwl/nest': path.join(__dirname, '../../../../nest/generators.json'),
|
||||
'@nrwl/node': path.join(__dirname, '../../../../node/generators.json'),
|
||||
'@nrwl/jest': path.join(__dirname, '../../../../jest/generators.json'),
|
||||
'@nrwl/cypress': path.join(
|
||||
'@nx/linter': path.join(__dirname, '../../../../linter/generators.json'),
|
||||
'@nx/nest': path.join(__dirname, '../../../../nest/generators.json'),
|
||||
'@nx/node': path.join(__dirname, '../../../../node/generators.json'),
|
||||
'@nx/jest': path.join(__dirname, '../../../../jest/generators.json'),
|
||||
'@nx/cypress': path.join(
|
||||
__dirname,
|
||||
'../../../../cypress/generators.json'
|
||||
),
|
||||
'@nrwl/express': path.join(
|
||||
'@nx/express': path.join(
|
||||
__dirname,
|
||||
'../../../../express/generators.json'
|
||||
),
|
||||
|
||||
@ -38,7 +38,7 @@ describe('checkTargets', () => {
|
||||
options: {},
|
||||
},
|
||||
storybook: {
|
||||
executor: '@nrwl/storybook:storybook',
|
||||
executor: '@nx/storybook:storybook',
|
||||
options: {},
|
||||
},
|
||||
},
|
||||
@ -50,7 +50,7 @@ describe('checkTargets', () => {
|
||||
sourceRoot: 'apps/storybook/src',
|
||||
targets: {
|
||||
storybook: {
|
||||
executor: '@nrwl/storybook:storybook',
|
||||
executor: '@nx/storybook:storybook',
|
||||
},
|
||||
},
|
||||
});
|
||||
@ -61,7 +61,7 @@ describe('checkTargets', () => {
|
||||
projectType: 'application',
|
||||
targets: {
|
||||
e2e: {
|
||||
executor: '@nrwl/cypress:cypress',
|
||||
executor: '@nx/cypress:cypress',
|
||||
options: {
|
||||
cypressConfig: 'apps/ng-app-e2e/cypress.json',
|
||||
tsConfig: 'apps/ng-app-e2e/tsconfig.e2e.json',
|
||||
|
||||
@ -35,7 +35,7 @@ describe('removeProjectReferencesInConfig', () => {
|
||||
projectType: 'application',
|
||||
targets: {
|
||||
e2e: {
|
||||
executor: '@nrwl/cypress:cypress',
|
||||
executor: '@nx/cypress:cypress',
|
||||
options: {
|
||||
cypressConfig: 'apps/ng-app-e2e/cypress.json',
|
||||
tsConfig: 'apps/ng-app-e2e/tsconfig.e2e.json',
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { Tree, formatFiles, installPackagesTask } from '@nrwl/devkit';
|
||||
import { libraryGenerator } from '@nrwl/js';
|
||||
import { Tree, formatFiles, installPackagesTask } from '@nx/devkit';
|
||||
import { libraryGenerator } from '@nx/js';
|
||||
|
||||
export default async function(tree: Tree, schema: any) {
|
||||
await libraryGenerator(tree, {name: schema.name});
|
||||
|
||||
@ -23,7 +23,7 @@ export default async function (host: Tree, schema: Schema) {
|
||||
host,
|
||||
{},
|
||||
{
|
||||
'@nrwl/devkit': nxVersion,
|
||||
'@nx/devkit': nxVersion,
|
||||
// types/node is neccessary for pnpm since it's used in tsconfig and transitive
|
||||
// dependencies are not resolved correctly
|
||||
'@types/node': 'latest',
|
||||
|
||||
@ -25,7 +25,7 @@ function isBuildable(target: string, node: ProjectGraphProjectNode): boolean {
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated This type will be removed from @nrwl/workspace in version 17. Prefer importing from @nrwl/js.
|
||||
* @deprecated This type will be removed from @nx/workspace in version 17. Prefer importing from @nx/js.
|
||||
*/
|
||||
export type DependentBuildableProjectNode = {
|
||||
name: string;
|
||||
@ -34,7 +34,7 @@ export type DependentBuildableProjectNode = {
|
||||
};
|
||||
|
||||
/**
|
||||
* @deprecated This function will be removed from @nrwl/workspace in version 17. Prefer importing from @nrwl/js.
|
||||
* @deprecated This function will be removed from @nx/workspace in version 17. Prefer importing from @nx/js.
|
||||
*/
|
||||
export function calculateProjectDependencies(
|
||||
projGraph: ProjectGraph,
|
||||
@ -223,7 +223,7 @@ function readPaths(tsConfig: string | ts.ParsedCommandLine) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated This function will be removed from @nrwl/workspace in version 17. Prefer importing from @nrwl/js.
|
||||
* @deprecated This function will be removed from @nx/workspace in version 17. Prefer importing from @nx/js.
|
||||
*/
|
||||
export function createTmpTsConfig(
|
||||
tsconfigPath: string,
|
||||
@ -256,7 +256,7 @@ function cleanupTmpTsConfigFile(tmpTsConfigPath) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated This function will be removed from @nrwl/workspace in version 17. Prefer importing from @nrwl/js.
|
||||
* @deprecated This function will be removed from @nx/workspace in version 17. Prefer importing from @nx/js.
|
||||
*/
|
||||
export function checkDependentProjectsHaveBeenBuilt(
|
||||
root: string,
|
||||
@ -285,7 +285,7 @@ export function checkDependentProjectsHaveBeenBuilt(
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated This function will be removed from @nrwl/workspace in version 17. Prefer importing from @nrwl/js.
|
||||
* @deprecated This function will be removed from @nx/workspace in version 17. Prefer importing from @nx/js.
|
||||
*/
|
||||
export function findMissingBuildDependencies(
|
||||
root: string,
|
||||
@ -312,7 +312,7 @@ export function findMissingBuildDependencies(
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated This function will be removed from @nrwl/workspace in version 17. Prefer importing from @nrwl/js.
|
||||
* @deprecated This function will be removed from @nx/workspace in version 17. Prefer importing from @nx/js.
|
||||
*/
|
||||
export function updatePaths(
|
||||
dependencies: DependentBuildableProjectNode[],
|
||||
@ -361,7 +361,7 @@ export function updatePaths(
|
||||
/**
|
||||
* Updates the peerDependencies section in the `dist/lib/xyz/package.json` with
|
||||
* the proper dependency and version
|
||||
* @deprecated This function will be removed from @nrwl/workspace in version 17. Prefer importing from @nrwl/js.
|
||||
* @deprecated This function will be removed from @nx/workspace in version 17. Prefer importing from @nx/js.
|
||||
*/
|
||||
export function updateBuildableProjectPackageJsonDependencies(
|
||||
root: string,
|
||||
|
||||
@ -24,7 +24,7 @@ describe('fileutils', () => {
|
||||
});
|
||||
it('should return false for absolute imports', () => {
|
||||
expect(isRelativePath('file')).toEqual(false);
|
||||
expect(isRelativePath('@nrwl/angular')).toEqual(false);
|
||||
expect(isRelativePath('@nx/angular')).toEqual(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@ -3,7 +3,7 @@ import type { GeneratorCallback } from '@nx/devkit';
|
||||
/**
|
||||
* Run tasks in serial
|
||||
*
|
||||
* @deprecated This function will be removed from `@nrwl/workspace` in version 17. Prefer importing it from `@nrwl/devkit`.
|
||||
* @deprecated This function will be removed from `@nx/workspace` in version 17. Prefer importing it from `@nx/devkit`.
|
||||
* @param tasks The tasks to run in serial.
|
||||
*/
|
||||
export function runTasksInSerial(
|
||||
|
||||
@ -93,14 +93,14 @@ import {
|
||||
} from './ts-config';
|
||||
|
||||
/**
|
||||
* @deprecated Please import this from @nrwl/js instead. This function will be removed in v17
|
||||
* @deprecated Please import this from @nx/js instead. This function will be removed in v17
|
||||
*/
|
||||
export function getRelativePathToRootTsConfig(tree: Tree, targetPath: string) {
|
||||
return _getRelativePathToRootTsConfig(tree, targetPath);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Please import this from @nrwl/js instead. This function will be removed in v17
|
||||
* @deprecated Please import this from @nx/js instead. This function will be removed in v17
|
||||
*/
|
||||
export function getRootTsConfigPathInTree(tree: Tree) {
|
||||
return _getRootTsConfigPathInTree(tree);
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import type * as ts from 'typescript';
|
||||
|
||||
/**
|
||||
* @deprecated This function will be removed from @nrwl/workspace in version 17. Prefer importing from @nrwl/js.
|
||||
* @deprecated This function will be removed from @nx/workspace in version 17. Prefer importing from @nx/js.
|
||||
*/
|
||||
export function getSourceNodes(sourceFile: ts.SourceFile): ts.Node[] {
|
||||
const nodes: ts.Node[] = [sourceFile];
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
import { checkAndCleanWithSemver as _checkAndCleanWithSemver } from '@nx/devkit/src/utils/semver';
|
||||
import { logger } from '@nx/devkit';
|
||||
|
||||
/** @deprecated Use checkAndCleanWithSemver from @nrwl/devkit/src/utils/semver instead.
|
||||
/** @deprecated Use checkAndCleanWithSemver from @nx/devkit/src/utils/semver instead.
|
||||
* TODO(v17): Remove this function from workspace. Keep it for now since there are projects that use it (e.g. https://github.com/gperdomor/nx-tools).
|
||||
*/
|
||||
export function checkAndCleanWithSemver(pkgName: string, version: string) {
|
||||
logger.warn(
|
||||
`checkAndCleanWithSemver has been moved to @nrwl/devkit/src/utils/semver`
|
||||
`checkAndCleanWithSemver has been moved to @nx/devkit/src/utils/semver`
|
||||
);
|
||||
return _checkAndCleanWithSemver(pkgName, version);
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@ import type { Rule } from '@angular-devkit/schematics';
|
||||
let installAdded = false;
|
||||
|
||||
/**
|
||||
* @deprecated This will be removed in v17. Prefer writing Nx Generators with @nrwl/devkit. This function can be replaced with 'addDependenciesToPackageJson' from @nrwl/devkit.
|
||||
* @deprecated This will be removed in v17. Prefer writing Nx Generators with @nx/devkit. This function can be replaced with 'addDependenciesToPackageJson' from @nx/devkit.
|
||||
*/
|
||||
export function addInstallTask(
|
||||
options: { skipInstall: boolean } = { skipInstall: false }
|
||||
|
||||
@ -2,7 +2,7 @@ import type { Rule, Tree } from '@angular-devkit/schematics';
|
||||
|
||||
/**
|
||||
* Remove a file from the Virtual Schematic Tree
|
||||
* @deprecated This will be removed in v17. Prefer writing Nx Generators with @nrwl/devkit. This function can be replaced with 'Tree.delete' from @nrwl/devkit.
|
||||
* @deprecated This will be removed in v17. Prefer writing Nx Generators with @nx/devkit. This function can be replaced with 'Tree.delete' from @nx/devkit.
|
||||
*/
|
||||
export function deleteFile(from: string): Rule {
|
||||
return (host: Tree) => host.delete(from);
|
||||
|
||||
@ -12,7 +12,7 @@ import * as path from 'path';
|
||||
import { workspaceRoot } from '@nx/devkit';
|
||||
|
||||
/**
|
||||
* @deprecated This will be removed in v17. Prefer writing Nx Generators with @nrwl/devkit. This function can be replaced with 'formatFiles' from @nrwl/devkit.
|
||||
* @deprecated This will be removed in v17. Prefer writing Nx Generators with @nx/devkit. This function can be replaced with 'formatFiles' from @nx/devkit.
|
||||
*/
|
||||
export function formatFiles(
|
||||
options: { skipFormat: boolean } = { skipFormat: false },
|
||||
|
||||
@ -8,7 +8,7 @@ import {
|
||||
import ignore, { Ignore } from 'ignore';
|
||||
|
||||
/**
|
||||
* @deprecated This will be removed in v17. Prefer writing Nx Generators with @nrwl/devkit. This function can be replaced with 'visitNotIgnoredFiles' from @nrwl/devkit.
|
||||
* @deprecated This will be removed in v17. Prefer writing Nx Generators with @nx/devkit. This function can be replaced with 'visitNotIgnoredFiles' from @nx/devkit.
|
||||
*/
|
||||
export function visitNotIgnoredFiles(
|
||||
visitor: (file: Path, host: Tree, context: SchematicContext) => void | Rule,
|
||||
|
||||
@ -22,7 +22,7 @@ const STRING_UNDERSCORE_REGEXP_2 = /-|\s+/g;
|
||||
```
|
||||
|
||||
@method decamelize
|
||||
@deprecated This will be removed from `@nrwl/workspace` in version 17. Prefer `@nrwl/js` when importing.
|
||||
@deprecated This will be removed from `@nx/workspace` in version 17. Prefer `@nx/js` when importing.
|
||||
@param {String} str The string to decamelize.
|
||||
@return {String} the decamelized string.
|
||||
*/
|
||||
@ -42,7 +42,7 @@ export function decamelize(str: string): string {
|
||||
```
|
||||
|
||||
@method dasherize
|
||||
@deprecated This will be removed from `@nrwl/workspace` in version 17. Prefer `@nrwl/js` when importing.
|
||||
@deprecated This will be removed from `@nx/workspace` in version 17. Prefer `@nx/js` when importing.
|
||||
@param {String} str The string to dasherize.
|
||||
@return {String} the dasherized string.
|
||||
*/
|
||||
@ -62,7 +62,7 @@ export function dasherize(str?: string): string {
|
||||
```
|
||||
|
||||
@method camelize
|
||||
@deprecated This will be removed from `@nrwl/workspace` in version 17. Prefer `@nrwl/js` when importing.
|
||||
@deprecated This will be removed from `@nx/workspace` in version 17. Prefer `@nx/js` when importing.
|
||||
@param {String} str The string to camelize.
|
||||
@return {String} the camelized string.
|
||||
*/
|
||||
@ -88,7 +88,7 @@ export function camelize(str: string): string {
|
||||
```
|
||||
|
||||
@method classify
|
||||
@deprecated This will be removed from `@nrwl/workspace` in version 17. Prefer `@nrwl/js` when importing.
|
||||
@deprecated This will be removed from `@nx/workspace` in version 17. Prefer `@nx/js` when importing.
|
||||
@param {String} str the string to classify
|
||||
@return {String} the classified string
|
||||
*/
|
||||
@ -111,7 +111,7 @@ export function classify(str: string): string {
|
||||
```
|
||||
|
||||
@method underscore
|
||||
@deprecated This will be removed from `@nrwl/workspace` in version 17. Prefer `@nrwl/js` when importing.
|
||||
@deprecated This will be removed from `@nx/workspace` in version 17. Prefer `@nx/js` when importing.
|
||||
@param {String} str The string to underscore.
|
||||
@return {String} the underscored string.
|
||||
*/
|
||||
@ -133,7 +133,7 @@ export function underscore(str: string): string {
|
||||
```
|
||||
|
||||
@method capitalize
|
||||
@deprecated This will be removed from `@nrwl/workspace` in version 17. Prefer `@nrwl/js` when importing.
|
||||
@deprecated This will be removed from `@nx/workspace` in version 17. Prefer `@nx/js` when importing.
|
||||
@param {String} str The string to capitalize.
|
||||
@return {String} The capitalized string.
|
||||
*/
|
||||
@ -142,14 +142,14 @@ export function capitalize(str: string): string {
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated This will be removed from `@nrwl/workspace` in version 17. Prefer `@nrwl/js` when importing.
|
||||
* @deprecated This will be removed from `@nx/workspace` in version 17. Prefer `@nx/js` when importing.
|
||||
*/
|
||||
export function group(name: string, group: string | undefined) {
|
||||
return group ? `${group}/${name}` : name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated This will be removed from `@nrwl/workspace` in version 17. Prefer `@nrwl/js` when importing.
|
||||
* @deprecated This will be removed from `@nx/workspace` in version 17. Prefer `@nx/js` when importing.
|
||||
*/
|
||||
export function featurePath(
|
||||
group: boolean | undefined,
|
||||
|
||||
@ -11,7 +11,7 @@ import { ScheduleOptions } from '@angular-devkit/architect/src/api';
|
||||
import { LoggerApi, LogLevel } from '@angular-devkit/core/src/logger';
|
||||
|
||||
/**
|
||||
* @deprecated This will be removed in v17. Prefer writing Nx Generators with @nrwl/devkit. Use tree.read(filePath, 'utf-8') instead.
|
||||
* @deprecated This will be removed in v17. Prefer writing Nx Generators with @nx/devkit. Use tree.read(filePath, 'utf-8') instead.
|
||||
*/
|
||||
export function getFileContent(tree: Tree, path: string): string {
|
||||
const fileEntry = tree.get(path);
|
||||
@ -24,7 +24,7 @@ export function getFileContent(tree: Tree, path: string): string {
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated This will be removed in v17. Prefer writing Nx Generators with @nrwl/devkit. Tests for Generators can use 'createTreeWithEmptyWorkspace()' from @nrwl/devkit/testing.
|
||||
* @deprecated This will be removed in v17. Prefer writing Nx Generators with @nx/devkit. Tests for Generators can use 'createTreeWithEmptyWorkspace()' from @nx/devkit/testing.
|
||||
*/
|
||||
export function createEmptyWorkspace(tree: Tree): Tree {
|
||||
_test_addWorkspaceFile('workspace.json', WorkspaceFormat.JSON);
|
||||
@ -119,7 +119,7 @@ class NoopLogger implements LoggerApi {
|
||||
|
||||
/**
|
||||
* Mock context which makes testing builders easier
|
||||
* @deprecated This will be removed in v17. Prefer writing Nx Generators with @nrwl/devkit.
|
||||
* @deprecated This will be removed in v17. Prefer writing Nx Generators with @nx/devkit.
|
||||
*/
|
||||
export class MockBuilderContext implements BuilderContext {
|
||||
id: 0;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user