Skip to content

Commit

Permalink
feat(core): switch packages to use the @nx scope (#16069)
Browse files Browse the repository at this point in the history
  • Loading branch information
FrozenPandaz committed Apr 14, 2023
1 parent 95f2f80 commit 2d19500
Show file tree
Hide file tree
Showing 1,678 changed files with 7,844 additions and 3,062 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ CHANGELOG.md
# Next.js
.next

# Angular Cache
.angular

# Local dev files
.env

Expand Down
2 changes: 1 addition & 1 deletion e2e/angular-core/src/module-federation.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { names } from '@nrwl/devkit';
import { names } from '@nx/devkit';
import {
cleanupProject,
killProcessAndPorts,
Expand Down
2 changes: 1 addition & 1 deletion e2e/angular-core/src/projects.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { names } from '@nrwl/devkit';
import { names } from '@nx/devkit';
import {
checkFilesExist,
cleanupProject,
Expand Down
2 changes: 1 addition & 1 deletion e2e/angular-extensions/src/cypress-component-tests.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
removeFile,
checkFilesExist,
} from '../../utils';
import { names } from '@nrwl/devkit';
import { names } from '@nx/devkit';
import { join } from 'path';

describe('Angular Cypress Component Tests', () => {
Expand Down
2 changes: 1 addition & 1 deletion e2e/angular-extensions/src/misc.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
uniq,
updateFile,
} from '@nrwl/e2e/utils';
import { classify } from '@nrwl/devkit/src/utils/string-utils';
import { classify } from '@nx/devkit/src/utils/string-utils';

describe('Move Angular Project', () => {
let proj: string;
Expand Down
2 changes: 1 addition & 1 deletion e2e/angular-extensions/src/tailwind.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ describe('Tailwind support', () => {
tailwindConfigFile = 'tailwind.config.js',
libSpacing: typeof spacing['projectVariant1']
) => {
const tailwindConfig = `const { createGlobPatternsForDependencies } = require('@nrwl/angular/tailwind');
const tailwindConfig = `const { createGlobPatternsForDependencies } = require('@nx/angular/tailwind');
const { join } = require('path');
module.exports = {
Expand Down
8 changes: 4 additions & 4 deletions e2e/next/src/next.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { detectPackageManager, joinPathFragments } from '@nrwl/devkit';
import { capitalize } from '@nrwl/devkit/src/utils/string-utils';
import { detectPackageManager, joinPathFragments } from '@nx/devkit';
import { capitalize } from '@nx/devkit/src/utils/string-utils';
import {
checkFilesExist,
cleanupProject,
Expand Down Expand Up @@ -292,7 +292,7 @@ describe('Next.js Applications', () => {
updateFile(
`apps/${appName}/next.config.js`,
`
const { withNx } = require('@nrwl/next/plugins/with-nx');
const { withNx } = require('@nx/next/plugins/with-nx');
const nextConfig = {
nx: {
svgr: false,
Expand Down Expand Up @@ -327,7 +327,7 @@ describe('Next.js Applications', () => {
updateFile(
`apps/${appName}/next.config.js`,
`
const { withNx } = require('@nrwl/next/plugins/with-nx');
const { withNx } = require('@nx/next/plugins/with-nx');
// Not including "nx" entry should still work.
const nextConfig = {};
Expand Down
2 changes: 1 addition & 1 deletion e2e/node/src/node.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { stripIndents } from '@angular-devkit/core/src/utils/literals';
import { joinPathFragments } from '@nrwl/devkit';
import { joinPathFragments } from '@nx/devkit';
import {
checkFilesDoNotExist,
checkFilesExist,
Expand Down
2 changes: 1 addition & 1 deletion e2e/nx-misc/src/extras.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ describe('Extra Nx Misc Tests', () => {
`
module.exports = {
processProjectGraph: (graph) => {
const Builder = require('@nrwl/devkit').ProjectGraphBuilder;
const Builder = require('@nx/devkit').ProjectGraphBuilder;
const builder = new Builder(graph);
builder.addNode({
name: 'plugin-node',
Expand Down
14 changes: 7 additions & 7 deletions e2e/nx-misc/src/misc.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { NxJsonConfiguration } from '@nrwl/devkit';
import type { NxJsonConfiguration } from '@nx/devkit';
import {
cleanupProject,
e2eCwd,
Expand Down Expand Up @@ -67,7 +67,7 @@ describe('Nx Commands', () => {
expect(listOutput).toContain('NX Installed plugins');

// just check for some, not all
expect(listOutput).toContain('@nrwl/angular');
expect(listOutput).toContain('@nrwl/workspace');

// temporarily make it look like this isn't installed
renameSync(
Expand All @@ -79,9 +79,9 @@ describe('Nx Commands', () => {
expect(listOutput).toContain('NX Also available');

// look for specific plugin
listOutput = runCLI('list @nrwl/workspace');
listOutput = runCLI('list @nx/workspace');

expect(listOutput).toContain('Capabilities in @nrwl/workspace');
expect(listOutput).toContain('Capabilities in @nx/workspace');

// check for schematics
expect(listOutput).toContain('workspace');
Expand All @@ -92,10 +92,10 @@ describe('Nx Commands', () => {
expect(listOutput).toContain('run-commands');

// // look for uninstalled core plugin
listOutput = runCLI('list @nrwl/angular');
listOutput = runCLI('list @nx/angular');

expect(listOutput).toContain(
'NX @nrwl/angular is not currently installed'
'NX @nx/angular is not currently installed'
);

// look for an unknown plugin
Expand All @@ -105,7 +105,7 @@ describe('Nx Commands', () => {
'NX @wibble/fish is not currently installed'
);

// put back the @nrwl/angular module (or all the other e2e tests after this will fail)
// put back the @nx/angular module (or all the other e2e tests after this will fail)
renameSync(
tmpProjPath('node_modules/@nrwl/angular_tmp'),
tmpProjPath('node_modules/@nrwl/angular')
Expand Down
44 changes: 6 additions & 38 deletions e2e/nx-misc/src/nxw.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { NxJsonConfiguration } from '@nrwl/devkit';
import type { NxJsonConfiguration } from '@nx/devkit';
import {
newWrappedNxWorkspace,
updateFile,
Expand Down Expand Up @@ -42,7 +42,7 @@ describe('nx wrapper / .nx installation', () => {
updateJson<NxJsonConfiguration>('nx.json', (json) => {
json.tasksRunnerOptions.default.options.cacheableOperations = ['echo'];
json.installation.plugins = {
'@nrwl/nest': getPublishedVersion(),
'@nrwl/js': getPublishedVersion(),
};
return json;
});
Expand All @@ -66,9 +66,7 @@ describe('nx wrapper / .nx installation', () => {
it('should work with nx report', () => {
const output = runNxWrapper('report');
expect(output).toMatch(new RegExp(`nx.*:.*${getPublishedVersion()}`));
expect(output).toMatch(
new RegExp(`@nrwl/nest.*:.*${getPublishedVersion()}`)
);
expect(output).toMatch(new RegExp(`@nrwl/js.*:.*${getPublishedVersion()}`));
expect(output).not.toContain('@nrwl/express');
});

Expand All @@ -87,12 +85,10 @@ describe('nx wrapper / .nx installation', () => {
);

expect(installedPluginLines.some((x) => x.includes(`${bold('nx')}`)));
expect(
installedPluginLines.some((x) => x.includes(`${bold('@nrwl/nest')}`))
);
expect(installedPluginLines.some((x) => x.includes(`${bold('@nrwl/js')}`)));

output = runNxWrapper('list @nrwl/nest');
expect(output).toContain('Capabilities in @nrwl/nest');
output = runNxWrapper('list @nrwl/js');
expect(output).toContain('Capabilities in @nrwl/js');
});

it('should work with basic generators', () => {
Expand All @@ -118,13 +114,6 @@ describe('nx wrapper / .nx installation', () => {
updateFile(
`.nx/installation/node_modules/migrate-parent-package/migrations.json`,
JSON.stringify({
schematics: {
run11: {
version: '1.1.0',
description: '1.1.0',
factory: './run11',
},
},
generators: {
run20: {
version: '2.0.0',
Expand All @@ -135,18 +124,6 @@ describe('nx wrapper / .nx installation', () => {
})
);

updateFile(
`.nx/installation/node_modules/migrate-parent-package/run11.js`,
`
var angular_devkit_core1 = require("@angular-devkit/core");
exports.default = function default_1() {
return function(host) {
host.create('file-11', 'content11')
}
}
`
);

updateFile(
`.nx/installation/node_modules/migrate-parent-package/run20.js`,
`
Expand Down Expand Up @@ -182,9 +159,6 @@ describe('nx wrapper / .nx installation', () => {
return Promise.resolve({
version: '2.0.0',
generators: {
'run11': {
version: '1.1.0'
},
'run20': {
version: '2.0.0',
cli: 'nx'
Expand Down Expand Up @@ -236,11 +210,6 @@ describe('nx wrapper / .nx installation', () => {
const migrationsJson = readJson(`migrations.json`);
expect(migrationsJson).toEqual({
migrations: [
{
package: 'migrate-parent-package',
version: '1.1.0',
name: 'run11',
},
{
package: 'migrate-parent-package',
version: '2.0.0',
Expand All @@ -259,7 +228,6 @@ describe('nx wrapper / .nx installation', () => {
NX_WRAPPER_SKIP_INSTALL: 'true',
},
});
expect(readFile('file-11')).toEqual('content11');
expect(readFile('file-20')).toEqual('content20');
});
});
Expand Down
2 changes: 1 addition & 1 deletion e2e/nx-plugin/src/nx-plugin.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ProjectConfiguration } from '@nrwl/devkit';
import { ProjectConfiguration } from '@nx/devkit';
import {
checkFilesExist,
expectTestsPass,
Expand Down
2 changes: 1 addition & 1 deletion e2e/nx-run/src/affected-graph.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { NxJsonConfiguration } from '@nrwl/devkit';
import type { NxJsonConfiguration } from '@nx/devkit';
import {
getPackageManagerCommand,
isNotWindows,
Expand Down
2 changes: 1 addition & 1 deletion e2e/react-core/src/react-module-federation.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { stripIndents } from '@nrwl/devkit';
import { stripIndents } from '@nx/devkit';
import {
checkFilesExist,
cleanupProject,
Expand Down
2 changes: 1 addition & 1 deletion e2e/react-core/src/react-package.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
updateJson,
updateProjectConfig,
} from '@nrwl/e2e/utils';
import { names } from '@nrwl/devkit';
import { names } from '@nx/devkit';

describe('Build React libraries and apps', () => {
/**
Expand Down
4 changes: 2 additions & 2 deletions e2e/react-extensions/src/cypress-component-tests.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,8 @@ ${content}`;
createFile(
`apps/${appName}/webpack.config.js`,
`
const { composePlugins, withNx } = require('@nrwl/webpack');
const { withReact } = require('@nrwl/react');
const { composePlugins, withNx } = require('@nx/webpack');
const { withReact } = require('@nx/react');
module.exports = composePlugins(
withNx(),
Expand Down
4 changes: 2 additions & 2 deletions e2e/utils/command-utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { output, PackageManager } from '@nrwl/devkit';
import { output, PackageManager } from '@nx/devkit';
import { packageInstall, tmpProjPath } from './create-project-utils';
import {
detectPackageManager,
Expand All @@ -8,7 +8,7 @@ import {
getStrippedEnvironmentVariables,
isVerboseE2ERun,
} from './get-env-info';
import { TargetConfiguration } from '@nrwl/devkit';
import { TargetConfiguration } from '@nx/devkit';
import { ChildProcess, exec, execSync, ExecSyncOptions } from 'child_process';
import { join } from 'path';
import * as isCI from 'is-ci';
Expand Down
4 changes: 2 additions & 2 deletions e2e/utils/create-project-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
} from './get-env-info';
import * as isCI from 'is-ci';

import { angularCliVersion as defaultAngularCliVersion } from '@nrwl/workspace/src/utils/versions';
import { angularCliVersion as defaultAngularCliVersion } from '@nx/workspace/src/utils/versions';
import { dump } from '@zkochan/js-yaml';
import { execSync, ExecSyncOptions } from 'child_process';

Expand All @@ -28,7 +28,7 @@ import {
RunCmdOpts,
runCommand,
} from './command-utils';
import { output } from '@nrwl/devkit';
import { output } from '@nx/devkit';
import { readFileSync } from 'fs';
import { join } from 'path';

Expand Down
2 changes: 1 addition & 1 deletion e2e/utils/file-utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { parseJson } from '@nrwl/devkit';
import { parseJson } from '@nx/devkit';
import {
createFileSync,
ensureDirSync,
Expand Down
2 changes: 1 addition & 1 deletion e2e/utils/get-env-info.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { readJsonFile, workspaceRoot } from '@nrwl/devkit';
import { readJsonFile, workspaceRoot } from '@nx/devkit';
import { execSync } from 'child_process';
import { existsSync } from 'fs-extra';
import { join } from 'path';
Expand Down
2 changes: 1 addition & 1 deletion e2e/utils/project-config-utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ProjectConfiguration, Workspaces } from '@nrwl/devkit';
import { ProjectConfiguration, Workspaces } from '@nx/devkit';
import { join } from 'path';
import { tmpProjPath } from './create-project-utils';
import { readJson, updateFile } from './file-utils';
Expand Down
2 changes: 1 addition & 1 deletion e2e/utils/test-utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { joinPathFragments } from '@nrwl/devkit';
import { joinPathFragments } from '@nx/devkit';
import {
getPackageManagerCommand,
runCLI,
Expand Down
6 changes: 3 additions & 3 deletions e2e/web/src/web.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ describe('Web Components Applications', () => {
updateFile(
`apps/${appName}/webpack.config.js`,
`
const { composePlugins, withNx, withWeb } = require('@nrwl/webpack');
const { composePlugins, withNx, withWeb } = require('@nx/webpack');
module.exports = composePlugins(withNx(), withWeb(), (config, context) => {
return config;
});
Expand All @@ -185,7 +185,7 @@ describe('Web Components Applications', () => {
updateFile(
`apps/${appName}/webpack.config.js`,
`
const { composePlugins, withNx, withWeb } = require('@nrwl/webpack');
const { composePlugins, withNx, withWeb } = require('@nx/webpack');
module.exports = composePlugins(withNx(), withWeb(), async (config, context) => {
return config;
});
Expand All @@ -200,7 +200,7 @@ describe('Web Components Applications', () => {
updateFile(
`apps/${appName}/webpack.config.js`,
`
const { composePlugins, withNx, withWeb } = require('@nrwl/webpack');
const { composePlugins, withNx, withWeb } = require('@nx/webpack');
module.exports = composePlugins(withNx(), withWeb(), Promise.resolve((config, context) => {
return config;
}));
Expand Down
2 changes: 1 addition & 1 deletion e2e/webpack/src/webpack.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe('Webpack Plugin', () => {
updateFile(
`libs/${myPkg}/webpack.config.js`,
`
const { composePlugins, withNx } = require('@nrwl/webpack');
const { composePlugins, withNx } = require('@nx/webpack');
module.exports = composePlugins(withNx(), (config) => {
console.log('scriptType is ' + config.output.scriptType);
Expand Down
2 changes: 1 addition & 1 deletion graph/client-e2e/cypress-release-static.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig } from 'cypress';
import { nxE2EPreset } from '@nrwl/cypress/plugins/cypress-preset';
import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset';
import setupNodeEvents from './src/plugins/index';

const cypressJsonConfig = {
Expand Down
2 changes: 1 addition & 1 deletion graph/client-e2e/cypress-release.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig } from 'cypress';
import { nxE2EPreset } from '@nrwl/cypress/plugins/cypress-preset';
import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset';
import setupNodeEvents from './src/plugins/index';

const cypressJsonConfig = {
Expand Down
2 changes: 1 addition & 1 deletion graph/client-e2e/cypress-watch-mode.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig } from 'cypress';
import { nxE2EPreset } from '@nrwl/cypress/plugins/cypress-preset';
import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset';
import setupNodeEvents from './src/plugins/index';

const cypressJsonConfig = {
Expand Down
Loading

1 comment on commit 2d19500

@vercel
Copy link

@vercel vercel bot commented on 2d19500 Apr 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nx-dev – ./

nx-dev-nrwl.vercel.app
nx-dev-git-master-nrwl.vercel.app
nx-five.vercel.app
nx.dev

Please sign in to comment.