diff --git a/.gitignore b/.gitignore index ab4c522e576285..d00ae66a0bfeee 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,9 @@ CHANGELOG.md # Next.js .next +# Angular Cache +.angular + # Local dev files .env diff --git a/e2e/angular-core/src/module-federation.test.ts b/e2e/angular-core/src/module-federation.test.ts index d8248e511c10e0..22ab2734dfb5d7 100644 --- a/e2e/angular-core/src/module-federation.test.ts +++ b/e2e/angular-core/src/module-federation.test.ts @@ -1,4 +1,4 @@ -import { names } from '@nrwl/devkit'; +import { names } from '@nx/devkit'; import { cleanupProject, killProcessAndPorts, diff --git a/e2e/angular-core/src/projects.test.ts b/e2e/angular-core/src/projects.test.ts index 349d1110d57ec7..6ea4aca22b4c1b 100644 --- a/e2e/angular-core/src/projects.test.ts +++ b/e2e/angular-core/src/projects.test.ts @@ -1,4 +1,4 @@ -import { names } from '@nrwl/devkit'; +import { names } from '@nx/devkit'; import { checkFilesExist, cleanupProject, diff --git a/e2e/angular-extensions/src/cypress-component-tests.test.ts b/e2e/angular-extensions/src/cypress-component-tests.test.ts index 6f62a301a322af..71806fdae1a287 100644 --- a/e2e/angular-extensions/src/cypress-component-tests.test.ts +++ b/e2e/angular-extensions/src/cypress-component-tests.test.ts @@ -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', () => { diff --git a/e2e/angular-extensions/src/misc.test.ts b/e2e/angular-extensions/src/misc.test.ts index 7b3b72c9827e5b..4945063f74d5c6 100644 --- a/e2e/angular-extensions/src/misc.test.ts +++ b/e2e/angular-extensions/src/misc.test.ts @@ -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; diff --git a/e2e/angular-extensions/src/tailwind.test.ts b/e2e/angular-extensions/src/tailwind.test.ts index 5b80760c960db3..e9a4ee686f4b99 100644 --- a/e2e/angular-extensions/src/tailwind.test.ts +++ b/e2e/angular-extensions/src/tailwind.test.ts @@ -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 = { diff --git a/e2e/next/src/next.test.ts b/e2e/next/src/next.test.ts index 5fe0c9f2b8945a..6b19f46cc8110c 100644 --- a/e2e/next/src/next.test.ts +++ b/e2e/next/src/next.test.ts @@ -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, @@ -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, @@ -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 = {}; diff --git a/e2e/node/src/node.test.ts b/e2e/node/src/node.test.ts index 8d10299dcf683e..0280323f601cfa 100644 --- a/e2e/node/src/node.test.ts +++ b/e2e/node/src/node.test.ts @@ -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, diff --git a/e2e/nx-misc/src/extras.test.ts b/e2e/nx-misc/src/extras.test.ts index 8246423c78f52b..fb36680bcde9ea 100644 --- a/e2e/nx-misc/src/extras.test.ts +++ b/e2e/nx-misc/src/extras.test.ts @@ -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', diff --git a/e2e/nx-misc/src/misc.test.ts b/e2e/nx-misc/src/misc.test.ts index 9613fcebb5e884..2a4602e06f7c91 100644 --- a/e2e/nx-misc/src/misc.test.ts +++ b/e2e/nx-misc/src/misc.test.ts @@ -1,4 +1,4 @@ -import type { NxJsonConfiguration } from '@nrwl/devkit'; +import type { NxJsonConfiguration } from '@nx/devkit'; import { cleanupProject, e2eCwd, @@ -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( @@ -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'); @@ -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 @@ -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') diff --git a/e2e/nx-misc/src/nxw.test.ts b/e2e/nx-misc/src/nxw.test.ts index 46e20f8c15f5fa..29e017b899c9f3 100644 --- a/e2e/nx-misc/src/nxw.test.ts +++ b/e2e/nx-misc/src/nxw.test.ts @@ -1,4 +1,4 @@ -import type { NxJsonConfiguration } from '@nrwl/devkit'; +import type { NxJsonConfiguration } from '@nx/devkit'; import { newWrappedNxWorkspace, updateFile, @@ -42,7 +42,7 @@ describe('nx wrapper / .nx installation', () => { updateJson('nx.json', (json) => { json.tasksRunnerOptions.default.options.cacheableOperations = ['echo']; json.installation.plugins = { - '@nrwl/nest': getPublishedVersion(), + '@nrwl/js': getPublishedVersion(), }; return json; }); @@ -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'); }); @@ -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', () => { @@ -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', @@ -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`, ` @@ -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' @@ -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', @@ -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'); }); }); diff --git a/e2e/nx-plugin/src/nx-plugin.test.ts b/e2e/nx-plugin/src/nx-plugin.test.ts index 6988acc304e742..e621745933b422 100644 --- a/e2e/nx-plugin/src/nx-plugin.test.ts +++ b/e2e/nx-plugin/src/nx-plugin.test.ts @@ -1,4 +1,4 @@ -import { ProjectConfiguration } from '@nrwl/devkit'; +import { ProjectConfiguration } from '@nx/devkit'; import { checkFilesExist, expectTestsPass, diff --git a/e2e/nx-run/src/affected-graph.test.ts b/e2e/nx-run/src/affected-graph.test.ts index a48383d34d2b4a..3098d538d4814c 100644 --- a/e2e/nx-run/src/affected-graph.test.ts +++ b/e2e/nx-run/src/affected-graph.test.ts @@ -1,4 +1,4 @@ -import type { NxJsonConfiguration } from '@nrwl/devkit'; +import type { NxJsonConfiguration } from '@nx/devkit'; import { getPackageManagerCommand, isNotWindows, diff --git a/e2e/react-core/src/react-module-federation.test.ts b/e2e/react-core/src/react-module-federation.test.ts index b4536ba686c861..fbd2c7326ebe64 100644 --- a/e2e/react-core/src/react-module-federation.test.ts +++ b/e2e/react-core/src/react-module-federation.test.ts @@ -1,4 +1,4 @@ -import { stripIndents } from '@nrwl/devkit'; +import { stripIndents } from '@nx/devkit'; import { checkFilesExist, cleanupProject, diff --git a/e2e/react-core/src/react-package.test.ts b/e2e/react-core/src/react-package.test.ts index b7f74165c0af6c..e1ace52e05f775 100644 --- a/e2e/react-core/src/react-package.test.ts +++ b/e2e/react-core/src/react-package.test.ts @@ -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', () => { /** diff --git a/e2e/react-extensions/src/cypress-component-tests.test.ts b/e2e/react-extensions/src/cypress-component-tests.test.ts index 0f73b8844fc169..3cb71c0ba35f51 100644 --- a/e2e/react-extensions/src/cypress-component-tests.test.ts +++ b/e2e/react-extensions/src/cypress-component-tests.test.ts @@ -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(), diff --git a/e2e/utils/command-utils.ts b/e2e/utils/command-utils.ts index bdc986fed4ddb9..8122b754727d5e 100644 --- a/e2e/utils/command-utils.ts +++ b/e2e/utils/command-utils.ts @@ -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, @@ -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'; diff --git a/e2e/utils/create-project-utils.ts b/e2e/utils/create-project-utils.ts index f89dabaf6aa45d..706edbc3a957e4 100644 --- a/e2e/utils/create-project-utils.ts +++ b/e2e/utils/create-project-utils.ts @@ -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'; @@ -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'; diff --git a/e2e/utils/file-utils.ts b/e2e/utils/file-utils.ts index 92859c8aeb71b8..191adb2db0cd33 100644 --- a/e2e/utils/file-utils.ts +++ b/e2e/utils/file-utils.ts @@ -1,4 +1,4 @@ -import { parseJson } from '@nrwl/devkit'; +import { parseJson } from '@nx/devkit'; import { createFileSync, ensureDirSync, diff --git a/e2e/utils/get-env-info.ts b/e2e/utils/get-env-info.ts index d9905c4f1d15a1..c607ff0eea1012 100644 --- a/e2e/utils/get-env-info.ts +++ b/e2e/utils/get-env-info.ts @@ -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'; diff --git a/e2e/utils/project-config-utils.ts b/e2e/utils/project-config-utils.ts index 9e08e7de75b08e..9e13f64032568f 100644 --- a/e2e/utils/project-config-utils.ts +++ b/e2e/utils/project-config-utils.ts @@ -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'; diff --git a/e2e/utils/test-utils.ts b/e2e/utils/test-utils.ts index 1504cd8f646ca2..d0f260b14d92b9 100644 --- a/e2e/utils/test-utils.ts +++ b/e2e/utils/test-utils.ts @@ -1,4 +1,4 @@ -import { joinPathFragments } from '@nrwl/devkit'; +import { joinPathFragments } from '@nx/devkit'; import { getPackageManagerCommand, runCLI, diff --git a/e2e/web/src/web.test.ts b/e2e/web/src/web.test.ts index 5313ee636a1ab1..3ef4aefb45eba2 100644 --- a/e2e/web/src/web.test.ts +++ b/e2e/web/src/web.test.ts @@ -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; }); @@ -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; }); @@ -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; })); diff --git a/e2e/webpack/src/webpack.test.ts b/e2e/webpack/src/webpack.test.ts index 7b5e32cf659e70..08525979811881 100644 --- a/e2e/webpack/src/webpack.test.ts +++ b/e2e/webpack/src/webpack.test.ts @@ -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); diff --git a/graph/client-e2e/cypress-release-static.config.ts b/graph/client-e2e/cypress-release-static.config.ts index c92983a40c715e..7985f7563384a7 100644 --- a/graph/client-e2e/cypress-release-static.config.ts +++ b/graph/client-e2e/cypress-release-static.config.ts @@ -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 = { diff --git a/graph/client-e2e/cypress-release.config.ts b/graph/client-e2e/cypress-release.config.ts index 06d96a59668309..c1e0e8145a42e7 100644 --- a/graph/client-e2e/cypress-release.config.ts +++ b/graph/client-e2e/cypress-release.config.ts @@ -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 = { diff --git a/graph/client-e2e/cypress-watch-mode.config.ts b/graph/client-e2e/cypress-watch-mode.config.ts index 7f5f1fefd5cb6b..bda09c5b38da6f 100644 --- a/graph/client-e2e/cypress-watch-mode.config.ts +++ b/graph/client-e2e/cypress-watch-mode.config.ts @@ -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 = { diff --git a/graph/client-e2e/cypress.config.ts b/graph/client-e2e/cypress.config.ts index 7fba74dffe18c0..f288ebb2064b37 100644 --- a/graph/client-e2e/cypress.config.ts +++ b/graph/client-e2e/cypress.config.ts @@ -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 = { diff --git a/graph/client/src/app/feature-projects/machines/project-graph.spec.ts b/graph/client/src/app/feature-projects/machines/project-graph.spec.ts index 501f4f20f4f891..8302ad6b0ddd68 100644 --- a/graph/client/src/app/feature-projects/machines/project-graph.spec.ts +++ b/graph/client/src/app/feature-projects/machines/project-graph.spec.ts @@ -2,7 +2,7 @@ import type { ProjectGraphDependency, ProjectGraphProjectNode, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { interpret } from 'xstate'; import { projectGraphMachine } from './project-graph.machine'; diff --git a/graph/client/src/app/feature-projects/machines/selectors.ts b/graph/client/src/app/feature-projects/machines/selectors.ts index fd281197203eba..86a9d21b26de57 100644 --- a/graph/client/src/app/feature-projects/machines/selectors.ts +++ b/graph/client/src/app/feature-projects/machines/selectors.ts @@ -1,5 +1,5 @@ // nx-ignore-next-line -import type { ProjectGraphProjectNode } from '@nrwl/devkit'; +import type { ProjectGraphProjectNode } from '@nx/devkit'; import { ProjectGraphSelector } from '../hooks/use-project-graph-selector'; import { GraphPerfReport, WorkspaceLayout } from '../../interfaces'; import { TracingAlgorithmType } from './interfaces'; diff --git a/graph/client/src/app/feature-projects/project-list.tsx b/graph/client/src/app/feature-projects/project-list.tsx index c585b5392ea955..476b5c0db5e76e 100644 --- a/graph/client/src/app/feature-projects/project-list.tsx +++ b/graph/client/src/app/feature-projects/project-list.tsx @@ -5,7 +5,7 @@ import { MapPinIcon, } from '@heroicons/react/24/outline'; // nx-ignore-next-line -import type { ProjectGraphNode } from '@nrwl/devkit'; +import type { ProjectGraphNode } from '@nx/devkit'; import { useProjectGraphSelector } from './hooks/use-project-graph-selector'; import { allProjectsSelector, diff --git a/graph/client/src/app/feature-tasks/task-list.tsx b/graph/client/src/app/feature-tasks/task-list.tsx index 3da187a964cece..2467e67a7f386c 100644 --- a/graph/client/src/app/feature-tasks/task-list.tsx +++ b/graph/client/src/app/feature-tasks/task-list.tsx @@ -1,5 +1,5 @@ // nx-ignore-next-line -import type { ProjectGraphProjectNode } from '@nrwl/devkit'; +import type { ProjectGraphProjectNode } from '@nx/devkit'; import { createTaskName, getProjectsByType, diff --git a/graph/client/src/app/machines/interfaces.ts b/graph/client/src/app/machines/interfaces.ts index f8baa95132a017..7356c6a27ccef7 100644 --- a/graph/client/src/app/machines/interfaces.ts +++ b/graph/client/src/app/machines/interfaces.ts @@ -2,7 +2,7 @@ import type { ProjectGraphDependency, ProjectGraphProjectNode, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { TracingAlgorithmType } from '../feature-projects/machines/interfaces'; // The events that the graph actor handles diff --git a/graph/client/src/app/mock-project-graph-service.ts b/graph/client/src/app/mock-project-graph-service.ts index 2c7162d43ae6f2..404f1d545ff810 100644 --- a/graph/client/src/app/mock-project-graph-service.ts +++ b/graph/client/src/app/mock-project-graph-service.ts @@ -3,7 +3,7 @@ import type { DependencyType, ProjectGraphDependency, ProjectGraphProjectNode, -} from '@nrwl/devkit'; +} from '@nx/devkit'; // nx-ignore-next-line import type { ProjectGraphClientResponse, diff --git a/graph/client/src/app/util.ts b/graph/client/src/app/util.ts index f91786e507f67e..5a190f9cd6b18e 100644 --- a/graph/client/src/app/util.ts +++ b/graph/client/src/app/util.ts @@ -1,5 +1,5 @@ // nx-ignore-next-line -import { ProjectGraphDependency, ProjectGraphProjectNode } from '@nrwl/devkit'; +import { ProjectGraphDependency, ProjectGraphProjectNode } from '@nx/devkit'; import { getEnvironmentConfig } from './hooks/use-environment-config'; import { To, useParams, useSearchParams } from 'react-router-dom'; diff --git a/graph/ui-components/tailwind.config.js b/graph/ui-components/tailwind.config.js index 3b56335f1e460e..a130bfceccd483 100644 --- a/graph/ui-components/tailwind.config.js +++ b/graph/ui-components/tailwind.config.js @@ -1,7 +1,7 @@ const path = require('path'); // nx-ignore-next-line -const { createGlobPatternsForDependencies } = require('@nrwl/react/tailwind'); +const { createGlobPatternsForDependencies } = require('@nx/react/tailwind'); module.exports = { content: [ diff --git a/graph/ui-graph/src/lib/interfaces.ts b/graph/ui-graph/src/lib/interfaces.ts index b414c407633ef6..7407267b310408 100644 --- a/graph/ui-graph/src/lib/interfaces.ts +++ b/graph/ui-graph/src/lib/interfaces.ts @@ -3,7 +3,7 @@ import type { ProjectGraphDependency, ProjectGraphProjectNode, TaskGraph, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { VirtualElement } from '@floating-ui/react'; import { ProjectEdgeNodeTooltipProps, diff --git a/graph/ui-graph/src/lib/util-cytoscape/project-edge.ts b/graph/ui-graph/src/lib/util-cytoscape/project-edge.ts index 7ae7cc7df9bcc8..95bf65e22de4d5 100644 --- a/graph/ui-graph/src/lib/util-cytoscape/project-edge.ts +++ b/graph/ui-graph/src/lib/util-cytoscape/project-edge.ts @@ -1,5 +1,5 @@ // nx-ignore-next-line -import type { ProjectGraphDependency } from '@nrwl/devkit'; +import type { ProjectGraphDependency } from '@nx/devkit'; import * as cy from 'cytoscape'; export interface ProjectEdgeDataDefinition extends cy.NodeDataDefinition { diff --git a/graph/ui-graph/src/lib/util-cytoscape/project-node.ts b/graph/ui-graph/src/lib/util-cytoscape/project-node.ts index 76f9e2422b91b2..8bf75599f80659 100644 --- a/graph/ui-graph/src/lib/util-cytoscape/project-node.ts +++ b/graph/ui-graph/src/lib/util-cytoscape/project-node.ts @@ -1,5 +1,5 @@ // nx-ignore-next-line -import type { ProjectGraphProjectNode } from '@nrwl/devkit'; +import type { ProjectGraphProjectNode } from '@nx/devkit'; import * as cy from 'cytoscape'; import { parseParentDirectoriesFromFilePath } from '../util'; diff --git a/graph/ui-graph/src/lib/util-cytoscape/task-edge.ts b/graph/ui-graph/src/lib/util-cytoscape/task-edge.ts index 125899b36866fb..7e91a9315caccc 100644 --- a/graph/ui-graph/src/lib/util-cytoscape/task-edge.ts +++ b/graph/ui-graph/src/lib/util-cytoscape/task-edge.ts @@ -1,5 +1,5 @@ // nx-ignore-next-line -import type { ProjectGraphDependency } from '@nrwl/devkit'; +import type { ProjectGraphDependency } from '@nx/devkit'; import * as cy from 'cytoscape'; export interface TaskEdgeDataDefinition extends cy.NodeDataDefinition { diff --git a/graph/ui-graph/src/lib/util-cytoscape/task-node.ts b/graph/ui-graph/src/lib/util-cytoscape/task-node.ts index 509d64add1c87a..a654bdd696d3cc 100644 --- a/graph/ui-graph/src/lib/util-cytoscape/task-node.ts +++ b/graph/ui-graph/src/lib/util-cytoscape/task-node.ts @@ -1,5 +1,5 @@ // nx-ignore-next-line -import type { ProjectGraphProjectNode, Task } from '@nrwl/devkit'; +import type { ProjectGraphProjectNode, Task } from '@nx/devkit'; import * as cy from 'cytoscape'; export interface TaskNodeDataDefinition extends cy.NodeDataDefinition { diff --git a/graph/ui-graph/src/lib/util-cytoscape/task-traversal.graph.ts b/graph/ui-graph/src/lib/util-cytoscape/task-traversal.graph.ts index acc78eecd4741e..a1448ee243290b 100644 --- a/graph/ui-graph/src/lib/util-cytoscape/task-traversal.graph.ts +++ b/graph/ui-graph/src/lib/util-cytoscape/task-traversal.graph.ts @@ -1,5 +1,5 @@ // nx-ignore-next-line -import type { ProjectGraphProjectNode } from '@nrwl/devkit'; +import type { ProjectGraphProjectNode } from '@nx/devkit'; import { TaskGraphRecord } from '../interfaces'; import { TaskNode } from './task-node'; import { TaskEdge } from './task-edge'; diff --git a/graph/ui-graph/src/lib/util.ts b/graph/ui-graph/src/lib/util.ts index 6e8eb2bd3cf9db..b3a6a12915f137 100644 --- a/graph/ui-graph/src/lib/util.ts +++ b/graph/ui-graph/src/lib/util.ts @@ -1,5 +1,5 @@ // nx-ignore-next-line -import { ProjectGraphDependency } from '@nrwl/devkit'; +import { ProjectGraphDependency } from '@nx/devkit'; export function trimBackSlash(value: string): string { return value.replace(/\/$/, ''); diff --git a/graph/ui-graph/tailwind.config.js b/graph/ui-graph/tailwind.config.js index 3b56335f1e460e..a130bfceccd483 100644 --- a/graph/ui-graph/tailwind.config.js +++ b/graph/ui-graph/tailwind.config.js @@ -1,7 +1,7 @@ const path = require('path'); // nx-ignore-next-line -const { createGlobPatternsForDependencies } = require('@nrwl/react/tailwind'); +const { createGlobPatternsForDependencies } = require('@nx/react/tailwind'); module.exports = { content: [ diff --git a/graph/ui-tooltips/tailwind.config.js b/graph/ui-tooltips/tailwind.config.js index 3b56335f1e460e..a130bfceccd483 100644 --- a/graph/ui-tooltips/tailwind.config.js +++ b/graph/ui-tooltips/tailwind.config.js @@ -1,7 +1,7 @@ const path = require('path'); // nx-ignore-next-line -const { createGlobPatternsForDependencies } = require('@nrwl/react/tailwind'); +const { createGlobPatternsForDependencies } = require('@nx/react/tailwind'); module.exports = { content: [ diff --git a/nx-dev/nx-dev-e2e/cypress.config.ts b/nx-dev/nx-dev-e2e/cypress.config.ts index 16b93cf381e071..35a56891fe06e6 100644 --- a/nx-dev/nx-dev-e2e/cypress.config.ts +++ b/nx-dev/nx-dev-e2e/cypress.config.ts @@ -1,4 +1,4 @@ -import { nxE2EPreset } from '@nrwl/cypress/plugins/cypress-preset'; +import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset'; import { defineConfig } from 'cypress'; const cypressJsonConfig = { diff --git a/nx-dev/nx-dev/project.json b/nx-dev/nx-dev/project.json index 63a7c88b88eb78..9b4305a425a2ba 100644 --- a/nx-dev/nx-dev/project.json +++ b/nx-dev/nx-dev/project.json @@ -16,7 +16,7 @@ "outputPath": "dist/nx-dev/nx-dev", "commands": [ "nx run nx-dev:sitemap", - "ts-node -P ./scripts/tsconfig.release.json ./scripts/documentation/internal-link-checker.ts" + "ts-node -P ./scripts/tsconfig.scripts.json ./scripts/documentation/internal-link-checker.ts" ], "parallel": false } diff --git a/nx.json b/nx.json index 65533b65e1a3de..6ca8a6c06021c4 100644 --- a/nx.json +++ b/nx.json @@ -12,6 +12,7 @@ "build", "lint-base", "lint", + "build-ng", "build-base", "build-native", "e2e", diff --git a/package.json b/package.json index 7ef5a8841e59a8..a60307dc563630 100644 --- a/package.json +++ b/package.json @@ -58,6 +58,7 @@ "@ngrx/router-store": "~15.3.0", "@ngrx/store": "~15.3.0", "@nguniversal/builders": "~15.2.0", + "@nrwl/angular": "16.0.0-beta.0", "@nrwl/cypress": "16.0.0-beta.0", "@nrwl/devkit": "16.0.0-beta.0", "@nrwl/eslint-plugin-nx": "16.0.0-beta.0", diff --git a/packages-legacy/angular/README.md b/packages-legacy/angular/README.md new file mode 100644 index 00000000000000..e26a77d7e43582 --- /dev/null +++ b/packages-legacy/angular/README.md @@ -0,0 +1,11 @@ +## @nrwl/angular has been deprecated! + +@nrwl/angular has been deprecated in favor of [@nx/angular](https://www.npmjs.com/package/@nx/angular). Please use that instead. + +@nrwl/angular will no longer be published in Nx v17. + +

Nx - Smart, Fast and Extensible Build System

+ +# Nx: Smart, Fast and Extensible Build System + +Nx is a next generation build system with first class monorepo support and powerful integrations. diff --git a/packages-legacy/angular/executors.json b/packages-legacy/angular/executors.json new file mode 100644 index 00000000000000..bfaad74b175823 --- /dev/null +++ b/packages-legacy/angular/executors.json @@ -0,0 +1,61 @@ +{ + "executors": { + "delegate-build": { + "implementation": "@nx/angular/src/executors/delegate-build/delegate-build.impl", + "schema": "@nx/angular/src/executors/delegate-build/schema.json", + "description": "Delegates the build to a different target while supporting incremental builds." + }, + "ng-packagr-lite": { + "implementation": "@nx/angular/src/executors/ng-packagr-lite/ng-packagr-lite.impl", + "schema": "@nx/angular/src/executors/ng-packagr-lite/schema.json", + "description": "Builds a library with support for incremental builds.\nThis executor is meant to be used with buildable libraries in an incremental build scenario. It is similar to the `@nrwl/angular:package` executor but with some key differences:\n- It doesn't run `ngcc` automatically (`ngcc` needs to be run separately beforehand if needed, this can be done in a `postinstall` hook on `package.json`).\n- It only produces ESM2020 bundles.\n- It doesn't generate package exports in the `package.json`." + }, + "package": { + "implementation": "@nx/angular/src/executors/package/package.impl", + "schema": "@nx/angular/src/executors/package/schema.json", + "description": "Builds and packages an Angular library producing an output following the Angular Package Format (APF) to be distributed as an NPM package.\nThis executor is similar to the `@angular-devkit/build-angular:ng-packagr` with additional support for incremental builds." + } + }, + "builders": { + "delegate-build": { + "implementation": "@nx/angular/src/executors/delegate-build/compat", + "schema": "@nx/angular/src/executors/delegate-build/schema.json", + "description": "Delegates the build to a different target while supporting incremental builds." + }, + "ng-packagr-lite": { + "implementation": "@nx/angular/src/executors/ng-packagr-lite/compat", + "schema": "@nx/angular/src/executors/ng-packagr-lite/schema.json", + "description": "Builds a library with support for incremental builds.\nThis executor is meant to be used with buildable libraries in an incremental build scenario. It is similar to the `@nrwl/angular:package` executor but with some key differences:\n- It doesn't run `ngcc` automatically (`ngcc` needs to be run separately beforehand if needed, this can be done in a `postinstall` hook on `package.json`)\n- It only produces ESM2020 bundles\n- It doesn't generate package exports in the `package.json`" + }, + "package": { + "implementation": "@nx/angular/src/executors/package/compat", + "schema": "@nx/angular/src/executors/package/schema.json", + "description": "Builds and packages an Angular library to be distributed as an NPM package. It supports incremental builds." + }, + "webpack-browser": { + "implementation": "@nx/angular/src/builders/webpack-browser/webpack-browser.impl", + "schema": "@nx/angular/src/builders/webpack-browser/schema.json", + "description": "The `webpack-browser` executor is very similar to the standard `browser` builder provided by the Angular Devkit. It allows you to build your Angular application to a build artifact that can be hosted online. There are some key differences: \n- Supports Custom Webpack Configurations \n- Supports Incremental Building" + }, + "webpack-dev-server": { + "implementation": "@nx/angular/src/builders/webpack-dev-server/webpack-dev-server.impl", + "schema": "@nx/angular/src/builders/webpack-dev-server/schema.json", + "description": "The `webpack-dev-server` executor is very similar to the standard `dev-server` builder provided by the Angular Devkit. It is usually used in tandem with `@nrwl/angular:webpack-browser` when your Angular application uses a custom webpack configuration." + }, + "webpack-server": { + "implementation": "@nx/angular/src/builders/webpack-server/webpack-server.impl", + "schema": "@nx/angular/src/builders/webpack-server/schema.json", + "description": "The `webpack-server` executor is very similar to the standard `server` builder provided by the Angular Devkit. It is usually used in tandem with `@nrwl/angular:webpack-browser` when your Angular application uses a custom webpack configuration and NgUniversal for SSR." + }, + "module-federation-dev-server": { + "implementation": "@nx/angular/src/builders/module-federation-dev-server/module-federation-dev-server.impl", + "schema": "@nx/angular/src/builders/module-federation-dev-server/schema.json", + "description": "The module-federation-dev-server executor is reserved exclusively for use with host Module Federation applications. It allows the user to specify which remote applications should be served with the host." + }, + "module-federation-dev-ssr": { + "implementation": "@nx/angular/src/builders/module-federation-dev-ssr/module-federation-dev-ssr.impl", + "schema": "@nx/angular/src/builders/module-federation-dev-ssr/schema.json", + "description": "The module-federation-dev-ssr executor is reserved exclusively for use with host Module Federation applications that use SSR. It allows the user to specify which remote applications should be served with the host." + } + } +} diff --git a/packages-legacy/angular/executors.ts b/packages-legacy/angular/executors.ts new file mode 100644 index 00000000000000..ef085598bcbe5a --- /dev/null +++ b/packages-legacy/angular/executors.ts @@ -0,0 +1 @@ +export * from '@nx/angular/executors'; diff --git a/packages-legacy/angular/generators.json b/packages-legacy/angular/generators.json new file mode 100644 index 00000000000000..e56e8662de1abf --- /dev/null +++ b/packages-legacy/angular/generators.json @@ -0,0 +1,4 @@ +{ + "extends": ["@nx/angular"], + "schematics": {} +} diff --git a/packages-legacy/angular/generators.ts b/packages-legacy/angular/generators.ts new file mode 100644 index 00000000000000..bf80a75ccf9717 --- /dev/null +++ b/packages-legacy/angular/generators.ts @@ -0,0 +1 @@ +export * from '@nx/angular/generators'; diff --git a/packages-legacy/angular/index.ts b/packages-legacy/angular/index.ts new file mode 100644 index 00000000000000..ffd52501b3aaec --- /dev/null +++ b/packages-legacy/angular/index.ts @@ -0,0 +1 @@ +export * from '@nx/angular'; diff --git a/packages-legacy/angular/mf/index.ts b/packages-legacy/angular/mf/index.ts new file mode 100644 index 00000000000000..9e619e9e02336c --- /dev/null +++ b/packages-legacy/angular/mf/index.ts @@ -0,0 +1 @@ +export * from '@nx/angular/mf'; diff --git a/packages-legacy/angular/mf/ng-package.json b/packages-legacy/angular/mf/ng-package.json new file mode 100644 index 00000000000000..bb6786ef97ad71 --- /dev/null +++ b/packages-legacy/angular/mf/ng-package.json @@ -0,0 +1,6 @@ +{ + "$schema": "../../../node_modules/ng-packagr/ng-package.schema.json", + "lib": { + "entryFile": "index.ts" + } +} diff --git a/packages-legacy/angular/module-federation/index.ts b/packages-legacy/angular/module-federation/index.ts new file mode 100644 index 00000000000000..6d0ac0629dacaf --- /dev/null +++ b/packages-legacy/angular/module-federation/index.ts @@ -0,0 +1 @@ +export * from '@nx/angular/module-federation'; diff --git a/packages-legacy/angular/ng-package.json b/packages-legacy/angular/ng-package.json new file mode 100644 index 00000000000000..c72d66f4cfbd82 --- /dev/null +++ b/packages-legacy/angular/ng-package.json @@ -0,0 +1,32 @@ +{ + "$schema": "../../node_modules/ng-packagr/ng-package.schema.json", + "lib": { + "entryFile": "index.ts" + }, + "dest": "../../build/packages/angular-legacy", + "deleteDestPath": false, + "allowedNonPeerDependencies": [ + "@nx/", + "@nrwl/", + "@angular-devkit", + "@angular-eslint/", + "@nguniversal/builders", + "@schematics", + "@phenomnomnominal/tsquery", + "@typescript-eslint/", + "chalk", + "chokidar", + "ignore", + "minimatch", + "rxjs-for-await", + "webpack-merge", + "ts-node", + "tsconfig-paths", + "semver", + "webpack", + "http-server", + "magic-string", + "enquirer" + ], + "keepLifecycleScripts": true +} diff --git a/packages-legacy/angular/package.json b/packages-legacy/angular/package.json new file mode 100644 index 00000000000000..a2e99cdbbf7719 --- /dev/null +++ b/packages-legacy/angular/package.json @@ -0,0 +1,44 @@ +{ + "name": "@nrwl/angular", + "version": "0.0.1", + "private": false, + "description": "The Nx Plugin for Angular contains executors, generators, and utilities for managing Angular applications and libraries within an Nx workspace. It provides: \n\n- Integration with libraries such as Storybook, Jest, ESLint, Tailwind CSS, and Cypress. \n\n- Generators to help scaffold code quickly (like: Micro Frontends, Libraries, both internal to your codebase and publishable to npm) \n\n- Upgrading AngularJS applications \n\n- Single Component Application Modules (SCAMs) \n\n- NgRx helpers. \n\n- Utilities for automatic workspace refactoring.", + "repository": { + "type": "git", + "url": "https://github.com/nrwl/nx.git", + "directory": "packages-legacy/angular" + }, + "keywords": [ + "Monorepo", + "Angular", + "Jest", + "Cypress", + "CLI" + ], + "exports": { + "./generators": "./generators.js", + "./executors": "./executors.js", + "./tailwind": "./tailwind.js", + "./src/generators/utils": "./src/generators/utils/index.js", + "./src/utils": "./src/utils/public-api.js", + "./module-federation": "./module-federation/index.js", + "./plugins/component-testing": "./plugins/component-testing.js" + }, + "author": "Victor Savkin", + "license": "MIT", + "bugs": { + "url": "https://github.com/nrwl/nx/issues" + }, + "homepage": "https://nx.dev", + "builders": "./executors.json", + "schematics": "./generators.json", + "dependencies": { + "@nx/angular": "file:../../packages/angular" + }, + "publishConfig": { + "access": "public" + }, + "nx-migrations": { + "migrations": "@nx/angular/migrations.json" + } +} diff --git a/packages-legacy/angular/plugins/component-testing.ts b/packages-legacy/angular/plugins/component-testing.ts new file mode 100644 index 00000000000000..2ff8d282b94298 --- /dev/null +++ b/packages-legacy/angular/plugins/component-testing.ts @@ -0,0 +1 @@ +export * from '@nx/angular/plugins/component-testing'; diff --git a/packages-legacy/angular/project.json b/packages-legacy/angular/project.json new file mode 100644 index 00000000000000..e251e3e9601a68 --- /dev/null +++ b/packages-legacy/angular/project.json @@ -0,0 +1,53 @@ +{ + "name": "angular-legacy", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "packages-legacy/angular", + "projectType": "library", + "targets": { + "build-ng": { + "dependsOn": ["^build", "build-base"], + "executor": "@nrwl/angular:package", + "options": { + "project": "packages-legacy/angular/ng-package.json", + "tsConfig": "packages-legacy/angular/tsconfig.json" + }, + "outputs": ["build/packages/angular-legacy"] + }, + "build-base": { + "executor": "@nrwl/js:tsc", + "dependsOn": ["^build"], + "options": { + "main": "packages-legacy/angular/index.ts", + "tsConfig": "packages-legacy/angular/tsconfig.json", + "outputPath": "build/packages/angular-legacy", + "updateBuildableProjectDepsInPackageJson": false, + "assets": [ + { + "input": "packages-legacy/angular", + "glob": "**/*.json", + "ignore": ["**/tsconfig*.json", "project.json"], + "output": "/" + }, + { + "input": "packages-legacy/angular", + "glob": "**/*.d.ts", + "output": "/" + }, + { + "input": "", + "glob": "LICENSE", + "output": "/" + } + ] + } + }, + "build": { + "dependsOn": ["build-ng", "build-base", "^build"], + "executor": "nx:run-commands", + "options": { + "command": "echo 'Built angular-legacy'" + } + } + }, + "implicitDependencies": ["workspace", "cypress", "jest"] +} diff --git a/packages-legacy/angular/tailwind.ts b/packages-legacy/angular/tailwind.ts new file mode 100644 index 00000000000000..b257ad4f99cb48 --- /dev/null +++ b/packages-legacy/angular/tailwind.ts @@ -0,0 +1 @@ +export * from '@nx/angular/tailwind'; diff --git a/packages-legacy/angular/testing/index.ts b/packages-legacy/angular/testing/index.ts new file mode 100644 index 00000000000000..9d77ff3992a875 --- /dev/null +++ b/packages-legacy/angular/testing/index.ts @@ -0,0 +1 @@ +export { readAll, readFirst } from '@nx/angular/testing'; diff --git a/packages-legacy/angular/testing/ng-package.json b/packages-legacy/angular/testing/ng-package.json new file mode 100644 index 00000000000000..bb6786ef97ad71 --- /dev/null +++ b/packages-legacy/angular/testing/ng-package.json @@ -0,0 +1,6 @@ +{ + "$schema": "../../../node_modules/ng-packagr/ng-package.schema.json", + "lib": { + "entryFile": "index.ts" + } +} diff --git a/packages-legacy/angular/tsconfig.json b/packages-legacy/angular/tsconfig.json new file mode 100644 index 00000000000000..8654d01991acaa --- /dev/null +++ b/packages-legacy/angular/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../tsconfig.base.json", + "angularCompilerOptions": { + "compilationMode": "partial" + }, + "include": ["**/*.ts"], + "files": ["index.ts"] +} diff --git a/packages-legacy/cypress/README.md b/packages-legacy/cypress/README.md new file mode 100644 index 00000000000000..dc0547750ad48e --- /dev/null +++ b/packages-legacy/cypress/README.md @@ -0,0 +1,11 @@ +## @nrwl/cypress has been deprecated! + +@nrwl/cypress has been deprecated in favor of [@nx/cypress](https://www.npmjs.com/package/@nx/cypress). Please use that instead. + +@nrwl/cypress will no longer be published in Nx v17. + +

Nx - Smart, Fast and Extensible Build System

+ +# Nx: Smart, Fast and Extensible Build System + +Nx is a next generation build system with first class monorepo support and powerful integrations. diff --git a/packages-legacy/cypress/executors.json b/packages-legacy/cypress/executors.json new file mode 100644 index 00000000000000..47e53c5430d619 --- /dev/null +++ b/packages-legacy/cypress/executors.json @@ -0,0 +1,16 @@ +{ + "builders": { + "cypress": { + "implementation": "@nx/cypress/src/executors/cypress/compat", + "schema": "@nx/cypress/src/executors/cypress/schema.json", + "description": "Run Cypress E2E tests." + } + }, + "executors": { + "cypress": { + "implementation": "@nx/cypress/src/executors/cypress/cypress.impl", + "schema": "@nx/cypress/src/executors/cypress/schema.json", + "description": "Run Cypress E2E tests." + } + } +} diff --git a/packages-legacy/cypress/generators.json b/packages-legacy/cypress/generators.json new file mode 100644 index 00000000000000..6546b765504d99 --- /dev/null +++ b/packages-legacy/cypress/generators.json @@ -0,0 +1,4 @@ +{ + "extends": ["@nx/cypress"], + "schematics": {} +} diff --git a/packages-legacy/cypress/index.ts b/packages-legacy/cypress/index.ts new file mode 100644 index 00000000000000..72debf335488e6 --- /dev/null +++ b/packages-legacy/cypress/index.ts @@ -0,0 +1 @@ +export * from '@nx/cypress'; diff --git a/packages-legacy/cypress/package.json b/packages-legacy/cypress/package.json new file mode 100644 index 00000000000000..acd8be0e557a01 --- /dev/null +++ b/packages-legacy/cypress/package.json @@ -0,0 +1,41 @@ +{ + "name": "@nrwl/cypress", + "version": "0.0.1", + "private": false, + "description": "The Nx Plugin for Cypress contains executors and generators allowing your workspace to use the powerful Cypress integration testing capabilities.", + "repository": { + "type": "git", + "url": "https://github.com/nrwl/nx.git", + "directory": "packages-legacy/cypress" + }, + "keywords": [ + "Monorepo", + "Angular", + "React", + "Web", + "Node", + "Nest", + "Jest", + "Cypress", + "CLI" + ], + "main": "./index", + "typings": "./index.d.ts", + "author": "Victor Savkin", + "license": "MIT", + "bugs": { + "url": "https://github.com/nrwl/nx/issues" + }, + "homepage": "https://nx.dev", + "schematics": "./generators.json", + "builders": "./executors.json", + "dependencies": { + "@nx/cypress": "file:../../packages/cypress" + }, + "publishConfig": { + "access": "public" + }, + "nx-migrations": { + "migrations": "@nx/cypress/migrations.json" + } +} diff --git a/packages-legacy/cypress/plugins/cypress-preset.ts b/packages-legacy/cypress/plugins/cypress-preset.ts new file mode 100644 index 00000000000000..1bfe579ba34332 --- /dev/null +++ b/packages-legacy/cypress/plugins/cypress-preset.ts @@ -0,0 +1 @@ +export * from '@nx/cypress/plugins/cypress-preset'; diff --git a/packages-legacy/cypress/project.json b/packages-legacy/cypress/project.json new file mode 100644 index 00000000000000..47592885667f88 --- /dev/null +++ b/packages-legacy/cypress/project.json @@ -0,0 +1,36 @@ +{ + "name": "cypress-legacy", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "packages-legacy/cypress", + "projectType": "library", + "targets": { + "build": { + "executor": "@nrwl/js:tsc", + "dependsOn": ["^build"], + "options": { + "main": "packages-legacy/cypress/index.ts", + "tsConfig": "packages-legacy/cypress/tsconfig.json", + "outputPath": "build/packages/cypress-legacy", + "updateBuildableProjectDepsInPackageJson": false, + "assets": [ + { + "input": "packages-legacy/cypress", + "glob": "**/*.json", + "ignore": ["**/tsconfig*.json", "project.json"], + "output": "/" + }, + { + "input": "packages-legacy/cypress", + "glob": "**/*.d.ts", + "output": "/" + }, + { + "input": "", + "glob": "LICENSE", + "output": "/" + } + ] + } + } + } +} diff --git a/packages-legacy/cypress/tsconfig.json b/packages-legacy/cypress/tsconfig.json new file mode 100644 index 00000000000000..133314b126cffc --- /dev/null +++ b/packages-legacy/cypress/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": {}, + "include": ["**/*.ts"], + "files": ["index.ts"] +} diff --git a/packages-legacy/detox/README.md b/packages-legacy/detox/README.md new file mode 100644 index 00000000000000..cb8212aec6f658 --- /dev/null +++ b/packages-legacy/detox/README.md @@ -0,0 +1,11 @@ +## @nrwl/detox has been deprecated! + +@nrwl/detox has been deprecated in favor of [@nx/detox](https://www.npmjs.com/package/@nx/detox). Please use that instead. + +@nrwl/detox will no longer be published in Nx v17. + +

Nx - Smart, Fast and Extensible Build System

+ +# Nx: Smart, Fast and Extensible Build System + +Nx is a next generation build system with first class monorepo support and powerful integrations. diff --git a/packages-legacy/detox/executors.json b/packages-legacy/detox/executors.json new file mode 100644 index 00000000000000..df862b7de06e90 --- /dev/null +++ b/packages-legacy/detox/executors.json @@ -0,0 +1,14 @@ +{ + "executors": { + "build": { + "implementation": "@nx/detox/src/executors/build/build.impl", + "schema": "@nx/detox/src/executors/build/schema.json", + "description": "Run the command defined in build property of the specified configuration." + }, + "test": { + "implementation": "@nx/detox/src/executors/test/test.impl", + "schema": "@nx/detox/src/executors/test/schema.json", + "description": "Initiating your detox test suite." + } + } +} diff --git a/packages-legacy/detox/generators.json b/packages-legacy/detox/generators.json new file mode 100644 index 00000000000000..4334ccca21e3a5 --- /dev/null +++ b/packages-legacy/detox/generators.json @@ -0,0 +1,4 @@ +{ + "extends": ["@nx/detox"], + "schematics": {} +} diff --git a/packages-legacy/detox/index.ts b/packages-legacy/detox/index.ts new file mode 100644 index 00000000000000..6b614d03fd4d1c --- /dev/null +++ b/packages-legacy/detox/index.ts @@ -0,0 +1 @@ +export * from '@nx/detox'; diff --git a/packages-legacy/detox/package.json b/packages-legacy/detox/package.json new file mode 100644 index 00000000000000..eed31dc47803da --- /dev/null +++ b/packages-legacy/detox/package.json @@ -0,0 +1,38 @@ +{ + "name": "@nrwl/detox", + "version": "0.0.1", + "private": false, + "description": "The Nx Plugin for Detox contains executors and generators for allowing your workspace to use the powerful Detox integration testing capabilities.", + "keywords": [ + "Monorepo", + "React", + "Web", + "Native", + "CLI", + "Detox" + ], + "homepage": "https://nx.dev", + "bugs": { + "url": "https://github.com/nrwl/nx/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/nrwl/nx.git", + "directory": "packages-legacy/detox" + }, + "license": "MIT", + "author": "Victor Savkin", + "main": "./index", + "types": "index.d.ts", + "dependencies": { + "@nx/detox": "file:../../packages/detox" + }, + "builders": "./executors.json", + "schematics": "./generators.json", + "publishConfig": { + "access": "public" + }, + "nx-migrations": { + "migrations": "@nx/detox/migrations.json" + } +} diff --git a/packages-legacy/detox/project.json b/packages-legacy/detox/project.json new file mode 100644 index 00000000000000..d2856f7957f425 --- /dev/null +++ b/packages-legacy/detox/project.json @@ -0,0 +1,36 @@ +{ + "name": "detox-legacy", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "packages-legacy/detox", + "projectType": "library", + "targets": { + "build": { + "executor": "@nrwl/js:tsc", + "dependsOn": ["^build"], + "options": { + "main": "packages-legacy/detox/index.ts", + "tsConfig": "packages-legacy/detox/tsconfig.json", + "outputPath": "build/packages/detox-legacy", + "updateBuildableProjectDepsInPackageJson": false, + "assets": [ + { + "input": "packages-legacy/detox", + "glob": "**/*.json", + "ignore": ["**/tsconfig*.json", "project.json"], + "output": "/" + }, + { + "input": "packages-legacy/detox", + "glob": "**/*.d.ts", + "output": "/" + }, + { + "input": "", + "glob": "LICENSE", + "output": "/" + } + ] + } + } + } +} diff --git a/packages-legacy/detox/tsconfig.json b/packages-legacy/detox/tsconfig.json new file mode 100644 index 00000000000000..133314b126cffc --- /dev/null +++ b/packages-legacy/detox/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": {}, + "include": ["**/*.ts"], + "files": ["index.ts"] +} diff --git a/packages-legacy/devkit/README.md b/packages-legacy/devkit/README.md new file mode 100644 index 00000000000000..3bf27296012643 --- /dev/null +++ b/packages-legacy/devkit/README.md @@ -0,0 +1,11 @@ +## @nrwl/devkit has been deprecated! + +@nrwl/devkit has been deprecated in favor of [@nx/devkit](https://www.npmjs.com/package/@nx/devkit). Please use that instead. + +@nrwl/devkit will no longer be published in Nx v17. + +

Nx - Smart, Fast and Extensible Build System

+ +# Nx: Smart, Fast and Extensible Build System + +Nx is a next generation build system with first class monorepo support and powerful integrations. diff --git a/packages-legacy/devkit/index.ts b/packages-legacy/devkit/index.ts new file mode 100644 index 00000000000000..a122ec53a65fe4 --- /dev/null +++ b/packages-legacy/devkit/index.ts @@ -0,0 +1 @@ +export * from '@nx/devkit'; diff --git a/packages-legacy/devkit/package.json b/packages-legacy/devkit/package.json new file mode 100644 index 00000000000000..d11f348ddbe56d --- /dev/null +++ b/packages-legacy/devkit/package.json @@ -0,0 +1,39 @@ +{ + "name": "@nrwl/devkit", + "version": "0.0.1", + "private": false, + "description": "The Nx Devkit is used to customize Nx for different technologies and use cases. It contains many utility functions for reading and writing files, updating configuration, working with Abstract Syntax Trees(ASTs), and more.", + "repository": { + "type": "git", + "url": "https://github.com/nrwl/nx.git", + "directory": "packages-legacy/devkit" + }, + "keywords": [ + "Monorepo", + "Angular", + "React", + "Web", + "Node", + "Nest", + "Jest", + "Cypress", + "CLI" + ], + "main": "./index", + "typings": "./index.d.ts", + "author": "Victor Savkin", + "license": "MIT", + "bugs": { + "url": "https://github.com/nrwl/nx/issues" + }, + "homepage": "https://nx.dev", + "dependencies": { + "@nx/devkit": "file:../../packages/devkit" + }, + "publishConfig": { + "access": "public" + }, + "nx-migrations": { + "migrations": "@nx/devkit/migrations.json" + } +} diff --git a/packages-legacy/devkit/project.json b/packages-legacy/devkit/project.json new file mode 100644 index 00000000000000..16cb4c474a1836 --- /dev/null +++ b/packages-legacy/devkit/project.json @@ -0,0 +1,36 @@ +{ + "name": "devkit-legacy", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "packages-legacy/devkit", + "projectType": "library", + "targets": { + "build": { + "executor": "@nrwl/js:tsc", + "dependsOn": ["^build"], + "options": { + "main": "packages-legacy/devkit/index.ts", + "tsConfig": "packages-legacy/devkit/tsconfig.json", + "outputPath": "build/packages/devkit-legacy", + "updateBuildableProjectDepsInPackageJson": false, + "assets": [ + { + "input": "packages-legacy/devkit", + "glob": "**/*.json", + "ignore": ["**/tsconfig*.json", "project.json"], + "output": "/" + }, + { + "input": "packages-legacy/devkit", + "glob": "**/*.d.ts", + "output": "/" + }, + { + "input": "", + "glob": "LICENSE", + "output": "/" + } + ] + } + } + } +} diff --git a/packages-legacy/devkit/testing.ts b/packages-legacy/devkit/testing.ts new file mode 100644 index 00000000000000..b0b2450860ab62 --- /dev/null +++ b/packages-legacy/devkit/testing.ts @@ -0,0 +1 @@ +export * from '@nx/devkit/testing'; diff --git a/packages-legacy/devkit/tsconfig.json b/packages-legacy/devkit/tsconfig.json new file mode 100644 index 00000000000000..133314b126cffc --- /dev/null +++ b/packages-legacy/devkit/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": {}, + "include": ["**/*.ts"], + "files": ["index.ts"] +} diff --git a/packages-legacy/esbuild/README.md b/packages-legacy/esbuild/README.md new file mode 100644 index 00000000000000..051007d6d736f6 --- /dev/null +++ b/packages-legacy/esbuild/README.md @@ -0,0 +1,11 @@ +## @nrwl/esbuild has been deprecated! + +@nrwl/esbuild has been deprecated in favor of [@nx/esbuild](https://www.npmjs.com/package/@nx/esbuild). Please use that instead. + +@nrwl/esbuild will no longer be published in Nx v17. + +

Nx - Smart, Fast and Extensible Build System

+ +# Nx: Smart, Fast and Extensible Build System + +Nx is a next generation build system with first class monorepo support and powerful integrations. diff --git a/packages-legacy/esbuild/executors.json b/packages-legacy/esbuild/executors.json new file mode 100644 index 00000000000000..b04ba4b42504eb --- /dev/null +++ b/packages-legacy/esbuild/executors.json @@ -0,0 +1,16 @@ +{ + "builders": { + "esbuild": { + "implementation": "@nx/esbuild/src/executors/esbuild/compat", + "schema": "@nx/esbuild/src/executors/esbuild/schema.json", + "description": "Bundle a package using EsBuild." + } + }, + "executors": { + "esbuild": { + "implementation": "@nx/esbuild/src/executors/esbuild/esbuild.impl", + "schema": "@nx/esbuild/src/executors/esbuild/schema.json", + "description": "Bundle a package using EsBuild." + } + } +} diff --git a/packages-legacy/esbuild/generators.json b/packages-legacy/esbuild/generators.json new file mode 100644 index 00000000000000..8c6b4903cb7c89 --- /dev/null +++ b/packages-legacy/esbuild/generators.json @@ -0,0 +1,4 @@ +{ + "extends": ["@nx/esbuild"], + "schematics": {} +} diff --git a/packages-legacy/esbuild/index.ts b/packages-legacy/esbuild/index.ts new file mode 100644 index 00000000000000..279cccf0aea37d --- /dev/null +++ b/packages-legacy/esbuild/index.ts @@ -0,0 +1 @@ +export * from '@nx/esbuild'; diff --git a/packages-legacy/esbuild/package.json b/packages-legacy/esbuild/package.json new file mode 100644 index 00000000000000..c2ec13908b2025 --- /dev/null +++ b/packages-legacy/esbuild/package.json @@ -0,0 +1,36 @@ +{ + "name": "@nrwl/esbuild", + "version": "0.0.1", + "private": false, + "description": "The Nx Plugin for esbuild contains executors and generators that support building applications using esbuild", + "repository": { + "type": "git", + "url": "https://github.com/nrwl/nx.git", + "directory": "packages-legacy/esbuild" + }, + "keywords": [ + "Monorepo", + "EsBuild", + "Web", + "CLI" + ], + "main": "./index", + "typings": "./index.d.ts", + "author": "Victor Savkin", + "license": "MIT", + "bugs": { + "url": "https://github.com/nrwl/nx/issues" + }, + "homepage": "https://nx.dev", + "schematics": "./generators.json", + "builders": "./executors.json", + "dependencies": { + "@nx/esbuild": "file:../../packages/esbuild" + }, + "publishConfig": { + "access": "public" + }, + "nx-migrations": { + "migrations": "@nx/esbuild/migrations.json" + } +} diff --git a/packages-legacy/esbuild/project.json b/packages-legacy/esbuild/project.json new file mode 100644 index 00000000000000..26799d19c20b2a --- /dev/null +++ b/packages-legacy/esbuild/project.json @@ -0,0 +1,36 @@ +{ + "name": "esbuild-legacy", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "packages-legacy/esbuild", + "projectType": "library", + "targets": { + "build": { + "executor": "@nrwl/js:tsc", + "dependsOn": ["^build"], + "options": { + "main": "packages-legacy/esbuild/index.ts", + "tsConfig": "packages-legacy/esbuild/tsconfig.json", + "outputPath": "build/packages/esbuild-legacy", + "updateBuildableProjectDepsInPackageJson": false, + "assets": [ + { + "input": "packages-legacy/esbuild", + "glob": "**/*.json", + "ignore": ["**/tsconfig*.json", "project.json"], + "output": "/" + }, + { + "input": "packages-legacy/esbuild", + "glob": "**/*.d.ts", + "output": "/" + }, + { + "input": "", + "glob": "LICENSE", + "output": "/" + } + ] + } + } + } +} diff --git a/packages-legacy/esbuild/tsconfig.json b/packages-legacy/esbuild/tsconfig.json new file mode 100644 index 00000000000000..133314b126cffc --- /dev/null +++ b/packages-legacy/esbuild/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": {}, + "include": ["**/*.ts"], + "files": ["index.ts"] +} diff --git a/packages-legacy/eslint-plugin-nx/README.md b/packages-legacy/eslint-plugin-nx/README.md new file mode 100644 index 00000000000000..a4078e1c78d23c --- /dev/null +++ b/packages-legacy/eslint-plugin-nx/README.md @@ -0,0 +1,11 @@ +## @nrwl/eslint-plugin-nx has been deprecated! + +@nrwl/eslint-plugin-nx has been deprecated in favor of [@nx/eslint-plugin-nx](https://www.npmjs.com/package/@nx/eslint-plugin-nx). Please use that instead. + +@nrwl/eslint-plugin-nx will no longer be published in Nx v17. + +

Nx - Smart, Fast and Extensible Build System

+ +# Nx: Smart, Fast and Extensible Build System + +Nx is a next generation build system with first class monorepo support and powerful integrations. diff --git a/packages-legacy/eslint-plugin-nx/index.ts b/packages-legacy/eslint-plugin-nx/index.ts new file mode 100644 index 00000000000000..8ee2780ec94318 --- /dev/null +++ b/packages-legacy/eslint-plugin-nx/index.ts @@ -0,0 +1 @@ +export * from '@nx/eslint-plugin-nx'; diff --git a/packages-legacy/eslint-plugin-nx/package.json b/packages-legacy/eslint-plugin-nx/package.json new file mode 100644 index 00000000000000..71b295245f955e --- /dev/null +++ b/packages-legacy/eslint-plugin-nx/package.json @@ -0,0 +1,35 @@ +{ + "name": "@nrwl/eslint-plugin-nx", + "version": "0.0.1", + "private": false, + "description": "The eslint-plugin-nx package is an ESLint plugin that contains a collection of recommended ESLint rule configurations which you can extend from in your own ESLint configs, as well as an Nx-specific lint rule called enforce-module-boundaries.", + "repository": { + "type": "git", + "url": "https://github.com/nrwl/nx.git", + "directory": "packages-legacy/eslint-plugin-nx" + }, + "keywords": [ + "Monorepo", + "Web", + "Lint", + "ESLint", + "CLI" + ], + "main": "./src/index.js", + "typings": "./src/index.d.ts", + "author": "Victor Savkin", + "license": "MIT", + "bugs": { + "url": "https://github.com/nrwl/nx/issues" + }, + "homepage": "https://nx.dev", + "dependencies": { + "@nx/eslint-plugin-nx": "file:../../packages/eslint-plugin-nx" + }, + "publishConfig": { + "access": "public" + }, + "nx-migrations": { + "migrations": "@nx/eslint-plugin-nx/migrations.json" + } +} diff --git a/packages-legacy/eslint-plugin-nx/project.json b/packages-legacy/eslint-plugin-nx/project.json new file mode 100644 index 00000000000000..1eccf671acda73 --- /dev/null +++ b/packages-legacy/eslint-plugin-nx/project.json @@ -0,0 +1,36 @@ +{ + "name": "eslint-plugin-nx-legacy", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "packages-legacy/eslint-plugin-nx", + "projectType": "library", + "targets": { + "build": { + "executor": "@nrwl/js:tsc", + "dependsOn": ["^build"], + "options": { + "main": "packages-legacy/eslint-plugin-nx/index.ts", + "tsConfig": "packages-legacy/eslint-plugin-nx/tsconfig.json", + "outputPath": "build/packages/eslint-plugin-nx-legacy", + "updateBuildableProjectDepsInPackageJson": false, + "assets": [ + { + "input": "packages-legacy/eslint-plugin-nx", + "glob": "**/*.json", + "ignore": ["**/tsconfig*.json", "project.json"], + "output": "/" + }, + { + "input": "packages-legacy/eslint-plugin-nx", + "glob": "**/*.d.ts", + "output": "/" + }, + { + "input": "", + "glob": "LICENSE", + "output": "/" + } + ] + } + } + } +} diff --git a/packages-legacy/eslint-plugin-nx/tsconfig.json b/packages-legacy/eslint-plugin-nx/tsconfig.json new file mode 100644 index 00000000000000..133314b126cffc --- /dev/null +++ b/packages-legacy/eslint-plugin-nx/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": {}, + "include": ["**/*.ts"], + "files": ["index.ts"] +} diff --git a/packages-legacy/expo/README.md b/packages-legacy/expo/README.md new file mode 100644 index 00000000000000..ede96f496cc174 --- /dev/null +++ b/packages-legacy/expo/README.md @@ -0,0 +1,11 @@ +## @nrwl/expo has been deprecated! + +@nrwl/expo has been deprecated in favor of [@nx/expo](https://www.npmjs.com/package/@nx/expo). Please use that instead. + +@nrwl/expo will no longer be published in Nx v17. + +

Nx - Smart, Fast and Extensible Build System

+ +# Nx: Smart, Fast and Extensible Build System + +Nx is a next generation build system with first class monorepo support and powerful integrations. diff --git a/packages-legacy/expo/executors.json b/packages-legacy/expo/executors.json new file mode 100644 index 00000000000000..5b6ecba9ca382d --- /dev/null +++ b/packages-legacy/expo/executors.json @@ -0,0 +1,116 @@ +{ + "executors": { + "update": { + "implementation": "@nx/expo/src/executors/update/update.impl", + "schema": "@nx/expo/src/executors/update/schema.json", + "description": "Start an EAS update for your expo project" + }, + "build": { + "implementation": "@nx/expo/src/executors/build/build.impl", + "schema": "@nx/expo/src/executors/build/schema.json", + "description": "Start an EAS build for your expo project" + }, + "build-list": { + "implementation": "@nx/expo/src/executors/build-list/build-list.impl", + "schema": "@nx/expo/src/executors/build-list/schema.json", + "description": "List all EAS builds for your Expo project" + }, + "download": { + "implementation": "@nx/expo/src/executors/download/download.impl", + "schema": "@nx/expo/src/executors/download/schema.json", + "description": "Download an EAS build" + }, + "run": { + "implementation": "@nx/expo/src/executors/run/run.impl", + "schema": "@nx/expo/src/executors/run/schema.json", + "description": "Run the Android app binary locally or run the iOS app binary locally" + }, + "start": { + "implementation": "@nx/expo/src/executors/start/start.impl", + "schema": "@nx/expo/src/executors/start/schema.json", + "description": "Start a local dev server for the app or start a Webpack dev server for the web app" + }, + "sync-deps": { + "implementation": "@nx/expo/src/executors/sync-deps/sync-deps.impl", + "schema": "@nx/expo/src/executors/sync-deps/schema.json", + "description": "Syncs dependencies to package.json (required for autolinking)." + }, + "ensure-symlink": { + "implementation": "@nx/expo/src/executors/ensure-symlink/ensure-symlink.impl", + "schema": "@nx/expo/src/executors/ensure-symlink/schema.json", + "description": "Ensure workspace node_modules is symlink under app's node_modules folder." + }, + "prebuild": { + "implementation": "@nx/expo/src/executors/prebuild/prebuild.impl", + "schema": "@nx/expo/src/executors/prebuild/schema.json", + "description": "Create native iOS and Android project files for building natively." + }, + "install": { + "implementation": "@nx/expo/src/executors/install/install.impl", + "schema": "@nx/expo/src/executors/install/schema.json", + "description": "Install a module or other package to a project." + }, + "export": { + "implementation": "@nx/expo/src/executors/export/export.impl", + "schema": "@nx/expo/src/executors/export/schema.json", + "description": "Export the JavaScript and assets for your app using Metro/webpack bundler" + } + }, + "builders": { + "update": { + "implementation": "@nx/expo/src/executors/update/compat", + "schema": "@nx/expo/src/executors/update/schema.json", + "description": "Start an EAS update for your expo project" + }, + "build": { + "implementation": "@nx/expo/src/executors/build/compat", + "schema": "@nx/expo/src/executors/build/schema.json", + "description": "Start an EAS build for your expo project" + }, + "build-list": { + "implementation": "@nx/expo/src/executors/build-list/compat", + "schema": "@nx/expo/src/executors/build-list/schema.json", + "description": "List all EAS builds for your Expo project" + }, + "download": { + "implementation": "@nx/expo/src/executors/download/compat", + "schema": "@nx/expo/src/executors/download/schema.json", + "description": "Download an EAS build" + }, + "run": { + "implementation": "@nx/expo/src/executors/run/compat", + "schema": "@nx/expo/src/executors/run/schema.json", + "description": "Run the Android app binary locally or run the iOS app binary locally" + }, + "start": { + "implementation": "@nx/expo/src/executors/start/compat", + "schema": "@nx/expo/src/executors/start/schema.json", + "description": "Start a local dev server for the app or start a Webpack dev server for the web app" + }, + "sync-deps": { + "implementation": "@nx/expo/src/executors/sync-deps/compat", + "schema": "@nx/expo/src/executors/sync-deps/schema.json", + "description": "Syncs dependencies to package.json (required for autolinking)." + }, + "ensure-symlink": { + "implementation": "@nx/expo/src/executors/ensure-symlink/compat", + "schema": "@nx/expo/src/executors/ensure-symlink/schema.json", + "description": "Ensure workspace node_modules is symlink under app's node_modules folder." + }, + "prebuild": { + "implementation": "@nx/expo/src/executors/prebuild/compat", + "schema": "@nx/expo/src/executors/prebuild/schema.json", + "description": "Create native iOS and Android project files for building natively." + }, + "install": { + "implementation": "@nx/expo/src/executors/install/compat", + "schema": "@nx/expo/src/executors/install/schema.json", + "description": "Install a module or other package to a project." + }, + "export": { + "implementation": "@nx/expo/src/executors/export/compat", + "schema": "@nx/expo/src/executors/export/schema.json", + "description": "Export the JavaScript and assets for your app using Metro/webpack bundler" + } + } +} diff --git a/packages-legacy/expo/generators.json b/packages-legacy/expo/generators.json new file mode 100644 index 00000000000000..a2a748b619abc3 --- /dev/null +++ b/packages-legacy/expo/generators.json @@ -0,0 +1,4 @@ +{ + "extends": ["@nx/expo"], + "schematics": {} +} diff --git a/packages-legacy/expo/index.ts b/packages-legacy/expo/index.ts new file mode 100644 index 00000000000000..7365b90aa00408 --- /dev/null +++ b/packages-legacy/expo/index.ts @@ -0,0 +1 @@ +export * from '@nx/expo'; diff --git a/packages-legacy/expo/package.json b/packages-legacy/expo/package.json new file mode 100644 index 00000000000000..209808a84c9366 --- /dev/null +++ b/packages-legacy/expo/package.json @@ -0,0 +1,39 @@ +{ + "name": "@nrwl/expo", + "version": "0.0.1", + "private": false, + "description": "The Expo Plugin for Nx contains executors and generators for managing and developing an expo application within your workspace. For example, you can directly build for different target platforms as well as generate projects and publish your code.", + "keywords": [ + "Monorepo", + "Expo", + "React", + "Web", + "Jest", + "Native", + "CLI" + ], + "homepage": "https://nx.dev", + "bugs": { + "url": "https://github.com/nrwl/nx/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/nrwl/nx.git", + "directory": "packages-legacy/expo" + }, + "license": "MIT", + "author": "Victor Savkin", + "main": "./index", + "types": "index.d.ts", + "dependencies": { + "@nx/expo": "file:../../packages/expo" + }, + "builders": "./executors.json", + "schematics": "./generators.json", + "publishConfig": { + "access": "public" + }, + "nx-migrations": { + "migrations": "@nx/expo/migrations.json" + } +} diff --git a/packages-legacy/expo/plugins/jest/svg-mock.ts b/packages-legacy/expo/plugins/jest/svg-mock.ts new file mode 100644 index 00000000000000..5d45aae397ab5f --- /dev/null +++ b/packages-legacy/expo/plugins/jest/svg-mock.ts @@ -0,0 +1,3 @@ +// From https://github.com/kristerkari/react-native-svg-transformer#usage-with-jest +module.exports = 'SvgMock'; +module.exports.ReactComponent = 'SvgMock'; diff --git a/packages-legacy/expo/plugins/with-nx-metro.ts b/packages-legacy/expo/plugins/with-nx-metro.ts new file mode 100644 index 00000000000000..a52a93207073f5 --- /dev/null +++ b/packages-legacy/expo/plugins/with-nx-metro.ts @@ -0,0 +1 @@ +export * from '@nx/expo/plugins/with-nx-metro'; diff --git a/packages-legacy/expo/plugins/with-nx-webpack.ts b/packages-legacy/expo/plugins/with-nx-webpack.ts new file mode 100644 index 00000000000000..6f99812fc0581e --- /dev/null +++ b/packages-legacy/expo/plugins/with-nx-webpack.ts @@ -0,0 +1 @@ +export * from '@nx/expo/plugins/with-nx-webpack'; diff --git a/packages-legacy/expo/project.json b/packages-legacy/expo/project.json new file mode 100644 index 00000000000000..2ccce61577737a --- /dev/null +++ b/packages-legacy/expo/project.json @@ -0,0 +1,37 @@ +{ + "name": "expo-legacy", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "packages-legacy/expo", + "projectType": "library", + "targets": { + "build": { + "executor": "@nrwl/js:tsc", + "dependsOn": ["^build"], + "options": { + "main": "packages-legacy/expo/index.ts", + "tsConfig": "packages-legacy/expo/tsconfig.json", + "outputPath": "build/packages/expo-legacy", + "updateBuildableProjectDepsInPackageJson": false, + "assets": [ + { + "input": "packages-legacy/expo", + "glob": "**/*.json", + "ignore": ["**/tsconfig*.json", "project.json"], + "output": "/" + }, + { + "input": "packages-legacy/expo", + "glob": "**/*.d.ts", + "output": "/" + }, + { + "input": "", + "glob": "LICENSE", + "output": "/" + } + ] + } + } + }, + "tags": [] +} diff --git a/packages-legacy/expo/tsconfig.json b/packages-legacy/expo/tsconfig.json new file mode 100644 index 00000000000000..133314b126cffc --- /dev/null +++ b/packages-legacy/expo/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": {}, + "include": ["**/*.ts"], + "files": ["index.ts"] +} diff --git a/packages-legacy/expo/typings/svg.d.ts b/packages-legacy/expo/typings/svg.d.ts new file mode 100644 index 00000000000000..fed8d1663473b7 --- /dev/null +++ b/packages-legacy/expo/typings/svg.d.ts @@ -0,0 +1,6 @@ +declare module '*.svg' { + import React from 'react'; + import { SvgProps } from 'react-native-svg'; + const content: React.FC; + export default content; +} diff --git a/packages-legacy/express/README.md b/packages-legacy/express/README.md new file mode 100644 index 00000000000000..54021dce091e56 --- /dev/null +++ b/packages-legacy/express/README.md @@ -0,0 +1,11 @@ +## @nrwl/express has been deprecated! + +@nrwl/express has been deprecated in favor of [@nx/express](https://www.npmjs.com/package/@nx/express). Please use that instead. + +@nrwl/express will no longer be published in Nx v17. + +

Nx - Smart, Fast and Extensible Build System

+ +# Nx: Smart, Fast and Extensible Build System + +Nx is a next generation build system with first class monorepo support and powerful integrations. diff --git a/packages-legacy/express/generators.json b/packages-legacy/express/generators.json new file mode 100644 index 00000000000000..24c6a60625195a --- /dev/null +++ b/packages-legacy/express/generators.json @@ -0,0 +1,4 @@ +{ + "extends": ["@nx/express"], + "schematics": {} +} diff --git a/packages-legacy/express/index.ts b/packages-legacy/express/index.ts new file mode 100644 index 00000000000000..0683bd7aa8da3c --- /dev/null +++ b/packages-legacy/express/index.ts @@ -0,0 +1 @@ +export * from '@nx/express'; diff --git a/packages-legacy/express/package.json b/packages-legacy/express/package.json new file mode 100644 index 00000000000000..cf98fa4480555f --- /dev/null +++ b/packages-legacy/express/package.json @@ -0,0 +1,37 @@ +{ + "name": "@nrwl/express", + "version": "0.0.1", + "private": false, + "description": "The Nx Plugin for Express contains executors and generators for allowing your workspace to create powerful Express Node applications and APIs.", + "repository": { + "type": "git", + "url": "https://github.com/nrwl/nx.git", + "directory": "packages-legacy/express" + }, + "keywords": [ + "Monorepo", + "Node", + "Express", + "Jest", + "Cypress", + "CLI" + ], + "main": "./index", + "typings": "./index.d.ts", + "author": "Victor Savkin", + "license": "MIT", + "bugs": { + "url": "https://github.com/nrwl/nx/issues" + }, + "homepage": "https://nx.dev", + "schematics": "./generators.json", + "dependencies": { + "@nx/express": "file:../../packages/express" + }, + "publishConfig": { + "access": "public" + }, + "nx-migrations": { + "migrations": "@nx/express/migrations.json" + } +} diff --git a/packages-legacy/express/project.json b/packages-legacy/express/project.json new file mode 100644 index 00000000000000..32a37eec899e0c --- /dev/null +++ b/packages-legacy/express/project.json @@ -0,0 +1,37 @@ +{ + "name": "express-legacy", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "packages-legacy/express", + "projectType": "library", + "targets": { + "build": { + "executor": "@nrwl/js:tsc", + "dependsOn": ["^build"], + "options": { + "main": "packages-legacy/express/index.ts", + "tsConfig": "packages-legacy/express/tsconfig.json", + "outputPath": "build/packages/express-legacy", + "updateBuildableProjectDepsInPackageJson": false, + "assets": [ + { + "input": "packages-legacy/express", + "glob": "**/*.json", + "ignore": ["**/tsconfig*.json", "project.json"], + "output": "/" + }, + { + "input": "packages-legacy/express", + "glob": "**/*.d.ts", + "output": "/" + }, + { + "input": "", + "glob": "LICENSE", + "output": "/" + } + ] + } + } + }, + "implicitDependencies": ["node"] +} diff --git a/packages-legacy/express/tsconfig.json b/packages-legacy/express/tsconfig.json new file mode 100644 index 00000000000000..133314b126cffc --- /dev/null +++ b/packages-legacy/express/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": {}, + "include": ["**/*.ts"], + "files": ["index.ts"] +} diff --git a/packages-legacy/jest/README.md b/packages-legacy/jest/README.md new file mode 100644 index 00000000000000..6689da14240691 --- /dev/null +++ b/packages-legacy/jest/README.md @@ -0,0 +1,11 @@ +## @nrwl/jest has been deprecated! + +@nrwl/jest has been deprecated in favor of [@nx/jest](https://www.npmjs.com/package/@nx/jest). Please use that instead. + +@nrwl/jest will no longer be published in Nx v17. + +

Nx - Smart, Fast and Extensible Build System

+ +# Nx: Smart, Fast and Extensible Build System + +Nx is a next generation build system with first class monorepo support and powerful integrations. diff --git a/packages-legacy/jest/executors.json b/packages-legacy/jest/executors.json new file mode 100644 index 00000000000000..66a44a0f44b9ae --- /dev/null +++ b/packages-legacy/jest/executors.json @@ -0,0 +1,17 @@ +{ + "builders": { + "jest": { + "implementation": "@nx/jest/src/executors/jest/compat", + "schema": "@nx/jest/src/executors/jest/schema.json", + "description": "Run Jest unit tests." + } + }, + "executors": { + "jest": { + "implementation": "@nx/jest/src/executors/jest/jest.impl", + "batchImplementation": "@nx/jest/src/executors/jest/jest.impl#batchJest", + "schema": "@nx/jest/src/executors/jest/schema.json", + "description": "Run Jest unit tests." + } + } +} diff --git a/packages-legacy/jest/generators.json b/packages-legacy/jest/generators.json new file mode 100644 index 00000000000000..425e10168c5902 --- /dev/null +++ b/packages-legacy/jest/generators.json @@ -0,0 +1,4 @@ +{ + "extends": ["@nx/jest"], + "schematics": {} +} diff --git a/packages-legacy/jest/index.ts b/packages-legacy/jest/index.ts new file mode 100644 index 00000000000000..f2c3729ae7271e --- /dev/null +++ b/packages-legacy/jest/index.ts @@ -0,0 +1 @@ +export * from '@nx/jest'; diff --git a/packages-legacy/jest/package.json b/packages-legacy/jest/package.json new file mode 100644 index 00000000000000..001d5867a3ca29 --- /dev/null +++ b/packages-legacy/jest/package.json @@ -0,0 +1,41 @@ +{ + "name": "@nrwl/jest", + "version": "0.0.1", + "private": false, + "description": "The Nx Plugin for Jest contains executors and generators allowing your workspace to use the powerful Jest testing capabilities.", + "repository": { + "type": "git", + "url": "https://github.com/nrwl/nx.git", + "directory": "packages-legacy/jest" + }, + "keywords": [ + "Monorepo", + "Angular", + "React", + "Web", + "Node", + "Nest", + "Jest", + "Unit Testing", + "CLI" + ], + "main": "./index", + "typings": "./index.d.ts", + "author": "Victor Savkin", + "license": "MIT", + "bugs": { + "url": "https://github.com/nrwl/nx/issues" + }, + "homepage": "https://nx.dev", + "schematics": "./generators.json", + "builders": "./executors.json", + "dependencies": { + "@nx/jest": "file:../../packages/jest" + }, + "publishConfig": { + "access": "public" + }, + "nx-migrations": { + "migrations": "@nx/jest/migrations.json" + } +} diff --git a/packages-legacy/jest/plugins/resolver.ts b/packages-legacy/jest/plugins/resolver.ts new file mode 100644 index 00000000000000..f7c7fffd6c98e5 --- /dev/null +++ b/packages-legacy/jest/plugins/resolver.ts @@ -0,0 +1 @@ +module.exports = require('@nx/jest/plugins/resolver'); diff --git a/packages-legacy/jest/preset/index.ts b/packages-legacy/jest/preset/index.ts new file mode 100644 index 00000000000000..986e4d116b2e07 --- /dev/null +++ b/packages-legacy/jest/preset/index.ts @@ -0,0 +1 @@ +module.exports = require('@nx/jest/preset'); diff --git a/packages-legacy/jest/project.json b/packages-legacy/jest/project.json new file mode 100644 index 00000000000000..0c157fd10b0c7b --- /dev/null +++ b/packages-legacy/jest/project.json @@ -0,0 +1,36 @@ +{ + "name": "jest-legacy", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "packages-legacy/jest", + "projectType": "library", + "targets": { + "build": { + "executor": "@nrwl/js:tsc", + "dependsOn": ["^build"], + "options": { + "main": "packages-legacy/jest/index.ts", + "tsConfig": "packages-legacy/jest/tsconfig.json", + "outputPath": "build/packages/jest-legacy", + "updateBuildableProjectDepsInPackageJson": false, + "assets": [ + { + "input": "packages-legacy/jest", + "glob": "**/*.json", + "ignore": ["**/tsconfig*.json", "project.json"], + "output": "/" + }, + { + "input": "packages-legacy/jest", + "glob": "**/*.d.ts", + "output": "/" + }, + { + "input": "", + "glob": "LICENSE", + "output": "/" + } + ] + } + } + } +} diff --git a/packages-legacy/jest/tsconfig.json b/packages-legacy/jest/tsconfig.json new file mode 100644 index 00000000000000..133314b126cffc --- /dev/null +++ b/packages-legacy/jest/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": {}, + "include": ["**/*.ts"], + "files": ["index.ts"] +} diff --git a/packages-legacy/js/README.md b/packages-legacy/js/README.md new file mode 100644 index 00000000000000..951cb7af04b364 --- /dev/null +++ b/packages-legacy/js/README.md @@ -0,0 +1,11 @@ +## @nrwl/js has been deprecated! + +@nrwl/js has been deprecated in favor of [@nx/js](https://www.npmjs.com/package/@nx/js). Please use that instead. + +@nrwl/js will no longer be published in Nx v17. + +

Nx - Smart, Fast and Extensible Build System

+ +# Nx: Smart, Fast and Extensible Build System + +Nx is a next generation build system with first class monorepo support and powerful integrations. diff --git a/packages-legacy/js/babel.ts b/packages-legacy/js/babel.ts new file mode 100644 index 00000000000000..6384b1444d3403 --- /dev/null +++ b/packages-legacy/js/babel.ts @@ -0,0 +1 @@ +module.exports = require('@nx/js/babel'); diff --git a/packages-legacy/js/executors.json b/packages-legacy/js/executors.json new file mode 100644 index 00000000000000..905d55a5f5a930 --- /dev/null +++ b/packages-legacy/js/executors.json @@ -0,0 +1,37 @@ +{ + "$schema": "http://json-schema.org/schema", + "executors": { + "tsc": { + "implementation": "@nx/js/src/executors/tsc/tsc.impl", + "schema": "@nx/js/src/executors/tsc/schema.json", + "description": "Build a project using TypeScript." + }, + "swc": { + "implementation": "@nx/js/src/executors/swc/swc.impl", + "schema": "@nx/js/src/executors/swc/schema.json", + "description": "Build a project using SWC." + }, + "node": { + "implementation": "@nx/js/src/executors/node/node.impl", + "schema": "@nx/js/src/executors/node/schema.json", + "description": "Execute a Node application." + } + }, + "builders": { + "tsc": { + "implementation": "@nx/js/src/executors/tsc/compat", + "schema": "@nx/js/src/executors/tsc/schema.json", + "description": "Build a project using TypeScript." + }, + "swc": { + "implementation": "@nx/js/src/executors/swc/compat", + "schema": "@nx/js/src/executors/swc/schema.json", + "description": "Build a project using SWC." + }, + "node": { + "implementation": "@nx/js/src/executors/node/compat", + "schema": "@nx/js/src/executors/node/schema.json", + "description": "Execute a Node application." + } + } +} diff --git a/packages-legacy/js/generators.json b/packages-legacy/js/generators.json new file mode 100644 index 00000000000000..a2545983d2c00e --- /dev/null +++ b/packages-legacy/js/generators.json @@ -0,0 +1,4 @@ +{ + "extends": ["@nx/js"], + "schematics": {} +} diff --git a/packages-legacy/js/index.ts b/packages-legacy/js/index.ts new file mode 100644 index 00000000000000..c1f5e6d6746b29 --- /dev/null +++ b/packages-legacy/js/index.ts @@ -0,0 +1 @@ +export * from '@nx/js'; diff --git a/packages-legacy/js/package.json b/packages-legacy/js/package.json new file mode 100644 index 00000000000000..7d19672e7f3712 --- /dev/null +++ b/packages-legacy/js/package.json @@ -0,0 +1,39 @@ +{ + "name": "@nrwl/js", + "version": "0.0.1", + "private": false, + "description": "The JS plugin for Nx contains executors and generators that provide the best experience for developing JavaScript and TypeScript projects. ", + "repository": { + "type": "git", + "url": "https://github.com/nrwl/nx.git", + "directory": "packages-legacy/js" + }, + "keywords": [ + "Monorepo", + "Web", + "Node", + "Swc", + "Tsc", + "CLI" + ], + "main": "src/index.js", + "typings": "src/index.d.ts", + "license": "MIT", + "bugs": { + "url": "https://github.com/nrwl/nx/issues" + }, + "homepage": "https://nx.dev", + "generators": "./generators.json", + "schematics": "./generators.json", + "executors": "./executors.json", + "builders": "./executors.json", + "dependencies": { + "@nx/js": "file:../../packages/js" + }, + "publishConfig": { + "access": "public" + }, + "nx-migrations": { + "migrations": "@nx/js/migrations.json" + } +} diff --git a/packages-legacy/js/project.json b/packages-legacy/js/project.json new file mode 100644 index 00000000000000..adc28041cc458b --- /dev/null +++ b/packages-legacy/js/project.json @@ -0,0 +1,37 @@ +{ + "name": "js-legacy", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "packages-legacy/js", + "projectType": "library", + "targets": { + "build": { + "executor": "@nrwl/js:tsc", + "dependsOn": ["^build"], + "options": { + "main": "packages-legacy/js/index.ts", + "tsConfig": "packages-legacy/js/tsconfig.json", + "outputPath": "build/packages/js-legacy", + "updateBuildableProjectDepsInPackageJson": false, + "assets": [ + { + "input": "packages-legacy/js", + "glob": "**/*.json", + "ignore": ["**/tsconfig*.json", "project.json"], + "output": "/" + }, + { + "input": "packages-legacy/js", + "glob": "**/*.d.ts", + "output": "/" + }, + { + "input": "", + "glob": "LICENSE", + "output": "/" + } + ] + } + } + }, + "tags": [] +} diff --git a/packages-legacy/js/tsconfig.json b/packages-legacy/js/tsconfig.json new file mode 100644 index 00000000000000..133314b126cffc --- /dev/null +++ b/packages-legacy/js/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": {}, + "include": ["**/*.ts"], + "files": ["index.ts"] +} diff --git a/packages-legacy/linter/README.md b/packages-legacy/linter/README.md new file mode 100644 index 00000000000000..fda35110cd18c7 --- /dev/null +++ b/packages-legacy/linter/README.md @@ -0,0 +1,11 @@ +## @nrwl/linter has been deprecated! + +@nrwl/linter has been deprecated in favor of [@nx/linter](https://www.npmjs.com/package/@nx/linter). Please use that instead. + +@nrwl/linter will no longer be published in Nx v17. + +

Nx - Smart, Fast and Extensible Build System

+ +# Nx: Smart, Fast and Extensible Build System + +Nx is a next generation build system with first class monorepo support and powerful integrations. diff --git a/packages-legacy/linter/executors.json b/packages-legacy/linter/executors.json new file mode 100644 index 00000000000000..ba70860fa5761e --- /dev/null +++ b/packages-legacy/linter/executors.json @@ -0,0 +1,17 @@ +{ + "builders": { + "eslint": { + "implementation": "@nx/linter/src/executors/eslint/compat", + "schema": "@nx/linter/src/executors/eslint/schema.json", + "description": "Run ESLint on a project." + } + }, + "executors": { + "eslint": { + "implementation": "@nx/linter/src/executors/eslint/lint.impl", + "schema": "@nx/linter/src/executors/eslint/schema.json", + "hasher": "@nx/linter/src/executors/eslint/hasher", + "description": "Run ESLint on a project." + } + } +} diff --git a/packages-legacy/linter/generators.json b/packages-legacy/linter/generators.json new file mode 100644 index 00000000000000..331f10e4586c61 --- /dev/null +++ b/packages-legacy/linter/generators.json @@ -0,0 +1,4 @@ +{ + "extends": ["@nx/linter"], + "schematics": {} +} diff --git a/packages-legacy/linter/index.ts b/packages-legacy/linter/index.ts new file mode 100644 index 00000000000000..ef67cd24cb9b40 --- /dev/null +++ b/packages-legacy/linter/index.ts @@ -0,0 +1 @@ +export * from '@nx/linter'; diff --git a/packages-legacy/linter/package.json b/packages-legacy/linter/package.json new file mode 100644 index 00000000000000..c920961a361452 --- /dev/null +++ b/packages-legacy/linter/package.json @@ -0,0 +1,37 @@ +{ + "name": "@nrwl/linter", + "version": "0.0.1", + "private": false, + "description": "The Linter plugin for Nx contains executors, generators and utilities used for linting JavaScript/TypeScript projects within an Nx workspace.", + "repository": { + "type": "git", + "url": "https://github.com/nrwl/nx.git", + "directory": "packages-legacy/linter" + }, + "keywords": [ + "Monorepo", + "Web", + "Lint", + "ESLint", + "CLI" + ], + "main": "./index", + "typings": "./index.d.ts", + "author": "Victor Savkin", + "license": "MIT", + "bugs": { + "url": "https://github.com/nrwl/nx/issues" + }, + "homepage": "https://nx.dev", + "builders": "./executors.json", + "schematics": "./generators.json", + "dependencies": { + "@nx/linter": "file:../../packages/linter" + }, + "publishConfig": { + "access": "public" + }, + "nx-migrations": { + "migrations": "@nx/linter/migrations.json" + } +} diff --git a/packages-legacy/linter/project.json b/packages-legacy/linter/project.json new file mode 100644 index 00000000000000..3e81782f6932ad --- /dev/null +++ b/packages-legacy/linter/project.json @@ -0,0 +1,37 @@ +{ + "name": "linter-legacy", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "packages-legacy/linter", + "projectType": "library", + "targets": { + "build": { + "executor": "@nrwl/js:tsc", + "dependsOn": ["^build"], + "options": { + "main": "packages-legacy/linter/index.ts", + "tsConfig": "packages-legacy/linter/tsconfig.json", + "outputPath": "build/packages/linter-legacy", + "updateBuildableProjectDepsInPackageJson": false, + "assets": [ + { + "input": "packages-legacy/linter", + "glob": "**/*.json", + "ignore": ["**/tsconfig*.json", "project.json"], + "output": "/" + }, + { + "input": "packages-legacy/linter", + "glob": "**/*.d.ts", + "output": "/" + }, + { + "input": "", + "glob": "LICENSE", + "output": "/" + } + ] + } + } + }, + "implicitDependencies": ["eslint-plugin-nx"] +} diff --git a/packages-legacy/linter/tsconfig.json b/packages-legacy/linter/tsconfig.json new file mode 100644 index 00000000000000..133314b126cffc --- /dev/null +++ b/packages-legacy/linter/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": {}, + "include": ["**/*.ts"], + "files": ["index.ts"] +} diff --git a/packages-legacy/nest/README.md b/packages-legacy/nest/README.md new file mode 100644 index 00000000000000..7fc2191fe95047 --- /dev/null +++ b/packages-legacy/nest/README.md @@ -0,0 +1,11 @@ +## @nrwl/nest has been deprecated! + +@nrwl/nest has been deprecated in favor of [@nx/nest](https://www.npmjs.com/package/@nx/nest). Please use that instead. + +@nrwl/nest will no longer be published in Nx v17. + +

Nx - Smart, Fast and Extensible Build System

+ +# Nx: Smart, Fast and Extensible Build System + +Nx is a next generation build system with first class monorepo support and powerful integrations. diff --git a/packages-legacy/nest/generators.json b/packages-legacy/nest/generators.json new file mode 100644 index 00000000000000..bdc46c352fbb11 --- /dev/null +++ b/packages-legacy/nest/generators.json @@ -0,0 +1,4 @@ +{ + "extends": ["@nx/nest"], + "schematics": {} +} diff --git a/packages-legacy/nest/index.ts b/packages-legacy/nest/index.ts new file mode 100644 index 00000000000000..28fca7030e658e --- /dev/null +++ b/packages-legacy/nest/index.ts @@ -0,0 +1 @@ +export * from '@nx/nest'; diff --git a/packages-legacy/nest/package.json b/packages-legacy/nest/package.json new file mode 100644 index 00000000000000..a42192e842bf3a --- /dev/null +++ b/packages-legacy/nest/package.json @@ -0,0 +1,37 @@ +{ + "name": "@nrwl/nest", + "version": "0.0.1", + "private": false, + "description": "The Nx Plugin for Nest contains executors and generators for allowing your workspace to create powerful Nest best in class APIs.", + "repository": { + "type": "git", + "url": "https://github.com/nrwl/nx.git", + "directory": "packages-legacy/nest" + }, + "keywords": [ + "Monorepo", + "Node", + "Nest", + "Jest", + "Cypress", + "CLI" + ], + "main": "./index", + "typings": "./index.d.ts", + "author": "Victor Savkin", + "license": "MIT", + "bugs": { + "url": "https://github.com/nrwl/nx/issues" + }, + "homepage": "https://nx.dev", + "schematics": "./generators.json", + "dependencies": { + "@nx/nest": "file:../../packages/nest" + }, + "publishConfig": { + "access": "public" + }, + "nx-migrations": { + "migrations": "@nx/nest/migrations.json" + } +} diff --git a/packages-legacy/nest/project.json b/packages-legacy/nest/project.json new file mode 100644 index 00000000000000..59b5e7275e837b --- /dev/null +++ b/packages-legacy/nest/project.json @@ -0,0 +1,37 @@ +{ + "name": "nest-legacy", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "packages-legacy/nest", + "projectType": "library", + "targets": { + "build": { + "executor": "@nrwl/js:tsc", + "dependsOn": ["^build"], + "options": { + "main": "packages-legacy/nest/index.ts", + "tsConfig": "packages-legacy/nest/tsconfig.json", + "outputPath": "build/packages/nest-legacy", + "updateBuildableProjectDepsInPackageJson": false, + "assets": [ + { + "input": "packages-legacy/nest", + "glob": "**/*.json", + "ignore": ["**/tsconfig*.json", "project.json"], + "output": "/" + }, + { + "input": "packages-legacy/nest", + "glob": "**/*.d.ts", + "output": "/" + }, + { + "input": "", + "glob": "LICENSE", + "output": "/" + } + ] + } + } + }, + "implicitDependencies": ["node", "linter"] +} diff --git a/packages-legacy/nest/tsconfig.json b/packages-legacy/nest/tsconfig.json new file mode 100644 index 00000000000000..133314b126cffc --- /dev/null +++ b/packages-legacy/nest/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": {}, + "include": ["**/*.ts"], + "files": ["index.ts"] +} diff --git a/packages-legacy/next/README.md b/packages-legacy/next/README.md new file mode 100644 index 00000000000000..8f4088eafa5a75 --- /dev/null +++ b/packages-legacy/next/README.md @@ -0,0 +1,11 @@ +## @nrwl/next has been deprecated! + +@nrwl/next has been deprecated in favor of [@nx/next](https://www.npmjs.com/package/@nx/next). Please use that instead. + +@nrwl/next will no longer be published in Nx v17. + +

Nx - Smart, Fast and Extensible Build System

+ +# Nx: Smart, Fast and Extensible Build System + +Nx is a next generation build system with first class monorepo support and powerful integrations. diff --git a/packages-legacy/next/babel.ts b/packages-legacy/next/babel.ts new file mode 100644 index 00000000000000..0da4391f04bce6 --- /dev/null +++ b/packages-legacy/next/babel.ts @@ -0,0 +1 @@ +module.exports = require('@nx/next/babel'); diff --git a/packages-legacy/next/executors.json b/packages-legacy/next/executors.json new file mode 100644 index 00000000000000..9c780f4d8788d9 --- /dev/null +++ b/packages-legacy/next/executors.json @@ -0,0 +1,36 @@ +{ + "executors": { + "build": { + "implementation": "@nx/next/src/executors/build/build.impl", + "schema": "@nx/next/src/executors/build/schema.json", + "description": "Build a Next.js application." + }, + "server": { + "implementation": "@nx/next/src/executors/server/server.impl", + "schema": "@nx/next/src/executors/server/schema.json", + "description": "Serve a Next.js application." + }, + "export": { + "implementation": "@nx/next/src/executors/export/export.impl", + "schema": "@nx/next/src/executors/export/schema.json", + "description": "Export a Next.js application. The exported application is located at `dist/$outputPath/exported`." + } + }, + "builders": { + "build": { + "implementation": "@nx/next/src/executors/build/compat", + "schema": "@nx/next/src/executors/build/schema.json", + "description": "Build a Next.js application." + }, + "server": { + "implementation": "@nx/next/src/executors/server/compat", + "schema": "@nx/next/src/executors/server/schema.json", + "description": "Serve a Next.js application." + }, + "export": { + "implementation": "@nx/next/src/executors/export/compat", + "schema": "@nx/next/src/executors/export/schema.json", + "description": "Export a Next.js application. The exported application is located at `dist/$outputPath/exported`." + } + } +} diff --git a/packages-legacy/next/generators.json b/packages-legacy/next/generators.json new file mode 100644 index 00000000000000..76489cddb37b66 --- /dev/null +++ b/packages-legacy/next/generators.json @@ -0,0 +1,4 @@ +{ + "extends": ["@nx/next"], + "schematics": {} +} diff --git a/packages-legacy/next/index.ts b/packages-legacy/next/index.ts new file mode 100644 index 00000000000000..ebb5aaf8a96402 --- /dev/null +++ b/packages-legacy/next/index.ts @@ -0,0 +1 @@ +export * from '@nx/next'; diff --git a/packages-legacy/next/package.json b/packages-legacy/next/package.json new file mode 100644 index 00000000000000..b7aad5f9fd4ef2 --- /dev/null +++ b/packages-legacy/next/package.json @@ -0,0 +1,38 @@ +{ + "name": "@nrwl/next", + "version": "0.0.1", + "private": false, + "description": "The Next.js plugin for Nx contains executors and generators for managing Next.js applications and libraries within an Nx workspace. It provides:\n\n\n- Scaffolding for creating, building, serving, linting, and testing Next.js applications.\n\n- Integration with building, serving, and exporting a Next.js application.\n\n- Integration with React libraries within the workspace. \n\nWhen using Next.js in Nx, you get the out-of-the-box support for TypeScript, Cypress, and Jest. No need to configure anything: watch mode, source maps, and typings just work.", + "repository": { + "type": "git", + "url": "https://github.com/nrwl/nx.git", + "directory": "packages-legacy/next" + }, + "keywords": [ + "Monorepo", + "Node", + "Next", + "Jest", + "Cypress", + "CLI" + ], + "main": "./index", + "typings": "./index.d.ts", + "author": "Victor Savkin", + "license": "MIT", + "bugs": { + "url": "https://github.com/nrwl/nx/issues" + }, + "homepage": "https://nx.dev", + "schematics": "./generators.json", + "builders": "./executors.json", + "dependencies": { + "@nx/next": "file:../../packages/next" + }, + "publishConfig": { + "access": "public" + }, + "nx-migrations": { + "migrations": "@nx/next/migrations.json" + } +} diff --git a/packages-legacy/next/plugins/with-less.ts b/packages-legacy/next/plugins/with-less.ts new file mode 100644 index 00000000000000..04e76a31ec3ba5 --- /dev/null +++ b/packages-legacy/next/plugins/with-less.ts @@ -0,0 +1 @@ +export * from '@nx/next/plugins/with-less'; diff --git a/packages-legacy/next/plugins/with-nx.ts b/packages-legacy/next/plugins/with-nx.ts new file mode 100644 index 00000000000000..919b742bc4547e --- /dev/null +++ b/packages-legacy/next/plugins/with-nx.ts @@ -0,0 +1 @@ +export * from '@nx/next/plugins/with-nx'; diff --git a/packages-legacy/next/plugins/with-stylus.ts b/packages-legacy/next/plugins/with-stylus.ts new file mode 100644 index 00000000000000..689b14a9578249 --- /dev/null +++ b/packages-legacy/next/plugins/with-stylus.ts @@ -0,0 +1 @@ +export * from '@nx/next/plugins/with-stylus'; diff --git a/packages-legacy/next/project.json b/packages-legacy/next/project.json new file mode 100644 index 00000000000000..c01b08f94bd1d4 --- /dev/null +++ b/packages-legacy/next/project.json @@ -0,0 +1,36 @@ +{ + "name": "next-legacy", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "packages-legacy/next", + "projectType": "library", + "targets": { + "build": { + "executor": "@nrwl/js:tsc", + "dependsOn": ["^build"], + "options": { + "main": "packages-legacy/next/index.ts", + "tsConfig": "packages-legacy/next/tsconfig.json", + "outputPath": "build/packages/next-legacy", + "updateBuildableProjectDepsInPackageJson": false, + "assets": [ + { + "input": "packages-legacy/next", + "glob": "**/*.json", + "ignore": ["**/tsconfig*.json", "project.json"], + "output": "/" + }, + { + "input": "packages-legacy/next", + "glob": "**/*.d.ts", + "output": "/" + }, + { + "input": "", + "glob": "LICENSE", + "output": "/" + } + ] + } + } + } +} diff --git a/packages-legacy/next/tailwind.ts b/packages-legacy/next/tailwind.ts new file mode 100644 index 00000000000000..4e86d139019280 --- /dev/null +++ b/packages-legacy/next/tailwind.ts @@ -0,0 +1 @@ +export * from '@nx/next/tailwind'; diff --git a/packages-legacy/next/tsconfig.json b/packages-legacy/next/tsconfig.json new file mode 100644 index 00000000000000..133314b126cffc --- /dev/null +++ b/packages-legacy/next/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": {}, + "include": ["**/*.ts"], + "files": ["index.ts"] +} diff --git a/packages-legacy/next/typings/image.d.ts b/packages-legacy/next/typings/image.d.ts new file mode 100644 index 00000000000000..54ff85aba6b6bd --- /dev/null +++ b/packages-legacy/next/typings/image.d.ts @@ -0,0 +1,12 @@ +/// + +declare module '*.svg' { + import * as React from 'react'; + + export const ReactComponent: React.FunctionComponent< + React.SVGProps & { title?: string } + >; + + const content: any; + export default content; +} diff --git a/packages-legacy/node/README.md b/packages-legacy/node/README.md new file mode 100644 index 00000000000000..6aeb4b59fb4a10 --- /dev/null +++ b/packages-legacy/node/README.md @@ -0,0 +1,11 @@ +## @nrwl/node has been deprecated! + +@nrwl/node has been deprecated in favor of [@nx/node](https://www.npmjs.com/package/@nx/node). Please use that instead. + +@nrwl/node will no longer be published in Nx v17. + +

Nx - Smart, Fast and Extensible Build System

+ +# Nx: Smart, Fast and Extensible Build System + +Nx is a next generation build system with first class monorepo support and powerful integrations. diff --git a/packages-legacy/node/executors.json b/packages-legacy/node/executors.json new file mode 100644 index 00000000000000..074fd93eafc0eb --- /dev/null +++ b/packages-legacy/node/executors.json @@ -0,0 +1,26 @@ +{ + "executors": { + "webpack": { + "implementation": "@nx/node/src/executors/webpack/webpack.impl", + "schema": "@nx/node/src/executors/webpack/schema.json", + "description": "Build a Node application using Webpack." + }, + "node": { + "implementation": "@nx/node/src/executors/node/node.impl", + "schema": "@nx/node/src/executors/node/schema.json", + "description": "Execute a Node application." + } + }, + "builders": { + "webpack": { + "implementation": "@nx/node/src/executors/webpack/compat", + "schema": "@nx/node/src/executors/webpack/schema.json", + "description": "Build a Node application using Webpack." + }, + "node": { + "implementation": "@nx/node/src/executors/node/compat", + "schema": "@nx/node/src/executors/node/schema.json", + "description": "Execute a Node application." + } + } +} diff --git a/packages-legacy/node/generators.json b/packages-legacy/node/generators.json new file mode 100644 index 00000000000000..ab96d29e481242 --- /dev/null +++ b/packages-legacy/node/generators.json @@ -0,0 +1,4 @@ +{ + "extends": ["@nx/node"], + "schematics": {} +} diff --git a/packages-legacy/node/index.ts b/packages-legacy/node/index.ts new file mode 100644 index 00000000000000..1e229f8fa0da69 --- /dev/null +++ b/packages-legacy/node/index.ts @@ -0,0 +1 @@ +export * from '@nx/node'; diff --git a/packages-legacy/node/package.json b/packages-legacy/node/package.json new file mode 100644 index 00000000000000..e4f0eb2f850c7b --- /dev/null +++ b/packages-legacy/node/package.json @@ -0,0 +1,38 @@ +{ + "name": "@nrwl/node", + "version": "0.0.1", + "private": false, + "description": "The Node Plugin for Nx contains generators and executors to manage Node applications within an Nx workspace.", + "repository": { + "type": "git", + "url": "https://github.com/nrwl/nx.git", + "directory": "packages-legacy/node" + }, + "keywords": [ + "Monorepo", + "Node", + "Nest", + "Jest", + "Cypress", + "CLI" + ], + "main": "./index", + "typings": "./index.d.ts", + "author": "Victor Savkin", + "license": "MIT", + "bugs": { + "url": "https://github.com/nrwl/nx/issues" + }, + "homepage": "https://nx.dev", + "schematics": "./generators.json", + "builders": "./executors.json", + "dependencies": { + "@nx/node": "file:../../packages/node" + }, + "publishConfig": { + "access": "public" + }, + "nx-migrations": { + "migrations": "@nx/node/migrations.json" + } +} diff --git a/packages-legacy/node/project.json b/packages-legacy/node/project.json new file mode 100644 index 00000000000000..83122b7d0e8a47 --- /dev/null +++ b/packages-legacy/node/project.json @@ -0,0 +1,36 @@ +{ + "name": "node-legacy", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "packages-legacy/node", + "projectType": "library", + "targets": { + "build": { + "executor": "@nrwl/js:tsc", + "dependsOn": ["^build"], + "options": { + "main": "packages-legacy/node/index.ts", + "tsConfig": "packages-legacy/node/tsconfig.json", + "outputPath": "build/packages/node-legacy", + "updateBuildableProjectDepsInPackageJson": false, + "assets": [ + { + "input": "packages-legacy/node", + "glob": "**/*.json", + "ignore": ["**/tsconfig*.json", "project.json"], + "output": "/" + }, + { + "input": "packages-legacy/node", + "glob": "**/*.d.ts", + "output": "/" + }, + { + "input": "", + "glob": "LICENSE", + "output": "/" + } + ] + } + } + } +} diff --git a/packages-legacy/node/tsconfig.json b/packages-legacy/node/tsconfig.json new file mode 100644 index 00000000000000..133314b126cffc --- /dev/null +++ b/packages-legacy/node/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": {}, + "include": ["**/*.ts"], + "files": ["index.ts"] +} diff --git a/packages-legacy/nx-plugin/README.md b/packages-legacy/nx-plugin/README.md new file mode 100644 index 00000000000000..c5788bbd7eac0f --- /dev/null +++ b/packages-legacy/nx-plugin/README.md @@ -0,0 +1,11 @@ +## @nrwl/nx-plugin has been deprecated! + +@nrwl/nx-plugin has been deprecated in favor of [@nx/nx-plugin](https://www.npmjs.com/package/@nx/nx-plugin). Please use that instead. + +@nrwl/nx-plugin will no longer be published in Nx v17. + +

Nx - Smart, Fast and Extensible Build System

+ +# Nx: Smart, Fast and Extensible Build System + +Nx is a next generation build system with first class monorepo support and powerful integrations. diff --git a/packages-legacy/nx-plugin/executors.json b/packages-legacy/nx-plugin/executors.json new file mode 100644 index 00000000000000..35d819cebe5b74 --- /dev/null +++ b/packages-legacy/nx-plugin/executors.json @@ -0,0 +1,16 @@ +{ + "builders": { + "e2e": { + "implementation": "@nx/nx-plugin/src/executors/e2e/compat", + "schema": "@nx/nx-plugin/src/executors/e2e/schema.json", + "description": "Creates and runs the E2E tests for an Nx Plugin." + } + }, + "executors": { + "e2e": { + "implementation": "@nx/nx-plugin/src/executors/e2e/e2e.impl", + "schema": "@nx/nx-plugin/src/executors/e2e/schema.json", + "description": "Creates and runs the E2E tests for an Nx Plugin." + } + } +} diff --git a/packages-legacy/nx-plugin/generators.json b/packages-legacy/nx-plugin/generators.json new file mode 100644 index 00000000000000..fcb719104f062a --- /dev/null +++ b/packages-legacy/nx-plugin/generators.json @@ -0,0 +1,4 @@ +{ + "extends": ["@nx/nx-plugin"], + "schematics": {} +} diff --git a/packages-legacy/nx-plugin/generators.ts b/packages-legacy/nx-plugin/generators.ts new file mode 100644 index 00000000000000..fc3116266d0424 --- /dev/null +++ b/packages-legacy/nx-plugin/generators.ts @@ -0,0 +1 @@ +export * from '@nx/nx-plugin/generators'; diff --git a/packages-legacy/nx-plugin/index.ts b/packages-legacy/nx-plugin/index.ts new file mode 100644 index 00000000000000..e69de29bb2d1d6 diff --git a/packages-legacy/nx-plugin/package.json b/packages-legacy/nx-plugin/package.json new file mode 100644 index 00000000000000..c7981c5afc9f6c --- /dev/null +++ b/packages-legacy/nx-plugin/package.json @@ -0,0 +1,35 @@ +{ + "name": "@nrwl/nx-plugin", + "version": "0.0.1", + "private": false, + "description": "This plugin is used to create Nx plugins! It contains generators for generating common plugin features like generators, executors, migrations and more.", + "repository": { + "type": "git", + "url": "https://github.com/nrwl/nx.git", + "directory": "packages-legacy/nx-plugin" + }, + "keywords": [ + "Monorepo", + "Nx", + "CLI" + ], + "main": "./index", + "types": "./index.d.ts", + "author": "Nrwl", + "license": "MIT", + "bugs": { + "url": "https://github.com/nrwl/nx/issues" + }, + "homepage": "https://nx.dev", + "schematics": "./generators.json", + "builders": "./executors.json", + "dependencies": { + "@nx/nx-plugin": "file:../../packages/nx-plugin" + }, + "publishConfig": { + "access": "public" + }, + "nx-migrations": { + "migrations": "@nx/nx-plugin/migrations.json" + } +} diff --git a/packages-legacy/nx-plugin/project.json b/packages-legacy/nx-plugin/project.json new file mode 100644 index 00000000000000..2c62566f53ee03 --- /dev/null +++ b/packages-legacy/nx-plugin/project.json @@ -0,0 +1,36 @@ +{ + "name": "nx-plugin-legacy", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "packages-legacy/nx-plugin", + "projectType": "library", + "targets": { + "build": { + "executor": "@nrwl/js:tsc", + "dependsOn": ["^build"], + "options": { + "main": "packages-legacy/nx-plugin/index.ts", + "tsConfig": "packages-legacy/nx-plugin/tsconfig.json", + "outputPath": "build/packages/nx-plugin-legacy", + "updateBuildableProjectDepsInPackageJson": false, + "assets": [ + { + "input": "packages-legacy/nx-plugin", + "glob": "**/*.json", + "ignore": ["**/tsconfig*.json", "project.json"], + "output": "/" + }, + { + "input": "packages-legacy/nx-plugin", + "glob": "**/*.d.ts", + "output": "/" + }, + { + "input": "", + "glob": "LICENSE", + "output": "/" + } + ] + } + } + } +} diff --git a/packages-legacy/nx-plugin/testing.ts b/packages-legacy/nx-plugin/testing.ts new file mode 100644 index 00000000000000..0818c6eb2ca359 --- /dev/null +++ b/packages-legacy/nx-plugin/testing.ts @@ -0,0 +1 @@ +export * from '@nx/nx-plugin/testing'; diff --git a/packages-legacy/nx-plugin/tsconfig.json b/packages-legacy/nx-plugin/tsconfig.json new file mode 100644 index 00000000000000..133314b126cffc --- /dev/null +++ b/packages-legacy/nx-plugin/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": {}, + "include": ["**/*.ts"], + "files": ["index.ts"] +} diff --git a/packages-legacy/react-native/README.md b/packages-legacy/react-native/README.md new file mode 100644 index 00000000000000..80ba779bbca806 --- /dev/null +++ b/packages-legacy/react-native/README.md @@ -0,0 +1,11 @@ +## @nrwl/react-native has been deprecated! + +@nrwl/react-native has been deprecated in favor of [@nx/react-native](https://www.npmjs.com/package/@nx/react-native). Please use that instead. + +@nrwl/react-native will no longer be published in Nx v17. + +

Nx - Smart, Fast and Extensible Build System

+ +# Nx: Smart, Fast and Extensible Build System + +Nx is a next generation build system with first class monorepo support and powerful integrations. diff --git a/packages-legacy/react-native/executors.json b/packages-legacy/react-native/executors.json new file mode 100644 index 00000000000000..fc773ebd14236f --- /dev/null +++ b/packages-legacy/react-native/executors.json @@ -0,0 +1,106 @@ +{ + "executors": { + "run-android": { + "implementation": "@nx/react-native/src/executors/run-android/run-android.impl", + "schema": "@nx/react-native/src/executors/run-android/schema.json", + "description": "Runs Android application." + }, + "run-ios": { + "implementation": "@nx/react-native/src/executors/run-ios/run-ios.impl", + "schema": "@nx/react-native/src/executors/run-ios/schema.json", + "description": "Runs iOS application." + }, + "bundle": { + "implementation": "@nx/react-native/src/executors/bundle/bundle.impl", + "schema": "@nx/react-native/src/executors/bundle/schema.json", + "description": "Builds the JavaScript bundle for offline use." + }, + "build-android": { + "implementation": "@nx/react-native/src/executors/build-android/build-android.impl", + "schema": "@nx/react-native/src/executors/build-android/schema.json", + "description": "Release Build for Android." + }, + "build-ios": { + "implementation": "@nx/react-native/src/executors/build-ios/build-ios.impl", + "schema": "@nx/react-native/src/executors/build-ios/schema.json", + "description": "Build iOS app" + }, + "start": { + "implementation": "@nx/react-native/src/executors/start/start.impl", + "schema": "@nx/react-native/src/executors/start/schema.json", + "description": "Starts the Javascript server that communicates with connected devices." + }, + "sync-deps": { + "implementation": "@nx/react-native/src/executors/sync-deps/sync-deps.impl", + "schema": "@nx/react-native/src/executors/sync-deps/schema.json", + "description": "Syncs dependencies to `package.json` (required for autolinking)." + }, + "ensure-symlink": { + "implementation": "@nx/react-native/src/executors/ensure-symlink/ensure-symlink.impl", + "schema": "@nx/react-native/src/executors/ensure-symlink/schema.json", + "description": "Ensure workspace `node_modules` is symlink under app's `node_modules` folder." + }, + "storybook": { + "implementation": "@nx/react-native/src/executors/storybook/storybook.impl", + "schema": "@nx/react-native/src/executors/storybook/schema.json", + "description": "Serve React Native Storybook." + }, + "pod-install": { + "implementation": "@nx/react-native/src/executors/pod-install/pod-install.impl", + "schema": "@nx/react-native/src/executors/pod-install/schema.json", + "description": "Run `pod install` in the `ios` directory." + } + }, + "builders": { + "run-android": { + "implementation": "@nx/react-native/src/executors/run-android/compat", + "schema": "@nx/react-native/src/executors/run-android/schema.json", + "description": "Runs Android application." + }, + "run-ios": { + "implementation": "@nx/react-native/src/executors/run-ios/compat", + "schema": "@nx/react-native/src/executors/run-ios/schema.json", + "description": "Runs iOS application." + }, + "bundle": { + "implementation": "@nx/react-native/src/executors/bundle/compat", + "schema": "@nx/react-native/src/executors/bundle/schema.json", + "description": "Builds the JavaScript bundle for offline use." + }, + "build-android": { + "implementation": "@nx/react-native/src/executors/build-android/compat", + "schema": "@nx/react-native/src/executors/build-android/schema.json", + "description": "Release Build for Android." + }, + "build-ios": { + "implementation": "@nx/react-native/src/executors/build-ios/compat", + "schema": "@nx/react-native/src/executors/build-ios/schema.json", + "description": "Build iOS app" + }, + "start": { + "implementation": "@nx/react-native/src/executors/start/compat", + "schema": "@nx/react-native/src/executors/start/schema.json", + "description": "Starts the Javascript server that communicates with connected devices." + }, + "sync-deps": { + "implementation": "@nx/react-native/src/executors/sync-deps/compat", + "schema": "@nx/react-native/src/executors/sync-deps/schema.json", + "description": "Syncs dependencies to `package.json` (required for autolinking)." + }, + "ensure-symlink": { + "implementation": "@nx/react-native/src/executors/ensure-symlink/compat", + "schema": "@nx/react-native/src/executors/ensure-symlink/schema.json", + "description": "Ensure workspace `node_modules` is symlink under app's `node_modules` folder." + }, + "storybook": { + "implementation": "@nx/react-native/src/executors/storybook/compat", + "schema": "@nx/react-native/src/executors/storybook/schema.json", + "description": "Serve React Native Storybook." + }, + "pod-install": { + "implementation": "@nx/react-native/src/executors/pod-install/compat", + "schema": "@nx/react-native/src/executors/pod-install/schema.json", + "description": "Run `pod install` in the `ios` directory." + } + } +} diff --git a/packages-legacy/react-native/generators.json b/packages-legacy/react-native/generators.json new file mode 100644 index 00000000000000..0b4121fe5b1787 --- /dev/null +++ b/packages-legacy/react-native/generators.json @@ -0,0 +1,4 @@ +{ + "extends": ["@nx/react-native"], + "schematics": {} +} diff --git a/packages-legacy/react-native/index.ts b/packages-legacy/react-native/index.ts new file mode 100644 index 00000000000000..51bc127a6e4aa7 --- /dev/null +++ b/packages-legacy/react-native/index.ts @@ -0,0 +1 @@ +export * from '@nx/react-native'; diff --git a/packages-legacy/react-native/package.json b/packages-legacy/react-native/package.json new file mode 100644 index 00000000000000..1f69304c55de83 --- /dev/null +++ b/packages-legacy/react-native/package.json @@ -0,0 +1,38 @@ +{ + "name": "@nrwl/react-native", + "version": "0.0.1", + "private": false, + "description": "The Nx Plugin for React Native contains generators for managing React Native applications and libraries within an Nx workspace. It provides: \n\n-Integration with libraries such as Jest, Detox, and Storybook.\n-Scaffolding for creating buildable libraries that can be published to npm.\n-Utilities for automatic workspace refactoring.", + "keywords": [ + "Monorepo", + "React", + "Web", + "Jest", + "Native", + "CLI" + ], + "homepage": "https://nx.dev", + "bugs": { + "url": "https://github.com/nrwl/nx/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/nrwl/nx.git", + "directory": "packages-legacy/react-native" + }, + "license": "MIT", + "author": "Victor Savkin", + "main": "./index", + "types": "index.d.ts", + "dependencies": { + "@nx/react-native": "file:../../packages/react-native" + }, + "builders": "./executors.json", + "schematics": "./generators.json", + "publishConfig": { + "access": "public" + }, + "nx-migrations": { + "migrations": "@nx/react-native/migrations.json" + } +} diff --git a/packages-legacy/react-native/plugins/jest/svg-mock.ts b/packages-legacy/react-native/plugins/jest/svg-mock.ts new file mode 100644 index 00000000000000..5d45aae397ab5f --- /dev/null +++ b/packages-legacy/react-native/plugins/jest/svg-mock.ts @@ -0,0 +1,3 @@ +// From https://github.com/kristerkari/react-native-svg-transformer#usage-with-jest +module.exports = 'SvgMock'; +module.exports.ReactComponent = 'SvgMock'; diff --git a/packages-legacy/react-native/plugins/with-nx-metro.ts b/packages-legacy/react-native/plugins/with-nx-metro.ts new file mode 100644 index 00000000000000..e2b18e5c7e2d07 --- /dev/null +++ b/packages-legacy/react-native/plugins/with-nx-metro.ts @@ -0,0 +1 @@ +export * from '@nx/react-native/plugins/with-nx-metro'; diff --git a/packages-legacy/react-native/project.json b/packages-legacy/react-native/project.json new file mode 100644 index 00000000000000..7501ca737503ab --- /dev/null +++ b/packages-legacy/react-native/project.json @@ -0,0 +1,36 @@ +{ + "name": "react-native-legacy", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "packages-legacy/react-native", + "projectType": "library", + "targets": { + "build": { + "executor": "@nrwl/js:tsc", + "dependsOn": ["^build"], + "options": { + "main": "packages-legacy/react-native/index.ts", + "tsConfig": "packages-legacy/react-native/tsconfig.json", + "outputPath": "build/packages/react-native-legacy", + "updateBuildableProjectDepsInPackageJson": false, + "assets": [ + { + "input": "packages-legacy/react-native", + "glob": "**/*.json", + "ignore": ["**/tsconfig*.json", "project.json"], + "output": "/" + }, + { + "input": "packages-legacy/react-native", + "glob": "**/*.d.ts", + "output": "/" + }, + { + "input": "", + "glob": "LICENSE", + "output": "/" + } + ] + } + } + } +} diff --git a/packages-legacy/react-native/tsconfig.json b/packages-legacy/react-native/tsconfig.json new file mode 100644 index 00000000000000..133314b126cffc --- /dev/null +++ b/packages-legacy/react-native/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": {}, + "include": ["**/*.ts"], + "files": ["index.ts"] +} diff --git a/packages-legacy/react-native/typings/svg.d.ts b/packages-legacy/react-native/typings/svg.d.ts new file mode 100644 index 00000000000000..7c42ae1dd74f2b --- /dev/null +++ b/packages-legacy/react-native/typings/svg.d.ts @@ -0,0 +1,7 @@ +// from https://github.com/kristerkari/react-native-svg-transformer#using-typescript +declare module '*.svg' { + import React from 'react'; + import { SvgProps } from 'react-native-svg'; + const content: React.FC; + export default content; +} diff --git a/packages-legacy/react/README.md b/packages-legacy/react/README.md new file mode 100644 index 00000000000000..5ee6433b57faab --- /dev/null +++ b/packages-legacy/react/README.md @@ -0,0 +1,11 @@ +## @nrwl/react has been deprecated! + +@nrwl/react has been deprecated in favor of [@nx/react](https://www.npmjs.com/package/@nx/react). Please use that instead. + +@nrwl/react will no longer be published in Nx v17. + +

Nx - Smart, Fast and Extensible Build System

+ +# Nx: Smart, Fast and Extensible Build System + +Nx is a next generation build system with first class monorepo support and powerful integrations. diff --git a/packages-legacy/react/ast-utils.ts b/packages-legacy/react/ast-utils.ts new file mode 100644 index 00000000000000..f54db8abf753c6 --- /dev/null +++ b/packages-legacy/react/ast-utils.ts @@ -0,0 +1 @@ +export * from '@nx/react/ast-utils'; diff --git a/packages-legacy/react/babel.ts b/packages-legacy/react/babel.ts new file mode 100644 index 00000000000000..c15d05c864eebf --- /dev/null +++ b/packages-legacy/react/babel.ts @@ -0,0 +1 @@ +module.exports = require('@nx/react/babel'); diff --git a/packages-legacy/react/executors.json b/packages-legacy/react/executors.json new file mode 100644 index 00000000000000..bd63d5ce500ede --- /dev/null +++ b/packages-legacy/react/executors.json @@ -0,0 +1,26 @@ +{ + "builders": { + "module-federation-dev-server": { + "implementation": "@nx/react/src/executors/module-federation-dev-server/compat", + "schema": "@nx/react/src/executors/module-federation-dev-server/schema.json", + "description": "Serve a host or remote application." + }, + "module-federation-ssr-dev-server": { + "implementation": "@nx/react/src/executors/module-federation-ssr-dev-server/compat", + "schema": "@nx/react/src/executors/module-federation-ssr-dev-server/schema.json", + "description": "Serve a host application along with it's known remotes." + } + }, + "executors": { + "module-federation-dev-server": { + "implementation": "@nx/react/src/executors/module-federation-dev-server/module-federation-dev-server.impl", + "schema": "@nx/react/src/executors/module-federation-dev-server/schema.json", + "description": "Serve a host or remote application." + }, + "module-federation-ssr-dev-server": { + "implementation": "@nx/react/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl", + "schema": "@nx/react/src/executors/module-federation-ssr-dev-server/schema.json", + "description": "Serve a host application along with it's known remotes." + } + } +} diff --git a/packages-legacy/react/generators.json b/packages-legacy/react/generators.json new file mode 100644 index 00000000000000..37de7079b83246 --- /dev/null +++ b/packages-legacy/react/generators.json @@ -0,0 +1,4 @@ +{ + "extends": ["@nx/react"], + "schematics": {} +} diff --git a/packages-legacy/react/index.ts b/packages-legacy/react/index.ts new file mode 100644 index 00000000000000..216f7e0926902b --- /dev/null +++ b/packages-legacy/react/index.ts @@ -0,0 +1 @@ +export * from '@nx/react'; diff --git a/packages-legacy/react/module-federation.ts b/packages-legacy/react/module-federation.ts new file mode 100644 index 00000000000000..94f304cbc31e2b --- /dev/null +++ b/packages-legacy/react/module-federation.ts @@ -0,0 +1 @@ +export * from '@nx/react/module-federation'; diff --git a/packages-legacy/react/package.json b/packages-legacy/react/package.json new file mode 100644 index 00000000000000..440fcb129bbabd --- /dev/null +++ b/packages-legacy/react/package.json @@ -0,0 +1,38 @@ +{ + "name": "@nrwl/react", + "version": "0.0.1", + "private": false, + "description": "The React plugin for Nx contains executors and generators for managing React applications and libraries within an Nx workspace. It provides:\n\n\n- Integration with libraries such as Jest, Cypress, and Storybook.\n\n- Generators for applications, libraries, components, hooks, and more.\n\n- Library build support for publishing packages to npm or other registries.\n\n- Utilities for automatic workspace refactoring.", + "repository": { + "type": "git", + "url": "https://github.com/nrwl/nx.git", + "directory": "packages-legacy/react" + }, + "keywords": [ + "Monorepo", + "React", + "Web", + "Jest", + "Cypress", + "CLI" + ], + "main": "./index", + "typings": "./index.d.ts", + "author": "Victor Savkin", + "license": "MIT", + "bugs": { + "url": "https://github.com/nrwl/nx/issues" + }, + "homepage": "https://nx.dev", + "builders": "./executors.json", + "schematics": "./generators.json", + "dependencies": { + "@nx/react": "file:../../packages/react" + }, + "publishConfig": { + "access": "public" + }, + "nx-migrations": { + "migrations": "@nx/react/migrations.json" + } +} diff --git a/packages-legacy/react/plugins/bundle-rollup.ts b/packages-legacy/react/plugins/bundle-rollup.ts new file mode 100644 index 00000000000000..76f043592f968e --- /dev/null +++ b/packages-legacy/react/plugins/bundle-rollup.ts @@ -0,0 +1 @@ +module.exports = require('@nx/react/plugins/bundle-rollup'); diff --git a/packages-legacy/react/plugins/component-testing/index.ts b/packages-legacy/react/plugins/component-testing/index.ts new file mode 100644 index 00000000000000..bdfce05e1bf900 --- /dev/null +++ b/packages-legacy/react/plugins/component-testing/index.ts @@ -0,0 +1 @@ +export * from '@nx/react/plugins/component-testing'; diff --git a/packages-legacy/react/plugins/jest.ts b/packages-legacy/react/plugins/jest.ts new file mode 100644 index 00000000000000..265624ce532ee5 --- /dev/null +++ b/packages-legacy/react/plugins/jest.ts @@ -0,0 +1 @@ +module.exports = require('@nx/react/plugins/jest'); diff --git a/packages-legacy/react/plugins/storybook/index.ts b/packages-legacy/react/plugins/storybook/index.ts new file mode 100644 index 00000000000000..3edfc745f9b75b --- /dev/null +++ b/packages-legacy/react/plugins/storybook/index.ts @@ -0,0 +1 @@ +export * from '@nx/react/plugins/storybook'; diff --git a/packages-legacy/react/plugins/webpack.ts b/packages-legacy/react/plugins/webpack.ts new file mode 100644 index 00000000000000..04381eaa9abe50 --- /dev/null +++ b/packages-legacy/react/plugins/webpack.ts @@ -0,0 +1 @@ +export * from '@nx/react/plugins/webpack'; diff --git a/packages-legacy/react/plugins/with-react.ts b/packages-legacy/react/plugins/with-react.ts new file mode 100644 index 00000000000000..db567679825e37 --- /dev/null +++ b/packages-legacy/react/plugins/with-react.ts @@ -0,0 +1 @@ +export * from '@nx/react/plugins/with-react'; diff --git a/packages-legacy/react/project.json b/packages-legacy/react/project.json new file mode 100644 index 00000000000000..5f07fb9069dfbc --- /dev/null +++ b/packages-legacy/react/project.json @@ -0,0 +1,36 @@ +{ + "name": "react-legacy", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "packages-legacy/react", + "projectType": "library", + "targets": { + "build": { + "executor": "@nrwl/js:tsc", + "dependsOn": ["^build"], + "options": { + "main": "packages-legacy/react/index.ts", + "tsConfig": "packages-legacy/react/tsconfig.json", + "outputPath": "build/packages/react-legacy", + "updateBuildableProjectDepsInPackageJson": false, + "assets": [ + { + "input": "packages-legacy/react", + "glob": "**/*.json", + "ignore": ["**/tsconfig*.json", "project.json"], + "output": "/" + }, + { + "input": "packages-legacy/react", + "glob": "**/*.d.ts", + "output": "/" + }, + { + "input": "", + "glob": "LICENSE", + "output": "/" + } + ] + } + } + } +} diff --git a/packages-legacy/react/tailwind.ts b/packages-legacy/react/tailwind.ts new file mode 100644 index 00000000000000..8c9e3abfe5e5e1 --- /dev/null +++ b/packages-legacy/react/tailwind.ts @@ -0,0 +1 @@ +export * from '@nx/react/tailwind'; diff --git a/packages-legacy/react/tsconfig.json b/packages-legacy/react/tsconfig.json new file mode 100644 index 00000000000000..133314b126cffc --- /dev/null +++ b/packages-legacy/react/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": {}, + "include": ["**/*.ts"], + "files": ["index.ts"] +} diff --git a/packages-legacy/react/typings/cssmodule.d.ts b/packages-legacy/react/typings/cssmodule.d.ts new file mode 100644 index 00000000000000..4692cb8336600e --- /dev/null +++ b/packages-legacy/react/typings/cssmodule.d.ts @@ -0,0 +1,24 @@ +declare module '*.module.css' { + const classes: { readonly [key: string]: string }; + export default classes; +} + +declare module '*.module.scss' { + const classes: { readonly [key: string]: string }; + export default classes; +} + +declare module '*.module.sass' { + const classes: { readonly [key: string]: string }; + export default classes; +} + +declare module '*.module.less' { + const classes: { readonly [key: string]: string }; + export default classes; +} + +declare module '*.module.styl' { + const classes: { readonly [key: string]: string }; + export default classes; +} diff --git a/packages-legacy/react/typings/image.d.ts b/packages-legacy/react/typings/image.d.ts new file mode 100644 index 00000000000000..427d461daf8246 --- /dev/null +++ b/packages-legacy/react/typings/image.d.ts @@ -0,0 +1,48 @@ +/// +/// + +declare module '*.svg' { + import * as React from 'react'; + + export const ReactComponent: React.FunctionComponent< + React.SVGProps & { title?: string } + >; + + const src: string; + export default src; +} + +declare module '*.bmp' { + const src: string; + export default src; +} + +declare module '*.gif' { + const src: string; + export default src; +} + +declare module '*.jpg' { + const src: string; + export default src; +} + +declare module '*.jpeg' { + const src: string; + export default src; +} + +declare module '*.png' { + const src: string; + export default src; +} + +declare module '*.avif' { + const src: string; + export default src; +} + +declare module '*.webp' { + const src: string; + export default src; +} diff --git a/packages-legacy/react/typings/style.d.ts b/packages-legacy/react/typings/style.d.ts new file mode 100644 index 00000000000000..8f2d76d63e51f6 --- /dev/null +++ b/packages-legacy/react/typings/style.d.ts @@ -0,0 +1,9 @@ +export type SupportedStyles = + | 'css' + | 'scss' + | 'styl' + | 'less' + | 'styled-components' + | '@emotion/styled' + | 'styled-jsx' + | 'none'; diff --git a/packages-legacy/react/typings/styled-jsx.d.ts b/packages-legacy/react/typings/styled-jsx.d.ts new file mode 100644 index 00000000000000..febdbe1583ae1e --- /dev/null +++ b/packages-legacy/react/typings/styled-jsx.d.ts @@ -0,0 +1,8 @@ +import 'react'; + +declare module 'react' { + interface StyleHTMLAttributes extends React.HTMLAttributes { + jsx?: boolean; + global?: boolean; + } +} diff --git a/packages-legacy/rollup/README.md b/packages-legacy/rollup/README.md new file mode 100644 index 00000000000000..6930bdbcea8b73 --- /dev/null +++ b/packages-legacy/rollup/README.md @@ -0,0 +1,11 @@ +## @nrwl/rollup has been deprecated! + +@nrwl/rollup has been deprecated in favor of [@nx/rollup](https://www.npmjs.com/package/@nx/rollup). Please use that instead. + +@nrwl/rollup will no longer be published in Nx v17. + +

Nx - Smart, Fast and Extensible Build System

+ +# Nx: Smart, Fast and Extensible Build System + +Nx is a next generation build system with first class monorepo support and powerful integrations. diff --git a/packages-legacy/rollup/executors.json b/packages-legacy/rollup/executors.json new file mode 100644 index 00000000000000..1174945b1712bc --- /dev/null +++ b/packages-legacy/rollup/executors.json @@ -0,0 +1,16 @@ +{ + "builders": { + "rollup": { + "implementation": "@nx/rollup/src/executors/rollup/compat", + "schema": "@nx/rollup/src/executors/rollup/schema.json", + "description": "Bundle a package using Rollup." + } + }, + "executors": { + "rollup": { + "implementation": "@nx/rollup/src/executors/rollup/rollup.impl", + "schema": "@nx/rollup/src/executors/rollup/schema.json", + "description": "Bundle a package using Rollup." + } + } +} diff --git a/packages-legacy/rollup/generators.json b/packages-legacy/rollup/generators.json new file mode 100644 index 00000000000000..cbebf1244d9726 --- /dev/null +++ b/packages-legacy/rollup/generators.json @@ -0,0 +1,4 @@ +{ + "extends": ["@nx/rollup"], + "schematics": {} +} diff --git a/packages-legacy/rollup/index.ts b/packages-legacy/rollup/index.ts new file mode 100644 index 00000000000000..0dc83687442cee --- /dev/null +++ b/packages-legacy/rollup/index.ts @@ -0,0 +1 @@ +export * from '@nx/rollup'; diff --git a/packages-legacy/rollup/package.json b/packages-legacy/rollup/package.json new file mode 100644 index 00000000000000..0c7ec086ba99cb --- /dev/null +++ b/packages-legacy/rollup/package.json @@ -0,0 +1,36 @@ +{ + "name": "@nrwl/rollup", + "version": "0.0.1", + "private": false, + "description": "The Nx Plugin for Rollup contains executors and generators that support building applications using Rollup.", + "repository": { + "type": "git", + "url": "https://github.com/nrwl/nx.git", + "directory": "packages-legacy/rollup" + }, + "keywords": [ + "Monorepo", + "Rollup", + "Web", + "CLI" + ], + "main": "./index", + "typings": "./index.d.ts", + "author": "Victor Savkin", + "license": "MIT", + "bugs": { + "url": "https://github.com/nrwl/nx/issues" + }, + "homepage": "https://nx.dev", + "schematics": "./generators.json", + "builders": "./executors.json", + "dependencies": { + "@nx/rollup": "file:../../packages/rollup" + }, + "publishConfig": { + "access": "public" + }, + "nx-migrations": { + "migrations": "@nx/rollup/migrations.json" + } +} diff --git a/packages-legacy/rollup/project.json b/packages-legacy/rollup/project.json new file mode 100644 index 00000000000000..cf058ffe2dd49c --- /dev/null +++ b/packages-legacy/rollup/project.json @@ -0,0 +1,36 @@ +{ + "name": "rollup-legacy", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "packages-legacy/rollup", + "projectType": "library", + "targets": { + "build": { + "executor": "@nrwl/js:tsc", + "dependsOn": ["^build"], + "options": { + "main": "packages-legacy/rollup/index.ts", + "tsConfig": "packages-legacy/rollup/tsconfig.json", + "outputPath": "build/packages/rollup-legacy", + "updateBuildableProjectDepsInPackageJson": false, + "assets": [ + { + "input": "packages-legacy/rollup", + "glob": "**/*.json", + "ignore": ["**/tsconfig*.json", "project.json"], + "output": "/" + }, + { + "input": "packages-legacy/rollup", + "glob": "**/*.d.ts", + "output": "/" + }, + { + "input": "", + "glob": "LICENSE", + "output": "/" + } + ] + } + } + } +} diff --git a/packages-legacy/rollup/tsconfig.json b/packages-legacy/rollup/tsconfig.json new file mode 100644 index 00000000000000..133314b126cffc --- /dev/null +++ b/packages-legacy/rollup/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": {}, + "include": ["**/*.ts"], + "files": ["index.ts"] +} diff --git a/packages-legacy/storybook/README.md b/packages-legacy/storybook/README.md new file mode 100644 index 00000000000000..9ced6aace810c2 --- /dev/null +++ b/packages-legacy/storybook/README.md @@ -0,0 +1,11 @@ +## @nrwl/storybook has been deprecated! + +@nrwl/storybook has been deprecated in favor of [@nx/storybook](https://www.npmjs.com/package/@nx/storybook). Please use that instead. + +@nrwl/storybook will no longer be published in Nx v17. + +

Nx - Smart, Fast and Extensible Build System

+ +# Nx: Smart, Fast and Extensible Build System + +Nx is a next generation build system with first class monorepo support and powerful integrations. diff --git a/packages-legacy/storybook/executors.json b/packages-legacy/storybook/executors.json new file mode 100644 index 00000000000000..51ef2d967b45f5 --- /dev/null +++ b/packages-legacy/storybook/executors.json @@ -0,0 +1,26 @@ +{ + "builders": { + "storybook": { + "implementation": "@nx/storybook/src/executors/storybook/compat", + "schema": "@nx/storybook/src/executors/storybook/schema.json", + "description": "Serve Storybook." + }, + "build": { + "implementation": "@nx/storybook/src/executors/build-storybook/compat", + "schema": "@nx/storybook/src/executors/build-storybook/schema.json", + "description": "Build Storybook." + } + }, + "executors": { + "storybook": { + "implementation": "@nx/storybook/src/executors/storybook/storybook.impl", + "schema": "@nx/storybook/src/executors/storybook/schema.json", + "description": "Serve Storybook." + }, + "build": { + "implementation": "@nx/storybook/src/executors/build-storybook/build-storybook.impl", + "schema": "@nx/storybook/src/executors/build-storybook/schema.json", + "description": "Build Storybook." + } + } +} diff --git a/packages-legacy/storybook/generators.json b/packages-legacy/storybook/generators.json new file mode 100644 index 00000000000000..08458127a44605 --- /dev/null +++ b/packages-legacy/storybook/generators.json @@ -0,0 +1,4 @@ +{ + "extends": ["@nx/storybook"], + "schematics": {} +} diff --git a/packages-legacy/storybook/index.ts b/packages-legacy/storybook/index.ts new file mode 100644 index 00000000000000..2d616f02ad5296 --- /dev/null +++ b/packages-legacy/storybook/index.ts @@ -0,0 +1 @@ +export * from '@nx/storybook'; diff --git a/packages-legacy/storybook/package.json b/packages-legacy/storybook/package.json new file mode 100644 index 00000000000000..90dda3a420c997 --- /dev/null +++ b/packages-legacy/storybook/package.json @@ -0,0 +1,37 @@ +{ + "name": "@nrwl/storybook", + "version": "0.0.1", + "private": false, + "description": "The Nx Plugin for Storybook contains executors and generators for allowing your workspace to use the powerful Storybook integration testing & documenting capabilities.", + "repository": { + "type": "git", + "url": "https://github.com/nrwl/nx.git", + "directory": "packages-legacy/storybook" + }, + "keywords": [ + "Angular", + "React", + "Web", + "Storybook", + "Cypress" + ], + "main": "./index", + "typings": "./index.d.ts", + "author": "Isaac Mann", + "license": "MIT", + "bugs": { + "url": "https://github.com/nrwl/nx/issues" + }, + "homepage": "https://nx.dev", + "schematics": "./generators.json", + "builders": "./executors.json", + "dependencies": { + "@nx/storybook": "file:../../packages/storybook" + }, + "publishConfig": { + "access": "public" + }, + "nx-migrations": { + "migrations": "@nx/storybook/migrations.json" + } +} diff --git a/packages-legacy/storybook/presets/cypress.ts b/packages-legacy/storybook/presets/cypress.ts new file mode 100644 index 00000000000000..a3c5345391dbbe --- /dev/null +++ b/packages-legacy/storybook/presets/cypress.ts @@ -0,0 +1 @@ +export * from '@nx/storybook/presets/cypress'; diff --git a/packages-legacy/storybook/project.json b/packages-legacy/storybook/project.json new file mode 100644 index 00000000000000..e1265fb8ee3077 --- /dev/null +++ b/packages-legacy/storybook/project.json @@ -0,0 +1,36 @@ +{ + "name": "storybook-legacy", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "packages-legacy/storybook", + "projectType": "library", + "targets": { + "build": { + "executor": "@nrwl/js:tsc", + "dependsOn": ["^build"], + "options": { + "main": "packages-legacy/storybook/index.ts", + "tsConfig": "packages-legacy/storybook/tsconfig.json", + "outputPath": "build/packages/storybook-legacy", + "updateBuildableProjectDepsInPackageJson": false, + "assets": [ + { + "input": "packages-legacy/storybook", + "glob": "**/*.json", + "ignore": ["**/tsconfig*.json", "project.json"], + "output": "/" + }, + { + "input": "packages-legacy/storybook", + "glob": "**/*.d.ts", + "output": "/" + }, + { + "input": "", + "glob": "LICENSE", + "output": "/" + } + ] + } + } + } +} diff --git a/packages-legacy/storybook/tsconfig.json b/packages-legacy/storybook/tsconfig.json new file mode 100644 index 00000000000000..133314b126cffc --- /dev/null +++ b/packages-legacy/storybook/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": {}, + "include": ["**/*.ts"], + "files": ["index.ts"] +} diff --git a/packages-legacy/vite/README.md b/packages-legacy/vite/README.md new file mode 100644 index 00000000000000..a921611d1f4802 --- /dev/null +++ b/packages-legacy/vite/README.md @@ -0,0 +1,11 @@ +## @nrwl/vite has been deprecated! + +@nrwl/vite has been deprecated in favor of [@nx/vite](https://www.npmjs.com/package/@nx/vite). Please use that instead. + +@nrwl/vite will no longer be published in Nx v17. + +

Nx - Smart, Fast and Extensible Build System

+ +# Nx: Smart, Fast and Extensible Build System + +Nx is a next generation build system with first class monorepo support and powerful integrations. diff --git a/packages-legacy/vite/executors.json b/packages-legacy/vite/executors.json new file mode 100644 index 00000000000000..30f6e19ee8b077 --- /dev/null +++ b/packages-legacy/vite/executors.json @@ -0,0 +1,46 @@ +{ + "builders": { + "dev-server": { + "implementation": "@nx/vite/src/executors/dev-server/compat", + "schema": "@nx/vite/src/executors/dev-server/schema.json", + "description": "Vite dev server." + }, + "build": { + "implementation": "@nx/vite/src/executors/build/compat", + "schema": "@nx/vite/src/executors/build/schema.json", + "description": "Build with Vite." + }, + "test": { + "implementation": "@nx/vite/src/executors/test/compat", + "schema": "@nx/vite/src/executors/test/schema.json", + "description": "Test with Vitest" + }, + "preview-server": { + "implementation": "@nx/vite/src/executors/preview-server/compat", + "schema": "@nx/vite/src/executors/preview-server/schema.json", + "description": "Vite preview server" + } + }, + "executors": { + "dev-server": { + "implementation": "@nx/vite/src/executors/dev-server/dev-server.impl", + "schema": "@nx/vite/src/executors/dev-server/schema.json", + "description": "Vite dev server." + }, + "build": { + "implementation": "@nx/vite/src/executors/build/build.impl", + "schema": "@nx/vite/src/executors/build/schema.json", + "description": "Build with Vite." + }, + "test": { + "implementation": "@nx/vite/src/executors/test/vitest.impl", + "schema": "@nx/vite/src/executors/test/schema.json", + "description": "Test with Vitest" + }, + "preview-server": { + "implementation": "@nx/vite/src/executors/preview-server/preview-server.impl", + "schema": "@nx/vite/src/executors/preview-server/schema.json", + "description": "Vite preview server" + } + } +} diff --git a/packages-legacy/vite/executors.ts b/packages-legacy/vite/executors.ts new file mode 100644 index 00000000000000..785735aa32f504 --- /dev/null +++ b/packages-legacy/vite/executors.ts @@ -0,0 +1 @@ +export * from '@nx/vite/executors'; diff --git a/packages-legacy/vite/generators.json b/packages-legacy/vite/generators.json new file mode 100644 index 00000000000000..b45d8b8da413b5 --- /dev/null +++ b/packages-legacy/vite/generators.json @@ -0,0 +1,4 @@ +{ + "extends": ["@nx/vite"], + "schematics": {} +} diff --git a/packages-legacy/vite/index.ts b/packages-legacy/vite/index.ts new file mode 100644 index 00000000000000..e4515b4496b6f9 --- /dev/null +++ b/packages-legacy/vite/index.ts @@ -0,0 +1 @@ +export * from '@nx/vite'; diff --git a/packages-legacy/vite/package.json b/packages-legacy/vite/package.json new file mode 100644 index 00000000000000..82b0655def63f9 --- /dev/null +++ b/packages-legacy/vite/package.json @@ -0,0 +1,42 @@ +{ + "name": "@nrwl/vite", + "version": "0.0.1", + "private": false, + "description": "The Nx Plugin for building and testing applications using Vite", + "repository": { + "type": "git", + "url": "https://github.com/nrwl/nx.git", + "directory": "packages-legacy/vite" + }, + "keywords": [ + "Monorepo", + "Vite", + "Web", + "CLI" + ], + "main": "./index", + "typings": "./index.d.ts", + "author": "Victor Savkin", + "license": "MIT", + "bugs": { + "url": "https://github.com/nrwl/nx/issues" + }, + "homepage": "https://nx.dev", + "schematics": "./generators.json", + "builders": "./executors.json", + "dependencies": { + "@nx/vite": "file:../../packages/vite" + }, + "publishConfig": { + "access": "public" + }, + "exports": { + "./package.json": { + "require": "./package.json" + }, + "./executors": "./executors.js" + }, + "nx-migrations": { + "migrations": "@nx/vite/migrations.json" + } +} diff --git a/packages-legacy/vite/plugins/rollup-replace-files.plugin.ts b/packages-legacy/vite/plugins/rollup-replace-files.plugin.ts new file mode 100644 index 00000000000000..343d273cb6ddb5 --- /dev/null +++ b/packages-legacy/vite/plugins/rollup-replace-files.plugin.ts @@ -0,0 +1 @@ +export * from '@nx/vite/plugins/rollup-replace-files.plugin'; diff --git a/packages-legacy/vite/project.json b/packages-legacy/vite/project.json new file mode 100644 index 00000000000000..3d59af2b259bfb --- /dev/null +++ b/packages-legacy/vite/project.json @@ -0,0 +1,36 @@ +{ + "name": "vite-legacy", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "packages-legacy/vite", + "projectType": "library", + "targets": { + "build": { + "executor": "@nrwl/js:tsc", + "dependsOn": ["^build"], + "options": { + "main": "packages-legacy/vite/index.ts", + "tsConfig": "packages-legacy/vite/tsconfig.json", + "outputPath": "build/packages/vite-legacy", + "updateBuildableProjectDepsInPackageJson": false, + "assets": [ + { + "input": "packages-legacy/vite", + "glob": "**/*.json", + "ignore": ["**/tsconfig*.json", "project.json"], + "output": "/" + }, + { + "input": "packages-legacy/vite", + "glob": "**/*.d.ts", + "output": "/" + }, + { + "input": "", + "glob": "LICENSE", + "output": "/" + } + ] + } + } + } +} diff --git a/packages-legacy/vite/tsconfig.json b/packages-legacy/vite/tsconfig.json new file mode 100644 index 00000000000000..133314b126cffc --- /dev/null +++ b/packages-legacy/vite/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": {}, + "include": ["**/*.ts"], + "files": ["index.ts"] +} diff --git a/packages-legacy/web/README.md b/packages-legacy/web/README.md new file mode 100644 index 00000000000000..9c10378f0e2341 --- /dev/null +++ b/packages-legacy/web/README.md @@ -0,0 +1,11 @@ +## @nrwl/web has been deprecated! + +@nrwl/web has been deprecated in favor of [@nx/web](https://www.npmjs.com/package/@nx/web). Please use that instead. + +@nrwl/web will no longer be published in Nx v17. + +

Nx - Smart, Fast and Extensible Build System

+ +# Nx: Smart, Fast and Extensible Build System + +Nx is a next generation build system with first class monorepo support and powerful integrations. diff --git a/packages-legacy/web/babel.ts b/packages-legacy/web/babel.ts new file mode 100644 index 00000000000000..a6f660db165012 --- /dev/null +++ b/packages-legacy/web/babel.ts @@ -0,0 +1 @@ +module.exports = require('@nx/web/babel'); diff --git a/packages-legacy/web/executors.json b/packages-legacy/web/executors.json new file mode 100644 index 00000000000000..d3f827055f7abb --- /dev/null +++ b/packages-legacy/web/executors.json @@ -0,0 +1,46 @@ +{ + "builders": { + "webpack": { + "implementation": "@nx/web/src/executors/webpack/compat", + "schema": "@nx/web/src/executors/webpack/schema.json", + "description": "Build an application using Webpack." + }, + "rollup": { + "implementation": "@nx/web/src/executors/rollup/compat", + "schema": "@nx/web/src/executors/rollup/schema.json", + "description": "Package a library using Rollup." + }, + "dev-server": { + "implementation": "@nx/web/src/executors/dev-server/compat", + "schema": "@nx/web/src/executors/dev-server/schema.json", + "description": "Serve a web application." + }, + "file-server": { + "implementation": "@nx/web/src/executors/file-server/compat", + "schema": "@nx/web/src/executors/file-server/schema.json", + "description": "Serve a web application from a folder." + } + }, + "executors": { + "webpack": { + "implementation": "@nx/web/src/executors/webpack/webpack.impl", + "schema": "@nx/web/src/executors/webpack/schema.json", + "description": "Build an application using Webpack." + }, + "rollup": { + "implementation": "@nx/web/src/executors/rollup/rollup.impl", + "schema": "@nx/web/src/executors/rollup/schema.json", + "description": "Package a library using Rollup." + }, + "dev-server": { + "implementation": "@nx/web/src/executors/dev-server/dev-server.impl", + "schema": "@nx/web/src/executors/dev-server/schema.json", + "description": "Serve a web application." + }, + "file-server": { + "implementation": "@nx/web/src/executors/file-server/file-server.impl", + "schema": "@nx/web/src/executors/file-server/schema.json", + "description": "Serve a web application from a folder." + } + } +} diff --git a/packages-legacy/web/generators.json b/packages-legacy/web/generators.json new file mode 100644 index 00000000000000..de791c1241c4ec --- /dev/null +++ b/packages-legacy/web/generators.json @@ -0,0 +1,4 @@ +{ + "extends": ["@nx/web"], + "schematics": {} +} diff --git a/packages-legacy/web/index.ts b/packages-legacy/web/index.ts new file mode 100644 index 00000000000000..aa41618035a81a --- /dev/null +++ b/packages-legacy/web/index.ts @@ -0,0 +1 @@ +export * from '@nx/web'; diff --git a/packages-legacy/web/package.json b/packages-legacy/web/package.json new file mode 100644 index 00000000000000..ada7cbb6f1440d --- /dev/null +++ b/packages-legacy/web/package.json @@ -0,0 +1,37 @@ +{ + "name": "@nrwl/web", + "version": "0.0.1", + "private": false, + "description": "The Nx Plugin for Web Components contains generators for managing Web Component applications and libraries within an Nx workspace. It provides:\n\n\n- Integration with libraries such as Jest, Cypress, and Storybook.\n\n- Scaffolding for creating buildable libraries that can be published to npm.\n\n- Utilities for automatic workspace refactoring.", + "repository": { + "type": "git", + "url": "https://github.com/nrwl/nx.git", + "directory": "packages-legacy/web" + }, + "keywords": [ + "Monorepo", + "Web", + "Jest", + "Cypress", + "CLI" + ], + "main": "./index", + "typings": "./index.d.ts", + "author": "Victor Savkin", + "license": "MIT", + "bugs": { + "url": "https://github.com/nrwl/nx/issues" + }, + "homepage": "https://nx.dev", + "schematics": "./generators.json", + "builders": "./executors.json", + "dependencies": { + "@nx/web": "file:../../packages/web" + }, + "publishConfig": { + "access": "public" + }, + "nx-migrations": { + "migrations": "@nx/web/migrations.json" + } +} diff --git a/packages-legacy/web/project.json b/packages-legacy/web/project.json new file mode 100644 index 00000000000000..fa92f088da85ab --- /dev/null +++ b/packages-legacy/web/project.json @@ -0,0 +1,36 @@ +{ + "name": "web-legacy", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "packages-legacy/web", + "projectType": "library", + "targets": { + "build": { + "executor": "@nrwl/js:tsc", + "dependsOn": ["^build"], + "options": { + "main": "packages-legacy/web/index.ts", + "tsConfig": "packages-legacy/web/tsconfig.json", + "outputPath": "build/packages/web-legacy", + "updateBuildableProjectDepsInPackageJson": false, + "assets": [ + { + "input": "packages-legacy/web", + "glob": "**/*.json", + "ignore": ["**/tsconfig*.json", "project.json"], + "output": "/" + }, + { + "input": "packages-legacy/web", + "glob": "**/*.d.ts", + "output": "/" + }, + { + "input": "", + "glob": "LICENSE", + "output": "/" + } + ] + } + } + } +} diff --git a/packages-legacy/web/tsconfig.json b/packages-legacy/web/tsconfig.json new file mode 100644 index 00000000000000..133314b126cffc --- /dev/null +++ b/packages-legacy/web/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": {}, + "include": ["**/*.ts"], + "files": ["index.ts"] +} diff --git a/packages-legacy/webpack/README.md b/packages-legacy/webpack/README.md new file mode 100644 index 00000000000000..05f255597f1fc0 --- /dev/null +++ b/packages-legacy/webpack/README.md @@ -0,0 +1,11 @@ +## @nrwl/webpack has been deprecated! + +@nrwl/webpack has been deprecated in favor of [@nx/webpack](https://www.npmjs.com/package/@nx/webpack). Please use that instead. + +@nrwl/webpack will no longer be published in Nx v17. + +

Nx - Smart, Fast and Extensible Build System

+ +# Nx: Smart, Fast and Extensible Build System + +Nx is a next generation build system with first class monorepo support and powerful integrations. diff --git a/packages-legacy/webpack/executors.json b/packages-legacy/webpack/executors.json new file mode 100644 index 00000000000000..dc79978044d136 --- /dev/null +++ b/packages-legacy/webpack/executors.json @@ -0,0 +1,36 @@ +{ + "builders": { + "webpack": { + "implementation": "@nx/webpack/src/executors/webpack/compat", + "schema": "@nx/webpack/src/executors/webpack/schema.json", + "description": "Run webpack build." + }, + "dev-server": { + "implementation": "@nx/webpack/src/executors/dev-server/compat", + "schema": "@nx/webpack/src/executors/dev-server/schema.json", + "description": "Serve a web application." + }, + "ssr-dev-server": { + "implementation": "@nx/webpack/src/executors/ssr-dev-server/compat", + "schema": "@nx/webpack/src/executors/ssr-dev-server/schema.json", + "description": "Serve a SSR application." + } + }, + "executors": { + "webpack": { + "implementation": "@nx/webpack/src/executors/webpack/webpack.impl", + "schema": "@nx/webpack/src/executors/webpack/schema.json", + "description": "Run webpack build." + }, + "dev-server": { + "implementation": "@nx/webpack/src/executors/dev-server/dev-server.impl", + "schema": "@nx/webpack/src/executors/dev-server/schema.json", + "description": "Serve a web application." + }, + "ssr-dev-server": { + "implementation": "@nx/webpack/src/executors/ssr-dev-server/ssr-dev-server.impl", + "schema": "@nx/webpack/src/executors/ssr-dev-server/schema.json", + "description": "Serve a SSR application." + } + } +} diff --git a/packages-legacy/webpack/generators.json b/packages-legacy/webpack/generators.json new file mode 100644 index 00000000000000..eec6b00f5c1f46 --- /dev/null +++ b/packages-legacy/webpack/generators.json @@ -0,0 +1,4 @@ +{ + "extends": ["@nx/webpack"], + "schematics": {} +} diff --git a/packages-legacy/webpack/index.ts b/packages-legacy/webpack/index.ts new file mode 100644 index 00000000000000..324863a54c4af6 --- /dev/null +++ b/packages-legacy/webpack/index.ts @@ -0,0 +1 @@ +export * from '@nx/webpack'; diff --git a/packages-legacy/webpack/package.json b/packages-legacy/webpack/package.json new file mode 100644 index 00000000000000..466811690bf2d3 --- /dev/null +++ b/packages-legacy/webpack/package.json @@ -0,0 +1,36 @@ +{ + "name": "@nrwl/webpack", + "version": "0.0.1", + "private": false, + "description": "The Nx Plugin for Webpack contains executors and generators that support building applications using Webpack.", + "repository": { + "type": "git", + "url": "https://github.com/nrwl/nx.git", + "directory": "packages-legacy/webpack" + }, + "keywords": [ + "Monorepo", + "Webpack", + "Web", + "CLI" + ], + "main": "./index", + "typings": "./index.d.ts", + "author": "Victor Savkin", + "license": "MIT", + "bugs": { + "url": "https://github.com/nrwl/nx/issues" + }, + "homepage": "https://nx.dev", + "schematics": "./generators.json", + "builders": "./executors.json", + "dependencies": { + "@nx/webpack": "file:../../packages/webpack" + }, + "publishConfig": { + "access": "public" + }, + "nx-migrations": { + "migrations": "@nx/webpack/migrations.json" + } +} diff --git a/packages-legacy/webpack/project.json b/packages-legacy/webpack/project.json new file mode 100644 index 00000000000000..925e3d50637b7b --- /dev/null +++ b/packages-legacy/webpack/project.json @@ -0,0 +1,36 @@ +{ + "name": "webpack-legacy", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "packages-legacy/webpack", + "projectType": "library", + "targets": { + "build": { + "executor": "@nrwl/js:tsc", + "dependsOn": ["^build"], + "options": { + "main": "packages-legacy/webpack/index.ts", + "tsConfig": "packages-legacy/webpack/tsconfig.json", + "outputPath": "build/packages/webpack-legacy", + "updateBuildableProjectDepsInPackageJson": false, + "assets": [ + { + "input": "packages-legacy/webpack", + "glob": "**/*.json", + "ignore": ["**/tsconfig*.json", "project.json"], + "output": "/" + }, + { + "input": "packages-legacy/webpack", + "glob": "**/*.d.ts", + "output": "/" + }, + { + "input": "", + "glob": "LICENSE", + "output": "/" + } + ] + } + } + } +} diff --git a/packages-legacy/webpack/tsconfig.json b/packages-legacy/webpack/tsconfig.json new file mode 100644 index 00000000000000..133314b126cffc --- /dev/null +++ b/packages-legacy/webpack/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": {}, + "include": ["**/*.ts"], + "files": ["index.ts"] +} diff --git a/packages-legacy/workspace/README.md b/packages-legacy/workspace/README.md new file mode 100644 index 00000000000000..66651f9508d462 --- /dev/null +++ b/packages-legacy/workspace/README.md @@ -0,0 +1,11 @@ +## @nrwl/workspace has been deprecated! + +@nrwl/workspace has been deprecated in favor of [@nx/workspace](https://www.npmjs.com/package/@nx/workspace). Please use that instead. + +@nrwl/workspace will no longer be published in Nx v17. + +

Nx - Smart, Fast and Extensible Build System

+ +# Nx: Smart, Fast and Extensible Build System + +Nx is a next generation build system with first class monorepo support and powerful integrations. diff --git a/packages-legacy/workspace/executors.json b/packages-legacy/workspace/executors.json new file mode 100644 index 00000000000000..c487c0a0d4aa68 --- /dev/null +++ b/packages-legacy/workspace/executors.json @@ -0,0 +1,11 @@ +{ + "executors": { + "counter": { + "implementation": "@nx/workspace/src/executors/counter/counter.impl", + "batchImplementation": "@nx/workspace/src/executors/counter/counter.impl#batchCounter", + "schema": "@nx/workspace/src/executors/counter/schema.json", + "description": "A dummy executor useful for E2E tests.", + "hidden": true + } + } +} diff --git a/packages-legacy/workspace/generators.json b/packages-legacy/workspace/generators.json new file mode 100644 index 00000000000000..9c05dba46b4b6d --- /dev/null +++ b/packages-legacy/workspace/generators.json @@ -0,0 +1,4 @@ +{ + "extends": ["@nx/workspace"], + "schematics": {} +} diff --git a/packages-legacy/workspace/generators.ts b/packages-legacy/workspace/generators.ts new file mode 100644 index 00000000000000..935190660e3068 --- /dev/null +++ b/packages-legacy/workspace/generators.ts @@ -0,0 +1 @@ +export * from '@nx/workspace/generators'; diff --git a/packages-legacy/workspace/index.ts b/packages-legacy/workspace/index.ts new file mode 100644 index 00000000000000..87ce9c5232c5ee --- /dev/null +++ b/packages-legacy/workspace/index.ts @@ -0,0 +1 @@ +export * from '@nx/workspace'; diff --git a/packages-legacy/workspace/package.json b/packages-legacy/workspace/package.json new file mode 100644 index 00000000000000..da5d4fe464fa30 --- /dev/null +++ b/packages-legacy/workspace/package.json @@ -0,0 +1,41 @@ +{ + "name": "@nrwl/workspace", + "version": "0.0.1", + "private": false, + "description": "The Workspace plugin contains executors and generators that are useful for any Nx workspace. It should be present in every Nx workspace and other plugins build on it.", + "repository": { + "type": "git", + "url": "https://github.com/nrwl/nx.git", + "directory": "packages-legacy/workspace" + }, + "keywords": [ + "Monorepo", + "Angular", + "React", + "Web", + "Node", + "Nest", + "Jest", + "Cypress", + "CLI" + ], + "main": "./index", + "typings": "./index.d.ts", + "author": "Victor Savkin", + "license": "MIT", + "bugs": { + "url": "https://github.com/nrwl/nx/issues" + }, + "homepage": "https://nx.dev", + "schematics": "./generators.json", + "builders": "./executors.json", + "dependencies": { + "@nx/workspace": "file:../../packages/workspace" + }, + "publishConfig": { + "access": "public" + }, + "nx-migrations": { + "migrations": "@nx/workspace/migrations.json" + } +} diff --git a/packages-legacy/workspace/presets/core.json b/packages-legacy/workspace/presets/core.json new file mode 100644 index 00000000000000..106dd457931cfd --- /dev/null +++ b/packages-legacy/workspace/presets/core.json @@ -0,0 +1,11 @@ +{ + "targetDefaults": { + "build": { + "dependsOn": ["^build"] + } + }, + "workspaceLayout": { + "appsDir": "packages", + "libsDir": "packages" + } +} diff --git a/packages-legacy/workspace/presets/npm.json b/packages-legacy/workspace/presets/npm.json new file mode 100644 index 00000000000000..2a59ed722a993e --- /dev/null +++ b/packages-legacy/workspace/presets/npm.json @@ -0,0 +1,7 @@ +{ + "targetDefaults": { + "build": { + "dependsOn": ["^build"] + } + } +} diff --git a/packages-legacy/workspace/project.json b/packages-legacy/workspace/project.json new file mode 100644 index 00000000000000..49c3f5f6aebb0b --- /dev/null +++ b/packages-legacy/workspace/project.json @@ -0,0 +1,36 @@ +{ + "name": "workspace-legacy", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "packages-legacy/workspace", + "projectType": "library", + "targets": { + "build": { + "executor": "@nrwl/js:tsc", + "dependsOn": ["^build"], + "options": { + "main": "packages-legacy/workspace/index.ts", + "tsConfig": "packages-legacy/workspace/tsconfig.json", + "outputPath": "build/packages/workspace-legacy", + "updateBuildableProjectDepsInPackageJson": false, + "assets": [ + { + "input": "packages-legacy/workspace", + "glob": "**/*.json", + "ignore": ["**/tsconfig*.json", "project.json"], + "output": "/" + }, + { + "input": "packages-legacy/workspace", + "glob": "**/*.d.ts", + "output": "/" + }, + { + "input": "", + "glob": "LICENSE", + "output": "/" + } + ] + } + } + } +} diff --git a/packages-legacy/workspace/tasks-runners/default.ts b/packages-legacy/workspace/tasks-runners/default.ts new file mode 100644 index 00000000000000..7a9089f1533432 --- /dev/null +++ b/packages-legacy/workspace/tasks-runners/default.ts @@ -0,0 +1 @@ +export * from '@nx/workspace/tasks-runners/default'; diff --git a/packages-legacy/workspace/testing.ts b/packages-legacy/workspace/testing.ts new file mode 100644 index 00000000000000..c5803c65661176 --- /dev/null +++ b/packages-legacy/workspace/testing.ts @@ -0,0 +1 @@ +export * from '@nx/workspace/testing'; diff --git a/packages-legacy/workspace/tsconfig.json b/packages-legacy/workspace/tsconfig.json new file mode 100644 index 00000000000000..133314b126cffc --- /dev/null +++ b/packages-legacy/workspace/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": {}, + "include": ["**/*.ts"], + "files": ["index.ts"] +} diff --git a/packages/angular/migrations.json b/packages/angular/migrations.json index f35dbeeb81a977..9a0a545d414aac 100644 --- a/packages/angular/migrations.json +++ b/packages/angular/migrations.json @@ -170,6 +170,12 @@ "version": "16.0.0-beta.1", "description": "Replace the deprecated library generator 'simpleModuleName' option from generator defaults with 'simpleName'", "factory": "./src/migrations/update-16-0-0/remove-library-generator-simple-module-name-option" + }, + "update-16-0-0-add-nx-packages": { + "cli": "nx", + "version": "16.0.0-beta.1", + "description": "Replace @nrwl/angular with @nx/angular", + "implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages" } }, "packageJsonUpdates": { diff --git a/packages/angular/migrations.spec.ts b/packages/angular/migrations.spec.ts index 96fa646c948ce5..5fd44f2a67bd71 100644 --- a/packages/angular/migrations.spec.ts +++ b/packages/angular/migrations.spec.ts @@ -1,11 +1,14 @@ import path = require('path'); import json = require('./migrations.json'); +import { MigrationsJsonEntry } from 'nx/src/config/misc-interfaces'; describe('Angular migrations', () => { it('should have valid paths', () => { - Object.values(json.generators).forEach((m) => { + Object.values(json.generators).forEach((m: MigrationsJsonEntry) => { expect(() => - require.resolve(path.join(__dirname, `${m.factory}.ts`)) + require.resolve( + path.join(__dirname, `${m.factory ?? m.implementation}.ts`) + ) ).not.toThrow(); }); }); diff --git a/packages/angular/ng-package.json b/packages/angular/ng-package.json index bb8fbc5f547e61..d6605fd4ba81d0 100644 --- a/packages/angular/ng-package.json +++ b/packages/angular/ng-package.json @@ -3,7 +3,10 @@ "lib": { "entryFile": "index.ts" }, + "dest": "../../build/packages/angular", + "deleteDestPath": false, "allowedNonPeerDependencies": [ + "@nx/", "@nrwl/", "@angular-devkit", "@angular-eslint/", diff --git a/packages/angular/package.json b/packages/angular/package.json index 0458bc6fa59a78..4efd4c95b9d2a4 100644 --- a/packages/angular/package.json +++ b/packages/angular/package.json @@ -1,5 +1,5 @@ { - "name": "@nrwl/angular", + "name": "@nx/angular", "version": "0.0.1", "private": false, "description": "The Nx Plugin for Angular contains executors, generators, and utilities for managing Angular applications and libraries within an Nx workspace. It provides: \n\n- Integration with libraries such as Storybook, Jest, ESLint, Tailwind CSS, and Cypress. \n\n- Generators to help scaffold code quickly (like: Micro Frontends, Libraries, both internal to your codebase and publishable to npm) \n\n- Upgrading AngularJS applications \n\n- Single Component Application Modules (SCAMs) \n\n- NgRx helpers. \n\n- Utilities for automatic workspace refactoring.", @@ -16,13 +16,21 @@ "CLI" ], "exports": { + "./migrations.json": "./migrations.json", + "./generators.json": "./generators.json", + "./executors.json": "./executors.json", "./generators": "./generators.js", "./executors": "./executors.js", "./tailwind": "./tailwind.js", - "./src/generators/utils": "./src/generators/utils/index.js", - "./src/utils": "./src/utils/public-api.js", "./module-federation": "./module-federation/index.js", - "./plugins/component-testing": "./plugins/component-testing.js" + "./src/utils": "./src/utils/public-api.js", + "./plugins/component-testing": "./plugins/component-testing.js", + "./src/generators/utils": "./src/generators/utils/index.js", + "./src/builders/*/schema.json": "./src/builders/*/schema.json", + "./src/builders/*.impl": "./src/builders/*.impl.js", + "./src/executors/*/schema.json": "./src/executors/*/schema.json", + "./src/executors/*.impl": "./src/executors/*.impl.js", + "./src/executors/*/compat": "./src/executors/*/compat.js" }, "author": "Victor Savkin", "license": "MIT", @@ -37,13 +45,6 @@ "migrations": "./migrations.json" }, "dependencies": { - "@nrwl/cypress": "file:../cypress", - "@nrwl/devkit": "file:../devkit", - "@nrwl/jest": "file:../jest", - "@nrwl/js": "file:../js", - "@nrwl/linter": "file:../linter", - "@nrwl/webpack": "file:../webpack", - "@nrwl/workspace": "file:../workspace", "@phenomnomnominal/tsquery": "~5.0.1", "chalk": "^4.1.0", "chokidar": "^3.5.1", @@ -56,7 +57,14 @@ "tsconfig-paths": "^4.1.2", "webpack": "^5.75.0", "webpack-merge": "5.7.3", - "enquirer": "^2.3.6" + "enquirer": "^2.3.6", + "@nx/cypress": "file:../cypress", + "@nx/devkit": "file:../devkit", + "@nx/jest": "file:../jest", + "@nx/js": "file:../js", + "@nx/linter": "file:../linter", + "@nx/webpack": "file:../webpack", + "@nx/workspace": "file:../workspace" }, "peerDependencies": { "@angular-devkit/build-angular": ">= 14.0.0 < 16.0.0", diff --git a/packages/angular/plugins/component-testing.ts b/packages/angular/plugins/component-testing.ts index a3e6fe4022e64f..e3050945da4de8 100644 --- a/packages/angular/plugins/component-testing.ts +++ b/packages/angular/plugins/component-testing.ts @@ -1,13 +1,13 @@ import { nxBaseCypressPreset, NxComponentTestingOptions, -} from '@nrwl/cypress/plugins/cypress-preset'; +} from '@nx/cypress/plugins/cypress-preset'; import { createExecutorContext, getProjectConfigByPath, getTempTailwindPath, isCtProjectUsingBuildProject, -} from '@nrwl/cypress/src/utils/ct-helpers'; +} from '@nx/cypress/src/utils/ct-helpers'; import { ExecutorContext, joinPathFragments, @@ -19,7 +19,7 @@ import { readCachedProjectGraph, readTargetOptions, stripIndents, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { existsSync, lstatSync, mkdirSync, writeFileSync } from 'fs'; import { dirname, join, relative, sep } from 'path'; import type { BrowserBuilderSchema } from '../src/builders/webpack-browser/schema'; diff --git a/packages/angular/project.json b/packages/angular/project.json index 7959011f36f3ba..c70f79e3189e54 100644 --- a/packages/angular/project.json +++ b/packages/angular/project.json @@ -5,6 +5,15 @@ "projectType": "library", "targets": { "test": {}, + "build-ng": { + "dependsOn": ["build-base"], + "executor": "@nrwl/angular:package", + "options": { + "project": "packages/angular/ng-package.json", + "tsConfig": "packages/angular/tsconfig.lib.json" + }, + "outputs": ["build/packages/angular"] + }, "build-base": { "executor": "@nrwl/js:tsc", "options": { @@ -52,14 +61,13 @@ "build": { "executor": "nx:run-commands", "outputs": ["{workspaceRoot}/build/packages/angular"], + "dependsOn": ["build-ng", "build-base", "^build"], "options": { "commands": [ - { - "command": "node ./scripts/build-angular" - }, { "command": "node ./scripts/copy-readme.js angular" - } + }, + "node ./scripts/add-dependency-to-build.js angular @nrwl/angular" ], "parallel": false } diff --git a/packages/angular/src/builders/module-federation-dev-server/module-federation-dev-server.impl.ts b/packages/angular/src/builders/module-federation-dev-server/module-federation-dev-server.impl.ts index 97fb7225fb3655..3899d069105bd7 100644 --- a/packages/angular/src/builders/module-federation-dev-server/module-federation-dev-server.impl.ts +++ b/packages/angular/src/builders/module-federation-dev-server/module-federation-dev-server.impl.ts @@ -1,9 +1,5 @@ import type { Schema } from './schema'; -import { - readCachedProjectGraph, - workspaceRoot, - Workspaces, -} from '@nrwl/devkit'; +import { readCachedProjectGraph, workspaceRoot, Workspaces } from '@nx/devkit'; import { scheduleTarget } from 'nx/src/adapter/ngcli-adapter'; import { executeWebpackDevServerBuilder } from '../webpack-dev-server/webpack-dev-server.impl'; import { readProjectsConfigurationFromProjectGraph } from 'nx/src/project-graph/project-graph'; diff --git a/packages/angular/src/builders/module-federation-dev-ssr/module-federation-dev-ssr.impl.ts b/packages/angular/src/builders/module-federation-dev-ssr/module-federation-dev-ssr.impl.ts index c418caf6b72305..457eed3f7e2896 100644 --- a/packages/angular/src/builders/module-federation-dev-ssr/module-federation-dev-ssr.impl.ts +++ b/packages/angular/src/builders/module-federation-dev-ssr/module-federation-dev-ssr.impl.ts @@ -1,10 +1,6 @@ import type { Schema } from './schema'; import { readProjectsConfigurationFromProjectGraph } from 'nx/src/project-graph/project-graph'; -import { - readCachedProjectGraph, - workspaceRoot, - Workspaces, -} from '@nrwl/devkit'; +import { readCachedProjectGraph, workspaceRoot, Workspaces } from '@nx/devkit'; import { getDynamicRemotes, getStaticRemotes, diff --git a/packages/angular/src/builders/utilities/buildable-libs.ts b/packages/angular/src/builders/utilities/buildable-libs.ts index 6f6e6354684ff5..76dea8f624adf2 100644 --- a/packages/angular/src/builders/utilities/buildable-libs.ts +++ b/packages/angular/src/builders/utilities/buildable-libs.ts @@ -2,8 +2,8 @@ import { calculateProjectDependencies, createTmpTsConfig, DependentBuildableProjectNode, -} from '@nrwl/js/src/utils/buildable-libs-utils'; -import { ProjectGraph, readCachedProjectGraph } from '@nrwl/devkit'; +} from '@nx/js/src/utils/buildable-libs-utils'; +import { ProjectGraph, readCachedProjectGraph } from '@nx/devkit'; import { join } from 'path'; export function createTmpTsConfigForBuildableLibs( diff --git a/packages/angular/src/builders/utilities/module-federation.ts b/packages/angular/src/builders/utilities/module-federation.ts index 857edb10778759..75cd990a14fc63 100644 --- a/packages/angular/src/builders/utilities/module-federation.ts +++ b/packages/angular/src/builders/utilities/module-federation.ts @@ -1,7 +1,7 @@ import { ProjectConfiguration } from 'nx/src/config/workspace-json-project-json'; import { join } from 'path'; import { existsSync, readFileSync } from 'fs'; -import { Remotes } from '@nrwl/devkit'; +import { Remotes } from '@nx/devkit'; export function getDynamicRemotes( project: ProjectConfiguration, diff --git a/packages/angular/src/builders/webpack-browser/validate-options.ts b/packages/angular/src/builders/webpack-browser/validate-options.ts index 659d8ca002cb69..797f27b446af02 100644 --- a/packages/angular/src/builders/webpack-browser/validate-options.ts +++ b/packages/angular/src/builders/webpack-browser/validate-options.ts @@ -1,4 +1,4 @@ -import { stripIndents } from '@nrwl/devkit'; +import { stripIndents } from '@nx/devkit'; import { extname } from 'path'; import type { VersionInfo } from '../../executors/utilities/angular-version-utils'; import { getInstalledAngularVersionInfo } from '../../executors/utilities/angular-version-utils'; diff --git a/packages/angular/src/builders/webpack-browser/webpack-browser.impl.ts b/packages/angular/src/builders/webpack-browser/webpack-browser.impl.ts index 4803d0026ca7a0..b036c4d7eeba15 100644 --- a/packages/angular/src/builders/webpack-browser/webpack-browser.impl.ts +++ b/packages/angular/src/builders/webpack-browser/webpack-browser.impl.ts @@ -2,9 +2,9 @@ import { joinPathFragments, ProjectGraph, readCachedProjectGraph, -} from '@nrwl/devkit'; -import type { DependentBuildableProjectNode } from '@nrwl/js/src/utils/buildable-libs-utils'; -import { WebpackNxBuildCoordinationPlugin } from '@nrwl/webpack/src/plugins/webpack-nx-build-coordination-plugin'; +} from '@nx/devkit'; +import type { DependentBuildableProjectNode } from '@nx/js/src/utils/buildable-libs-utils'; +import { WebpackNxBuildCoordinationPlugin } from '@nx/webpack/src/plugins/webpack-nx-build-coordination-plugin'; import { existsSync } from 'fs'; import { readNxJson } from 'nx/src/project-graph/file-utils'; import { isNpmProject } from 'nx/src/project-graph/operators'; diff --git a/packages/angular/src/builders/webpack-dev-server/webpack-dev-server.impl.ts b/packages/angular/src/builders/webpack-dev-server/webpack-dev-server.impl.ts index 60554c9131dafe..3c283289da65c9 100644 --- a/packages/angular/src/builders/webpack-dev-server/webpack-dev-server.impl.ts +++ b/packages/angular/src/builders/webpack-dev-server/webpack-dev-server.impl.ts @@ -2,9 +2,9 @@ import { joinPathFragments, parseTargetString, readCachedProjectGraph, -} from '@nrwl/devkit'; -import { WebpackNxBuildCoordinationPlugin } from '@nrwl/webpack/src/plugins/webpack-nx-build-coordination-plugin'; -import { DependentBuildableProjectNode } from '@nrwl/js/src/utils/buildable-libs-utils'; +} from '@nx/devkit'; +import { WebpackNxBuildCoordinationPlugin } from '@nx/webpack/src/plugins/webpack-nx-build-coordination-plugin'; +import { DependentBuildableProjectNode } from '@nx/js/src/utils/buildable-libs-utils'; import { readCachedProjectConfiguration } from 'nx/src/project-graph/project-graph'; import { existsSync } from 'fs'; import { isNpmProject } from 'nx/src/project-graph/operators'; diff --git a/packages/angular/src/builders/webpack-server/validate-options.ts b/packages/angular/src/builders/webpack-server/validate-options.ts index 6ee851e92791dd..c36b60559162f9 100644 --- a/packages/angular/src/builders/webpack-server/validate-options.ts +++ b/packages/angular/src/builders/webpack-server/validate-options.ts @@ -1,4 +1,4 @@ -import { stripIndents } from '@nrwl/devkit'; +import { stripIndents } from '@nx/devkit'; import { lt } from 'semver'; import type { VersionInfo } from '../../executors/utilities/angular-version-utils'; import { getInstalledAngularVersionInfo } from '../../executors/utilities/angular-version-utils'; diff --git a/packages/angular/src/builders/webpack-server/webpack-server.impl.ts b/packages/angular/src/builders/webpack-server/webpack-server.impl.ts index 3330bc8d235f00..273e21ecbcea49 100644 --- a/packages/angular/src/builders/webpack-server/webpack-server.impl.ts +++ b/packages/angular/src/builders/webpack-server/webpack-server.impl.ts @@ -1,4 +1,4 @@ -import { joinPathFragments } from '@nrwl/devkit'; +import { joinPathFragments } from '@nx/devkit'; import { existsSync } from 'fs'; import { Observable, from } from 'rxjs'; import { switchMap } from 'rxjs/operators'; diff --git a/packages/angular/src/executors/delegate-build/compat.ts b/packages/angular/src/executors/delegate-build/compat.ts index 7e6c066075c285..910a004384dbdf 100644 --- a/packages/angular/src/executors/delegate-build/compat.ts +++ b/packages/angular/src/executors/delegate-build/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import { delegateBuildExecutor } from './delegate-build.impl'; diff --git a/packages/angular/src/executors/delegate-build/delegate-build.impl.spec.ts b/packages/angular/src/executors/delegate-build/delegate-build.impl.spec.ts index 92e6e3c057294d..d5826ba5e09128 100644 --- a/packages/angular/src/executors/delegate-build/delegate-build.impl.spec.ts +++ b/packages/angular/src/executors/delegate-build/delegate-build.impl.spec.ts @@ -1,6 +1,6 @@ -jest.mock('@nrwl/devkit'); -jest.mock('@nrwl/devkit'); -jest.mock('@nrwl/js/src/utils/buildable-libs-utils'); +jest.mock('@nx/devkit'); +jest.mock('@nx/devkit'); +jest.mock('@nx/js/src/utils/buildable-libs-utils'); // nested code imports graph from the repo, which might have innacurate graph version jest.mock('nx/src/project-graph/project-graph', () => ({ ...jest.requireActual('nx/src/project-graph/project-graph'), @@ -9,9 +9,9 @@ jest.mock('nx/src/project-graph/project-graph', () => ({ .mockImplementation(async () => ({ nodes: {}, dependencies: {} })), })); -import type { ExecutorContext, Target } from '@nrwl/devkit'; -import * as devkit from '@nrwl/devkit'; -import * as buildableLibsUtils from '@nrwl/js/src/utils/buildable-libs-utils'; +import type { ExecutorContext, Target } from '@nx/devkit'; +import * as devkit from '@nx/devkit'; +import * as buildableLibsUtils from '@nx/js/src/utils/buildable-libs-utils'; import delegateBuildExecutor from './delegate-build.impl'; import type { DelegateBuildExecutorSchema } from './schema'; @@ -32,7 +32,7 @@ describe('DelegateBuild executor', () => { () => '/my-app/tsconfig.app.generated.json' ); (devkit.parseTargetString as jest.Mock).mockImplementation( - jest.requireActual('@nrwl/devkit').parseTargetString + jest.requireActual('@nx/devkit').parseTargetString ); context = { diff --git a/packages/angular/src/executors/delegate-build/delegate-build.impl.ts b/packages/angular/src/executors/delegate-build/delegate-build.impl.ts index 9753034e8a7f36..d877e3a40a8e35 100644 --- a/packages/angular/src/executors/delegate-build/delegate-build.impl.ts +++ b/packages/angular/src/executors/delegate-build/delegate-build.impl.ts @@ -1,14 +1,10 @@ -import type { ExecutorContext } from '@nrwl/devkit'; -import { - joinPathFragments, - parseTargetString, - runExecutor, -} from '@nrwl/devkit'; +import type { ExecutorContext } from '@nx/devkit'; +import { joinPathFragments, parseTargetString, runExecutor } from '@nx/devkit'; import { calculateProjectDependencies, checkDependentProjectsHaveBeenBuilt, createTmpTsConfig, -} from '@nrwl/js/src/utils/buildable-libs-utils'; +} from '@nx/js/src/utils/buildable-libs-utils'; import type { DelegateBuildExecutorSchema } from './schema'; export async function* delegateBuildExecutor( diff --git a/packages/angular/src/executors/ng-packagr-lite/compat.ts b/packages/angular/src/executors/ng-packagr-lite/compat.ts index e88113f3945178..9602cbe987eca5 100644 --- a/packages/angular/src/executors/ng-packagr-lite/compat.ts +++ b/packages/angular/src/executors/ng-packagr-lite/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import { ngPackagrLiteExecutor } from './ng-packagr-lite.impl'; diff --git a/packages/angular/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/entry-point.transform.ts b/packages/angular/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/entry-point.transform.ts index a4957f13417aa4..7da87f5b1c1ae1 100644 --- a/packages/angular/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/entry-point.transform.ts +++ b/packages/angular/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/entry-point.transform.ts @@ -5,7 +5,7 @@ * - Removed writing bundles as we don't generate them for incremental builds. */ -import { logger } from '@nrwl/devkit'; +import { logger } from '@nx/devkit'; import { STATE_DONE } from 'ng-packagr/lib/graph/node'; import { isInProgress } from 'ng-packagr/lib/graph/select'; import type { Transform } from 'ng-packagr/lib/graph/transform'; diff --git a/packages/angular/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/write-package.transform.ts b/packages/angular/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/write-package.transform.ts index ec84b685bbce75..fca95da503d24e 100644 --- a/packages/angular/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/write-package.transform.ts +++ b/packages/angular/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/write-package.transform.ts @@ -6,7 +6,7 @@ * - Remove package exports. */ -import { logger } from '@nrwl/devkit'; +import { logger } from '@nx/devkit'; import { BuildGraph } from 'ng-packagr/lib/graph/build-graph'; import { Node } from 'ng-packagr/lib/graph/node'; import { transformFromPromise } from 'ng-packagr/lib/graph/transform'; diff --git a/packages/angular/src/executors/ng-packagr-lite/ng-packagr-lite.impl.spec.ts b/packages/angular/src/executors/ng-packagr-lite/ng-packagr-lite.impl.spec.ts index 7ab7162b6019c5..e2aa55244b1ec0 100644 --- a/packages/angular/src/executors/ng-packagr-lite/ng-packagr-lite.impl.spec.ts +++ b/packages/angular/src/executors/ng-packagr-lite/ng-packagr-lite.impl.spec.ts @@ -1,11 +1,11 @@ -jest.mock('@nrwl/devkit'); -jest.mock('@nrwl/js/src/utils/buildable-libs-utils'); +jest.mock('@nx/devkit'); +jest.mock('@nx/js/src/utils/buildable-libs-utils'); jest.mock('ng-packagr'); jest.mock('ng-packagr/lib/utils/ng-compiler-cli'); jest.mock('./ng-packagr-adjustments/ng-package/options.di'); -import type { ExecutorContext } from '@nrwl/devkit'; -import * as buildableLibsUtils from '@nrwl/js/src/utils/buildable-libs-utils'; +import type { ExecutorContext } from '@nx/devkit'; +import * as buildableLibsUtils from '@nx/js/src/utils/buildable-libs-utils'; import * as ngPackagr from 'ng-packagr'; import { ngCompilerCli } from 'ng-packagr/lib/utils/ng-compiler-cli'; import { BehaviorSubject } from 'rxjs'; diff --git a/packages/angular/src/executors/ng-packagr-lite/ng-packagr-lite.impl.ts b/packages/angular/src/executors/ng-packagr-lite/ng-packagr-lite.impl.ts index a53ea567b482bc..645edb1dc42919 100644 --- a/packages/angular/src/executors/ng-packagr-lite/ng-packagr-lite.impl.ts +++ b/packages/angular/src/executors/ng-packagr-lite/ng-packagr-lite.impl.ts @@ -1,8 +1,8 @@ -import type { ExecutorContext } from '@nrwl/devkit'; +import type { ExecutorContext } from '@nx/devkit'; import { createTmpTsConfig, DependentBuildableProjectNode, -} from '@nrwl/js/src/utils/buildable-libs-utils'; +} from '@nx/js/src/utils/buildable-libs-utils'; import { NgPackagr } from 'ng-packagr'; import { resolve } from 'path'; import { createLibraryExecutor } from '../package/package.impl'; diff --git a/packages/angular/src/executors/package/compat.ts b/packages/angular/src/executors/package/compat.ts index 50966de81d508e..26939a7823c757 100644 --- a/packages/angular/src/executors/package/compat.ts +++ b/packages/angular/src/executors/package/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import { packageExecutor } from './package.impl'; diff --git a/packages/angular/src/executors/package/package.impl.spec.ts b/packages/angular/src/executors/package/package.impl.spec.ts index dfe9d972dba95b..b55dc29cf99819 100644 --- a/packages/angular/src/executors/package/package.impl.spec.ts +++ b/packages/angular/src/executors/package/package.impl.spec.ts @@ -1,11 +1,11 @@ -jest.mock('@nrwl/devkit'); -jest.mock('@nrwl/js/src/utils/buildable-libs-utils'); +jest.mock('@nx/devkit'); +jest.mock('@nx/js/src/utils/buildable-libs-utils'); jest.mock('ng-packagr'); jest.mock('ng-packagr/lib/utils/ng-compiler-cli'); jest.mock('./ng-packagr-adjustments/ng-package/options.di'); -import type { ExecutorContext } from '@nrwl/devkit'; -import * as buildableLibsUtils from '@nrwl/js/src/utils/buildable-libs-utils'; +import type { ExecutorContext } from '@nx/devkit'; +import * as buildableLibsUtils from '@nx/js/src/utils/buildable-libs-utils'; import * as ngPackagr from 'ng-packagr'; import { ngCompilerCli } from 'ng-packagr/lib/utils/ng-compiler-cli'; import { BehaviorSubject } from 'rxjs'; diff --git a/packages/angular/src/executors/package/package.impl.ts b/packages/angular/src/executors/package/package.impl.ts index 88588e010d8056..04f2f18d70c50e 100644 --- a/packages/angular/src/executors/package/package.impl.ts +++ b/packages/angular/src/executors/package/package.impl.ts @@ -1,12 +1,12 @@ -import type { ExecutorContext } from '@nrwl/devkit'; -import { eachValueFrom } from '@nrwl/devkit/src/utils/rxjs-for-await'; +import type { ExecutorContext } from '@nx/devkit'; +import { eachValueFrom } from '@nx/devkit/src/utils/rxjs-for-await'; import { calculateProjectDependencies, checkDependentProjectsHaveBeenBuilt, createTmpTsConfig, DependentBuildableProjectNode, updateBuildableProjectPackageJsonDependencies, -} from '@nrwl/js/src/utils/buildable-libs-utils'; +} from '@nx/js/src/utils/buildable-libs-utils'; import type { NgPackagr } from 'ng-packagr'; import { resolve } from 'path'; import { from } from 'rxjs'; diff --git a/packages/angular/src/executors/utilities/tailwindcss.ts b/packages/angular/src/executors/utilities/tailwindcss.ts index 1216326df6da8c..a9917a37364e6a 100644 --- a/packages/angular/src/executors/utilities/tailwindcss.ts +++ b/packages/angular/src/executors/utilities/tailwindcss.ts @@ -1,5 +1,5 @@ -import { logger } from '@nrwl/devkit'; -import { workspaceRoot } from '@nrwl/devkit'; +import { logger } from '@nx/devkit'; +import { workspaceRoot } from '@nx/devkit'; import { existsSync } from 'fs'; import { join, relative } from 'path'; import * as postcssImport from 'postcss-import'; diff --git a/packages/angular/src/generators/add-linting/add-linting.spec.ts b/packages/angular/src/generators/add-linting/add-linting.spec.ts index f0659d8fc30ee1..811f2f8920d2cb 100644 --- a/packages/angular/src/generators/add-linting/add-linting.spec.ts +++ b/packages/angular/src/generators/add-linting/add-linting.spec.ts @@ -1,12 +1,12 @@ -import type { ProjectConfiguration, Tree } from '@nrwl/devkit'; +import type { ProjectConfiguration, Tree } from '@nx/devkit'; import { addProjectConfiguration, readJson, readProjectConfiguration, updateJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import * as linter from '@nrwl/linter'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import * as linter from '@nx/linter'; import { addLintingGenerator } from './add-linting'; describe('addLinting generator', () => { diff --git a/packages/angular/src/generators/add-linting/add-linting.ts b/packages/angular/src/generators/add-linting/add-linting.ts index 505131af72a366..c6509bfe4a35c1 100755 --- a/packages/angular/src/generators/add-linting/add-linting.ts +++ b/packages/angular/src/generators/add-linting/add-linting.ts @@ -5,9 +5,9 @@ import { runTasksInSerial, Tree, updateJson, -} from '@nrwl/devkit'; -import { Linter, lintProjectGenerator } from '@nrwl/linter'; -import { mapLintPattern } from '@nrwl/linter/src/generators/lint-project/lint-project'; +} from '@nx/devkit'; +import { Linter, lintProjectGenerator } from '@nx/linter'; +import { mapLintPattern } from '@nx/linter/src/generators/lint-project/lint-project'; import { addAngularEsLintDependencies } from './lib/add-angular-eslint-dependencies'; import { extendAngularEslintJson } from './lib/create-eslint-configuration'; import type { AddLintingGeneratorSchema } from './schema'; diff --git a/packages/angular/src/generators/add-linting/compat.ts b/packages/angular/src/generators/add-linting/compat.ts index ec253ec5411405..73002df46214d4 100644 --- a/packages/angular/src/generators/add-linting/compat.ts +++ b/packages/angular/src/generators/add-linting/compat.ts @@ -1,4 +1,4 @@ -import { convertNxGenerator } from '@nrwl/devkit'; +import { convertNxGenerator } from '@nx/devkit'; import { warnForSchematicUsage } from '../utils/warn-for-schematic-usage'; import { addLintingGenerator } from './add-linting'; diff --git a/packages/angular/src/generators/add-linting/lib/add-angular-eslint-dependencies.ts b/packages/angular/src/generators/add-linting/lib/add-angular-eslint-dependencies.ts index a2cc132d3ca3d4..b365b767c6166b 100644 --- a/packages/angular/src/generators/add-linting/lib/add-angular-eslint-dependencies.ts +++ b/packages/angular/src/generators/add-linting/lib/add-angular-eslint-dependencies.ts @@ -1,5 +1,5 @@ -import type { GeneratorCallback, Tree } from '@nrwl/devkit'; -import { addDependenciesToPackageJson } from '@nrwl/devkit'; +import type { GeneratorCallback, Tree } from '@nx/devkit'; +import { addDependenciesToPackageJson } from '@nx/devkit'; import { versions } from '../../utils/version-utils'; export function addAngularEsLintDependencies(tree: Tree): GeneratorCallback { diff --git a/packages/angular/src/generators/add-linting/lib/create-eslint-configuration.ts b/packages/angular/src/generators/add-linting/lib/create-eslint-configuration.ts index 786a2f3efe73d3..cf8864bebfd80c 100644 --- a/packages/angular/src/generators/add-linting/lib/create-eslint-configuration.ts +++ b/packages/angular/src/generators/add-linting/lib/create-eslint-configuration.ts @@ -1,8 +1,8 @@ -import type { Tree } from '@nrwl/devkit'; -import { joinPathFragments, offsetFromRoot, writeJson } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { joinPathFragments, offsetFromRoot, writeJson } from '@nx/devkit'; import type { Linter } from 'eslint'; import type { AddLintingGeneratorSchema } from '../schema'; -import { camelize, dasherize } from '@nrwl/devkit/src/utils/string-utils'; +import { camelize, dasherize } from '@nx/devkit/src/utils/string-utils'; type EslintExtensionSchema = { prefix: string; diff --git a/packages/angular/src/generators/application/application.compat.ts b/packages/angular/src/generators/application/application.compat.ts index 9c7c57629f70e7..90809af8c37a3d 100644 --- a/packages/angular/src/generators/application/application.compat.ts +++ b/packages/angular/src/generators/application/application.compat.ts @@ -1,4 +1,4 @@ -import { convertNxGenerator } from '@nrwl/devkit'; +import { convertNxGenerator } from '@nx/devkit'; import { warnForSchematicUsage } from '../utils/warn-for-schematic-usage'; import application from './application'; diff --git a/packages/angular/src/generators/application/application.spec.ts b/packages/angular/src/generators/application/application.spec.ts index b50813f7f86ec1..c0cc23e9d45a70 100644 --- a/packages/angular/src/generators/application/application.spec.ts +++ b/packages/angular/src/generators/application/application.spec.ts @@ -1,6 +1,6 @@ -import { installedCypressVersion } from '@nrwl/cypress/src/utils/cypress-version'; -import type { Tree } from '@nrwl/devkit'; -import * as devkit from '@nrwl/devkit'; +import { installedCypressVersion } from '@nx/cypress/src/utils/cypress-version'; +import type { Tree } from '@nx/devkit'; +import * as devkit from '@nx/devkit'; import { NxJsonConfiguration, parseJson, @@ -9,9 +9,9 @@ import { readProjectConfiguration, stripIndents, updateJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { Linter } from '@nrwl/linter'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { Linter } from '@nx/linter'; import * as enquirer from 'enquirer'; import { E2eTestRunner, UnitTestRunner } from '../../utils/test-runners'; import { @@ -24,7 +24,7 @@ import type { Schema } from './schema'; // need to mock cypress otherwise it'll use the nx installed version from package.json // which is v9 while we are testing for the new v10 version -jest.mock('@nrwl/cypress/src/utils/cypress-version'); +jest.mock('@nx/cypress/src/utils/cypress-version'); jest.mock('enquirer'); describe('app', () => { diff --git a/packages/angular/src/generators/application/application.ts b/packages/angular/src/generators/application/application.ts index 3c6d50e139f83c..bc13869a9bd00d 100644 --- a/packages/angular/src/generators/application/application.ts +++ b/packages/angular/src/generators/application/application.ts @@ -7,7 +7,7 @@ import { stripIndents, Tree, updateNxJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { angularInitGenerator } from '../init/init'; import { setupTailwindGenerator } from '../setup-tailwind/setup-tailwind'; import { getInstalledAngularVersionInfo } from '../utils/version-utils'; diff --git a/packages/angular/src/generators/application/lib/add-e2e.ts b/packages/angular/src/generators/application/lib/add-e2e.ts index a092e5c83ebd26..6f979405b6be35 100644 --- a/packages/angular/src/generators/application/lib/add-e2e.ts +++ b/packages/angular/src/generators/application/lib/add-e2e.ts @@ -1,10 +1,10 @@ -import { cypressProjectGenerator } from '@nrwl/cypress'; -import type { Tree } from '@nrwl/devkit'; +import { cypressProjectGenerator } from '@nx/cypress'; +import type { Tree } from '@nx/devkit'; import { addDependenciesToPackageJson, readProjectConfiguration, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { nxVersion } from '../../../utils/versions'; import type { NormalizedSchema } from './normalized-schema'; import { removeScaffoldedE2e } from './remove-scaffolded-e2e'; diff --git a/packages/angular/src/generators/application/lib/add-linting.ts b/packages/angular/src/generators/application/lib/add-linting.ts index e396870730dc96..f1ff025624e861 100644 --- a/packages/angular/src/generators/application/lib/add-linting.ts +++ b/packages/angular/src/generators/application/lib/add-linting.ts @@ -1,7 +1,7 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import type { NormalizedSchema } from './normalized-schema'; -import { Linter } from '@nrwl/linter'; +import { Linter } from '@nx/linter'; import addLintingGenerator from '../../add-linting/add-linting'; export async function addLinting(host: Tree, options: NormalizedSchema) { diff --git a/packages/angular/src/generators/application/lib/add-proxy-config.ts b/packages/angular/src/generators/application/lib/add-proxy-config.ts index 221f952c042f27..c75b785c642060 100644 --- a/packages/angular/src/generators/application/lib/add-proxy-config.ts +++ b/packages/angular/src/generators/application/lib/add-proxy-config.ts @@ -1,11 +1,11 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import type { NormalizedSchema } from './normalized-schema'; import { readProjectConfiguration, updateProjectConfiguration, updateJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; export function addProxyConfig(host: Tree, options: NormalizedSchema) { const projectConfig = readProjectConfiguration(host, options.name); diff --git a/packages/angular/src/generators/application/lib/add-unit-test-runner.ts b/packages/angular/src/generators/application/lib/add-unit-test-runner.ts index 7f58bce23f39c9..17f782cd04fc8f 100644 --- a/packages/angular/src/generators/application/lib/add-unit-test-runner.ts +++ b/packages/angular/src/generators/application/lib/add-unit-test-runner.ts @@ -1,7 +1,7 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import type { NormalizedSchema } from './normalized-schema'; -import { jestProjectGenerator } from '@nrwl/jest'; +import { jestProjectGenerator } from '@nx/jest'; import { UnitTestRunner } from '../../../utils/test-runners'; diff --git a/packages/angular/src/generators/application/lib/create-files.ts b/packages/angular/src/generators/application/lib/create-files.ts index 375f60f8db3265..88c4601dadc011 100644 --- a/packages/angular/src/generators/application/lib/create-files.ts +++ b/packages/angular/src/generators/application/lib/create-files.ts @@ -1,10 +1,7 @@ -import type { Tree } from '@nrwl/devkit'; -import { generateFiles, joinPathFragments } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { generateFiles, joinPathFragments } from '@nx/devkit'; import type { NormalizedSchema } from './normalized-schema'; -import { - getRelativePathToRootTsConfig, - getRootTsConfigFileName, -} from '@nrwl/js'; +import { getRelativePathToRootTsConfig, getRootTsConfigFileName } from '@nx/js'; import { createTsConfig } from '../../utils/create-ts-config'; import { UnitTestRunner } from '../../../utils/test-runners'; import { getInstalledAngularVersionInfo } from '../../utils/version-utils'; diff --git a/packages/angular/src/generators/application/lib/create-project.ts b/packages/angular/src/generators/application/lib/create-project.ts index 36db9fac1fd758..c5734cdea91ca8 100644 --- a/packages/angular/src/generators/application/lib/create-project.ts +++ b/packages/angular/src/generators/application/lib/create-project.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { addProjectConfiguration } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { addProjectConfiguration } from '@nx/devkit'; import type { AngularProjectConfiguration } from '../../../utils/types'; import { getInstalledAngularVersionInfo } from '../../utils/version-utils'; import type { NormalizedSchema } from './normalized-schema'; diff --git a/packages/angular/src/generators/application/lib/enable-strict-type-checking.ts b/packages/angular/src/generators/application/lib/enable-strict-type-checking.ts index 0e4e5d2f0c8608..7ee14da0190626 100644 --- a/packages/angular/src/generators/application/lib/enable-strict-type-checking.ts +++ b/packages/angular/src/generators/application/lib/enable-strict-type-checking.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { updateJson } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { updateJson } from '@nx/devkit'; import type { NormalizedSchema } from './normalized-schema'; export function enableStrictTypeChecking( diff --git a/packages/angular/src/generators/application/lib/normalize-options.ts b/packages/angular/src/generators/application/lib/normalize-options.ts index 9dff9fab54d6d3..48726a12e384c8 100644 --- a/packages/angular/src/generators/application/lib/normalize-options.ts +++ b/packages/angular/src/generators/application/lib/normalize-options.ts @@ -4,11 +4,11 @@ import { joinPathFragments, names, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import type { Schema } from '../schema'; import type { NormalizedSchema } from './normalized-schema'; import { E2eTestRunner, UnitTestRunner } from '../../../utils/test-runners'; -import { Linter } from '@nrwl/linter'; +import { Linter } from '@nx/linter'; import { normalizeDirectory, normalizePrefix, diff --git a/packages/angular/src/generators/application/lib/normalized-schema.ts b/packages/angular/src/generators/application/lib/normalized-schema.ts index 2a6fb1ed6bf462..67aa9fc0c576d9 100644 --- a/packages/angular/src/generators/application/lib/normalized-schema.ts +++ b/packages/angular/src/generators/application/lib/normalized-schema.ts @@ -1,6 +1,6 @@ import { E2eTestRunner, UnitTestRunner } from '../../../utils/test-runners'; import type { Schema } from '../schema'; -import { Linter } from '@nrwl/linter'; +import { Linter } from '@nx/linter'; export interface NormalizedSchema extends Schema { linter: Linter; diff --git a/packages/angular/src/generators/application/lib/remove-scaffolded-e2e.ts b/packages/angular/src/generators/application/lib/remove-scaffolded-e2e.ts index 0dacc06817b6c1..6f3ca07e258c3a 100644 --- a/packages/angular/src/generators/application/lib/remove-scaffolded-e2e.ts +++ b/packages/angular/src/generators/application/lib/remove-scaffolded-e2e.ts @@ -1,10 +1,10 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import type { NormalizedSchema } from './normalized-schema'; import { updateProjectConfiguration, readProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; export function removeScaffoldedE2e( host: Tree, diff --git a/packages/angular/src/generators/application/lib/set-app-strict-default.ts b/packages/angular/src/generators/application/lib/set-app-strict-default.ts index f08efc78afc0d9..5199426c206b38 100644 --- a/packages/angular/src/generators/application/lib/set-app-strict-default.ts +++ b/packages/angular/src/generators/application/lib/set-app-strict-default.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { readNxJson, updateNxJson } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { readNxJson, updateNxJson } from '@nx/devkit'; export function setApplicationStrictDefault(host: Tree, strict: boolean) { const nxJson = readNxJson(host); diff --git a/packages/angular/src/generators/application/lib/update-e2e-project.ts b/packages/angular/src/generators/application/lib/update-e2e-project.ts index 5586c81ac1bc40..747f690c289633 100644 --- a/packages/angular/src/generators/application/lib/update-e2e-project.ts +++ b/packages/angular/src/generators/application/lib/update-e2e-project.ts @@ -1,12 +1,12 @@ -import type { ProjectConfiguration, Tree } from '@nrwl/devkit'; +import type { ProjectConfiguration, Tree } from '@nx/devkit'; import { addProjectConfiguration, offsetFromRoot, readProjectConfiguration, updateJson, updateProjectConfiguration, -} from '@nrwl/devkit'; -import { getRelativePathToRootTsConfig } from '@nrwl/js'; +} from '@nx/devkit'; +import { getRelativePathToRootTsConfig } from '@nx/js'; import type { NormalizedSchema } from './normalized-schema'; export function updateE2eProject(tree: Tree, options: NormalizedSchema) { diff --git a/packages/angular/src/generators/application/lib/update-editor-tsconfig.ts b/packages/angular/src/generators/application/lib/update-editor-tsconfig.ts index a7e94d33df29c1..f20585a9fa35e5 100644 --- a/packages/angular/src/generators/application/lib/update-editor-tsconfig.ts +++ b/packages/angular/src/generators/application/lib/update-editor-tsconfig.ts @@ -1,7 +1,7 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import type { NormalizedSchema } from './normalized-schema'; -import { joinPathFragments, readJson, updateJson } from '@nrwl/devkit'; +import { joinPathFragments, readJson, updateJson } from '@nx/devkit'; interface TsConfig { compilerOptions: { types: string[] }; diff --git a/packages/angular/src/generators/application/schema.d.ts b/packages/angular/src/generators/application/schema.d.ts index c60a3c085f892b..66f76195741a4d 100644 --- a/packages/angular/src/generators/application/schema.d.ts +++ b/packages/angular/src/generators/application/schema.d.ts @@ -1,4 +1,4 @@ -import { Linter } from '@nrwl/linter'; +import { Linter } from '@nx/linter'; import { E2eTestRunner, UnitTestRunner } from '../../utils/test-runners'; import type { Styles } from '../utils/types'; diff --git a/packages/angular/src/generators/component-cypress-spec/compat.ts b/packages/angular/src/generators/component-cypress-spec/compat.ts index 8600d16d5b59a0..336397f5deb481 100644 --- a/packages/angular/src/generators/component-cypress-spec/compat.ts +++ b/packages/angular/src/generators/component-cypress-spec/compat.ts @@ -1,4 +1,4 @@ -import { convertNxGenerator } from '@nrwl/devkit'; +import { convertNxGenerator } from '@nx/devkit'; import { warnForSchematicUsage } from '../utils/warn-for-schematic-usage'; import { componentCypressSpecGenerator } from './component-cypress-spec'; diff --git a/packages/angular/src/generators/component-cypress-spec/component-cypress-spec.spec.ts b/packages/angular/src/generators/component-cypress-spec/component-cypress-spec.spec.ts index 361acb7138a9a3..e8164351e41944 100644 --- a/packages/angular/src/generators/component-cypress-spec/component-cypress-spec.spec.ts +++ b/packages/angular/src/generators/component-cypress-spec/component-cypress-spec.spec.ts @@ -1,7 +1,7 @@ -import { installedCypressVersion } from '@nrwl/cypress/src/utils/cypress-version'; -import type { Tree } from '@nrwl/devkit'; -import * as devkit from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { installedCypressVersion } from '@nx/cypress/src/utils/cypress-version'; +import type { Tree } from '@nx/devkit'; +import * as devkit from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { componentGenerator } from '../component/component'; import * as storybookUtils from '../utils/storybook-ast/storybook-inputs'; import { generateTestApplication } from '../utils/testing'; @@ -9,7 +9,7 @@ import { componentCypressSpecGenerator } from './component-cypress-spec'; // need to mock cypress otherwise it'll use the nx installed version from package.json // which is v9 while we are testing for the new v10 version -jest.mock('@nrwl/cypress/src/utils/cypress-version'); +jest.mock('@nx/cypress/src/utils/cypress-version'); describe('componentCypressSpec generator', () => { let tree: Tree; diff --git a/packages/angular/src/generators/component-cypress-spec/component-cypress-spec.ts b/packages/angular/src/generators/component-cypress-spec/component-cypress-spec.ts index 0a5ad44c97d4f6..23c5f108c4b1a8 100644 --- a/packages/angular/src/generators/component-cypress-spec/component-cypress-spec.ts +++ b/packages/angular/src/generators/component-cypress-spec/component-cypress-spec.ts @@ -1,10 +1,10 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { formatFiles, generateFiles, joinPathFragments, readProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { getComponentProps } from '../utils/storybook-ast/storybook-inputs'; import { getArgsDefaultValue } from './lib/get-args-default-value'; import { getComponentSelector } from './lib/get-component-selector'; diff --git a/packages/angular/src/generators/component-cypress-spec/lib/get-args-default-value.ts b/packages/angular/src/generators/component-cypress-spec/lib/get-args-default-value.ts index d8763d998b984a..952724e7f1b829 100644 --- a/packages/angular/src/generators/component-cypress-spec/lib/get-args-default-value.ts +++ b/packages/angular/src/generators/component-cypress-spec/lib/get-args-default-value.ts @@ -1,4 +1,4 @@ -import { ensureTypescript } from '@nrwl/js/src/utils/typescript/ensure-typescript'; +import { ensureTypescript } from '@nx/js/src/utils/typescript/ensure-typescript'; import type { PropertyDeclaration } from 'typescript'; let tsModule: typeof import('typescript'); diff --git a/packages/angular/src/generators/component-cypress-spec/lib/get-component-selector.ts b/packages/angular/src/generators/component-cypress-spec/lib/get-component-selector.ts index ab3aacdbae95f2..da557bbd240be8 100644 --- a/packages/angular/src/generators/component-cypress-spec/lib/get-component-selector.ts +++ b/packages/angular/src/generators/component-cypress-spec/lib/get-component-selector.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { ensureTypescript } from '@nrwl/js/src/utils/typescript/ensure-typescript'; +import type { Tree } from '@nx/devkit'; +import { ensureTypescript } from '@nx/js/src/utils/typescript/ensure-typescript'; import { findNodes } from 'nx/src/utils/typescript'; import type { PropertyAssignment } from 'typescript'; diff --git a/packages/angular/src/generators/component-story/compat.ts b/packages/angular/src/generators/component-story/compat.ts index ec8b2ef9cd8aaa..fed22609bd3e8a 100644 --- a/packages/angular/src/generators/component-story/compat.ts +++ b/packages/angular/src/generators/component-story/compat.ts @@ -1,4 +1,4 @@ -import { convertNxGenerator } from '@nrwl/devkit'; +import { convertNxGenerator } from '@nx/devkit'; import { warnForSchematicUsage } from '../utils/warn-for-schematic-usage'; import { componentStoryGenerator } from './component-story'; diff --git a/packages/angular/src/generators/component-story/component-story.spec.ts b/packages/angular/src/generators/component-story/component-story.spec.ts index 1f496165e1f069..ef4e2e975f5a7a 100644 --- a/packages/angular/src/generators/component-story/component-story.spec.ts +++ b/packages/angular/src/generators/component-story/component-story.spec.ts @@ -1,6 +1,6 @@ -import type { Tree } from '@nrwl/devkit'; -import * as devkit from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import type { Tree } from '@nx/devkit'; +import * as devkit from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { componentGenerator } from '../component/component'; import * as storybookUtils from '../utils/storybook-ast/storybook-inputs'; import { generateTestLibrary } from '../utils/testing'; diff --git a/packages/angular/src/generators/component-story/component-story.ts b/packages/angular/src/generators/component-story/component-story.ts index 989f662e99b311..f087b78a37948a 100644 --- a/packages/angular/src/generators/component-story/component-story.ts +++ b/packages/angular/src/generators/component-story/component-story.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { formatFiles, generateFiles, joinPathFragments } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { formatFiles, generateFiles, joinPathFragments } from '@nx/devkit'; import { getComponentProps } from '../utils/storybook-ast/storybook-inputs'; import type { ComponentStoryGeneratorOptions } from './schema'; diff --git a/packages/angular/src/generators/component-test/compat.ts b/packages/angular/src/generators/component-test/compat.ts index fb99057e383408..fdcda1d20e345f 100644 --- a/packages/angular/src/generators/component-test/compat.ts +++ b/packages/angular/src/generators/component-test/compat.ts @@ -1,4 +1,4 @@ -import { convertNxGenerator } from '@nrwl/devkit'; +import { convertNxGenerator } from '@nx/devkit'; import { warnForSchematicUsage } from '../utils/warn-for-schematic-usage'; import { componentTestGenerator } from './component-test'; diff --git a/packages/angular/src/generators/component-test/component-test.spec.ts b/packages/angular/src/generators/component-test/component-test.spec.ts index 84442d09c70197..c33f8626d80791 100644 --- a/packages/angular/src/generators/component-test/component-test.spec.ts +++ b/packages/angular/src/generators/component-test/component-test.spec.ts @@ -1,13 +1,13 @@ -import { assertMinimumCypressVersion } from '@nrwl/cypress/src/utils/cypress-version'; -import { Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { Linter } from '@nrwl/linter'; +import { assertMinimumCypressVersion } from '@nx/cypress/src/utils/cypress-version'; +import { Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { Linter } from '@nx/linter'; import { UnitTestRunner } from '../../utils/test-runners'; import { componentGenerator } from '../component/component'; import { generateTestLibrary } from '../utils/testing'; import { componentTestGenerator } from './component-test'; -jest.mock('@nrwl/cypress/src/utils/cypress-version'); +jest.mock('@nx/cypress/src/utils/cypress-version'); describe('Angular Cypress Component Test Generator', () => { let tree: Tree; diff --git a/packages/angular/src/generators/component-test/component-test.ts b/packages/angular/src/generators/component-test/component-test.ts index e9aed3aa776a12..dfda4a3673120e 100644 --- a/packages/angular/src/generators/component-test/component-test.ts +++ b/packages/angular/src/generators/component-test/component-test.ts @@ -1,10 +1,10 @@ -import { assertMinimumCypressVersion } from '@nrwl/cypress/src/utils/cypress-version'; +import { assertMinimumCypressVersion } from '@nx/cypress/src/utils/cypress-version'; import { generateFiles, joinPathFragments, readProjectConfiguration, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { getArgsDefaultValue, getComponentProps, diff --git a/packages/angular/src/generators/component/component.compat.ts b/packages/angular/src/generators/component/component.compat.ts index aed6eb3be419c0..ec0a114263163b 100644 --- a/packages/angular/src/generators/component/component.compat.ts +++ b/packages/angular/src/generators/component/component.compat.ts @@ -1,4 +1,4 @@ -import { convertNxGenerator } from '@nrwl/devkit'; +import { convertNxGenerator } from '@nx/devkit'; import { warnForSchematicUsage } from '../utils/warn-for-schematic-usage'; import { componentGenerator } from './component'; diff --git a/packages/angular/src/generators/component/component.spec.ts b/packages/angular/src/generators/component/component.spec.ts index 0213dd5b248e87..09ec5bc1e42319 100644 --- a/packages/angular/src/generators/component/component.spec.ts +++ b/packages/angular/src/generators/component/component.spec.ts @@ -3,8 +3,8 @@ import { stripIndents, updateJson, writeJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { componentGenerator } from './component'; describe('component Generator', () => { diff --git a/packages/angular/src/generators/component/component.ts b/packages/angular/src/generators/component/component.ts index e46fd892d2b196..07db7fbec5f35d 100644 --- a/packages/angular/src/generators/component/component.ts +++ b/packages/angular/src/generators/component/component.ts @@ -1,10 +1,10 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { formatFiles, generateFiles, joinPathFragments, names, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { addToNgModule } from '../utils'; import { exportComponentInEntryPoint, diff --git a/packages/angular/src/generators/component/lib/component.ts b/packages/angular/src/generators/component/lib/component.ts index 70623930a78158..1981ddfda17b4b 100644 --- a/packages/angular/src/generators/component/lib/component.ts +++ b/packages/angular/src/generators/component/lib/component.ts @@ -1,6 +1,6 @@ -import type { Tree } from '@nrwl/devkit'; -import { logger, readProjectConfiguration, stripIndents } from '@nrwl/devkit'; -import { ensureTypescript } from '@nrwl/js/src/utils/typescript/ensure-typescript'; +import type { Tree } from '@nx/devkit'; +import { logger, readProjectConfiguration, stripIndents } from '@nx/devkit'; +import { ensureTypescript } from '@nx/js/src/utils/typescript/ensure-typescript'; import type { StringLiteral } from 'typescript'; import { locateLibraryEntryPointFromDirectory } from '../../utils/entry-point'; import { getRelativeImportToFile } from '../../utils/path'; diff --git a/packages/angular/src/generators/component/lib/module.ts b/packages/angular/src/generators/component/lib/module.ts index 63eca6af7f4f99..97164560f71e45 100644 --- a/packages/angular/src/generators/component/lib/module.ts +++ b/packages/angular/src/generators/component/lib/module.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { joinPathFragments, normalizePath } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { joinPathFragments, normalizePath } from '@nx/devkit'; import { basename, dirname } from 'path'; import type { NormalizedSchema } from '../schema'; diff --git a/packages/angular/src/generators/component/lib/normalize-options.ts b/packages/angular/src/generators/component/lib/normalize-options.ts index b46391db2b5cfa..1e11940ba705ef 100644 --- a/packages/angular/src/generators/component/lib/normalize-options.ts +++ b/packages/angular/src/generators/component/lib/normalize-options.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { readProjectConfiguration } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { readProjectConfiguration } from '@nx/devkit'; import type { AngularProjectConfiguration } from '../../../utils/types'; import { normalizeNameAndPaths } from '../../utils/path'; import { buildSelector } from '../../utils/selector'; diff --git a/packages/angular/src/generators/component/lib/validate-options.ts b/packages/angular/src/generators/component/lib/validate-options.ts index 55cfe46bfa69ce..4b5ed70f133fc0 100644 --- a/packages/angular/src/generators/component/lib/validate-options.ts +++ b/packages/angular/src/generators/component/lib/validate-options.ts @@ -1,4 +1,4 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { checkPathUnderProjectRoot } from '../../utils/path'; import { validateProject, diff --git a/packages/angular/src/generators/convert-to-with-mf/convert-to-with-mf.compat.ts b/packages/angular/src/generators/convert-to-with-mf/convert-to-with-mf.compat.ts index e544ee4920a5d5..4148cde7d08839 100644 --- a/packages/angular/src/generators/convert-to-with-mf/convert-to-with-mf.compat.ts +++ b/packages/angular/src/generators/convert-to-with-mf/convert-to-with-mf.compat.ts @@ -1,4 +1,4 @@ -import { convertNxGenerator } from '@nrwl/devkit'; +import { convertNxGenerator } from '@nx/devkit'; import { warnForSchematicUsage } from '../utils/warn-for-schematic-usage'; import convertToWithMF from './convert-to-with-mf'; diff --git a/packages/angular/src/generators/convert-to-with-mf/convert-to-with-mf.spec.ts b/packages/angular/src/generators/convert-to-with-mf/convert-to-with-mf.spec.ts index 449bd76020f116..d731e6a75dcb52 100644 --- a/packages/angular/src/generators/convert-to-with-mf/convert-to-with-mf.spec.ts +++ b/packages/angular/src/generators/convert-to-with-mf/convert-to-with-mf.spec.ts @@ -1,5 +1,5 @@ -import { addProjectConfiguration } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { addProjectConfiguration } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { STANDARD_HOST_MFE_CONFIG, STANDARD_REMOTE_MFE_CONFIG, diff --git a/packages/angular/src/generators/convert-to-with-mf/convert-to-with-mf.ts b/packages/angular/src/generators/convert-to-with-mf/convert-to-with-mf.ts index 8b416cb33a953b..0ace3ca0a309de 100644 --- a/packages/angular/src/generators/convert-to-with-mf/convert-to-with-mf.ts +++ b/packages/angular/src/generators/convert-to-with-mf/convert-to-with-mf.ts @@ -4,7 +4,7 @@ import { logger, readProjectConfiguration, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import type { Schema } from './schema'; import { getMFProjects } from '../../utils/get-mf-projects'; import { diff --git a/packages/angular/src/generators/convert-to-with-mf/lib/check-name-matches.ts b/packages/angular/src/generators/convert-to-with-mf/lib/check-name-matches.ts index 4d048109cd168c..23ac2d01f4d385 100644 --- a/packages/angular/src/generators/convert-to-with-mf/lib/check-name-matches.ts +++ b/packages/angular/src/generators/convert-to-with-mf/lib/check-name-matches.ts @@ -1,5 +1,5 @@ import type { SourceFile } from 'typescript'; -import { ensureTypescript } from '@nrwl/js/src/utils/typescript/ensure-typescript'; +import { ensureTypescript } from '@nx/js/src/utils/typescript/ensure-typescript'; export function checkOutputNameMatchesProjectName( ast: SourceFile, diff --git a/packages/angular/src/generators/convert-to-with-mf/lib/check-shared-npm-packages.ts b/packages/angular/src/generators/convert-to-with-mf/lib/check-shared-npm-packages.ts index 865f7067d2adba..78e28288a4e06a 100644 --- a/packages/angular/src/generators/convert-to-with-mf/lib/check-shared-npm-packages.ts +++ b/packages/angular/src/generators/convert-to-with-mf/lib/check-shared-npm-packages.ts @@ -1,5 +1,5 @@ import type { SourceFile, Node } from 'typescript'; -import { ensureTypescript } from '@nrwl/js/src/utils/typescript/ensure-typescript'; +import { ensureTypescript } from '@nx/js/src/utils/typescript/ensure-typescript'; export function checkSharedNpmPackagesMatchExpected(ast: SourceFile) { ensureTypescript(); diff --git a/packages/angular/src/generators/convert-to-with-mf/lib/get-webpack-config-path.ts b/packages/angular/src/generators/convert-to-with-mf/lib/get-webpack-config-path.ts index 2fccee3f1a0bec..c236c0b5f84e06 100644 --- a/packages/angular/src/generators/convert-to-with-mf/lib/get-webpack-config-path.ts +++ b/packages/angular/src/generators/convert-to-with-mf/lib/get-webpack-config-path.ts @@ -1,4 +1,4 @@ -import type { ProjectConfiguration } from '@nrwl/devkit'; +import type { ProjectConfiguration } from '@nx/devkit'; export function getWebpackConfigPath( project: ProjectConfiguration, diff --git a/packages/angular/src/generators/convert-to-with-mf/lib/is-host-remote-config.ts b/packages/angular/src/generators/convert-to-with-mf/lib/is-host-remote-config.ts index 109db6d85168ab..a4bb7793bfea78 100644 --- a/packages/angular/src/generators/convert-to-with-mf/lib/is-host-remote-config.ts +++ b/packages/angular/src/generators/convert-to-with-mf/lib/is-host-remote-config.ts @@ -1,5 +1,5 @@ import type { SourceFile } from 'typescript'; -import { ensureTypescript } from '@nrwl/js/src/utils/typescript/ensure-typescript'; +import { ensureTypescript } from '@nx/js/src/utils/typescript/ensure-typescript'; export type IsHostRemoteConfigResult = 'host' | 'remote' | 'both' | false; diff --git a/packages/angular/src/generators/convert-to-with-mf/lib/parse-ast-webpack-config.ts b/packages/angular/src/generators/convert-to-with-mf/lib/parse-ast-webpack-config.ts index 300fc444e6ab72..34fb5e8b8abd71 100644 --- a/packages/angular/src/generators/convert-to-with-mf/lib/parse-ast-webpack-config.ts +++ b/packages/angular/src/generators/convert-to-with-mf/lib/parse-ast-webpack-config.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { ensureTypescript } from '@nrwl/js/src/utils/typescript/ensure-typescript'; +import type { Tree } from '@nx/devkit'; +import { ensureTypescript } from '@nx/js/src/utils/typescript/ensure-typescript'; export function parseASTOfWebpackConfig( tree: Tree, diff --git a/packages/angular/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.spec.ts b/packages/angular/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.spec.ts index e433516b0def87..5d9a367d4591d7 100644 --- a/packages/angular/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.spec.ts +++ b/packages/angular/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.spec.ts @@ -6,9 +6,9 @@ import { readProjectConfiguration, Tree, writeJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { exampleRootTslintJson } from '@nrwl/linter'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { exampleRootTslintJson } from '@nx/linter'; import { conversionGenerator } from './convert-tslint-to-eslint'; /** diff --git a/packages/angular/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.ts b/packages/angular/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.ts index 76c729fd1631ae..42afb423450001 100755 --- a/packages/angular/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.ts +++ b/packages/angular/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.ts @@ -1,12 +1,12 @@ -import { conversionGenerator as cypressConversionGenerator } from '@nrwl/cypress'; +import { conversionGenerator as cypressConversionGenerator } from '@nx/cypress'; import { convertNxGenerator, formatFiles, GeneratorCallback, logger, Tree, -} from '@nrwl/devkit'; -import { ConvertTSLintToESLintSchema, ProjectConverter } from '@nrwl/linter'; +} from '@nx/devkit'; +import { ConvertTSLintToESLintSchema, ProjectConverter } from '@nx/linter'; import type { Linter } from 'eslint'; import type { AngularProjectConfiguration } from '../../utils/types'; import { addLintingGenerator } from '../add-linting/add-linting'; diff --git a/packages/angular/src/generators/cypress-component-configuration/compat.ts b/packages/angular/src/generators/cypress-component-configuration/compat.ts index 7e76a1967b7ce9..bf69a3cb55e230 100644 --- a/packages/angular/src/generators/cypress-component-configuration/compat.ts +++ b/packages/angular/src/generators/cypress-component-configuration/compat.ts @@ -1,4 +1,4 @@ -import { convertNxGenerator } from '@nrwl/devkit'; +import { convertNxGenerator } from '@nx/devkit'; import { warnForSchematicUsage } from '../utils/warn-for-schematic-usage'; import { cypressComponentConfiguration } from './cypress-component-configuration'; diff --git a/packages/angular/src/generators/cypress-component-configuration/cypress-component-configuration.spec.ts b/packages/angular/src/generators/cypress-component-configuration/cypress-component-configuration.spec.ts index bc7677ca053054..6b35a05bc7d22f 100644 --- a/packages/angular/src/generators/cypress-component-configuration/cypress-component-configuration.spec.ts +++ b/packages/angular/src/generators/cypress-component-configuration/cypress-component-configuration.spec.ts @@ -1,4 +1,4 @@ -import { installedCypressVersion } from '@nrwl/cypress/src/utils/cypress-version'; +import { installedCypressVersion } from '@nx/cypress/src/utils/cypress-version'; import { DependencyType, joinPathFragments, @@ -6,17 +6,17 @@ import { readProjectConfiguration, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { componentGenerator } from '../component/component'; import { librarySecondaryEntryPointGenerator } from '../library-secondary-entry-point/library-secondary-entry-point'; import { generateTestApplication, generateTestLibrary } from '../utils/testing'; import { cypressComponentConfiguration } from './cypress-component-configuration'; let projectGraph: ProjectGraph; -jest.mock('@nrwl/cypress/src/utils/cypress-version'); -jest.mock('@nrwl/devkit', () => ({ - ...jest.requireActual('@nrwl/devkit'), +jest.mock('@nx/cypress/src/utils/cypress-version'); +jest.mock('@nx/devkit', () => ({ + ...jest.requireActual('@nx/devkit'), createProjectGraphAsync: jest .fn() .mockImplementation(async () => projectGraph), diff --git a/packages/angular/src/generators/cypress-component-configuration/cypress-component-configuration.ts b/packages/angular/src/generators/cypress-component-configuration/cypress-component-configuration.ts index 1b2e7270a34710..632e3f27407b9e 100644 --- a/packages/angular/src/generators/cypress-component-configuration/cypress-component-configuration.ts +++ b/packages/angular/src/generators/cypress-component-configuration/cypress-component-configuration.ts @@ -1,5 +1,5 @@ -import { cypressComponentProject } from '@nrwl/cypress'; -import { findBuildConfig } from '@nrwl/cypress/src/utils/find-target-options'; +import { cypressComponentProject } from '@nx/cypress'; +import { findBuildConfig } from '@nx/cypress/src/utils/find-target-options'; import { formatFiles, generateFiles, @@ -8,7 +8,7 @@ import { readProjectConfiguration, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { relative } from 'path'; import { componentTestGenerator } from '../component-test/component-test'; import { diff --git a/packages/angular/src/generators/directive/directive.spec.ts b/packages/angular/src/generators/directive/directive.spec.ts index 767528d92924be..b6717d28c38c59 100644 --- a/packages/angular/src/generators/directive/directive.spec.ts +++ b/packages/angular/src/generators/directive/directive.spec.ts @@ -1,5 +1,5 @@ -import { addProjectConfiguration, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { addProjectConfiguration, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { directiveGenerator } from './directive'; import type { Schema } from './schema'; diff --git a/packages/angular/src/generators/directive/directive.ts b/packages/angular/src/generators/directive/directive.ts index 1082fa76bdcb1a..09a50dcda56760 100644 --- a/packages/angular/src/generators/directive/directive.ts +++ b/packages/angular/src/generators/directive/directive.ts @@ -1,10 +1,10 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { formatFiles, generateFiles, joinPathFragments, names, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { addToNgModule, findModule } from '../utils'; import { normalizeOptions, validateOptions } from './lib'; import type { Schema } from './schema'; diff --git a/packages/angular/src/generators/directive/lib/normalize-options.ts b/packages/angular/src/generators/directive/lib/normalize-options.ts index fd85ec5b222e59..165049dcd4ef7c 100644 --- a/packages/angular/src/generators/directive/lib/normalize-options.ts +++ b/packages/angular/src/generators/directive/lib/normalize-options.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { readProjectConfiguration } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { readProjectConfiguration } from '@nx/devkit'; import type { AngularProjectConfiguration } from '../../../utils/types'; import { normalizeNameAndPaths } from '../../utils/path'; import { buildSelector } from '../../utils/selector'; diff --git a/packages/angular/src/generators/directive/lib/validate-options.ts b/packages/angular/src/generators/directive/lib/validate-options.ts index 55cfe46bfa69ce..4b5ed70f133fc0 100644 --- a/packages/angular/src/generators/directive/lib/validate-options.ts +++ b/packages/angular/src/generators/directive/lib/validate-options.ts @@ -1,4 +1,4 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { checkPathUnderProjectRoot } from '../../utils/path'; import { validateProject, diff --git a/packages/angular/src/generators/host/host.compat.ts b/packages/angular/src/generators/host/host.compat.ts index b976df1330fb27..80b6456539d956 100644 --- a/packages/angular/src/generators/host/host.compat.ts +++ b/packages/angular/src/generators/host/host.compat.ts @@ -1,4 +1,4 @@ -import { convertNxGenerator } from '@nrwl/devkit'; +import { convertNxGenerator } from '@nx/devkit'; import { warnForSchematicUsage } from '../utils/warn-for-schematic-usage'; import host from './host'; diff --git a/packages/angular/src/generators/host/host.spec.ts b/packages/angular/src/generators/host/host.spec.ts index e5f83d8c4c178e..a413b994ae6d81 100644 --- a/packages/angular/src/generators/host/host.spec.ts +++ b/packages/angular/src/generators/host/host.spec.ts @@ -1,5 +1,5 @@ -import { stripIndents, updateJson } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { stripIndents, updateJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { getProjects, readProjectConfiguration, diff --git a/packages/angular/src/generators/host/host.ts b/packages/angular/src/generators/host/host.ts index 56eed89b0e7f75..b6315aa63e64f2 100644 --- a/packages/angular/src/generators/host/host.ts +++ b/packages/angular/src/generators/host/host.ts @@ -5,7 +5,7 @@ import { runTasksInSerial, stripIndents, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import type { Schema } from './schema'; import applicationGenerator from '../application/application'; import remoteGenerator from '../remote/remote'; diff --git a/packages/angular/src/generators/host/lib/add-ssr.ts b/packages/angular/src/generators/host/lib/add-ssr.ts index 3b38f194637e0d..2738ea958899f7 100644 --- a/packages/angular/src/generators/host/lib/add-ssr.ts +++ b/packages/angular/src/generators/host/lib/add-ssr.ts @@ -1,11 +1,11 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { addDependenciesToPackageJson, generateFiles, joinPathFragments, readProjectConfiguration, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import type { Schema } from '../schema'; import setupSsr from '../../setup-ssr/setup-ssr'; diff --git a/packages/angular/src/generators/host/schema.d.ts b/packages/angular/src/generators/host/schema.d.ts index 613e97fef17cd5..b5148633847fd2 100644 --- a/packages/angular/src/generators/host/schema.d.ts +++ b/packages/angular/src/generators/host/schema.d.ts @@ -1,4 +1,4 @@ -import { Linter } from '@nrwl/linter'; +import { Linter } from '@nx/linter'; import { E2eTestRunner, UnitTestRunner } from '../../utils/test-runners'; import type { Styles } from '../utils/types'; diff --git a/packages/angular/src/generators/init/init.compat.ts b/packages/angular/src/generators/init/init.compat.ts index 2796b24e1f31bd..fc18cd0dacc07c 100644 --- a/packages/angular/src/generators/init/init.compat.ts +++ b/packages/angular/src/generators/init/init.compat.ts @@ -1,4 +1,4 @@ -import { convertNxGenerator } from '@nrwl/devkit'; +import { convertNxGenerator } from '@nx/devkit'; import { warnForSchematicUsage } from '../utils/warn-for-schematic-usage'; import { angularInitGenerator } from './init'; diff --git a/packages/angular/src/generators/init/init.spec.ts b/packages/angular/src/generators/init/init.spec.ts index 62bbbf3fc8d2e6..b164f2d04f3270 100644 --- a/packages/angular/src/generators/init/init.spec.ts +++ b/packages/angular/src/generators/init/init.spec.ts @@ -1,5 +1,5 @@ -jest.mock('@nrwl/devkit', () => ({ - ...jest.requireActual('@nrwl/devkit'), +jest.mock('@nx/devkit', () => ({ + ...jest.requireActual('@nx/devkit'), // need to mock so it doesn't resolve what the workspace has installed // and be able to test with different versions ensurePackage: jest.fn(), @@ -11,9 +11,9 @@ import { Tree, updateJson, updateNxJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { Linter } from '@nrwl/linter'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { Linter } from '@nx/linter'; import { backwardCompatibleVersions } from '../../utils/backward-compatible-versions'; import { E2eTestRunner, UnitTestRunner } from '../../utils/test-runners'; import { angularDevkitVersion, angularVersion } from '../../utils/versions'; diff --git a/packages/angular/src/generators/init/init.ts b/packages/angular/src/generators/init/init.ts index 6aa0b7cfb2be73..7382eceec0a37c 100755 --- a/packages/angular/src/generators/init/init.ts +++ b/packages/angular/src/generators/init/init.ts @@ -1,4 +1,4 @@ -import { cypressInitGenerator } from '@nrwl/cypress'; +import { cypressInitGenerator } from '@nx/cypress'; import { addDependenciesToPackageJson, ensurePackage, @@ -9,10 +9,10 @@ import { runTasksInSerial, Tree, updateNxJson, -} from '@nrwl/devkit'; -import { jestInitGenerator } from '@nrwl/jest'; -import { Linter } from '@nrwl/linter'; -import { initGenerator as jsInitGenerator } from '@nrwl/js'; +} from '@nx/devkit'; +import { jestInitGenerator } from '@nx/jest'; +import { Linter } from '@nx/linter'; +import { initGenerator as jsInitGenerator } from '@nx/js'; import { E2eTestRunner, UnitTestRunner } from '../../utils/test-runners'; import { addDependenciesToPackageJsonIfDontExist, diff --git a/packages/angular/src/generators/init/schema.d.ts b/packages/angular/src/generators/init/schema.d.ts index 171b5d834e1873..3c0cacfbb1cd7d 100644 --- a/packages/angular/src/generators/init/schema.d.ts +++ b/packages/angular/src/generators/init/schema.d.ts @@ -1,4 +1,4 @@ -import { Linter } from '@nrwl/linter'; +import { Linter } from '@nx/linter'; import { E2eTestRunner, UnitTestRunner } from '../../utils/test-runners'; import type { Styles } from '../utils/types'; diff --git a/packages/angular/src/generators/library-secondary-entry-point/compat.ts b/packages/angular/src/generators/library-secondary-entry-point/compat.ts index 7b645dccab51b0..39811b2cef6e73 100644 --- a/packages/angular/src/generators/library-secondary-entry-point/compat.ts +++ b/packages/angular/src/generators/library-secondary-entry-point/compat.ts @@ -1,4 +1,4 @@ -import { convertNxGenerator } from '@nrwl/devkit'; +import { convertNxGenerator } from '@nx/devkit'; import { warnForSchematicUsage } from '../utils/warn-for-schematic-usage'; import { librarySecondaryEntryPointGenerator } from './library-secondary-entry-point'; diff --git a/packages/angular/src/generators/library-secondary-entry-point/lib/add-files.ts b/packages/angular/src/generators/library-secondary-entry-point/lib/add-files.ts index e9909ce8e9a2cb..e5255395099a2f 100644 --- a/packages/angular/src/generators/library-secondary-entry-point/lib/add-files.ts +++ b/packages/angular/src/generators/library-secondary-entry-point/lib/add-files.ts @@ -1,4 +1,4 @@ -import { generateFiles, joinPathFragments, names, Tree } from '@nrwl/devkit'; +import { generateFiles, joinPathFragments, names, Tree } from '@nx/devkit'; import { NormalizedGeneratorOptions } from '../schema'; export function addFiles( diff --git a/packages/angular/src/generators/library-secondary-entry-point/lib/add-path-mapping.ts b/packages/angular/src/generators/library-secondary-entry-point/lib/add-path-mapping.ts index 2f22e47334ed98..b218535e69d53b 100644 --- a/packages/angular/src/generators/library-secondary-entry-point/lib/add-path-mapping.ts +++ b/packages/angular/src/generators/library-secondary-entry-point/lib/add-path-mapping.ts @@ -1,5 +1,5 @@ -import { Tree, updateJson } from '@nrwl/devkit'; -import { getRootTsConfigPathInTree } from '@nrwl/js'; +import { Tree, updateJson } from '@nx/devkit'; +import { getRootTsConfigPathInTree } from '@nx/js'; import { NormalizedGeneratorOptions } from '../schema'; export function addPathMapping( diff --git a/packages/angular/src/generators/library-secondary-entry-point/lib/normalize-options.ts b/packages/angular/src/generators/library-secondary-entry-point/lib/normalize-options.ts index 293fe02e543ada..585b150a4d6c25 100644 --- a/packages/angular/src/generators/library-secondary-entry-point/lib/normalize-options.ts +++ b/packages/angular/src/generators/library-secondary-entry-point/lib/normalize-options.ts @@ -4,7 +4,7 @@ import { names, readJson, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { GeneratorOptions, NormalizedGeneratorOptions } from '../schema'; export function normalizeOptions( diff --git a/packages/angular/src/generators/library-secondary-entry-point/lib/update-linting-file-patterns.ts b/packages/angular/src/generators/library-secondary-entry-point/lib/update-linting-file-patterns.ts index 5dc4be8d0754f2..ca3cee759aa30e 100644 --- a/packages/angular/src/generators/library-secondary-entry-point/lib/update-linting-file-patterns.ts +++ b/packages/angular/src/generators/library-secondary-entry-point/lib/update-linting-file-patterns.ts @@ -1,4 +1,4 @@ -import { Tree, updateProjectConfiguration } from '@nrwl/devkit'; +import { Tree, updateProjectConfiguration } from '@nx/devkit'; import { NormalizedGeneratorOptions } from '../schema'; export function updateLintingFilePatterns( diff --git a/packages/angular/src/generators/library-secondary-entry-point/library-secondary-entry-point.spec.ts b/packages/angular/src/generators/library-secondary-entry-point/library-secondary-entry-point.spec.ts index 35ce5fc24c584c..dc0dcc539822b2 100644 --- a/packages/angular/src/generators/library-secondary-entry-point/library-secondary-entry-point.spec.ts +++ b/packages/angular/src/generators/library-secondary-entry-point/library-secondary-entry-point.spec.ts @@ -1,11 +1,11 @@ -import * as devkit from '@nrwl/devkit'; +import * as devkit from '@nx/devkit'; import { addProjectConfiguration, readJson, readProjectConfiguration, Tree, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { librarySecondaryEntryPointGenerator } from './library-secondary-entry-point'; describe('librarySecondaryEntryPoint generator', () => { diff --git a/packages/angular/src/generators/library-secondary-entry-point/library-secondary-entry-point.ts b/packages/angular/src/generators/library-secondary-entry-point/library-secondary-entry-point.ts index 83640492142c44..63e5dad468e234 100644 --- a/packages/angular/src/generators/library-secondary-entry-point/library-secondary-entry-point.ts +++ b/packages/angular/src/generators/library-secondary-entry-point/library-secondary-entry-point.ts @@ -1,4 +1,4 @@ -import { formatFiles, Tree } from '@nrwl/devkit'; +import { formatFiles, Tree } from '@nx/devkit'; import { addFiles, addPathMapping, diff --git a/packages/angular/src/generators/library-secondary-entry-point/schema.d.ts b/packages/angular/src/generators/library-secondary-entry-point/schema.d.ts index 29ee442c388299..de661c6965c70f 100644 --- a/packages/angular/src/generators/library-secondary-entry-point/schema.d.ts +++ b/packages/angular/src/generators/library-secondary-entry-point/schema.d.ts @@ -1,4 +1,4 @@ -import { ProjectConfiguration } from '@nrwl/devkit'; +import { ProjectConfiguration } from '@nx/devkit'; export interface GeneratorOptions { library: string; diff --git a/packages/angular/src/generators/library/lib/add-children.ts b/packages/angular/src/generators/library/lib/add-children.ts index 26ce29a5ccc39b..cef64d125dc457 100644 --- a/packages/angular/src/generators/library/lib/add-children.ts +++ b/packages/angular/src/generators/library/lib/add-children.ts @@ -1,9 +1,9 @@ -import { names, Tree } from '@nrwl/devkit'; -import { insertImport } from '@nrwl/js'; +import { names, Tree } from '@nx/devkit'; +import { insertImport } from '@nx/js'; import { addImportToModule } from '../../../utils/nx-devkit/ast-utils'; import { NormalizedSchema } from './normalized-schema'; import { addRoute } from '../../../utils/nx-devkit/route-utils'; -import { ensureTypescript } from '@nrwl/js/src/utils/typescript/ensure-typescript'; +import { ensureTypescript } from '@nx/js/src/utils/typescript/ensure-typescript'; let tsModule: typeof import('typescript'); diff --git a/packages/angular/src/generators/library/lib/add-lazy-loaded-router-configuration.ts b/packages/angular/src/generators/library/lib/add-lazy-loaded-router-configuration.ts index 5bbf80b80e791d..c2f99c45cbed25 100644 --- a/packages/angular/src/generators/library/lib/add-lazy-loaded-router-configuration.ts +++ b/packages/angular/src/generators/library/lib/add-lazy-loaded-router-configuration.ts @@ -1,9 +1,9 @@ -import { joinPathFragments, names, Tree } from '@nrwl/devkit'; -import { insertImport } from '@nrwl/js'; +import { joinPathFragments, names, Tree } from '@nx/devkit'; +import { insertImport } from '@nx/js'; import { addImportToModule } from '../../../utils/nx-devkit/ast-utils'; import { NormalizedSchema } from './normalized-schema'; import { dirname } from 'path'; -import { ensureTypescript } from '@nrwl/js/src/utils/typescript/ensure-typescript'; +import { ensureTypescript } from '@nx/js/src/utils/typescript/ensure-typescript'; let tsModule: typeof import('typescript'); diff --git a/packages/angular/src/generators/library/lib/add-load-children.ts b/packages/angular/src/generators/library/lib/add-load-children.ts index b7c8de3caea81d..b34c8dfed28c04 100644 --- a/packages/angular/src/generators/library/lib/add-load-children.ts +++ b/packages/angular/src/generators/library/lib/add-load-children.ts @@ -1,7 +1,7 @@ -import { names, Tree } from '@nrwl/devkit'; +import { names, Tree } from '@nx/devkit'; import { NormalizedSchema } from './normalized-schema'; import { addRoute } from '../../../utils/nx-devkit/route-utils'; -import { ensureTypescript } from '@nrwl/js/src/utils/typescript/ensure-typescript'; +import { ensureTypescript } from '@nx/js/src/utils/typescript/ensure-typescript'; let tsModule: typeof import('typescript'); diff --git a/packages/angular/src/generators/library/lib/add-module.ts b/packages/angular/src/generators/library/lib/add-module.ts index 6bf85f4ee7abd2..30ecfcdc5e58ee 100644 --- a/packages/angular/src/generators/library/lib/add-module.ts +++ b/packages/angular/src/generators/library/lib/add-module.ts @@ -1,4 +1,4 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { addChildren } from './add-children'; import { addLazyLoadedRouterConfiguration } from './add-lazy-loaded-router-configuration'; import { addLoadChildren } from './add-load-children'; diff --git a/packages/angular/src/generators/library/lib/add-project.ts b/packages/angular/src/generators/library/lib/add-project.ts index a3ccbf31d601ea..dc1da88c238ef1 100644 --- a/packages/angular/src/generators/library/lib/add-project.ts +++ b/packages/angular/src/generators/library/lib/add-project.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { addProjectConfiguration, joinPathFragments } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { addProjectConfiguration, joinPathFragments } from '@nx/devkit'; import type { AngularProjectConfiguration } from '../../../utils/types'; import type { NormalizedSchema } from './normalized-schema'; diff --git a/packages/angular/src/generators/library/lib/add-router-configuration.ts b/packages/angular/src/generators/library/lib/add-router-configuration.ts index d8a87dc2a5f9d3..5c712bb2509305 100644 --- a/packages/angular/src/generators/library/lib/add-router-configuration.ts +++ b/packages/angular/src/generators/library/lib/add-router-configuration.ts @@ -1,10 +1,10 @@ -import type { Tree } from '@nrwl/devkit'; -import { joinPathFragments, names } from '@nrwl/devkit'; -import { insertImport } from '@nrwl/js'; +import type { Tree } from '@nx/devkit'; +import { joinPathFragments, names } from '@nx/devkit'; +import { insertImport } from '@nx/js'; import { addImportToModule } from '../../../utils/nx-devkit/ast-utils'; import { NormalizedSchema } from './normalized-schema'; import { dirname } from 'path'; -import { ensureTypescript } from '@nrwl/js/src/utils/typescript/ensure-typescript'; +import { ensureTypescript } from '@nx/js/src/utils/typescript/ensure-typescript'; let tsModule: typeof import('typescript'); diff --git a/packages/angular/src/generators/library/lib/create-files.ts b/packages/angular/src/generators/library/lib/create-files.ts index bfe6bb511fb2e1..d68bbd52e08f4c 100644 --- a/packages/angular/src/generators/library/lib/create-files.ts +++ b/packages/angular/src/generators/library/lib/create-files.ts @@ -1,12 +1,12 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { generateFiles, getWorkspaceLayout, joinPathFragments, names, offsetFromRoot, -} from '@nrwl/devkit'; -import { getRootTsConfigFileName } from '@nrwl/js'; +} from '@nx/devkit'; +import { getRootTsConfigFileName } from '@nx/js'; import { UnitTestRunner } from '../../../utils/test-runners'; import type { AngularProjectConfiguration } from '../../../utils/types'; import type { NormalizedSchema } from './normalized-schema'; diff --git a/packages/angular/src/generators/library/lib/enable-strict-type-checking.ts b/packages/angular/src/generators/library/lib/enable-strict-type-checking.ts index 62d324759148b3..e0428f19c61be9 100644 --- a/packages/angular/src/generators/library/lib/enable-strict-type-checking.ts +++ b/packages/angular/src/generators/library/lib/enable-strict-type-checking.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { readNxJson, updateJson, updateNxJson } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { readNxJson, updateJson, updateNxJson } from '@nx/devkit'; import { NormalizedSchema } from './normalized-schema'; /** diff --git a/packages/angular/src/generators/library/lib/normalize-options.ts b/packages/angular/src/generators/library/lib/normalize-options.ts index 0ae495de2a34bf..4b59d1e8d903e9 100644 --- a/packages/angular/src/generators/library/lib/normalize-options.ts +++ b/packages/angular/src/generators/library/lib/normalize-options.ts @@ -4,11 +4,11 @@ import { joinPathFragments, names, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { getImportPath } from 'nx/src/utils/path'; import { Schema } from '../schema'; import { NormalizedSchema } from './normalized-schema'; -import { Linter } from '@nrwl/linter'; +import { Linter } from '@nx/linter'; import { UnitTestRunner } from '../../../utils/test-runners'; import { normalizePrefix } from '../../utils/project'; diff --git a/packages/angular/src/generators/library/lib/normalized-schema.ts b/packages/angular/src/generators/library/lib/normalized-schema.ts index fcf5af0d1f17bb..80555aa209b3f6 100644 --- a/packages/angular/src/generators/library/lib/normalized-schema.ts +++ b/packages/angular/src/generators/library/lib/normalized-schema.ts @@ -1,5 +1,5 @@ import { UnitTestRunner } from '../../../utils/test-runners'; -import type { Linter } from '@nrwl/linter'; +import type { Linter } from '@nx/linter'; export interface NormalizedSchema { libraryOptions: { diff --git a/packages/angular/src/generators/library/lib/update-lib-package-npm-scope.ts b/packages/angular/src/generators/library/lib/update-lib-package-npm-scope.ts index 71dfd8d505df6c..31d85732ab9b28 100644 --- a/packages/angular/src/generators/library/lib/update-lib-package-npm-scope.ts +++ b/packages/angular/src/generators/library/lib/update-lib-package-npm-scope.ts @@ -1,4 +1,4 @@ -import { Tree, updateJson } from '@nrwl/devkit'; +import { Tree, updateJson } from '@nx/devkit'; import { NormalizedSchema } from './normalized-schema'; export function updateLibPackageNpmScope( diff --git a/packages/angular/src/generators/library/lib/update-tsconfig.ts b/packages/angular/src/generators/library/lib/update-tsconfig.ts index 83ce3fb94048ea..85a5d8c801105b 100644 --- a/packages/angular/src/generators/library/lib/update-tsconfig.ts +++ b/packages/angular/src/generators/library/lib/update-tsconfig.ts @@ -1,6 +1,6 @@ -import type { Tree } from '@nrwl/devkit'; -import { updateJson } from '@nrwl/devkit'; -import { getRelativePathToRootTsConfig } from '@nrwl/js'; +import type { Tree } from '@nx/devkit'; +import { updateJson } from '@nx/devkit'; +import { getRelativePathToRootTsConfig } from '@nx/js'; import { NormalizedSchema } from './normalized-schema'; import { createTsConfig, diff --git a/packages/angular/src/generators/library/library.compat.ts b/packages/angular/src/generators/library/library.compat.ts index be5e842a54815e..984242c8feaee6 100644 --- a/packages/angular/src/generators/library/library.compat.ts +++ b/packages/angular/src/generators/library/library.compat.ts @@ -1,4 +1,4 @@ -import { convertNxGenerator } from '@nrwl/devkit'; +import { convertNxGenerator } from '@nx/devkit'; import { warnForSchematicUsage } from '../utils/warn-for-schematic-usage'; import library from './library'; diff --git a/packages/angular/src/generators/library/library.spec.ts b/packages/angular/src/generators/library/library.spec.ts index 20650e96d83b82..8194ebd831b61c 100644 --- a/packages/angular/src/generators/library/library.spec.ts +++ b/packages/angular/src/generators/library/library.spec.ts @@ -7,9 +7,9 @@ import { readProjectConfiguration, Tree, updateJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { Linter } from '@nrwl/linter'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { Linter } from '@nx/linter'; import { backwardCompatibleVersions } from '../../utils/backward-compatible-versions'; import { createApp } from '../../utils/nx-devkit/testing'; import { UnitTestRunner } from '../../utils/test-runners'; @@ -22,9 +22,9 @@ import { generateTestApplication, generateTestLibrary } from '../utils/testing'; import { Schema } from './schema'; let projectGraph: ProjectGraph; -jest.mock('@nrwl/devkit', () => { +jest.mock('@nx/devkit', () => { return { - ...jest.requireActual('@nrwl/devkit'), + ...jest.requireActual('@nx/devkit'), createProjectGraphAsync: jest.fn().mockImplementation(() => projectGraph), }; }); diff --git a/packages/angular/src/generators/library/library.ts b/packages/angular/src/generators/library/library.ts index 8494d82412c790..e246dd9b21d54c 100644 --- a/packages/angular/src/generators/library/library.ts +++ b/packages/angular/src/generators/library/library.ts @@ -6,10 +6,10 @@ import { joinPathFragments, removeDependenciesFromPackageJson, Tree, -} from '@nrwl/devkit'; -import { jestProjectGenerator } from '@nrwl/jest'; -import { Linter } from '@nrwl/linter'; -import { addTsConfigPath } from '@nrwl/js'; +} from '@nx/devkit'; +import { jestProjectGenerator } from '@nx/jest'; +import { Linter } from '@nx/linter'; +import { addTsConfigPath } from '@nx/js'; import { lt } from 'semver'; import init from '../../generators/init/init'; import { E2eTestRunner } from '../../utils/test-runners'; diff --git a/packages/angular/src/generators/library/schema.d.ts b/packages/angular/src/generators/library/schema.d.ts index 7524a31209a650..99a357c9fce2ab 100644 --- a/packages/angular/src/generators/library/schema.d.ts +++ b/packages/angular/src/generators/library/schema.d.ts @@ -1,5 +1,5 @@ import { UnitTestRunner } from '../../utils/test-runners'; -import { Linter } from '@nrwl/linter'; +import { Linter } from '@nx/linter'; export interface Schema { name: string; diff --git a/packages/angular/src/generators/move/lib/update-module-name.spec.ts b/packages/angular/src/generators/move/lib/update-module-name.spec.ts index f05a7a63a39cd5..8b5f0c977307cd 100644 --- a/packages/angular/src/generators/move/lib/update-module-name.spec.ts +++ b/packages/angular/src/generators/move/lib/update-module-name.spec.ts @@ -1,7 +1,7 @@ -import { Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { Linter } from '@nrwl/linter'; -import { moveGenerator } from '@nrwl/workspace/generators'; +import { Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { Linter } from '@nx/linter'; +import { moveGenerator } from '@nx/workspace/generators'; import { UnitTestRunner } from '../../../utils/test-runners'; import { generateTestLibrary } from '../../utils/testing'; import { Schema } from '../schema'; diff --git a/packages/angular/src/generators/move/lib/update-module-name.ts b/packages/angular/src/generators/move/lib/update-module-name.ts index 2a867f0dcccdca..902b1dc06123a4 100644 --- a/packages/angular/src/generators/move/lib/update-module-name.ts +++ b/packages/angular/src/generators/move/lib/update-module-name.ts @@ -4,7 +4,7 @@ import { readProjectConfiguration, Tree, visitNotIgnoredFiles, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { getNewProjectName } from '../../utils/get-new-project-name'; import { join } from 'path'; import { Schema } from '../schema'; diff --git a/packages/angular/src/generators/move/lib/update-ng-package.ts b/packages/angular/src/generators/move/lib/update-ng-package.ts index e0d86a2317dee7..39223a1edaf987 100644 --- a/packages/angular/src/generators/move/lib/update-ng-package.ts +++ b/packages/angular/src/generators/move/lib/update-ng-package.ts @@ -5,7 +5,7 @@ import { Tree, updateJson, workspaceRoot, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { getNewProjectName } from '../../utils/get-new-project-name'; import { join, relative } from 'path'; import { Schema } from '../schema'; diff --git a/packages/angular/src/generators/move/move.spec.ts b/packages/angular/src/generators/move/move.spec.ts index 6136a081e8b0e6..5a731d6bbac341 100644 --- a/packages/angular/src/generators/move/move.spec.ts +++ b/packages/angular/src/generators/move/move.spec.ts @@ -1,7 +1,7 @@ -import * as devkit from '@nrwl/devkit'; -import { readJson, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { Linter } from '@nrwl/linter'; +import * as devkit from '@nx/devkit'; +import { readJson, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { Linter } from '@nx/linter'; import { UnitTestRunner } from '../../utils/test-runners'; import { generateTestLibrary } from '../utils/testing'; import { angularMoveGenerator } from './move'; diff --git a/packages/angular/src/generators/move/move.ts b/packages/angular/src/generators/move/move.ts index 6f84ee20eb04d6..1184af3ef9c330 100644 --- a/packages/angular/src/generators/move/move.ts +++ b/packages/angular/src/generators/move/move.ts @@ -1,6 +1,6 @@ -import { convertNxGenerator, formatFiles, Tree } from '@nrwl/devkit'; +import { convertNxGenerator, formatFiles, Tree } from '@nx/devkit'; import { warnForSchematicUsage } from '../utils/warn-for-schematic-usage'; -import { moveGenerator } from '@nrwl/workspace/generators'; +import { moveGenerator } from '@nx/workspace/generators'; import { updateModuleName } from './lib/update-module-name'; import { updateNgPackage } from './lib/update-ng-package'; import { Schema } from './schema'; diff --git a/packages/angular/src/generators/ng-add/compat.ts b/packages/angular/src/generators/ng-add/compat.ts index ac2246d833c10b..a6d120fbe36d30 100644 --- a/packages/angular/src/generators/ng-add/compat.ts +++ b/packages/angular/src/generators/ng-add/compat.ts @@ -1,4 +1,4 @@ -import { convertNxGenerator } from '@nrwl/devkit'; +import { convertNxGenerator } from '@nx/devkit'; import { ngAddGenerator } from './ng-add'; export default convertNxGenerator(ngAddGenerator, true); diff --git a/packages/angular/src/generators/ng-add/migrate-from-angular-cli.spec.ts b/packages/angular/src/generators/ng-add/migrate-from-angular-cli.spec.ts index edd50b6d64f703..67bf4cbb04fc8e 100644 --- a/packages/angular/src/generators/ng-add/migrate-from-angular-cli.spec.ts +++ b/packages/angular/src/generators/ng-add/migrate-from-angular-cli.spec.ts @@ -1,11 +1,11 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { readJson, readProjectConfiguration, updateJson, writeJson, -} from '@nrwl/devkit'; -import { createTree } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTree } from '@nx/devkit/testing'; import { migrateFromAngularCli } from './migrate-from-angular-cli'; describe('workspace', () => { diff --git a/packages/angular/src/generators/ng-add/migrate-from-angular-cli.ts b/packages/angular/src/generators/ng-add/migrate-from-angular-cli.ts index 0d04435761b127..376bbbe536c01a 100755 --- a/packages/angular/src/generators/ng-add/migrate-from-angular-cli.ts +++ b/packages/angular/src/generators/ng-add/migrate-from-angular-cli.ts @@ -1,5 +1,5 @@ -import type { GeneratorCallback, Tree } from '@nrwl/devkit'; -import { installPackagesTask, readJson, updateJson } from '@nrwl/devkit'; +import type { GeneratorCallback, Tree } from '@nx/devkit'; +import { installPackagesTask, readJson, updateJson } from '@nx/devkit'; import type { ProjectMigrator } from './migrators'; import { AppMigrator, LibMigrator } from './migrators'; import type { GeneratorOptions } from './schema'; diff --git a/packages/angular/src/generators/ng-add/migrators/builders/angular-devkit-karma.migrator.ts b/packages/angular/src/generators/ng-add/migrators/builders/angular-devkit-karma.migrator.ts index 965787750e46b1..6c6a254bc973b0 100644 --- a/packages/angular/src/generators/ng-add/migrators/builders/angular-devkit-karma.migrator.ts +++ b/packages/angular/src/generators/ng-add/migrators/builders/angular-devkit-karma.migrator.ts @@ -2,13 +2,13 @@ import type { ProjectConfiguration, TargetConfiguration, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { joinPathFragments, offsetFromRoot, updateProjectConfiguration, -} from '@nrwl/devkit'; -import { getRootTsConfigPathInTree } from '@nrwl/js'; +} from '@nx/devkit'; +import { getRootTsConfigPathInTree } from '@nx/js'; import { basename } from 'path'; import type { Logger, ProjectMigrationInfo } from '../../utilities'; import { BuilderMigrator } from './builder.migrator'; diff --git a/packages/angular/src/generators/ng-add/migrators/builders/angular-devkit-ng-packagr.migrator.ts b/packages/angular/src/generators/ng-add/migrators/builders/angular-devkit-ng-packagr.migrator.ts index 20938dc3bfdeef..f0fbfcf821a749 100644 --- a/packages/angular/src/generators/ng-add/migrators/builders/angular-devkit-ng-packagr.migrator.ts +++ b/packages/angular/src/generators/ng-add/migrators/builders/angular-devkit-ng-packagr.migrator.ts @@ -2,14 +2,14 @@ import type { ProjectConfiguration, TargetConfiguration, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { joinPathFragments, offsetFromRoot, updateJson, updateProjectConfiguration, -} from '@nrwl/devkit'; -import { getRootTsConfigPathInTree } from '@nrwl/js'; +} from '@nx/devkit'; +import { getRootTsConfigPathInTree } from '@nx/js'; import { basename } from 'path'; import { addBuildableLibrariesPostCssDependencies } from '../../../utils/dependencies'; import type { Logger, ProjectMigrationInfo } from '../../utilities'; diff --git a/packages/angular/src/generators/ng-add/migrators/builders/angular-eslint-lint.migrator.ts b/packages/angular/src/generators/ng-add/migrators/builders/angular-eslint-lint.migrator.ts index 17a43cec1138c3..610f86626de7d4 100644 --- a/packages/angular/src/generators/ng-add/migrators/builders/angular-eslint-lint.migrator.ts +++ b/packages/angular/src/generators/ng-add/migrators/builders/angular-eslint-lint.migrator.ts @@ -2,15 +2,15 @@ import type { ProjectConfiguration, TargetConfiguration, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { joinPathFragments, offsetFromRoot, readJson, updateJson, updateProjectConfiguration, -} from '@nrwl/devkit'; -import { hasRulesRequiringTypeChecking } from '@nrwl/linter'; +} from '@nx/devkit'; +import { hasRulesRequiringTypeChecking } from '@nx/linter'; import { dirname } from 'path'; import type { Logger, ProjectMigrationInfo } from '../../utilities'; import { BuilderMigrator } from './builder.migrator'; diff --git a/packages/angular/src/generators/ng-add/migrators/builders/builder-migrator-class.type.ts b/packages/angular/src/generators/ng-add/migrators/builders/builder-migrator-class.type.ts index 9db6fcbc38e462..ebf7158d4550a4 100644 --- a/packages/angular/src/generators/ng-add/migrators/builders/builder-migrator-class.type.ts +++ b/packages/angular/src/generators/ng-add/migrators/builders/builder-migrator-class.type.ts @@ -1,4 +1,4 @@ -import type { ProjectConfiguration, Tree } from '@nrwl/devkit'; +import type { ProjectConfiguration, Tree } from '@nx/devkit'; import type { Logger, ProjectMigrationInfo } from '../../utilities'; import type { BuilderMigrator } from './builder.migrator'; diff --git a/packages/angular/src/generators/ng-add/migrators/builders/builder.migrator.ts b/packages/angular/src/generators/ng-add/migrators/builders/builder.migrator.ts index 226c2aefe2fd97..119131c7ff6714 100644 --- a/packages/angular/src/generators/ng-add/migrators/builders/builder.migrator.ts +++ b/packages/angular/src/generators/ng-add/migrators/builders/builder.migrator.ts @@ -2,7 +2,7 @@ import type { ProjectConfiguration, TargetConfiguration, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import type { Logger, ProjectMigrationInfo, diff --git a/packages/angular/src/generators/ng-add/migrators/migrator.ts b/packages/angular/src/generators/ng-add/migrators/migrator.ts index eee0ed202af2fc..d0e52fecbcb3b0 100644 --- a/packages/angular/src/generators/ng-add/migrators/migrator.ts +++ b/packages/angular/src/generators/ng-add/migrators/migrator.ts @@ -2,13 +2,13 @@ import type { ProjectConfiguration, TargetConfiguration, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { joinPathFragments, readNxJson, updateJson, updateNxJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { basename } from 'path'; import type { Logger } from '../utilities/logger'; import type { diff --git a/packages/angular/src/generators/ng-add/migrators/projects/app.migrator.spec.ts b/packages/angular/src/generators/ng-add/migrators/projects/app.migrator.spec.ts index ed8efde22cea36..0cc791ae21c847 100644 --- a/packages/angular/src/generators/ng-add/migrators/projects/app.migrator.spec.ts +++ b/packages/angular/src/generators/ng-add/migrators/projects/app.migrator.spec.ts @@ -2,14 +2,14 @@ import type { ProjectConfiguration, TargetConfiguration, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { readJson, readNxJson, readProjectConfiguration, writeJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import type { MigrationProjectConfiguration } from '../../utilities/types'; import { AppMigrator } from './app.migrator'; diff --git a/packages/angular/src/generators/ng-add/migrators/projects/app.migrator.ts b/packages/angular/src/generators/ng-add/migrators/projects/app.migrator.ts index 63c268825834b6..ceac9a222c41be 100644 --- a/packages/angular/src/generators/ng-add/migrators/projects/app.migrator.ts +++ b/packages/angular/src/generators/ng-add/migrators/projects/app.migrator.ts @@ -1,11 +1,11 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { joinPathFragments, offsetFromRoot, updateJson, updateProjectConfiguration, -} from '@nrwl/devkit'; -import { getRootTsConfigPathInTree } from '@nrwl/js'; +} from '@nx/devkit'; +import { getRootTsConfigPathInTree } from '@nx/js'; import { basename } from 'path'; import type { GeneratorOptions } from '../../schema'; import type { diff --git a/packages/angular/src/generators/ng-add/migrators/projects/e2e.migrator.spec.ts b/packages/angular/src/generators/ng-add/migrators/projects/e2e.migrator.spec.ts index 95a009637cd018..00f1dc016d3f50 100644 --- a/packages/angular/src/generators/ng-add/migrators/projects/e2e.migrator.spec.ts +++ b/packages/angular/src/generators/ng-add/migrators/projects/e2e.migrator.spec.ts @@ -1,5 +1,5 @@ // mock so we can test multiple versions -jest.mock('@nrwl/cypress/src/utils/cypress-version'); +jest.mock('@nx/cypress/src/utils/cypress-version'); // mock bc the nxE2EPreset uses fs for path normalization jest.mock('fs', () => { return { @@ -10,16 +10,16 @@ jest.mock('fs', () => { }; }); -import { installedCypressVersion } from '@nrwl/cypress/src/utils/cypress-version'; -import type { ProjectConfiguration, Tree } from '@nrwl/devkit'; +import { installedCypressVersion } from '@nx/cypress/src/utils/cypress-version'; +import type { ProjectConfiguration, Tree } from '@nx/devkit'; import { joinPathFragments, offsetFromRoot, readJson, readProjectConfiguration, writeJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import type { Logger, MigrationProjectConfiguration } from '../../utilities'; import { E2eMigrator } from './e2e.migrator'; diff --git a/packages/angular/src/generators/ng-add/migrators/projects/e2e.migrator.ts b/packages/angular/src/generators/ng-add/migrators/projects/e2e.migrator.ts index 85ebb3727eda9e..cc1c25499eae6c 100644 --- a/packages/angular/src/generators/ng-add/migrators/projects/e2e.migrator.ts +++ b/packages/angular/src/generators/ng-add/migrators/projects/e2e.migrator.ts @@ -1,11 +1,11 @@ -import { cypressProjectGenerator } from '@nrwl/cypress'; -import { nxE2EPreset } from '@nrwl/cypress/plugins/cypress-preset'; -import { installedCypressVersion } from '@nrwl/cypress/src/utils/cypress-version'; +import { cypressProjectGenerator } from '@nx/cypress'; +import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset'; +import { installedCypressVersion } from '@nx/cypress/src/utils/cypress-version'; import type { ProjectConfiguration, TargetConfiguration, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { addProjectConfiguration, joinPathFragments, @@ -19,9 +19,9 @@ import { updateProjectConfiguration, visitNotIgnoredFiles, writeJson, -} from '@nrwl/devkit'; -import { Linter, lintProjectGenerator } from '@nrwl/linter'; -import { getRootTsConfigPathInTree, insertImport } from '@nrwl/js'; +} from '@nx/devkit'; +import { Linter, lintProjectGenerator } from '@nx/linter'; +import { getRootTsConfigPathInTree, insertImport } from '@nx/js'; import { basename, relative } from 'path'; import type { Node, @@ -44,7 +44,7 @@ import type { } from '../../utilities'; import { FileChangeRecorder } from '../../../../utils/file-change-recorder'; import { ProjectMigrator } from './project.migrator'; -import { ensureTypescript } from '@nrwl/js/src/utils/typescript/ensure-typescript'; +import { ensureTypescript } from '@nx/js/src/utils/typescript/ensure-typescript'; type SupportedTargets = 'e2e'; const supportedTargets: Record = { diff --git a/packages/angular/src/generators/ng-add/migrators/projects/lib.migrator.spec.ts b/packages/angular/src/generators/ng-add/migrators/projects/lib.migrator.spec.ts index aff9234f7d41a1..effd824d78a63a 100644 --- a/packages/angular/src/generators/ng-add/migrators/projects/lib.migrator.spec.ts +++ b/packages/angular/src/generators/ng-add/migrators/projects/lib.migrator.spec.ts @@ -2,14 +2,14 @@ import type { ProjectConfiguration, TargetConfiguration, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { readJson, readNxJson, readProjectConfiguration, writeJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import type { MigrationProjectConfiguration } from '../../utilities'; import { LibMigrator } from './lib.migrator'; diff --git a/packages/angular/src/generators/ng-add/migrators/projects/lib.migrator.ts b/packages/angular/src/generators/ng-add/migrators/projects/lib.migrator.ts index c540e4212ef6c5..7a235536640439 100644 --- a/packages/angular/src/generators/ng-add/migrators/projects/lib.migrator.ts +++ b/packages/angular/src/generators/ng-add/migrators/projects/lib.migrator.ts @@ -1,5 +1,5 @@ -import { joinPathFragments, Tree } from '@nrwl/devkit'; -import { updateProjectConfiguration } from '@nrwl/devkit'; +import { joinPathFragments, Tree } from '@nx/devkit'; +import { updateProjectConfiguration } from '@nx/devkit'; import type { GeneratorOptions } from '../../schema'; import type { Logger, diff --git a/packages/angular/src/generators/ng-add/migrators/projects/project.migrator.ts b/packages/angular/src/generators/ng-add/migrators/projects/project.migrator.ts index 0d217b41371ed1..0b5e074a3cb04f 100644 --- a/packages/angular/src/generators/ng-add/migrators/projects/project.migrator.ts +++ b/packages/angular/src/generators/ng-add/migrators/projects/project.migrator.ts @@ -1,9 +1,9 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { joinPathFragments, normalizePath, visitNotIgnoredFiles, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import type { GeneratorOptions } from '../../schema'; import type { MigrationProjectConfiguration, diff --git a/packages/angular/src/generators/ng-add/ng-add.spec.ts b/packages/angular/src/generators/ng-add/ng-add.spec.ts index 14f05e0e4226df..92861faaba8b30 100644 --- a/packages/angular/src/generators/ng-add/ng-add.spec.ts +++ b/packages/angular/src/generators/ng-add/ng-add.spec.ts @@ -1,8 +1,8 @@ import * as angularCliMigrator from './migrate-from-angular-cli'; import * as initGenerator from '../init/init'; import { ngAddGenerator } from './ng-add'; -import type { Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import type { Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; describe('ngAdd generator', () => { let tree: Tree; diff --git a/packages/angular/src/generators/ng-add/ng-add.ts b/packages/angular/src/generators/ng-add/ng-add.ts index 28ec897998973f..909405a6f03b7c 100644 --- a/packages/angular/src/generators/ng-add/ng-add.ts +++ b/packages/angular/src/generators/ng-add/ng-add.ts @@ -1,4 +1,4 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { angularInitGenerator } from '../init/init'; import { migrateFromAngularCli } from './migrate-from-angular-cli'; import type { GeneratorOptions } from './schema'; diff --git a/packages/angular/src/generators/ng-add/schema.d.ts b/packages/angular/src/generators/ng-add/schema.d.ts index 1d57c3643c4e2f..684c4e72435e26 100644 --- a/packages/angular/src/generators/ng-add/schema.d.ts +++ b/packages/angular/src/generators/ng-add/schema.d.ts @@ -1,4 +1,4 @@ -import { Linter } from '@nrwl/linter'; +import { Linter } from '@nx/linter'; import { E2eTestRunner, UnitTestRunner } from '../../utils/test-runners'; import type { Styles } from '../utils/types'; diff --git a/packages/angular/src/generators/ng-add/utilities/dependencies.ts b/packages/angular/src/generators/ng-add/utilities/dependencies.ts index 341d9b09c9c587..d8c5ccf03b8bd7 100644 --- a/packages/angular/src/generators/ng-add/utilities/dependencies.ts +++ b/packages/angular/src/generators/ng-add/utilities/dependencies.ts @@ -1,4 +1,4 @@ -import { addDependenciesToPackageJson, readJson, Tree } from '@nrwl/devkit'; +import { addDependenciesToPackageJson, readJson, Tree } from '@nx/devkit'; import { getPkgVersionForAngularMajorVersion } from '../../../utils/version-utils'; import { getInstalledAngularMajorVersion } from '../../utils/version-utils'; diff --git a/packages/angular/src/generators/ng-add/utilities/format-files-task.ts b/packages/angular/src/generators/ng-add/utilities/format-files-task.ts index 392ad3a6f345b2..5c9ccf0afd7bfd 100644 --- a/packages/angular/src/generators/ng-add/utilities/format-files-task.ts +++ b/packages/angular/src/generators/ng-add/utilities/format-files-task.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { getPackageManagerCommand } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { getPackageManagerCommand } from '@nx/devkit'; import { runNxSync } from 'nx/src/utils/child-process'; export function formatFilesTask(tree: Tree): void { diff --git a/packages/angular/src/generators/ng-add/utilities/logger.ts b/packages/angular/src/generators/ng-add/utilities/logger.ts index a296d72bb00c28..5952048b1b4c4f 100644 --- a/packages/angular/src/generators/ng-add/utilities/logger.ts +++ b/packages/angular/src/generators/ng-add/utilities/logger.ts @@ -1,4 +1,4 @@ -import { logger } from '@nrwl/devkit'; +import { logger } from '@nx/devkit'; export class Logger { private message = (_: TemplateStringsArray, message: string) => diff --git a/packages/angular/src/generators/ng-add/utilities/normalize-options.ts b/packages/angular/src/generators/ng-add/utilities/normalize-options.ts index 90d3998a4a797b..1781ea603b407b 100644 --- a/packages/angular/src/generators/ng-add/utilities/normalize-options.ts +++ b/packages/angular/src/generators/ng-add/utilities/normalize-options.ts @@ -1,10 +1,10 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { detectWorkspaceScope, joinPathFragments, names, readJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import type { GeneratorOptions } from '../schema'; import type { WorkspaceProjects } from './types'; diff --git a/packages/angular/src/generators/ng-add/utilities/projects.ts b/packages/angular/src/generators/ng-add/utilities/projects.ts index 57ff58e403e8f4..10a3acfca8b98b 100644 --- a/packages/angular/src/generators/ng-add/utilities/projects.ts +++ b/packages/angular/src/generators/ng-add/utilities/projects.ts @@ -4,7 +4,7 @@ import { readJson, Tree, writeJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { toNewFormat } from 'nx/src/adapter/angular-json'; import type { MigrationProjectConfiguration, WorkspaceProjects } from './types'; diff --git a/packages/angular/src/generators/ng-add/utilities/types.ts b/packages/angular/src/generators/ng-add/utilities/types.ts index c5b5aea7c06b28..47be81b18d493f 100644 --- a/packages/angular/src/generators/ng-add/utilities/types.ts +++ b/packages/angular/src/generators/ng-add/utilities/types.ts @@ -1,4 +1,4 @@ -import type { ProjectConfiguration } from '@nrwl/devkit'; +import type { ProjectConfiguration } from '@nx/devkit'; export type MigrationProjectConfiguration = { config: ProjectConfiguration; diff --git a/packages/angular/src/generators/ng-add/utilities/workspace.ts b/packages/angular/src/generators/ng-add/utilities/workspace.ts index e16ead0d80441c..ac63e3375e0d17 100644 --- a/packages/angular/src/generators/ng-add/utilities/workspace.ts +++ b/packages/angular/src/generators/ng-add/utilities/workspace.ts @@ -1,4 +1,4 @@ -import type { NxJsonConfiguration, Tree } from '@nrwl/devkit'; +import type { NxJsonConfiguration, Tree } from '@nx/devkit'; import { generateFiles, getProjects, @@ -8,14 +8,14 @@ import { updateJson, updateNxJson, writeJson, -} from '@nrwl/devkit'; -import { Linter, lintInitGenerator } from '@nrwl/linter'; +} from '@nx/devkit'; +import { Linter, lintInitGenerator } from '@nx/linter'; import { getRootTsConfigPathInTree, initGenerator as jsInitGenerator, -} from '@nrwl/js'; +} from '@nx/js'; import { deduceDefaultBase } from 'nx/src/utils/default-base'; -import { prettierVersion } from '@nrwl/js/src/utils/versions'; +import { prettierVersion } from '@nx/js/src/utils/versions'; import { toNewFormat } from 'nx/src/adapter/angular-json'; import { angularDevkitVersion, nxVersion } from '../../../utils/versions'; import type { ProjectMigrator } from '../migrators'; diff --git a/packages/angular/src/generators/ngrx/compat.ts b/packages/angular/src/generators/ngrx/compat.ts index 9b7d2baed2585b..2b9b2934bbd8e9 100644 --- a/packages/angular/src/generators/ngrx/compat.ts +++ b/packages/angular/src/generators/ngrx/compat.ts @@ -1,4 +1,4 @@ -import { convertNxGenerator } from '@nrwl/devkit'; +import { convertNxGenerator } from '@nx/devkit'; import { warnForSchematicUsage } from '../utils/warn-for-schematic-usage'; import { ngrxGenerator } from './ngrx'; diff --git a/packages/angular/src/generators/ngrx/lib/add-exports-barrel.ts b/packages/angular/src/generators/ngrx/lib/add-exports-barrel.ts index 28aaa7b5b37323..44286c654e003c 100644 --- a/packages/angular/src/generators/ngrx/lib/add-exports-barrel.ts +++ b/packages/angular/src/generators/ngrx/lib/add-exports-barrel.ts @@ -1,7 +1,7 @@ -import type { Tree } from '@nrwl/devkit'; -import { joinPathFragments, names } from '@nrwl/devkit'; -import { ensureTypescript } from '@nrwl/js/src/utils/typescript/ensure-typescript'; -import { addGlobal } from '@nrwl/js'; +import type { Tree } from '@nx/devkit'; +import { joinPathFragments, names } from '@nx/devkit'; +import { ensureTypescript } from '@nx/js/src/utils/typescript/ensure-typescript'; +import { addGlobal } from '@nx/js'; import type { NormalizedNgRxGeneratorOptions } from './normalize-options'; let tsModule: typeof import('typescript'); diff --git a/packages/angular/src/generators/ngrx/lib/add-imports-to-module.ts b/packages/angular/src/generators/ngrx/lib/add-imports-to-module.ts index f355a2b7b50616..95e8bbef3ae1d9 100644 --- a/packages/angular/src/generators/ngrx/lib/add-imports-to-module.ts +++ b/packages/angular/src/generators/ngrx/lib/add-imports-to-module.ts @@ -1,7 +1,7 @@ -import type { Tree } from '@nrwl/devkit'; -import { names } from '@nrwl/devkit'; -import { insertImport } from '@nrwl/js'; -import { ensureTypescript } from '@nrwl/js/src/utils/typescript/ensure-typescript'; +import type { Tree } from '@nx/devkit'; +import { names } from '@nx/devkit'; +import { insertImport } from '@nx/js'; +import { ensureTypescript } from '@nx/js/src/utils/typescript/ensure-typescript'; import type { SourceFile } from 'typescript'; import { addImportToModule, diff --git a/packages/angular/src/generators/ngrx/lib/add-ngrx-to-package-json.ts b/packages/angular/src/generators/ngrx/lib/add-ngrx-to-package-json.ts index 688c5c5b454696..101170337e3f2b 100644 --- a/packages/angular/src/generators/ngrx/lib/add-ngrx-to-package-json.ts +++ b/packages/angular/src/generators/ngrx/lib/add-ngrx-to-package-json.ts @@ -1,5 +1,5 @@ -import type { GeneratorCallback, Tree } from '@nrwl/devkit'; -import { addDependenciesToPackageJson } from '@nrwl/devkit'; +import type { GeneratorCallback, Tree } from '@nx/devkit'; +import { addDependenciesToPackageJson } from '@nx/devkit'; import { gte } from 'semver'; import { versions } from '../../utils/version-utils'; import { NormalizedNgRxGeneratorOptions } from './normalize-options'; diff --git a/packages/angular/src/generators/ngrx/lib/generate-files.ts b/packages/angular/src/generators/ngrx/lib/generate-files.ts index 13d4a07d8174ff..d0e478de02c895 100644 --- a/packages/angular/src/generators/ngrx/lib/generate-files.ts +++ b/packages/angular/src/generators/ngrx/lib/generate-files.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { generateFiles, joinPathFragments, names } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { generateFiles, joinPathFragments, names } from '@nx/devkit'; import { lt } from 'semver'; import { getInstalledAngularVersion } from '../../utils/version-utils'; import { NormalizedNgRxGeneratorOptions } from './normalize-options'; diff --git a/packages/angular/src/generators/ngrx/lib/normalize-options.ts b/packages/angular/src/generators/ngrx/lib/normalize-options.ts index c8aef74a79b606..61218f697df89f 100644 --- a/packages/angular/src/generators/ngrx/lib/normalize-options.ts +++ b/packages/angular/src/generators/ngrx/lib/normalize-options.ts @@ -1,5 +1,5 @@ -import { names, readJson, Tree } from '@nrwl/devkit'; -import { checkAndCleanWithSemver } from '@nrwl/devkit/src/utils/semver'; +import { names, readJson, Tree } from '@nx/devkit'; +import { checkAndCleanWithSemver } from '@nx/devkit/src/utils/semver'; import { dirname } from 'path'; import { rxjsVersion as defaultRxjsVersion } from '../../../utils/versions'; import type { NgRxGeneratorOptions } from '../schema'; diff --git a/packages/angular/src/generators/ngrx/lib/validate-options.ts b/packages/angular/src/generators/ngrx/lib/validate-options.ts index 39906c5fbc970b..5ead456ca43f02 100644 --- a/packages/angular/src/generators/ngrx/lib/validate-options.ts +++ b/packages/angular/src/generators/ngrx/lib/validate-options.ts @@ -1,4 +1,4 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { coerce, lt, major } from 'semver'; import { getInstalledAngularVersionInfo, diff --git a/packages/angular/src/generators/ngrx/ngrx.spec.ts b/packages/angular/src/generators/ngrx/ngrx.spec.ts index cfd69eb1dd8dff..c1d48fed04d268 100644 --- a/packages/angular/src/generators/ngrx/ngrx.spec.ts +++ b/packages/angular/src/generators/ngrx/ngrx.spec.ts @@ -1,6 +1,6 @@ -import type { Tree } from '@nrwl/devkit'; -import * as devkit from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import type { Tree } from '@nx/devkit'; +import * as devkit from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { dirname } from 'path'; import { backwardCompatibleVersions } from '../../utils/backward-compatible-versions'; import { diff --git a/packages/angular/src/generators/ngrx/ngrx.ts b/packages/angular/src/generators/ngrx/ngrx.ts index bab5351040f98f..c2ed961a3f25f7 100644 --- a/packages/angular/src/generators/ngrx/ngrx.ts +++ b/packages/angular/src/generators/ngrx/ngrx.ts @@ -1,5 +1,5 @@ -import type { GeneratorCallback, Tree } from '@nrwl/devkit'; -import { formatFiles } from '@nrwl/devkit'; +import type { GeneratorCallback, Tree } from '@nx/devkit'; +import { formatFiles } from '@nx/devkit'; import { addExportsToBarrel, addImportsToModule, diff --git a/packages/angular/src/generators/pipe/lib/normalize-options.ts b/packages/angular/src/generators/pipe/lib/normalize-options.ts index 5b0010299714fc..f273c799428fc0 100644 --- a/packages/angular/src/generators/pipe/lib/normalize-options.ts +++ b/packages/angular/src/generators/pipe/lib/normalize-options.ts @@ -1,4 +1,4 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { normalizeNameAndPaths } from '../../utils/path'; import type { NormalizedSchema, Schema } from '../schema'; diff --git a/packages/angular/src/generators/pipe/lib/validate-options.ts b/packages/angular/src/generators/pipe/lib/validate-options.ts index 55cfe46bfa69ce..4b5ed70f133fc0 100644 --- a/packages/angular/src/generators/pipe/lib/validate-options.ts +++ b/packages/angular/src/generators/pipe/lib/validate-options.ts @@ -1,4 +1,4 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { checkPathUnderProjectRoot } from '../../utils/path'; import { validateProject, diff --git a/packages/angular/src/generators/pipe/pipe.spec.ts b/packages/angular/src/generators/pipe/pipe.spec.ts index c4be8a7a5d98e3..673fd2ddb90822 100644 --- a/packages/angular/src/generators/pipe/pipe.spec.ts +++ b/packages/angular/src/generators/pipe/pipe.spec.ts @@ -1,5 +1,5 @@ -import { addProjectConfiguration, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { addProjectConfiguration, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { pipeGenerator } from './pipe'; import type { Schema } from './schema'; diff --git a/packages/angular/src/generators/pipe/pipe.ts b/packages/angular/src/generators/pipe/pipe.ts index e229db12c8dc25..a103c5a20dc4d5 100644 --- a/packages/angular/src/generators/pipe/pipe.ts +++ b/packages/angular/src/generators/pipe/pipe.ts @@ -1,10 +1,10 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { formatFiles, generateFiles, joinPathFragments, names, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { addToNgModule, findModule } from '../utils'; import { normalizeOptions, validateOptions } from './lib'; import type { Schema } from './schema'; diff --git a/packages/angular/src/generators/remote/lib/add-ssr.ts b/packages/angular/src/generators/remote/lib/add-ssr.ts index 8a6da2b07eeaf0..680b25ad5befc7 100644 --- a/packages/angular/src/generators/remote/lib/add-ssr.ts +++ b/packages/angular/src/generators/remote/lib/add-ssr.ts @@ -1,11 +1,11 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { addDependenciesToPackageJson, generateFiles, joinPathFragments, readProjectConfiguration, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import setupSsr from '../../setup-ssr/setup-ssr'; import { diff --git a/packages/angular/src/generators/remote/lib/find-next-available-port.ts b/packages/angular/src/generators/remote/lib/find-next-available-port.ts index ebee855f00cbd8..4c532e98f99329 100644 --- a/packages/angular/src/generators/remote/lib/find-next-available-port.ts +++ b/packages/angular/src/generators/remote/lib/find-next-available-port.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { readProjectConfiguration } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { readProjectConfiguration } from '@nx/devkit'; import { getMFProjects } from '../../../utils/get-mf-projects'; export function findNextAvailablePort(tree: Tree) { diff --git a/packages/angular/src/generators/remote/remote.compat.ts b/packages/angular/src/generators/remote/remote.compat.ts index 586cb509857e25..5a898b92119cf4 100644 --- a/packages/angular/src/generators/remote/remote.compat.ts +++ b/packages/angular/src/generators/remote/remote.compat.ts @@ -1,4 +1,4 @@ -import { convertNxGenerator } from '@nrwl/devkit'; +import { convertNxGenerator } from '@nx/devkit'; import { warnForSchematicUsage } from '../utils/warn-for-schematic-usage'; import remote from './remote'; diff --git a/packages/angular/src/generators/remote/remote.spec.ts b/packages/angular/src/generators/remote/remote.spec.ts index c675ef7f457c08..80a159a25e285e 100644 --- a/packages/angular/src/generators/remote/remote.spec.ts +++ b/packages/angular/src/generators/remote/remote.spec.ts @@ -1,12 +1,12 @@ -import { E2eTestRunner } from '@nrwl/angular/src/utils/test-runners'; +import { E2eTestRunner } from '@nx/angular/src/utils/test-runners'; import { getProjects, readNxJson, readProjectConfiguration, stripIndents, updateJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { generateTestHostApplication, generateTestRemoteApplication, diff --git a/packages/angular/src/generators/remote/remote.ts b/packages/angular/src/generators/remote/remote.ts index ef7da862a00911..078ff7380749c5 100644 --- a/packages/angular/src/generators/remote/remote.ts +++ b/packages/angular/src/generators/remote/remote.ts @@ -5,7 +5,7 @@ import { runTasksInSerial, stripIndents, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import type { Schema } from './schema'; import applicationGenerator from '../application/application'; import { normalizeProjectName } from '../utils/project'; diff --git a/packages/angular/src/generators/remote/schema.d.ts b/packages/angular/src/generators/remote/schema.d.ts index de11d136c1d30d..97d43327a0c398 100644 --- a/packages/angular/src/generators/remote/schema.d.ts +++ b/packages/angular/src/generators/remote/schema.d.ts @@ -1,4 +1,4 @@ -import { Linter } from '@nrwl/linter'; +import { Linter } from '@nx/linter'; import { E2eTestRunner, UnitTestRunner } from '../../utils/test-runners'; import type { Styles } from '../utils/types'; diff --git a/packages/angular/src/generators/scam-directive/lib/convert-directive-to-scam.spec.ts b/packages/angular/src/generators/scam-directive/lib/convert-directive-to-scam.spec.ts index d8aeea7977adb3..82ab6e68ee6db6 100644 --- a/packages/angular/src/generators/scam-directive/lib/convert-directive-to-scam.spec.ts +++ b/packages/angular/src/generators/scam-directive/lib/convert-directive-to-scam.spec.ts @@ -1,5 +1,5 @@ -import { addProjectConfiguration } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { addProjectConfiguration } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { directiveGenerator } from '../../directive/directive'; import { convertDirectiveToScam } from './convert-directive-to-scam'; diff --git a/packages/angular/src/generators/scam-directive/lib/convert-directive-to-scam.ts b/packages/angular/src/generators/scam-directive/lib/convert-directive-to-scam.ts index db98feb18bbaef..711c06d211f74b 100644 --- a/packages/angular/src/generators/scam-directive/lib/convert-directive-to-scam.ts +++ b/packages/angular/src/generators/scam-directive/lib/convert-directive-to-scam.ts @@ -1,7 +1,7 @@ -import type { Tree } from '@nrwl/devkit'; -import { joinPathFragments, names } from '@nrwl/devkit'; -import { insertImport } from '@nrwl/js'; -import { ensureTypescript } from '@nrwl/js/src/utils/typescript/ensure-typescript'; +import type { Tree } from '@nx/devkit'; +import { joinPathFragments, names } from '@nx/devkit'; +import { insertImport } from '@nx/js'; +import { ensureTypescript } from '@nx/js/src/utils/typescript/ensure-typescript'; import type { NormalizedSchema } from '../schema'; let tsModule: typeof import('typescript'); diff --git a/packages/angular/src/generators/scam-directive/lib/normalize-options.ts b/packages/angular/src/generators/scam-directive/lib/normalize-options.ts index 7775d643f9cb44..299d946ab9e7b0 100644 --- a/packages/angular/src/generators/scam-directive/lib/normalize-options.ts +++ b/packages/angular/src/generators/scam-directive/lib/normalize-options.ts @@ -1,4 +1,4 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { normalizeNameAndPaths } from '../../utils/path'; import type { NormalizedSchema, Schema } from '../schema'; diff --git a/packages/angular/src/generators/scam-directive/lib/validate-options.ts b/packages/angular/src/generators/scam-directive/lib/validate-options.ts index 0dfcdeee1ecdfb..81d70bbc7ab24f 100644 --- a/packages/angular/src/generators/scam-directive/lib/validate-options.ts +++ b/packages/angular/src/generators/scam-directive/lib/validate-options.ts @@ -1,4 +1,4 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { checkPathUnderProjectRoot } from '../../utils/path'; import { validateProject } from '../../utils/validations'; import type { Schema } from '../schema'; diff --git a/packages/angular/src/generators/scam-directive/scam-directive.compat.ts b/packages/angular/src/generators/scam-directive/scam-directive.compat.ts index b64e34a2b79060..19d1fbcdaa2f92 100644 --- a/packages/angular/src/generators/scam-directive/scam-directive.compat.ts +++ b/packages/angular/src/generators/scam-directive/scam-directive.compat.ts @@ -1,5 +1,5 @@ import scamGenerator from './scam-directive'; import { warnForSchematicUsage } from '../utils/warn-for-schematic-usage'; -import { convertNxGenerator } from '@nrwl/devkit'; +import { convertNxGenerator } from '@nx/devkit'; export default warnForSchematicUsage(convertNxGenerator(scamGenerator)); diff --git a/packages/angular/src/generators/scam-directive/scam-directive.spec.ts b/packages/angular/src/generators/scam-directive/scam-directive.spec.ts index f868ed17fc0372..4198864c993e98 100644 --- a/packages/angular/src/generators/scam-directive/scam-directive.spec.ts +++ b/packages/angular/src/generators/scam-directive/scam-directive.spec.ts @@ -1,5 +1,5 @@ -import { addProjectConfiguration, writeJson } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { addProjectConfiguration, writeJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { scamDirectiveGenerator } from './scam-directive'; describe('SCAM Directive Generator', () => { diff --git a/packages/angular/src/generators/scam-directive/scam-directive.ts b/packages/angular/src/generators/scam-directive/scam-directive.ts index e3035e5eaa4cd4..3a7b8884d7c264 100644 --- a/packages/angular/src/generators/scam-directive/scam-directive.ts +++ b/packages/angular/src/generators/scam-directive/scam-directive.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { formatFiles } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { formatFiles } from '@nx/devkit'; import { directiveGenerator } from '../directive/directive'; import { exportScam } from '../utils/export-scam'; import { diff --git a/packages/angular/src/generators/scam-pipe/lib/convert-pipe-to-scam.spec.ts b/packages/angular/src/generators/scam-pipe/lib/convert-pipe-to-scam.spec.ts index 0536474d04885b..a1dcd21be7c77c 100644 --- a/packages/angular/src/generators/scam-pipe/lib/convert-pipe-to-scam.spec.ts +++ b/packages/angular/src/generators/scam-pipe/lib/convert-pipe-to-scam.spec.ts @@ -1,5 +1,5 @@ -import { addProjectConfiguration } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { addProjectConfiguration } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { pipeGenerator } from '../../pipe/pipe'; import { convertPipeToScam } from './convert-pipe-to-scam'; diff --git a/packages/angular/src/generators/scam-pipe/lib/convert-pipe-to-scam.ts b/packages/angular/src/generators/scam-pipe/lib/convert-pipe-to-scam.ts index 4006eaad979221..a1e4cf088c95f6 100644 --- a/packages/angular/src/generators/scam-pipe/lib/convert-pipe-to-scam.ts +++ b/packages/angular/src/generators/scam-pipe/lib/convert-pipe-to-scam.ts @@ -1,7 +1,7 @@ -import type { Tree } from '@nrwl/devkit'; -import { joinPathFragments, names } from '@nrwl/devkit'; -import { insertImport } from '@nrwl/js'; -import { ensureTypescript } from '@nrwl/js/src/utils/typescript/ensure-typescript'; +import type { Tree } from '@nx/devkit'; +import { joinPathFragments, names } from '@nx/devkit'; +import { insertImport } from '@nx/js'; +import { ensureTypescript } from '@nx/js/src/utils/typescript/ensure-typescript'; import type { NormalizedSchema } from '../schema'; let tsModule: typeof import('typescript'); diff --git a/packages/angular/src/generators/scam-pipe/lib/normalize-options.ts b/packages/angular/src/generators/scam-pipe/lib/normalize-options.ts index a3db58f0bc83fc..1f0aa2cbaa812e 100644 --- a/packages/angular/src/generators/scam-pipe/lib/normalize-options.ts +++ b/packages/angular/src/generators/scam-pipe/lib/normalize-options.ts @@ -1,4 +1,4 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { normalizeNameAndPaths } from '../../utils/path'; import type { NormalizedSchema, Schema } from '../schema'; diff --git a/packages/angular/src/generators/scam-pipe/lib/validate-options.ts b/packages/angular/src/generators/scam-pipe/lib/validate-options.ts index 0dfcdeee1ecdfb..81d70bbc7ab24f 100644 --- a/packages/angular/src/generators/scam-pipe/lib/validate-options.ts +++ b/packages/angular/src/generators/scam-pipe/lib/validate-options.ts @@ -1,4 +1,4 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { checkPathUnderProjectRoot } from '../../utils/path'; import { validateProject } from '../../utils/validations'; import type { Schema } from '../schema'; diff --git a/packages/angular/src/generators/scam-pipe/scam-pipe.compat.ts b/packages/angular/src/generators/scam-pipe/scam-pipe.compat.ts index e11c6a66c0336d..aa2b976cfb8500 100644 --- a/packages/angular/src/generators/scam-pipe/scam-pipe.compat.ts +++ b/packages/angular/src/generators/scam-pipe/scam-pipe.compat.ts @@ -1,5 +1,5 @@ import scamPipeGenerator from './scam-pipe'; import { warnForSchematicUsage } from '../utils/warn-for-schematic-usage'; -import { convertNxGenerator } from '@nrwl/devkit'; +import { convertNxGenerator } from '@nx/devkit'; export default warnForSchematicUsage(convertNxGenerator(scamPipeGenerator)); diff --git a/packages/angular/src/generators/scam-pipe/scam-pipe.spec.ts b/packages/angular/src/generators/scam-pipe/scam-pipe.spec.ts index a7430a77201af8..fa561bd72acb56 100644 --- a/packages/angular/src/generators/scam-pipe/scam-pipe.spec.ts +++ b/packages/angular/src/generators/scam-pipe/scam-pipe.spec.ts @@ -1,5 +1,5 @@ -import { addProjectConfiguration, writeJson } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { addProjectConfiguration, writeJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { scamPipeGenerator } from './scam-pipe'; describe('SCAM Pipe Generator', () => { diff --git a/packages/angular/src/generators/scam-pipe/scam-pipe.ts b/packages/angular/src/generators/scam-pipe/scam-pipe.ts index b77c9ce314c00a..0194d40764828a 100644 --- a/packages/angular/src/generators/scam-pipe/scam-pipe.ts +++ b/packages/angular/src/generators/scam-pipe/scam-pipe.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { formatFiles } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { formatFiles } from '@nx/devkit'; import { pipeGenerator } from '../pipe/pipe'; import { exportScam } from '../utils/export-scam'; import { convertPipeToScam, normalizeOptions, validateOptions } from './lib'; diff --git a/packages/angular/src/generators/scam-to-standalone/compat.ts b/packages/angular/src/generators/scam-to-standalone/compat.ts index c1293ae5189e5c..3cfba0da6f8612 100644 --- a/packages/angular/src/generators/scam-to-standalone/compat.ts +++ b/packages/angular/src/generators/scam-to-standalone/compat.ts @@ -1,4 +1,4 @@ -import { convertNxGenerator } from '@nrwl/devkit'; +import { convertNxGenerator } from '@nx/devkit'; import { warnForSchematicUsage } from '../utils/warn-for-schematic-usage'; import { scamToStandalone } from './scam-to-standalone'; diff --git a/packages/angular/src/generators/scam-to-standalone/lib/replace-module-usages-with-component.ts b/packages/angular/src/generators/scam-to-standalone/lib/replace-module-usages-with-component.ts index 3ba58a4eb61b18..2eef107f5992ff 100644 --- a/packages/angular/src/generators/scam-to-standalone/lib/replace-module-usages-with-component.ts +++ b/packages/angular/src/generators/scam-to-standalone/lib/replace-module-usages-with-component.ts @@ -1,5 +1,5 @@ import { Tree } from 'nx/src/generators/tree'; -import { visitNotIgnoredFiles } from '@nrwl/devkit'; +import { visitNotIgnoredFiles } from '@nx/devkit'; import { extname } from 'path'; export function replaceModuleUsagesWithComponent( diff --git a/packages/angular/src/generators/scam-to-standalone/scam-to-standalone.spec.ts b/packages/angular/src/generators/scam-to-standalone/scam-to-standalone.spec.ts index 992c9b4e1c5678..6f2994040e2664 100644 --- a/packages/angular/src/generators/scam-to-standalone/scam-to-standalone.spec.ts +++ b/packages/angular/src/generators/scam-to-standalone/scam-to-standalone.spec.ts @@ -1,5 +1,5 @@ -import { stripIndents, updateJson } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { stripIndents, updateJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import scamGenerator from '../scam/scam'; import { generateTestApplication } from '../utils/testing'; import { scamToStandalone } from './scam-to-standalone'; diff --git a/packages/angular/src/generators/scam-to-standalone/scam-to-standalone.ts b/packages/angular/src/generators/scam-to-standalone/scam-to-standalone.ts index 2ad13d40661be0..315b9a6e681fce 100644 --- a/packages/angular/src/generators/scam-to-standalone/scam-to-standalone.ts +++ b/packages/angular/src/generators/scam-to-standalone/scam-to-standalone.ts @@ -1,10 +1,10 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { formatFiles, getProjects, joinPathFragments, stripIndents, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import type { Schema } from './schema'; import { convertScamToStandalone, diff --git a/packages/angular/src/generators/scam/lib/convert-component-to-scam.spec.ts b/packages/angular/src/generators/scam/lib/convert-component-to-scam.spec.ts index e93693c84509e2..1de216f33efea6 100644 --- a/packages/angular/src/generators/scam/lib/convert-component-to-scam.spec.ts +++ b/packages/angular/src/generators/scam/lib/convert-component-to-scam.spec.ts @@ -1,5 +1,5 @@ -import { addProjectConfiguration } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { addProjectConfiguration } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { componentGenerator } from '../../component/component'; import { convertComponentToScam } from './convert-component-to-scam'; diff --git a/packages/angular/src/generators/scam/lib/convert-component-to-scam.ts b/packages/angular/src/generators/scam/lib/convert-component-to-scam.ts index 33a564631a2720..4050bc7e8e0811 100644 --- a/packages/angular/src/generators/scam/lib/convert-component-to-scam.ts +++ b/packages/angular/src/generators/scam/lib/convert-component-to-scam.ts @@ -1,7 +1,7 @@ -import type { Tree } from '@nrwl/devkit'; -import { joinPathFragments, names } from '@nrwl/devkit'; -import { insertImport } from '@nrwl/js'; -import { ensureTypescript } from '@nrwl/js/src/utils/typescript/ensure-typescript'; +import type { Tree } from '@nx/devkit'; +import { joinPathFragments, names } from '@nx/devkit'; +import { insertImport } from '@nx/js'; +import { ensureTypescript } from '@nx/js/src/utils/typescript/ensure-typescript'; import type { NormalizedSchema } from '../schema'; let tsModule: typeof import('typescript'); diff --git a/packages/angular/src/generators/scam/lib/normalize-options.ts b/packages/angular/src/generators/scam/lib/normalize-options.ts index 15174a901e2039..331bced481fded 100644 --- a/packages/angular/src/generators/scam/lib/normalize-options.ts +++ b/packages/angular/src/generators/scam/lib/normalize-options.ts @@ -1,4 +1,4 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { normalizeNameAndPaths } from '../../utils/path'; import type { NormalizedSchema, Schema } from '../schema'; diff --git a/packages/angular/src/generators/scam/lib/validate-options.ts b/packages/angular/src/generators/scam/lib/validate-options.ts index 0dfcdeee1ecdfb..81d70bbc7ab24f 100644 --- a/packages/angular/src/generators/scam/lib/validate-options.ts +++ b/packages/angular/src/generators/scam/lib/validate-options.ts @@ -1,4 +1,4 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { checkPathUnderProjectRoot } from '../../utils/path'; import { validateProject } from '../../utils/validations'; import type { Schema } from '../schema'; diff --git a/packages/angular/src/generators/scam/scam.compat.ts b/packages/angular/src/generators/scam/scam.compat.ts index 4e92fad1225b93..db6c9c0e2637c4 100644 --- a/packages/angular/src/generators/scam/scam.compat.ts +++ b/packages/angular/src/generators/scam/scam.compat.ts @@ -1,5 +1,5 @@ import scamGenerator from './scam'; import { warnForSchematicUsage } from '../utils/warn-for-schematic-usage'; -import { convertNxGenerator } from '@nrwl/devkit'; +import { convertNxGenerator } from '@nx/devkit'; export default warnForSchematicUsage(convertNxGenerator(scamGenerator)); diff --git a/packages/angular/src/generators/scam/scam.spec.ts b/packages/angular/src/generators/scam/scam.spec.ts index bfb4f3b93878de..6015099bc904b7 100644 --- a/packages/angular/src/generators/scam/scam.spec.ts +++ b/packages/angular/src/generators/scam/scam.spec.ts @@ -1,5 +1,5 @@ -import { addProjectConfiguration, writeJson } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { addProjectConfiguration, writeJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { scamGenerator } from './scam'; describe('SCAM Generator', () => { diff --git a/packages/angular/src/generators/scam/scam.ts b/packages/angular/src/generators/scam/scam.ts index 78647b78b258f9..1c23c7abcb0c25 100644 --- a/packages/angular/src/generators/scam/scam.ts +++ b/packages/angular/src/generators/scam/scam.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { formatFiles } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { formatFiles } from '@nx/devkit'; import { componentGenerator } from '../component/component'; import { exportScam } from '../utils/export-scam'; import { diff --git a/packages/angular/src/generators/setup-mf/lib/add-cypress-workaround.ts b/packages/angular/src/generators/setup-mf/lib/add-cypress-workaround.ts index 78c4e74573f815..413a2bc9841a93 100644 --- a/packages/angular/src/generators/setup-mf/lib/add-cypress-workaround.ts +++ b/packages/angular/src/generators/setup-mf/lib/add-cypress-workaround.ts @@ -2,13 +2,13 @@ // as Angular attempt to figure out how to fix HMR when styles.js // is attached to the index.html with type=module -import type { ProjectConfiguration, Tree } from '@nrwl/devkit'; +import type { ProjectConfiguration, Tree } from '@nx/devkit'; import { joinPathFragments, logger, readProjectConfiguration, stripIndents, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import type { Schema } from '../schema'; export function addCypressOnErrorWorkaround(tree: Tree, schema: Schema) { diff --git a/packages/angular/src/generators/setup-mf/lib/add-remote-entry.ts b/packages/angular/src/generators/setup-mf/lib/add-remote-entry.ts index 696311d55ef9e7..ada4b6b8eab1d1 100644 --- a/packages/angular/src/generators/setup-mf/lib/add-remote-entry.ts +++ b/packages/angular/src/generators/setup-mf/lib/add-remote-entry.ts @@ -1,10 +1,10 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { generateFiles, joinPathFragments, readNxJson, readProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { addRoute } from '../../../utils/nx-devkit/route-utils'; import type { AngularProjectConfiguration } from '../../../utils/types'; import type { Schema } from '../schema'; diff --git a/packages/angular/src/generators/setup-mf/lib/add-remote-to-host.ts b/packages/angular/src/generators/setup-mf/lib/add-remote-to-host.ts index 3a1b13bca8b325..aef115cfa1f40c 100644 --- a/packages/angular/src/generators/setup-mf/lib/add-remote-to-host.ts +++ b/packages/angular/src/generators/setup-mf/lib/add-remote-to-host.ts @@ -5,12 +5,12 @@ import { readProjectConfiguration, Tree, updateJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import type { Schema } from '../schema'; import { ArrayLiteralExpression } from 'typescript'; -import { insertImport } from '@nrwl/js'; +import { insertImport } from '@nx/js'; import { addRoute } from '../../../utils/nx-devkit/route-utils'; -import { ensureTypescript } from '@nrwl/js/src/utils/typescript/ensure-typescript'; +import { ensureTypescript } from '@nx/js/src/utils/typescript/ensure-typescript'; let tsModule: typeof import('typescript'); diff --git a/packages/angular/src/generators/setup-mf/lib/change-build-target.ts b/packages/angular/src/generators/setup-mf/lib/change-build-target.ts index 31ec0799543141..821d5b5da010b7 100644 --- a/packages/angular/src/generators/setup-mf/lib/change-build-target.ts +++ b/packages/angular/src/generators/setup-mf/lib/change-build-target.ts @@ -1,10 +1,10 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import type { Schema } from '../schema'; import { readProjectConfiguration, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; export function changeBuildTarget(host: Tree, options: Schema) { const appConfig = readProjectConfiguration(host, options.appName); diff --git a/packages/angular/src/generators/setup-mf/lib/fix-bootstrap.ts b/packages/angular/src/generators/setup-mf/lib/fix-bootstrap.ts index 8f6721c6f1eb8e..78e4ff348b01e1 100644 --- a/packages/angular/src/generators/setup-mf/lib/fix-bootstrap.ts +++ b/packages/angular/src/generators/setup-mf/lib/fix-bootstrap.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { joinPathFragments } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { joinPathFragments } from '@nx/devkit'; import type { Schema } from '../schema'; import { getInstalledAngularMajorVersion } from '../../utils/version-utils'; diff --git a/packages/angular/src/generators/setup-mf/lib/generate-config.ts b/packages/angular/src/generators/setup-mf/lib/generate-config.ts index 1f127e13b0e8e3..47bd394d5a8439 100644 --- a/packages/angular/src/generators/setup-mf/lib/generate-config.ts +++ b/packages/angular/src/generators/setup-mf/lib/generate-config.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { generateFiles, joinPathFragments, logger } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { generateFiles, joinPathFragments, logger } from '@nx/devkit'; import type { Schema } from '../schema'; export function generateWebpackConfig( diff --git a/packages/angular/src/generators/setup-mf/lib/get-remotes-with-ports.ts b/packages/angular/src/generators/setup-mf/lib/get-remotes-with-ports.ts index a7233041c6a777..1767c77a8b331a 100644 --- a/packages/angular/src/generators/setup-mf/lib/get-remotes-with-ports.ts +++ b/packages/angular/src/generators/setup-mf/lib/get-remotes-with-ports.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { readProjectConfiguration } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { readProjectConfiguration } from '@nx/devkit'; import type { Schema } from '../schema'; export function getRemotesWithPorts(host: Tree, options: Schema) { diff --git a/packages/angular/src/generators/setup-mf/lib/remove-dead-code-from-remote.ts b/packages/angular/src/generators/setup-mf/lib/remove-dead-code-from-remote.ts index fe6980fe00b8a3..d505a03d2c5c68 100644 --- a/packages/angular/src/generators/setup-mf/lib/remove-dead-code-from-remote.ts +++ b/packages/angular/src/generators/setup-mf/lib/remove-dead-code-from-remote.ts @@ -2,7 +2,7 @@ import { Tree } from 'nx/src/generators/tree'; import { Schema } from '../schema'; import { readProjectConfiguration } from 'nx/src/generators/utils/project-configuration'; import { joinPathFragments } from 'nx/src/utils/path'; -import { readNxJson } from '@nrwl/devkit'; +import { readNxJson } from '@nx/devkit'; export function removeDeadCodeFromRemote(tree: Tree, options: Schema) { const projectName = options.appName; diff --git a/packages/angular/src/generators/setup-mf/lib/set-tsconfig-target.ts b/packages/angular/src/generators/setup-mf/lib/set-tsconfig-target.ts index a6987c7f8398db..96401331f907da 100644 --- a/packages/angular/src/generators/setup-mf/lib/set-tsconfig-target.ts +++ b/packages/angular/src/generators/setup-mf/lib/set-tsconfig-target.ts @@ -1,11 +1,11 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import type { Schema } from '../schema'; import { updateJson, readProjectConfiguration, joinPathFragments, -} from '@nrwl/devkit'; +} from '@nx/devkit'; export function updateTsConfigTarget(tree: Tree, schema: Schema) { const { root } = readProjectConfiguration(tree, schema.appName); diff --git a/packages/angular/src/generators/setup-mf/lib/setup-host-if-dynamic.ts b/packages/angular/src/generators/setup-mf/lib/setup-host-if-dynamic.ts index dfea94c4bc9fa0..ae63213c1e9c33 100644 --- a/packages/angular/src/generators/setup-mf/lib/setup-host-if-dynamic.ts +++ b/packages/angular/src/generators/setup-mf/lib/setup-host-if-dynamic.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { joinPathFragments, readProjectConfiguration } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { joinPathFragments, readProjectConfiguration } from '@nx/devkit'; import type { Schema } from '../schema'; export function setupHostIfDynamic(tree: Tree, options: Schema) { diff --git a/packages/angular/src/generators/setup-mf/lib/setup-serve-target.ts b/packages/angular/src/generators/setup-mf/lib/setup-serve-target.ts index 0a2c650fb6c904..8396bb50bd1424 100644 --- a/packages/angular/src/generators/setup-mf/lib/setup-serve-target.ts +++ b/packages/angular/src/generators/setup-mf/lib/setup-serve-target.ts @@ -1,8 +1,8 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { readProjectConfiguration, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import type { Schema } from '../schema'; export function setupServeTarget(host: Tree, options: Schema) { diff --git a/packages/angular/src/generators/setup-mf/lib/update-host-app-routes.ts b/packages/angular/src/generators/setup-mf/lib/update-host-app-routes.ts index 44a2627ea60766..49b4dc52e28280 100644 --- a/packages/angular/src/generators/setup-mf/lib/update-host-app-routes.ts +++ b/packages/angular/src/generators/setup-mf/lib/update-host-app-routes.ts @@ -1,7 +1,7 @@ import { Tree } from 'nx/src/generators/tree'; import { readProjectConfiguration } from 'nx/src/generators/utils/project-configuration'; -import { generateFiles, joinPathFragments, names } from '@nrwl/devkit'; -import { ensureTypescript } from '@nrwl/js/src/utils/typescript/ensure-typescript'; +import { generateFiles, joinPathFragments, names } from '@nx/devkit'; +import { ensureTypescript } from '@nx/js/src/utils/typescript/ensure-typescript'; import { addRoute } from '../../../utils/nx-devkit/route-utils'; import { Schema } from '../schema'; diff --git a/packages/angular/src/generators/setup-mf/setup-mf.compat.ts b/packages/angular/src/generators/setup-mf/setup-mf.compat.ts index d70619038adfd4..5b2378850139db 100644 --- a/packages/angular/src/generators/setup-mf/setup-mf.compat.ts +++ b/packages/angular/src/generators/setup-mf/setup-mf.compat.ts @@ -1,4 +1,4 @@ -import { convertNxGenerator } from '@nrwl/devkit'; +import { convertNxGenerator } from '@nx/devkit'; import { warnForSchematicUsage } from '../utils/warn-for-schematic-usage'; import { setupMf } from './setup-mf'; diff --git a/packages/angular/src/generators/setup-mf/setup-mf.spec.ts b/packages/angular/src/generators/setup-mf/setup-mf.spec.ts index 4a9031538d4ab2..efc7e8267dd47f 100644 --- a/packages/angular/src/generators/setup-mf/setup-mf.spec.ts +++ b/packages/angular/src/generators/setup-mf/setup-mf.spec.ts @@ -3,8 +3,8 @@ import { readProjectConfiguration, Tree, updateJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { generateTestApplication } from '../utils/testing'; import { setupMf } from './setup-mf'; diff --git a/packages/angular/src/generators/setup-mf/setup-mf.ts b/packages/angular/src/generators/setup-mf/setup-mf.ts index 9266005641539c..ef6aae7bb7e4ab 100644 --- a/packages/angular/src/generators/setup-mf/setup-mf.ts +++ b/packages/angular/src/generators/setup-mf/setup-mf.ts @@ -1,9 +1,9 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { addDependenciesToPackageJson, formatFiles, readProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import type { Schema } from './schema'; import { diff --git a/packages/angular/src/generators/setup-ssr/lib/generate-files.ts b/packages/angular/src/generators/setup-ssr/lib/generate-files.ts index 48a459d628c8f3..8c32826e7e4e62 100644 --- a/packages/angular/src/generators/setup-ssr/lib/generate-files.ts +++ b/packages/angular/src/generators/setup-ssr/lib/generate-files.ts @@ -1,9 +1,9 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { generateFiles, joinPathFragments, readProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import type { Schema } from '../schema'; export function generateSSRFiles(tree: Tree, schema: Schema) { diff --git a/packages/angular/src/generators/setup-ssr/lib/normalize-options.ts b/packages/angular/src/generators/setup-ssr/lib/normalize-options.ts index 304238a8c4dabc..2de38d51e87f19 100644 --- a/packages/angular/src/generators/setup-ssr/lib/normalize-options.ts +++ b/packages/angular/src/generators/setup-ssr/lib/normalize-options.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { readNxJson } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { readNxJson } from '@nx/devkit'; import type { Schema } from '../schema'; export function normalizeOptions(tree: Tree, options: Schema) { diff --git a/packages/angular/src/generators/setup-ssr/lib/update-app-module.ts b/packages/angular/src/generators/setup-ssr/lib/update-app-module.ts index a2530e80b034dd..c723e04a1d9fd1 100644 --- a/packages/angular/src/generators/setup-ssr/lib/update-app-module.ts +++ b/packages/angular/src/generators/setup-ssr/lib/update-app-module.ts @@ -1,7 +1,7 @@ -import type { Tree } from '@nrwl/devkit'; -import { joinPathFragments, readProjectConfiguration } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { joinPathFragments, readProjectConfiguration } from '@nx/devkit'; import type { Schema } from '../schema'; -import { ensureTypescript } from '@nrwl/js/src/utils/typescript/ensure-typescript'; +import { ensureTypescript } from '@nx/js/src/utils/typescript/ensure-typescript'; export function updateAppModule(tree: Tree, schema: Schema) { ensureTypescript(); diff --git a/packages/angular/src/generators/setup-ssr/lib/update-project-config.ts b/packages/angular/src/generators/setup-ssr/lib/update-project-config.ts index 6d0f73113ef6b9..56e0e5406eefd9 100644 --- a/packages/angular/src/generators/setup-ssr/lib/update-project-config.ts +++ b/packages/angular/src/generators/setup-ssr/lib/update-project-config.ts @@ -1,11 +1,11 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { joinPathFragments, readNxJson, readProjectConfiguration, updateNxJson, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import type { Schema } from '../schema'; export function updateProjectConfig(tree: Tree, schema: Schema) { diff --git a/packages/angular/src/generators/setup-ssr/setup-ssr.compat.ts b/packages/angular/src/generators/setup-ssr/setup-ssr.compat.ts index be052ea0f8c59a..0b1da67ed2c0e3 100644 --- a/packages/angular/src/generators/setup-ssr/setup-ssr.compat.ts +++ b/packages/angular/src/generators/setup-ssr/setup-ssr.compat.ts @@ -1,4 +1,4 @@ -import { convertNxGenerator } from '@nrwl/devkit'; +import { convertNxGenerator } from '@nx/devkit'; import { warnForSchematicUsage } from '../utils/warn-for-schematic-usage'; import { setupSsr } from './setup-ssr'; diff --git a/packages/angular/src/generators/setup-ssr/setup-ssr.spec.ts b/packages/angular/src/generators/setup-ssr/setup-ssr.spec.ts index 9ee3e4adfd9dc2..2e61b64cc03b94 100644 --- a/packages/angular/src/generators/setup-ssr/setup-ssr.spec.ts +++ b/packages/angular/src/generators/setup-ssr/setup-ssr.spec.ts @@ -4,8 +4,8 @@ import { readProjectConfiguration, updateJson, updateProjectConfiguration, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { PackageJson } from 'nx/src/utils/package-json'; import { angularVersion, ngUniversalVersion } from '../../utils/versions'; import { generateTestApplication } from '../utils/testing'; diff --git a/packages/angular/src/generators/setup-ssr/setup-ssr.ts b/packages/angular/src/generators/setup-ssr/setup-ssr.ts index 509742cfe66efe..746aa18c66f4bf 100644 --- a/packages/angular/src/generators/setup-ssr/setup-ssr.ts +++ b/packages/angular/src/generators/setup-ssr/setup-ssr.ts @@ -1,9 +1,9 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { addDependenciesToPackageJson, formatFiles, installPackagesTask, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { versions } from '../utils/version-utils'; import { generateSSRFiles, diff --git a/packages/angular/src/generators/setup-tailwind/lib/add-tailwind-config-path-to-project.ts b/packages/angular/src/generators/setup-tailwind/lib/add-tailwind-config-path-to-project.ts index c997718254ce40..a7a05a284ed134 100644 --- a/packages/angular/src/generators/setup-tailwind/lib/add-tailwind-config-path-to-project.ts +++ b/packages/angular/src/generators/setup-tailwind/lib/add-tailwind-config-path-to-project.ts @@ -4,7 +4,7 @@ import { stripIndents, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { NormalizedGeneratorOptions } from '../schema'; export function addTailwindConfigPathToProject( diff --git a/packages/angular/src/generators/setup-tailwind/lib/add-tailwind-config.ts b/packages/angular/src/generators/setup-tailwind/lib/add-tailwind-config.ts index d650497192147d..a8a1d9a7263e67 100644 --- a/packages/angular/src/generators/setup-tailwind/lib/add-tailwind-config.ts +++ b/packages/angular/src/generators/setup-tailwind/lib/add-tailwind-config.ts @@ -4,7 +4,7 @@ import { ProjectConfiguration, stripIndents, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { relative } from 'path'; import { GeneratorOptions } from '../schema'; diff --git a/packages/angular/src/generators/setup-tailwind/lib/add-tailwind-required-packages.ts b/packages/angular/src/generators/setup-tailwind/lib/add-tailwind-required-packages.ts index 9c3d881d0d7978..850a4adf1920cb 100644 --- a/packages/angular/src/generators/setup-tailwind/lib/add-tailwind-required-packages.ts +++ b/packages/angular/src/generators/setup-tailwind/lib/add-tailwind-required-packages.ts @@ -2,7 +2,7 @@ import { addDependenciesToPackageJson, GeneratorCallback, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { versions } from '../../utils/version-utils'; export function addTailwindRequiredPackages(tree: Tree): GeneratorCallback { diff --git a/packages/angular/src/generators/setup-tailwind/lib/detect-tailwind-installed-version.ts b/packages/angular/src/generators/setup-tailwind/lib/detect-tailwind-installed-version.ts index 29c2166bca98ab..a2aa5a70981bad 100644 --- a/packages/angular/src/generators/setup-tailwind/lib/detect-tailwind-installed-version.ts +++ b/packages/angular/src/generators/setup-tailwind/lib/detect-tailwind-installed-version.ts @@ -1,5 +1,5 @@ -import { readJson, Tree } from '@nrwl/devkit'; -import { checkAndCleanWithSemver } from '@nrwl/devkit/src/utils/semver'; +import { readJson, Tree } from '@nx/devkit'; +import { checkAndCleanWithSemver } from '@nx/devkit/src/utils/semver'; import { lt } from 'semver'; export function detectTailwindInstalledVersion( diff --git a/packages/angular/src/generators/setup-tailwind/lib/update-application-styles.ts b/packages/angular/src/generators/setup-tailwind/lib/update-application-styles.ts index 397d270417c462..4e8890af76b55c 100644 --- a/packages/angular/src/generators/setup-tailwind/lib/update-application-styles.ts +++ b/packages/angular/src/generators/setup-tailwind/lib/update-application-styles.ts @@ -3,7 +3,7 @@ import { ProjectConfiguration, stripIndents, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { NormalizedGeneratorOptions } from '../schema'; export function updateApplicationStyles( diff --git a/packages/angular/src/generators/setup-tailwind/setup-tailwind.application.spec.ts b/packages/angular/src/generators/setup-tailwind/setup-tailwind.application.spec.ts index cf42cd5dcd5efe..365e3a030191a8 100644 --- a/packages/angular/src/generators/setup-tailwind/setup-tailwind.application.spec.ts +++ b/packages/angular/src/generators/setup-tailwind/setup-tailwind.application.spec.ts @@ -1,4 +1,4 @@ -import * as devkit from '@nrwl/devkit'; +import * as devkit from '@nx/devkit'; import { addProjectConfiguration, readJson, @@ -6,8 +6,8 @@ import { Tree, updateJson, updateProjectConfiguration, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { setupTailwindGenerator } from './setup-tailwind'; import { autoprefixerVersion, diff --git a/packages/angular/src/generators/setup-tailwind/setup-tailwind.compat.ts b/packages/angular/src/generators/setup-tailwind/setup-tailwind.compat.ts index fe4cd06277445f..96fe2d20549778 100644 --- a/packages/angular/src/generators/setup-tailwind/setup-tailwind.compat.ts +++ b/packages/angular/src/generators/setup-tailwind/setup-tailwind.compat.ts @@ -1,4 +1,4 @@ -import { convertNxGenerator } from '@nrwl/devkit'; +import { convertNxGenerator } from '@nx/devkit'; import { warnForSchematicUsage } from '../utils/warn-for-schematic-usage'; import { setupTailwindGenerator } from './setup-tailwind'; diff --git a/packages/angular/src/generators/setup-tailwind/setup-tailwind.library.spec.ts b/packages/angular/src/generators/setup-tailwind/setup-tailwind.library.spec.ts index b948e8ef9b1602..2abdfe3612c5f0 100644 --- a/packages/angular/src/generators/setup-tailwind/setup-tailwind.library.spec.ts +++ b/packages/angular/src/generators/setup-tailwind/setup-tailwind.library.spec.ts @@ -1,4 +1,4 @@ -import * as devkit from '@nrwl/devkit'; +import * as devkit from '@nx/devkit'; import { addProjectConfiguration, readJson, @@ -6,8 +6,8 @@ import { Tree, updateJson, updateProjectConfiguration, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { setupTailwindGenerator } from './setup-tailwind'; import { autoprefixerVersion, diff --git a/packages/angular/src/generators/setup-tailwind/setup-tailwind.ts b/packages/angular/src/generators/setup-tailwind/setup-tailwind.ts index 22c32f58cd895f..252c477a93ecb5 100644 --- a/packages/angular/src/generators/setup-tailwind/setup-tailwind.ts +++ b/packages/angular/src/generators/setup-tailwind/setup-tailwind.ts @@ -3,7 +3,7 @@ import { GeneratorCallback, readProjectConfiguration, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { addTailwindConfig, addTailwindConfigPathToProject, diff --git a/packages/angular/src/generators/stories/compat.ts b/packages/angular/src/generators/stories/compat.ts index effdd2f3928b15..1b0c9fa07f8b9c 100644 --- a/packages/angular/src/generators/stories/compat.ts +++ b/packages/angular/src/generators/stories/compat.ts @@ -1,4 +1,4 @@ -import { convertNxGenerator } from '@nrwl/devkit'; +import { convertNxGenerator } from '@nx/devkit'; import { warnForSchematicUsage } from '../utils/warn-for-schematic-usage'; import { angularStoriesGenerator } from './stories'; diff --git a/packages/angular/src/generators/stories/lib/get-e2e-project.ts b/packages/angular/src/generators/stories/lib/get-e2e-project.ts index 0a3f81248e2f1c..b5a057c370638f 100644 --- a/packages/angular/src/generators/stories/lib/get-e2e-project.ts +++ b/packages/angular/src/generators/stories/lib/get-e2e-project.ts @@ -1,5 +1,5 @@ -import type { ProjectConfiguration, Tree } from '@nrwl/devkit'; -import { readProjectConfiguration } from '@nrwl/devkit'; +import type { ProjectConfiguration, Tree } from '@nx/devkit'; +import { readProjectConfiguration } from '@nx/devkit'; export function getE2EProject( tree: Tree, diff --git a/packages/angular/src/generators/stories/stories-app.spec.ts b/packages/angular/src/generators/stories/stories-app.spec.ts index 998a2258b52a94..39ade7427e65b1 100644 --- a/packages/angular/src/generators/stories/stories-app.spec.ts +++ b/packages/angular/src/generators/stories/stories-app.spec.ts @@ -1,6 +1,6 @@ -import { installedCypressVersion } from '@nrwl/cypress/src/utils/cypress-version'; -import type { Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { installedCypressVersion } from '@nx/cypress/src/utils/cypress-version'; +import type { Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { componentGenerator } from '../component/component'; import { scamGenerator } from '../scam/scam'; import { generateTestApplication } from '../utils/testing'; @@ -8,7 +8,7 @@ import { angularStoriesGenerator } from './stories'; // need to mock cypress otherwise it'll use the nx installed version from package.json // which is v9 while we are testing for the new v10 version -jest.mock('@nrwl/cypress/src/utils/cypress-version'); +jest.mock('@nx/cypress/src/utils/cypress-version'); describe('angularStories generator: applications', () => { let tree: Tree; diff --git a/packages/angular/src/generators/stories/stories-lib.spec.ts b/packages/angular/src/generators/stories/stories-lib.spec.ts index 606bf2a48d3c89..ec1008480fbc2e 100644 --- a/packages/angular/src/generators/stories/stories-lib.spec.ts +++ b/packages/angular/src/generators/stories/stories-lib.spec.ts @@ -1,8 +1,8 @@ -import { installedCypressVersion } from '@nrwl/cypress/src/utils/cypress-version'; -import { Tree } from '@nrwl/devkit'; -import { writeJson } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { Linter } from '@nrwl/linter'; +import { installedCypressVersion } from '@nx/cypress/src/utils/cypress-version'; +import { Tree } from '@nx/devkit'; +import { writeJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { Linter } from '@nx/linter'; import { componentGenerator } from '../component/component'; import { librarySecondaryEntryPointGenerator } from '../library-secondary-entry-point/library-secondary-entry-point'; import { scamGenerator } from '../scam/scam'; @@ -14,7 +14,7 @@ import { angularStoriesGenerator } from './stories'; // need to mock cypress otherwise it'll use the nx installed version from package.json // which is v9 while we are testing for the new v10 version -jest.mock('@nrwl/cypress/src/utils/cypress-version'); +jest.mock('@nx/cypress/src/utils/cypress-version'); describe('angularStories generator: libraries', () => { const libName = 'test-ui-lib'; @@ -52,7 +52,7 @@ describe('angularStories generator: libraries', () => { beforeEach(async () => { tree = await createStorybookTestWorkspaceForLib(libName); cypressProjectGenerator = await ( - await import('@nrwl/storybook') + await import('@nx/storybook') ).cypressProjectGenerator; }); diff --git a/packages/angular/src/generators/stories/stories.ts b/packages/angular/src/generators/stories/stories.ts index c76d37fb9f49fe..3d1370bdda8b22 100644 --- a/packages/angular/src/generators/stories/stories.ts +++ b/packages/angular/src/generators/stories/stories.ts @@ -1,4 +1,4 @@ -import { formatFiles, joinPathFragments, logger, Tree } from '@nrwl/devkit'; +import { formatFiles, joinPathFragments, logger, Tree } from '@nx/devkit'; import componentCypressSpecGenerator from '../component-cypress-spec/component-cypress-spec'; import componentStoryGenerator from '../component-story/component-story'; import type { ComponentInfo } from '../utils/storybook-ast/component-info'; diff --git a/packages/angular/src/generators/storybook-configuration/compat.ts b/packages/angular/src/generators/storybook-configuration/compat.ts index d0e08eab2cc56c..6fcff020e10fb1 100644 --- a/packages/angular/src/generators/storybook-configuration/compat.ts +++ b/packages/angular/src/generators/storybook-configuration/compat.ts @@ -1,4 +1,4 @@ -import { convertNxGenerator } from '@nrwl/devkit'; +import { convertNxGenerator } from '@nx/devkit'; import { warnForSchematicUsage } from '../utils/warn-for-schematic-usage'; import { storybookConfigurationGenerator } from './storybook-configuration'; diff --git a/packages/angular/src/generators/storybook-configuration/lib/generate-stories.ts b/packages/angular/src/generators/storybook-configuration/lib/generate-stories.ts index c6e3d70739040c..de21bbcc90ee3c 100644 --- a/packages/angular/src/generators/storybook-configuration/lib/generate-stories.ts +++ b/packages/angular/src/generators/storybook-configuration/lib/generate-stories.ts @@ -1,6 +1,6 @@ -import { getE2eProjectName } from '@nrwl/cypress/src/utils/project-name'; -import type { Tree } from '@nrwl/devkit'; -import { readProjectConfiguration } from '@nrwl/devkit'; +import { getE2eProjectName } from '@nx/cypress/src/utils/project-name'; +import type { Tree } from '@nx/devkit'; +import { readProjectConfiguration } from '@nx/devkit'; import { angularStoriesGenerator } from '../../stories/stories'; import type { StorybookConfigurationOptions } from '../schema'; diff --git a/packages/angular/src/generators/storybook-configuration/lib/generate-storybook-configuration.ts b/packages/angular/src/generators/storybook-configuration/lib/generate-storybook-configuration.ts index f45b682a4fbe75..48060ccf955ab7 100644 --- a/packages/angular/src/generators/storybook-configuration/lib/generate-storybook-configuration.ts +++ b/packages/angular/src/generators/storybook-configuration/lib/generate-storybook-configuration.ts @@ -1,4 +1,4 @@ -import { GeneratorCallback, Tree, ensurePackage } from '@nrwl/devkit'; +import { GeneratorCallback, Tree, ensurePackage } from '@nx/devkit'; import type { StorybookConfigurationOptions } from '../schema'; import { nxVersion } from '../../../utils/versions'; @@ -6,10 +6,7 @@ export async function generateStorybookConfiguration( tree: Tree, options: StorybookConfigurationOptions ): Promise { - const { configurationGenerator } = ensurePackage( - '@nrwl/storybook', - nxVersion - ); + const { configurationGenerator } = ensurePackage('@nx/storybook', nxVersion); return await configurationGenerator(tree, { name: options.name, uiFramework: '@storybook/angular', diff --git a/packages/angular/src/generators/storybook-configuration/schema.d.ts b/packages/angular/src/generators/storybook-configuration/schema.d.ts index 02666e6a5196a2..fbe8f901779daa 100644 --- a/packages/angular/src/generators/storybook-configuration/schema.d.ts +++ b/packages/angular/src/generators/storybook-configuration/schema.d.ts @@ -1,4 +1,4 @@ -import type { Linter } from '@nrwl/linter'; +import type { Linter } from '@nx/linter'; export interface StorybookConfigurationOptions { configureCypress: boolean; diff --git a/packages/angular/src/generators/storybook-configuration/storybook-configuration.spec.ts b/packages/angular/src/generators/storybook-configuration/storybook-configuration.spec.ts index 5321392af7c229..2f7486fad6325b 100644 --- a/packages/angular/src/generators/storybook-configuration/storybook-configuration.spec.ts +++ b/packages/angular/src/generators/storybook-configuration/storybook-configuration.spec.ts @@ -1,7 +1,7 @@ -import { installedCypressVersion } from '@nrwl/cypress/src/utils/cypress-version'; -import type { Tree } from '@nrwl/devkit'; -import { joinPathFragments, writeJson } from '@nrwl/devkit'; -import { overrideCollectionResolutionForTesting } from '@nrwl/devkit/ngcli-adapter'; +import { installedCypressVersion } from '@nx/cypress/src/utils/cypress-version'; +import type { Tree } from '@nx/devkit'; +import { joinPathFragments, writeJson } from '@nx/devkit'; +import { overrideCollectionResolutionForTesting } from '@nx/devkit/ngcli-adapter'; import { Linter } from 'packages/linter/src/generators/utils/linter'; import { componentGenerator } from '../component/component'; import { librarySecondaryEntryPointGenerator } from '../library-secondary-entry-point/library-secondary-entry-point'; @@ -11,7 +11,7 @@ import { storybookConfigurationGenerator } from './storybook-configuration'; // need to mock cypress otherwise it'll use the nx installed version from package.json // which is v9 while we are testing for the new v10 version -jest.mock('@nrwl/cypress/src/utils/cypress-version'); +jest.mock('@nx/cypress/src/utils/cypress-version'); // nested code imports graph from the repo, which might have innacurate graph version jest.mock('nx/src/project-graph/project-graph', () => ({ ...jest.requireActual('nx/src/project-graph/project-graph'), diff --git a/packages/angular/src/generators/storybook-configuration/storybook-configuration.ts b/packages/angular/src/generators/storybook-configuration/storybook-configuration.ts index bac9af3083f2c2..6164f0215af50a 100644 --- a/packages/angular/src/generators/storybook-configuration/storybook-configuration.ts +++ b/packages/angular/src/generators/storybook-configuration/storybook-configuration.ts @@ -1,4 +1,4 @@ -import { formatFiles, GeneratorCallback, Tree } from '@nrwl/devkit'; +import { formatFiles, GeneratorCallback, Tree } from '@nx/devkit'; import { assertCompatibleStorybookVersion } from './lib/assert-compatible-storybook-version'; import { generateStories } from './lib/generate-stories'; import { generateStorybookConfiguration } from './lib/generate-storybook-configuration'; diff --git a/packages/angular/src/generators/utils/create-ts-config.ts b/packages/angular/src/generators/utils/create-ts-config.ts index f92d81cd8b31b7..9b4d62469f22bf 100644 --- a/packages/angular/src/generators/utils/create-ts-config.ts +++ b/packages/angular/src/generators/utils/create-ts-config.ts @@ -1,9 +1,9 @@ -import type { Tree } from '@nrwl/devkit'; -import { writeJson } from '@nrwl/devkit'; -import { tsConfigBaseOptions } from '@nrwl/js'; +import type { Tree } from '@nx/devkit'; +import { writeJson } from '@nx/devkit'; +import { tsConfigBaseOptions } from '@nx/js'; import { getInstalledAngularMajorVersion } from './version-utils'; -export { extractTsConfigBase } from '@nrwl/js'; +export { extractTsConfigBase } from '@nx/js'; export function createTsConfig( host: Tree, diff --git a/packages/angular/src/generators/utils/dependencies.ts b/packages/angular/src/generators/utils/dependencies.ts index 9eeb6dc7d44b2e..e15238d8b89ac1 100644 --- a/packages/angular/src/generators/utils/dependencies.ts +++ b/packages/angular/src/generators/utils/dependencies.ts @@ -1,4 +1,4 @@ -import { addDependenciesToPackageJson, Tree } from '@nrwl/devkit'; +import { addDependenciesToPackageJson, Tree } from '@nx/devkit'; import { versions } from './version-utils'; export function addBuildableLibrariesPostCssDependencies(tree: Tree): void { diff --git a/packages/angular/src/generators/utils/entry-point.ts b/packages/angular/src/generators/utils/entry-point.ts index 4e00c51c061f9c..190c7152504ca4 100644 --- a/packages/angular/src/generators/utils/entry-point.ts +++ b/packages/angular/src/generators/utils/entry-point.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { joinPathFragments, readJson } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { joinPathFragments, readJson } from '@nx/devkit'; import { dirname } from 'path'; export function locateLibraryEntryPointFromDirectory( diff --git a/packages/angular/src/generators/utils/export-scam.spec.ts b/packages/angular/src/generators/utils/export-scam.spec.ts index 36a9633cde102a..5e8fca66a91c5d 100644 --- a/packages/angular/src/generators/utils/export-scam.spec.ts +++ b/packages/angular/src/generators/utils/export-scam.spec.ts @@ -1,5 +1,5 @@ -import { addProjectConfiguration, writeJson } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { addProjectConfiguration, writeJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { exportScam } from './export-scam'; describe('exportScam', () => { diff --git a/packages/angular/src/generators/utils/export-scam.ts b/packages/angular/src/generators/utils/export-scam.ts index 7f20dd9bc2b05c..1486279bccb768 100644 --- a/packages/angular/src/generators/utils/export-scam.ts +++ b/packages/angular/src/generators/utils/export-scam.ts @@ -1,11 +1,11 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { joinPathFragments, logger, names, readProjectConfiguration, stripIndents, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { locateLibraryEntryPointFromDirectory } from './entry-point'; import { getRelativeImportToFile } from './path'; diff --git a/packages/angular/src/generators/utils/find-module.ts b/packages/angular/src/generators/utils/find-module.ts index 854cd26c45b61a..0d7af2b46b3f2a 100644 --- a/packages/angular/src/generators/utils/find-module.ts +++ b/packages/angular/src/generators/utils/find-module.ts @@ -1,8 +1,8 @@ -import type { Tree } from '@nrwl/devkit'; -import { joinPathFragments } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { joinPathFragments } from '@nx/devkit'; import { dirname } from 'path'; -import { ensureTypescript } from '@nrwl/js/src/utils/typescript/ensure-typescript'; -import { insertImport } from '@nrwl/js'; +import { ensureTypescript } from '@nx/js/src/utils/typescript/ensure-typescript'; +import { insertImport } from '@nx/js'; import { insertNgModuleProperty, ngModuleDecoratorProperty, diff --git a/packages/angular/src/generators/utils/insert-ngmodule-import.spec.ts b/packages/angular/src/generators/utils/insert-ngmodule-import.spec.ts index c3bd2516b8a61a..48cc7ca87d1218 100644 --- a/packages/angular/src/generators/utils/insert-ngmodule-import.spec.ts +++ b/packages/angular/src/generators/utils/insert-ngmodule-import.spec.ts @@ -1,5 +1,5 @@ -import { Tree } from '@nrwl/devkit'; -import { createTree } from '@nrwl/devkit/testing'; +import { Tree } from '@nx/devkit'; +import { createTree } from '@nx/devkit/testing'; import { insertNgModuleImport } from './insert-ngmodule-import'; describe('insertNgModuleImport', () => { diff --git a/packages/angular/src/generators/utils/insert-ngmodule-import.ts b/packages/angular/src/generators/utils/insert-ngmodule-import.ts index 59b4d0bf584ed1..c04b5d63ab205a 100644 --- a/packages/angular/src/generators/utils/insert-ngmodule-import.ts +++ b/packages/angular/src/generators/utils/insert-ngmodule-import.ts @@ -1,4 +1,4 @@ -import { applyChangesToString, ChangeType, Tree } from '@nrwl/devkit'; +import { applyChangesToString, ChangeType, Tree } from '@nx/devkit'; import type { __String, CallExpression, @@ -9,7 +9,7 @@ import type { PropertyAssignment, SourceFile, } from 'typescript'; -import { ensureTypescript } from '@nrwl/js/src/utils/typescript/ensure-typescript'; +import { ensureTypescript } from '@nx/js/src/utils/typescript/ensure-typescript'; let tsModule: typeof import('typescript'); diff --git a/packages/angular/src/generators/utils/names.ts b/packages/angular/src/generators/utils/names.ts index 838e3e568258b1..32ff2546331e34 100644 --- a/packages/angular/src/generators/utils/names.ts +++ b/packages/angular/src/generators/utils/names.ts @@ -1,4 +1,4 @@ -import { normalizePath } from '@nrwl/devkit'; +import { normalizePath } from '@nx/devkit'; export type NameInfo = { name: string; path: string }; diff --git a/packages/angular/src/generators/utils/path.ts b/packages/angular/src/generators/utils/path.ts index c12702c91de29b..26b0544f7811a0 100644 --- a/packages/angular/src/generators/utils/path.ts +++ b/packages/angular/src/generators/utils/path.ts @@ -1,11 +1,11 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { joinPathFragments, names, normalizePath, readProjectConfiguration, workspaceRoot, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { basename, dirname, relative } from 'path'; import { parseNameWithPath } from './names'; diff --git a/packages/angular/src/generators/utils/project.ts b/packages/angular/src/generators/utils/project.ts index 871e80dbbc2ee7..ae3c51401eea26 100644 --- a/packages/angular/src/generators/utils/project.ts +++ b/packages/angular/src/generators/utils/project.ts @@ -1,4 +1,4 @@ -import { names } from '@nrwl/devkit'; +import { names } from '@nx/devkit'; export function normalizeDirectory( appName: string, diff --git a/packages/angular/src/generators/utils/selector.ts b/packages/angular/src/generators/utils/selector.ts index ec4011af002b3b..b85fa928d35e9a 100644 --- a/packages/angular/src/generators/utils/selector.ts +++ b/packages/angular/src/generators/utils/selector.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { names, readNxJson } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { names, readNxJson } from '@nx/devkit'; export function buildSelector( tree: Tree, diff --git a/packages/angular/src/generators/utils/storybook-ast/component-info.ts b/packages/angular/src/generators/utils/storybook-ast/component-info.ts index 4c411e8a6f04b7..b60939bf3f46ca 100644 --- a/packages/angular/src/generators/utils/storybook-ast/component-info.ts +++ b/packages/angular/src/generators/utils/storybook-ast/component-info.ts @@ -4,8 +4,8 @@ import { normalizePath, Tree, visitNotIgnoredFiles, -} from '@nrwl/devkit'; -import { ensureTypescript } from '@nrwl/js/src/utils/typescript/ensure-typescript'; +} from '@nx/devkit'; +import { ensureTypescript } from '@nx/js/src/utils/typescript/ensure-typescript'; import { basename, dirname, extname, relative } from 'path'; import type { Identifier, SourceFile, Statement } from 'typescript'; import { getTsSourceFile } from '../../../utils/nx-devkit/ast-utils'; diff --git a/packages/angular/src/generators/utils/storybook-ast/entry-point.ts b/packages/angular/src/generators/utils/storybook-ast/entry-point.ts index a4c60b388118be..d422a95c745642 100644 --- a/packages/angular/src/generators/utils/storybook-ast/entry-point.ts +++ b/packages/angular/src/generators/utils/storybook-ast/entry-point.ts @@ -1,11 +1,11 @@ -import type { ProjectType, Tree } from '@nrwl/devkit'; +import type { ProjectType, Tree } from '@nx/devkit'; import { joinPathFragments, normalizePath, readJson, readProjectConfiguration, visitNotIgnoredFiles, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { basename, dirname } from 'path'; export type EntryPoint = { name: string; path: string; excludeDirs?: string[] }; diff --git a/packages/angular/src/generators/utils/storybook-ast/module-info.ts b/packages/angular/src/generators/utils/storybook-ast/module-info.ts index d1d0a9f14f40d8..53a4810375c6e1 100644 --- a/packages/angular/src/generators/utils/storybook-ast/module-info.ts +++ b/packages/angular/src/generators/utils/storybook-ast/module-info.ts @@ -1,10 +1,10 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { logger, normalizePath, stripIndents, visitNotIgnoredFiles, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { findNodes } from 'nx/src/utils/typescript'; import { extname } from 'path'; import type { @@ -15,7 +15,7 @@ import type { } from 'typescript'; import { getDecoratorMetadata } from '../../../utils/nx-devkit/ast-utils'; import type { EntryPoint } from './entry-point'; -import { ensureTypescript } from '@nrwl/js/src/utils/typescript/ensure-typescript'; +import { ensureTypescript } from '@nx/js/src/utils/typescript/ensure-typescript'; let tsModule: typeof import('typescript'); diff --git a/packages/angular/src/generators/utils/storybook-ast/storybook-inputs.ts b/packages/angular/src/generators/utils/storybook-ast/storybook-inputs.ts index 24fabadbc3833b..4b20c5f53b4ea8 100644 --- a/packages/angular/src/generators/utils/storybook-ast/storybook-inputs.ts +++ b/packages/angular/src/generators/utils/storybook-ast/storybook-inputs.ts @@ -1,9 +1,9 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { findNodes } from 'nx/src/utils/typescript'; -import { getSourceNodes } from '@nrwl/js'; +import { getSourceNodes } from '@nx/js'; import type { PropertyDeclaration } from 'typescript'; import { getTsSourceFile } from '../../../utils/nx-devkit/ast-utils'; -import { ensureTypescript } from '@nrwl/js/src/utils/typescript/ensure-typescript'; +import { ensureTypescript } from '@nx/js/src/utils/typescript/ensure-typescript'; let tsModule: typeof import('typescript'); diff --git a/packages/angular/src/generators/utils/storybook-ast/tree-utilities.ts b/packages/angular/src/generators/utils/storybook-ast/tree-utilities.ts index 53bbc3aa9726ec..da9d1775629852 100644 --- a/packages/angular/src/generators/utils/storybook-ast/tree-utilities.ts +++ b/packages/angular/src/generators/utils/storybook-ast/tree-utilities.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { joinPathFragments } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { joinPathFragments } from '@nx/devkit'; import type { Ignore } from 'ignore'; import ignore from 'ignore'; diff --git a/packages/angular/src/generators/utils/testing.ts b/packages/angular/src/generators/utils/testing.ts index 5bda8a8c66ced2..228aadc8b543a8 100644 --- a/packages/angular/src/generators/utils/testing.ts +++ b/packages/angular/src/generators/utils/testing.ts @@ -1,7 +1,7 @@ -import type { Tree } from '@nrwl/devkit'; -import { updateJson } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { Linter } from '@nrwl/linter'; +import type { Tree } from '@nx/devkit'; +import { updateJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { Linter } from '@nx/linter'; import { UnitTestRunner } from '../../utils/test-runners'; import { angularDevkitVersion } from '../../utils/versions'; import { applicationGenerator } from '../application/application'; @@ -57,7 +57,7 @@ export async function createStorybookTestWorkspaceForLib( addAngularPluginPeerDeps(tree); tree.write('.gitignore', ''); - const { wrapAngularDevkitSchematic } = require('@nrwl/devkit/ngcli-adapter'); + const { wrapAngularDevkitSchematic } = require('@nx/devkit/ngcli-adapter'); const moduleGenerator = wrapAngularDevkitSchematic( '@schematics/angular', 'module' diff --git a/packages/angular/src/generators/utils/validations.ts b/packages/angular/src/generators/utils/validations.ts index 4495aab5165cb8..2462e0681579a6 100644 --- a/packages/angular/src/generators/utils/validations.ts +++ b/packages/angular/src/generators/utils/validations.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { getProjects, stripIndents } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { getProjects, stripIndents } from '@nx/devkit'; import { lt } from 'semver'; import { getInstalledAngularVersionInfo } from './version-utils'; diff --git a/packages/angular/src/generators/utils/version-utils.spec.ts b/packages/angular/src/generators/utils/version-utils.spec.ts index 6d43be89378f36..843bf29b66e020 100644 --- a/packages/angular/src/generators/utils/version-utils.spec.ts +++ b/packages/angular/src/generators/utils/version-utils.spec.ts @@ -1,5 +1,5 @@ -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { updateJson } from '@nrwl/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { updateJson } from '@nx/devkit'; import { getGeneratorDirectoryForInstalledAngularVersion, getInstalledAngularMajorVersion, diff --git a/packages/angular/src/generators/utils/version-utils.ts b/packages/angular/src/generators/utils/version-utils.ts index b571acb3c3414c..62dba355da5f07 100644 --- a/packages/angular/src/generators/utils/version-utils.ts +++ b/packages/angular/src/generators/utils/version-utils.ts @@ -1,5 +1,5 @@ -import type { GeneratorCallback, Tree } from '@nrwl/devkit'; -import { addDependenciesToPackageJson, readJson } from '@nrwl/devkit'; +import type { GeneratorCallback, Tree } from '@nx/devkit'; +import { addDependenciesToPackageJson, readJson } from '@nx/devkit'; import { clean, coerce, major } from 'semver'; import * as latestVersions from '../../utils/versions'; import { angularVersion } from '../../utils/versions'; diff --git a/packages/angular/src/generators/web-worker/compat.ts b/packages/angular/src/generators/web-worker/compat.ts index 6e74e6361f49f2..b2a38e1e72bd25 100644 --- a/packages/angular/src/generators/web-worker/compat.ts +++ b/packages/angular/src/generators/web-worker/compat.ts @@ -1,4 +1,4 @@ -import { convertNxGenerator } from '@nrwl/devkit'; +import { convertNxGenerator } from '@nx/devkit'; import { warnForSchematicUsage } from '../utils/warn-for-schematic-usage'; import { webWorkerGenerator } from './web-worker'; diff --git a/packages/angular/src/generators/web-worker/lib/add-snippet.ts b/packages/angular/src/generators/web-worker/lib/add-snippet.ts index c6efc96834e77e..dd0cfe617ee646 100644 --- a/packages/angular/src/generators/web-worker/lib/add-snippet.ts +++ b/packages/angular/src/generators/web-worker/lib/add-snippet.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { joinPathFragments, stripIndents } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { joinPathFragments, stripIndents } from '@nx/devkit'; export function addSnippet(tree: Tree, name: string, path: string) { const fileRegExp = new RegExp(`^${name}.*\\.ts`); diff --git a/packages/angular/src/generators/web-worker/lib/normalize-options.ts b/packages/angular/src/generators/web-worker/lib/normalize-options.ts index 7ef236bba8a366..cb26f1920ada82 100644 --- a/packages/angular/src/generators/web-worker/lib/normalize-options.ts +++ b/packages/angular/src/generators/web-worker/lib/normalize-options.ts @@ -1,10 +1,10 @@ import type { WebWorkerGeneratorOptions } from '../schema'; -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { getProjects, joinPathFragments, readProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; export function normalizeOptions( tree: Tree, diff --git a/packages/angular/src/generators/web-worker/web-worker.spec.ts b/packages/angular/src/generators/web-worker/web-worker.spec.ts index 4f3bee40849a29..b89383d7825cdc 100644 --- a/packages/angular/src/generators/web-worker/web-worker.spec.ts +++ b/packages/angular/src/generators/web-worker/web-worker.spec.ts @@ -1,6 +1,6 @@ -import type { Tree } from '@nrwl/devkit'; -import * as devkit from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import type { Tree } from '@nx/devkit'; +import * as devkit from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { generateTestApplication } from '../utils/testing'; import { webWorkerGenerator } from './web-worker'; diff --git a/packages/angular/src/generators/web-worker/web-worker.ts b/packages/angular/src/generators/web-worker/web-worker.ts index 7c18ed96df9d80..a1ac000a032b99 100644 --- a/packages/angular/src/generators/web-worker/web-worker.ts +++ b/packages/angular/src/generators/web-worker/web-worker.ts @@ -1,4 +1,4 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { formatFiles, generateFiles, @@ -7,10 +7,10 @@ import { offsetFromRoot, readProjectConfiguration, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { addSnippet, normalizeOptions } from './lib'; import type { WebWorkerGeneratorOptions } from './schema'; -import { getRelativePathToRootTsConfig } from '@nrwl/js'; +import { getRelativePathToRootTsConfig } from '@nx/js'; export async function webWorkerGenerator( tree: Tree, diff --git a/packages/angular/src/migrations/update-14-2-0/remove-show-circular-dependencies-option.spec.ts b/packages/angular/src/migrations/update-14-2-0/remove-show-circular-dependencies-option.spec.ts index 2732c1b43da89a..642202d14898be 100644 --- a/packages/angular/src/migrations/update-14-2-0/remove-show-circular-dependencies-option.spec.ts +++ b/packages/angular/src/migrations/update-14-2-0/remove-show-circular-dependencies-option.spec.ts @@ -2,8 +2,8 @@ import { addProjectConfiguration, readProjectConfiguration, Tree, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import removeShowCircularDependencies from './remove-show-circular-dependencies-option'; describe('remove-show-circular-dependencies-option migration', () => { diff --git a/packages/angular/src/migrations/update-14-2-0/remove-show-circular-dependencies-option.ts b/packages/angular/src/migrations/update-14-2-0/remove-show-circular-dependencies-option.ts index 28d929849540dc..ae3488984abeb4 100644 --- a/packages/angular/src/migrations/update-14-2-0/remove-show-circular-dependencies-option.ts +++ b/packages/angular/src/migrations/update-14-2-0/remove-show-circular-dependencies-option.ts @@ -3,8 +3,8 @@ import { readProjectConfiguration, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; +} from '@nx/devkit'; +import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils'; const executors = [ '@angular-devkit/build-angular:browser', diff --git a/packages/angular/src/migrations/update-14-2-0/update-angular-cli.spec.ts b/packages/angular/src/migrations/update-14-2-0/update-angular-cli.spec.ts index b7e47dd8c07d46..dd589bdd109777 100644 --- a/packages/angular/src/migrations/update-14-2-0/update-angular-cli.spec.ts +++ b/packages/angular/src/migrations/update-14-2-0/update-angular-cli.spec.ts @@ -1,5 +1,5 @@ -import { readJson, Tree, writeJson } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { readJson, Tree, writeJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import updateAngularCli from './update-angular-cli'; describe('update-angular-cli migration', () => { diff --git a/packages/angular/src/migrations/update-14-2-0/update-angular-cli.ts b/packages/angular/src/migrations/update-14-2-0/update-angular-cli.ts index 3c014560eea703..c6570aba80f408 100644 --- a/packages/angular/src/migrations/update-14-2-0/update-angular-cli.ts +++ b/packages/angular/src/migrations/update-14-2-0/update-angular-cli.ts @@ -1,4 +1,4 @@ -import { formatFiles, Tree, updateJson } from '@nrwl/devkit'; +import { formatFiles, Tree, updateJson } from '@nx/devkit'; const angularCliVersion = '~14.0.0'; diff --git a/packages/angular/src/migrations/update-14-2-0/update-libraries-secondary-entrypoints.spec.ts b/packages/angular/src/migrations/update-14-2-0/update-libraries-secondary-entrypoints.spec.ts index 3c50ec68d63386..312b412e69b900 100644 --- a/packages/angular/src/migrations/update-14-2-0/update-libraries-secondary-entrypoints.spec.ts +++ b/packages/angular/src/migrations/update-14-2-0/update-libraries-secondary-entrypoints.spec.ts @@ -1,10 +1,5 @@ -import { - addProjectConfiguration, - readJson, - Tree, - writeJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { addProjectConfiguration, readJson, Tree, writeJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import updateLibrariesSecondaryEntrypoints from './update-libraries-secondary-entrypoints'; const libraryExecutors = [ diff --git a/packages/angular/src/migrations/update-14-2-0/update-libraries-secondary-entrypoints.ts b/packages/angular/src/migrations/update-14-2-0/update-libraries-secondary-entrypoints.ts index 22fbcb7346a6f4..e3345595159580 100644 --- a/packages/angular/src/migrations/update-14-2-0/update-libraries-secondary-entrypoints.ts +++ b/packages/angular/src/migrations/update-14-2-0/update-libraries-secondary-entrypoints.ts @@ -7,7 +7,7 @@ import { Tree, visitNotIgnoredFiles, writeJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { basename, dirname } from 'path'; const libraryExecutors = [ diff --git a/packages/angular/src/migrations/update-14-2-0/update-ngcc-target.spec.ts b/packages/angular/src/migrations/update-14-2-0/update-ngcc-target.spec.ts index 4c1a59684002e8..8f31e6454e0ae5 100644 --- a/packages/angular/src/migrations/update-14-2-0/update-ngcc-target.spec.ts +++ b/packages/angular/src/migrations/update-14-2-0/update-ngcc-target.spec.ts @@ -1,5 +1,5 @@ -import { readJson } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { readJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import updateNgccTarget from './update-ngcc-target'; describe('update-ngcc-postinstall-target migration', () => { diff --git a/packages/angular/src/migrations/update-14-2-0/update-ngcc-target.ts b/packages/angular/src/migrations/update-14-2-0/update-ngcc-target.ts index 5b0da1ecbe0f3d..0ea6ba1c934ba9 100644 --- a/packages/angular/src/migrations/update-14-2-0/update-ngcc-target.ts +++ b/packages/angular/src/migrations/update-14-2-0/update-ngcc-target.ts @@ -1,4 +1,4 @@ -import { formatFiles, Tree, updateJson } from '@nrwl/devkit'; +import { formatFiles, Tree, updateJson } from '@nx/devkit'; export default async function (tree: Tree) { let shouldFormat = false; diff --git a/packages/angular/src/migrations/update-14-2-0/update-router-initial-navigation.spec.ts b/packages/angular/src/migrations/update-14-2-0/update-router-initial-navigation.spec.ts index 98677ac14410c7..4de0f6ded383d8 100644 --- a/packages/angular/src/migrations/update-14-2-0/update-router-initial-navigation.spec.ts +++ b/packages/angular/src/migrations/update-14-2-0/update-router-initial-navigation.spec.ts @@ -3,13 +3,13 @@ import { DependencyType, ProjectGraph, Tree, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import updateRouterInitialNavigation from './update-router-initial-navigation'; let projectGraph: ProjectGraph; -jest.mock('@nrwl/devkit', () => ({ - ...jest.requireActual('@nrwl/devkit'), +jest.mock('@nx/devkit', () => ({ + ...jest.requireActual('@nx/devkit'), createProjectGraphAsync: jest .fn() .mockImplementation(async () => projectGraph), diff --git a/packages/angular/src/migrations/update-14-2-0/update-router-initial-navigation.ts b/packages/angular/src/migrations/update-14-2-0/update-router-initial-navigation.ts index 5daf5d3322571f..29ffe22764b046 100644 --- a/packages/angular/src/migrations/update-14-2-0/update-router-initial-navigation.ts +++ b/packages/angular/src/migrations/update-14-2-0/update-router-initial-navigation.ts @@ -1,10 +1,10 @@ -import type { ProjectConfiguration, Tree } from '@nrwl/devkit'; +import type { ProjectConfiguration, Tree } from '@nx/devkit'; import { createProjectGraphAsync, formatFiles, readProjectConfiguration, visitNotIgnoredFiles, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { tsquery } from '@phenomnomnominal/tsquery'; import type { CallExpression, diff --git a/packages/angular/src/migrations/update-14-2-0/update-tsconfig-target.spec.ts b/packages/angular/src/migrations/update-14-2-0/update-tsconfig-target.spec.ts index de4cc48d9560f6..2f5feb0f92a8a0 100644 --- a/packages/angular/src/migrations/update-14-2-0/update-tsconfig-target.spec.ts +++ b/packages/angular/src/migrations/update-14-2-0/update-tsconfig-target.spec.ts @@ -1,16 +1,16 @@ -import { logger, ProjectGraph, Tree } from '@nrwl/devkit'; +import { logger, ProjectGraph, Tree } from '@nx/devkit'; import { addProjectConfiguration, DependencyType, readJson, writeJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import updateTsConfigTarget from './update-tsconfig-target'; let projectGraph: ProjectGraph; -jest.mock('@nrwl/devkit', () => ({ - ...jest.requireActual('@nrwl/devkit'), +jest.mock('@nx/devkit', () => ({ + ...jest.requireActual('@nx/devkit'), createProjectGraphAsync: jest .fn() .mockImplementation(async () => projectGraph), diff --git a/packages/angular/src/migrations/update-14-2-0/update-tsconfig-target.ts b/packages/angular/src/migrations/update-14-2-0/update-tsconfig-target.ts index 7b81307965d73f..f8b746330151d2 100644 --- a/packages/angular/src/migrations/update-14-2-0/update-tsconfig-target.ts +++ b/packages/angular/src/migrations/update-14-2-0/update-tsconfig-target.ts @@ -3,7 +3,7 @@ import { readJson, TargetConfiguration, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { createProjectGraphAsync, formatFiles, @@ -11,7 +11,7 @@ import { logger, readProjectConfiguration, updateJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { tsquery } from '@phenomnomnominal/tsquery'; import { dirname } from 'path'; import type { StringLiteral } from 'typescript'; diff --git a/packages/angular/src/migrations/update-14-5-0/migrate-mfe-to-mf.spec.ts b/packages/angular/src/migrations/update-14-5-0/migrate-mfe-to-mf.spec.ts index f0bcc2a79243b7..892e1fcf8401f7 100644 --- a/packages/angular/src/migrations/update-14-5-0/migrate-mfe-to-mf.spec.ts +++ b/packages/angular/src/migrations/update-14-5-0/migrate-mfe-to-mf.spec.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import type { Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import migrateMfeToMf, { renameSetupMfeGeneratorUsages, diff --git a/packages/angular/src/migrations/update-14-5-0/migrate-mfe-to-mf.ts b/packages/angular/src/migrations/update-14-5-0/migrate-mfe-to-mf.ts index ce27504ee2558d..4657c292acdc44 100644 --- a/packages/angular/src/migrations/update-14-5-0/migrate-mfe-to-mf.ts +++ b/packages/angular/src/migrations/update-14-5-0/migrate-mfe-to-mf.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { visitNotIgnoredFiles } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { visitNotIgnoredFiles } from '@nx/devkit'; import { extname } from 'path'; import { tsquery } from '@phenomnomnominal/tsquery'; import { SourceFile } from 'typescript'; diff --git a/packages/angular/src/migrations/update-14-5-2/update-angular-cli.spec.ts b/packages/angular/src/migrations/update-14-5-2/update-angular-cli.spec.ts index 07ed8916c6fd8b..d042bb045c5d42 100644 --- a/packages/angular/src/migrations/update-14-5-2/update-angular-cli.spec.ts +++ b/packages/angular/src/migrations/update-14-5-2/update-angular-cli.spec.ts @@ -1,5 +1,5 @@ -import { readJson, Tree, writeJson } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { readJson, Tree, writeJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import updateAngularCli from './update-angular-cli'; describe('update-angular-cli migration', () => { diff --git a/packages/angular/src/migrations/update-14-5-2/update-angular-cli.ts b/packages/angular/src/migrations/update-14-5-2/update-angular-cli.ts index d7f74fe76ac989..37fdcc1baf6e43 100644 --- a/packages/angular/src/migrations/update-14-5-2/update-angular-cli.ts +++ b/packages/angular/src/migrations/update-14-5-2/update-angular-cli.ts @@ -1,4 +1,4 @@ -import { formatFiles, Tree, updateJson } from '@nrwl/devkit'; +import { formatFiles, Tree, updateJson } from '@nx/devkit'; const angularCliVersion = '~14.1.0'; diff --git a/packages/angular/src/migrations/update-14-6-0/update-angular-cli.spec.ts b/packages/angular/src/migrations/update-14-6-0/update-angular-cli.spec.ts index 9ec7ec99530d58..f491b23a0b5c57 100644 --- a/packages/angular/src/migrations/update-14-6-0/update-angular-cli.spec.ts +++ b/packages/angular/src/migrations/update-14-6-0/update-angular-cli.spec.ts @@ -1,5 +1,5 @@ -import { readJson, Tree, writeJson } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { readJson, Tree, writeJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import updateAngularCli from './update-angular-cli'; describe('update-angular-cli migration', () => { diff --git a/packages/angular/src/migrations/update-14-6-0/update-angular-cli.ts b/packages/angular/src/migrations/update-14-6-0/update-angular-cli.ts index fbf66bced992d7..9773a3f5599ce4 100644 --- a/packages/angular/src/migrations/update-14-6-0/update-angular-cli.ts +++ b/packages/angular/src/migrations/update-14-6-0/update-angular-cli.ts @@ -1,4 +1,4 @@ -import { formatFiles, Tree, updateJson } from '@nrwl/devkit'; +import { formatFiles, Tree, updateJson } from '@nx/devkit'; const angularCliVersion = '~14.2.0'; diff --git a/packages/angular/src/migrations/update-14-8-0/rename-webpack-server.spec.ts b/packages/angular/src/migrations/update-14-8-0/rename-webpack-server.spec.ts index 73a56a73018db5..10c32714c6cb0f 100644 --- a/packages/angular/src/migrations/update-14-8-0/rename-webpack-server.spec.ts +++ b/packages/angular/src/migrations/update-14-8-0/rename-webpack-server.spec.ts @@ -1,5 +1,5 @@ -import { readJson, updateJson } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { readJson, updateJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { generateTestRemoteApplication } from '../../generators/utils/testing'; import renameWebpackServer from './rename-webpack-server'; diff --git a/packages/angular/src/migrations/update-14-8-0/rename-webpack-server.ts b/packages/angular/src/migrations/update-14-8-0/rename-webpack-server.ts index 86dae9fa2230af..c03441d3fd2203 100644 --- a/packages/angular/src/migrations/update-14-8-0/rename-webpack-server.ts +++ b/packages/angular/src/migrations/update-14-8-0/rename-webpack-server.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { getProjects, updateProjectConfiguration } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { getProjects, updateProjectConfiguration } from '@nx/devkit'; export default function renameWebpackServer(tree: Tree) { const projects = getProjects(tree); diff --git a/packages/angular/src/migrations/update-15-0-0/add-karma-inputs.spec.ts b/packages/angular/src/migrations/update-15-0-0/add-karma-inputs.spec.ts index dca45a9f49bdd1..2f2e950590adf8 100644 --- a/packages/angular/src/migrations/update-15-0-0/add-karma-inputs.spec.ts +++ b/packages/angular/src/migrations/update-15-0-0/add-karma-inputs.spec.ts @@ -1,10 +1,10 @@ -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { addProjectConfiguration, readNxJson, Tree, updateNxJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import addKarmaInputs from './add-karma-inputs'; describe('15.0.0 migration (add-karma-inputs)', () => { diff --git a/packages/angular/src/migrations/update-15-0-0/add-karma-inputs.ts b/packages/angular/src/migrations/update-15-0-0/add-karma-inputs.ts index 82b585e0b24d27..c25ded318a5031 100644 --- a/packages/angular/src/migrations/update-15-0-0/add-karma-inputs.ts +++ b/packages/angular/src/migrations/update-15-0-0/add-karma-inputs.ts @@ -1,5 +1,5 @@ -import { formatFiles, readNxJson, Tree, updateNxJson } from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; +import { formatFiles, readNxJson, Tree, updateNxJson } from '@nx/devkit'; +import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils'; export default async function (tree: Tree) { const nxJson = readNxJson(tree); diff --git a/packages/angular/src/migrations/update-15-0-0/switch-to-jasmine-marbles.spec.ts b/packages/angular/src/migrations/update-15-0-0/switch-to-jasmine-marbles.spec.ts index 99ea07cf6c89e6..5a6ee6aea60ec5 100644 --- a/packages/angular/src/migrations/update-15-0-0/switch-to-jasmine-marbles.spec.ts +++ b/packages/angular/src/migrations/update-15-0-0/switch-to-jasmine-marbles.spec.ts @@ -1,16 +1,16 @@ import switchToJasmineMarbles from './switch-to-jasmine-marbles'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { addProjectConfiguration, DependencyType, ProjectGraph, readJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { jasmineMarblesVersion } from '../../utils/versions'; let projectGraph: ProjectGraph; -jest.mock('@nrwl/devkit', () => ({ - ...jest.requireActual('@nrwl/devkit'), +jest.mock('@nx/devkit', () => ({ + ...jest.requireActual('@nx/devkit'), readCachedProjectGraph: jest.fn().mockImplementation(() => projectGraph), createProjectGraphAsync: jest .fn() diff --git a/packages/angular/src/migrations/update-15-0-0/switch-to-jasmine-marbles.ts b/packages/angular/src/migrations/update-15-0-0/switch-to-jasmine-marbles.ts index fff06ec20d4767..65fc6f140f61cd 100644 --- a/packages/angular/src/migrations/update-15-0-0/switch-to-jasmine-marbles.ts +++ b/packages/angular/src/migrations/update-15-0-0/switch-to-jasmine-marbles.ts @@ -1,4 +1,4 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { addDependenciesToPackageJson, createProjectGraphAsync, @@ -6,7 +6,7 @@ import { readJson, readProjectConfiguration, visitNotIgnoredFiles, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { extname } from 'path'; import { tsquery } from '@phenomnomnominal/tsquery'; import { jasmineMarblesVersion } from '../../utils/versions'; diff --git a/packages/angular/src/migrations/update-15-2-0/remove-browserlist-config.spec.ts b/packages/angular/src/migrations/update-15-2-0/remove-browserlist-config.spec.ts index 264803ea96558b..539fb50df03bd1 100644 --- a/packages/angular/src/migrations/update-15-2-0/remove-browserlist-config.spec.ts +++ b/packages/angular/src/migrations/update-15-2-0/remove-browserlist-config.spec.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import type { Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { generateTestApplication } from '../../generators/utils/testing'; import removeBrowserlistConfig, { DEFAULT_BROWSERS, diff --git a/packages/angular/src/migrations/update-15-2-0/remove-browserlist-config.ts b/packages/angular/src/migrations/update-15-2-0/remove-browserlist-config.ts index 786873c58f0ea3..f24952a52dcd52 100644 --- a/packages/angular/src/migrations/update-15-2-0/remove-browserlist-config.ts +++ b/packages/angular/src/migrations/update-15-2-0/remove-browserlist-config.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { logger, visitNotIgnoredFiles } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { logger, visitNotIgnoredFiles } from '@nx/devkit'; import { basename } from 'path'; const validBrowserslistConfigFilenames = new Set([ diff --git a/packages/angular/src/migrations/update-15-2-0/remove-platform-server-exports.spec.ts b/packages/angular/src/migrations/update-15-2-0/remove-platform-server-exports.spec.ts index c59fbe02669a69..fee53ae4fadd05 100644 --- a/packages/angular/src/migrations/update-15-2-0/remove-platform-server-exports.spec.ts +++ b/packages/angular/src/migrations/update-15-2-0/remove-platform-server-exports.spec.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing-pre16'; +import type { Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing-pre16'; import removePlatformServerExports from './remove-platform-server-exports'; diff --git a/packages/angular/src/migrations/update-15-2-0/remove-platform-server-exports.ts b/packages/angular/src/migrations/update-15-2-0/remove-platform-server-exports.ts index a168f17d25e132..60bcf1f813863d 100644 --- a/packages/angular/src/migrations/update-15-2-0/remove-platform-server-exports.ts +++ b/packages/angular/src/migrations/update-15-2-0/remove-platform-server-exports.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { formatFiles, visitNotIgnoredFiles } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { formatFiles, visitNotIgnoredFiles } from '@nx/devkit'; import * as ts from 'typescript'; import { FileChangeRecorder } from '../../utils/file-change-recorder'; diff --git a/packages/angular/src/migrations/update-15-2-0/update-angular-cli.spec.ts b/packages/angular/src/migrations/update-15-2-0/update-angular-cli.spec.ts index 16440fc99ea25f..daddd024060964 100644 --- a/packages/angular/src/migrations/update-15-2-0/update-angular-cli.spec.ts +++ b/packages/angular/src/migrations/update-15-2-0/update-angular-cli.spec.ts @@ -1,5 +1,5 @@ -import { readJson, Tree, writeJson } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { readJson, Tree, writeJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import updateAngularCli from './update-angular-cli'; describe('update-angular-cli migration', () => { diff --git a/packages/angular/src/migrations/update-15-2-0/update-angular-cli.ts b/packages/angular/src/migrations/update-15-2-0/update-angular-cli.ts index 5fedbe906a254e..e5bcb07c940021 100644 --- a/packages/angular/src/migrations/update-15-2-0/update-angular-cli.ts +++ b/packages/angular/src/migrations/update-15-2-0/update-angular-cli.ts @@ -1,4 +1,4 @@ -import { formatFiles, Tree, updateJson } from '@nrwl/devkit'; +import { formatFiles, Tree, updateJson } from '@nx/devkit'; const angularCliVersion = '~15.0.0'; diff --git a/packages/angular/src/migrations/update-15-2-0/update-karma-main-file.spec.ts b/packages/angular/src/migrations/update-15-2-0/update-karma-main-file.spec.ts index 0b89fb82ade162..aa003a5138ee62 100644 --- a/packages/angular/src/migrations/update-15-2-0/update-karma-main-file.spec.ts +++ b/packages/angular/src/migrations/update-15-2-0/update-karma-main-file.spec.ts @@ -1,6 +1,6 @@ -import type { Tree } from '@nrwl/devkit'; -import { addProjectConfiguration, stripIndents } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing-pre16'; +import type { Tree } from '@nx/devkit'; +import { addProjectConfiguration, stripIndents } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing-pre16'; import { Builders } from '@schematics/angular/utility/workspace-models'; import updateKarmaMainFile from './update-karma-main-file'; diff --git a/packages/angular/src/migrations/update-15-2-0/update-karma-main-file.ts b/packages/angular/src/migrations/update-15-2-0/update-karma-main-file.ts index 115c0709047df8..3d83eb085759f0 100644 --- a/packages/angular/src/migrations/update-15-2-0/update-karma-main-file.ts +++ b/packages/angular/src/migrations/update-15-2-0/update-karma-main-file.ts @@ -1,8 +1,8 @@ -import type { Tree } from '@nrwl/devkit'; -import { formatFiles } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { formatFiles } from '@nx/devkit'; import * as ts from 'typescript'; import { Builders } from '@schematics/angular/utility/workspace-models'; -import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; +import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils'; import { FileChangeRecorder } from '../../utils/file-change-recorder'; export default async function (tree: Tree) { diff --git a/packages/angular/src/migrations/update-15-2-0/update-typescript-target.spec.ts b/packages/angular/src/migrations/update-15-2-0/update-typescript-target.spec.ts index 03f10318fb6a11..9c0706dd9d2ffb 100644 --- a/packages/angular/src/migrations/update-15-2-0/update-typescript-target.spec.ts +++ b/packages/angular/src/migrations/update-15-2-0/update-typescript-target.spec.ts @@ -4,8 +4,8 @@ import { Tree, updateProjectConfiguration, writeJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { generateTestApplication } from '../../generators/utils/testing'; import { UnitTestRunner } from '../../utils/test-runners'; import updateTypescriptTarget from './update-typescript-target'; diff --git a/packages/angular/src/migrations/update-15-2-0/update-typescript-target.ts b/packages/angular/src/migrations/update-15-2-0/update-typescript-target.ts index 0ad1a0eb8254fc..df5af01ce3cceb 100644 --- a/packages/angular/src/migrations/update-15-2-0/update-typescript-target.ts +++ b/packages/angular/src/migrations/update-15-2-0/update-typescript-target.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { formatFiles, getProjects, updateJson } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { formatFiles, getProjects, updateJson } from '@nx/devkit'; import { Builders } from '@schematics/angular/utility/workspace-models'; function updateTarget(tree: Tree, tsconfigPath: string) { diff --git a/packages/angular/src/migrations/update-15-2-0/update-workspace-config.spec.ts b/packages/angular/src/migrations/update-15-2-0/update-workspace-config.spec.ts index 0be6aaf2597e7f..39dd53c8e1b01a 100644 --- a/packages/angular/src/migrations/update-15-2-0/update-workspace-config.spec.ts +++ b/packages/angular/src/migrations/update-15-2-0/update-workspace-config.spec.ts @@ -1,4 +1,4 @@ -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { Builders } from '@schematics/angular/utility/workspace-models'; import { readProjectConfiguration, diff --git a/packages/angular/src/migrations/update-15-2-0/update-workspace-config.ts b/packages/angular/src/migrations/update-15-2-0/update-workspace-config.ts index af34682f7bc6d9..f36561a11fdec4 100644 --- a/packages/angular/src/migrations/update-15-2-0/update-workspace-config.ts +++ b/packages/angular/src/migrations/update-15-2-0/update-workspace-config.ts @@ -1,9 +1,9 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { formatFiles, getProjects, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { Builders } from '@schematics/angular/utility/workspace-models'; export default async function updateWorkspaceConfigurations(tree: Tree) { diff --git a/packages/angular/src/migrations/update-15-5-0/update-angular-cli.spec.ts b/packages/angular/src/migrations/update-15-5-0/update-angular-cli.spec.ts index 4d0d00bab6b13c..d6411b0c6e560e 100644 --- a/packages/angular/src/migrations/update-15-5-0/update-angular-cli.spec.ts +++ b/packages/angular/src/migrations/update-15-5-0/update-angular-cli.spec.ts @@ -1,5 +1,5 @@ -import { readJson, Tree, writeJson } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { readJson, Tree, writeJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import updateAngularCli from './update-angular-cli'; describe('update-angular-cli migration', () => { diff --git a/packages/angular/src/migrations/update-15-5-0/update-angular-cli.ts b/packages/angular/src/migrations/update-15-5-0/update-angular-cli.ts index 854d66f58dd77e..63b5f37a725c01 100644 --- a/packages/angular/src/migrations/update-15-5-0/update-angular-cli.ts +++ b/packages/angular/src/migrations/update-15-5-0/update-angular-cli.ts @@ -1,4 +1,4 @@ -import { formatFiles, Tree, updateJson } from '@nrwl/devkit'; +import { formatFiles, Tree, updateJson } from '@nx/devkit'; const angularCliVersion = '~15.1.0'; diff --git a/packages/angular/src/migrations/update-15-7-0/install-required-packages.spec.ts b/packages/angular/src/migrations/update-15-7-0/install-required-packages.spec.ts index 240f508f8f9204..b19a3ca2b7909f 100644 --- a/packages/angular/src/migrations/update-15-7-0/install-required-packages.spec.ts +++ b/packages/angular/src/migrations/update-15-7-0/install-required-packages.spec.ts @@ -1,13 +1,13 @@ // mock stuff that relies or make changes to the filesystem jest.mock('child_process'); -jest.mock('@nrwl/devkit', () => ({ - ...jest.requireActual('@nrwl/devkit'), +jest.mock('@nx/devkit', () => ({ + ...jest.requireActual('@nx/devkit'), getPackageManagerCommand: jest.fn(() => ({ install: '' })), writeJsonFile: jest.fn(), })); -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { readJson, updateJson } from '@nrwl/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { readJson, updateJson } from '@nx/devkit'; import installRequiredPackages from './install-required-packages'; describe('installed-required-packages', () => { diff --git a/packages/angular/src/migrations/update-15-7-0/install-required-packages.ts b/packages/angular/src/migrations/update-15-7-0/install-required-packages.ts index b7588f76350266..07307a66a79d08 100644 --- a/packages/angular/src/migrations/update-15-7-0/install-required-packages.ts +++ b/packages/angular/src/migrations/update-15-7-0/install-required-packages.ts @@ -1,10 +1,10 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { addDependenciesToPackageJson, getPackageManagerCommand, readJson, writeJsonFile, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { execSync } from 'child_process'; import { join } from 'path'; import { getInstalledAngularMajorVersion } from '../../generators/utils/version-utils'; diff --git a/packages/angular/src/migrations/update-15-8-0/update-angular-cli.spec.ts b/packages/angular/src/migrations/update-15-8-0/update-angular-cli.spec.ts index 413b58a3bbf1ec..9bfe9217739c94 100644 --- a/packages/angular/src/migrations/update-15-8-0/update-angular-cli.spec.ts +++ b/packages/angular/src/migrations/update-15-8-0/update-angular-cli.spec.ts @@ -1,5 +1,5 @@ -import { readJson, Tree, writeJson } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { readJson, Tree, writeJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import updateAngularCli from './update-angular-cli'; describe('update-angular-cli migration', () => { diff --git a/packages/angular/src/migrations/update-15-8-0/update-angular-cli.ts b/packages/angular/src/migrations/update-15-8-0/update-angular-cli.ts index d61acd497f7011..ecdc3ce12ad3ea 100644 --- a/packages/angular/src/migrations/update-15-8-0/update-angular-cli.ts +++ b/packages/angular/src/migrations/update-15-8-0/update-angular-cli.ts @@ -1,4 +1,4 @@ -import { formatFiles, Tree, updateJson } from '@nrwl/devkit'; +import { formatFiles, Tree, updateJson } from '@nx/devkit'; const angularCliVersion = '~15.2.0'; diff --git a/packages/angular/src/migrations/update-15-9-0/update-file-server-executor.spec.ts b/packages/angular/src/migrations/update-15-9-0/update-file-server-executor.spec.ts index 83cf4f5ad11f3d..cf95d0dfb8f05a 100644 --- a/packages/angular/src/migrations/update-15-9-0/update-file-server-executor.spec.ts +++ b/packages/angular/src/migrations/update-15-9-0/update-file-server-executor.spec.ts @@ -4,8 +4,8 @@ import { readNxJson, readProjectConfiguration, updateNxJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import updateFileServerExecutor from './update-file-server-executor'; describe('updateFileServerExecutor', () => { diff --git a/packages/angular/src/migrations/update-15-9-0/update-file-server-executor.ts b/packages/angular/src/migrations/update-15-9-0/update-file-server-executor.ts index b48f9000b5a827..9c20720919cd78 100644 --- a/packages/angular/src/migrations/update-15-9-0/update-file-server-executor.ts +++ b/packages/angular/src/migrations/update-15-9-0/update-file-server-executor.ts @@ -1,4 +1,4 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { addDependenciesToPackageJson, formatFiles, @@ -6,7 +6,7 @@ import { readNxJson, updateNxJson, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { nxVersion } from '../../utils/versions'; export default async function updateFileServerExecutor(tree: Tree) { diff --git a/packages/angular/src/migrations/update-15-9-0/update-testing-tsconfig.spec.ts b/packages/angular/src/migrations/update-15-9-0/update-testing-tsconfig.spec.ts index 649aa14e7f4dd6..7f11ed3a1d9f0c 100644 --- a/packages/angular/src/migrations/update-15-9-0/update-testing-tsconfig.spec.ts +++ b/packages/angular/src/migrations/update-15-9-0/update-testing-tsconfig.spec.ts @@ -4,7 +4,7 @@ import { readProjectConfiguration, Tree, updateJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from 'nx/src/devkit-testing-exports'; import { generateTestApplication, @@ -13,8 +13,8 @@ import { import { updateTestingTsconfigForJest } from './update-testing-tsconfig'; let projectGraph: ProjectGraph; -jest.mock('@nrwl/devkit', () => ({ - ...jest.requireActual('@nrwl/devkit'), +jest.mock('@nx/devkit', () => ({ + ...jest.requireActual('@nx/devkit'), createProjectGraphAsync: jest.fn().mockImplementation(async () => { return projectGraph; }), diff --git a/packages/angular/src/migrations/update-15-9-0/update-testing-tsconfig.ts b/packages/angular/src/migrations/update-15-9-0/update-testing-tsconfig.ts index ff48b0d92cfc3a..aa0d01c5e29ba7 100644 --- a/packages/angular/src/migrations/update-15-9-0/update-testing-tsconfig.ts +++ b/packages/angular/src/migrations/update-15-9-0/update-testing-tsconfig.ts @@ -5,9 +5,9 @@ import { joinPathFragments, Tree, updateJson, -} from '@nrwl/devkit'; -import { forEachExecutorOptionsInGraph } from '@nrwl/devkit/src/generators/executor-options-utils'; -import type { JestExecutorOptions } from '@nrwl/jest/src/executors/jest/schema'; +} from '@nx/devkit'; +import { forEachExecutorOptionsInGraph } from '@nx/devkit/src/generators/executor-options-utils'; +import type { JestExecutorOptions } from '@nx/jest/src/executors/jest/schema'; export async function updateTestingTsconfigForJest(tree: Tree) { const graph = await createProjectGraphAsync(); diff --git a/packages/angular/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts b/packages/angular/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts new file mode 100644 index 00000000000000..8b5081a72e2bf7 --- /dev/null +++ b/packages/angular/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts @@ -0,0 +1,37 @@ +import { Tree, readJson, updateJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import replacePackage from './update-16-0-0-add-nx-packages'; + +describe('update-16-0-0-add-nx-packages', () => { + let tree: Tree; + beforeEach(() => { + tree = createTreeWithEmptyWorkspace(); + + updateJson(tree, 'package.json', (json) => { + json.devDependencies['@nrwl/angular'] = '16.0.0'; + return json; + }); + }); + + it('should remove the dependency on @nrwl/angular', async () => { + await replacePackage(tree); + + expect( + readJson(tree, 'package.json').dependencies['@nrwl/angular'] + ).not.toBeDefined(); + expect( + readJson(tree, 'package.json').devDependencies['@nrwl/angular'] + ).not.toBeDefined(); + }); + + it('should add a dependency on @nx/angular', async () => { + await replacePackage(tree); + + const packageJson = readJson(tree, 'package.json'); + const newDependencyVersion = + packageJson.devDependencies['@nx/angular'] ?? + packageJson.dependencies['@nx/angular']; + + expect(newDependencyVersion).toBeDefined(); + }); +}); diff --git a/packages/angular/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts b/packages/angular/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts new file mode 100644 index 00000000000000..f1234743d157a3 --- /dev/null +++ b/packages/angular/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts @@ -0,0 +1,8 @@ +import { Tree, formatFiles } from '@nx/devkit'; +import { replaceNrwlPackageWithNxPackage } from '@nx/devkit/src/utils/replace-package'; + +export default async function replacePackage(tree: Tree): Promise { + await replaceNrwlPackageWithNxPackage(tree, '@nrwl/angular', '@nx/angular'); + + await formatFiles(tree); +} diff --git a/packages/angular/src/migrations/update-16-0-0/remove-library-generator-simple-module-name-option.spec.ts b/packages/angular/src/migrations/update-16-0-0/remove-library-generator-simple-module-name-option.spec.ts index 65025c659708a4..ba7a4fe6b557c7 100644 --- a/packages/angular/src/migrations/update-16-0-0/remove-library-generator-simple-module-name-option.spec.ts +++ b/packages/angular/src/migrations/update-16-0-0/remove-library-generator-simple-module-name-option.spec.ts @@ -1,11 +1,11 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { addProjectConfiguration, readNxJson, readProjectConfiguration, updateNxJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import removeLibraryGeneratorSimpleModuleNameOption from './remove-library-generator-simple-module-name-option'; describe('removeLibraryGeneratorSimpleModuleNameOption', () => { diff --git a/packages/angular/src/migrations/update-16-0-0/remove-library-generator-simple-module-name-option.ts b/packages/angular/src/migrations/update-16-0-0/remove-library-generator-simple-module-name-option.ts index 9c972315bc5a75..d5a1046f46e00b 100644 --- a/packages/angular/src/migrations/update-16-0-0/remove-library-generator-simple-module-name-option.ts +++ b/packages/angular/src/migrations/update-16-0-0/remove-library-generator-simple-module-name-option.ts @@ -2,14 +2,14 @@ import type { NxJsonConfiguration, ProjectConfiguration, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { formatFiles, getProjects, readNxJson, updateNxJson, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; export default async function removeLibraryGeneratorSimpleModuleNameOption( tree: Tree diff --git a/packages/angular/src/utils/file-change-recorder.ts b/packages/angular/src/utils/file-change-recorder.ts index 360a04b491a4af..2bb6e82153e428 100644 --- a/packages/angular/src/utils/file-change-recorder.ts +++ b/packages/angular/src/utils/file-change-recorder.ts @@ -1,4 +1,4 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import MagicString from 'magic-string'; import type { Node } from 'typescript'; diff --git a/packages/angular/src/utils/get-mf-projects.ts b/packages/angular/src/utils/get-mf-projects.ts index b24493da973722..ca0f04daec2196 100644 --- a/packages/angular/src/utils/get-mf-projects.ts +++ b/packages/angular/src/utils/get-mf-projects.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; +import type { Tree } from '@nx/devkit'; +import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils'; export function getMFProjects( tree: Tree, diff --git a/packages/angular/src/utils/mf/utils.ts b/packages/angular/src/utils/mf/utils.ts index beb8fb07e928e1..0190e3b188c45d 100644 --- a/packages/angular/src/utils/mf/utils.ts +++ b/packages/angular/src/utils/mf/utils.ts @@ -11,7 +11,7 @@ import { SharedLibraryConfig, sharePackages, shareWorkspaceLibraries, -} from '@nrwl/devkit'; +} from '@nx/devkit'; export function applyDefaultEagerPackages( sharedConfig: Record diff --git a/packages/angular/src/utils/mf/with-module-federation-ssr.ts b/packages/angular/src/utils/mf/with-module-federation-ssr.ts index 89bf47c8d78693..2f14b35677b598 100644 --- a/packages/angular/src/utils/mf/with-module-federation-ssr.ts +++ b/packages/angular/src/utils/mf/with-module-federation-ssr.ts @@ -1,5 +1,5 @@ import { readCachedProjectConfiguration } from 'nx/src/project-graph/project-graph'; -import { ModuleFederationConfig } from '@nrwl/devkit'; +import { ModuleFederationConfig } from '@nx/devkit'; import { getModuleFederationConfig } from './utils'; function determineRemoteUrl(remote: string) { diff --git a/packages/angular/src/utils/mf/with-module-federation.ts b/packages/angular/src/utils/mf/with-module-federation.ts index 9ecf6911bd575a..5be810151b3d9b 100644 --- a/packages/angular/src/utils/mf/with-module-federation.ts +++ b/packages/angular/src/utils/mf/with-module-federation.ts @@ -1,4 +1,4 @@ -import { ModuleFederationConfig } from '@nrwl/devkit'; +import { ModuleFederationConfig } from '@nx/devkit'; import { getModuleFederationConfig } from './utils'; import { readCachedProjectConfiguration } from 'nx/src/project-graph/project-graph'; import ModuleFederationPlugin = require('webpack/lib/container/ModuleFederationPlugin'); diff --git a/packages/angular/src/utils/nx-devkit/ast-utils.spec.ts b/packages/angular/src/utils/nx-devkit/ast-utils.spec.ts index fed6de8c5f7a20..002c3700d8a39d 100644 --- a/packages/angular/src/utils/nx-devkit/ast-utils.spec.ts +++ b/packages/angular/src/utils/nx-devkit/ast-utils.spec.ts @@ -6,7 +6,7 @@ import { addProviderToBootstrapApplication, isStandalone, } from './ast-utils'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { createSourceFile, ScriptTarget } from 'typescript'; describe('Angular AST Utils', () => { diff --git a/packages/angular/src/utils/nx-devkit/ast-utils.ts b/packages/angular/src/utils/nx-devkit/ast-utils.ts index ae4c6e255b708b..ee8207dd3bff6c 100644 --- a/packages/angular/src/utils/nx-devkit/ast-utils.ts +++ b/packages/angular/src/utils/nx-devkit/ast-utils.ts @@ -6,10 +6,10 @@ import { insertChange, removeChange, replaceChange, -} from '@nrwl/js'; +} from '@nx/js'; import { dirname, join } from 'path'; -import { names, readProjectConfiguration, Tree } from '@nrwl/devkit'; -import { ensureTypescript } from '@nrwl/js/src/utils/typescript/ensure-typescript'; +import { names, readProjectConfiguration, Tree } from '@nx/devkit'; +import { ensureTypescript } from '@nx/js/src/utils/typescript/ensure-typescript'; let tsModule: typeof import('typescript'); diff --git a/packages/angular/src/utils/nx-devkit/route-utils.spec.ts b/packages/angular/src/utils/nx-devkit/route-utils.spec.ts index 8ca90ba3f556bf..08778866224ffa 100644 --- a/packages/angular/src/utils/nx-devkit/route-utils.spec.ts +++ b/packages/angular/src/utils/nx-devkit/route-utils.spec.ts @@ -1,4 +1,4 @@ -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { addProviderToRoute, addRoute } from './route-utils'; describe.each([ diff --git a/packages/angular/src/utils/nx-devkit/route-utils.ts b/packages/angular/src/utils/nx-devkit/route-utils.ts index 69ae69efe72848..be083e68d7e89c 100644 --- a/packages/angular/src/utils/nx-devkit/route-utils.ts +++ b/packages/angular/src/utils/nx-devkit/route-utils.ts @@ -1,7 +1,7 @@ -import { Tree } from '@nrwl/devkit'; -import { insertImport } from '@nrwl/js'; +import { Tree } from '@nx/devkit'; +import { insertImport } from '@nx/js'; import { addRouteToNgModule } from './ast-utils'; -import { ensureTypescript } from '@nrwl/js/src/utils/typescript/ensure-typescript'; +import { ensureTypescript } from '@nx/js/src/utils/typescript/ensure-typescript'; let tsModule: typeof import('typescript'); diff --git a/packages/angular/src/utils/nx-devkit/testing.ts b/packages/angular/src/utils/nx-devkit/testing.ts index 8b1c45f941e889..439a72d707151b 100644 --- a/packages/angular/src/utils/nx-devkit/testing.ts +++ b/packages/angular/src/utils/nx-devkit/testing.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { addProjectConfiguration, names, updateJson } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { addProjectConfiguration, names, updateJson } from '@nx/devkit'; export interface AppConfig { appName: string; // name of app diff --git a/packages/angular/src/utils/types.ts b/packages/angular/src/utils/types.ts index 1eaf0ac0f6cecf..77483b94ea48fd 100644 --- a/packages/angular/src/utils/types.ts +++ b/packages/angular/src/utils/types.ts @@ -1,4 +1,4 @@ -import type { ProjectConfiguration } from '@nrwl/devkit'; +import type { ProjectConfiguration } from '@nx/devkit'; export type AngularProjectConfiguration = ProjectConfiguration & { prefix?: string; diff --git a/packages/angular/tailwind.ts b/packages/angular/tailwind.ts index 38d615954ef061..fc3cea956eaba2 100644 --- a/packages/angular/tailwind.ts +++ b/packages/angular/tailwind.ts @@ -1,4 +1,4 @@ -import { createGlobPatternsForDependencies as jsGenerateGlobs } from '@nrwl/js/src/utils/generate-globs'; +import { createGlobPatternsForDependencies as jsGenerateGlobs } from '@nx/js/src/utils/generate-globs'; /** * Generates a set of glob patterns based off the source root of the app and its dependencies diff --git a/packages/angular/tsconfig.lib.json b/packages/angular/tsconfig.lib.json index b54ee18bfc3eef..a19f0353241f06 100644 --- a/packages/angular/tsconfig.lib.json +++ b/packages/angular/tsconfig.lib.json @@ -6,6 +6,9 @@ "declaration": true, "types": ["node"] }, + "angularCompilerOptions": { + "compilationMode": "partial" + }, "exclude": [ "**/*.spec.ts", "**/*.test.ts", diff --git a/packages/cypress/migrations.json b/packages/cypress/migrations.json index a961045eedd0cb..0022f3e81d0d64 100644 --- a/packages/cypress/migrations.json +++ b/packages/cypress/migrations.json @@ -41,6 +41,12 @@ "version": "15.5.0-beta.0", "description": "Update to Cypress v12. Cypress 12 contains a handful of breaking changes that might causes tests to start failing that nx cannot directly fix. Read more Cypress 12 changes: https://docs.cypress.io/guides/references/migration-guide#Migrating-to-Cypress-12-0.This migration will only run if you are already using Cypress v11.", "factory": "./src/migrations/update-15-5-0/update-to-cypress-12" + }, + "update-16-0-0-add-nx-packages": { + "cli": "nx", + "version": "16.0.0-beta.1", + "description": "Replace @nrwl/cypress with @nx/cypress", + "implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages" } }, "packageJsonUpdates": {} diff --git a/packages/cypress/migrations.spec.ts b/packages/cypress/migrations.spec.ts index 602e386ddf517f..3d02af95e440fb 100644 --- a/packages/cypress/migrations.spec.ts +++ b/packages/cypress/migrations.spec.ts @@ -5,7 +5,9 @@ describe('Cypress migrations', () => { it('should have valid paths', () => { Object.values(json.generators || {}).forEach((m: any) => { expect(() => - require.resolve(path.join(__dirname, `${m.factory}.ts`)) + require.resolve( + path.join(__dirname, `${m.factory ?? m.implementation}.ts`) + ) ).not.toThrow(); }); }); diff --git a/packages/cypress/package.json b/packages/cypress/package.json index ebc1d774a562b0..c5d063296242b1 100644 --- a/packages/cypress/package.json +++ b/packages/cypress/package.json @@ -1,5 +1,5 @@ { - "name": "@nrwl/cypress", + "name": "@nx/cypress", "version": "0.0.1", "private": false, "description": "The Nx Plugin for Cypress contains executors and generators allowing your workspace to use the powerful Cypress integration testing capabilities.", @@ -34,14 +34,13 @@ "migrations": "./migrations.json" }, "dependencies": { - "@nrwl/devkit": "file:../devkit", - "@nrwl/js": "file:../js", - "@nrwl/linter": "file:../linter", - "@nrwl/workspace": "file:../workspace", "@phenomnomnominal/tsquery": "~5.0.1", "dotenv": "~10.0.0", "semver": "7.3.4", - "detect-port": "^1.5.1" + "detect-port": "^1.5.1", + "@nx/devkit": "file:../devkit", + "@nx/js": "file:../js", + "@nx/linter": "file:../linter" }, "peerDependencies": { "cypress": ">= 3 < 13" diff --git a/packages/cypress/plugins/cypress-preset.ts b/packages/cypress/plugins/cypress-preset.ts index d38a2296121bc1..ba44d00dc02524 100644 --- a/packages/cypress/plugins/cypress-preset.ts +++ b/packages/cypress/plugins/cypress-preset.ts @@ -1,4 +1,4 @@ -import { workspaceRoot } from '@nrwl/devkit'; +import { workspaceRoot } from '@nx/devkit'; import { dirname, join, relative } from 'path'; import { lstatSync } from 'fs'; diff --git a/packages/cypress/project.json b/packages/cypress/project.json index 8bab30e4c63006..0e46b35f17de19 100644 --- a/packages/cypress/project.json +++ b/packages/cypress/project.json @@ -48,7 +48,10 @@ "executor": "nx:run-commands", "outputs": ["{workspaceRoot}/build/packages/cypress"], "options": { - "command": "node ./scripts/copy-readme.js cypress" + "commands": [ + "node ./scripts/copy-readme.js cypress", + "node ./scripts/add-dependency-to-build.js cypress @nrwl/cypress" + ] } }, "lint": {} diff --git a/packages/cypress/src/executors/cypress/compat.ts b/packages/cypress/src/executors/cypress/compat.ts index 67ea703f814eff..73ff03fab97441 100644 --- a/packages/cypress/src/executors/cypress/compat.ts +++ b/packages/cypress/src/executors/cypress/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import { default as cypressExecutor } from './cypress.impl'; diff --git a/packages/cypress/src/executors/cypress/cypress.impl.spec.ts b/packages/cypress/src/executors/cypress/cypress.impl.spec.ts index 7a10a434f7ded3..43c08ff42d6100 100644 --- a/packages/cypress/src/executors/cypress/cypress.impl.spec.ts +++ b/packages/cypress/src/executors/cypress/cypress.impl.spec.ts @@ -1,11 +1,11 @@ import { getTempTailwindPath } from '../../utils/ct-helpers'; -import { ExecutorContext, stripIndents } from '@nrwl/devkit'; +import { ExecutorContext, stripIndents } from '@nx/devkit'; import * as path from 'path'; import { installedCypressVersion } from '../../utils/cypress-version'; import cypressExecutor, { CypressExecutorOptions } from './cypress.impl'; -jest.mock('@nrwl/devkit'); -let devkit = require('@nrwl/devkit'); +jest.mock('@nx/devkit'); +let devkit = require('@nx/devkit'); jest.mock('detect-port', () => jest.fn().mockResolvedValue(4200)); import * as detectPort from 'detect-port'; jest.mock('../../utils/cypress-version'); diff --git a/packages/cypress/src/executors/cypress/cypress.impl.ts b/packages/cypress/src/executors/cypress/cypress.impl.ts index 998c35ea52c3ae..31dcb29bab87f1 100644 --- a/packages/cypress/src/executors/cypress/cypress.impl.ts +++ b/packages/cypress/src/executors/cypress/cypress.impl.ts @@ -9,7 +9,7 @@ import { Target, targetToTargetString, output, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import 'dotenv/config'; import { existsSync, readdirSync, unlinkSync, writeFileSync } from 'fs'; import { basename, dirname, join } from 'path'; diff --git a/packages/cypress/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.spec.ts b/packages/cypress/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.spec.ts index 2b1d4865352188..0e981c95d1dd03 100644 --- a/packages/cypress/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.spec.ts +++ b/packages/cypress/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.spec.ts @@ -5,9 +5,9 @@ import { readProjectConfiguration, Tree, writeJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { exampleRootTslintJson } from '@nrwl/linter'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { exampleRootTslintJson } from '@nx/linter'; import { conversionGenerator } from './convert-tslint-to-eslint'; /** diff --git a/packages/cypress/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.ts b/packages/cypress/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.ts index e8d16b9c9b96bb..27d890165874b6 100755 --- a/packages/cypress/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.ts +++ b/packages/cypress/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.ts @@ -3,12 +3,12 @@ import { formatFiles, GeneratorCallback, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { ConvertTSLintToESLintSchema, Linter, ProjectConverter, -} from '@nrwl/linter'; +} from '@nx/linter'; import { addLinterToCyProject } from '../../utils/add-linter'; import type { Linter as ESLinter } from 'eslint'; diff --git a/packages/cypress/src/generators/cypress-component-project/cypress-component-project.spec.ts b/packages/cypress/src/generators/cypress-component-project/cypress-component-project.spec.ts index 4bc54187b85d9c..34fd68dabae541 100644 --- a/packages/cypress/src/generators/cypress-component-project/cypress-component-project.spec.ts +++ b/packages/cypress/src/generators/cypress-component-project/cypress-component-project.spec.ts @@ -6,8 +6,8 @@ import { Tree, updateJson, updateProjectConfiguration, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { installedCypressVersion } from '../../utils/cypress-version'; import { cypressComponentProject } from './cypress-component-project'; diff --git a/packages/cypress/src/generators/cypress-component-project/cypress-component-project.ts b/packages/cypress/src/generators/cypress-component-project/cypress-component-project.ts index 32d9f802a93064..c29ef359fdfd30 100644 --- a/packages/cypress/src/generators/cypress-component-project/cypress-component-project.ts +++ b/packages/cypress/src/generators/cypress-component-project/cypress-component-project.ts @@ -11,7 +11,7 @@ import { updateJson, updateProjectConfiguration, updateNxJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { installedCypressVersion } from '../../utils/cypress-version'; import { diff --git a/packages/cypress/src/generators/cypress-e2e-configuration/cypress-e2e-configuration.spec.ts b/packages/cypress/src/generators/cypress-e2e-configuration/cypress-e2e-configuration.spec.ts index 34b5eb21d1050b..8b991ff3a19907 100644 --- a/packages/cypress/src/generators/cypress-e2e-configuration/cypress-e2e-configuration.spec.ts +++ b/packages/cypress/src/generators/cypress-e2e-configuration/cypress-e2e-configuration.spec.ts @@ -5,8 +5,8 @@ import { readProjectConfiguration, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { cypressE2EConfigurationGenerator } from './cypress-e2e-configuration'; import { installedCypressVersion } from '../../utils/cypress-version'; diff --git a/packages/cypress/src/generators/cypress-e2e-configuration/cypress-e2e-configuration.ts b/packages/cypress/src/generators/cypress-e2e-configuration/cypress-e2e-configuration.ts index 4e278251b6317a..83c03bdc1bc5e2 100644 --- a/packages/cypress/src/generators/cypress-e2e-configuration/cypress-e2e-configuration.ts +++ b/packages/cypress/src/generators/cypress-e2e-configuration/cypress-e2e-configuration.ts @@ -13,9 +13,9 @@ import { Tree, updateJson, updateProjectConfiguration, -} from '@nrwl/devkit'; -import { getRelativePathToRootTsConfig } from '@nrwl/js'; -import { Linter } from '@nrwl/linter'; +} from '@nx/devkit'; +import { getRelativePathToRootTsConfig } from '@nx/js'; +import { Linter } from '@nx/linter'; import { join } from 'path'; import { addLinterToCyProject } from '../../utils/add-linter'; import { installedCypressVersion } from '../../utils/cypress-version'; diff --git a/packages/cypress/src/generators/cypress-e2e-configuration/files/v9/__dir__/plugins/index.js b/packages/cypress/src/generators/cypress-e2e-configuration/files/v9/__dir__/plugins/index.js index 9067e75a258dad..63aa33cbe284a9 100644 --- a/packages/cypress/src/generators/cypress-e2e-configuration/files/v9/__dir__/plugins/index.js +++ b/packages/cypress/src/generators/cypress-e2e-configuration/files/v9/__dir__/plugins/index.js @@ -11,7 +11,7 @@ // This function is called when a project is opened or re-opened (e.g. due to // the project's config changing) -const { preprocessTypescript } = require('@nrwl/cypress/plugins/preprocessor'); +const { preprocessTypescript } = require('@nx/cypress/plugins/preprocessor'); module.exports = (on, config) => { // `on` is used to hook into various events Cypress emits diff --git a/packages/cypress/src/generators/cypress-project/cypress-project.spec.ts b/packages/cypress/src/generators/cypress-project/cypress-project.spec.ts index 8ad18b51dfa3e1..648efb0eaf6311 100644 --- a/packages/cypress/src/generators/cypress-project/cypress-project.spec.ts +++ b/packages/cypress/src/generators/cypress-project/cypress-project.spec.ts @@ -4,11 +4,11 @@ import { readProjectConfiguration, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { cypressProjectGenerator } from './cypress-project'; import { Schema } from './schema'; -import { Linter } from '@nrwl/linter'; +import { Linter } from '@nx/linter'; import { installedCypressVersion } from '../../utils/cypress-version'; import { cypressInitGenerator } from '../init/init'; diff --git a/packages/cypress/src/generators/cypress-project/cypress-project.ts b/packages/cypress/src/generators/cypress-project/cypress-project.ts index 263de32329ff68..4e07018872fc0a 100644 --- a/packages/cypress/src/generators/cypress-project/cypress-project.ts +++ b/packages/cypress/src/generators/cypress-project/cypress-project.ts @@ -19,10 +19,10 @@ import { toJS, Tree, updateJson, -} from '@nrwl/devkit'; -import { Linter } from '@nrwl/linter'; +} from '@nx/devkit'; +import { Linter } from '@nx/linter'; -import { getRelativePathToRootTsConfig } from '@nrwl/js'; +import { getRelativePathToRootTsConfig } from '@nx/js'; import { join } from 'path'; import { installedCypressVersion } from '../../utils/cypress-version'; diff --git a/packages/cypress/src/generators/cypress-project/files/v9-and-under/src/plugins/index.js b/packages/cypress/src/generators/cypress-project/files/v9-and-under/src/plugins/index.js index 9067e75a258dad..63aa33cbe284a9 100644 --- a/packages/cypress/src/generators/cypress-project/files/v9-and-under/src/plugins/index.js +++ b/packages/cypress/src/generators/cypress-project/files/v9-and-under/src/plugins/index.js @@ -11,7 +11,7 @@ // This function is called when a project is opened or re-opened (e.g. due to // the project's config changing) -const { preprocessTypescript } = require('@nrwl/cypress/plugins/preprocessor'); +const { preprocessTypescript } = require('@nx/cypress/plugins/preprocessor'); module.exports = (on, config) => { // `on` is used to hook into various events Cypress emits diff --git a/packages/cypress/src/generators/cypress-project/schema.d.ts b/packages/cypress/src/generators/cypress-project/schema.d.ts index f497ddf87087aa..6be36277367f0a 100644 --- a/packages/cypress/src/generators/cypress-project/schema.d.ts +++ b/packages/cypress/src/generators/cypress-project/schema.d.ts @@ -1,4 +1,4 @@ -import { Linter } from '@nrwl/linter'; +import { Linter } from '@nx/linter'; export interface Schema { project?: string; diff --git a/packages/cypress/src/generators/init/init.spec.ts b/packages/cypress/src/generators/init/init.spec.ts index 420a8ffe9661b2..416266fad33923 100644 --- a/packages/cypress/src/generators/init/init.spec.ts +++ b/packages/cypress/src/generators/init/init.spec.ts @@ -1,5 +1,5 @@ -import { NxJsonConfiguration, readJson, Tree, updateJson } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { NxJsonConfiguration, readJson, Tree, updateJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { cypressVersion } from '../../utils/versions'; import { cypressInitGenerator } from './init'; diff --git a/packages/cypress/src/generators/init/init.ts b/packages/cypress/src/generators/init/init.ts index 80810a3ca77956..969c2625e08f58 100644 --- a/packages/cypress/src/generators/init/init.ts +++ b/packages/cypress/src/generators/init/init.ts @@ -7,14 +7,14 @@ import { runTasksInSerial, Tree, updateNxJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { cypressVersion, nxVersion, typesNodeVersion, } from '../../utils/versions'; import { Schema } from './schema'; -import { initGenerator } from '@nrwl/js'; +import { initGenerator } from '@nx/js'; function setupE2ETargetDefaults(tree: Tree) { const nxJson = readNxJson(tree); diff --git a/packages/cypress/src/generators/migrate-to-cypress-11/conversion.util.ts b/packages/cypress/src/generators/migrate-to-cypress-11/conversion.util.ts index d483d47f3e1db3..569660aaa7b7a9 100644 --- a/packages/cypress/src/generators/migrate-to-cypress-11/conversion.util.ts +++ b/packages/cypress/src/generators/migrate-to-cypress-11/conversion.util.ts @@ -7,10 +7,10 @@ import { updateJson, visitNotIgnoredFiles, normalizePath, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { basename, dirname, extname, relative } from 'path'; import type { StringLiteral } from 'typescript'; -import { ensureTypescript } from '@nrwl/js/src/utils/typescript/ensure-typescript'; +import { ensureTypescript } from '@nx/js/src/utils/typescript/ensure-typescript'; let tsModule: typeof import('typescript'); let tsquery: typeof import('@phenomnomnominal/tsquery').tsquery; diff --git a/packages/cypress/src/generators/migrate-to-cypress-11/migrate-to-cypress-11.spec.ts b/packages/cypress/src/generators/migrate-to-cypress-11/migrate-to-cypress-11.spec.ts index a97ed8452e13e1..6898ce6ed138ab 100644 --- a/packages/cypress/src/generators/migrate-to-cypress-11/migrate-to-cypress-11.spec.ts +++ b/packages/cypress/src/generators/migrate-to-cypress-11/migrate-to-cypress-11.spec.ts @@ -6,8 +6,8 @@ import { Tree, updateJson, updateProjectConfiguration, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { installedCypressVersion } from '../../utils/cypress-version'; import { cypressProjectGenerator } from '../cypress-project/cypress-project'; import { diff --git a/packages/cypress/src/generators/migrate-to-cypress-11/migrate-to-cypress-11.ts b/packages/cypress/src/generators/migrate-to-cypress-11/migrate-to-cypress-11.ts index b92d71016627c6..db5374c55c210d 100644 --- a/packages/cypress/src/generators/migrate-to-cypress-11/migrate-to-cypress-11.ts +++ b/packages/cypress/src/generators/migrate-to-cypress-11/migrate-to-cypress-11.ts @@ -1,7 +1,7 @@ import { assertMinimumCypressVersion, installedCypressVersion, -} from '@nrwl/cypress/src/utils/cypress-version'; +} from '../../utils/cypress-version'; import { formatFiles, installPackagesTask, @@ -12,8 +12,8 @@ import { Tree, updateJson, updateProjectConfiguration, -} from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; +} from '@nx/devkit'; +import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils'; import { CypressExecutorOptions } from '../../executors/cypress/cypress.impl'; import { addConfigToTsConfig, diff --git a/packages/cypress/src/migrations/update-12-8-0/remove-typescript-plugin.spec.ts b/packages/cypress/src/migrations/update-12-8-0/remove-typescript-plugin.spec.ts index 59f06619e87ef6..587a5eb8e4dd6c 100644 --- a/packages/cypress/src/migrations/update-12-8-0/remove-typescript-plugin.spec.ts +++ b/packages/cypress/src/migrations/update-12-8-0/remove-typescript-plugin.spec.ts @@ -1,5 +1,5 @@ -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { addProjectConfiguration, Tree, writeJson } from '@nrwl/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { addProjectConfiguration, Tree, writeJson } from '@nx/devkit'; import removeTypescriptPlugin from './remove-typescript-plugin'; describe('remove typescript plugin', () => { @@ -40,7 +40,7 @@ describe('remove typescript plugin', () => { // This function is called when a project is opened or re-opened (e.g. due to // the project's config changing) - const { preprocessTypescript } = require('@nrwl/cypress/plugins/preprocessor'); + const { preprocessTypescript } = require('@nx/cypress/plugins/preprocessor'); module.exports = (on, config) => { // \`on\` is used to hook into various events Cypress emits diff --git a/packages/cypress/src/migrations/update-12-8-0/remove-typescript-plugin.ts b/packages/cypress/src/migrations/update-12-8-0/remove-typescript-plugin.ts index 4fa0dfbe7179a3..1bff0abc7aba67 100644 --- a/packages/cypress/src/migrations/update-12-8-0/remove-typescript-plugin.ts +++ b/packages/cypress/src/migrations/update-12-8-0/remove-typescript-plugin.ts @@ -8,7 +8,7 @@ import { StringDeletion, TargetConfiguration, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { createSourceFile, isCallExpression, diff --git a/packages/cypress/src/migrations/update-14-6-1/update-cypress-configs-presets.spec.ts b/packages/cypress/src/migrations/update-14-6-1/update-cypress-configs-presets.spec.ts index 2e9e9feb66faee..7beaa8c02c36ac 100644 --- a/packages/cypress/src/migrations/update-14-6-1/update-cypress-configs-presets.spec.ts +++ b/packages/cypress/src/migrations/update-14-6-1/update-cypress-configs-presets.spec.ts @@ -8,15 +8,15 @@ import { readProjectConfiguration, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { cypressProjectGenerator } from '../../generators/cypress-project/cypress-project'; -import { libraryGenerator } from '@nrwl/js'; +import { libraryGenerator } from '@nx/js'; let projectGraph: ProjectGraph; -jest.mock('@nrwl/devkit', () => { +jest.mock('@nx/devkit', () => { return { - ...jest.requireActual('@nrwl/devkit'), + ...jest.requireActual('@nx/devkit'), createProjectGraphAsync: jest.fn().mockImplementation(() => projectGraph), }; }); diff --git a/packages/cypress/src/migrations/update-14-6-1/update-cypress-configs-presets.ts b/packages/cypress/src/migrations/update-14-6-1/update-cypress-configs-presets.ts index 2c12235a62c0c6..ada260b79aa8ba 100644 --- a/packages/cypress/src/migrations/update-14-6-1/update-cypress-configs-presets.ts +++ b/packages/cypress/src/migrations/update-14-6-1/update-cypress-configs-presets.ts @@ -5,8 +5,8 @@ import { Tree, updateJson, updateProjectConfiguration, -} from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; +} from '@nx/devkit'; +import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils'; import { tsquery } from '@phenomnomnominal/tsquery'; import * as ts from 'typescript'; import { CypressExecutorOptions } from '../../executors/cypress/cypress.impl'; diff --git a/packages/cypress/src/migrations/update-14-7-0/update-cypress-version-if-10.spec.ts b/packages/cypress/src/migrations/update-14-7-0/update-cypress-version-if-10.spec.ts index f2c4f39cf64fd9..ce1de150fe0270 100644 --- a/packages/cypress/src/migrations/update-14-7-0/update-cypress-version-if-10.spec.ts +++ b/packages/cypress/src/migrations/update-14-7-0/update-cypress-version-if-10.spec.ts @@ -1,7 +1,7 @@ import { updateCypressVersionIf10 } from './update-cypress-version-if-10'; import { installedCypressVersion } from '../../utils/cypress-version'; -import { readJson, Tree, updateJson } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { readJson, Tree, updateJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; describe('Update Cypress if v10 migration', () => { let tree: Tree; diff --git a/packages/cypress/src/migrations/update-14-7-0/update-cypress-version-if-10.ts b/packages/cypress/src/migrations/update-14-7-0/update-cypress-version-if-10.ts index 04c6653e5a4675..65187dcd96de40 100644 --- a/packages/cypress/src/migrations/update-14-7-0/update-cypress-version-if-10.ts +++ b/packages/cypress/src/migrations/update-14-7-0/update-cypress-version-if-10.ts @@ -4,9 +4,9 @@ import { readJson, Tree, updateJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; // don't import from root level to prevent issue where angular isn't installed. -import { checkAndCleanWithSemver } from '@nrwl/devkit/src/utils/semver'; +import { checkAndCleanWithSemver } from '@nx/devkit/src/utils/semver'; import { gte, lt } from 'semver'; export function updateCypressVersionIf10(tree: Tree): GeneratorCallback { diff --git a/packages/cypress/src/migrations/update-15-0-0/add-cypress-inputs.spec.ts b/packages/cypress/src/migrations/update-15-0-0/add-cypress-inputs.spec.ts index 9b954613b40dbf..b2f05e9c49ca10 100644 --- a/packages/cypress/src/migrations/update-15-0-0/add-cypress-inputs.spec.ts +++ b/packages/cypress/src/migrations/update-15-0-0/add-cypress-inputs.spec.ts @@ -1,10 +1,10 @@ -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { addProjectConfiguration, readNxJson, Tree, updateNxJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import addCypressInputs from './add-cypress-inputs'; describe('15.0.0 migration (add-cypress-inputs)', () => { diff --git a/packages/cypress/src/migrations/update-15-0-0/add-cypress-inputs.ts b/packages/cypress/src/migrations/update-15-0-0/add-cypress-inputs.ts index 525d4f3c3bcf80..9f45763ce8df0d 100644 --- a/packages/cypress/src/migrations/update-15-0-0/add-cypress-inputs.ts +++ b/packages/cypress/src/migrations/update-15-0-0/add-cypress-inputs.ts @@ -1,6 +1,6 @@ -import { formatFiles, readNxJson, Tree, updateNxJson } from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; -import { CypressExecutorOptions } from '@nrwl/cypress/src/executors/cypress/cypress.impl'; +import { formatFiles, readNxJson, Tree, updateNxJson } from '@nx/devkit'; +import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils'; +import { CypressExecutorOptions } from '../../executors/cypress/cypress.impl'; export default async function (tree: Tree) { const nxJson = readNxJson(tree); diff --git a/packages/cypress/src/migrations/update-15-0-0/update-cy-mount-usage.spec.ts b/packages/cypress/src/migrations/update-15-0-0/update-cy-mount-usage.spec.ts index 81110731bb57f8..64a373557ad122 100644 --- a/packages/cypress/src/migrations/update-15-0-0/update-cy-mount-usage.spec.ts +++ b/packages/cypress/src/migrations/update-15-0-0/update-cy-mount-usage.spec.ts @@ -3,14 +3,14 @@ import { readProjectConfiguration, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { addMountCommand, updateCyFile, updateCyMountUsage, } from './update-cy-mount-usage'; -import { libraryGenerator } from '@nrwl/js'; +import { libraryGenerator } from '@nx/js'; import { cypressComponentProject } from '../../generators/cypress-component-project/cypress-component-project'; jest.mock('../../utils/cypress-version'); diff --git a/packages/cypress/src/migrations/update-15-0-0/update-cy-mount-usage.ts b/packages/cypress/src/migrations/update-15-0-0/update-cy-mount-usage.ts index 6b491a259151cd..e36c078f0e3616 100644 --- a/packages/cypress/src/migrations/update-15-0-0/update-cy-mount-usage.ts +++ b/packages/cypress/src/migrations/update-15-0-0/update-cy-mount-usage.ts @@ -11,9 +11,9 @@ import { TargetConfiguration, Tree, visitNotIgnoredFiles, -} from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; -import { checkAndCleanWithSemver } from '@nrwl/devkit/src/utils/semver'; +} from '@nx/devkit'; +import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils'; +import { checkAndCleanWithSemver } from '@nx/devkit/src/utils/semver'; import { tsquery } from '@phenomnomnominal/tsquery'; import { gte } from 'semver'; import * as ts from 'typescript'; diff --git a/packages/cypress/src/migrations/update-15-1-0/cypress-11.spec.ts b/packages/cypress/src/migrations/update-15-1-0/cypress-11.spec.ts index 697919f6375b88..1be671423925c1 100644 --- a/packages/cypress/src/migrations/update-15-1-0/cypress-11.spec.ts +++ b/packages/cypress/src/migrations/update-15-1-0/cypress-11.spec.ts @@ -1,6 +1,6 @@ -import { addProjectConfiguration, Tree } from '@nrwl/devkit'; -import { libraryGenerator } from '@nrwl/js'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { addProjectConfiguration, Tree } from '@nx/devkit'; +import { libraryGenerator } from '@nx/js'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import updateToCypress11 from './cypress-11'; import { installedCypressVersion } from '../../utils/cypress-version'; jest.mock('../../utils/cypress-version'); diff --git a/packages/cypress/src/migrations/update-15-1-0/cypress-11.ts b/packages/cypress/src/migrations/update-15-1-0/cypress-11.ts index 7bdf6c36c742ae..f116000445022c 100644 --- a/packages/cypress/src/migrations/update-15-1-0/cypress-11.ts +++ b/packages/cypress/src/migrations/update-15-1-0/cypress-11.ts @@ -6,8 +6,8 @@ import { joinPathFragments, Tree, visitNotIgnoredFiles, -} from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; +} from '@nx/devkit'; +import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils'; import { tsquery } from '@phenomnomnominal/tsquery'; import { extname } from 'path'; import * as ts from 'typescript'; diff --git a/packages/cypress/src/migrations/update-15-5-0/update-to-cypress-12.spec.ts b/packages/cypress/src/migrations/update-15-5-0/update-to-cypress-12.spec.ts index b497935f2c3ec5..bcb16e454d7a13 100644 --- a/packages/cypress/src/migrations/update-15-5-0/update-to-cypress-12.spec.ts +++ b/packages/cypress/src/migrations/update-15-5-0/update-to-cypress-12.spec.ts @@ -1,10 +1,10 @@ -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { addProjectConfiguration, stripIndents, Tree, readJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { shouldNotOverrideCommands, shouldNotUseCyInShouldCB, diff --git a/packages/cypress/src/migrations/update-15-5-0/update-to-cypress-12.ts b/packages/cypress/src/migrations/update-15-5-0/update-to-cypress-12.ts index 306a56323a7445..43344cdad578c6 100644 --- a/packages/cypress/src/migrations/update-15-5-0/update-to-cypress-12.ts +++ b/packages/cypress/src/migrations/update-15-5-0/update-to-cypress-12.ts @@ -6,8 +6,8 @@ import { Tree, updateJson, visitNotIgnoredFiles, -} from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; +} from '@nx/devkit'; +import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils'; import { tsquery } from '@phenomnomnominal/tsquery'; import { CallExpression, diff --git a/packages/cypress/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts b/packages/cypress/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts new file mode 100644 index 00000000000000..ac8681ec340117 --- /dev/null +++ b/packages/cypress/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts @@ -0,0 +1,37 @@ +import { Tree, readJson, updateJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import replacePackage from './update-16-0-0-add-nx-packages'; + +describe('update-16-0-0-add-nx-packages', () => { + let tree: Tree; + beforeEach(() => { + tree = createTreeWithEmptyWorkspace(); + + updateJson(tree, 'package.json', (json) => { + json.devDependencies['@nrwl/cypress'] = '16.0.0'; + return json; + }); + }); + + it('should remove the dependency on @nrwl/cypress', async () => { + await replacePackage(tree); + + expect( + readJson(tree, 'package.json').dependencies['@nrwl/cypress'] + ).not.toBeDefined(); + expect( + readJson(tree, 'package.json').devDependencies['@nrwl/cypress'] + ).not.toBeDefined(); + }); + + it('should add a dependency on @nx/cypress', async () => { + await replacePackage(tree); + + const packageJson = readJson(tree, 'package.json'); + const newDependencyVersion = + packageJson.devDependencies['@nx/cypress'] ?? + packageJson.dependencies['@nx/cypress']; + + expect(newDependencyVersion).toBeDefined(); + }); +}); diff --git a/packages/cypress/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts b/packages/cypress/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts new file mode 100644 index 00000000000000..e3edbbb93e6fd5 --- /dev/null +++ b/packages/cypress/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts @@ -0,0 +1,8 @@ +import { Tree, formatFiles } from '@nx/devkit'; +import { replaceNrwlPackageWithNxPackage } from '@nx/devkit/src/utils/replace-package'; + +export default async function replacePackage(tree: Tree): Promise { + await replaceNrwlPackageWithNxPackage(tree, '@nrwl/cypress', '@nx/cypress'); + + await formatFiles(tree); +} diff --git a/packages/cypress/src/utils/add-linter.ts b/packages/cypress/src/utils/add-linter.ts index 15d9be6d217aed..be6df5bd858f61 100644 --- a/packages/cypress/src/utils/add-linter.ts +++ b/packages/cypress/src/utils/add-linter.ts @@ -6,9 +6,9 @@ import { runTasksInSerial, Tree, updateJson, -} from '@nrwl/devkit'; -import { Linter, lintProjectGenerator } from '@nrwl/linter'; -import { globalJavaScriptOverrides } from '@nrwl/linter/src/generators/init/global-eslint-config'; +} from '@nx/devkit'; +import { Linter, lintProjectGenerator } from '@nx/linter'; +import { globalJavaScriptOverrides } from '@nx/linter/src/generators/init/global-eslint-config'; import { installedCypressVersion } from './cypress-version'; import { eslintPluginCypressVersion } from './versions'; diff --git a/packages/cypress/src/utils/ct-helpers.ts b/packages/cypress/src/utils/ct-helpers.ts index 667e6b2fbe87e4..38b2fa51585c82 100644 --- a/packages/cypress/src/utils/ct-helpers.ts +++ b/packages/cypress/src/utils/ct-helpers.ts @@ -1,11 +1,11 @@ -import type { ExecutorContext, ProjectGraph } from '@nrwl/devkit'; +import type { ExecutorContext, ProjectGraph } from '@nx/devkit'; import { normalizePath, ProjectConfiguration, stripIndents, TargetConfiguration, workspaceRoot, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { extname, join, relative } from 'path'; import { lstatSync } from 'fs'; import { diff --git a/packages/cypress/src/utils/find-target-options.ts b/packages/cypress/src/utils/find-target-options.ts index 1cd9314de01023..f4f54a253950d7 100644 --- a/packages/cypress/src/utils/find-target-options.ts +++ b/packages/cypress/src/utils/find-target-options.ts @@ -12,7 +12,7 @@ import { readTargetOptions, ExecutorContext, workspaceRoot, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { readNxJson } from 'nx/src/project-graph/file-utils'; import { readProjectsConfigurationFromProjectGraph } from 'nx/src/project-graph/project-graph'; diff --git a/packages/cypress/src/utils/project-name.ts b/packages/cypress/src/utils/project-name.ts index 11ce9f47faceda..38a4216d122628 100644 --- a/packages/cypress/src/utils/project-name.ts +++ b/packages/cypress/src/utils/project-name.ts @@ -1,4 +1,4 @@ -import { names } from '@nrwl/devkit'; +import { names } from '@nx/devkit'; export function getUnscopedLibName(libRoot: string) { return libRoot.slice(libRoot.lastIndexOf('/') + 1); diff --git a/packages/detox/migrations.json b/packages/detox/migrations.json index 7d4ee91d06c954..474cc0d3cf067e 100644 --- a/packages/detox/migrations.json +++ b/packages/detox/migrations.json @@ -17,6 +17,12 @@ "cli": "nx", "description": "Update jest.config.json under detox project, add key verbsoe: true", "factory": "./src/migrations/update-13-10-3/add-verbose-jest-config-13-10-3" + }, + "update-16-0-0-add-nx-packages": { + "cli": "nx", + "version": "16.0.0-beta.1", + "description": "Replace @nrwl/detox with @nx/detox", + "implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages" } }, "packageJsonUpdates": { diff --git a/packages/detox/migrations.spec.ts b/packages/detox/migrations.spec.ts index e3e6398879860a..e1d1a0289ede4c 100644 --- a/packages/detox/migrations.spec.ts +++ b/packages/detox/migrations.spec.ts @@ -5,7 +5,9 @@ describe('Detox migrations', () => { it('should have valid paths', () => { Object.values(json.generators).forEach((m: any) => { expect(() => - require.resolve(path.join(__dirname, `${m.factory}.ts`)) + require.resolve( + path.join(__dirname, `${m.factory ?? m.implementation}.ts`) + ) ).not.toThrow(); }); }); diff --git a/packages/detox/package.json b/packages/detox/package.json index 6ad96ed1d7974b..dc158f360fd413 100644 --- a/packages/detox/package.json +++ b/packages/detox/package.json @@ -1,5 +1,5 @@ { - "name": "@nrwl/detox", + "name": "@nx/detox", "version": "0.0.1", "private": false, "description": "The Nx Plugin for Detox contains executors and generators for allowing your workspace to use the powerful Detox integration testing capabilities.", @@ -25,12 +25,11 @@ "main": "./index", "types": "index.d.ts", "dependencies": { - "@nrwl/devkit": "file:../devkit", - "@nrwl/jest": "file:../jest", - "@nrwl/js": "file:../js", - "@nrwl/linter": "file:../linter", - "@nrwl/react": "file:../react", - "@nrwl/workspace": "file:../workspace" + "@nx/devkit": "file:../devkit", + "@nx/jest": "file:../jest", + "@nx/js": "file:../js", + "@nx/linter": "file:../linter", + "@nx/react": "file:../react" }, "peerDependencies": { "detox": "~20.5.0" diff --git a/packages/detox/project.json b/packages/detox/project.json index 2b1195959d7324..0c6d99e077deb5 100644 --- a/packages/detox/project.json +++ b/packages/detox/project.json @@ -48,7 +48,10 @@ "executor": "nx:run-commands", "outputs": ["{workspaceRoot}/build/packages/detox"], "options": { - "command": "node ./scripts/copy-readme.js detox" + "commands": [ + "node ./scripts/copy-readme.js detox", + "node ./scripts/add-dependency-to-build.js detox @nrwl/detox" + ] } } } diff --git a/packages/detox/src/executors/build/build.impl.ts b/packages/detox/src/executors/build/build.impl.ts index 5d794f7498b160..3b01d6a1a4a71d 100644 --- a/packages/detox/src/executors/build/build.impl.ts +++ b/packages/detox/src/executors/build/build.impl.ts @@ -1,4 +1,4 @@ -import { ExecutorContext } from '@nrwl/devkit'; +import { ExecutorContext } from '@nx/devkit'; import { join } from 'path'; import { ChildProcess, fork } from 'child_process'; diff --git a/packages/detox/src/executors/build/compat.ts b/packages/detox/src/executors/build/compat.ts index 87700b88bc7aac..49a0fc36986e06 100644 --- a/packages/detox/src/executors/build/compat.ts +++ b/packages/detox/src/executors/build/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import detoxBuildExecutor from './build.impl'; diff --git a/packages/detox/src/executors/test/compat.ts b/packages/detox/src/executors/test/compat.ts index 1409e42e14935e..489629e0671a2c 100644 --- a/packages/detox/src/executors/test/compat.ts +++ b/packages/detox/src/executors/test/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import detoxTestExecutor from './test.impl'; diff --git a/packages/detox/src/executors/test/test.impl.ts b/packages/detox/src/executors/test/test.impl.ts index 248adee6b867ca..afef03727e3b78 100644 --- a/packages/detox/src/executors/test/test.impl.ts +++ b/packages/detox/src/executors/test/test.impl.ts @@ -2,8 +2,8 @@ import { ExecutorContext, parseTargetString, readTargetOptions, -} from '@nrwl/devkit'; -import { names } from '@nrwl/devkit'; +} from '@nx/devkit'; +import { names } from '@nx/devkit'; import { join } from 'path'; import { ChildProcess, fork } from 'child_process'; diff --git a/packages/detox/src/generators/application/application.spec.ts b/packages/detox/src/generators/application/application.spec.ts index a957529f7026d8..ab1b7e8b427149 100644 --- a/packages/detox/src/generators/application/application.spec.ts +++ b/packages/detox/src/generators/application/application.spec.ts @@ -3,8 +3,8 @@ import { readJson, readProjectConfiguration, Tree, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { Linter } from 'packages/linter/src/generators/utils/linter'; import detoxApplicationGenerator from './application'; diff --git a/packages/detox/src/generators/application/application.ts b/packages/detox/src/generators/application/application.ts index c8aef0ce1d63a2..735535b859440e 100644 --- a/packages/detox/src/generators/application/application.ts +++ b/packages/detox/src/generators/application/application.ts @@ -3,7 +3,7 @@ import { formatFiles, runTasksInSerial, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import detoxInitGenerator from '../init/init'; import { addGitIgnoreEntry } from './lib/add-git-ignore-entry'; diff --git a/packages/detox/src/generators/application/lib/add-git-ignore-entry.ts b/packages/detox/src/generators/application/lib/add-git-ignore-entry.ts index 03cabdb77d843b..a4c2e816f5cc60 100644 --- a/packages/detox/src/generators/application/lib/add-git-ignore-entry.ts +++ b/packages/detox/src/generators/application/lib/add-git-ignore-entry.ts @@ -1,4 +1,4 @@ -import { logger, Tree } from '@nrwl/devkit'; +import { logger, Tree } from '@nx/devkit'; import { NormalizedSchema } from './normalize-options'; export function addGitIgnoreEntry(host: Tree, options: NormalizedSchema) { diff --git a/packages/detox/src/generators/application/lib/add-linting.spec.ts b/packages/detox/src/generators/application/lib/add-linting.spec.ts index b49b4388561f6c..1a36e513ea8a83 100644 --- a/packages/detox/src/generators/application/lib/add-linting.spec.ts +++ b/packages/detox/src/generators/application/lib/add-linting.spec.ts @@ -1,6 +1,6 @@ -import { readProjectConfiguration, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { Linter } from '@nrwl/linter'; +import { readProjectConfiguration, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { Linter } from '@nx/linter'; import { addLinting } from './add-linting'; import { addProject } from './add-project'; diff --git a/packages/detox/src/generators/application/lib/add-linting.ts b/packages/detox/src/generators/application/lib/add-linting.ts index d86803786deacb..d1b578bcf05e97 100644 --- a/packages/detox/src/generators/application/lib/add-linting.ts +++ b/packages/detox/src/generators/application/lib/add-linting.ts @@ -1,12 +1,12 @@ -import { Linter, lintProjectGenerator } from '@nrwl/linter'; +import { Linter, lintProjectGenerator } from '@nx/linter'; import { addDependenciesToPackageJson, joinPathFragments, runTasksInSerial, Tree, updateJson, -} from '@nrwl/devkit'; -import { extendReactEslintJson, extraEslintDependencies } from '@nrwl/react'; +} from '@nx/devkit'; +import { extendReactEslintJson, extraEslintDependencies } from '@nx/react'; import { NormalizedSchema } from './normalize-options'; export async function addLinting(host: Tree, options: NormalizedSchema) { diff --git a/packages/detox/src/generators/application/lib/add-project.spec.ts b/packages/detox/src/generators/application/lib/add-project.spec.ts index fd834de55d0b26..dc230a8481d4cd 100644 --- a/packages/detox/src/generators/application/lib/add-project.spec.ts +++ b/packages/detox/src/generators/application/lib/add-project.spec.ts @@ -2,9 +2,9 @@ import { addProjectConfiguration, readProjectConfiguration, Tree, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { Linter } from '@nrwl/linter'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { Linter } from '@nx/linter'; import { addProject } from './add-project'; describe('Add Project', () => { diff --git a/packages/detox/src/generators/application/lib/add-project.ts b/packages/detox/src/generators/application/lib/add-project.ts index 5e74fe4dd6f226..2d09ea6be086f1 100644 --- a/packages/detox/src/generators/application/lib/add-project.ts +++ b/packages/detox/src/generators/application/lib/add-project.ts @@ -1,8 +1,4 @@ -import { - addProjectConfiguration, - TargetConfiguration, - Tree, -} from '@nrwl/devkit'; +import { addProjectConfiguration, TargetConfiguration, Tree } from '@nx/devkit'; import { expoBuildTarget, expoTestTarget, diff --git a/packages/detox/src/generators/application/lib/create-files.spec.ts b/packages/detox/src/generators/application/lib/create-files.spec.ts index befefe5c4b9a4f..2c8104e91aa49e 100644 --- a/packages/detox/src/generators/application/lib/create-files.spec.ts +++ b/packages/detox/src/generators/application/lib/create-files.spec.ts @@ -1,6 +1,6 @@ -import { Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { Linter } from '@nrwl/linter'; +import { Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { Linter } from '@nx/linter'; import { createFiles } from './create-files'; describe('Create Files', () => { diff --git a/packages/detox/src/generators/application/lib/create-files.ts b/packages/detox/src/generators/application/lib/create-files.ts index b63df109c4fa37..5bbffa8f982478 100644 --- a/packages/detox/src/generators/application/lib/create-files.ts +++ b/packages/detox/src/generators/application/lib/create-files.ts @@ -5,8 +5,8 @@ import { offsetFromRoot, toJS, Tree, -} from '@nrwl/devkit'; -import { getRelativePathToRootTsConfig } from '@nrwl/js'; +} from '@nx/devkit'; +import { getRelativePathToRootTsConfig } from '@nx/js'; import { join } from 'path'; import { NormalizedSchema } from './normalize-options'; diff --git a/packages/detox/src/generators/application/lib/normalize-options.spec.ts b/packages/detox/src/generators/application/lib/normalize-options.spec.ts index 2ec158ed269a44..6a7587c88bf672 100644 --- a/packages/detox/src/generators/application/lib/normalize-options.spec.ts +++ b/packages/detox/src/generators/application/lib/normalize-options.spec.ts @@ -1,6 +1,6 @@ -import { addProjectConfiguration, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { Linter } from '@nrwl/linter'; +import { addProjectConfiguration, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { Linter } from '@nx/linter'; import { Schema } from '../schema'; import { normalizeOptions } from './normalize-options'; diff --git a/packages/detox/src/generators/application/lib/normalize-options.ts b/packages/detox/src/generators/application/lib/normalize-options.ts index 3be0fb8a5e6d4c..876ebe058419c0 100644 --- a/packages/detox/src/generators/application/lib/normalize-options.ts +++ b/packages/detox/src/generators/application/lib/normalize-options.ts @@ -4,7 +4,7 @@ import { joinPathFragments, names, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { Schema } from '../schema'; export interface NormalizedSchema extends Schema { diff --git a/packages/detox/src/generators/application/schema.d.ts b/packages/detox/src/generators/application/schema.d.ts index 55e4733bebbaf6..2a95b66bfb5aec 100644 --- a/packages/detox/src/generators/application/schema.d.ts +++ b/packages/detox/src/generators/application/schema.d.ts @@ -1,4 +1,4 @@ -import { Linter } from '@nrwl/linter'; +import { Linter } from '@nx/linter'; export interface Schema { appProject: string; // name of the project app to be tested (directory + app name in kebab class) diff --git a/packages/detox/src/generators/init/init.spec.ts b/packages/detox/src/generators/init/init.spec.ts index ec0134aba12d70..348f14e4dd7aac 100644 --- a/packages/detox/src/generators/init/init.spec.ts +++ b/packages/detox/src/generators/init/init.spec.ts @@ -1,5 +1,5 @@ -import { Tree, readJson } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { Tree, readJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { detoxInitGenerator } from './init'; describe('init', () => { diff --git a/packages/detox/src/generators/init/init.ts b/packages/detox/src/generators/init/init.ts index ed17b2a1fb199f..5bd7604d26eea0 100644 --- a/packages/detox/src/generators/init/init.ts +++ b/packages/detox/src/generators/init/init.ts @@ -6,8 +6,8 @@ import { removeDependenciesFromPackageJson, runTasksInSerial, Tree, -} from '@nrwl/devkit'; -import { jestVersion, typesNodeVersion } from '@nrwl/jest/src/utils/versions'; +} from '@nx/devkit'; +import { jestVersion, typesNodeVersion } from '@nx/jest/src/utils/versions'; import { Schema } from './schema'; import { diff --git a/packages/detox/src/migrations/update-13-10-3/add-verbose-jest-config-13-10-3.spec.ts b/packages/detox/src/migrations/update-13-10-3/add-verbose-jest-config-13-10-3.spec.ts index 0ea46c9564e770..1fbefe0111df85 100644 --- a/packages/detox/src/migrations/update-13-10-3/add-verbose-jest-config-13-10-3.spec.ts +++ b/packages/detox/src/migrations/update-13-10-3/add-verbose-jest-config-13-10-3.spec.ts @@ -1,5 +1,5 @@ -import { addProjectConfiguration, readJson, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { addProjectConfiguration, readJson, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import update from './add-verbose-jest-config-13-10-3'; diff --git a/packages/detox/src/migrations/update-13-10-3/add-verbose-jest-config-13-10-3.ts b/packages/detox/src/migrations/update-13-10-3/add-verbose-jest-config-13-10-3.ts index 2f27c3314fa519..4082d53f49c1d2 100644 --- a/packages/detox/src/migrations/update-13-10-3/add-verbose-jest-config-13-10-3.ts +++ b/packages/detox/src/migrations/update-13-10-3/add-verbose-jest-config-13-10-3.ts @@ -4,7 +4,7 @@ import { getProjects, updateJson, ProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; /** * Update jest.config.json under detox project, add key verbsoe: true diff --git a/packages/detox/src/migrations/update-13-5-0/add-build-target-test-13-5-0.spec.ts b/packages/detox/src/migrations/update-13-5-0/add-build-target-test-13-5-0.spec.ts index e6cee931308c72..634dde0e3a2958 100644 --- a/packages/detox/src/migrations/update-13-5-0/add-build-target-test-13-5-0.spec.ts +++ b/packages/detox/src/migrations/update-13-5-0/add-build-target-test-13-5-0.spec.ts @@ -1,5 +1,5 @@ -import { addProjectConfiguration, getProjects, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { addProjectConfiguration, getProjects, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import update from './add-build-target-test-13-5-0'; describe('add-e2e-targets-13-5-0', () => { diff --git a/packages/detox/src/migrations/update-13-5-0/add-build-target-test-13-5-0.ts b/packages/detox/src/migrations/update-13-5-0/add-build-target-test-13-5-0.ts index fbccd57359b934..abd0e6585f233c 100644 --- a/packages/detox/src/migrations/update-13-5-0/add-build-target-test-13-5-0.ts +++ b/packages/detox/src/migrations/update-13-5-0/add-build-target-test-13-5-0.ts @@ -3,7 +3,7 @@ import { formatFiles, getProjects, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; /** * This function buildTarget to test-ios and test-android diff --git a/packages/detox/src/migrations/update-13-8-2/remove-types-detox-13-8-2.spec.ts b/packages/detox/src/migrations/update-13-8-2/remove-types-detox-13-8-2.spec.ts index cc0a5ba71e1edf..ac5f44da0f57ba 100644 --- a/packages/detox/src/migrations/update-13-8-2/remove-types-detox-13-8-2.spec.ts +++ b/packages/detox/src/migrations/update-13-8-2/remove-types-detox-13-8-2.spec.ts @@ -3,8 +3,8 @@ import { readJson, Tree, updateJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import update from './remove-types-detox-13-8-2'; describe('remove-types-detox-13-8-2', () => { diff --git a/packages/detox/src/migrations/update-13-8-2/remove-types-detox-13-8-2.ts b/packages/detox/src/migrations/update-13-8-2/remove-types-detox-13-8-2.ts index d7888ae67c80fd..55058106ce5a73 100644 --- a/packages/detox/src/migrations/update-13-8-2/remove-types-detox-13-8-2.ts +++ b/packages/detox/src/migrations/update-13-8-2/remove-types-detox-13-8-2.ts @@ -1,4 +1,4 @@ -import { getProjects, readJson, Tree, updateJson } from '@nrwl/devkit'; +import { getProjects, readJson, Tree, updateJson } from '@nx/devkit'; export default async function update(tree: Tree) { const packageJson = readJson(tree, 'package.json'); diff --git a/packages/detox/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts b/packages/detox/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts new file mode 100644 index 00000000000000..40759f32eab5b1 --- /dev/null +++ b/packages/detox/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts @@ -0,0 +1,37 @@ +import { Tree, readJson, updateJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import replacePackage from './update-16-0-0-add-nx-packages'; + +describe('update-16-0-0-add-nx-packages', () => { + let tree: Tree; + beforeEach(() => { + tree = createTreeWithEmptyWorkspace(); + + updateJson(tree, 'package.json', (json) => { + json.devDependencies['@nrwl/detox'] = '16.0.0'; + return json; + }); + }); + + it('should remove the dependency on @nrwl/detox', async () => { + await replacePackage(tree); + + expect( + readJson(tree, 'package.json').dependencies['@nrwl/detox'] + ).not.toBeDefined(); + expect( + readJson(tree, 'package.json').devDependencies['@nrwl/detox'] + ).not.toBeDefined(); + }); + + it('should add a dependency on @nx/detox', async () => { + await replacePackage(tree); + + const packageJson = readJson(tree, 'package.json'); + const newDependencyVersion = + packageJson.devDependencies['@nx/detox'] ?? + packageJson.dependencies['@nx/detox']; + + expect(newDependencyVersion).toBeDefined(); + }); +}); diff --git a/packages/detox/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts b/packages/detox/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts new file mode 100644 index 00000000000000..24d5ed7ffd12f2 --- /dev/null +++ b/packages/detox/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts @@ -0,0 +1,8 @@ +import { Tree, formatFiles } from '@nx/devkit'; +import { replaceNrwlPackageWithNxPackage } from '@nx/devkit/src/utils/replace-package'; + +export default async function replacePackage(tree: Tree): Promise { + await replaceNrwlPackageWithNxPackage(tree, '@nrwl/detox', '@nx/detox'); + + await formatFiles(tree); +} diff --git a/packages/devkit/migrations.json b/packages/devkit/migrations.json new file mode 100644 index 00000000000000..7db5ad4104821a --- /dev/null +++ b/packages/devkit/migrations.json @@ -0,0 +1,12 @@ +{ + "generators": { + "update-16-0-0-add-nx-packages": { + "cli": "nx", + "version": "16.0.0-beta.1", + "description": "Replace @nrwl/devkit with @nx/devkit", + "implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages" + } + }, + "packageJsonUpdates": {}, + "version": "0.1" +} diff --git a/packages/devkit/package.json b/packages/devkit/package.json index c9d04bd071b2c6..2200c6d71360c1 100644 --- a/packages/devkit/package.json +++ b/packages/devkit/package.json @@ -1,5 +1,5 @@ { - "name": "@nrwl/devkit", + "name": "@nx/devkit", "version": "0.0.1", "private": false, "description": "The Nx Devkit is used to customize Nx for different technologies and use cases. It contains many utility functions for reading and writing files, updating configuration, working with Abstract Syntax Trees(ASTs), and more.", @@ -39,5 +39,8 @@ }, "publishConfig": { "access": "public" + }, + "nx-migrations": { + "migrations": "./migrations.json" } } diff --git a/packages/devkit/project.json b/packages/devkit/project.json index 36ea9bbd432790..449497a14a00c7 100644 --- a/packages/devkit/project.json +++ b/packages/devkit/project.json @@ -48,7 +48,10 @@ "executor": "nx:run-commands", "outputs": ["{workspaceRoot}/build/packages/devkit"], "options": { - "command": "node ./scripts/copy-readme.js devkit" + "commands": [ + "node ./scripts/copy-readme.js devkit", + "node ./scripts/add-dependency-to-build.js devkit @nrwl/devkit" + ] } }, "lint": {} diff --git a/packages/devkit/src/generators/visit-not-ignored-files.ts b/packages/devkit/src/generators/visit-not-ignored-files.ts index b4571da88c6545..34822d16dca446 100644 --- a/packages/devkit/src/generators/visit-not-ignored-files.ts +++ b/packages/devkit/src/generators/visit-not-ignored-files.ts @@ -13,6 +13,7 @@ export function visitNotIgnoredFiles( let ig: Ignore; if (tree.exists('.gitignore')) { ig = ignore(); + ig.add('.git'); ig.add(tree.read('.gitignore', 'utf-8')); } dirPath = normalizePathRelativeToRoot(dirPath, tree.root); diff --git a/packages/devkit/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts b/packages/devkit/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts new file mode 100644 index 00000000000000..72be57949c678e --- /dev/null +++ b/packages/devkit/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts @@ -0,0 +1,38 @@ +import { createTreeWithEmptyWorkspace } from 'nx/src/generators/testing-utils/create-tree-with-empty-workspace'; +import { Tree } from 'nx/src/generators/tree'; +import { readJson, updateJson } from 'nx/src/generators/utils/json'; +import replacePackage from './update-16-0-0-add-nx-packages'; + +describe('update-16-0-0-add-nx-packages', () => { + let tree: Tree; + beforeEach(() => { + tree = createTreeWithEmptyWorkspace(); + + updateJson(tree, 'package.json', (json) => { + json.devDependencies['@nrwl/devkit'] = '16.0.0'; + return json; + }); + }); + + it('should remove the dependency on @nrwl/devkit', async () => { + await replacePackage(tree); + + expect( + readJson(tree, 'package.json').dependencies['@nrwl/devkit'] + ).not.toBeDefined(); + expect( + readJson(tree, 'package.json').devDependencies['@nrwl/devkit'] + ).not.toBeDefined(); + }); + + it('should add a dependency on @nx/devkit', async () => { + await replacePackage(tree); + + const packageJson = readJson(tree, 'package.json'); + const newDependencyVersion = + packageJson.devDependencies['@nx/devkit'] ?? + packageJson.dependencies['@nx/devkit']; + + expect(newDependencyVersion).toBeDefined(); + }); +}); diff --git a/packages/devkit/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts b/packages/devkit/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts new file mode 100644 index 00000000000000..625e9ab4302937 --- /dev/null +++ b/packages/devkit/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts @@ -0,0 +1,9 @@ +import type { Tree } from 'nx/src/generators/tree'; +import { formatFiles } from '../../generators/format-files'; +import { replaceNrwlPackageWithNxPackage } from '../../utils/replace-package'; + +export default async function replacePackage(tree: Tree): Promise { + await replaceNrwlPackageWithNxPackage(tree, '@nrwl/devkit', '@nx/devkit'); + + await formatFiles(tree); +} diff --git a/packages/devkit/src/utils/get-workspace-layout.spec.ts b/packages/devkit/src/utils/get-workspace-layout.spec.ts index 164f37516bc617..90603a94430367 100644 --- a/packages/devkit/src/utils/get-workspace-layout.spec.ts +++ b/packages/devkit/src/utils/get-workspace-layout.spec.ts @@ -1,4 +1,4 @@ -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { getWorkspaceLayout } from './get-workspace-layout'; describe('getWorkspaceLayout', () => { diff --git a/packages/devkit/src/utils/package-json.spec.ts b/packages/devkit/src/utils/package-json.spec.ts index 01e013e005f591..e066a6a0688529 100644 --- a/packages/devkit/src/utils/package-json.spec.ts +++ b/packages/devkit/src/utils/package-json.spec.ts @@ -459,8 +459,8 @@ describe('ensurePackage', () => { it('should return package when present', async () => { writeJson(tree, 'package.json', {}); - expect(ensurePackage('@nrwl/devkit', '>=15.0.0')).toEqual( - require('@nrwl/devkit') + expect(ensurePackage('@nx/devkit', '>=15.0.0')).toEqual( + require('@nx/devkit') ); // return void }); }); diff --git a/packages/devkit/src/utils/replace-package.spec.ts b/packages/devkit/src/utils/replace-package.spec.ts new file mode 100644 index 00000000000000..d4ffee7dcdc027 --- /dev/null +++ b/packages/devkit/src/utils/replace-package.spec.ts @@ -0,0 +1,172 @@ +import { replaceNrwlPackageWithNxPackage } from './replace-package'; + +import { Tree } from 'nx/src/generators/tree'; +import { createTreeWithEmptyWorkspace } from 'nx/src/generators/testing-utils/create-tree-with-empty-workspace'; +import { + addProjectConfiguration, + readNxJson, + readProjectConfiguration, + updateNxJson, + writeJson, + readJson, +} from 'nx/src/devkit-exports'; + +describe('replaceNrwlPackageWithNxPackage', () => { + let tree: Tree; + beforeAll(() => { + tree = createTreeWithEmptyWorkspace(); + + tree.write('README.txt', 'old-package'); + + writeJson(tree, 'package.json', { + name: 'source-code', + dependencies: { + 'old-package': '0.0.1', + }, + devDependencies: { + 'old-package': '0.0.1', + }, + }); + + writeJson(tree, 'packages/package1/package.json', { + name: 'package1', + dependencies: { + 'old-package': '0.0.1', + }, + devDependencies: { + 'old-package': '0.0.1', + }, + peerDependencies: { + 'old-package': '0.0.1', + }, + optionalDependencies: { + 'old-package': '0.0.1', + }, + }); + + addProjectConfiguration(tree, 'proj1', { + name: 'proj1', + root: 'proj1', + targets: { + build: { + executor: 'old-package:build', + options: { + key: 'value', + }, + }, + }, + generators: { + 'old-package': { + app: { + key: 'value', + }, + }, + }, + }); + + addProjectConfiguration(tree, 'proj2', { + name: 'proj2', + root: 'proj2', + }); + + updateNxJson(tree, { + generators: { + 'old-package': { + app: { + key: 'value', + }, + }, + }, + targetDefaults: { + build: { + executor: 'old-package:build', + options: { + key: 'value', + }, + }, + }, + }); + + replaceNrwlPackageWithNxPackage(tree, 'old-package', 'new-package'); + }); + + it('should update targets in the project configuration', () => { + expect(readProjectConfiguration(tree, 'proj1')).toEqual({ + $schema: '../node_modules/nx/schemas/project-schema.json', + generators: { + 'new-package': { + app: { + key: 'value', + }, + }, + }, + name: 'proj1', + root: 'proj1', + targets: { + build: { + executor: 'new-package:build', + options: { + key: 'value', + }, + }, + }, + }); + expect(readProjectConfiguration(tree, 'proj2')).toEqual({ + $schema: '../node_modules/nx/schemas/project-schema.json', + name: 'proj2', + root: 'proj2', + }); + }); + + it('should replace package in nx.json', () => { + expect(readNxJson(tree)).toEqual({ + generators: { + 'new-package': { + app: { + key: 'value', + }, + }, + }, + targetDefaults: { + build: { + executor: 'new-package:build', + options: { + key: 'value', + }, + }, + }, + }); + }); + + it('should replace package in package.json files', () => { + expect(readJson(tree, 'package.json')).toEqual({ + name: 'source-code', + dependencies: { + 'new-package': '0.0.1', + }, + devDependencies: { + 'new-package': '0.0.1', + }, + }); + expect(readJson(tree, 'packages/package1/package.json')).toEqual({ + name: 'package1', + dependencies: { + 'new-package': '0.0.1', + }, + devDependencies: { + 'new-package': '0.0.1', + }, + peerDependencies: { + 'new-package': '0.0.1', + }, + optionalDependencies: { + 'new-package': '0.0.1', + }, + }); + }); + + it('should replace any mentions in files', () => { + expect(tree.read('README.txt').toString()).toContain('new-package'); + expect(tree.read('README.txt').toString()).not.toContain('old-package'); + }); +}); diff --git a/packages/devkit/src/utils/replace-package.ts b/packages/devkit/src/utils/replace-package.ts new file mode 100644 index 00000000000000..d77c567171b125 --- /dev/null +++ b/packages/devkit/src/utils/replace-package.ts @@ -0,0 +1,166 @@ +import type { Tree } from 'nx/src/generators/tree'; +import type { PackageJson } from 'nx/src/utils/package-json'; +import { requireNx } from '../../nx'; +import { NX_VERSION } from './package-json'; +import { visitNotIgnoredFiles } from '../generators/visit-not-ignored-files'; +import { basename } from 'path'; + +const { + getProjects, + updateProjectConfiguration, + readNxJson, + updateNxJson, + updateJson, +} = requireNx(); + +export function replaceNrwlPackageWithNxPackage( + tree: Tree, + oldPackageName: string, + newPackageName: string +): void { + replacePackageInDependencies(tree, oldPackageName, newPackageName); + + replacePackageInProjectConfigurations(tree, oldPackageName, newPackageName); + + replacePackageInNxJson(tree, oldPackageName, newPackageName); + + replaceMentions(tree, oldPackageName, newPackageName); +} + +function replacePackageInDependencies( + tree: Tree, + oldPackageName: string, + newPackageName: string +) { + visitNotIgnoredFiles(tree, '.', (path) => { + if (basename(path) !== 'package.json') { + return; + } + + updateJson(tree, path, (packageJson) => { + for (const deps of [ + packageJson.dependencies ?? {}, + packageJson.devDependencies ?? {}, + packageJson.peerDependencies ?? {}, + packageJson.optionalDependencies ?? {}, + ]) { + if (oldPackageName in deps) { + deps[newPackageName] = NX_VERSION; + delete deps[oldPackageName]; + } + } + return packageJson; + }); + }); +} + +function replacePackageInProjectConfigurations( + tree: Tree, + oldPackageName: string, + newPackageName: string +) { + const projects = getProjects(tree); + + for (const [projectName, projectConfiguration] of projects) { + let needsUpdate = false; + + for (const [targetName, targetConfig] of Object.entries( + projectConfiguration.targets ?? {} + )) { + if (!targetConfig.executor) { + continue; + } + + const [pkg, executorName] = targetConfig.executor.split(':'); + if (pkg === oldPackageName) { + needsUpdate = true; + + projectConfiguration.targets[targetName].executor = + newPackageName + ':' + executorName; + } + } + + for (const [collection, collectionDefaults] of Object.entries( + projectConfiguration.generators ?? {} + )) { + if (collection === oldPackageName) { + needsUpdate = true; + + projectConfiguration.generators[newPackageName] = collectionDefaults; + delete projectConfiguration.generators[collection]; + } + } + + if (needsUpdate) { + updateProjectConfiguration(tree, projectName, projectConfiguration); + } + } +} + +function replacePackageInNxJson( + tree: Tree, + oldPackageName: string, + newPackageName: string +) { + if (!tree.exists('nx.json')) { + return; + } + + const nxJson = readNxJson(tree); + + let needsUpdate = false; + + for (const [targetName, targetConfig] of Object.entries( + nxJson.targetDefaults ?? {} + )) { + if (!targetConfig.executor) { + continue; + } + + const [pkg, executorName] = targetConfig.executor.split(':'); + if (pkg === oldPackageName) { + needsUpdate = true; + + nxJson.targetDefaults[targetName].executor = + newPackageName + ':' + executorName; + } + } + + for (const [collection, collectionDefaults] of Object.entries( + nxJson.generators ?? {} + )) { + if (collection === oldPackageName) { + needsUpdate = true; + + nxJson.generators[newPackageName] = collectionDefaults; + delete nxJson.generators[collection]; + } + } + + if (needsUpdate) { + updateNxJson(tree, nxJson); + } +} + +function replaceMentions( + tree: Tree, + oldPackageName: string, + newPackageName: string +) { + visitNotIgnoredFiles(tree, '.', (path) => { + if (['yarn.lock', 'package-lock.json', 'pnpm-lock.yaml'].includes(path)) { + return; + } + + const contents = tree.read(path).toString(); + + if (!contents.includes(oldPackageName)) { + return; + } + + tree.write( + path, + contents.replace(new RegExp(oldPackageName, 'g'), newPackageName) + ); + }); +} diff --git a/packages/esbuild/migrations.json b/packages/esbuild/migrations.json index 85b363d1938f67..89666f68c89c21 100644 --- a/packages/esbuild/migrations.json +++ b/packages/esbuild/migrations.json @@ -5,6 +5,12 @@ "version": "15.8.7-beta.0", "description": "Set generatePackageJson to true to maintain existing behavior of generating package.json in output path.", "factory": "./src/migrations/update-15-8-7/set-generate-package-json" + }, + "update-16-0-0-add-nx-packages": { + "cli": "nx", + "version": "16.0.0-beta.1", + "description": "Replace @nrwl/esbuild with @nx/esbuild", + "implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages" } }, "packageJsonUpdates": { diff --git a/packages/esbuild/migrations.spec.ts b/packages/esbuild/migrations.spec.ts index 6e38d8e8e94f08..acd833541cf32e 100644 --- a/packages/esbuild/migrations.spec.ts +++ b/packages/esbuild/migrations.spec.ts @@ -5,7 +5,9 @@ describe('esbuild migrations', () => { it('should have valid paths', () => { Object.values(json.generators).forEach((m: any) => { expect(() => - require.resolve(path.join(__dirname, `${m.factory}.ts`)) + require.resolve( + path.join(__dirname, `${m.factory ?? m.implementation}.ts`) + ) ).not.toThrow(); }); }); diff --git a/packages/esbuild/package.json b/packages/esbuild/package.json index 13649571cbb7d3..9625348454b529 100644 --- a/packages/esbuild/package.json +++ b/packages/esbuild/package.json @@ -1,5 +1,5 @@ { - "name": "@nrwl/esbuild", + "name": "@nx/esbuild", "version": "0.0.1", "private": false, "description": "The Nx Plugin for esbuild contains executors and generators that support building applications using esbuild", @@ -29,15 +29,14 @@ "migrations": "./migrations.json" }, "dependencies": { - "@nrwl/devkit": "file:../devkit", - "@nrwl/js": "file:../js", - "@nrwl/workspace": "file:../workspace", "chalk": "^4.1.0", "dotenv": "~10.0.0", "fast-glob": "3.2.7", "fs-extra": "^11.1.0", "tslib": "^2.3.0", - "tsconfig-paths": "^4.1.2" + "tsconfig-paths": "^4.1.2", + "@nx/devkit": "file:../devkit", + "@nx/js": "file:../js" }, "peerDependencies": { "esbuild": "~0.17.5" diff --git a/packages/esbuild/project.json b/packages/esbuild/project.json index 60989bba3cc814..a46988e4860092 100644 --- a/packages/esbuild/project.json +++ b/packages/esbuild/project.json @@ -48,7 +48,10 @@ "executor": "nx:run-commands", "outputs": ["{workspaceRoot}/build/packages/esbuild"], "options": { - "command": "node ./scripts/copy-readme.js esbuild" + "commands": [ + "node ./scripts/copy-readme.js esbuild", + "node ./scripts/add-dependency-to-build.js esbuild @nrwl/esbuild" + ] } }, "lint": {} diff --git a/packages/esbuild/src/executors/esbuild/compat.ts b/packages/esbuild/src/executors/esbuild/compat.ts index 08b24055e97692..4b0539b6e2df5f 100644 --- a/packages/esbuild/src/executors/esbuild/compat.ts +++ b/packages/esbuild/src/executors/esbuild/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import esbuildExecutor from './esbuild.impl'; diff --git a/packages/esbuild/src/executors/esbuild/esbuild.impl.ts b/packages/esbuild/src/executors/esbuild/esbuild.impl.ts index 26b07e0c688261..ea904e6302f2ba 100644 --- a/packages/esbuild/src/executors/esbuild/esbuild.impl.ts +++ b/packages/esbuild/src/executors/esbuild/esbuild.impl.ts @@ -1,7 +1,7 @@ import 'dotenv/config'; import * as chalk from 'chalk'; -import type { ExecutorContext } from '@nrwl/devkit'; -import { cacheDir, joinPathFragments, logger } from '@nrwl/devkit'; +import type { ExecutorContext } from '@nx/devkit'; +import { cacheDir, joinPathFragments, logger } from '@nx/devkit'; import { copyAssets, copyPackageJson, @@ -9,20 +9,20 @@ import { printDiagnostics, runTypeCheck as _runTypeCheck, TypeCheckOptions, -} from '@nrwl/js'; +} from '@nx/js'; import * as esbuild from 'esbuild'; import { normalizeOptions } from './lib/normalize'; import { EsBuildExecutorOptions } from './schema'; import { removeSync, writeJsonSync } from 'fs-extra'; -import { createAsyncIterable } from '@nrwl/devkit/src/utils/async-iterable'; +import { createAsyncIterable } from '@nx/devkit/src/utils/async-iterable'; import { buildEsbuildOptions, getOutExtension, getOutfile, } from './lib/build-esbuild-options'; import { getExtraDependencies } from './lib/get-extra-dependencies'; -import { DependentBuildableProjectNode } from '@nrwl/js/src/utils/buildable-libs-utils'; +import { DependentBuildableProjectNode } from '@nx/js/src/utils/buildable-libs-utils'; import { join } from 'path'; const BUILD_WATCH_FAILED = `[ ${chalk.red( diff --git a/packages/esbuild/src/executors/esbuild/lib/build-esbuild-options.ts b/packages/esbuild/src/executors/esbuild/lib/build-esbuild-options.ts index 270ca17c5b1046..4c302327bb8b69 100644 --- a/packages/esbuild/src/executors/esbuild/lib/build-esbuild-options.ts +++ b/packages/esbuild/src/executors/esbuild/lib/build-esbuild-options.ts @@ -6,7 +6,7 @@ import { joinPathFragments, normalizePath, ProjectGraphProjectNode, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { getClientEnvironment } from '../../../utils/environment-variables'; import { NormalizedEsBuildExecutorOptions } from '../schema'; diff --git a/packages/esbuild/src/executors/esbuild/lib/get-extra-dependencies.ts b/packages/esbuild/src/executors/esbuild/lib/get-extra-dependencies.ts index 5f00a6ace1e66f..5a9a1b1d7081c9 100644 --- a/packages/esbuild/src/executors/esbuild/lib/get-extra-dependencies.ts +++ b/packages/esbuild/src/executors/esbuild/lib/get-extra-dependencies.ts @@ -1,5 +1,5 @@ -import { ProjectGraph } from '@nrwl/devkit'; -import { DependentBuildableProjectNode } from '@nrwl/js/src/utils/buildable-libs-utils'; +import { ProjectGraph } from '@nx/devkit'; +import { DependentBuildableProjectNode } from '@nx/js/src/utils/buildable-libs-utils'; export function getExtraDependencies( projectName: string, diff --git a/packages/esbuild/src/executors/esbuild/lib/normalize.spec.ts b/packages/esbuild/src/executors/esbuild/lib/normalize.spec.ts index 1e7afd4fce7649..09f6d5bffe833b 100644 --- a/packages/esbuild/src/executors/esbuild/lib/normalize.spec.ts +++ b/packages/esbuild/src/executors/esbuild/lib/normalize.spec.ts @@ -1,5 +1,5 @@ import { normalizeOptions } from './normalize'; -import { ExecutorContext } from '@nrwl/devkit'; +import { ExecutorContext } from '@nx/devkit'; describe('normalizeOptions', () => { const context: ExecutorContext = { diff --git a/packages/esbuild/src/executors/esbuild/lib/normalize.ts b/packages/esbuild/src/executors/esbuild/lib/normalize.ts index c38a6ee1b92848..5ed21643f331f0 100644 --- a/packages/esbuild/src/executors/esbuild/lib/normalize.ts +++ b/packages/esbuild/src/executors/esbuild/lib/normalize.ts @@ -4,7 +4,7 @@ import { EsBuildExecutorOptions, NormalizedEsBuildExecutorOptions, } from '../schema'; -import { ExecutorContext, joinPathFragments, logger } from '@nrwl/devkit'; +import { ExecutorContext, joinPathFragments, logger } from '@nx/devkit'; import chalk = require('chalk'); import * as esbuild from 'esbuild'; diff --git a/packages/esbuild/src/executors/esbuild/schema.d.ts b/packages/esbuild/src/executors/esbuild/schema.d.ts index 1367c9da551ac0..b9274e313cd666 100644 --- a/packages/esbuild/src/executors/esbuild/schema.d.ts +++ b/packages/esbuild/src/executors/esbuild/schema.d.ts @@ -1,4 +1,4 @@ -import { AssetGlob } from '@nrwl/js/src/utils/assets/assets'; +import { AssetGlob } from '@nx/js/src/utils/assets/assets'; import * as esbuild from 'esbuild'; type Compiler = 'babel' | 'swc'; diff --git a/packages/esbuild/src/generators/esbuild-project/esbuild-project.spec.ts b/packages/esbuild/src/generators/esbuild-project/esbuild-project.spec.ts index 808c51bf3ce27c..8896152363f0eb 100644 --- a/packages/esbuild/src/generators/esbuild-project/esbuild-project.spec.ts +++ b/packages/esbuild/src/generators/esbuild-project/esbuild-project.spec.ts @@ -1,10 +1,10 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { addProjectConfiguration, readProjectConfiguration, writeJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import esbuildProjectGenerator from './esbuild-project'; describe('esbuildProjectGenerator', () => { diff --git a/packages/esbuild/src/generators/esbuild-project/esbuild-project.ts b/packages/esbuild/src/generators/esbuild-project/esbuild-project.ts index d10857859510d7..4d874bb2f4282c 100644 --- a/packages/esbuild/src/generators/esbuild-project/esbuild-project.ts +++ b/packages/esbuild/src/generators/esbuild-project/esbuild-project.ts @@ -1,4 +1,4 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { convertNxGenerator, formatFiles, @@ -8,7 +8,7 @@ import { readProjectConfiguration, updateProjectConfiguration, writeJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { esbuildInitGenerator } from '../init/init'; import { EsBuildExecutorOptions } from '../../executors/esbuild/schema'; diff --git a/packages/esbuild/src/generators/init/init.spec.ts b/packages/esbuild/src/generators/init/init.spec.ts index 702dc048ac30b6..dbe4f5e49cd3fc 100644 --- a/packages/esbuild/src/generators/init/init.spec.ts +++ b/packages/esbuild/src/generators/init/init.spec.ts @@ -1,5 +1,5 @@ -import { readJson, writeJson, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { readJson, writeJson, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { esbuildInitGenerator } from './init'; diff --git a/packages/esbuild/src/generators/init/init.ts b/packages/esbuild/src/generators/init/init.ts index 5d0bf059122976..ff29676fbcd85d 100644 --- a/packages/esbuild/src/generators/init/init.ts +++ b/packages/esbuild/src/generators/init/init.ts @@ -3,9 +3,9 @@ import { convertNxGenerator, formatFiles, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { Schema } from './schema'; -import { esbuildVersion } from '@nrwl/js/src/utils/versions'; +import { esbuildVersion } from '@nx/js/src/utils/versions'; export async function esbuildInitGenerator(tree: Tree, schema: Schema) { const task = addDependenciesToPackageJson( diff --git a/packages/esbuild/src/migrations/update-15-8-7/set-generate-package-json.spec.ts b/packages/esbuild/src/migrations/update-15-8-7/set-generate-package-json.spec.ts index c23eef22b457ce..b4b80472ce63cc 100644 --- a/packages/esbuild/src/migrations/update-15-8-7/set-generate-package-json.spec.ts +++ b/packages/esbuild/src/migrations/update-15-8-7/set-generate-package-json.spec.ts @@ -2,8 +2,8 @@ import { addProjectConfiguration, readProjectConfiguration, Tree, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import update from './set-generate-package-json'; describe('Migration: Set generatePackageJson', () => { diff --git a/packages/esbuild/src/migrations/update-15-8-7/set-generate-package-json.ts b/packages/esbuild/src/migrations/update-15-8-7/set-generate-package-json.ts index d2d85351679354..fce27f154885dd 100644 --- a/packages/esbuild/src/migrations/update-15-8-7/set-generate-package-json.ts +++ b/packages/esbuild/src/migrations/update-15-8-7/set-generate-package-json.ts @@ -1,9 +1,9 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { formatFiles, getProjects, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; export default async function update(tree: Tree): Promise { const projects = getProjects(tree); diff --git a/packages/esbuild/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts b/packages/esbuild/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts new file mode 100644 index 00000000000000..463bcdcc06a4db --- /dev/null +++ b/packages/esbuild/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts @@ -0,0 +1,37 @@ +import { Tree, readJson, updateJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import replacePackage from './update-16-0-0-add-nx-packages'; + +describe('update-16-0-0-add-nx-packages', () => { + let tree: Tree; + beforeEach(() => { + tree = createTreeWithEmptyWorkspace(); + + updateJson(tree, 'package.json', (json) => { + json.devDependencies['@nrwl/esbuild'] = '16.0.0'; + return json; + }); + }); + + it('should remove the dependency on @nrwl/esbuild', async () => { + await replacePackage(tree); + + expect( + readJson(tree, 'package.json').dependencies['@nrwl/esbuild'] + ).not.toBeDefined(); + expect( + readJson(tree, 'package.json').devDependencies['@nrwl/esbuild'] + ).not.toBeDefined(); + }); + + it('should add a dependency on @nx/esbuild', async () => { + await replacePackage(tree); + + const packageJson = readJson(tree, 'package.json'); + const newDependencyVersion = + packageJson.devDependencies['@nx/esbuild'] ?? + packageJson.dependencies['@nx/esbuild']; + + expect(newDependencyVersion).toBeDefined(); + }); +}); diff --git a/packages/esbuild/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts b/packages/esbuild/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts new file mode 100644 index 00000000000000..0f2fee0d7609d6 --- /dev/null +++ b/packages/esbuild/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts @@ -0,0 +1,8 @@ +import { Tree, formatFiles } from '@nx/devkit'; +import { replaceNrwlPackageWithNxPackage } from '@nx/devkit/src/utils/replace-package'; + +export default async function replacePackage(tree: Tree): Promise { + await replaceNrwlPackageWithNxPackage(tree, '@nrwl/esbuild', '@nx/esbuild'); + + await formatFiles(tree); +} diff --git a/packages/esbuild/src/utils/get-entry-points.ts b/packages/esbuild/src/utils/get-entry-points.ts index 6e5766e0075a96..c165fdd69166dc 100644 --- a/packages/esbuild/src/utils/get-entry-points.ts +++ b/packages/esbuild/src/utils/get-entry-points.ts @@ -1,4 +1,4 @@ -import { ExecutorContext, readJsonFile } from '@nrwl/devkit'; +import { ExecutorContext, readJsonFile } from '@nx/devkit'; import * as fs from 'fs'; import * as path from 'path'; import * as glob from 'fast-glob'; diff --git a/packages/eslint-plugin-nx/migrations.json b/packages/eslint-plugin-nx/migrations.json new file mode 100644 index 00000000000000..6f5c74a5751ecc --- /dev/null +++ b/packages/eslint-plugin-nx/migrations.json @@ -0,0 +1,12 @@ +{ + "generators": { + "update-16-0-0-add-nx-packages": { + "cli": "nx", + "version": "16.0.0-beta.1", + "description": "Replace @nrwl/eslint-plugin-nx with @nx/eslint-plugin-nx", + "implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages" + } + }, + "packageJsonUpdates": {}, + "version": "0.1" +} diff --git a/packages/eslint-plugin-nx/package.json b/packages/eslint-plugin-nx/package.json index dca0051cde88e4..569b6f6faafa19 100644 --- a/packages/eslint-plugin-nx/package.json +++ b/packages/eslint-plugin-nx/package.json @@ -1,5 +1,5 @@ { - "name": "@nrwl/eslint-plugin-nx", + "name": "@nx/eslint-plugin-nx", "version": "0.0.1", "private": false, "description": "The eslint-plugin-nx package is an ESLint plugin that contains a collection of recommended ESLint rule configurations which you can extend from in your own ESLint configs, as well as an Nx-specific lint rule called enforce-module-boundaries.", @@ -33,13 +33,16 @@ } }, "dependencies": { - "@nrwl/devkit": "file:../devkit", "@typescript-eslint/utils": "^5.58.0", "chalk": "^4.1.0", "confusing-browser-globals": "^1.0.9", - "semver": "7.3.4" + "semver": "7.3.4", + "@nx/devkit": "file:../devkit" }, "publishConfig": { "access": "public" + }, + "nx-migrations": { + "migrations": "./migrations.json" } } diff --git a/packages/eslint-plugin-nx/project.json b/packages/eslint-plugin-nx/project.json index 569c56d8463916..b950eb2a205048 100644 --- a/packages/eslint-plugin-nx/project.json +++ b/packages/eslint-plugin-nx/project.json @@ -49,7 +49,10 @@ "executor": "nx:run-commands", "outputs": ["{workspaceRoot}/build/packages/eslint-plugin-nx"], "options": { - "command": "node ./scripts/copy-readme.js eslint-plugin-nx" + "commands": [ + "node ./scripts/copy-readme.js eslint-plugin-nx", + "node ./scripts/add-dependency-to-build.js eslint-plugin-nx @nrwl/eslint-plugin-nx" + ] } }, "lint": {} diff --git a/packages/eslint-plugin-nx/src/configs/typescript.ts b/packages/eslint-plugin-nx/src/configs/typescript.ts index 3c0f0bbf6b9061..cf415f7020e394 100644 --- a/packages/eslint-plugin-nx/src/configs/typescript.ts +++ b/packages/eslint-plugin-nx/src/configs/typescript.ts @@ -1,4 +1,4 @@ -import { workspaceRoot } from '@nrwl/devkit'; +import { workspaceRoot } from '@nx/devkit'; import { packageExists } from '../utils/config-utils'; const isPrettierAvailable = diff --git a/packages/eslint-plugin-nx/src/constants.ts b/packages/eslint-plugin-nx/src/constants.ts index 16dcca79f219ae..ca2bcc1bad6122 100644 --- a/packages/eslint-plugin-nx/src/constants.ts +++ b/packages/eslint-plugin-nx/src/constants.ts @@ -1,4 +1,4 @@ -import { workspaceRoot } from '@nrwl/devkit'; +import { workspaceRoot } from '@nx/devkit'; import { join } from 'path'; export const WORKSPACE_PLUGIN_DIR = join(workspaceRoot, 'tools/eslint-rules'); diff --git a/packages/eslint-plugin-nx/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts b/packages/eslint-plugin-nx/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts new file mode 100644 index 00000000000000..81120e8754db52 --- /dev/null +++ b/packages/eslint-plugin-nx/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts @@ -0,0 +1,62 @@ +import { Tree, readJson, updateJson, writeJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import replacePackage from './update-16-0-0-add-nx-packages'; + +describe('update-16-0-0-add-nx-packages', () => { + let tree: Tree; + beforeEach(() => { + tree = createTreeWithEmptyWorkspace(); + + updateJson(tree, 'package.json', (json) => { + json.devDependencies['@nrwl/eslint-plugin-nx'] = '16.0.0'; + return json; + }); + }); + + it('should remove the dependency on @nrwl/eslint-plugin-nx', async () => { + await replacePackage(tree); + + expect( + readJson(tree, 'package.json').dependencies['@nrwl/eslint-plugin-nx'] + ).not.toBeDefined(); + expect( + readJson(tree, 'package.json').devDependencies['@nrwl/eslint-plugin-nx'] + ).not.toBeDefined(); + }); + + it('should add a dependency on @nx/eslint-plugin-nx', async () => { + await replacePackage(tree); + + const packageJson = readJson(tree, 'package.json'); + const newDependencyVersion = + packageJson.devDependencies['@nx/eslint-plugin-nx'] ?? + packageJson.dependencies['@nx/eslint-plugin-nx']; + + expect(newDependencyVersion).toBeDefined(); + }); + + it('should replace the eslint plugin', async () => { + writeJson(tree, '.eslintrc.json', { + plugins: ['@nrwl/nx'], + rules: { + '@nrwl/nx/enforce-module-boundaries': ['error', {}], + }, + }); + + await replacePackage(tree); + + expect(readJson(tree, '.eslintrc.json')).toMatchInlineSnapshot(` + { + "plugins": [ + "@nx/nx", + ], + "rules": { + "@nx/nx/enforce-module-boundaries": [ + "error", + {}, + ], + }, + } + `); + }); +}); diff --git a/packages/eslint-plugin-nx/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts b/packages/eslint-plugin-nx/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts new file mode 100644 index 00000000000000..c9d5d299712ff1 --- /dev/null +++ b/packages/eslint-plugin-nx/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts @@ -0,0 +1,14 @@ +import { Tree, formatFiles } from '@nx/devkit'; +import { replaceNrwlPackageWithNxPackage } from '@nx/devkit/src/utils/replace-package'; + +export default async function replacePackage(tree: Tree): Promise { + await replaceNrwlPackageWithNxPackage( + tree, + '@nrwl/eslint-plugin-nx', + '@nx/eslint-plugin-nx' + ); + + await replaceNrwlPackageWithNxPackage(tree, '@nrwl/nx', '@nx/nx'); + + await formatFiles(tree); +} diff --git a/packages/eslint-plugin-nx/src/rules/enforce-module-boundaries.spec.ts b/packages/eslint-plugin-nx/src/rules/enforce-module-boundaries.spec.ts index 42d13c85aafe4c..d9f306f21e1104 100644 --- a/packages/eslint-plugin-nx/src/rules/enforce-module-boundaries.spec.ts +++ b/packages/eslint-plugin-nx/src/rules/enforce-module-boundaries.spec.ts @@ -4,8 +4,8 @@ import type { FileData, ProjectGraph, ProjectGraphDependency, -} from '@nrwl/devkit'; -import { DependencyType } from '@nrwl/devkit'; +} from '@nx/devkit'; +import { DependencyType } from '@nx/devkit'; import * as parser from '@typescript-eslint/parser'; import { TSESLint } from '@typescript-eslint/utils'; import { vol } from 'memfs'; @@ -15,8 +15,8 @@ import enforceModuleBoundaries, { } from '../../src/rules/enforce-module-boundaries'; import { createProjectRootMappings } from 'nx/src/project-graph/utils/find-project-for-path'; -jest.mock('@nrwl/devkit', () => ({ - ...jest.requireActual('@nrwl/devkit'), +jest.mock('@nx/devkit', () => ({ + ...jest.requireActual('@nx/devkit'), workspaceRoot: '/root', })); diff --git a/packages/eslint-plugin-nx/src/rules/enforce-module-boundaries.ts b/packages/eslint-plugin-nx/src/rules/enforce-module-boundaries.ts index e7bf5c51319266..17d023a2e6ea64 100644 --- a/packages/eslint-plugin-nx/src/rules/enforce-module-boundaries.ts +++ b/packages/eslint-plugin-nx/src/rules/enforce-module-boundaries.ts @@ -4,7 +4,7 @@ import { ProjectGraphExternalNode, ProjectGraphProjectNode, workspaceRoot, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { isRelativePath } from 'nx/src/utils/fileutils'; import { checkCircularPath, diff --git a/packages/eslint-plugin-nx/src/rules/nx-plugin-checks.ts b/packages/eslint-plugin-nx/src/rules/nx-plugin-checks.ts index 87f7e660516d85..3241f7d643cab7 100644 --- a/packages/eslint-plugin-nx/src/rules/nx-plugin-checks.ts +++ b/packages/eslint-plugin-nx/src/rules/nx-plugin-checks.ts @@ -5,7 +5,7 @@ import { ProjectGraphProjectNode, readJsonFile, workspaceRoot, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { findProject, getSourceFilePath } from '../utils/runtime-lint-utils'; import { existsSync } from 'fs'; import { registerTsProject } from 'nx/src/utils/register'; diff --git a/packages/eslint-plugin-nx/src/utils/ast-utils.ts b/packages/eslint-plugin-nx/src/utils/ast-utils.ts index df3ec305e2f3d5..04075425456c47 100644 --- a/packages/eslint-plugin-nx/src/utils/ast-utils.ts +++ b/packages/eslint-plugin-nx/src/utils/ast-utils.ts @@ -2,12 +2,12 @@ import { joinPathFragments, ProjectGraphProjectNode, readJsonFile, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { findNodes } from 'nx/src/utils/typescript'; import { existsSync, readFileSync } from 'fs'; import { dirname } from 'path'; import ts = require('typescript'); -import { logger, workspaceRoot } from '@nrwl/devkit'; +import { logger, workspaceRoot } from '@nx/devkit'; function tryReadBaseJson() { try { diff --git a/packages/eslint-plugin-nx/src/utils/graph-utils.spec.ts b/packages/eslint-plugin-nx/src/utils/graph-utils.spec.ts index 6259f52efe5d5e..0d49eab2c33d90 100644 --- a/packages/eslint-plugin-nx/src/utils/graph-utils.spec.ts +++ b/packages/eslint-plugin-nx/src/utils/graph-utils.spec.ts @@ -1,4 +1,4 @@ -import type { ProjectGraph } from '@nrwl/devkit'; +import type { ProjectGraph } from '@nx/devkit'; import { checkCircularPath } from './graph-utils'; describe('should find the path between nodes', () => { diff --git a/packages/eslint-plugin-nx/src/utils/graph-utils.ts b/packages/eslint-plugin-nx/src/utils/graph-utils.ts index a750f879b8e4be..96fba8c43e7c99 100644 --- a/packages/eslint-plugin-nx/src/utils/graph-utils.ts +++ b/packages/eslint-plugin-nx/src/utils/graph-utils.ts @@ -2,7 +2,7 @@ import type { FileData, ProjectGraph, ProjectGraphProjectNode, -} from '@nrwl/devkit'; +} from '@nx/devkit'; interface Reach { graph: ProjectGraph; diff --git a/packages/eslint-plugin-nx/src/utils/project-graph-utils.ts b/packages/eslint-plugin-nx/src/utils/project-graph-utils.ts index bb1259e13bc7c2..457de2d918cd52 100644 --- a/packages/eslint-plugin-nx/src/utils/project-graph-utils.ts +++ b/packages/eslint-plugin-nx/src/utils/project-graph-utils.ts @@ -1,4 +1,4 @@ -import { ProjectGraph, readCachedProjectGraph } from '@nrwl/devkit'; +import { ProjectGraph, readCachedProjectGraph } from '@nx/devkit'; import { isTerminalRun } from './runtime-lint-utils'; import * as chalk from 'chalk'; import { diff --git a/packages/eslint-plugin-nx/src/utils/runtime-lint-utils.spec.ts b/packages/eslint-plugin-nx/src/utils/runtime-lint-utils.spec.ts index 2be51e7f82672c..6952b03cecccdb 100644 --- a/packages/eslint-plugin-nx/src/utils/runtime-lint-utils.spec.ts +++ b/packages/eslint-plugin-nx/src/utils/runtime-lint-utils.spec.ts @@ -4,7 +4,7 @@ import { ProjectGraph, ProjectGraphExternalNode, ProjectGraphProjectNode, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { DepConstraint, findConstraintsFor, diff --git a/packages/eslint-plugin-nx/src/utils/runtime-lint-utils.ts b/packages/eslint-plugin-nx/src/utils/runtime-lint-utils.ts index 30d9898fd611f2..73ccfcf4e83856 100644 --- a/packages/eslint-plugin-nx/src/utils/runtime-lint-utils.ts +++ b/packages/eslint-plugin-nx/src/utils/runtime-lint-utils.ts @@ -10,7 +10,7 @@ import { ProjectGraphExternalNode, ProjectGraphProjectNode, workspaceRoot, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { getPath, pathExists } from './graph-utils'; import { readFileIfExisting } from 'nx/src/utils/fileutils'; import { TargetProjectLocator } from 'nx/src/plugins/js/project-graph/build-dependencies/target-project-locator'; diff --git a/packages/expo/migrations.json b/packages/expo/migrations.json index b940fb045fe110..c1bb34f2d3bff7 100644 --- a/packages/expo/migrations.json +++ b/packages/expo/migrations.json @@ -47,6 +47,12 @@ "cli": "nx", "description": "Remove deprecated expo targets", "factory": "./src/migrations/update-16-0-0/remove-deprecated-targets" + }, + "update-16-0-0-add-nx-packages": { + "cli": "nx", + "version": "16.0.0-beta.1", + "description": "Replace @nrwl/expo with @nx/expo", + "implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages" } }, "packageJsonUpdates": { diff --git a/packages/expo/package.json b/packages/expo/package.json index 62fab978e4eea1..0746e3bd2cc8a7 100644 --- a/packages/expo/package.json +++ b/packages/expo/package.json @@ -1,5 +1,5 @@ { - "name": "@nrwl/expo", + "name": "@nx/expo", "version": "0.0.1", "private": false, "description": "The Expo Plugin for Nx contains executors and generators for managing and developing an expo application within your workspace. For example, you can directly build for different target platforms as well as generate projects and publish your code.", @@ -26,14 +26,6 @@ "main": "./index", "types": "index.d.ts", "dependencies": { - "@nrwl/detox": "file:../detox", - "@nrwl/devkit": "file:../devkit", - "@nrwl/jest": "file:../jest", - "@nrwl/js": "file:../js", - "@nrwl/linter": "file:../linter", - "@nrwl/react": "file:../react", - "@nrwl/webpack": "file:../webpack", - "@nrwl/workspace": "file:../workspace", "chalk": "^4.1.0", "enhanced-resolve": "^5.8.3", "fs-extra": "^11.1.0", @@ -41,7 +33,14 @@ "node-fetch": "^2.6.7", "tar-fs": "^2.1.1", "tsconfig-paths": "^4.1.2", - "tsconfig-paths-webpack-plugin": "^4.0.0" + "tsconfig-paths-webpack-plugin": "^4.0.0", + "@nx/detox": "file:../detox", + "@nx/devkit": "file:../devkit", + "@nx/jest": "file:../jest", + "@nx/js": "file:../js", + "@nx/linter": "file:../linter", + "@nx/react": "file:../react", + "@nx/webpack": "file:../webpack" }, "peerDependencies": { "expo": "^48.0.6" diff --git a/packages/expo/plugins/metro-resolver.ts b/packages/expo/plugins/metro-resolver.ts index 74153d2404f291..5a66c48ab0c063 100644 --- a/packages/expo/plugins/metro-resolver.ts +++ b/packages/expo/plugins/metro-resolver.ts @@ -5,7 +5,7 @@ import * as chalk from 'chalk'; import { CachedInputFileSystem, ResolverFactory } from 'enhanced-resolve'; import { dirname, join } from 'path'; import * as fs from 'fs'; -import { workspaceRoot } from '@nrwl/devkit'; +import { workspaceRoot } from '@nx/devkit'; /* * Use tsconfig to resolve additional workspace libs. diff --git a/packages/expo/plugins/with-nx-metro.ts b/packages/expo/plugins/with-nx-metro.ts index 7fd0b2998b7be4..18efe13b192e1c 100644 --- a/packages/expo/plugins/with-nx-metro.ts +++ b/packages/expo/plugins/with-nx-metro.ts @@ -1,4 +1,4 @@ -import { workspaceLayout, workspaceRoot } from '@nrwl/devkit'; +import { workspaceLayout, workspaceRoot } from '@nx/devkit'; import { join } from 'path'; import { existsSync } from 'fs-extra'; diff --git a/packages/expo/plugins/with-nx-webpack.ts b/packages/expo/plugins/with-nx-webpack.ts index 874a761be67667..d297412f985f0a 100644 --- a/packages/expo/plugins/with-nx-webpack.ts +++ b/packages/expo/plugins/with-nx-webpack.ts @@ -13,7 +13,7 @@ export async function withNxWebpack(config) { test: /\.(mjs|[jt]sx?)$/, exclude: /node_modules/, use: { - loader: require.resolve('@nrwl/webpack/src/utils/web-babel-loader.js'), + loader: require.resolve('@nx/webpack/src/utils/web-babel-loader.js'), options: { presets: [ [ diff --git a/packages/expo/project.json b/packages/expo/project.json index b02ad0fb7f3f63..4cf740e379b100 100644 --- a/packages/expo/project.json +++ b/packages/expo/project.json @@ -50,7 +50,10 @@ "executor": "nx:run-commands", "outputs": ["{workspaceRoot}/build/packages/expo"], "options": { - "command": "node ./scripts/copy-readme.js expo" + "commands": [ + "node ./scripts/copy-readme.js expo", + "node ./scripts/add-dependency-to-build.js expo @nrwl/expo" + ] } } }, diff --git a/packages/expo/src/executors/build-list/build-list.impl.ts b/packages/expo/src/executors/build-list/build-list.impl.ts index 166edbaf257612..65a90bffa5003a 100644 --- a/packages/expo/src/executors/build-list/build-list.impl.ts +++ b/packages/expo/src/executors/build-list/build-list.impl.ts @@ -1,4 +1,4 @@ -import { ExecutorContext, logger, names } from '@nrwl/devkit'; +import { ExecutorContext, logger, names } from '@nx/devkit'; import { join } from 'path'; import { ChildProcess, fork } from 'child_process'; diff --git a/packages/expo/src/executors/build-list/compat.ts b/packages/expo/src/executors/build-list/compat.ts index 9031c2275ec686..764bd063faf8c7 100644 --- a/packages/expo/src/executors/build-list/compat.ts +++ b/packages/expo/src/executors/build-list/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import buildListExecutor from './build-list.impl'; diff --git a/packages/expo/src/executors/build/build.impl.ts b/packages/expo/src/executors/build/build.impl.ts index c9e031a14ac7e7..8fbd1ce645d1cc 100644 --- a/packages/expo/src/executors/build/build.impl.ts +++ b/packages/expo/src/executors/build/build.impl.ts @@ -1,4 +1,4 @@ -import { ExecutorContext, names } from '@nrwl/devkit'; +import { ExecutorContext, names } from '@nx/devkit'; import { join } from 'path'; import { ChildProcess, fork } from 'child_process'; diff --git a/packages/expo/src/executors/build/compat.ts b/packages/expo/src/executors/build/compat.ts index 477ba0be5f653b..fc7908d20075b8 100644 --- a/packages/expo/src/executors/build/compat.ts +++ b/packages/expo/src/executors/build/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import buildExecutor from './build.impl'; diff --git a/packages/expo/src/executors/download/compat.ts b/packages/expo/src/executors/download/compat.ts index 5b860aa19b265f..7f1a89239cbe48 100644 --- a/packages/expo/src/executors/download/compat.ts +++ b/packages/expo/src/executors/download/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import downloadExecutor from './download.impl'; diff --git a/packages/expo/src/executors/download/download.impl.ts b/packages/expo/src/executors/download/download.impl.ts index 4fbc11226c7d68..971ff779dc0170 100644 --- a/packages/expo/src/executors/download/download.impl.ts +++ b/packages/expo/src/executors/download/download.impl.ts @@ -1,4 +1,4 @@ -import { ExecutorContext, logger, names } from '@nrwl/devkit'; +import { ExecutorContext, logger, names } from '@nx/devkit'; import { copyFile, createReadStream, diff --git a/packages/expo/src/executors/ensure-symlink/compat.ts b/packages/expo/src/executors/ensure-symlink/compat.ts index 94c2df8239aa6a..2b1fbac1599191 100644 --- a/packages/expo/src/executors/ensure-symlink/compat.ts +++ b/packages/expo/src/executors/ensure-symlink/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import ensureSymlinkExecutor from './ensure-symlink.impl'; diff --git a/packages/expo/src/executors/ensure-symlink/ensure-symlink.impl.ts b/packages/expo/src/executors/ensure-symlink/ensure-symlink.impl.ts index 72e3566f32c3d8..80207b9b50776e 100644 --- a/packages/expo/src/executors/ensure-symlink/ensure-symlink.impl.ts +++ b/packages/expo/src/executors/ensure-symlink/ensure-symlink.impl.ts @@ -1,4 +1,4 @@ -import { ExecutorContext } from '@nrwl/devkit'; +import { ExecutorContext } from '@nx/devkit'; import { ensureNodeModulesSymlink } from '../../utils/ensure-node-modules-symlink'; diff --git a/packages/expo/src/executors/export/compat.ts b/packages/expo/src/executors/export/compat.ts index 7bc584476207ac..b3d3c12d21d776 100644 --- a/packages/expo/src/executors/export/compat.ts +++ b/packages/expo/src/executors/export/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import exportExecutor from './export.impl'; diff --git a/packages/expo/src/executors/export/export.impl.ts b/packages/expo/src/executors/export/export.impl.ts index ecfb51e467b976..6aecc5e28ba694 100644 --- a/packages/expo/src/executors/export/export.impl.ts +++ b/packages/expo/src/executors/export/export.impl.ts @@ -1,4 +1,4 @@ -import { ExecutorContext, names } from '@nrwl/devkit'; +import { ExecutorContext, names } from '@nx/devkit'; import { ChildProcess, fork } from 'child_process'; import { join } from 'path'; diff --git a/packages/expo/src/executors/install/compat.ts b/packages/expo/src/executors/install/compat.ts index d9900bab859bb6..73aaed1b3481e2 100644 --- a/packages/expo/src/executors/install/compat.ts +++ b/packages/expo/src/executors/install/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import installExecutor from './install.impl'; diff --git a/packages/expo/src/executors/install/install.impl.ts b/packages/expo/src/executors/install/install.impl.ts index 1ea78a4edcf5d0..751219597718ee 100644 --- a/packages/expo/src/executors/install/install.impl.ts +++ b/packages/expo/src/executors/install/install.impl.ts @@ -1,4 +1,4 @@ -import { ExecutorContext, names } from '@nrwl/devkit'; +import { ExecutorContext, names } from '@nx/devkit'; import { ChildProcess, fork } from 'child_process'; import { join } from 'path'; diff --git a/packages/expo/src/executors/prebuild/compat.ts b/packages/expo/src/executors/prebuild/compat.ts index 75d6be9106885e..a8ede28bfcb24a 100644 --- a/packages/expo/src/executors/prebuild/compat.ts +++ b/packages/expo/src/executors/prebuild/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import prebuildExecutor from './prebuild.impl'; diff --git a/packages/expo/src/executors/prebuild/prebuild.impl.ts b/packages/expo/src/executors/prebuild/prebuild.impl.ts index cb0c9fc7ebcc07..3f52b411f746da 100644 --- a/packages/expo/src/executors/prebuild/prebuild.impl.ts +++ b/packages/expo/src/executors/prebuild/prebuild.impl.ts @@ -1,4 +1,4 @@ -import { ExecutorContext, names } from '@nrwl/devkit'; +import { ExecutorContext, names } from '@nx/devkit'; import { ChildProcess, fork } from 'child_process'; import { join } from 'path'; diff --git a/packages/expo/src/executors/run/compat.ts b/packages/expo/src/executors/run/compat.ts index 54c6c1a9704f80..8bda243d659a9e 100644 --- a/packages/expo/src/executors/run/compat.ts +++ b/packages/expo/src/executors/run/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import runExecutor from './run.impl'; diff --git a/packages/expo/src/executors/run/run.impl.ts b/packages/expo/src/executors/run/run.impl.ts index 411e23b2bfd450..360db77eeda450 100644 --- a/packages/expo/src/executors/run/run.impl.ts +++ b/packages/expo/src/executors/run/run.impl.ts @@ -1,4 +1,4 @@ -import { ExecutorContext, names } from '@nrwl/devkit'; +import { ExecutorContext, names } from '@nx/devkit'; import { join } from 'path'; import { ChildProcess, fork } from 'child_process'; import { platform } from 'os'; diff --git a/packages/expo/src/executors/start/compat.ts b/packages/expo/src/executors/start/compat.ts index dfc3aa7e71e14a..d0a895af818ad6 100644 --- a/packages/expo/src/executors/start/compat.ts +++ b/packages/expo/src/executors/start/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import startExecutor from './start.impl'; diff --git a/packages/expo/src/executors/start/start.impl.ts b/packages/expo/src/executors/start/start.impl.ts index 156b3786c53cea..69afafc19b0ff7 100644 --- a/packages/expo/src/executors/start/start.impl.ts +++ b/packages/expo/src/executors/start/start.impl.ts @@ -1,5 +1,5 @@ import * as chalk from 'chalk'; -import { ExecutorContext, logger, names } from '@nrwl/devkit'; +import { ExecutorContext, logger, names } from '@nx/devkit'; import { ChildProcess, fork } from 'child_process'; import { join } from 'path'; diff --git a/packages/expo/src/executors/sync-deps/compat.ts b/packages/expo/src/executors/sync-deps/compat.ts index 91634e4ee6cba6..a0a363f75c0eea 100644 --- a/packages/expo/src/executors/sync-deps/compat.ts +++ b/packages/expo/src/executors/sync-deps/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import syncDepsExecutor from './sync-deps.impl'; diff --git a/packages/expo/src/executors/sync-deps/sync-deps.impl.ts b/packages/expo/src/executors/sync-deps/sync-deps.impl.ts index a8a8e3dba37280..5dec1e81370424 100644 --- a/packages/expo/src/executors/sync-deps/sync-deps.impl.ts +++ b/packages/expo/src/executors/sync-deps/sync-deps.impl.ts @@ -6,7 +6,7 @@ import { ProjectGraph, readJsonFile, writeJsonFile, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { findAllNpmDependencies } from '../../utils/find-all-npm-dependencies'; diff --git a/packages/expo/src/executors/update/compat.ts b/packages/expo/src/executors/update/compat.ts index d3517da9a9e31c..d898a595f89b9f 100644 --- a/packages/expo/src/executors/update/compat.ts +++ b/packages/expo/src/executors/update/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import buildExecutor from './update.impl'; diff --git a/packages/expo/src/executors/update/update.impl.ts b/packages/expo/src/executors/update/update.impl.ts index e00aeb3297a4cd..212da4f437c317 100644 --- a/packages/expo/src/executors/update/update.impl.ts +++ b/packages/expo/src/executors/update/update.impl.ts @@ -1,4 +1,4 @@ -import { ExecutorContext, names } from '@nrwl/devkit'; +import { ExecutorContext, names } from '@nx/devkit'; import { join } from 'path'; import { ChildProcess, fork } from 'child_process'; diff --git a/packages/expo/src/generators/application/application.spec.ts b/packages/expo/src/generators/application/application.spec.ts index a8c4f7b3e6a14f..30bebfec880002 100644 --- a/packages/expo/src/generators/application/application.spec.ts +++ b/packages/expo/src/generators/application/application.spec.ts @@ -3,9 +3,9 @@ import { readJson, readProjectConfiguration, Tree, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { Linter } from '@nrwl/linter'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { Linter } from '@nx/linter'; import { expoApplicationGenerator } from './application'; describe('app', () => { diff --git a/packages/expo/src/generators/application/application.ts b/packages/expo/src/generators/application/application.ts index c473aee0563cd2..5dc65ab008edec 100644 --- a/packages/expo/src/generators/application/application.ts +++ b/packages/expo/src/generators/application/application.ts @@ -5,7 +5,7 @@ import { joinPathFragments, runTasksInSerial, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { addLinting } from '../../utils/add-linting'; import { addJest } from '../../utils/add-jest'; diff --git a/packages/expo/src/generators/application/lib/add-detox.ts b/packages/expo/src/generators/application/lib/add-detox.ts index d2a3c03cd4e153..1b7f77797ed545 100644 --- a/packages/expo/src/generators/application/lib/add-detox.ts +++ b/packages/expo/src/generators/application/lib/add-detox.ts @@ -1,7 +1,7 @@ -import { detoxApplicationGenerator } from '@nrwl/detox'; -import { Tree } from '@nrwl/devkit'; +import { detoxApplicationGenerator } from '@nx/detox'; +import { Tree } from '@nx/devkit'; import { NormalizedSchema } from './normalize-options'; -import { Linter } from '@nrwl/linter'; +import { Linter } from '@nx/linter'; export async function addDetox(host: Tree, options: NormalizedSchema) { if (options?.e2eTestRunner !== 'detox') { diff --git a/packages/expo/src/generators/application/lib/add-project.ts b/packages/expo/src/generators/application/lib/add-project.ts index a09d1992fca05e..243c904e27556a 100644 --- a/packages/expo/src/generators/application/lib/add-project.ts +++ b/packages/expo/src/generators/application/lib/add-project.ts @@ -4,7 +4,7 @@ import { ProjectConfiguration, TargetConfiguration, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { NormalizedSchema } from './normalize-options'; export function addProject(host: Tree, options: NormalizedSchema) { diff --git a/packages/expo/src/generators/application/lib/create-application-files.ts b/packages/expo/src/generators/application/lib/create-application-files.ts index 1e219c08ed2242..4efeee32010532 100644 --- a/packages/expo/src/generators/application/lib/create-application-files.ts +++ b/packages/expo/src/generators/application/lib/create-application-files.ts @@ -5,7 +5,7 @@ import { PackageManager, toJS, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { join } from 'path'; import { NormalizedSchema } from './normalize-options'; diff --git a/packages/expo/src/generators/application/lib/nomalize-options.spec.ts b/packages/expo/src/generators/application/lib/nomalize-options.spec.ts index 7fcf7476a21b4d..b1955d1a040f67 100644 --- a/packages/expo/src/generators/application/lib/nomalize-options.spec.ts +++ b/packages/expo/src/generators/application/lib/nomalize-options.spec.ts @@ -1,6 +1,6 @@ -import { Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { Linter } from '@nrwl/linter'; +import { Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { Linter } from '@nx/linter'; import { Schema } from '../schema'; import { normalizeOptions } from './normalize-options'; diff --git a/packages/expo/src/generators/application/lib/normalize-options.ts b/packages/expo/src/generators/application/lib/normalize-options.ts index d7ce343aaeb1ff..7eb2f9e06e8409 100644 --- a/packages/expo/src/generators/application/lib/normalize-options.ts +++ b/packages/expo/src/generators/application/lib/normalize-options.ts @@ -1,4 +1,4 @@ -import { getWorkspaceLayout, names, Tree } from '@nrwl/devkit'; +import { getWorkspaceLayout, names, Tree } from '@nx/devkit'; import { join } from 'path'; import { Schema } from '../schema'; diff --git a/packages/expo/src/generators/application/schema.d.ts b/packages/expo/src/generators/application/schema.d.ts index 279927eb60266c..ee0720edc6f90d 100644 --- a/packages/expo/src/generators/application/schema.d.ts +++ b/packages/expo/src/generators/application/schema.d.ts @@ -1,4 +1,4 @@ -import { Linter } from '@nrwl/linter'; +import { Linter } from '@nx/linter'; export interface Schema { name: string; diff --git a/packages/expo/src/generators/component/component.spec.ts b/packages/expo/src/generators/component/component.spec.ts index 7f4b213ed609ad..af3fe4184ee605 100644 --- a/packages/expo/src/generators/component/component.spec.ts +++ b/packages/expo/src/generators/component/component.spec.ts @@ -1,6 +1,6 @@ -import { logger, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { Linter } from '@nrwl/linter'; +import { logger, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { Linter } from '@nx/linter'; import expoApplicationGenerator from '../application/application'; import expoLibraryGenerator from '../library/library'; import { expoComponentGenerator } from './component'; diff --git a/packages/expo/src/generators/component/component.ts b/packages/expo/src/generators/component/component.ts index f1ccb40f7a0896..fec25e59760e31 100644 --- a/packages/expo/src/generators/component/component.ts +++ b/packages/expo/src/generators/component/component.ts @@ -9,7 +9,7 @@ import { joinPathFragments, toJS, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { NormalizedSchema, normalizeOptions } from './lib/normalize-options'; import { addImport } from './lib/add-import'; diff --git a/packages/expo/src/generators/component/lib/add-import.ts b/packages/expo/src/generators/component/lib/add-import.ts index 5e51c4bb21f736..3d2172caec2119 100644 --- a/packages/expo/src/generators/component/lib/add-import.ts +++ b/packages/expo/src/generators/component/lib/add-import.ts @@ -1,6 +1,6 @@ import { findNodes } from 'nx/src/utils/typescript'; import * as ts from 'typescript'; -import { ChangeType, StringChange } from '@nrwl/devkit'; +import { ChangeType, StringChange } from '@nx/devkit'; export function addImport( source: ts.SourceFile, diff --git a/packages/expo/src/generators/component/lib/normalize-options.ts b/packages/expo/src/generators/component/lib/normalize-options.ts index 23bc23c724f43a..186af0ed55f644 100644 --- a/packages/expo/src/generators/component/lib/normalize-options.ts +++ b/packages/expo/src/generators/component/lib/normalize-options.ts @@ -4,7 +4,7 @@ import { logger, names, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { Schema } from '../schema'; export interface NormalizedSchema extends Schema { diff --git a/packages/expo/src/generators/init/init.spec.ts b/packages/expo/src/generators/init/init.spec.ts index 521d5b89a6bf86..4228237931c6e4 100644 --- a/packages/expo/src/generators/init/init.spec.ts +++ b/packages/expo/src/generators/init/init.spec.ts @@ -1,5 +1,5 @@ -import { Tree, readJson, updateJson } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { Tree, readJson, updateJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { expoInitGenerator } from './init'; describe('init', () => { diff --git a/packages/expo/src/generators/init/init.ts b/packages/expo/src/generators/init/init.ts index 5830e887cdc9cb..4314cb51042835 100644 --- a/packages/expo/src/generators/init/init.ts +++ b/packages/expo/src/generators/init/init.ts @@ -6,7 +6,7 @@ import { removeDependenciesFromPackageJson, runTasksInSerial, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { Schema } from './schema'; import { babelPresetExpoVersion, @@ -31,9 +31,9 @@ import { typesReactVersion, } from '../../utils/versions'; -import { jestInitGenerator } from '@nrwl/jest'; -import { detoxInitGenerator } from '@nrwl/detox'; -import { initGenerator as jsInitGenerator } from '@nrwl/js'; +import { jestInitGenerator } from '@nx/jest'; +import { detoxInitGenerator } from '@nx/detox'; +import { initGenerator as jsInitGenerator } from '@nx/js'; import { addGitIgnoreEntry } from './lib/add-git-ignore-entry'; import { initRootBabelConfig } from './lib/init-root-babel-config'; diff --git a/packages/expo/src/generators/init/lib/add-git-ignore-entry.ts b/packages/expo/src/generators/init/lib/add-git-ignore-entry.ts index 5721bbbfe73746..c605c9fce0cc67 100644 --- a/packages/expo/src/generators/init/lib/add-git-ignore-entry.ts +++ b/packages/expo/src/generators/init/lib/add-git-ignore-entry.ts @@ -1,4 +1,4 @@ -import { logger, Tree } from '@nrwl/devkit'; +import { logger, Tree } from '@nx/devkit'; import { gitIgnoreEntriesForExpo } from './gitignore-entries'; export function addGitIgnoreEntry(host: Tree) { diff --git a/packages/expo/src/generators/init/lib/init-root-babel-config.ts b/packages/expo/src/generators/init/lib/init-root-babel-config.ts index a3f079a2ce479e..4b40e40d919fce 100644 --- a/packages/expo/src/generators/init/lib/init-root-babel-config.ts +++ b/packages/expo/src/generators/init/lib/init-root-babel-config.ts @@ -1,4 +1,4 @@ -import { Tree, writeJson } from '@nrwl/devkit'; +import { Tree, writeJson } from '@nx/devkit'; export function initRootBabelConfig(tree: Tree) { if (tree.exists('/babel.config.json') || tree.exists('/babel.config.js')) { diff --git a/packages/expo/src/generators/library/lib/normalize-options.ts b/packages/expo/src/generators/library/lib/normalize-options.ts index 8428f8523b35c5..85a6711cf2d7bc 100644 --- a/packages/expo/src/generators/library/lib/normalize-options.ts +++ b/packages/expo/src/generators/library/lib/normalize-options.ts @@ -4,7 +4,7 @@ import { joinPathFragments, names, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { Schema } from '../schema'; export interface NormalizedSchema extends Schema { diff --git a/packages/expo/src/generators/library/library.spec.ts b/packages/expo/src/generators/library/library.spec.ts index b63b51ee2f8ba8..24b9878a980c54 100644 --- a/packages/expo/src/generators/library/library.spec.ts +++ b/packages/expo/src/generators/library/library.spec.ts @@ -4,9 +4,9 @@ import { readProjectConfiguration, Tree, updateJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { Linter } from '@nrwl/linter'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { Linter } from '@nx/linter'; import { expoLibraryGenerator } from './library'; import { Schema } from './schema'; diff --git a/packages/expo/src/generators/library/library.ts b/packages/expo/src/generators/library/library.ts index b1d79b82ea8b00..91ce8823acbfa4 100644 --- a/packages/expo/src/generators/library/library.ts +++ b/packages/expo/src/generators/library/library.ts @@ -13,9 +13,9 @@ import { toJS, Tree, updateJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; -import { addTsConfigPath } from '@nrwl/js'; +import { addTsConfigPath } from '@nx/js'; import init from '../init/init'; import { addLinting } from '../../utils/add-linting'; diff --git a/packages/expo/src/generators/library/schema.d.ts b/packages/expo/src/generators/library/schema.d.ts index 1a0afcea781250..ab536a68f34428 100644 --- a/packages/expo/src/generators/library/schema.d.ts +++ b/packages/expo/src/generators/library/schema.d.ts @@ -1,4 +1,4 @@ -import { Linter } from '@nrwl/linter'; +import { Linter } from '@nx/linter'; /** * Same as the @nrwl/react library schema, except it removes keys: style, component, routing, appProject diff --git a/packages/expo/src/migrations/update-14-0-0/add-project-root-metro-config-14-0-0.spec.ts b/packages/expo/src/migrations/update-14-0-0/add-project-root-metro-config-14-0-0.spec.ts index b845ffbd8af62b..c5b0ec89409dca 100644 --- a/packages/expo/src/migrations/update-14-0-0/add-project-root-metro-config-14-0-0.spec.ts +++ b/packages/expo/src/migrations/update-14-0-0/add-project-root-metro-config-14-0-0.spec.ts @@ -1,5 +1,5 @@ -import { addProjectConfiguration, readJson, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { addProjectConfiguration, readJson, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import update from './add-project-root-metro-config-14-0-0'; @@ -26,7 +26,7 @@ describe('Add projectRoot option in metro.config.js', () => { tree.write( 'apps/products/metro.config.js', ` -const { withNxMetro } = require('@nrwl/react-native'); +const { withNxMetro } = require('@nx/react-native'); const { getDefaultConfig } = require('metro-config'); module.exports = (async () => { @@ -66,7 +66,7 @@ module.exports = (async () => { expect(tree.read('apps/products/metro.config.js', 'utf-8')) .toMatchInlineSnapshot(` - "const { withNxMetro } = require('@nrwl/react-native'); + "const { withNxMetro } = require('@nx/react-native'); const { getDefaultConfig } = require('metro-config'); module.exports = (async () => { @@ -110,7 +110,7 @@ module.exports = (async () => { tree.write( 'apps/products/metro.config.js', ` -const { withNxMetro } = require('@nrwl/react-native'); +const { withNxMetro } = require('@nx/react-native'); const { getDefaultConfig } = require('metro-config'); module.exports = (async () => { @@ -151,7 +151,7 @@ module.exports = (async () => { expect(tree.read('apps/products/metro.config.js', 'utf-8')) .toMatchInlineSnapshot(` - "const { withNxMetro } = require('@nrwl/react-native'); + "const { withNxMetro } = require('@nx/react-native'); const { getDefaultConfig } = require('metro-config'); module.exports = (async () => { diff --git a/packages/expo/src/migrations/update-14-0-0/add-project-root-metro-config-14-0-0.ts b/packages/expo/src/migrations/update-14-0-0/add-project-root-metro-config-14-0-0.ts index 8c0782ac494437..a561a30d7f5ddd 100644 --- a/packages/expo/src/migrations/update-14-0-0/add-project-root-metro-config-14-0-0.ts +++ b/packages/expo/src/migrations/update-14-0-0/add-project-root-metro-config-14-0-0.ts @@ -4,7 +4,7 @@ import { logger, stripIndents, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; /** * Add projectRoot and watchFolders options in metro.config.js diff --git a/packages/expo/src/migrations/update-14-1-2/add-eject-target-14-1-2.spec.ts b/packages/expo/src/migrations/update-14-1-2/add-eject-target-14-1-2.spec.ts index 1e87a4b1e6d215..173fc5b7208607 100644 --- a/packages/expo/src/migrations/update-14-1-2/add-eject-target-14-1-2.spec.ts +++ b/packages/expo/src/migrations/update-14-1-2/add-eject-target-14-1-2.spec.ts @@ -1,5 +1,5 @@ -import { addProjectConfiguration, getProjects, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { addProjectConfiguration, getProjects, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import update from './add-eject-target-14-1-2'; describe('add-eject-target-14-1-2', () => { diff --git a/packages/expo/src/migrations/update-14-1-2/add-eject-target-14-1-2.ts b/packages/expo/src/migrations/update-14-1-2/add-eject-target-14-1-2.ts index ed8146a22a9452..9cc53a92139030 100644 --- a/packages/expo/src/migrations/update-14-1-2/add-eject-target-14-1-2.ts +++ b/packages/expo/src/migrations/update-14-1-2/add-eject-target-14-1-2.ts @@ -3,7 +3,7 @@ import { formatFiles, getProjects, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; /** * Add eject to targets for expo app diff --git a/packages/expo/src/migrations/update-14-4-3/add-eas-build-target.spec.ts b/packages/expo/src/migrations/update-14-4-3/add-eas-build-target.spec.ts index cb5543eea9f563..997e8a3142d2ee 100644 --- a/packages/expo/src/migrations/update-14-4-3/add-eas-build-target.spec.ts +++ b/packages/expo/src/migrations/update-14-4-3/add-eas-build-target.spec.ts @@ -1,5 +1,5 @@ -import { addProjectConfiguration, getProjects, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { addProjectConfiguration, getProjects, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import update from './add-eas-build-target'; describe('add-eas-build-target', () => { diff --git a/packages/expo/src/migrations/update-14-4-3/add-eas-build-target.ts b/packages/expo/src/migrations/update-14-4-3/add-eas-build-target.ts index 55a4b36bb3707d..3acd185b5be196 100644 --- a/packages/expo/src/migrations/update-14-4-3/add-eas-build-target.ts +++ b/packages/expo/src/migrations/update-14-4-3/add-eas-build-target.ts @@ -3,7 +3,7 @@ import { formatFiles, getProjects, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { join } from 'path'; /** diff --git a/packages/expo/src/migrations/update-14-5-1/add-eas-update-target.spec.ts b/packages/expo/src/migrations/update-14-5-1/add-eas-update-target.spec.ts index cb77b6e9ee70f9..5c53ca04a8e507 100644 --- a/packages/expo/src/migrations/update-14-5-1/add-eas-update-target.spec.ts +++ b/packages/expo/src/migrations/update-14-5-1/add-eas-update-target.spec.ts @@ -1,5 +1,5 @@ -import { addProjectConfiguration, getProjects, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { addProjectConfiguration, getProjects, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import update from './add-eas-update-target'; describe('add-eas-update-target', () => { diff --git a/packages/expo/src/migrations/update-14-5-1/add-eas-update-target.ts b/packages/expo/src/migrations/update-14-5-1/add-eas-update-target.ts index d1b1aa7eebbdfd..fa10ffa1dcc807 100644 --- a/packages/expo/src/migrations/update-14-5-1/add-eas-update-target.ts +++ b/packages/expo/src/migrations/update-14-5-1/add-eas-update-target.ts @@ -3,7 +3,7 @@ import { formatFiles, getProjects, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; /** * Add eas update target for expo diff --git a/packages/expo/src/migrations/update-15-0-3/add-new-expo-cli-targets.spec.ts b/packages/expo/src/migrations/update-15-0-3/add-new-expo-cli-targets.spec.ts index bdc94f987100ff..68cc2483b07c4b 100644 --- a/packages/expo/src/migrations/update-15-0-3/add-new-expo-cli-targets.spec.ts +++ b/packages/expo/src/migrations/update-15-0-3/add-new-expo-cli-targets.spec.ts @@ -1,5 +1,5 @@ -import { addProjectConfiguration, getProjects, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { addProjectConfiguration, getProjects, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import update from './add-new-expo-cli-targets'; describe('add-eas-update-target', () => { diff --git a/packages/expo/src/migrations/update-15-0-3/add-new-expo-cli-targets.ts b/packages/expo/src/migrations/update-15-0-3/add-new-expo-cli-targets.ts index 61fb8776fc2e19..004368eb6e9555 100644 --- a/packages/expo/src/migrations/update-15-0-3/add-new-expo-cli-targets.ts +++ b/packages/expo/src/migrations/update-15-0-3/add-new-expo-cli-targets.ts @@ -4,7 +4,7 @@ import { getProjects, updateProjectConfiguration, offsetFromRoot, -} from '@nrwl/devkit'; +} from '@nx/devkit'; /** * Add new @expo/cli targets: diff --git a/packages/expo/src/migrations/update-15-0-3/change-jest-preset.spec.ts b/packages/expo/src/migrations/update-15-0-3/change-jest-preset.spec.ts index 05c871bc3172ca..79721f7d7104e5 100644 --- a/packages/expo/src/migrations/update-15-0-3/change-jest-preset.spec.ts +++ b/packages/expo/src/migrations/update-15-0-3/change-jest-preset.spec.ts @@ -3,8 +3,8 @@ import { readJson, Tree, updateJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import update from './change-jest-preset'; describe('Change expo jest preset', () => { diff --git a/packages/expo/src/migrations/update-15-0-3/change-jest-preset.ts b/packages/expo/src/migrations/update-15-0-3/change-jest-preset.ts index 0e7ecdc21a03e8..49b96bde78bca4 100644 --- a/packages/expo/src/migrations/update-15-0-3/change-jest-preset.ts +++ b/packages/expo/src/migrations/update-15-0-3/change-jest-preset.ts @@ -6,13 +6,13 @@ import { stripIndents, Tree, updateJson, -} from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; +} from '@nx/devkit'; +import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils'; import { addPropertyToJestConfig, removePropertyFromJestConfig, -} from '@nrwl/jest'; -import { JestExecutorOptions } from '@nrwl/jest/src/executors/jest/schema'; +} from '@nx/jest'; +import { JestExecutorOptions } from '@nx/jest/src/executors/jest/schema'; import { join } from 'path'; /** diff --git a/packages/expo/src/migrations/update-15-8-3/change-webpack-to-metro.spec.ts b/packages/expo/src/migrations/update-15-8-3/change-webpack-to-metro.spec.ts index f3b48ed46e2b79..628528af7a39fa 100644 --- a/packages/expo/src/migrations/update-15-8-3/change-webpack-to-metro.spec.ts +++ b/packages/expo/src/migrations/update-15-8-3/change-webpack-to-metro.spec.ts @@ -3,8 +3,8 @@ import { getProjects, readJson, Tree, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import update from './change-webpack-to-metro'; describe('change-webpack-to-metro', () => { diff --git a/packages/expo/src/migrations/update-15-8-3/change-webpack-to-metro.ts b/packages/expo/src/migrations/update-15-8-3/change-webpack-to-metro.ts index b5b24a9e2b1c10..4f641478b99189 100644 --- a/packages/expo/src/migrations/update-15-8-3/change-webpack-to-metro.ts +++ b/packages/expo/src/migrations/update-15-8-3/change-webpack-to-metro.ts @@ -4,7 +4,7 @@ import { getProjects, updateProjectConfiguration, updateJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; /** * Change webpack to metro diff --git a/packages/expo/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts b/packages/expo/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts new file mode 100644 index 00000000000000..9ee07dbc04ed9e --- /dev/null +++ b/packages/expo/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts @@ -0,0 +1,37 @@ +import { Tree, readJson, updateJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import replacePackage from './update-16-0-0-add-nx-packages'; + +describe('update-16-0-0-add-nx-packages', () => { + let tree: Tree; + beforeEach(() => { + tree = createTreeWithEmptyWorkspace(); + + updateJson(tree, 'package.json', (json) => { + json.devDependencies['@nrwl/expo'] = '16.0.0'; + return json; + }); + }); + + it('should remove the dependency on @nrwl/expo', async () => { + await replacePackage(tree); + + expect( + readJson(tree, 'package.json').dependencies['@nrwl/expo'] + ).not.toBeDefined(); + expect( + readJson(tree, 'package.json').devDependencies['@nrwl/expo'] + ).not.toBeDefined(); + }); + + it('should add a dependency on @nx/expo', async () => { + await replacePackage(tree); + + const packageJson = readJson(tree, 'package.json'); + const newDependencyVersion = + packageJson.devDependencies['@nx/expo'] ?? + packageJson.dependencies['@nx/expo']; + + expect(newDependencyVersion).toBeDefined(); + }); +}); diff --git a/packages/expo/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts b/packages/expo/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts new file mode 100644 index 00000000000000..9459acd38444c2 --- /dev/null +++ b/packages/expo/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts @@ -0,0 +1,8 @@ +import { Tree, formatFiles } from '@nx/devkit'; +import { replaceNrwlPackageWithNxPackage } from '@nx/devkit/src/utils/replace-package'; + +export default async function replacePackage(tree: Tree): Promise { + await replaceNrwlPackageWithNxPackage(tree, '@nrwl/expo', '@nx/expo'); + + await formatFiles(tree); +} diff --git a/packages/expo/src/migrations/update-16-0-0/remove-deprecated-targets.ts b/packages/expo/src/migrations/update-16-0-0/remove-deprecated-targets.ts index c5aa8385e937fc..188b715a3b84b0 100644 --- a/packages/expo/src/migrations/update-16-0-0/remove-deprecated-targets.ts +++ b/packages/expo/src/migrations/update-16-0-0/remove-deprecated-targets.ts @@ -3,7 +3,7 @@ import { formatFiles, getProjects, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; /** * Remove deprecated @expo/cli targets diff --git a/packages/expo/src/utils/add-jest.ts b/packages/expo/src/utils/add-jest.ts index 6b0673df9f4f34..82328da219de7b 100644 --- a/packages/expo/src/utils/add-jest.ts +++ b/packages/expo/src/utils/add-jest.ts @@ -1,5 +1,5 @@ -import { Tree } from '@nrwl/devkit'; -import { jestProjectGenerator } from '@nrwl/jest'; +import { Tree } from '@nx/devkit'; +import { jestProjectGenerator } from '@nx/jest'; export async function addJest( host: Tree, diff --git a/packages/expo/src/utils/add-linting.spec.ts b/packages/expo/src/utils/add-linting.spec.ts index 485d67e6796088..1a3fb6e63de45c 100644 --- a/packages/expo/src/utils/add-linting.spec.ts +++ b/packages/expo/src/utils/add-linting.spec.ts @@ -1,7 +1,7 @@ -import { readProjectConfiguration, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { Linter } from '@nrwl/linter'; -import { libraryGenerator } from '@nrwl/js'; +import { readProjectConfiguration, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { Linter } from '@nx/linter'; +import { libraryGenerator } from '@nx/js'; import { addLinting } from './add-linting'; describe('Add Linting', () => { diff --git a/packages/expo/src/utils/add-linting.ts b/packages/expo/src/utils/add-linting.ts index 3b51172c17dbae..01f4e9692b1c6a 100644 --- a/packages/expo/src/utils/add-linting.ts +++ b/packages/expo/src/utils/add-linting.ts @@ -1,12 +1,12 @@ -import { Linter, lintProjectGenerator } from '@nrwl/linter'; +import { Linter, lintProjectGenerator } from '@nx/linter'; import { addDependenciesToPackageJson, joinPathFragments, runTasksInSerial, Tree, updateJson, -} from '@nrwl/devkit'; -import { extendReactEslintJson, extraEslintDependencies } from '@nrwl/react'; +} from '@nx/devkit'; +import { extendReactEslintJson, extraEslintDependencies } from '@nx/react'; import type { Linter as ESLintLinter } from 'eslint'; export async function addLinting( diff --git a/packages/expo/src/utils/find-all-npm-dependencies.spec.ts b/packages/expo/src/utils/find-all-npm-dependencies.spec.ts index afa844b21c1e51..9c60f051156446 100644 --- a/packages/expo/src/utils/find-all-npm-dependencies.spec.ts +++ b/packages/expo/src/utils/find-all-npm-dependencies.spec.ts @@ -1,5 +1,5 @@ import { findAllNpmDependencies } from './find-all-npm-dependencies'; -import { DependencyType, ProjectGraph } from '@nrwl/devkit'; +import { DependencyType, ProjectGraph } from '@nx/devkit'; test('findAllNpmDependencies', () => { const graph: ProjectGraph = { diff --git a/packages/expo/src/utils/find-all-npm-dependencies.ts b/packages/expo/src/utils/find-all-npm-dependencies.ts index 30b0551794f43e..580a70e0c87366 100644 --- a/packages/expo/src/utils/find-all-npm-dependencies.ts +++ b/packages/expo/src/utils/find-all-npm-dependencies.ts @@ -1,4 +1,4 @@ -import { ProjectGraph } from '@nrwl/devkit'; +import { ProjectGraph } from '@nx/devkit'; export function findAllNpmDependencies( graph: ProjectGraph, diff --git a/packages/expo/src/utils/pod-install-task.ts b/packages/expo/src/utils/pod-install-task.ts index fda361d92a0f1d..9fb466b55d2d82 100644 --- a/packages/expo/src/utils/pod-install-task.ts +++ b/packages/expo/src/utils/pod-install-task.ts @@ -1,7 +1,7 @@ import { execSync } from 'child_process'; import { platform } from 'os'; import * as chalk from 'chalk'; -import { GeneratorCallback, logger } from '@nrwl/devkit'; +import { GeneratorCallback, logger } from '@nx/devkit'; const podInstallErrorMessage = ` Running ${chalk.bold('pod install')} failed, see above. diff --git a/packages/expo/src/utils/symlink-task.ts b/packages/expo/src/utils/symlink-task.ts index bc527097d20ab1..08bc05949c7a19 100644 --- a/packages/expo/src/utils/symlink-task.ts +++ b/packages/expo/src/utils/symlink-task.ts @@ -1,6 +1,6 @@ import { ensureNodeModulesSymlink } from './ensure-node-modules-symlink'; import * as chalk from 'chalk'; -import { GeneratorCallback, logger } from '@nrwl/devkit'; +import { GeneratorCallback, logger } from '@nx/devkit'; export function runSymlink( workspaceRoot: string, diff --git a/packages/express/migrations.json b/packages/express/migrations.json index b1e28ae321ee81..c302e2d554fbc0 100644 --- a/packages/express/migrations.json +++ b/packages/express/migrations.json @@ -1,5 +1,12 @@ { - "generators": {}, + "generators": { + "update-16-0-0-add-nx-packages": { + "cli": "nx", + "version": "16.0.0-beta.1", + "description": "Replace @nrwl/express with @nx/express", + "implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages" + } + }, "packageJsonUpdates": { "13.7.0": { "version": "13.7.0", diff --git a/packages/express/migrations.spec.ts b/packages/express/migrations.spec.ts index db336c96841c3a..396880ec7f816c 100644 --- a/packages/express/migrations.spec.ts +++ b/packages/express/migrations.spec.ts @@ -5,7 +5,9 @@ describe('Express migrations', () => { it('should have valid paths', () => { Object.values(json.generators).forEach((m: any) => { expect(() => - require.resolve(path.join(__dirname, `${m.factory}.ts`)) + require.resolve( + path.join(__dirname, `${m.factory ?? m.implementation}.ts`) + ) ).not.toThrow(); }); }); diff --git a/packages/express/package.json b/packages/express/package.json index 7b4bc15b456f06..9f8319d27bcdb9 100644 --- a/packages/express/package.json +++ b/packages/express/package.json @@ -1,5 +1,5 @@ { - "name": "@nrwl/express", + "name": "@nx/express", "version": "0.0.1", "private": false, "description": "The Nx Plugin for Express contains executors and generators for allowing your workspace to create powerful Express Node applications and APIs.", @@ -30,9 +30,8 @@ "migrations": "./migrations.json" }, "dependencies": { - "@nrwl/devkit": "file:../devkit", - "@nrwl/node": "file:../node", - "@nrwl/workspace": "file:../workspace" + "@nx/devkit": "file:../devkit", + "@nx/node": "file:../node" }, "peerDependencies": { "express": "^4.18.1" diff --git a/packages/express/project.json b/packages/express/project.json index 13b281b04eea2e..39cb69fdc1b1c4 100644 --- a/packages/express/project.json +++ b/packages/express/project.json @@ -48,7 +48,10 @@ "executor": "nx:run-commands", "outputs": ["{workspaceRoot}/build/packages/express"], "options": { - "command": "node ./scripts/copy-readme.js express" + "commands": [ + "node ./scripts/copy-readme.js express", + "node ./scripts/add-dependency-to-build.js express @nrwl/express" + ] } }, "lint": {} diff --git a/packages/express/src/generators/application/application.spec.ts b/packages/express/src/generators/application/application.spec.ts index 1f4e4f64d57df8..4c39069ee58fe2 100644 --- a/packages/express/src/generators/application/application.spec.ts +++ b/packages/express/src/generators/application/application.spec.ts @@ -1,5 +1,5 @@ -import { readJson, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { readJson, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { applicationGenerator } from './application'; import { Schema } from './schema'; diff --git a/packages/express/src/generators/application/application.ts b/packages/express/src/generators/application/application.ts index e977e38d765f7d..58a98625984d26 100644 --- a/packages/express/src/generators/application/application.ts +++ b/packages/express/src/generators/application/application.ts @@ -7,9 +7,9 @@ import { names, toJS, updateJson, -} from '@nrwl/devkit'; -import type { Tree } from '@nrwl/devkit'; -import { applicationGenerator as nodeApplicationGenerator } from '@nrwl/node'; +} from '@nx/devkit'; +import type { Tree } from '@nx/devkit'; +import { applicationGenerator as nodeApplicationGenerator } from '@nx/node'; import { join } from 'path'; import { initGenerator } from '../init/init'; import type { Schema } from './schema'; diff --git a/packages/express/src/generators/application/schema.d.ts b/packages/express/src/generators/application/schema.d.ts index a1e7431f654f2e..1ec7eff6ee7ab0 100644 --- a/packages/express/src/generators/application/schema.d.ts +++ b/packages/express/src/generators/application/schema.d.ts @@ -1,5 +1,5 @@ import { UnitTestRunner } from '../../utils/test-runners'; -import type { Linter } from '@nrwl/linter'; +import type { Linter } from '@nx/linter'; export interface Schema { name: string; diff --git a/packages/express/src/generators/init/init.spec.ts b/packages/express/src/generators/init/init.spec.ts index 8abda1c9415e47..c6d8113ebf5da8 100644 --- a/packages/express/src/generators/init/init.spec.ts +++ b/packages/express/src/generators/init/init.spec.ts @@ -3,10 +3,10 @@ import { readJson, NxJsonConfiguration, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { expressVersion } from '../../utils/versions'; import initGenerator from './init'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; describe('init', () => { let tree: Tree; diff --git a/packages/express/src/generators/init/init.ts b/packages/express/src/generators/init/init.ts index 7db2787112f1bd..951728e33008ed 100644 --- a/packages/express/src/generators/init/init.ts +++ b/packages/express/src/generators/init/init.ts @@ -4,9 +4,9 @@ import { formatFiles, removeDependenciesFromPackageJson, Tree, -} from '@nrwl/devkit'; -import { initGenerator as nodeInitGenerator } from '@nrwl/node'; -import { tslibVersion } from '@nrwl/node/src/utils/versions'; +} from '@nx/devkit'; +import { initGenerator as nodeInitGenerator } from '@nx/node'; +import { tslibVersion } from '@nx/node/src/utils/versions'; import { expressTypingsVersion, expressVersion, diff --git a/packages/express/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts b/packages/express/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts new file mode 100644 index 00000000000000..856c86a57b4855 --- /dev/null +++ b/packages/express/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts @@ -0,0 +1,37 @@ +import { Tree, readJson, updateJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import replacePackage from './update-16-0-0-add-nx-packages'; + +describe('update-16-0-0-add-nx-packages', () => { + let tree: Tree; + beforeEach(() => { + tree = createTreeWithEmptyWorkspace(); + + updateJson(tree, 'package.json', (json) => { + json.devDependencies['@nrwl/express'] = '16.0.0'; + return json; + }); + }); + + it('should remove the dependency on @nrwl/express', async () => { + await replacePackage(tree); + + expect( + readJson(tree, 'package.json').dependencies['@nrwl/express'] + ).not.toBeDefined(); + expect( + readJson(tree, 'package.json').devDependencies['@nrwl/express'] + ).not.toBeDefined(); + }); + + it('should add a dependency on @nx/express', async () => { + await replacePackage(tree); + + const packageJson = readJson(tree, 'package.json'); + const newDependencyVersion = + packageJson.devDependencies['@nx/express'] ?? + packageJson.dependencies['@nx/express']; + + expect(newDependencyVersion).toBeDefined(); + }); +}); diff --git a/packages/express/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts b/packages/express/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts new file mode 100644 index 00000000000000..5ac86ccf454f03 --- /dev/null +++ b/packages/express/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts @@ -0,0 +1,8 @@ +import { Tree, formatFiles } from '@nx/devkit'; +import { replaceNrwlPackageWithNxPackage } from '@nx/devkit/src/utils/replace-package'; + +export default async function replacePackage(tree: Tree): Promise { + await replaceNrwlPackageWithNxPackage(tree, '@nrwl/express', '@nx/express'); + + await formatFiles(tree); +} diff --git a/packages/jest/migrations.json b/packages/jest/migrations.json index 64c6b207a30296..303c2e41b73eef 100644 --- a/packages/jest/migrations.json +++ b/packages/jest/migrations.json @@ -89,6 +89,12 @@ "cli": "nx", "description": "Update jest test files to support jest 29 changes (https://jestjs.io/docs/upgrading-to-jest29)", "factory": "./src/migrations/update-15-8-0/update-tests-jest-29" + }, + "update-16-0-0-add-nx-packages": { + "cli": "nx", + "version": "16.0.0-beta.1", + "description": "Replace @nrwl/jest with @nx/jest", + "implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages" } }, "packageJsonUpdates": { diff --git a/packages/jest/migrations.spec.ts b/packages/jest/migrations.spec.ts index d9dbdf0593ee20..e6720a891adcef 100644 --- a/packages/jest/migrations.spec.ts +++ b/packages/jest/migrations.spec.ts @@ -1,11 +1,14 @@ import path = require('path'); import json = require('./migrations.json'); +import { MigrationsJsonEntry } from 'nx/src/config/misc-interfaces'; describe('Jest migrations', () => { it('should have valid paths', () => { - Object.values(json.generators).forEach((m) => { + Object.values(json.generators).forEach((m: MigrationsJsonEntry) => { expect(() => - require.resolve(path.join(__dirname, `${m.factory}.ts`)) + require.resolve( + path.join(__dirname, `${m.factory ?? m.implementation}.ts`) + ) ).not.toThrow(); }); }); diff --git a/packages/jest/package.json b/packages/jest/package.json index 6f5230cf4deb6a..075094af1e8940 100644 --- a/packages/jest/package.json +++ b/packages/jest/package.json @@ -1,5 +1,5 @@ { - "name": "@nrwl/jest", + "name": "@nx/jest", "version": "0.0.1", "private": false, "description": "The Nx Plugin for Jest contains executors and generators allowing your workspace to use the powerful Jest testing capabilities.", @@ -36,8 +36,6 @@ "dependencies": { "@jest/reporters": "^29.4.1", "@jest/test-result": "^29.4.1", - "@nrwl/devkit": "file:../devkit", - "@nrwl/js": "file:../js", "@phenomnomnominal/tsquery": "~5.0.1", "chalk": "^4.1.0", "dotenv": "~10.0.0", @@ -46,7 +44,9 @@ "jest-resolve": "^29.4.1", "jest-util": "^29.4.1", "resolve.exports": "1.1.0", - "tslib": "^2.3.0" + "tslib": "^2.3.0", + "@nx/devkit": "file:../devkit", + "@nx/js": "file:../js" }, "publishConfig": { "access": "public" diff --git a/packages/jest/project.json b/packages/jest/project.json index 41091ea4da11de..94197d667f48d5 100644 --- a/packages/jest/project.json +++ b/packages/jest/project.json @@ -48,7 +48,10 @@ "executor": "nx:run-commands", "outputs": ["{workspaceRoot}/build/packages/jest"], "options": { - "command": "node ./scripts/copy-readme.js jest" + "commands": [ + "node ./scripts/copy-readme.js jest", + "node ./scripts/add-dependency-to-build.js jest @nrwl/jest" + ] } }, "lint": {} diff --git a/packages/jest/src/executors/jest/compat.ts b/packages/jest/src/executors/jest/compat.ts index 5e83b59b8ab030..5211fd6b87f59d 100644 --- a/packages/jest/src/executors/jest/compat.ts +++ b/packages/jest/src/executors/jest/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import { default as jestExecutor } from './jest.impl'; diff --git a/packages/jest/src/executors/jest/jest.impl.spec.ts b/packages/jest/src/executors/jest/jest.impl.spec.ts index 59710700bb177b..9dd7940c896935 100644 --- a/packages/jest/src/executors/jest/jest.impl.spec.ts +++ b/packages/jest/src/executors/jest/jest.impl.spec.ts @@ -15,7 +15,7 @@ jest.mock('jest-config', () => ({ readConfig, })); -import { ExecutorContext } from '@nrwl/devkit'; +import { ExecutorContext } from '@nx/devkit'; import { jestExecutor } from './jest.impl'; import { JestExecutorOptions } from './schema'; diff --git a/packages/jest/src/executors/jest/jest.impl.ts b/packages/jest/src/executors/jest/jest.impl.ts index 4013fcba20a935..310ff34516720a 100644 --- a/packages/jest/src/executors/jest/jest.impl.ts +++ b/packages/jest/src/executors/jest/jest.impl.ts @@ -12,7 +12,7 @@ import { stripIndents, TaskGraph, workspaceRoot, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { getSummary } from './summary'; import { readFileSync } from 'fs'; import type { BatchResults } from 'nx/src/tasks-runner/batch/batch-messages'; diff --git a/packages/jest/src/generators/init/init.spec.ts b/packages/jest/src/generators/init/init.spec.ts index a2edbad8acb8a7..d73940db6662cd 100644 --- a/packages/jest/src/generators/init/init.spec.ts +++ b/packages/jest/src/generators/init/init.spec.ts @@ -7,8 +7,8 @@ import { Tree, updateJson, writeJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { jestInitGenerator } from './init'; describe('jest', () => { diff --git a/packages/jest/src/generators/init/init.ts b/packages/jest/src/generators/init/init.ts index 3fd685abb04c06..227b79899cff92 100644 --- a/packages/jest/src/generators/init/init.ts +++ b/packages/jest/src/generators/init/init.ts @@ -11,8 +11,8 @@ import { updateJson, updateNxJson, updateProjectConfiguration, -} from '@nrwl/devkit'; -import { initGenerator as jsInitGenerator } from '@nrwl/js'; +} from '@nx/devkit'; +import { initGenerator as jsInitGenerator } from '@nx/js'; import { findRootJestConfig } from '../../utils/config/find-root-jest-files'; import { diff --git a/packages/jest/src/generators/jest-project/jest-project.spec.ts b/packages/jest/src/generators/jest-project/jest-project.spec.ts index 4b345f1e0dff62..add9ad31194a9d 100644 --- a/packages/jest/src/generators/jest-project/jest-project.spec.ts +++ b/packages/jest/src/generators/jest-project/jest-project.spec.ts @@ -4,8 +4,8 @@ import { readProjectConfiguration, Tree, writeJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { jestConfigObject } from '../../utils/config/functions'; import { jestProjectGenerator } from './jest-project'; diff --git a/packages/jest/src/generators/jest-project/jest-project.ts b/packages/jest/src/generators/jest-project/jest-project.ts index f3af021e1b2c1b..4c772b10e560f8 100644 --- a/packages/jest/src/generators/jest-project/jest-project.ts +++ b/packages/jest/src/generators/jest-project/jest-project.ts @@ -10,7 +10,7 @@ import { convertNxGenerator, GeneratorCallback, readProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; const schemaDefaults = { setupFile: 'none', diff --git a/packages/jest/src/generators/jest-project/lib/check-for-test-target.ts b/packages/jest/src/generators/jest-project/lib/check-for-test-target.ts index d1c2405bd589e3..a84632245e7910 100644 --- a/packages/jest/src/generators/jest-project/lib/check-for-test-target.ts +++ b/packages/jest/src/generators/jest-project/lib/check-for-test-target.ts @@ -1,4 +1,4 @@ -import { readProjectConfiguration, Tree } from '@nrwl/devkit'; +import { readProjectConfiguration, Tree } from '@nx/devkit'; import { NormalizedJestProjectSchema } from '../schema'; export function checkForTestTarget( diff --git a/packages/jest/src/generators/jest-project/lib/create-files.ts b/packages/jest/src/generators/jest-project/lib/create-files.ts index 2995f1551c87fe..6188e440b04048 100644 --- a/packages/jest/src/generators/jest-project/lib/create-files.ts +++ b/packages/jest/src/generators/jest-project/lib/create-files.ts @@ -3,7 +3,7 @@ import { offsetFromRoot, readProjectConfiguration, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { join } from 'path'; import { NormalizedJestProjectSchema } from '../schema'; diff --git a/packages/jest/src/generators/jest-project/lib/update-jestconfig.ts b/packages/jest/src/generators/jest-project/lib/update-jestconfig.ts index 1aa9d449dd0f6b..f9eef9fa6943e3 100644 --- a/packages/jest/src/generators/jest-project/lib/update-jestconfig.ts +++ b/packages/jest/src/generators/jest-project/lib/update-jestconfig.ts @@ -1,7 +1,7 @@ import { findRootJestConfig } from '../../../utils/config/find-root-jest-files'; import { NormalizedJestProjectSchema } from '../schema'; import { addPropertyToJestConfig } from '../../../utils/config/update-config'; -import { readProjectConfiguration, Tree } from '@nrwl/devkit'; +import { readProjectConfiguration, Tree } from '@nx/devkit'; function isUsingUtilityFunction(host: Tree) { const rootConfig = findRootJestConfig(host); diff --git a/packages/jest/src/generators/jest-project/lib/update-tsconfig.ts b/packages/jest/src/generators/jest-project/lib/update-tsconfig.ts index 8d834293aa6936..340c4bf12ea760 100644 --- a/packages/jest/src/generators/jest-project/lib/update-tsconfig.ts +++ b/packages/jest/src/generators/jest-project/lib/update-tsconfig.ts @@ -1,6 +1,6 @@ import { join } from 'path'; import { NormalizedJestProjectSchema } from '../schema'; -import { readProjectConfiguration, Tree, updateJson } from '@nrwl/devkit'; +import { readProjectConfiguration, Tree, updateJson } from '@nx/devkit'; export function updateTsConfig( host: Tree, diff --git a/packages/jest/src/generators/jest-project/lib/update-workspace.ts b/packages/jest/src/generators/jest-project/lib/update-workspace.ts index 009dc32115d483..bc7d273ecac180 100644 --- a/packages/jest/src/generators/jest-project/lib/update-workspace.ts +++ b/packages/jest/src/generators/jest-project/lib/update-workspace.ts @@ -5,7 +5,7 @@ import { updateProjectConfiguration, joinPathFragments, normalizePath, -} from '@nrwl/devkit'; +} from '@nx/devkit'; export function updateWorkspace( tree: Tree, diff --git a/packages/jest/src/migrations/update-12-1-2/update-jest-preset-angular.ts b/packages/jest/src/migrations/update-12-1-2/update-jest-preset-angular.ts index a5781e08a1fe78..f190f16056b829 100644 --- a/packages/jest/src/migrations/update-12-1-2/update-jest-preset-angular.ts +++ b/packages/jest/src/migrations/update-12-1-2/update-jest-preset-angular.ts @@ -4,8 +4,8 @@ import { readProjectConfiguration, stripIndents, Tree, -} from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; +} from '@nx/devkit'; +import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils'; import { join } from 'path'; import { addPropertyToJestConfig, diff --git a/packages/jest/src/migrations/update-12-1-2/update-ts-jest.ts b/packages/jest/src/migrations/update-12-1-2/update-ts-jest.ts index 8f3b3b4d275b97..6bb914c9af08dc 100644 --- a/packages/jest/src/migrations/update-12-1-2/update-ts-jest.ts +++ b/packages/jest/src/migrations/update-12-1-2/update-ts-jest.ts @@ -1,5 +1,5 @@ -import { formatFiles, logger, stripIndents, Tree } from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; +import { formatFiles, logger, stripIndents, Tree } from '@nx/devkit'; +import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils'; import { join } from 'path'; import { JestExecutorOptions } from '../../executors/jest/schema'; import { diff --git a/packages/jest/src/migrations/update-12-4-0/add-test-environment-for-node.ts b/packages/jest/src/migrations/update-12-4-0/add-test-environment-for-node.ts index c9095b97eec741..68f48f6c02828b 100644 --- a/packages/jest/src/migrations/update-12-4-0/add-test-environment-for-node.ts +++ b/packages/jest/src/migrations/update-12-4-0/add-test-environment-for-node.ts @@ -5,8 +5,8 @@ import { readProjectConfiguration, stripIndents, Tree, -} from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; +} from '@nx/devkit'; +import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils'; import { join } from 'path'; import { JestExecutorOptions } from '../../executors/jest/schema'; import { addPropertyToJestConfig } from '../../utils/config/update-config'; diff --git a/packages/jest/src/migrations/update-12-4-0/update-jest-preset-angular.ts b/packages/jest/src/migrations/update-12-4-0/update-jest-preset-angular.ts index 2a500fee920cfe..2ce441390c1df6 100644 --- a/packages/jest/src/migrations/update-12-4-0/update-jest-preset-angular.ts +++ b/packages/jest/src/migrations/update-12-4-0/update-jest-preset-angular.ts @@ -1,5 +1,5 @@ -import { formatFiles, logger, stripIndents, Tree } from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; +import { formatFiles, logger, stripIndents, Tree } from '@nx/devkit'; +import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils'; import { join } from 'path'; import { JestExecutorOptions } from '../../executors/jest/schema'; import { diff --git a/packages/jest/src/migrations/update-12-6-0/update-base-jest-config.spec.ts b/packages/jest/src/migrations/update-12-6-0/update-base-jest-config.spec.ts index e90bce66787207..45543c8f747c6e 100644 --- a/packages/jest/src/migrations/update-12-6-0/update-base-jest-config.spec.ts +++ b/packages/jest/src/migrations/update-12-6-0/update-base-jest-config.spec.ts @@ -6,8 +6,8 @@ const mockResolveConfig = jest.fn(() => Promise.resolve({ singleQuote: true, endOfLine: 'lf' }) ); -import { Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import update from './update-base-jest-config'; describe('update 12.6.0', () => { @@ -34,7 +34,7 @@ describe('update 12.6.0', () => { const result = tree.read('jest.config.js').toString(); expect(result).toMatchInlineSnapshot(` - "const { getJestProjects } = require('@nrwl/jest'); + "const { getJestProjects } = require('@nx/jest'); module.exports = { projects: getJestProjects() }; " @@ -46,7 +46,7 @@ describe('update 12.6.0', () => { await update(tree); const result = tree.read('jest.config.js').toString(); expect(result).toMatchInlineSnapshot(` - "const { getJestProjects } = require('@nrwl/jest'); + "const { getJestProjects } = require('@nx/jest'); module.exports = { projects: getJestProjects() }; " @@ -58,7 +58,7 @@ describe('update 12.6.0', () => { await update(tree); const result = tree.read('jest.config.js').toString(); expect(result).toMatchInlineSnapshot(` - "const { getJestProjects } = require('@nrwl/jest'); + "const { getJestProjects } = require('@nx/jest'); module.exports = { projects: [...getJestProjects(), '/test-1'] }; " @@ -83,7 +83,7 @@ module.exports = { await update(tree); const result = tree.read('jest.config.js').toString(); expect(result).toMatchInlineSnapshot(` -"const { getJestProjects } = require('@nrwl/jest'); +"const { getJestProjects } = require('@nx/jest'); module.exports = { projects: [ diff --git a/packages/jest/src/migrations/update-12-6-0/update-base-jest-config.ts b/packages/jest/src/migrations/update-12-6-0/update-base-jest-config.ts index f4a689d8d85b9b..384f0b6c3ac536 100644 --- a/packages/jest/src/migrations/update-12-6-0/update-base-jest-config.ts +++ b/packages/jest/src/migrations/update-12-6-0/update-base-jest-config.ts @@ -1,4 +1,4 @@ -import { formatFiles, Tree } from '@nrwl/devkit'; +import { formatFiles, Tree } from '@nx/devkit'; import { jestConfigObject } from '../../utils/config/functions'; import { getJestProjects } from '../../utils/config/get-jest-projects'; import { @@ -51,7 +51,7 @@ function updateBaseJestConfig( addImportStatementToJestConfig( tree, baseJestConfigPath, - `const { getJestProjects } = require('@nrwl/jest');` + `const { getJestProjects } = require('@nx/jest');` ); return; } diff --git a/packages/jest/src/migrations/update-13-1-2/update-tsconfigs-for-tests.spec.ts b/packages/jest/src/migrations/update-13-1-2/update-tsconfigs-for-tests.spec.ts index 75f14e23f467b4..8869953f7b9542 100644 --- a/packages/jest/src/migrations/update-13-1-2/update-tsconfigs-for-tests.spec.ts +++ b/packages/jest/src/migrations/update-13-1-2/update-tsconfigs-for-tests.spec.ts @@ -1,5 +1,5 @@ -import { addProjectConfiguration, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { addProjectConfiguration, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import update from './update-tsconfigs-for-tests'; const reactTsConfigs = { diff --git a/packages/jest/src/migrations/update-13-1-2/update-tsconfigs-for-tests.ts b/packages/jest/src/migrations/update-13-1-2/update-tsconfigs-for-tests.ts index d7fee2d67a2e61..1763c912a0c565 100644 --- a/packages/jest/src/migrations/update-13-1-2/update-tsconfigs-for-tests.ts +++ b/packages/jest/src/migrations/update-13-1-2/update-tsconfigs-for-tests.ts @@ -6,8 +6,8 @@ import { Tree, updateJson, visitNotIgnoredFiles, -} from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; +} from '@nx/devkit'; +import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils'; import { basename } from 'path'; import { JestExecutorOptions } from '../../executors/jest/schema'; diff --git a/packages/jest/src/migrations/update-13-4-4/add-missing-root-babel-config.spec.ts b/packages/jest/src/migrations/update-13-4-4/add-missing-root-babel-config.spec.ts index 9b5d7ea1604de4..870f4c546407cf 100644 --- a/packages/jest/src/migrations/update-13-4-4/add-missing-root-babel-config.spec.ts +++ b/packages/jest/src/migrations/update-13-4-4/add-missing-root-babel-config.spec.ts @@ -1,5 +1,5 @@ -import { addProjectConfiguration, readJson, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { addProjectConfiguration, readJson, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import update from './add-missing-root-babel-config'; describe('Jest Migration (v13.4.4)', () => { diff --git a/packages/jest/src/migrations/update-13-4-4/add-missing-root-babel-config.ts b/packages/jest/src/migrations/update-13-4-4/add-missing-root-babel-config.ts index 7d4a26d3a166ac..2874517fc7179c 100644 --- a/packages/jest/src/migrations/update-13-4-4/add-missing-root-babel-config.ts +++ b/packages/jest/src/migrations/update-13-4-4/add-missing-root-babel-config.ts @@ -4,8 +4,8 @@ import { joinPathFragments, readProjectConfiguration, Tree, -} from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; +} from '@nx/devkit'; +import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils'; import { JestExecutorOptions } from '../../executors/jest/schema'; import { jestConfigObject } from '../../utils/config/functions'; import { nxVersion } from '../../utils/versions'; diff --git a/packages/jest/src/migrations/update-14-0-0/update-jest-config-ext.spec.ts b/packages/jest/src/migrations/update-14-0-0/update-jest-config-ext.spec.ts index 25ff2eeef401eb..f6ba082e3df9be 100644 --- a/packages/jest/src/migrations/update-14-0-0/update-jest-config-ext.spec.ts +++ b/packages/jest/src/migrations/update-14-0-0/update-jest-config-ext.spec.ts @@ -4,9 +4,9 @@ import { Tree, updateJson, updateProjectConfiguration, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { libraryGenerator as workspaceLib } from '@nrwl/js'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { libraryGenerator as workspaceLib } from '@nx/js'; import jestInitGenerator from '../../generators/init/init'; import { updateJestConfigExt } from './update-jest-config-ext'; diff --git a/packages/jest/src/migrations/update-14-0-0/update-jest-config-ext.ts b/packages/jest/src/migrations/update-14-0-0/update-jest-config-ext.ts index 843924d5fd2f6f..a2b079657a9adf 100644 --- a/packages/jest/src/migrations/update-14-0-0/update-jest-config-ext.ts +++ b/packages/jest/src/migrations/update-14-0-0/update-jest-config-ext.ts @@ -9,8 +9,8 @@ import { Tree, updateJson, updateProjectConfiguration, -} from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; +} from '@nx/devkit'; +import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils'; import { extname } from 'path'; import { JestExecutorOptions } from '../../executors/jest/schema'; diff --git a/packages/jest/src/migrations/update-14-1-5/update-exports-jest-config.spec.ts b/packages/jest/src/migrations/update-14-1-5/update-exports-jest-config.spec.ts index 80b23488e22fdd..ca07f9db139a2e 100644 --- a/packages/jest/src/migrations/update-14-1-5/update-exports-jest-config.spec.ts +++ b/packages/jest/src/migrations/update-14-1-5/update-exports-jest-config.spec.ts @@ -5,9 +5,9 @@ import { updateProjectConfiguration, updateJson, readJson, -} from '@nrwl/devkit'; -import { createTree, createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { libraryGenerator as workspaceLib } from '@nrwl/js'; +} from '@nx/devkit'; +import { createTree, createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { libraryGenerator as workspaceLib } from '@nx/js'; import { updateExportsJestConfig, updateRootFiles, @@ -172,8 +172,8 @@ module.exports = { stripIndents` const { getJestProjects } = require('@nrwl/jest'); const nxPreset = require('@nrwl/jest/preset'); - - + + const someFn = () => ({more: 'stuff'}); module.export.abc = someFn; module.exports = { diff --git a/packages/jest/src/migrations/update-14-1-5/update-exports-jest-config.ts b/packages/jest/src/migrations/update-14-1-5/update-exports-jest-config.ts index 6eacbe85ffb724..35f1d1b1eb8469 100644 --- a/packages/jest/src/migrations/update-14-1-5/update-exports-jest-config.ts +++ b/packages/jest/src/migrations/update-14-1-5/update-exports-jest-config.ts @@ -1,6 +1,6 @@ -import type { Tree } from '@nrwl/devkit'; -import { addDependenciesToPackageJson } from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; +import type { Tree } from '@nx/devkit'; +import { addDependenciesToPackageJson } from '@nx/devkit'; +import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils'; import { tsNodeVersion } from '../../utils/versions'; import { tsquery } from '@phenomnomnominal/tsquery'; import type { BinaryExpression } from 'typescript'; diff --git a/packages/jest/src/migrations/update-14-6-0/update-configs-jest-28.spec.ts b/packages/jest/src/migrations/update-14-6-0/update-configs-jest-28.spec.ts index 01eb3f60bd108b..4caa9e680f74b9 100644 --- a/packages/jest/src/migrations/update-14-6-0/update-configs-jest-28.spec.ts +++ b/packages/jest/src/migrations/update-14-6-0/update-configs-jest-28.spec.ts @@ -1,6 +1,6 @@ -import { readJson, updateJson } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { libraryGenerator as workspaceLib } from '@nrwl/js'; +import { readJson, updateJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { libraryGenerator as workspaceLib } from '@nx/js'; import { checkDeps, updateConfigsJest28, @@ -114,7 +114,7 @@ describe('Jest Migration - jest 28 config support', () => { tree.write( 'jest.preset.js', ` -const nxPreset = require('@nrwl/jest/preset').default; +const nxPreset = require('@nx/jest/preset').default; module.exports = { ...nxPreset, testRunner: 'jest-jasmine2', diff --git a/packages/jest/src/migrations/update-14-6-0/update-configs-jest-28.ts b/packages/jest/src/migrations/update-14-6-0/update-configs-jest-28.ts index 5ffd786b577cff..ae25b9f963b6de 100644 --- a/packages/jest/src/migrations/update-14-6-0/update-configs-jest-28.ts +++ b/packages/jest/src/migrations/update-14-6-0/update-configs-jest-28.ts @@ -1,5 +1,5 @@ -import { addDependenciesToPackageJson, readJson, Tree } from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; +import { addDependenciesToPackageJson, readJson, Tree } from '@nx/devkit'; +import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils'; import { tsquery } from '@phenomnomnominal/tsquery'; import { isStringLiteralLike, PropertyAssignment } from 'typescript'; import { JestExecutorOptions } from '../../executors/jest/schema'; diff --git a/packages/jest/src/migrations/update-14-6-0/update-tests-jest-28.spec.ts b/packages/jest/src/migrations/update-14-6-0/update-tests-jest-28.spec.ts index b51ec783cd4c85..a06ee7e76734e5 100644 --- a/packages/jest/src/migrations/update-14-6-0/update-tests-jest-28.spec.ts +++ b/packages/jest/src/migrations/update-14-6-0/update-tests-jest-28.spec.ts @@ -1,5 +1,5 @@ -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { libraryGenerator as workspaceLib } from '@nrwl/js'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { libraryGenerator as workspaceLib } from '@nx/js'; import { readProjectConfiguration, updateProjectConfiguration, diff --git a/packages/jest/src/migrations/update-14-6-0/update-tests-jest-28.ts b/packages/jest/src/migrations/update-14-6-0/update-tests-jest-28.ts index 56f48c49a2306b..9642607b56a89d 100644 --- a/packages/jest/src/migrations/update-14-6-0/update-tests-jest-28.ts +++ b/packages/jest/src/migrations/update-14-6-0/update-tests-jest-28.ts @@ -2,8 +2,8 @@ import { readProjectConfiguration, Tree, visitNotIgnoredFiles, -} from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; +} from '@nx/devkit'; +import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils'; import { tsquery } from '@phenomnomnominal/tsquery'; import * as ts from 'typescript'; import { JestExecutorOptions } from '../../executors/jest/schema'; diff --git a/packages/jest/src/migrations/update-15-0-0/add-jest-inputs.spec.ts b/packages/jest/src/migrations/update-15-0-0/add-jest-inputs.spec.ts index 71a131ba0f4ba5..9fd8ef0627b8cd 100644 --- a/packages/jest/src/migrations/update-15-0-0/add-jest-inputs.spec.ts +++ b/packages/jest/src/migrations/update-15-0-0/add-jest-inputs.spec.ts @@ -1,10 +1,10 @@ -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { addProjectConfiguration, readNxJson, Tree, updateNxJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import addJestInputs from './add-jest-inputs'; describe('15.0.0 migration (add-jest-inputs)', () => { diff --git a/packages/jest/src/migrations/update-15-0-0/add-jest-inputs.ts b/packages/jest/src/migrations/update-15-0-0/add-jest-inputs.ts index b5619a50d29230..0199b247710833 100644 --- a/packages/jest/src/migrations/update-15-0-0/add-jest-inputs.ts +++ b/packages/jest/src/migrations/update-15-0-0/add-jest-inputs.ts @@ -1,5 +1,5 @@ -import { formatFiles, readNxJson, Tree, updateNxJson } from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; +import { formatFiles, readNxJson, Tree, updateNxJson } from '@nx/devkit'; +import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils'; export default async function (tree: Tree) { const nxJson = readNxJson(tree); diff --git a/packages/jest/src/migrations/update-15-8-0/update-configs-jest-29.spec.ts b/packages/jest/src/migrations/update-15-8-0/update-configs-jest-29.spec.ts index 60b56502ee4e30..53d787a4354572 100644 --- a/packages/jest/src/migrations/update-15-8-0/update-configs-jest-29.spec.ts +++ b/packages/jest/src/migrations/update-15-8-0/update-configs-jest-29.spec.ts @@ -1,16 +1,16 @@ -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { ProjectGraph, readProjectConfiguration, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { updateConfigsJest29 } from './update-configs-jest-29'; -import { libraryGenerator } from '@nrwl/js'; +import { libraryGenerator } from '@nx/js'; let projectGraph: ProjectGraph; -jest.mock('@nrwl/devkit', () => ({ - ...jest.requireActual('@nrwl/devkit'), +jest.mock('@nx/devkit', () => ({ + ...jest.requireActual('@nx/devkit'), createProjectGraphAsync: jest.fn().mockImplementation(async () => { return projectGraph; }), diff --git a/packages/jest/src/migrations/update-15-8-0/update-configs-jest-29.ts b/packages/jest/src/migrations/update-15-8-0/update-configs-jest-29.ts index e55199be5d37c5..94de36bb33e57e 100644 --- a/packages/jest/src/migrations/update-15-8-0/update-configs-jest-29.ts +++ b/packages/jest/src/migrations/update-15-8-0/update-configs-jest-29.ts @@ -4,8 +4,8 @@ import { logger, stripIndents, Tree, -} from '@nrwl/devkit'; -import { forEachExecutorOptionsInGraph } from '@nrwl/devkit/src/generators/executor-options-utils'; +} from '@nx/devkit'; +import { forEachExecutorOptionsInGraph } from '@nx/devkit/src/generators/executor-options-utils'; import { TS_QUERY_JEST_CONFIG_PREFIX } from '../../utils/ast-utils'; import { tsquery } from '@phenomnomnominal/tsquery'; import * as ts from 'typescript'; diff --git a/packages/jest/src/migrations/update-15-8-0/update-tests-jest-29.spec.ts b/packages/jest/src/migrations/update-15-8-0/update-tests-jest-29.spec.ts index ed8e71eac7c2f0..1569b3b0d8129b 100644 --- a/packages/jest/src/migrations/update-15-8-0/update-tests-jest-29.spec.ts +++ b/packages/jest/src/migrations/update-15-8-0/update-tests-jest-29.spec.ts @@ -3,14 +3,14 @@ import { readProjectConfiguration, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { libraryGenerator } from '@nrwl/js'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { libraryGenerator } from '@nx/js'; import { updateTestsJest29 } from './update-tests-jest-29'; let projectGraph: ProjectGraph; -jest.mock('@nrwl/devkit', () => ({ - ...jest.requireActual('@nrwl/devkit'), +jest.mock('@nx/devkit', () => ({ + ...jest.requireActual('@nx/devkit'), createProjectGraphAsync: jest .fn() .mockImplementation(async () => projectGraph), diff --git a/packages/jest/src/migrations/update-15-8-0/update-tests-jest-29.ts b/packages/jest/src/migrations/update-15-8-0/update-tests-jest-29.ts index 9499387ea67265..e8642d1587b4ab 100644 --- a/packages/jest/src/migrations/update-15-8-0/update-tests-jest-29.ts +++ b/packages/jest/src/migrations/update-15-8-0/update-tests-jest-29.ts @@ -4,8 +4,8 @@ import { readProjectConfiguration, Tree, visitNotIgnoredFiles, -} from '@nrwl/devkit'; -import { forEachExecutorOptionsInGraph } from '@nrwl/devkit/src/generators/executor-options-utils'; +} from '@nx/devkit'; +import { forEachExecutorOptionsInGraph } from '@nx/devkit/src/generators/executor-options-utils'; import { tsquery } from '@phenomnomnominal/tsquery'; import { CallExpression, diff --git a/packages/jest/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts b/packages/jest/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts new file mode 100644 index 00000000000000..e92821496f7cb9 --- /dev/null +++ b/packages/jest/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts @@ -0,0 +1,37 @@ +import { Tree, readJson, updateJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import replacePackage from './update-16-0-0-add-nx-packages'; + +describe('update-16-0-0-add-nx-packages', () => { + let tree: Tree; + beforeEach(() => { + tree = createTreeWithEmptyWorkspace(); + + updateJson(tree, 'package.json', (json) => { + json.devDependencies['@nrwl/jest'] = '16.0.0'; + return json; + }); + }); + + it('should remove the dependency on @nrwl/jest', async () => { + await replacePackage(tree); + + expect( + readJson(tree, 'package.json').dependencies['@nrwl/jest'] + ).not.toBeDefined(); + expect( + readJson(tree, 'package.json').devDependencies['@nrwl/jest'] + ).not.toBeDefined(); + }); + + it('should add a dependency on @nx/jest', async () => { + await replacePackage(tree); + + const packageJson = readJson(tree, 'package.json'); + const newDependencyVersion = + packageJson.devDependencies['@nx/jest'] ?? + packageJson.dependencies['@nx/jest']; + + expect(newDependencyVersion).toBeDefined(); + }); +}); diff --git a/packages/jest/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts b/packages/jest/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts new file mode 100644 index 00000000000000..0d5413bfec219c --- /dev/null +++ b/packages/jest/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts @@ -0,0 +1,8 @@ +import { Tree, formatFiles } from '@nx/devkit'; +import { replaceNrwlPackageWithNxPackage } from '@nx/devkit/src/utils/replace-package'; + +export default async function replacePackage(tree: Tree): Promise { + await replaceNrwlPackageWithNxPackage(tree, '@nrwl/jest', '@nx/jest'); + + await formatFiles(tree); +} diff --git a/packages/jest/src/utils/config/find-root-jest-files.ts b/packages/jest/src/utils/config/find-root-jest-files.ts index 1edd1a8793f418..72a97a18e0d865 100644 --- a/packages/jest/src/utils/config/find-root-jest-files.ts +++ b/packages/jest/src/utils/config/find-root-jest-files.ts @@ -1,4 +1,4 @@ -import { Tree } from '@nrwl/devkit'; +import { Tree } from '@nx/devkit'; export function findRootJestConfig(tree: Tree): string | null { if (tree.exists('jest.config.js')) { diff --git a/packages/jest/src/utils/config/functions.spec.ts b/packages/jest/src/utils/config/functions.spec.ts index 1982a9330b7266..a891a8b49927f3 100644 --- a/packages/jest/src/utils/config/functions.spec.ts +++ b/packages/jest/src/utils/config/functions.spec.ts @@ -1,4 +1,4 @@ -import { createTree } from '@nrwl/devkit/testing'; +import { createTree } from '@nx/devkit/testing'; import { jestConfigObject, jestConfigObjectAst } from './functions'; describe('jestConfigObject', () => { @@ -21,13 +21,13 @@ describe('jestConfigObject', () => { xit('should work with async functions', async () => { const tree = createTree(); - jest.mock('@nrwl/jest', () => ({ + jest.mock('@nx/jest', () => ({ getJestProjects: () => ['/project-a', '/project-b'], })); tree.write( 'jest.config.js', ` - const { getJestProjects } = require('@nrwl/jest'); + const { getJestProjects } = require('@nx/jest'); module.exports = async () => ({ foo: 'bar' }); @@ -41,13 +41,13 @@ describe('jestConfigObject', () => { it('should work with `getJestConfig`', () => { const tree = createTree(); - jest.mock('@nrwl/jest', () => ({ + jest.mock('@nx/jest', () => ({ getJestProjects: () => ['/project-a', '/project-b'], })); tree.write( 'jest.config.js', ` - const { getJestProjects } = require('@nrwl/jest'); + const { getJestProjects } = require('@nx/jest'); module.exports = { projects: getJestProjects() }; @@ -61,13 +61,13 @@ describe('jestConfigObject', () => { it('should work with node globals (require, __dirname, process, __filename, console, and other globals)', () => { const tree = createTree(); - jest.mock('@nrwl/jest', () => ({ + jest.mock('@nx/jest', () => ({ getJestProjects: () => ['/project-a', '/project-b'], })); tree.write( 'jest.config.js', ` - const { getJestProjects } = require('@nrwl/jest'); + const { getJestProjects } = require('@nx/jest'); module.exports = { projects: getJestProjects(), filename: __filename, diff --git a/packages/jest/src/utils/config/functions.ts b/packages/jest/src/utils/config/functions.ts index de34efeb699300..ce4f0a002c1570 100644 --- a/packages/jest/src/utils/config/functions.ts +++ b/packages/jest/src/utils/config/functions.ts @@ -1,9 +1,9 @@ import type * as ts from 'typescript'; -import { applyChangesToString, ChangeType, Tree } from '@nrwl/devkit'; +import { applyChangesToString, ChangeType, Tree } from '@nx/devkit'; import { Config } from '@jest/types'; import { createContext, runInContext } from 'vm'; import { dirname, join } from 'path'; -import { ensureTypescript } from '@nrwl/js/src/utils/typescript/ensure-typescript'; +import { ensureTypescript } from '@nx/js/src/utils/typescript/ensure-typescript'; let tsModule: typeof import('typescript'); diff --git a/packages/jest/src/utils/config/get-jest-projects.spec.ts b/packages/jest/src/utils/config/get-jest-projects.spec.ts index 2184ab9e8dbd6f..cd54ac3e0a91d7 100644 --- a/packages/jest/src/utils/config/get-jest-projects.spec.ts +++ b/packages/jest/src/utils/config/get-jest-projects.spec.ts @@ -1,6 +1,6 @@ import { getJestProjects } from './get-jest-projects'; import * as Workspace from 'nx/src/project-graph/file-utils'; -import type { WorkspaceJsonConfiguration } from '@nrwl/devkit'; +import type { WorkspaceJsonConfiguration } from '@nx/devkit'; describe('getJestProjects', () => { test('single project', () => { diff --git a/packages/jest/src/utils/config/get-jest-projects.ts b/packages/jest/src/utils/config/get-jest-projects.ts index 3e9ca0cf202869..27d5e0eb19b302 100644 --- a/packages/jest/src/utils/config/get-jest-projects.ts +++ b/packages/jest/src/utils/config/get-jest-projects.ts @@ -1,5 +1,5 @@ import { join } from 'path'; -import type { ProjectsConfigurations } from '@nrwl/devkit'; +import type { ProjectsConfigurations } from '@nx/devkit'; import { readWorkspaceConfig } from 'nx/src/project-graph/file-utils'; const JEST_RUNNER_TOKEN = '@nrwl/jest:jest'; diff --git a/packages/jest/src/utils/config/update-config.spec.ts b/packages/jest/src/utils/config/update-config.spec.ts index e0fc03c3415191..d3b8e5a6ce25eb 100644 --- a/packages/jest/src/utils/config/update-config.spec.ts +++ b/packages/jest/src/utils/config/update-config.spec.ts @@ -3,8 +3,8 @@ import { removePropertyFromJestConfig, } from './update-config'; import { jestConfigObject } from './functions'; -import { Tree } from '@nrwl/devkit'; -import { createTree } from '@nrwl/devkit/testing'; +import { Tree } from '@nx/devkit'; +import { createTree } from '@nx/devkit/testing'; describe('Update jest.config.js', () => { let host: Tree; @@ -183,7 +183,7 @@ describe('Update jest.config.js', () => { host.write( 'jest.config.js', String.raw` - const { nxPreset } = require('@nrwl/jest/preset'); + const { nxPreset } = require('@nx/jest/preset'); module.exports = { ...nxPreset, @@ -278,7 +278,7 @@ describe('Update jest.config.js', () => { host.write( 'jest.config.js', String.raw` - const { nxPreset } = require('@nrwl/jest/preset'); + const { nxPreset } = require('@nx/jest/preset'); module.exports = { ...nxPreset, @@ -320,7 +320,7 @@ describe('Update jest.config.js', () => { host.write( 'jest.config.js', String.raw` - const { nxPreset } = require('@nrwl/jest/preset'); + const { nxPreset } = require('@nx/jest/preset'); module.exports = { ...nxPreset, diff --git a/packages/jest/src/utils/config/update-config.ts b/packages/jest/src/utils/config/update-config.ts index 3d0236d5661992..cd8f30a5e5cd17 100644 --- a/packages/jest/src/utils/config/update-config.ts +++ b/packages/jest/src/utils/config/update-config.ts @@ -1,4 +1,4 @@ -import { Tree, applyChangesToString, ChangeType, logger } from '@nrwl/devkit'; +import { Tree, applyChangesToString, ChangeType, logger } from '@nx/devkit'; import { addOrUpdateProperty, jestConfigObjectAst, diff --git a/packages/js/migrations.json b/packages/js/migrations.json index 3ed3c61e466713..2476ee336fd009 100644 --- a/packages/js/migrations.json +++ b/packages/js/migrations.json @@ -35,6 +35,12 @@ "version": "15.8.0-beta.0", "description": "Rename .lib.swcrc to .swcrc for better SWC support throughout the workspace", "factory": "./src/migrations/update-15-8-0/rename-swcrc-config" + }, + "update-16-0-0-add-nx-packages": { + "cli": "nx", + "version": "16.0.0-beta.1", + "description": "Replace @nrwl/js with @nx/js", + "implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages" } }, "packageJsonUpdates": { diff --git a/packages/js/migrations.spec.ts b/packages/js/migrations.spec.ts index a3f53a6c041557..4e274814efa411 100644 --- a/packages/js/migrations.spec.ts +++ b/packages/js/migrations.spec.ts @@ -5,7 +5,9 @@ describe('JS migrations', () => { it('should have valid paths', () => { Object.values(json.generators).forEach((m: any) => { expect(() => - require.resolve(path.join(__dirname, `${m.factory}.ts`)) + require.resolve( + path.join(__dirname, `${m.factory ?? m.implementation}.ts`) + ) ).not.toThrow(); }); }); diff --git a/packages/js/package.json b/packages/js/package.json index b7e2288b118a4a..297ccd30ce2be4 100644 --- a/packages/js/package.json +++ b/packages/js/package.json @@ -1,5 +1,5 @@ { - "name": "@nrwl/js", + "name": "@nx/js", "version": "0.0.1", "private": false, "description": "The JS plugin for Nx contains executors and generators that provide the best experience for developing JavaScript and TypeScript projects. ", @@ -39,8 +39,6 @@ "@babel/preset-env": "^7.15.0", "@babel/preset-typescript": "^7.15.0", "@babel/runtime": "^7.14.8", - "@nrwl/devkit": "file:../devkit", - "@nrwl/workspace": "file:../workspace", "@phenomnomnominal/tsquery": "~5.0.1", "babel-plugin-const-enum": "^1.0.1", "babel-plugin-macros": "^2.8.0", @@ -53,7 +51,9 @@ "minimatch": "3.0.5", "source-map-support": "0.5.19", "tree-kill": "1.2.2", - "tslib": "^2.3.0" + "tslib": "^2.3.0", + "@nx/devkit": "file:../devkit", + "@nx/workspace": "file:../workspace" }, "publishConfig": { "access": "public" diff --git a/packages/js/project.json b/packages/js/project.json index 47b9ad9dfe4b92..9933f15aa887f4 100644 --- a/packages/js/project.json +++ b/packages/js/project.json @@ -50,7 +50,10 @@ "executor": "nx:run-commands", "outputs": ["{workspaceRoot}/build/packages/js"], "options": { - "command": "node ./scripts/copy-readme.js js" + "commands": [ + "node ./scripts/copy-readme.js js", + "node ./scripts/add-dependency-to-build.js js @nrwl/js" + ] } } }, diff --git a/packages/js/src/executors/node/compat.ts b/packages/js/src/executors/node/compat.ts index 44014a83a152af..03735e668e6414 100644 --- a/packages/js/src/executors/node/compat.ts +++ b/packages/js/src/executors/node/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import nodeExecutor from './node.impl'; export default convertNxExecutor(nodeExecutor); diff --git a/packages/js/src/executors/node/node.impl.ts b/packages/js/src/executors/node/node.impl.ts index 8d106f87a78f8e..00297681db609f 100644 --- a/packages/js/src/executors/node/node.impl.ts +++ b/packages/js/src/executors/node/node.impl.ts @@ -4,7 +4,7 @@ import { logger, parseTargetString, runExecutor, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { calculateProjectDependencies } from '../../utils/buildable-libs-utils'; import { ChildProcess, fork } from 'child_process'; import { randomUUID } from 'crypto'; diff --git a/packages/js/src/executors/swc/compat.ts b/packages/js/src/executors/swc/compat.ts index 478b3ef73f5026..156bea015e7d1a 100644 --- a/packages/js/src/executors/swc/compat.ts +++ b/packages/js/src/executors/swc/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import { swcExecutor } from './swc.impl'; export default convertNxExecutor(swcExecutor); diff --git a/packages/js/src/executors/swc/swc.impl.ts b/packages/js/src/executors/swc/swc.impl.ts index 097947ac0fd185..4bb1a4056081dd 100644 --- a/packages/js/src/executors/swc/swc.impl.ts +++ b/packages/js/src/executors/swc/swc.impl.ts @@ -1,4 +1,4 @@ -import { ExecutorContext, readJsonFile, writeJsonFile } from '@nrwl/devkit'; +import { ExecutorContext, readJsonFile, writeJsonFile } from '@nx/devkit'; import { assetGlobsToFiles, FileInputOutput } from '../../utils/assets/assets'; import { removeSync } from 'fs-extra'; import { dirname, join, relative, resolve } from 'path'; diff --git a/packages/js/src/executors/tsc/compat.ts b/packages/js/src/executors/tsc/compat.ts index 546cfcc0e415aa..ab5004ebde7fd1 100644 --- a/packages/js/src/executors/tsc/compat.ts +++ b/packages/js/src/executors/tsc/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import { tscExecutor } from './tsc.impl'; diff --git a/packages/js/src/executors/tsc/tsc.impl.spec.ts b/packages/js/src/executors/tsc/tsc.impl.spec.ts index 609cc97821de46..d35b7b973b5573 100644 --- a/packages/js/src/executors/tsc/tsc.impl.spec.ts +++ b/packages/js/src/executors/tsc/tsc.impl.spec.ts @@ -1,4 +1,4 @@ -import { ExecutorContext } from '@nrwl/devkit'; +import { ExecutorContext } from '@nx/devkit'; import { ExecutorOptions } from '../../utils/schema'; import { createTypeScriptCompilationOptions, diff --git a/packages/js/src/executors/tsc/tsc.impl.ts b/packages/js/src/executors/tsc/tsc.impl.ts index e81a82daf2eb3c..6e1a1000e63bf1 100644 --- a/packages/js/src/executors/tsc/tsc.impl.ts +++ b/packages/js/src/executors/tsc/tsc.impl.ts @@ -1,6 +1,6 @@ -import { ExecutorContext } from '@nrwl/devkit'; +import { ExecutorContext } from '@nx/devkit'; import { assetGlobsToFiles, FileInputOutput } from '../../utils/assets/assets'; -import type { TypeScriptCompilationOptions } from '@nrwl/workspace/src/utilities/typescript/compilation'; +import type { TypeScriptCompilationOptions } from '@nx/workspace/src/utilities/typescript/compilation'; import { join, resolve } from 'path'; import { CustomTransformers, diff --git a/packages/js/src/generators/convert-to-swc/convert-to-swc.spec.ts b/packages/js/src/generators/convert-to-swc/convert-to-swc.spec.ts index dcaea2ac4f28ac..cb53133bb59d82 100644 --- a/packages/js/src/generators/convert-to-swc/convert-to-swc.spec.ts +++ b/packages/js/src/generators/convert-to-swc/convert-to-swc.spec.ts @@ -1,5 +1,5 @@ -import { readProjectConfiguration, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { readProjectConfiguration, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { join } from 'path'; import { LibraryGeneratorSchema } from '../../utils/schema'; import { libraryGenerator as jsLibraryGenerator } from '../library/library'; diff --git a/packages/js/src/generators/convert-to-swc/convert-to-swc.ts b/packages/js/src/generators/convert-to-swc/convert-to-swc.ts index b2b72b68af9877..38d82b038bed46 100644 --- a/packages/js/src/generators/convert-to-swc/convert-to-swc.ts +++ b/packages/js/src/generators/convert-to-swc/convert-to-swc.ts @@ -7,7 +7,7 @@ import { readProjectConfiguration, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { join } from 'path'; import { addSwcConfig } from '../../utils/swc/add-swc-config'; import { addSwcDependencies } from '../../utils/swc/add-swc-dependencies'; diff --git a/packages/js/src/generators/init/init.spec.ts b/packages/js/src/generators/init/init.spec.ts index 9831fc27641970..1b31d7191b9f48 100644 --- a/packages/js/src/generators/init/init.spec.ts +++ b/packages/js/src/generators/init/init.spec.ts @@ -1,5 +1,5 @@ -import { writeJson, readJson, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { writeJson, readJson, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import init from './init'; describe('js init generator', () => { diff --git a/packages/js/src/generators/init/init.ts b/packages/js/src/generators/init/init.ts index 7a4fd739989420..667234a2259ea9 100644 --- a/packages/js/src/generators/init/init.ts +++ b/packages/js/src/generators/init/init.ts @@ -10,7 +10,7 @@ import { Tree, updateJson, writeJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { getRootTsConfigFileName } from '../../utils/typescript/ts-config'; import { nxVersion, diff --git a/packages/js/src/generators/library/library.spec.ts b/packages/js/src/generators/library/library.spec.ts index 1ac2cf890e0315..b5410e96e6cbce 100644 --- a/packages/js/src/generators/library/library.spec.ts +++ b/packages/js/src/generators/library/library.spec.ts @@ -4,8 +4,8 @@ import { readProjectConfiguration, Tree, updateJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { LibraryGeneratorSchema } from '../../utils/schema'; import libraryGenerator from './library'; diff --git a/packages/js/src/generators/library/library.ts b/packages/js/src/generators/library/library.ts index 139cc8531939ea..1de8b1f5d272de 100644 --- a/packages/js/src/generators/library/library.ts +++ b/packages/js/src/generators/library/library.ts @@ -17,7 +17,7 @@ import { Tree, updateJson, writeJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { getImportPath } from 'nx/src/utils/path'; import { @@ -73,10 +73,7 @@ export async function projectGenerator( tasks.push(addProjectDependencies(tree, options)); if (options.bundler === 'vite') { - const { viteConfigurationGenerator } = ensurePackage( - '@nrwl/vite', - nxVersion - ); + const { viteConfigurationGenerator } = ensurePackage('@nx/vite', nxVersion); const viteTask = await viteConfigurationGenerator(tree, { project: options.name, newProject: true, @@ -106,7 +103,7 @@ export async function projectGenerator( options.unitTestRunner === 'vitest' && options.bundler !== 'vite' // Test would have been set up already ) { - const { vitestGenerator } = ensurePackage('@nrwl/vite', nxVersion); + const { vitestGenerator } = ensurePackage('@nx/vite', nxVersion); const vitestTask = await vitestGenerator(tree, { project: options.name, uiFramework: 'none', @@ -231,7 +228,7 @@ export async function addLint( tree: Tree, options: NormalizedSchema ): Promise { - const { lintProjectGenerator } = ensurePackage('@nrwl/linter', nxVersion); + const { lintProjectGenerator } = ensurePackage('@nx/linter', nxVersion); return lintProjectGenerator(tree, { project: options.name, linter: options.linter, @@ -363,7 +360,7 @@ async function addJest( tree: Tree, options: NormalizedSchema ): Promise { - const { jestProjectGenerator } = ensurePackage('@nrwl/jest', nxVersion); + const { jestProjectGenerator } = ensurePackage('@nx/jest', nxVersion); return await jestProjectGenerator(tree, { ...options, project: options.name, @@ -456,7 +453,7 @@ function normalizeOptions( options.bundler = 'none'; } - const { Linter } = ensurePackage('@nrwl/linter', nxVersion); + const { Linter } = ensurePackage('@nx/linter', nxVersion); if (options.config === 'npm-scripts') { options.unitTestRunner = 'none'; options.linter = Linter.None; diff --git a/packages/js/src/migrations/update-13-10-1/update-lib-swcrc-exclude.spec.ts b/packages/js/src/migrations/update-13-10-1/update-lib-swcrc-exclude.spec.ts index f2f11b13acebe9..298160acb64e8b 100644 --- a/packages/js/src/migrations/update-13-10-1/update-lib-swcrc-exclude.spec.ts +++ b/packages/js/src/migrations/update-13-10-1/update-lib-swcrc-exclude.spec.ts @@ -4,8 +4,8 @@ import { readJson, Tree, updateJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import updateSwcRcExclude from './update-lib-swcrc-exclude'; const projectConfig: ProjectConfiguration = { diff --git a/packages/js/src/migrations/update-13-10-1/update-lib-swcrc-exclude.ts b/packages/js/src/migrations/update-13-10-1/update-lib-swcrc-exclude.ts index 54bb5daf46d292..730a52a812c72e 100644 --- a/packages/js/src/migrations/update-13-10-1/update-lib-swcrc-exclude.ts +++ b/packages/js/src/migrations/update-13-10-1/update-lib-swcrc-exclude.ts @@ -1,5 +1,5 @@ -import { readProjectConfiguration, Tree, updateJson } from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; +import { readProjectConfiguration, Tree, updateJson } from '@nx/devkit'; +import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils'; import { join } from 'path'; import { SwcExecutorOptions } from '../../utils/schema'; import { defaultExclude } from '../../utils/swc/add-swc-config'; diff --git a/packages/js/src/migrations/update-13-8-5/update-node-executor.spec.ts b/packages/js/src/migrations/update-13-8-5/update-node-executor.spec.ts index fd7d5132686a98..fec61feeb330fc 100644 --- a/packages/js/src/migrations/update-13-8-5/update-node-executor.spec.ts +++ b/packages/js/src/migrations/update-13-8-5/update-node-executor.spec.ts @@ -2,8 +2,8 @@ import { addProjectConfiguration, readJson, readProjectConfiguration, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import update from './update-node-executor'; diff --git a/packages/js/src/migrations/update-13-8-5/update-node-executor.ts b/packages/js/src/migrations/update-13-8-5/update-node-executor.ts index e4150465af7596..aaed56cd4afbb4 100644 --- a/packages/js/src/migrations/update-13-8-5/update-node-executor.ts +++ b/packages/js/src/migrations/update-13-8-5/update-node-executor.ts @@ -4,8 +4,8 @@ import { getProjects, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; -import { nxVersion } from '@nrwl/workspace/src/utils/versions'; +} from '@nx/devkit'; +import { nxVersion } from '@nx/workspace/src/utils/versions'; export default async function update(host: Tree) { const projects = getProjects(host); diff --git a/packages/js/src/migrations/update-13-8-5/update-swcrc.spec.ts b/packages/js/src/migrations/update-13-8-5/update-swcrc.spec.ts index 087366cd0463b0..d72cb865a6d8d7 100644 --- a/packages/js/src/migrations/update-13-8-5/update-swcrc.spec.ts +++ b/packages/js/src/migrations/update-13-8-5/update-swcrc.spec.ts @@ -5,9 +5,9 @@ import { readProjectConfiguration, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { libraryGenerator } from '@nrwl/js'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { libraryGenerator } from '@nx/js'; import { defaultExclude } from '../../utils/swc/add-swc-config'; import update from './update-swcrc'; diff --git a/packages/js/src/migrations/update-13-8-5/update-swcrc.ts b/packages/js/src/migrations/update-13-8-5/update-swcrc.ts index 7bb4f0b74e87bd..1cff15514bf92e 100644 --- a/packages/js/src/migrations/update-13-8-5/update-swcrc.ts +++ b/packages/js/src/migrations/update-13-8-5/update-swcrc.ts @@ -4,7 +4,7 @@ import { readJson, Tree, updateJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { join } from 'path'; import { defaultExclude } from '../../utils/swc/add-swc-config'; diff --git a/packages/js/src/migrations/update-14-0-0/exclude-jest-config-swcrc.spec.ts b/packages/js/src/migrations/update-14-0-0/exclude-jest-config-swcrc.spec.ts index 4d5164864226a3..c253e074457547 100644 --- a/packages/js/src/migrations/update-14-0-0/exclude-jest-config-swcrc.spec.ts +++ b/packages/js/src/migrations/update-14-0-0/exclude-jest-config-swcrc.spec.ts @@ -3,8 +3,8 @@ import { readJson, Tree, updateJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { excludeJestConfigSwcrc } from './exclude-jest-config-swcrc'; import { ProjectConfiguration } from 'nx/src/config/workspace-json-project-json'; diff --git a/packages/js/src/migrations/update-14-0-0/exclude-jest-config-swcrc.ts b/packages/js/src/migrations/update-14-0-0/exclude-jest-config-swcrc.ts index 824ff55d13ba28..28d5472ea31b5b 100644 --- a/packages/js/src/migrations/update-14-0-0/exclude-jest-config-swcrc.ts +++ b/packages/js/src/migrations/update-14-0-0/exclude-jest-config-swcrc.ts @@ -1,5 +1,5 @@ -import { readProjectConfiguration, Tree, updateJson } from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; +import { readProjectConfiguration, Tree, updateJson } from '@nx/devkit'; +import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils'; import { SwcExecutorOptions } from '../../utils/schema'; import { join } from 'path'; diff --git a/packages/js/src/migrations/update-14-1-5/update-swcrc-path.spec.ts b/packages/js/src/migrations/update-14-1-5/update-swcrc-path.spec.ts index d89e7b34c60432..c51122232e78e4 100644 --- a/packages/js/src/migrations/update-14-1-5/update-swcrc-path.spec.ts +++ b/packages/js/src/migrations/update-14-1-5/update-swcrc-path.spec.ts @@ -1,8 +1,5 @@ -import { - addProjectConfiguration, - readProjectConfiguration, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { addProjectConfiguration, readProjectConfiguration } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import updateSwcrcPath from './update-swcrc-path'; describe('update-swcrc-path migration', () => { diff --git a/packages/js/src/migrations/update-14-1-5/update-swcrc-path.ts b/packages/js/src/migrations/update-14-1-5/update-swcrc-path.ts index 5c1ebe52541086..3c8f810659c253 100644 --- a/packages/js/src/migrations/update-14-1-5/update-swcrc-path.ts +++ b/packages/js/src/migrations/update-14-1-5/update-swcrc-path.ts @@ -4,8 +4,8 @@ import { readProjectConfiguration, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; +} from '@nx/devkit'; +import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils'; import { SwcExecutorOptions } from '../../utils/schema'; type OldSwcExecutorOptions = SwcExecutorOptions & { swcrcPath?: string }; diff --git a/packages/js/src/migrations/update-15-8-0/rename-swcrc-config.spec.ts b/packages/js/src/migrations/update-15-8-0/rename-swcrc-config.spec.ts index 0c04fa45010589..6637421added3b 100644 --- a/packages/js/src/migrations/update-15-8-0/rename-swcrc-config.spec.ts +++ b/packages/js/src/migrations/update-15-8-0/rename-swcrc-config.spec.ts @@ -2,8 +2,8 @@ import { readProjectConfiguration, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { libraryGenerator } from '../../generators/library/library'; import renameSwcrcConfig from './rename-swcrc-config'; diff --git a/packages/js/src/migrations/update-15-8-0/rename-swcrc-config.ts b/packages/js/src/migrations/update-15-8-0/rename-swcrc-config.ts index 7c76d66108126e..b36dd6e3ce3433 100644 --- a/packages/js/src/migrations/update-15-8-0/rename-swcrc-config.ts +++ b/packages/js/src/migrations/update-15-8-0/rename-swcrc-config.ts @@ -4,8 +4,8 @@ import { joinPathFragments, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; +} from '@nx/devkit'; +import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils'; import { SwcExecutorOptions } from '../../utils/schema'; import { tsquery } from '@phenomnomnominal/tsquery'; import type { TemplateSpan } from 'typescript'; diff --git a/packages/js/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts b/packages/js/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts new file mode 100644 index 00000000000000..42b7c511fb9b60 --- /dev/null +++ b/packages/js/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts @@ -0,0 +1,37 @@ +import { Tree, readJson, updateJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import replacePackage from './update-16-0-0-add-nx-packages'; + +describe('update-16-0-0-add-nx-packages', () => { + let tree: Tree; + beforeEach(() => { + tree = createTreeWithEmptyWorkspace(); + + updateJson(tree, 'package.json', (json) => { + json.devDependencies['@nrwl/js'] = '16.0.0'; + return json; + }); + }); + + it('should remove the dependency on @nrwl/js', async () => { + await replacePackage(tree); + + expect( + readJson(tree, 'package.json').dependencies['@nrwl/js'] + ).not.toBeDefined(); + expect( + readJson(tree, 'package.json').devDependencies['@nrwl/js'] + ).not.toBeDefined(); + }); + + it('should add a dependency on @nx/js', async () => { + await replacePackage(tree); + + const packageJson = readJson(tree, 'package.json'); + const newDependencyVersion = + packageJson.devDependencies['@nx/js'] ?? + packageJson.dependencies['@nx/js']; + + expect(newDependencyVersion).toBeDefined(); + }); +}); diff --git a/packages/js/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts b/packages/js/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts new file mode 100644 index 00000000000000..04118deb72b981 --- /dev/null +++ b/packages/js/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts @@ -0,0 +1,8 @@ +import { Tree, formatFiles } from '@nx/devkit'; +import { replaceNrwlPackageWithNxPackage } from '@nx/devkit/src/utils/replace-package'; + +export default async function replacePackage(tree: Tree): Promise { + await replaceNrwlPackageWithNxPackage(tree, '@nrwl/js', '@nx/js'); + + await formatFiles(tree); +} diff --git a/packages/js/src/utils/add-babel-inputs.ts b/packages/js/src/utils/add-babel-inputs.ts index ac5fad78b0de37..b499042e8148e0 100644 --- a/packages/js/src/utils/add-babel-inputs.ts +++ b/packages/js/src/utils/add-babel-inputs.ts @@ -5,7 +5,7 @@ import { Tree, updateNxJson, writeJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; export function addBabelInputs(tree: Tree) { const nxJson = readNxJson(tree); diff --git a/packages/js/src/utils/assets/copy-assets-handler.ts b/packages/js/src/utils/assets/copy-assets-handler.ts index 639a793374f25e..42c3b0ecc5860a 100644 --- a/packages/js/src/utils/assets/copy-assets-handler.ts +++ b/packages/js/src/utils/assets/copy-assets-handler.ts @@ -4,7 +4,7 @@ import * as fse from 'fs-extra'; import ignore, { Ignore } from 'ignore'; import * as fg from 'fast-glob'; import { AssetGlob } from './assets'; -import { logger } from '@nrwl/devkit'; +import { logger } from '@nx/devkit'; import { ChangedFile, daemonClient } from 'nx/src/daemon/client/client'; export type FileEventType = 'create' | 'update' | 'delete'; diff --git a/packages/js/src/utils/assets/index.ts b/packages/js/src/utils/assets/index.ts index 78678af78f8710..391f9bfa46829a 100644 --- a/packages/js/src/utils/assets/index.ts +++ b/packages/js/src/utils/assets/index.ts @@ -1,6 +1,6 @@ import { AssetGlob } from './assets'; import { CopyAssetsHandler, FileEvent } from './copy-assets-handler'; -import { ExecutorContext } from '@nrwl/devkit'; +import { ExecutorContext } from '@nx/devkit'; export interface CopyAssetsOptions { outputPath: string; diff --git a/packages/js/src/utils/buildable-libs-utils.spec.ts b/packages/js/src/utils/buildable-libs-utils.spec.ts index 2c4d3ee8fa7586..5b128a2159e7c4 100644 --- a/packages/js/src/utils/buildable-libs-utils.spec.ts +++ b/packages/js/src/utils/buildable-libs-utils.spec.ts @@ -1,4 +1,4 @@ -import { DependencyType, ProjectGraph } from '@nrwl/devkit'; +import { DependencyType, ProjectGraph } from '@nx/devkit'; import { calculateProjectDependencies, DependentBuildableProjectNode, diff --git a/packages/js/src/utils/buildable-libs-utils.ts b/packages/js/src/utils/buildable-libs-utils.ts index d09edc55a8db92..86a0e621901037 100644 --- a/packages/js/src/utils/buildable-libs-utils.ts +++ b/packages/js/src/utils/buildable-libs-utils.ts @@ -1,13 +1,13 @@ import { dirname, join, relative } from 'path'; import { directoryExists, fileExists } from 'nx/src/utils/fileutils'; -import type { ProjectGraph, ProjectGraphProjectNode } from '@nrwl/devkit'; +import type { ProjectGraph, ProjectGraphProjectNode } from '@nx/devkit'; import { getOutputsForTargetAndConfiguration, ProjectGraphExternalNode, readJsonFile, stripIndents, writeJsonFile, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import type * as ts from 'typescript'; import { unlinkSync } from 'fs'; import { output } from 'nx/src/utils/output'; diff --git a/packages/js/src/utils/check-dependencies.ts b/packages/js/src/utils/check-dependencies.ts index ba41b417685519..6044ef41bf90af 100644 --- a/packages/js/src/utils/check-dependencies.ts +++ b/packages/js/src/utils/check-dependencies.ts @@ -1,4 +1,4 @@ -import { ExecutorContext, ProjectGraphProjectNode } from '@nrwl/devkit'; +import { ExecutorContext, ProjectGraphProjectNode } from '@nx/devkit'; import { calculateProjectDependencies, createTmpTsConfig, diff --git a/packages/js/src/utils/compiler-helper-dependency.ts b/packages/js/src/utils/compiler-helper-dependency.ts index 05586e6b5583e3..9708b41d39bc44 100644 --- a/packages/js/src/utils/compiler-helper-dependency.ts +++ b/packages/js/src/utils/compiler-helper-dependency.ts @@ -3,7 +3,7 @@ import { ProjectGraph, ProjectGraphDependency, readJsonFile, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { DependentBuildableProjectNode } from './buildable-libs-utils'; import { join } from 'path'; import { readTsConfig } from './typescript/ts-config'; diff --git a/packages/js/src/utils/generate-globs.ts b/packages/js/src/utils/generate-globs.ts index a4a940164f397a..249f68afb2e93b 100644 --- a/packages/js/src/utils/generate-globs.ts +++ b/packages/js/src/utils/generate-globs.ts @@ -1,4 +1,4 @@ -import { joinPathFragments, logger, normalizePath } from '@nrwl/devkit'; +import { joinPathFragments, logger, normalizePath } from '@nx/devkit'; import { workspaceRoot } from 'nx/src/utils/workspace-root'; import { dirname, join, relative, resolve } from 'path'; import { readCachedProjectGraph } from 'nx/src/project-graph/project-graph'; diff --git a/packages/js/src/utils/inline.ts b/packages/js/src/utils/inline.ts index 7cc06a48fe1a52..459bc9ee7f9a2c 100644 --- a/packages/js/src/utils/inline.ts +++ b/packages/js/src/utils/inline.ts @@ -1,5 +1,5 @@ -import type { ExecutorContext, ProjectGraphProjectNode } from '@nrwl/devkit'; -import { normalizePath, readJsonFile } from '@nrwl/devkit'; +import type { ExecutorContext, ProjectGraphProjectNode } from '@nx/devkit'; +import { normalizePath, readJsonFile } from '@nx/devkit'; import { copySync, readdirSync, diff --git a/packages/js/src/utils/minimal-publish-script.ts b/packages/js/src/utils/minimal-publish-script.ts index 98bf5150639f97..13fefbf98d59fe 100644 --- a/packages/js/src/utils/minimal-publish-script.ts +++ b/packages/js/src/utils/minimal-publish-script.ts @@ -1,4 +1,4 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; const publishScriptContent = ` /** diff --git a/packages/js/src/utils/package-json/index.ts b/packages/js/src/utils/package-json/index.ts index 7f889c08bb757f..54dbaed318a66c 100644 --- a/packages/js/src/utils/package-json/index.ts +++ b/packages/js/src/utils/package-json/index.ts @@ -1,4 +1,4 @@ -import { ExecutorContext } from '@nrwl/devkit'; +import { ExecutorContext } from '@nx/devkit'; import { DependentBuildableProjectNode } from '../buildable-libs-utils'; import { watchForSingleFileChanges } from '../watch-for-single-file-changes'; diff --git a/packages/js/src/utils/package-json/update-package-json.spec.ts b/packages/js/src/utils/package-json/update-package-json.spec.ts index 468f4a766a82dc..9209b21eb3d5cd 100644 --- a/packages/js/src/utils/package-json/update-package-json.spec.ts +++ b/packages/js/src/utils/package-json/update-package-json.spec.ts @@ -6,7 +6,7 @@ import { UpdatePackageJsonOption, } from './update-package-json'; import { vol } from 'memfs'; -import { DependencyType, ExecutorContext, ProjectGraph } from '@nrwl/devkit'; +import { DependencyType, ExecutorContext, ProjectGraph } from '@nx/devkit'; import { DependentBuildableProjectNode } from '../buildable-libs-utils'; jest.mock('nx/src/utils/workspace-root', () => ({ diff --git a/packages/js/src/utils/package-json/update-package-json.ts b/packages/js/src/utils/package-json/update-package-json.ts index 8cd01317508d8d..7727aaa6b67f84 100644 --- a/packages/js/src/utils/package-json/update-package-json.ts +++ b/packages/js/src/utils/package-json/update-package-json.ts @@ -12,7 +12,7 @@ import { readJsonFile, workspaceRoot, writeJsonFile, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { DependentBuildableProjectNode } from '../buildable-libs-utils'; import { basename, dirname, join, parse, relative } from 'path'; import { writeFileSync } from 'fs-extra'; diff --git a/packages/js/src/utils/schema.d.ts b/packages/js/src/utils/schema.d.ts index 7d408d5d369400..ddfbfb33203043 100644 --- a/packages/js/src/utils/schema.d.ts +++ b/packages/js/src/utils/schema.d.ts @@ -1,5 +1,5 @@ // nx-ignore-next-line -const { Linter } = require('@nrwl/linter'); // use require to import to avoid circular dependency +const { Linter } = require('@nx/linter'); // use require to import to avoid circular dependency import type { AssetGlob, FileInputOutput } from './assets/assets'; import { TransformerEntry } from './typescript/types'; diff --git a/packages/js/src/utils/swc/add-swc-config.ts b/packages/js/src/utils/swc/add-swc-config.ts index 427b9d4c126eb5..4e3d4e9a86a913 100644 --- a/packages/js/src/utils/swc/add-swc-config.ts +++ b/packages/js/src/utils/swc/add-swc-config.ts @@ -1,6 +1,6 @@ // TODO(chau): change back to 2015 when https://github.com/swc-project/swc/issues/1108 is solved // target: 'es2015' -import { logger, readJson, Tree, updateJson } from '@nrwl/devkit'; +import { logger, readJson, Tree, updateJson } from '@nx/devkit'; import { join } from 'path'; export const defaultExclude = [ diff --git a/packages/js/src/utils/swc/add-swc-dependencies.ts b/packages/js/src/utils/swc/add-swc-dependencies.ts index b36dee699a178a..22214eedc045df 100644 --- a/packages/js/src/utils/swc/add-swc-dependencies.ts +++ b/packages/js/src/utils/swc/add-swc-dependencies.ts @@ -1,4 +1,4 @@ -import { addDependenciesToPackageJson, Tree } from '@nrwl/devkit'; +import { addDependenciesToPackageJson, Tree } from '@nx/devkit'; import { swcCliVersion, swcCoreVersion, swcHelpersVersion } from '../versions'; export function addSwcDependencies(tree: Tree) { diff --git a/packages/js/src/utils/swc/compile-swc.ts b/packages/js/src/utils/swc/compile-swc.ts index 138b0d0c0608f9..aa441ad9f8dd61 100644 --- a/packages/js/src/utils/swc/compile-swc.ts +++ b/packages/js/src/utils/swc/compile-swc.ts @@ -1,7 +1,7 @@ -import { cacheDir, ExecutorContext, logger } from '@nrwl/devkit'; +import { cacheDir, ExecutorContext, logger } from '@nx/devkit'; import { exec, execSync } from 'child_process'; import { removeSync } from 'fs-extra'; -import { createAsyncIterable } from '@nrwl/devkit/src/utils/async-iterable'; +import { createAsyncIterable } from '@nx/devkit/src/utils/async-iterable'; import { NormalizedSwcExecutorOptions, SwcCliOptions } from '../schema'; import { printDiagnostics } from '../typescript/print-diagnostics'; import { runTypeCheck, TypeCheckOptions } from '../typescript/run-type-check'; diff --git a/packages/js/src/utils/swc/inline.ts b/packages/js/src/utils/swc/inline.ts index a38e0c720e6d75..f8bcd83f265ddd 100644 --- a/packages/js/src/utils/swc/inline.ts +++ b/packages/js/src/utils/swc/inline.ts @@ -1,4 +1,4 @@ -import { readJsonFile, writeJsonFile } from '@nrwl/devkit'; +import { readJsonFile, writeJsonFile } from '@nx/devkit'; import type { InlineProjectGraph } from '../inline'; export function generateTmpSwcrc( diff --git a/packages/js/src/utils/typescript/ast-utils.ts b/packages/js/src/utils/typescript/ast-utils.ts index db49d274eed083..96ac2d83477bfb 100644 --- a/packages/js/src/utils/typescript/ast-utils.ts +++ b/packages/js/src/utils/typescript/ast-utils.ts @@ -1,7 +1,7 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import type * as ts from 'typescript'; // TODO(colum): replace when https://github.com/nrwl/nx/pull/15497 is merged -import { getSourceNodes } from '@nrwl/workspace/src/utilities/typescript'; +import { getSourceNodes } from '@nx/workspace/src/utilities/typescript'; import { findNodes } from 'nx/src/utils/typescript'; import { ensureTypescript } from './ensure-typescript'; diff --git a/packages/js/src/utils/typescript/compile-typescript-files.ts b/packages/js/src/utils/typescript/compile-typescript-files.ts index 70ae56fb8a25a2..bfe4b65073ea1e 100644 --- a/packages/js/src/utils/typescript/compile-typescript-files.ts +++ b/packages/js/src/utils/typescript/compile-typescript-files.ts @@ -2,9 +2,9 @@ import { compileTypeScript, compileTypeScriptWatcher, TypeScriptCompilationOptions, -} from '@nrwl/workspace/src/utilities/typescript/compilation'; +} from '@nx/workspace/src/utilities/typescript/compilation'; import type { Diagnostic } from 'typescript'; -import { createAsyncIterable } from '@nrwl/devkit/src/utils/async-iterable'; +import { createAsyncIterable } from '@nx/devkit/src/utils/async-iterable'; import { NormalizedExecutorOptions } from '../schema'; const TYPESCRIPT_FOUND_N_ERRORS_WATCHING_FOR_FILE_CHANGES = 6194; diff --git a/packages/js/src/utils/typescript/ensure-typescript.ts b/packages/js/src/utils/typescript/ensure-typescript.ts index e69023538b1b1a..0d82504f9bdebc 100644 --- a/packages/js/src/utils/typescript/ensure-typescript.ts +++ b/packages/js/src/utils/typescript/ensure-typescript.ts @@ -1,4 +1,4 @@ -import { ensurePackage } from '@nrwl/devkit'; +import { ensurePackage } from '@nx/devkit'; import { typescriptVersion } from '../versions'; export function ensureTypescript() { diff --git a/packages/js/src/utils/typescript/load-ts-transformers.ts b/packages/js/src/utils/typescript/load-ts-transformers.ts index fc847c54b46322..99e3ca75640130 100644 --- a/packages/js/src/utils/typescript/load-ts-transformers.ts +++ b/packages/js/src/utils/typescript/load-ts-transformers.ts @@ -1,4 +1,4 @@ -import { logger } from '@nrwl/devkit'; +import { logger } from '@nx/devkit'; import { join } from 'path'; import { CompilerPlugin, diff --git a/packages/js/src/utils/typescript/ts-config.ts b/packages/js/src/utils/typescript/ts-config.ts index 6743ecaa8a4c7b..63fb0441312a57 100644 --- a/packages/js/src/utils/typescript/ts-config.ts +++ b/packages/js/src/utils/typescript/ts-config.ts @@ -4,7 +4,7 @@ import { Tree, updateJson, workspaceRoot, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { existsSync } from 'fs'; import { dirname, join } from 'path'; diff --git a/packages/js/src/utils/watch-for-single-file-changes.ts b/packages/js/src/utils/watch-for-single-file-changes.ts index 47344fae80a73a..682d48bc72095c 100644 --- a/packages/js/src/utils/watch-for-single-file-changes.ts +++ b/packages/js/src/utils/watch-for-single-file-changes.ts @@ -1,4 +1,4 @@ -import { logger } from '@nrwl/devkit'; +import { logger } from '@nx/devkit'; import { daemonClient } from 'nx/src/daemon/client/client'; import { join } from 'path'; diff --git a/packages/linter/migrations.json b/packages/linter/migrations.json index 132f4fecd1709d..7487f89dc76456 100644 --- a/packages/linter/migrations.json +++ b/packages/linter/migrations.json @@ -59,6 +59,12 @@ "version": "15.7.1-beta.0", "description": "Add node_modules to root eslint ignore", "factory": "./src/migrations/update-15-7-1/add-eslint-ignore" + }, + "update-16-0-0-add-nx-packages": { + "cli": "nx", + "version": "16.0.0-beta.1", + "description": "Replace @nrwl/linter with @nx/linter", + "implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages" } }, "packageJsonUpdates": { diff --git a/packages/linter/migrations.spec.ts b/packages/linter/migrations.spec.ts index 916a4da18c0f3b..868be861df4fd7 100644 --- a/packages/linter/migrations.spec.ts +++ b/packages/linter/migrations.spec.ts @@ -1,11 +1,14 @@ import path = require('path'); import json = require('./migrations.json'); +import { MigrationsJsonEntry } from 'nx/src/config/misc-interfaces'; describe('Linter migrations', () => { it('should have valid paths', () => { - Object.values(json.generators).forEach((m) => { + Object.values(json.generators).forEach((m: MigrationsJsonEntry) => { expect(() => - require.resolve(path.join(__dirname, `${m.factory}.ts`)) + require.resolve( + path.join(__dirname, `${m.factory ?? m.implementation}.ts`) + ) ).not.toThrow(); }); }); diff --git a/packages/linter/package.json b/packages/linter/package.json index cc2f36396ef913..0dd3d494d10c53 100644 --- a/packages/linter/package.json +++ b/packages/linter/package.json @@ -1,5 +1,5 @@ { - "name": "@nrwl/linter", + "name": "@nx/linter", "version": "0.0.1", "private": false, "description": "The Linter plugin for Nx contains executors, generators and utilities used for linting JavaScript/TypeScript projects within an Nx workspace.", @@ -33,11 +33,11 @@ "eslint": "^8.0.0" }, "dependencies": { - "@nrwl/devkit": "file:../devkit", - "@nrwl/js": "file:../js", "@phenomnomnominal/tsquery": "~5.0.1", "tmp": "~0.2.1", - "tslib": "^2.3.0" + "tslib": "^2.3.0", + "@nx/devkit": "file:../devkit", + "@nx/js": "file:../js" }, "peerDependenciesMeta": { "eslint": { diff --git a/packages/linter/project.json b/packages/linter/project.json index 0ef6d2cfe65be0..c4733dc31dc3e4 100644 --- a/packages/linter/project.json +++ b/packages/linter/project.json @@ -48,7 +48,10 @@ "executor": "nx:run-commands", "outputs": ["{workspaceRoot}/build/packages/linter"], "options": { - "command": "node ./scripts/copy-readme.js linter" + "commands": [ + "node ./scripts/copy-readme.js linter", + "node ./scripts/add-dependency-to-build.js linter @nrwl/linter" + ] } }, "lint": {} diff --git a/packages/linter/src/executors/eslint/compat.ts b/packages/linter/src/executors/eslint/compat.ts index d04532c1be5ca4..1d005fafb0eee1 100644 --- a/packages/linter/src/executors/eslint/compat.ts +++ b/packages/linter/src/executors/eslint/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import lintExecutor from './lint.impl'; diff --git a/packages/linter/src/executors/eslint/hasher.ts b/packages/linter/src/executors/eslint/hasher.ts index a2df772513f2c1..4738c255101417 100644 --- a/packages/linter/src/executors/eslint/hasher.ts +++ b/packages/linter/src/executors/eslint/hasher.ts @@ -5,7 +5,7 @@ import { ProjectsConfigurations, Hasher, Hash, -} from '@nrwl/devkit'; +} from '@nx/devkit'; export default async function run( task: Task, diff --git a/packages/linter/src/executors/eslint/lint.impl.spec.ts b/packages/linter/src/executors/eslint/lint.impl.spec.ts index 8ce527e2014a6e..9a805faa7d54f1 100644 --- a/packages/linter/src/executors/eslint/lint.impl.spec.ts +++ b/packages/linter/src/executors/eslint/lint.impl.spec.ts @@ -1,6 +1,6 @@ import * as fs from 'fs'; import type { Schema } from './schema'; -import type { ExecutorContext } from '@nrwl/devkit'; +import type { ExecutorContext } from '@nx/devkit'; jest.spyOn(fs, 'mkdirSync').mockImplementation(); jest.spyOn(fs, 'writeFileSync').mockImplementation(); diff --git a/packages/linter/src/executors/eslint/lint.impl.ts b/packages/linter/src/executors/eslint/lint.impl.ts index 2ab24fecf45218..8c4ddedea8483d 100644 --- a/packages/linter/src/executors/eslint/lint.impl.ts +++ b/packages/linter/src/executors/eslint/lint.impl.ts @@ -1,4 +1,4 @@ -import type { ExecutorContext } from '@nrwl/devkit'; +import type { ExecutorContext } from '@nx/devkit'; import { ESLint } from 'eslint'; import { writeFileSync, mkdirSync } from 'fs'; diff --git a/packages/linter/src/generators/init/init-migration.ts b/packages/linter/src/generators/init/init-migration.ts index 28c7f6e253d1af..6169b75691151c 100644 --- a/packages/linter/src/generators/init/init-migration.ts +++ b/packages/linter/src/generators/init/init-migration.ts @@ -6,7 +6,7 @@ import { Tree, updateJson, writeJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { dirname } from 'path'; import { findEslintFile } from '../utils/eslint-file'; import { getGlobalEsLintConfiguration } from './global-eslint-config'; diff --git a/packages/linter/src/generators/init/init.spec.ts b/packages/linter/src/generators/init/init.spec.ts index e6579e584e3e7c..57385c9b9b5e80 100644 --- a/packages/linter/src/generators/init/init.spec.ts +++ b/packages/linter/src/generators/init/init.spec.ts @@ -1,6 +1,6 @@ import { Linter } from '../utils/linter'; -import { readJson, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { readJson, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { lintInitGenerator } from './init'; describe('@nrwl/linter:init', () => { diff --git a/packages/linter/src/generators/init/init.ts b/packages/linter/src/generators/init/init.ts index 57c7bbbe040901..7230f63d015c7d 100644 --- a/packages/linter/src/generators/init/init.ts +++ b/packages/linter/src/generators/init/init.ts @@ -1,4 +1,4 @@ -import type { GeneratorCallback, Tree } from '@nrwl/devkit'; +import type { GeneratorCallback, Tree } from '@nx/devkit'; import { addDependenciesToPackageJson, readNxJson, @@ -6,7 +6,7 @@ import { updateJson, updateNxJson, writeJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { eslintConfigPrettierVersion, eslintVersion, diff --git a/packages/linter/src/generators/lint-project/lint-project.spec.ts b/packages/linter/src/generators/lint-project/lint-project.spec.ts index fec69053a8ab46..9fcf5650a5b8c4 100644 --- a/packages/linter/src/generators/lint-project/lint-project.spec.ts +++ b/packages/linter/src/generators/lint-project/lint-project.spec.ts @@ -2,10 +2,10 @@ import { addProjectConfiguration, readProjectConfiguration, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { Linter } from '../utils/linter'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { lintProjectGenerator } from './lint-project'; describe('@nrwl/linter:lint-project', () => { diff --git a/packages/linter/src/generators/lint-project/lint-project.ts b/packages/linter/src/generators/lint-project/lint-project.ts index 8d275bcd38ca05..0120f2e75bc55e 100644 --- a/packages/linter/src/generators/lint-project/lint-project.ts +++ b/packages/linter/src/generators/lint-project/lint-project.ts @@ -1,11 +1,11 @@ -import type { ProjectConfiguration, Tree } from '@nrwl/devkit'; +import type { ProjectConfiguration, Tree } from '@nx/devkit'; import { formatFiles, offsetFromRoot, readProjectConfiguration, updateProjectConfiguration, writeJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { Linter } from '../utils/linter'; import { findEslintFile } from '../utils/eslint-file'; diff --git a/packages/linter/src/generators/utils/eslint-file.spec.ts b/packages/linter/src/generators/utils/eslint-file.spec.ts index d2e1fb0ee9e8d6..5185276a6b5d3b 100644 --- a/packages/linter/src/generators/utils/eslint-file.spec.ts +++ b/packages/linter/src/generators/utils/eslint-file.spec.ts @@ -4,8 +4,8 @@ import { findEslintFile, } from './eslint-file'; -import { Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; describe('@nrwl/linter:eslint-file', () => { let tree: Tree; diff --git a/packages/linter/src/generators/utils/eslint-file.ts b/packages/linter/src/generators/utils/eslint-file.ts index 050245ad3239e9..3867121bcc6317 100644 --- a/packages/linter/src/generators/utils/eslint-file.ts +++ b/packages/linter/src/generators/utils/eslint-file.ts @@ -1,4 +1,4 @@ -import { joinPathFragments, Tree } from '@nrwl/devkit'; +import { joinPathFragments, Tree } from '@nx/devkit'; export const eslintConfigFileWhitelist = [ '.eslintrc', diff --git a/packages/linter/src/generators/utils/eslint-targets.ts b/packages/linter/src/generators/utils/eslint-targets.ts index 9de6f24bdd7e42..397d09deb8ae29 100644 --- a/packages/linter/src/generators/utils/eslint-targets.ts +++ b/packages/linter/src/generators/utils/eslint-targets.ts @@ -1,5 +1,5 @@ -import { Tree } from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; +import { Tree } from '@nx/devkit'; +import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils'; export function getEslintTargets(tree: Tree) { const eslintTargetNames = new Set(); diff --git a/packages/linter/src/generators/workspace-rule/workspace-rule.spec.ts b/packages/linter/src/generators/workspace-rule/workspace-rule.spec.ts index 3bfdd026c334dd..e7dfb7ae464af8 100644 --- a/packages/linter/src/generators/workspace-rule/workspace-rule.spec.ts +++ b/packages/linter/src/generators/workspace-rule/workspace-rule.spec.ts @@ -1,5 +1,5 @@ -import { NxJsonConfiguration, readJson, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { NxJsonConfiguration, readJson, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { lintWorkspaceRuleGenerator } from './workspace-rule'; describe('@nrwl/linter:workspace-rule', () => { diff --git a/packages/linter/src/generators/workspace-rule/workspace-rule.ts b/packages/linter/src/generators/workspace-rule/workspace-rule.ts index 06c14e4e790e17..8a50b77fa3f86c 100644 --- a/packages/linter/src/generators/workspace-rule/workspace-rule.ts +++ b/packages/linter/src/generators/workspace-rule/workspace-rule.ts @@ -7,8 +7,8 @@ import { joinPathFragments, logger, Tree, -} from '@nrwl/devkit'; -import { camelize } from '@nrwl/devkit/src/utils/string-utils'; +} from '@nx/devkit'; +import { camelize } from '@nx/devkit/src/utils/string-utils'; import { join } from 'path'; import * as ts from 'typescript'; import { workspaceLintPluginDir } from '../../utils/workspace-lint-rules'; diff --git a/packages/linter/src/generators/workspace-rules-project/workspace-rules-project.spec.ts b/packages/linter/src/generators/workspace-rules-project/workspace-rules-project.spec.ts index 55607402598e37..b06dc0186eb27a 100644 --- a/packages/linter/src/generators/workspace-rules-project/workspace-rules-project.spec.ts +++ b/packages/linter/src/generators/workspace-rules-project/workspace-rules-project.spec.ts @@ -5,8 +5,8 @@ import { readProjectConfiguration, Tree, updateJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { lintWorkspaceRulesProjectGenerator, WORKSPACE_RULES_PROJECT_NAME, diff --git a/packages/linter/src/generators/workspace-rules-project/workspace-rules-project.ts b/packages/linter/src/generators/workspace-rules-project/workspace-rules-project.ts index f6621c61c67a94..aecb4af30772b0 100644 --- a/packages/linter/src/generators/workspace-rules-project/workspace-rules-project.ts +++ b/packages/linter/src/generators/workspace-rules-project/workspace-rules-project.ts @@ -12,8 +12,8 @@ import { Tree, updateJson, updateNxJson, -} from '@nrwl/devkit'; -import { getRelativePathToRootTsConfig } from '@nrwl/js'; +} from '@nx/devkit'; +import { getRelativePathToRootTsConfig } from '@nx/js'; import { join } from 'path'; import { workspaceLintPluginDir } from '../../utils/workspace-lint-rules'; import { swcCoreVersion, swcNodeVersion } from 'nx/src/utils/versions'; @@ -32,7 +32,7 @@ export async function lintWorkspaceRulesProjectGenerator( options: LintWorkspaceRulesProjectGeneratorOptions = {} ) { const { addPropertyToJestConfig, jestProjectGenerator } = ensurePackage( - '@nrwl/jest', + '@nx/jest', nxVersion ); diff --git a/packages/linter/src/migrations/update-12-4-0/remove-eslint-project-config-if-no-type-checking-rules.spec.ts b/packages/linter/src/migrations/update-12-4-0/remove-eslint-project-config-if-no-type-checking-rules.spec.ts index e8c9e78be5a937..3721f5a9a22a30 100644 --- a/packages/linter/src/migrations/update-12-4-0/remove-eslint-project-config-if-no-type-checking-rules.spec.ts +++ b/packages/linter/src/migrations/update-12-4-0/remove-eslint-project-config-if-no-type-checking-rules.spec.ts @@ -1,10 +1,5 @@ -import { - addProjectConfiguration, - readJson, - Tree, - writeJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { addProjectConfiguration, readJson, Tree, writeJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import removeESLintProjectConfigIfNoTypeCheckingRules from './remove-eslint-project-config-if-no-type-checking-rules'; import type { Linter } from 'eslint'; const KNOWN_RULE_REQUIRING_TYPE_CHECKING = '@typescript-eslint/await-thenable'; diff --git a/packages/linter/src/migrations/update-12-4-0/remove-eslint-project-config-if-no-type-checking-rules.ts b/packages/linter/src/migrations/update-12-4-0/remove-eslint-project-config-if-no-type-checking-rules.ts index 6f8b2ed9f4c491..497c67c4baa9ce 100644 --- a/packages/linter/src/migrations/update-12-4-0/remove-eslint-project-config-if-no-type-checking-rules.ts +++ b/packages/linter/src/migrations/update-12-4-0/remove-eslint-project-config-if-no-type-checking-rules.ts @@ -1,5 +1,5 @@ -import { formatFiles, getProjects, readJson, updateJson } from '@nrwl/devkit'; -import type { Tree } from '@nrwl/devkit'; +import { formatFiles, getProjects, readJson, updateJson } from '@nx/devkit'; +import type { Tree } from '@nx/devkit'; import { join } from 'path'; import { hasRulesRequiringTypeChecking, diff --git a/packages/linter/src/migrations/update-12-9-0/add-outputs.spec.ts b/packages/linter/src/migrations/update-12-9-0/add-outputs.spec.ts index d5f62cb0210363..56819b2c039f68 100644 --- a/packages/linter/src/migrations/update-12-9-0/add-outputs.spec.ts +++ b/packages/linter/src/migrations/update-12-9-0/add-outputs.spec.ts @@ -3,8 +3,8 @@ import { readProjectConfiguration, TargetConfiguration, Tree, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import addOutputs from './add-outputs'; describe('addOutputs', () => { diff --git a/packages/linter/src/migrations/update-12-9-0/add-outputs.ts b/packages/linter/src/migrations/update-12-9-0/add-outputs.ts index 7ec85927a0283b..84213058b7dc88 100644 --- a/packages/linter/src/migrations/update-12-9-0/add-outputs.ts +++ b/packages/linter/src/migrations/update-12-9-0/add-outputs.ts @@ -3,7 +3,7 @@ import { getProjects, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; export default async function addOutputs(tree: Tree) { for (const [projectName, project] of getProjects(tree)) { diff --git a/packages/linter/src/migrations/update-13-3-0/eslint-8-updates.spec.ts b/packages/linter/src/migrations/update-13-3-0/eslint-8-updates.spec.ts index 20374fe1857617..5c56d621a463f2 100644 --- a/packages/linter/src/migrations/update-13-3-0/eslint-8-updates.spec.ts +++ b/packages/linter/src/migrations/update-13-3-0/eslint-8-updates.spec.ts @@ -1,5 +1,5 @@ -import { Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import eslint8Updates from './eslint-8-updates'; describe('eslint8Updates()', () => { diff --git a/packages/linter/src/migrations/update-13-3-0/eslint-8-updates.ts b/packages/linter/src/migrations/update-13-3-0/eslint-8-updates.ts index 5037120a4e8aea..b1c9643771e55e 100644 --- a/packages/linter/src/migrations/update-13-3-0/eslint-8-updates.ts +++ b/packages/linter/src/migrations/update-13-3-0/eslint-8-updates.ts @@ -4,13 +4,13 @@ import { normalizePath, Tree, visitNotIgnoredFiles, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { tsquery } from '@phenomnomnominal/tsquery'; import { nxVersion } from '../../utils/versions'; export default async function eslint8Updates(tree: Tree) { try { - const { addPropertyToJestConfig } = ensurePackage('@nrwl/jest', nxVersion); + const { addPropertyToJestConfig } = ensurePackage('@nx/jest', nxVersion); const existingJestConfigPath = normalizePath( 'tools/eslint-rules/jest.config.js' ); diff --git a/packages/linter/src/migrations/update-14-1-9/add-swc-deps-if-needed.ts b/packages/linter/src/migrations/update-14-1-9/add-swc-deps-if-needed.ts index eaffc27d4b6890..040e33cf991f62 100644 --- a/packages/linter/src/migrations/update-14-1-9/add-swc-deps-if-needed.ts +++ b/packages/linter/src/migrations/update-14-1-9/add-swc-deps-if-needed.ts @@ -1,4 +1,4 @@ -import { addDependenciesToPackageJson, formatFiles, Tree } from '@nrwl/devkit'; +import { addDependenciesToPackageJson, formatFiles, Tree } from '@nx/devkit'; import { swcCoreVersion, swcNodeVersion } from 'nx/src/utils/versions'; import { WORKSPACE_PLUGIN_DIR } from '../../generators/workspace-rules-project/workspace-rules-project'; diff --git a/packages/linter/src/migrations/update-14-4-4/experimental-to-utils-deps.spec.ts b/packages/linter/src/migrations/update-14-4-4/experimental-to-utils-deps.spec.ts index 2b5ad17ea898dc..9852c3a754d6fc 100644 --- a/packages/linter/src/migrations/update-14-4-4/experimental-to-utils-deps.spec.ts +++ b/packages/linter/src/migrations/update-14-4-4/experimental-to-utils-deps.spec.ts @@ -1,5 +1,5 @@ -import { updateJson } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { updateJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { WORKSPACE_PLUGIN_DIR } from '../../generators/workspace-rules-project/workspace-rules-project'; import addTypescriptEslintUtilsIfNeeded from './experimental-to-utils-deps'; diff --git a/packages/linter/src/migrations/update-14-4-4/experimental-to-utils-deps.ts b/packages/linter/src/migrations/update-14-4-4/experimental-to-utils-deps.ts index a2fb28fdeba9af..63ec3303593336 100644 --- a/packages/linter/src/migrations/update-14-4-4/experimental-to-utils-deps.ts +++ b/packages/linter/src/migrations/update-14-4-4/experimental-to-utils-deps.ts @@ -4,7 +4,7 @@ import { readJson, removeDependenciesFromPackageJson, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { WORKSPACE_PLUGIN_DIR } from '../../generators/workspace-rules-project/workspace-rules-project'; import { typescriptESLintVersion } from '../../utils/versions'; diff --git a/packages/linter/src/migrations/update-14-4-4/experimental-to-utils-rules.spec.ts b/packages/linter/src/migrations/update-14-4-4/experimental-to-utils-rules.spec.ts index da48b4303fc5fa..1a1a3a2f77f937 100644 --- a/packages/linter/src/migrations/update-14-4-4/experimental-to-utils-rules.spec.ts +++ b/packages/linter/src/migrations/update-14-4-4/experimental-to-utils-rules.spec.ts @@ -1,5 +1,5 @@ -import { Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import experimentalToUtilsUpdate from './experimental-to-utils-rules'; describe('experimentalToUtilsUpdate()', () => { diff --git a/packages/linter/src/migrations/update-14-4-4/experimental-to-utils-rules.ts b/packages/linter/src/migrations/update-14-4-4/experimental-to-utils-rules.ts index 82baacfccd8e81..d1f4a55e31985d 100644 --- a/packages/linter/src/migrations/update-14-4-4/experimental-to-utils-rules.ts +++ b/packages/linter/src/migrations/update-14-4-4/experimental-to-utils-rules.ts @@ -1,4 +1,4 @@ -import { formatFiles, Tree, visitNotIgnoredFiles } from '@nrwl/devkit'; +import { formatFiles, Tree, visitNotIgnoredFiles } from '@nx/devkit'; import { tsquery } from '@phenomnomnominal/tsquery'; function updateFile(fileAst: any, fileContents: string): string | undefined { diff --git a/packages/linter/src/migrations/update-15-0-0/add-eslint-inputs.spec.ts b/packages/linter/src/migrations/update-15-0-0/add-eslint-inputs.spec.ts index 30087a7a894245..84b68ed5328306 100644 --- a/packages/linter/src/migrations/update-15-0-0/add-eslint-inputs.spec.ts +++ b/packages/linter/src/migrations/update-15-0-0/add-eslint-inputs.spec.ts @@ -1,10 +1,10 @@ -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { Tree, addProjectConfiguration, readNxJson, updateNxJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import addEslintInputs from './add-eslint-inputs'; import { eslintConfigFileWhitelist } from '../../generators/utils/eslint-file'; diff --git a/packages/linter/src/migrations/update-15-0-0/add-eslint-inputs.ts b/packages/linter/src/migrations/update-15-0-0/add-eslint-inputs.ts index 06d265aeae9932..62abcbbf84c013 100644 --- a/packages/linter/src/migrations/update-15-0-0/add-eslint-inputs.ts +++ b/packages/linter/src/migrations/update-15-0-0/add-eslint-inputs.ts @@ -4,7 +4,7 @@ import { readNxJson, Tree, updateNxJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { eslintConfigFileWhitelist } from '../../generators/utils/eslint-file'; import { getEslintTargets } from '../../generators/utils/eslint-targets'; diff --git a/packages/linter/src/migrations/update-15-7-1/add-eslint-ignore.spec.ts b/packages/linter/src/migrations/update-15-7-1/add-eslint-ignore.spec.ts index ac7aeae216639c..a52f1d8a200982 100644 --- a/packages/linter/src/migrations/update-15-7-1/add-eslint-ignore.spec.ts +++ b/packages/linter/src/migrations/update-15-7-1/add-eslint-ignore.spec.ts @@ -4,8 +4,8 @@ import { readNxJson, Tree, updateNxJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import addEslintIgnore from './add-eslint-ignore'; describe('15.7.1 migration (add-eslintignore)', () => { diff --git a/packages/linter/src/migrations/update-15-7-1/add-eslint-ignore.ts b/packages/linter/src/migrations/update-15-7-1/add-eslint-ignore.ts index 9f1e7c766c2590..fff702591db771 100644 --- a/packages/linter/src/migrations/update-15-7-1/add-eslint-ignore.ts +++ b/packages/linter/src/migrations/update-15-7-1/add-eslint-ignore.ts @@ -4,7 +4,7 @@ import { readJson, Tree, updateNxJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { eslintConfigFileWhitelist } from '../../generators/utils/eslint-file'; import { getEslintTargets } from '../../generators/utils/eslint-targets'; diff --git a/packages/linter/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts b/packages/linter/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts new file mode 100644 index 00000000000000..1c66d74de0c4e8 --- /dev/null +++ b/packages/linter/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts @@ -0,0 +1,37 @@ +import { Tree, readJson, updateJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import replacePackage from './update-16-0-0-add-nx-packages'; + +describe('update-16-0-0-add-nx-packages', () => { + let tree: Tree; + beforeEach(() => { + tree = createTreeWithEmptyWorkspace(); + + updateJson(tree, 'package.json', (json) => { + json.devDependencies['@nrwl/linter'] = '16.0.0'; + return json; + }); + }); + + it('should remove the dependency on @nrwl/linter', async () => { + await replacePackage(tree); + + expect( + readJson(tree, 'package.json').dependencies['@nrwl/linter'] + ).not.toBeDefined(); + expect( + readJson(tree, 'package.json').devDependencies['@nrwl/linter'] + ).not.toBeDefined(); + }); + + it('should add a dependency on @nx/linter', async () => { + await replacePackage(tree); + + const packageJson = readJson(tree, 'package.json'); + const newDependencyVersion = + packageJson.devDependencies['@nx/linter'] ?? + packageJson.dependencies['@nx/linter']; + + expect(newDependencyVersion).toBeDefined(); + }); +}); diff --git a/packages/linter/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts b/packages/linter/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts new file mode 100644 index 00000000000000..318e1816ffba8c --- /dev/null +++ b/packages/linter/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts @@ -0,0 +1,8 @@ +import { Tree, formatFiles } from '@nx/devkit'; +import { replaceNrwlPackageWithNxPackage } from '@nx/devkit/src/utils/replace-package'; + +export default async function replacePackage(tree: Tree): Promise { + await replaceNrwlPackageWithNxPackage(tree, '@nrwl/linter', '@nx/linter'); + + await formatFiles(tree); +} diff --git a/packages/linter/src/utils/convert-tslint-to-eslint/convert-to-eslint-config.spec.ts b/packages/linter/src/utils/convert-tslint-to-eslint/convert-to-eslint-config.spec.ts index 8479921cf01cab..20c38199c7c9ea 100644 --- a/packages/linter/src/utils/convert-tslint-to-eslint/convert-to-eslint-config.spec.ts +++ b/packages/linter/src/utils/convert-tslint-to-eslint/convert-to-eslint-config.spec.ts @@ -1,5 +1,5 @@ -import { addProjectConfiguration, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { addProjectConfiguration, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { join } from 'path'; import { convertToESLintConfig, diff --git a/packages/linter/src/utils/convert-tslint-to-eslint/convert-to-eslint-config.ts b/packages/linter/src/utils/convert-tslint-to-eslint/convert-to-eslint-config.ts index 3c72b9cba9d523..ffa41f252c5c80 100644 --- a/packages/linter/src/utils/convert-tslint-to-eslint/convert-to-eslint-config.ts +++ b/packages/linter/src/utils/convert-tslint-to-eslint/convert-to-eslint-config.ts @@ -3,8 +3,8 @@ import { visitNotIgnoredFiles, writeJsonFile, getPackageManagerCommand, -} from '@nrwl/devkit'; -import type { Tree } from '@nrwl/devkit'; +} from '@nx/devkit'; +import type { Tree } from '@nx/devkit'; import { execSync } from 'child_process'; import type { Linter as ESLintLinter } from 'eslint'; import { dirSync } from 'tmp'; diff --git a/packages/linter/src/utils/convert-tslint-to-eslint/project-converter.spec.ts b/packages/linter/src/utils/convert-tslint-to-eslint/project-converter.spec.ts index 280f15d72ebaef..91082b918abf95 100644 --- a/packages/linter/src/utils/convert-tslint-to-eslint/project-converter.spec.ts +++ b/packages/linter/src/utils/convert-tslint-to-eslint/project-converter.spec.ts @@ -6,8 +6,8 @@ import { readProjectConfiguration, Tree, writeJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { ProjectConverter } from './project-converter'; /** diff --git a/packages/linter/src/utils/convert-tslint-to-eslint/project-converter.ts b/packages/linter/src/utils/convert-tslint-to-eslint/project-converter.ts index fb6fd20ab3663e..96ab2804a4adf1 100644 --- a/packages/linter/src/utils/convert-tslint-to-eslint/project-converter.ts +++ b/packages/linter/src/utils/convert-tslint-to-eslint/project-converter.ts @@ -1,8 +1,4 @@ -import type { - GeneratorCallback, - ProjectConfiguration, - Tree, -} from '@nrwl/devkit'; +import type { GeneratorCallback, ProjectConfiguration, Tree } from '@nx/devkit'; import { getProjects, installPackagesTask, @@ -16,7 +12,7 @@ import { updateJson, updateNxJson, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import type { Linter } from 'eslint'; import { removeParserOptionsProjectIfNotRequired } from '../rules-requiring-type-checking'; import { convertTSLintDisableCommentsForProject } from './convert-to-eslint-config'; diff --git a/packages/linter/src/utils/convert-tslint-to-eslint/utils.ts b/packages/linter/src/utils/convert-tslint-to-eslint/utils.ts index cbb058ac8381c3..580ef4c2b5e763 100644 --- a/packages/linter/src/utils/convert-tslint-to-eslint/utils.ts +++ b/packages/linter/src/utils/convert-tslint-to-eslint/utils.ts @@ -1,5 +1,5 @@ -import { addDependenciesToPackageJson, logger } from '@nrwl/devkit'; -import type { Tree, GeneratorCallback } from '@nrwl/devkit'; +import { addDependenciesToPackageJson, logger } from '@nx/devkit'; +import type { Tree, GeneratorCallback } from '@nx/devkit'; import type { Linter } from 'eslint'; import type { TSLintRuleOptions } from 'tslint-to-eslint-config'; import { convertTslintNxRuleToEslintNxRule } from './convert-nx-enforce-module-boundaries-rule'; diff --git a/packages/linter/src/utils/workspace-lint-rules.ts b/packages/linter/src/utils/workspace-lint-rules.ts index 4d8dab15c776c6..b141b8c30218c8 100644 --- a/packages/linter/src/utils/workspace-lint-rules.ts +++ b/packages/linter/src/utils/workspace-lint-rules.ts @@ -1,3 +1,3 @@ -import { joinPathFragments } from '@nrwl/devkit'; +import { joinPathFragments } from '@nx/devkit'; export const workspaceLintPluginDir = joinPathFragments('tools/eslint-rules'); diff --git a/packages/nest/migrations.json b/packages/nest/migrations.json index 01eb1c71a1d97d..b13731fe78c521 100644 --- a/packages/nest/migrations.json +++ b/packages/nest/migrations.json @@ -5,6 +5,12 @@ "version": "13.2.0-beta.0", "description": "Update Nest.js libraries", "factory": "./src/migrations/update-13-2-0/update-to-nest-8" + }, + "update-16-0-0-add-nx-packages": { + "cli": "nx", + "version": "16.0.0-beta.1", + "description": "Replace @nrwl/nest with @nx/nest", + "implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages" } }, "packageJsonUpdates": { diff --git a/packages/nest/migrations.spec.ts b/packages/nest/migrations.spec.ts index 5ac5b7f54c5e5a..c9ee8857f9599f 100644 --- a/packages/nest/migrations.spec.ts +++ b/packages/nest/migrations.spec.ts @@ -1,11 +1,14 @@ import path = require('path'); import json = require('./migrations.json'); +import { MigrationsJsonEntry } from 'nx/src/config/misc-interfaces'; describe('Nest migrations', () => { it('should have valid paths', () => { - Object.values(json.generators).forEach((m) => { + Object.values(json.generators).forEach((m: MigrationsJsonEntry) => { expect(() => - require.resolve(path.join(__dirname, `${m.factory}.ts`)) + require.resolve( + path.join(__dirname, `${m.factory ?? m.implementation}.ts`) + ) ).not.toThrow(); }); }); diff --git a/packages/nest/package.json b/packages/nest/package.json index b8648052c56433..b5d8d2fe9987b0 100644 --- a/packages/nest/package.json +++ b/packages/nest/package.json @@ -1,5 +1,5 @@ { - "name": "@nrwl/nest", + "name": "@nx/nest", "version": "0.0.1", "private": false, "description": "The Nx Plugin for Nest contains executors and generators for allowing your workspace to create powerful Nest best in class APIs.", @@ -31,11 +31,11 @@ }, "dependencies": { "@nestjs/schematics": "^9.0.0", - "@nrwl/devkit": "file:../devkit", - "@nrwl/js": "file:../js", - "@nrwl/linter": "file:../linter", - "@nrwl/node": "file:../node", - "enquirer": "~2.3.6" + "enquirer": "~2.3.6", + "@nx/devkit": "file:../devkit", + "@nx/js": "file:../js", + "@nx/linter": "file:../linter", + "@nx/node": "file:../node" }, "publishConfig": { "access": "public" diff --git a/packages/nest/project.json b/packages/nest/project.json index 058b63e3e7a44c..f673a204357ff6 100644 --- a/packages/nest/project.json +++ b/packages/nest/project.json @@ -48,7 +48,10 @@ "executor": "nx:run-commands", "outputs": ["{workspaceRoot}/build/packages/nest"], "options": { - "command": "node ./scripts/copy-readme.js nest" + "commands": [ + "node ./scripts/copy-readme.js nest", + "node ./scripts/add-dependency-to-build.js nest @nrwl/nest" + ] } }, "lint": {} diff --git a/packages/nest/src/generators/application/application.spec.ts b/packages/nest/src/generators/application/application.spec.ts index af3f8556dd4bf2..cbd50dc5e1dbbf 100644 --- a/packages/nest/src/generators/application/application.spec.ts +++ b/packages/nest/src/generators/application/application.spec.ts @@ -1,6 +1,6 @@ -import type { Tree } from '@nrwl/devkit'; -import * as devkit from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import type { Tree } from '@nx/devkit'; +import * as devkit from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { applicationGenerator } from './application'; describe('application generator', () => { diff --git a/packages/nest/src/generators/application/application.ts b/packages/nest/src/generators/application/application.ts index e75eb61774fc13..18e8ea3bbf646c 100644 --- a/packages/nest/src/generators/application/application.ts +++ b/packages/nest/src/generators/application/application.ts @@ -1,10 +1,6 @@ -import type { GeneratorCallback, Tree } from '@nrwl/devkit'; -import { - convertNxGenerator, - formatFiles, - runTasksInSerial, -} from '@nrwl/devkit'; -import { applicationGenerator as nodeApplicationGenerator } from '@nrwl/node'; +import type { GeneratorCallback, Tree } from '@nx/devkit'; +import { convertNxGenerator, formatFiles, runTasksInSerial } from '@nx/devkit'; +import { applicationGenerator as nodeApplicationGenerator } from '@nx/node'; import { initGenerator } from '../init/init'; import { diff --git a/packages/nest/src/generators/application/lib/create-files.ts b/packages/nest/src/generators/application/lib/create-files.ts index db6dc5ba27397d..4ee1d6e9deefa9 100644 --- a/packages/nest/src/generators/application/lib/create-files.ts +++ b/packages/nest/src/generators/application/lib/create-files.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { generateFiles, joinPathFragments } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { generateFiles, joinPathFragments } from '@nx/devkit'; import type { NormalizedOptions } from '../schema'; export function createFiles(tree: Tree, options: NormalizedOptions): void { diff --git a/packages/nest/src/generators/application/lib/normalize-options.ts b/packages/nest/src/generators/application/lib/normalize-options.ts index 8891dabb3103d3..dd7dc07483906d 100644 --- a/packages/nest/src/generators/application/lib/normalize-options.ts +++ b/packages/nest/src/generators/application/lib/normalize-options.ts @@ -1,7 +1,7 @@ -import { extractLayoutDirectory, Tree } from '@nrwl/devkit'; -import { getWorkspaceLayout, joinPathFragments, names } from '@nrwl/devkit'; -import { Linter } from '@nrwl/linter'; -import type { Schema as NodeApplicationGeneratorOptions } from '@nrwl/node/src/generators/application/schema'; +import { extractLayoutDirectory, Tree } from '@nx/devkit'; +import { getWorkspaceLayout, joinPathFragments, names } from '@nx/devkit'; +import { Linter } from '@nx/linter'; +import type { Schema as NodeApplicationGeneratorOptions } from '@nx/node/src/generators/application/schema'; import type { ApplicationGeneratorOptions, NormalizedOptions } from '../schema'; export function normalizeOptions( diff --git a/packages/nest/src/generators/application/lib/update-tsconfig.ts b/packages/nest/src/generators/application/lib/update-tsconfig.ts index d9383ff0ac05db..748b82b02149cf 100644 --- a/packages/nest/src/generators/application/lib/update-tsconfig.ts +++ b/packages/nest/src/generators/application/lib/update-tsconfig.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { joinPathFragments, updateJson } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { joinPathFragments, updateJson } from '@nx/devkit'; import type { NormalizedOptions } from '../schema'; export function updateTsConfig(tree: Tree, options: NormalizedOptions): void { diff --git a/packages/nest/src/generators/application/schema.d.ts b/packages/nest/src/generators/application/schema.d.ts index f45728a1e0a7f6..e5b9d3d54b74d9 100644 --- a/packages/nest/src/generators/application/schema.d.ts +++ b/packages/nest/src/generators/application/schema.d.ts @@ -1,4 +1,4 @@ -import { Linter } from '@nrwl/linter'; +import { Linter } from '@nx/linter'; export interface ApplicationGeneratorOptions { name: string; diff --git a/packages/nest/src/generators/class/class.spec.ts b/packages/nest/src/generators/class/class.spec.ts index be7596829e5be2..1f660ae83a236e 100644 --- a/packages/nest/src/generators/class/class.spec.ts +++ b/packages/nest/src/generators/class/class.spec.ts @@ -1,4 +1,4 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { createTreeWithNestApplication } from '../utils/testing'; import type { ClassGeneratorOptions } from './class'; import { classGenerator } from './class'; diff --git a/packages/nest/src/generators/class/class.ts b/packages/nest/src/generators/class/class.ts index cd58873713e490..b24c799617fab5 100644 --- a/packages/nest/src/generators/class/class.ts +++ b/packages/nest/src/generators/class/class.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { convertNxGenerator } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { convertNxGenerator } from '@nx/devkit'; import type { NestGeneratorWithLanguageOption, NestGeneratorWithTestOption, diff --git a/packages/nest/src/generators/controller/controller.spec.ts b/packages/nest/src/generators/controller/controller.spec.ts index eb33cf03206541..8cfb79a52e2f56 100644 --- a/packages/nest/src/generators/controller/controller.spec.ts +++ b/packages/nest/src/generators/controller/controller.spec.ts @@ -1,4 +1,4 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { createTreeWithNestApplication } from '../utils/testing'; import type { ControllerGeneratorOptions } from './controller'; import { controllerGenerator } from './controller'; diff --git a/packages/nest/src/generators/controller/controller.ts b/packages/nest/src/generators/controller/controller.ts index cc72f0466a9a43..554ed0c32b1e26 100644 --- a/packages/nest/src/generators/controller/controller.ts +++ b/packages/nest/src/generators/controller/controller.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { convertNxGenerator } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { convertNxGenerator } from '@nx/devkit'; import type { NestGeneratorWithLanguageOption, NestGeneratorWithTestOption, diff --git a/packages/nest/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.spec.ts b/packages/nest/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.spec.ts index 69e404219b1678..4c6d5fd4fa0d6e 100644 --- a/packages/nest/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.spec.ts +++ b/packages/nest/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.spec.ts @@ -1,4 +1,4 @@ -import * as devkit from '@nrwl/devkit'; +import * as devkit from '@nx/devkit'; import { addProjectConfiguration, joinPathFragments, @@ -6,9 +6,9 @@ import { readProjectConfiguration, Tree, writeJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { exampleRootTslintJson } from '@nrwl/linter'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { exampleRootTslintJson } from '@nx/linter'; import { conversionGenerator } from './convert-tslint-to-eslint'; const appProjectName = 'nest-app-1'; diff --git a/packages/nest/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.ts b/packages/nest/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.ts index 6f90313a008961..c014ee45e0b024 100755 --- a/packages/nest/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.ts +++ b/packages/nest/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.ts @@ -3,16 +3,16 @@ import { formatFiles, GeneratorCallback, Tree, -} from '@nrwl/devkit'; -import { ConvertTSLintToESLintSchema, ProjectConverter } from '@nrwl/linter'; +} from '@nx/devkit'; +import { ConvertTSLintToESLintSchema, ProjectConverter } from '@nx/linter'; import { addLintingToApplication, NormalizedSchema as AddLintForApplicationSchema, -} from '@nrwl/node/src/generators/application/application'; +} from '@nx/node/src/generators/application/application'; import { addLint as addLintingToLibraryGenerator, NormalizedSchema as AddLintForLibrarySchema, -} from '@nrwl/js/src/generators/library/library'; +} from '@nx/js/src/generators/library/library'; import type { Linter } from 'eslint'; export async function conversionGenerator( diff --git a/packages/nest/src/generators/decorator/decorator.spec.ts b/packages/nest/src/generators/decorator/decorator.spec.ts index a734ede264980d..85bad5d26e17f3 100644 --- a/packages/nest/src/generators/decorator/decorator.spec.ts +++ b/packages/nest/src/generators/decorator/decorator.spec.ts @@ -1,4 +1,4 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { createTreeWithNestApplication } from '../utils/testing'; import type { DecoratorGeneratorOptions } from './decorator'; import { decoratorGenerator } from './decorator'; diff --git a/packages/nest/src/generators/decorator/decorator.ts b/packages/nest/src/generators/decorator/decorator.ts index 83d8674412cf43..1092db987d6b38 100644 --- a/packages/nest/src/generators/decorator/decorator.ts +++ b/packages/nest/src/generators/decorator/decorator.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { convertNxGenerator } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { convertNxGenerator } from '@nx/devkit'; import type { NestGeneratorWithLanguageOption, NormalizedOptions, diff --git a/packages/nest/src/generators/filter/filter.spec.ts b/packages/nest/src/generators/filter/filter.spec.ts index caf4f093f96591..fff38d07e21540 100644 --- a/packages/nest/src/generators/filter/filter.spec.ts +++ b/packages/nest/src/generators/filter/filter.spec.ts @@ -1,4 +1,4 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { createTreeWithNestApplication } from '../utils/testing'; import type { FilterGeneratorOptions } from './filter'; import { filterGenerator } from './filter'; diff --git a/packages/nest/src/generators/filter/filter.ts b/packages/nest/src/generators/filter/filter.ts index 445cae1a555dbd..2b83a9ad40b638 100644 --- a/packages/nest/src/generators/filter/filter.ts +++ b/packages/nest/src/generators/filter/filter.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { convertNxGenerator } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { convertNxGenerator } from '@nx/devkit'; import type { NestGeneratorWithLanguageOption, NestGeneratorWithTestOption, diff --git a/packages/nest/src/generators/gateway/gateway.spec.ts b/packages/nest/src/generators/gateway/gateway.spec.ts index 3304ad0a1fd560..408e3fed242d6b 100644 --- a/packages/nest/src/generators/gateway/gateway.spec.ts +++ b/packages/nest/src/generators/gateway/gateway.spec.ts @@ -1,4 +1,4 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { createTreeWithNestApplication } from '../utils/testing'; import type { GatewayGeneratorOptions } from './gateway'; import { gatewayGenerator } from './gateway'; diff --git a/packages/nest/src/generators/gateway/gateway.ts b/packages/nest/src/generators/gateway/gateway.ts index 5a383215354056..0e816863e5fdda 100644 --- a/packages/nest/src/generators/gateway/gateway.ts +++ b/packages/nest/src/generators/gateway/gateway.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { convertNxGenerator } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { convertNxGenerator } from '@nx/devkit'; import type { NestGeneratorWithLanguageOption, NestGeneratorWithTestOption, diff --git a/packages/nest/src/generators/guard/guard.spec.ts b/packages/nest/src/generators/guard/guard.spec.ts index 95a6e73a28f6ac..2273f8abc0bce4 100644 --- a/packages/nest/src/generators/guard/guard.spec.ts +++ b/packages/nest/src/generators/guard/guard.spec.ts @@ -1,4 +1,4 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { createTreeWithNestApplication } from '../utils/testing'; import type { GuardGeneratorOptions } from './guard'; import { guardGenerator } from './guard'; diff --git a/packages/nest/src/generators/guard/guard.ts b/packages/nest/src/generators/guard/guard.ts index 71d015d2b997af..20d1187adabddc 100644 --- a/packages/nest/src/generators/guard/guard.ts +++ b/packages/nest/src/generators/guard/guard.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { convertNxGenerator } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { convertNxGenerator } from '@nx/devkit'; import type { NestGeneratorWithLanguageOption, NestGeneratorWithTestOption, diff --git a/packages/nest/src/generators/init/init.spec.ts b/packages/nest/src/generators/init/init.spec.ts index 6dea930800d429..f6e6d0ff05a3bd 100644 --- a/packages/nest/src/generators/init/init.spec.ts +++ b/packages/nest/src/generators/init/init.spec.ts @@ -1,6 +1,6 @@ -import type { Tree } from '@nrwl/devkit'; -import * as devkit from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import type { Tree } from '@nx/devkit'; +import * as devkit from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { nestJsVersion, nxVersion } from '../../utils/versions'; import { initGenerator } from './init'; diff --git a/packages/nest/src/generators/init/init.ts b/packages/nest/src/generators/init/init.ts index 3193766703f173..cb72841ff5ce9a 100644 --- a/packages/nest/src/generators/init/init.ts +++ b/packages/nest/src/generators/init/init.ts @@ -1,10 +1,6 @@ -import type { GeneratorCallback, Tree } from '@nrwl/devkit'; -import { - convertNxGenerator, - formatFiles, - runTasksInSerial, -} from '@nrwl/devkit'; -import { initGenerator as nodeInitGenerator } from '@nrwl/node'; +import type { GeneratorCallback, Tree } from '@nx/devkit'; +import { convertNxGenerator, formatFiles, runTasksInSerial } from '@nx/devkit'; +import { initGenerator as nodeInitGenerator } from '@nx/node'; import { addDependencies, normalizeOptions } from './lib'; import type { InitGeneratorOptions } from './schema'; diff --git a/packages/nest/src/generators/init/lib/add-dependencies.ts b/packages/nest/src/generators/init/lib/add-dependencies.ts index 9011a765ceac16..2fc1d84a57a7a8 100644 --- a/packages/nest/src/generators/init/lib/add-dependencies.ts +++ b/packages/nest/src/generators/init/lib/add-dependencies.ts @@ -1,5 +1,5 @@ -import type { GeneratorCallback, Tree } from '@nrwl/devkit'; -import { addDependenciesToPackageJson } from '@nrwl/devkit'; +import type { GeneratorCallback, Tree } from '@nx/devkit'; +import { addDependenciesToPackageJson } from '@nx/devkit'; import { nestJsVersion, nxVersion, diff --git a/packages/nest/src/generators/interceptor/interceptor.spec.ts b/packages/nest/src/generators/interceptor/interceptor.spec.ts index 1fd036b1d4136b..0f97e7472be301 100644 --- a/packages/nest/src/generators/interceptor/interceptor.spec.ts +++ b/packages/nest/src/generators/interceptor/interceptor.spec.ts @@ -1,4 +1,4 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { createTreeWithNestApplication } from '../utils/testing'; import type { InterceptorGeneratorOptions } from './interceptor'; import { interceptorGenerator } from './interceptor'; diff --git a/packages/nest/src/generators/interceptor/interceptor.ts b/packages/nest/src/generators/interceptor/interceptor.ts index aa0f35c61434ac..8a1fa227639c44 100644 --- a/packages/nest/src/generators/interceptor/interceptor.ts +++ b/packages/nest/src/generators/interceptor/interceptor.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { convertNxGenerator } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { convertNxGenerator } from '@nx/devkit'; import type { NestGeneratorWithLanguageOption, NestGeneratorWithTestOption, diff --git a/packages/nest/src/generators/interface/interface.spec.ts b/packages/nest/src/generators/interface/interface.spec.ts index a21e9e0abb7857..7e71fc1b7277a0 100644 --- a/packages/nest/src/generators/interface/interface.spec.ts +++ b/packages/nest/src/generators/interface/interface.spec.ts @@ -1,4 +1,4 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { createTreeWithNestApplication } from '../utils/testing'; import type { InterfaceGeneratorOptions } from './interface'; import { interfaceGenerator } from './interface'; diff --git a/packages/nest/src/generators/interface/interface.ts b/packages/nest/src/generators/interface/interface.ts index df1e25e96f47b3..c82310273af34e 100644 --- a/packages/nest/src/generators/interface/interface.ts +++ b/packages/nest/src/generators/interface/interface.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { convertNxGenerator } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { convertNxGenerator } from '@nx/devkit'; import type { NestGeneratorOptions } from '../utils'; import { normalizeOptions, runNestSchematic } from '../utils'; diff --git a/packages/nest/src/generators/library/lib/add-exports-to-barrel.ts b/packages/nest/src/generators/library/lib/add-exports-to-barrel.ts index fe33996b2fcab6..44a4a6062fb1d9 100644 --- a/packages/nest/src/generators/library/lib/add-exports-to-barrel.ts +++ b/packages/nest/src/generators/library/lib/add-exports-to-barrel.ts @@ -1,7 +1,7 @@ -import type { Tree } from '@nrwl/devkit'; -import { addGlobal, removeChange } from '@nrwl/js'; +import type { Tree } from '@nx/devkit'; +import { addGlobal, removeChange } from '@nx/js'; import type { NormalizedOptions } from '../schema'; -import { ensureTypescript } from '@nrwl/js/src/utils/typescript/ensure-typescript'; +import { ensureTypescript } from '@nx/js/src/utils/typescript/ensure-typescript'; let tsModule: typeof import('typescript'); diff --git a/packages/nest/src/generators/library/lib/add-project.ts b/packages/nest/src/generators/library/lib/add-project.ts index 330539b7d6a1e7..bfa42c42f2f318 100644 --- a/packages/nest/src/generators/library/lib/add-project.ts +++ b/packages/nest/src/generators/library/lib/add-project.ts @@ -1,8 +1,8 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { readProjectConfiguration, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import type { NormalizedOptions } from '../schema'; export function addProject(tree: Tree, options: NormalizedOptions): void { diff --git a/packages/nest/src/generators/library/lib/create-files.ts b/packages/nest/src/generators/library/lib/create-files.ts index 5042e487a7c08d..19b2bd8312e56a 100644 --- a/packages/nest/src/generators/library/lib/create-files.ts +++ b/packages/nest/src/generators/library/lib/create-files.ts @@ -1,10 +1,10 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { generateFiles, joinPathFragments, names, offsetFromRoot, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import type { NormalizedOptions } from '../schema'; export function createFiles(tree: Tree, options: NormalizedOptions): void { diff --git a/packages/nest/src/generators/library/lib/delete-files.ts b/packages/nest/src/generators/library/lib/delete-files.ts index 2d8485ccbbe44e..6565d7256f1ed8 100644 --- a/packages/nest/src/generators/library/lib/delete-files.ts +++ b/packages/nest/src/generators/library/lib/delete-files.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { joinPathFragments } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { joinPathFragments } from '@nx/devkit'; import type { NormalizedOptions } from '../schema'; export function deleteFiles(tree: Tree, options: NormalizedOptions): void { diff --git a/packages/nest/src/generators/library/lib/normalize-options.ts b/packages/nest/src/generators/library/lib/normalize-options.ts index 6abe320ab9f6db..98921c54bbbf12 100644 --- a/packages/nest/src/generators/library/lib/normalize-options.ts +++ b/packages/nest/src/generators/library/lib/normalize-options.ts @@ -1,7 +1,7 @@ -import { extractLayoutDirectory, Tree } from '@nrwl/devkit'; -import { getWorkspaceLayout, joinPathFragments, names } from '@nrwl/devkit'; -import type { LibraryGeneratorSchema as JsLibraryGeneratorSchema } from '@nrwl/js/src/utils/schema'; -import { Linter } from '@nrwl/linter'; +import { extractLayoutDirectory, Tree } from '@nx/devkit'; +import { getWorkspaceLayout, joinPathFragments, names } from '@nx/devkit'; +import type { LibraryGeneratorSchema as JsLibraryGeneratorSchema } from '@nx/js/src/utils/schema'; +import { Linter } from '@nx/linter'; import type { LibraryGeneratorOptions, NormalizedOptions } from '../schema'; export function normalizeOptions( diff --git a/packages/nest/src/generators/library/lib/update-tsconfig.ts b/packages/nest/src/generators/library/lib/update-tsconfig.ts index b95d1d91b26d96..8eaffe7c272675 100644 --- a/packages/nest/src/generators/library/lib/update-tsconfig.ts +++ b/packages/nest/src/generators/library/lib/update-tsconfig.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { readProjectConfiguration, updateJson } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { readProjectConfiguration, updateJson } from '@nx/devkit'; import type { NormalizedOptions } from '../schema'; export function updateTsConfig(tree: Tree, options: NormalizedOptions): void { diff --git a/packages/nest/src/generators/library/library.spec.ts b/packages/nest/src/generators/library/library.spec.ts index 46688c9e07fc0d..4245a656348b35 100644 --- a/packages/nest/src/generators/library/library.spec.ts +++ b/packages/nest/src/generators/library/library.spec.ts @@ -1,7 +1,7 @@ -import type { Tree } from '@nrwl/devkit'; -import * as devkit from '@nrwl/devkit'; -import { readJson, readProjectConfiguration } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import type { Tree } from '@nx/devkit'; +import * as devkit from '@nx/devkit'; +import { readJson, readProjectConfiguration } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { libraryGenerator } from './library'; describe('lib', () => { diff --git a/packages/nest/src/generators/library/library.ts b/packages/nest/src/generators/library/library.ts index 82e3127be76cad..0ad139b35baecc 100644 --- a/packages/nest/src/generators/library/library.ts +++ b/packages/nest/src/generators/library/library.ts @@ -1,6 +1,6 @@ -import type { GeneratorCallback, Tree } from '@nrwl/devkit'; -import { convertNxGenerator, formatFiles } from '@nrwl/devkit'; -import { libraryGenerator as jsLibraryGenerator } from '@nrwl/js'; +import type { GeneratorCallback, Tree } from '@nx/devkit'; +import { convertNxGenerator, formatFiles } from '@nx/devkit'; +import { libraryGenerator as jsLibraryGenerator } from '@nx/js'; import { addDependencies } from '../init/lib'; import { addExportsToBarrelFile, diff --git a/packages/nest/src/generators/library/schema.d.ts b/packages/nest/src/generators/library/schema.d.ts index 2e80e650301c42..7da448b66812d1 100644 --- a/packages/nest/src/generators/library/schema.d.ts +++ b/packages/nest/src/generators/library/schema.d.ts @@ -1,4 +1,4 @@ -import { Linter } from '@nrwl/linter'; +import { Linter } from '@nx/linter'; import { UnitTestRunner } from '../utils'; export interface LibraryGeneratorOptions { diff --git a/packages/nest/src/generators/middleware/middleware.spec.ts b/packages/nest/src/generators/middleware/middleware.spec.ts index 3e3d983167d741..205e92cf04a3f1 100644 --- a/packages/nest/src/generators/middleware/middleware.spec.ts +++ b/packages/nest/src/generators/middleware/middleware.spec.ts @@ -1,4 +1,4 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { createTreeWithNestApplication } from '../utils/testing'; import type { MiddlewareGeneratorOptions } from './middleware'; import { middlewareGenerator } from './middleware'; diff --git a/packages/nest/src/generators/middleware/middleware.ts b/packages/nest/src/generators/middleware/middleware.ts index 1b74c4a87af3f2..3690226acfa629 100644 --- a/packages/nest/src/generators/middleware/middleware.ts +++ b/packages/nest/src/generators/middleware/middleware.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { convertNxGenerator } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { convertNxGenerator } from '@nx/devkit'; import type { NestGeneratorWithLanguageOption, NestGeneratorWithTestOption, diff --git a/packages/nest/src/generators/module/module.spec.ts b/packages/nest/src/generators/module/module.spec.ts index 67c408a9e19247..9b2bb9763d6097 100644 --- a/packages/nest/src/generators/module/module.spec.ts +++ b/packages/nest/src/generators/module/module.spec.ts @@ -1,4 +1,4 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { createTreeWithNestApplication } from '../utils/testing'; import type { ModuleGeneratorOptions } from './module'; import { moduleGenerator } from './module'; diff --git a/packages/nest/src/generators/module/module.ts b/packages/nest/src/generators/module/module.ts index 80e7595d6e4518..5faa8c640892ac 100644 --- a/packages/nest/src/generators/module/module.ts +++ b/packages/nest/src/generators/module/module.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { convertNxGenerator } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { convertNxGenerator } from '@nx/devkit'; import type { NestGeneratorWithLanguageOption, NormalizedOptions, diff --git a/packages/nest/src/generators/pipe/pipe.spec.ts b/packages/nest/src/generators/pipe/pipe.spec.ts index 8b33d81bbe1ff7..d28ecea581f6d0 100644 --- a/packages/nest/src/generators/pipe/pipe.spec.ts +++ b/packages/nest/src/generators/pipe/pipe.spec.ts @@ -1,4 +1,4 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { createTreeWithNestApplication } from '../utils/testing'; import type { PipeGeneratorOptions } from './pipe'; import { pipeGenerator } from './pipe'; diff --git a/packages/nest/src/generators/pipe/pipe.ts b/packages/nest/src/generators/pipe/pipe.ts index 5f032fd042c8db..5463bbfa249ac7 100644 --- a/packages/nest/src/generators/pipe/pipe.ts +++ b/packages/nest/src/generators/pipe/pipe.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { convertNxGenerator } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { convertNxGenerator } from '@nx/devkit'; import type { NestGeneratorWithLanguageOption, NestGeneratorWithTestOption, diff --git a/packages/nest/src/generators/provider/provider.spec.ts b/packages/nest/src/generators/provider/provider.spec.ts index 605e8434c4418e..37323462660bd2 100644 --- a/packages/nest/src/generators/provider/provider.spec.ts +++ b/packages/nest/src/generators/provider/provider.spec.ts @@ -1,4 +1,4 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { createTreeWithNestApplication } from '../utils/testing'; import type { ProviderGeneratorOptions } from './provider'; import { providerGenerator } from './provider'; diff --git a/packages/nest/src/generators/provider/provider.ts b/packages/nest/src/generators/provider/provider.ts index 45825a1da9af4f..95e88475b9d17c 100644 --- a/packages/nest/src/generators/provider/provider.ts +++ b/packages/nest/src/generators/provider/provider.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { convertNxGenerator } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { convertNxGenerator } from '@nx/devkit'; import type { NestGeneratorWithLanguageOption, NestGeneratorWithTestOption, diff --git a/packages/nest/src/generators/resolver/resolver.spec.ts b/packages/nest/src/generators/resolver/resolver.spec.ts index d8fb20d061adb5..7c168d6630050d 100644 --- a/packages/nest/src/generators/resolver/resolver.spec.ts +++ b/packages/nest/src/generators/resolver/resolver.spec.ts @@ -1,4 +1,4 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { createTreeWithNestApplication } from '../utils/testing'; import type { ResolverGeneratorOptions } from './resolver'; import { resolverGenerator } from './resolver'; diff --git a/packages/nest/src/generators/resolver/resolver.ts b/packages/nest/src/generators/resolver/resolver.ts index e8377fac2c7513..e60f5e6ddd7b7a 100644 --- a/packages/nest/src/generators/resolver/resolver.ts +++ b/packages/nest/src/generators/resolver/resolver.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { convertNxGenerator } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { convertNxGenerator } from '@nx/devkit'; import type { NestGeneratorWithLanguageOption, NestGeneratorWithTestOption, diff --git a/packages/nest/src/generators/resource/resource.spec.ts b/packages/nest/src/generators/resource/resource.spec.ts index 27aeb4c78bf033..95d2e097baf1b9 100644 --- a/packages/nest/src/generators/resource/resource.spec.ts +++ b/packages/nest/src/generators/resource/resource.spec.ts @@ -1,4 +1,4 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { createTreeWithNestApplication } from '../utils/testing'; import type { ResourceGeneratorOptions } from './resource'; import { resourceGenerator } from './resource'; diff --git a/packages/nest/src/generators/resource/resource.ts b/packages/nest/src/generators/resource/resource.ts index 628a92e01e1094..a49cf7740f95f6 100644 --- a/packages/nest/src/generators/resource/resource.ts +++ b/packages/nest/src/generators/resource/resource.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { convertNxGenerator } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { convertNxGenerator } from '@nx/devkit'; import type { NestGeneratorWithLanguageOption, NestGeneratorWithResourceOption, diff --git a/packages/nest/src/generators/service/service.spec.ts b/packages/nest/src/generators/service/service.spec.ts index 97e347a305f8d4..6bdf2d6de0a67d 100644 --- a/packages/nest/src/generators/service/service.spec.ts +++ b/packages/nest/src/generators/service/service.spec.ts @@ -1,4 +1,4 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { createTreeWithNestApplication } from '../utils/testing'; import type { ServiceGeneratorOptions } from './service'; import { serviceGenerator } from './service'; diff --git a/packages/nest/src/generators/service/service.ts b/packages/nest/src/generators/service/service.ts index 71f0e0f311598f..7c5db71bd3c880 100644 --- a/packages/nest/src/generators/service/service.ts +++ b/packages/nest/src/generators/service/service.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { convertNxGenerator } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { convertNxGenerator } from '@nx/devkit'; import type { NestGeneratorWithLanguageOption, NestGeneratorWithTestOption, diff --git a/packages/nest/src/generators/utils/normalize-options.ts b/packages/nest/src/generators/utils/normalize-options.ts index c440398ff2e268..42fdcbba5b87a9 100644 --- a/packages/nest/src/generators/utils/normalize-options.ts +++ b/packages/nest/src/generators/utils/normalize-options.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { names, readProjectConfiguration } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { names, readProjectConfiguration } from '@nx/devkit'; import type { NestGeneratorOptions, NormalizedOptions, diff --git a/packages/nest/src/generators/utils/run-nest-schematic.spec.ts b/packages/nest/src/generators/utils/run-nest-schematic.spec.ts index 4eacbee1ece1ec..ae72eb3ab6df8b 100644 --- a/packages/nest/src/generators/utils/run-nest-schematic.spec.ts +++ b/packages/nest/src/generators/utils/run-nest-schematic.spec.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import * as devkit from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import * as devkit from '@nx/devkit'; import { runNestSchematic } from './run-nest-schematic'; import { createTreeWithNestApplication } from './testing'; import type { NestSchematic, NormalizedOptions } from './types'; diff --git a/packages/nest/src/generators/utils/run-nest-schematic.ts b/packages/nest/src/generators/utils/run-nest-schematic.ts index c7b3bec3f04cac..88eb661249e474 100644 --- a/packages/nest/src/generators/utils/run-nest-schematic.ts +++ b/packages/nest/src/generators/utils/run-nest-schematic.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { formatFiles } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { formatFiles } from '@nx/devkit'; import type { NestSchematic, NormalizedOptions } from './types'; export async function runNestSchematic( @@ -9,7 +9,7 @@ export async function runNestSchematic( ): Promise { const { skipFormat, ...schematicOptions } = options; - const { wrapAngularDevkitSchematic } = require('@nrwl/devkit/ngcli-adapter'); + const { wrapAngularDevkitSchematic } = require('@nx/devkit/ngcli-adapter'); const nestSchematic = wrapAngularDevkitSchematic( '@nestjs/schematics', schematic diff --git a/packages/nest/src/generators/utils/testing.ts b/packages/nest/src/generators/utils/testing.ts index e1cbdaf7efa4f4..a9c3e722f07f5d 100644 --- a/packages/nest/src/generators/utils/testing.ts +++ b/packages/nest/src/generators/utils/testing.ts @@ -1,5 +1,5 @@ -import { addProjectConfiguration, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { addProjectConfiguration, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; export function createTreeWithNestApplication(appName: string): Tree { const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' }); diff --git a/packages/nest/src/migrations/update-13-2-0/update-to-nest-8.ts b/packages/nest/src/migrations/update-13-2-0/update-to-nest-8.ts index 2dff38622b19dd..25446581005847 100644 --- a/packages/nest/src/migrations/update-13-2-0/update-to-nest-8.ts +++ b/packages/nest/src/migrations/update-13-2-0/update-to-nest-8.ts @@ -1,5 +1,5 @@ -import { formatFiles, logger, readJson, Tree, updateJson } from '@nrwl/devkit'; -import { checkAndCleanWithSemver } from '@nrwl/devkit/src/utils/semver'; +import { formatFiles, logger, readJson, Tree, updateJson } from '@nx/devkit'; +import { checkAndCleanWithSemver } from '@nx/devkit/src/utils/semver'; import { satisfies } from 'semver'; import { sortObjectByKeys } from 'nx/src/utils/object-sort'; diff --git a/packages/nest/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts b/packages/nest/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts new file mode 100644 index 00000000000000..dc34380a630ad7 --- /dev/null +++ b/packages/nest/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts @@ -0,0 +1,37 @@ +import { Tree, readJson, updateJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import replacePackage from './update-16-0-0-add-nx-packages'; + +describe('update-16-0-0-add-nx-packages', () => { + let tree: Tree; + beforeEach(() => { + tree = createTreeWithEmptyWorkspace(); + + updateJson(tree, 'package.json', (json) => { + json.devDependencies['@nrwl/nest'] = '16.0.0'; + return json; + }); + }); + + it('should remove the dependency on @nrwl/nest', async () => { + await replacePackage(tree); + + expect( + readJson(tree, 'package.json').dependencies['@nrwl/nest'] + ).not.toBeDefined(); + expect( + readJson(tree, 'package.json').devDependencies['@nrwl/nest'] + ).not.toBeDefined(); + }); + + it('should add a dependency on @nx/nest', async () => { + await replacePackage(tree); + + const packageJson = readJson(tree, 'package.json'); + const newDependencyVersion = + packageJson.devDependencies['@nx/nest'] ?? + packageJson.dependencies['@nx/nest']; + + expect(newDependencyVersion).toBeDefined(); + }); +}); diff --git a/packages/nest/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts b/packages/nest/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts new file mode 100644 index 00000000000000..b8bc21758dafd0 --- /dev/null +++ b/packages/nest/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts @@ -0,0 +1,8 @@ +import { Tree, formatFiles } from '@nx/devkit'; +import { replaceNrwlPackageWithNxPackage } from '@nx/devkit/src/utils/replace-package'; + +export default async function replacePackage(tree: Tree): Promise { + await replaceNrwlPackageWithNxPackage(tree, '@nrwl/nest', '@nx/nest'); + + await formatFiles(tree); +} diff --git a/packages/next/migrations.json b/packages/next/migrations.json index efc1bff7375987..80962be71bf303 100644 --- a/packages/next/migrations.json +++ b/packages/next/migrations.json @@ -59,6 +59,12 @@ "version": "15.8.8-beta.0", "description": "Add less and stylus packages if used.", "factory": "./src/migrations/update-15-8-8/add-style-packages" + }, + "update-16-0-0-add-nx-packages": { + "cli": "nx", + "version": "16.0.0-beta.1", + "description": "Replace @nrwl/next with @nx/next", + "implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages" } }, "packageJsonUpdates": { diff --git a/packages/next/migrations.spec.ts b/packages/next/migrations.spec.ts index ef7177be86b433..e54acf24f2ab71 100644 --- a/packages/next/migrations.spec.ts +++ b/packages/next/migrations.spec.ts @@ -1,11 +1,14 @@ import path = require('path'); import json = require('./migrations.json'); +import { MigrationsJsonEntry } from 'nx/src/config/misc-interfaces'; describe('Next migrations', () => { it('should have valid paths', () => { - Object.values(json.generators).forEach((m) => { + Object.values(json.generators).forEach((m: MigrationsJsonEntry) => { expect(() => - require.resolve(path.join(__dirname, `${m.factory}.ts`)) + require.resolve( + path.join(__dirname, `${m.factory ?? m.implementation}.ts`) + ) ).not.toThrow(); }); }); diff --git a/packages/next/package.json b/packages/next/package.json index 03653f5d20b99a..ee46671a8407c5 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -1,5 +1,5 @@ { - "name": "@nrwl/next", + "name": "@nx/next", "version": "0.0.1", "private": false, "description": "The Next.js plugin for Nx contains executors and generators for managing Next.js applications and libraries within an Nx workspace. It provides:\n\n\n- Scaffolding for creating, building, serving, linting, and testing Next.js applications.\n\n- Integration with building, serving, and exporting a Next.js application.\n\n- Integration with React libraries within the workspace. \n\nWhen using Next.js in Nx, you get the out-of-the-box support for TypeScript, Cypress, and Jest. No need to configure anything: watch mode, source maps, and typings just work.", @@ -35,11 +35,6 @@ }, "dependencies": { "@babel/plugin-proposal-decorators": "^7.14.5", - "@nrwl/devkit": "file:../devkit", - "@nrwl/js": "file:../js", - "@nrwl/linter": "file:../linter", - "@nrwl/react": "file:../react", - "@nrwl/workspace": "file:../workspace", "@svgr/webpack": "^6.1.2", "chalk": "^4.1.0", "copy-webpack-plugin": "^10.2.4", @@ -53,7 +48,12 @@ "tsconfig-paths": "^4.1.2", "tsconfig-paths-webpack-plugin": "4.0.0", "url-loader": "^4.1.1", - "webpack-merge": "^5.8.0" + "webpack-merge": "^5.8.0", + "@nx/devkit": "file:../devkit", + "@nx/js": "file:../js", + "@nx/linter": "file:../linter", + "@nx/react": "file:../react", + "@nx/workspace": "file:../workspace" }, "publishConfig": { "access": "public" diff --git a/packages/next/plugins/with-nx.ts b/packages/next/plugins/with-nx.ts index ba2861b8a983a4..bc2a6d590ad2c2 100644 --- a/packages/next/plugins/with-nx.ts +++ b/packages/next/plugins/with-nx.ts @@ -7,11 +7,11 @@ import { ProjectGraphProjectNode, Target, workspaceRoot, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { calculateProjectDependencies, DependentBuildableProjectNode, -} from '@nrwl/js/src/utils/buildable-libs-utils'; +} from '@nx/js/src/utils/buildable-libs-utils'; import type { NextConfig } from 'next'; import { PHASE_PRODUCTION_SERVER } from 'next/constants'; @@ -46,7 +46,7 @@ function regexEqual(x, y) { * To this function that hard-codes the libsDir. */ function getWithNxContext(): WithNxContext { - const { workspaceRoot, workspaceLayout } = require('@nrwl/devkit'); + const { workspaceRoot, workspaceLayout } = require('@nx/devkit'); return { workspaceRoot, libsDir: workspaceLayout().libsDir, @@ -394,7 +394,7 @@ function addNxEnvVariables(config: any) { } } -// Support for older generated code: `const withNx = require('@nrwl/next/plugins/with-nx');` +// Support for older generated code: `const withNx = require('@nx/next/plugins/with-nx');` module.exports = withNx; // Support for newer generated code: `const { withNx } = require(...);` module.exports.withNx = withNx; diff --git a/packages/next/project.json b/packages/next/project.json index 97e2c2bf340c3d..d548c5a330c591 100644 --- a/packages/next/project.json +++ b/packages/next/project.json @@ -53,7 +53,10 @@ "executor": "nx:run-commands", "outputs": ["{workspaceRoot}/build/packages/next"], "options": { - "command": "node ./scripts/copy-readme.js next" + "commands": [ + "node ./scripts/copy-readme.js next", + "node ./scripts/add-dependency-to-build.js next @nrwl/next" + ] } }, "lint": {} diff --git a/packages/next/src/executors/build/build.impl.ts b/packages/next/src/executors/build/build.impl.ts index c81f2e540fdf85..c61082430e5222 100644 --- a/packages/next/src/executors/build/build.impl.ts +++ b/packages/next/src/executors/build/build.impl.ts @@ -4,14 +4,14 @@ import { readJsonFile, workspaceRoot, writeJsonFile, -} from '@nrwl/devkit'; -import { createLockFile, createPackageJson } from '@nrwl/js'; +} from '@nx/devkit'; +import { createLockFile, createPackageJson } from '@nx/js'; import build from 'next/dist/build'; import { join, resolve } from 'path'; import { copySync, existsSync, mkdir, writeFileSync } from 'fs-extra'; import { gte } from 'semver'; -import { directoryExists } from '@nrwl/workspace/src/utilities/fileutils'; -import { checkAndCleanWithSemver } from '@nrwl/devkit/src/utils/semver'; +import { directoryExists } from '@nx/workspace/src/utilities/fileutils'; +import { checkAndCleanWithSemver } from '@nx/devkit/src/utils/semver'; import { updatePackageJson } from './lib/update-package-json'; import { createNextConfigFile } from './lib/create-next-config-file'; diff --git a/packages/next/src/executors/build/compat.ts b/packages/next/src/executors/build/compat.ts index 477ba0be5f653b..fc7908d20075b8 100644 --- a/packages/next/src/executors/build/compat.ts +++ b/packages/next/src/executors/build/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import buildExecutor from './build.impl'; diff --git a/packages/next/src/executors/build/lib/check-project.ts b/packages/next/src/executors/build/lib/check-project.ts index 7ca8fcb024ce01..7e6c9416d8a174 100644 --- a/packages/next/src/executors/build/lib/check-project.ts +++ b/packages/next/src/executors/build/lib/check-project.ts @@ -1,4 +1,4 @@ -import { logger } from '@nrwl/devkit'; +import { logger } from '@nx/devkit'; import { readdirSync } from 'fs-extra'; import { join } from 'path'; diff --git a/packages/next/src/executors/build/lib/create-next-config-file.ts b/packages/next/src/executors/build/lib/create-next-config-file.ts index 535aa218543e7f..6c9b693a068822 100644 --- a/packages/next/src/executors/build/lib/create-next-config-file.ts +++ b/packages/next/src/executors/build/lib/create-next-config-file.ts @@ -1,4 +1,4 @@ -import { ExecutorContext } from '@nrwl/devkit'; +import { ExecutorContext } from '@nx/devkit'; import { copyFileSync, existsSync } from 'fs'; import { join } from 'path'; diff --git a/packages/next/src/executors/build/lib/update-package-json.ts b/packages/next/src/executors/build/lib/update-package-json.ts index 2019fe250d22c7..46c077abae9e66 100644 --- a/packages/next/src/executors/build/lib/update-package-json.ts +++ b/packages/next/src/executors/build/lib/update-package-json.ts @@ -1,4 +1,4 @@ -import type { ExecutorContext } from '@nrwl/devkit'; +import type { ExecutorContext } from '@nx/devkit'; import type { PackageJson } from 'nx/src/utils/package-json'; export function updatePackageJson( diff --git a/packages/next/src/executors/export/compat.ts b/packages/next/src/executors/export/compat.ts index 7bc584476207ac..b3d3c12d21d776 100644 --- a/packages/next/src/executors/export/compat.ts +++ b/packages/next/src/executors/export/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import exportExecutor from './export.impl'; diff --git a/packages/next/src/executors/export/export.impl.ts b/packages/next/src/executors/export/export.impl.ts index ae9440fdf207c9..c397ccfea68bab 100644 --- a/packages/next/src/executors/export/export.impl.ts +++ b/packages/next/src/executors/export/export.impl.ts @@ -4,13 +4,13 @@ import { parseTargetString, readTargetOptions, workspaceLayout, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import exportApp from 'next/dist/export'; import { join, resolve } from 'path'; import { calculateProjectDependencies, DependentBuildableProjectNode, -} from '@nrwl/js/src/utils/buildable-libs-utils'; +} from '@nx/js/src/utils/buildable-libs-utils'; import { NextBuildBuilderOptions, diff --git a/packages/next/src/executors/server/compat.ts b/packages/next/src/executors/server/compat.ts index c70f628f39422f..62dff828d21b3b 100644 --- a/packages/next/src/executors/server/compat.ts +++ b/packages/next/src/executors/server/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import serverExecutor from './server.impl'; diff --git a/packages/next/src/executors/server/server.impl.ts b/packages/next/src/executors/server/server.impl.ts index 4d4b73bb98df44..a532e0de7db91d 100644 --- a/packages/next/src/executors/server/server.impl.ts +++ b/packages/next/src/executors/server/server.impl.ts @@ -5,7 +5,7 @@ import { parseTargetString, readTargetOptions, runExecutor, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import * as chalk from 'chalk'; import { existsSync } from 'fs'; import { join, resolve } from 'path'; diff --git a/packages/next/src/generators/application/application.spec.ts b/packages/next/src/generators/application/application.spec.ts index b26d8869ad5965..6d01f0b0358a47 100644 --- a/packages/next/src/generators/application/application.spec.ts +++ b/packages/next/src/generators/application/application.spec.ts @@ -1,10 +1,10 @@ -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { getProjects, readJson, readProjectConfiguration, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { applicationGenerator } from './application'; diff --git a/packages/next/src/generators/application/application.ts b/packages/next/src/generators/application/application.ts index 61d7a6fa3846d5..99e8a7dca44026 100644 --- a/packages/next/src/generators/application/application.ts +++ b/packages/next/src/generators/application/application.ts @@ -3,7 +3,7 @@ import { formatFiles, runTasksInSerial, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { normalizeOptions } from './lib/normalize-options'; import { Schema } from './schema'; diff --git a/packages/next/src/generators/application/lib/add-cypress.ts b/packages/next/src/generators/application/lib/add-cypress.ts index 83017ed43b3850..c4ccd30a45f11c 100644 --- a/packages/next/src/generators/application/lib/add-cypress.ts +++ b/packages/next/src/generators/application/lib/add-cypress.ts @@ -1,5 +1,5 @@ -import { ensurePackage, Tree } from '@nrwl/devkit'; -import { Linter } from '@nrwl/linter'; +import { ensurePackage, Tree } from '@nx/devkit'; +import { Linter } from '@nx/linter'; import { nxVersion } from '../../../utils/versions'; import { NormalizedSchema } from './normalize-options'; @@ -10,8 +10,8 @@ export async function addCypress(host: Tree, options: NormalizedSchema) { } const { cypressProjectGenerator } = ensurePackage< - typeof import('@nrwl/cypress') - >('@nrwl/cypress', nxVersion); + typeof import('@nx/cypress') + >('@nx/cypress', nxVersion); return cypressProjectGenerator(host, { ...options, linter: Linter.EsLint, diff --git a/packages/next/src/generators/application/lib/add-jest.ts b/packages/next/src/generators/application/lib/add-jest.ts index 51e6ae75a1ca98..4042f1df0eccf4 100644 --- a/packages/next/src/generators/application/lib/add-jest.ts +++ b/packages/next/src/generators/application/lib/add-jest.ts @@ -4,7 +4,7 @@ import { readJson, Tree, updateJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { nxVersion } from '../../../utils/versions'; import { NormalizedSchema } from './normalize-options'; @@ -14,8 +14,8 @@ export async function addJest(host: Tree, options: NormalizedSchema) { return () => {}; } - const { jestProjectGenerator } = ensurePackage( - '@nrwl/jest', + const { jestProjectGenerator } = ensurePackage( + '@nx/jest', nxVersion ); const jestTask = await jestProjectGenerator(host, { diff --git a/packages/next/src/generators/application/lib/add-linting.ts b/packages/next/src/generators/application/lib/add-linting.ts index 794d561c20e753..8ec251ea8b3747 100644 --- a/packages/next/src/generators/application/lib/add-linting.ts +++ b/packages/next/src/generators/application/lib/add-linting.ts @@ -1,4 +1,4 @@ -import { Linter, lintProjectGenerator } from '@nrwl/linter'; +import { Linter, lintProjectGenerator } from '@nx/linter'; import { addDependenciesToPackageJson, GeneratorCallback, @@ -6,11 +6,11 @@ import { runTasksInSerial, Tree, updateJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { extendReactEslintJson, extraEslintDependencies, -} from '@nrwl/react/src/utils/lint'; +} from '@nx/react/src/utils/lint'; import { NormalizedSchema } from './normalize-options'; export async function addLinting( diff --git a/packages/next/src/generators/application/lib/add-project.ts b/packages/next/src/generators/application/lib/add-project.ts index 65e70cc46b4a8a..b1f4132c39d49e 100644 --- a/packages/next/src/generators/application/lib/add-project.ts +++ b/packages/next/src/generators/application/lib/add-project.ts @@ -4,7 +4,7 @@ import { joinPathFragments, ProjectConfiguration, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; export function addProject(host: Tree, options: NormalizedSchema) { const targets: Record = {}; diff --git a/packages/next/src/generators/application/lib/create-application-files.ts b/packages/next/src/generators/application/lib/create-application-files.ts index e1c9323ca7804e..c3610e7cc8bc5a 100644 --- a/packages/next/src/generators/application/lib/create-application-files.ts +++ b/packages/next/src/generators/application/lib/create-application-files.ts @@ -1,6 +1,6 @@ import { join } from 'path'; -import { generateFiles, names, toJS, Tree } from '@nrwl/devkit'; -import { getRelativePathToRootTsConfig } from '@nrwl/js'; +import { generateFiles, names, toJS, Tree } from '@nx/devkit'; +import { getRelativePathToRootTsConfig } from '@nx/js'; import { NormalizedSchema } from './normalize-options'; import { diff --git a/packages/next/src/generators/application/lib/normalize-options.ts b/packages/next/src/generators/application/lib/normalize-options.ts index 4df023ad29efe7..9962f439d928e5 100644 --- a/packages/next/src/generators/application/lib/normalize-options.ts +++ b/packages/next/src/generators/application/lib/normalize-options.ts @@ -1,12 +1,12 @@ -import { assertValidStyle } from '@nrwl/react/src/utils/assertion'; +import { assertValidStyle } from '@nx/react/src/utils/assertion'; import { extractLayoutDirectory, getWorkspaceLayout, joinPathFragments, names, Tree, -} from '@nrwl/devkit'; -import { Linter } from '@nrwl/linter'; +} from '@nx/devkit'; +import { Linter } from '@nx/linter'; import { Schema } from '../schema'; diff --git a/packages/next/src/generators/application/lib/set-defaults.ts b/packages/next/src/generators/application/lib/set-defaults.ts index 1f96a5eba814c2..d4799dd80bca4e 100644 --- a/packages/next/src/generators/application/lib/set-defaults.ts +++ b/packages/next/src/generators/application/lib/set-defaults.ts @@ -1,4 +1,4 @@ -import { readNxJson, Tree, updateNxJson } from '@nrwl/devkit'; +import { readNxJson, Tree, updateNxJson } from '@nx/devkit'; import { NormalizedSchema } from './normalize-options'; diff --git a/packages/next/src/generators/application/lib/update-jest-config.ts b/packages/next/src/generators/application/lib/update-jest-config.ts index e776f44b7b2cba..94d358460d5e85 100644 --- a/packages/next/src/generators/application/lib/update-jest-config.ts +++ b/packages/next/src/generators/application/lib/update-jest-config.ts @@ -1,5 +1,5 @@ import { NormalizedSchema } from './normalize-options'; -import { Tree } from '@nrwl/devkit'; +import { Tree } from '@nx/devkit'; export function updateJestConfig(host: Tree, options: NormalizedSchema) { if (options.unitTestRunner !== 'jest') { diff --git a/packages/next/src/generators/application/schema.d.ts b/packages/next/src/generators/application/schema.d.ts index c1032a0df41501..7e468a19080885 100644 --- a/packages/next/src/generators/application/schema.d.ts +++ b/packages/next/src/generators/application/schema.d.ts @@ -1,5 +1,5 @@ -import { Linter } from '@nrwl/linter'; -import { SupportedStyles } from '@nrwl/react'; +import { Linter } from '@nx/linter'; +import { SupportedStyles } from '@nx/react'; export interface Schema { name: string; diff --git a/packages/next/src/generators/component/component.spec.ts b/packages/next/src/generators/component/component.spec.ts index a4bd2eccb98fad..a1c9c68e8ac347 100644 --- a/packages/next/src/generators/component/component.spec.ts +++ b/packages/next/src/generators/component/component.spec.ts @@ -1,9 +1,9 @@ import { applicationGenerator } from '../application/application'; import { componentGenerator } from './component'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { Tree } from '@nrwl/devkit'; -import { libraryGenerator } from '@nrwl/react'; -import { Linter } from '@nrwl/linter'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { Tree } from '@nx/devkit'; +import { libraryGenerator } from '@nx/react'; +import { Linter } from '@nx/linter'; describe('component', () => { let tree: Tree; diff --git a/packages/next/src/generators/component/component.ts b/packages/next/src/generators/component/component.ts index 3607b749a8c0f4..8fb53e76bf57cb 100644 --- a/packages/next/src/generators/component/component.ts +++ b/packages/next/src/generators/component/component.ts @@ -4,9 +4,9 @@ import { getProjects, runTasksInSerial, Tree, -} from '@nrwl/devkit'; -import type { SupportedStyles } from '@nrwl/react'; -import { componentGenerator as reactComponentGenerator } from '@nrwl/react'; +} from '@nx/devkit'; +import type { SupportedStyles } from '@nx/react'; +import { componentGenerator as reactComponentGenerator } from '@nx/react'; import { addStyleDependencies } from '../../utils/styles'; diff --git a/packages/next/src/generators/custom-server/custom-server.ts b/packages/next/src/generators/custom-server/custom-server.ts index 7a5d8daff52fec..a5c2c4da37f4a7 100644 --- a/packages/next/src/generators/custom-server/custom-server.ts +++ b/packages/next/src/generators/custom-server/custom-server.ts @@ -1,4 +1,4 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { updateJson, convertNxGenerator, @@ -8,7 +8,7 @@ import { offsetFromRoot, readProjectConfiguration, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { CustomServerSchema } from './schema'; export async function customServerGenerator( diff --git a/packages/next/src/generators/init/init.spec.ts b/packages/next/src/generators/init/init.spec.ts index 979712ead6d0bc..ccd748b76a8cd2 100644 --- a/packages/next/src/generators/init/init.spec.ts +++ b/packages/next/src/generators/init/init.spec.ts @@ -1,5 +1,5 @@ -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { readJson, NxJsonConfiguration, Tree } from '@nrwl/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { readJson, NxJsonConfiguration, Tree } from '@nx/devkit'; import { nextInitGenerator } from './init'; diff --git a/packages/next/src/generators/init/init.ts b/packages/next/src/generators/init/init.ts index 2192a11ea88deb..cb93bd487a08d6 100644 --- a/packages/next/src/generators/init/init.ts +++ b/packages/next/src/generators/init/init.ts @@ -5,11 +5,11 @@ import { GeneratorCallback, runTasksInSerial, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; -import { reactDomVersion, reactVersion } from '@nrwl/react/src/utils/versions'; -import reactInitGenerator from '@nrwl/react/src/generators/init/init'; -import { initGenerator as jsInitGenerator } from '@nrwl/js'; +import { reactDomVersion, reactVersion } from '@nx/react/src/utils/versions'; +import reactInitGenerator from '@nx/react/src/generators/init/init'; +import { initGenerator as jsInitGenerator } from '@nx/js'; import { eslintConfigNextVersion, @@ -47,8 +47,8 @@ export async function nextInitGenerator(host: Tree, schema: InitSchema) { ); if (!schema.unitTestRunner || schema.unitTestRunner === 'jest') { - const { jestInitGenerator } = ensurePackage( - '@nrwl/jest', + const { jestInitGenerator } = ensurePackage( + '@nx/jest', nxVersion ); const jestTask = await jestInitGenerator(host, schema); @@ -56,8 +56,8 @@ export async function nextInitGenerator(host: Tree, schema: InitSchema) { } if (!schema.e2eTestRunner || schema.e2eTestRunner === 'cypress') { const { cypressInitGenerator } = ensurePackage< - typeof import('@nrwl/cypress') - >('@nrwl/cypress', nxVersion); + typeof import('@nx/cypress') + >('@nx/cypress', nxVersion); const cypressTask = await cypressInitGenerator(host, {}); tasks.push(cypressTask); } diff --git a/packages/next/src/generators/library/lib/normalize-options.spec.ts b/packages/next/src/generators/library/lib/normalize-options.spec.ts index 4af2562f4fec93..d7c6bbdb37a3c7 100644 --- a/packages/next/src/generators/library/lib/normalize-options.spec.ts +++ b/packages/next/src/generators/library/lib/normalize-options.spec.ts @@ -1,6 +1,6 @@ -import type { Tree } from '@nrwl/devkit'; -import { Linter } from '@nrwl/linter'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import type { Tree } from '@nx/devkit'; +import { Linter } from '@nx/linter'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { normalizeOptions } from './normalize-options'; describe('normalizeOptions', () => { diff --git a/packages/next/src/generators/library/lib/normalize-options.ts b/packages/next/src/generators/library/lib/normalize-options.ts index 13f23c0447964d..62b6aad5935f5c 100644 --- a/packages/next/src/generators/library/lib/normalize-options.ts +++ b/packages/next/src/generators/library/lib/normalize-options.ts @@ -4,7 +4,7 @@ import { joinPathFragments, names, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { Schema } from '../schema'; export interface NormalizedSchema extends Schema { diff --git a/packages/next/src/generators/library/library.spec.ts b/packages/next/src/generators/library/library.spec.ts index 604ebac9a22704..a1faf83686ae0a 100644 --- a/packages/next/src/generators/library/library.spec.ts +++ b/packages/next/src/generators/library/library.spec.ts @@ -1,13 +1,13 @@ -import { installedCypressVersion } from '@nrwl/cypress/src/utils/cypress-version'; -import { readJson } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { Linter } from '@nrwl/linter'; +import { installedCypressVersion } from '@nx/cypress/src/utils/cypress-version'; +import { readJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { Linter } from '@nx/linter'; import libraryGenerator from './library'; import { Schema } from './schema'; // need to mock cypress otherwise it'll use the nx installed version from package.json // which is v9 while we are testing for the new v10 version -jest.mock('@nrwl/cypress/src/utils/cypress-version'); +jest.mock('@nx/cypress/src/utils/cypress-version'); describe('next library', () => { let mockedInstalledCypressVersion: jest.Mock< diff --git a/packages/next/src/generators/library/library.ts b/packages/next/src/generators/library/library.ts index 7269a9a492d371..9828eea9b6ff2a 100644 --- a/packages/next/src/generators/library/library.ts +++ b/packages/next/src/generators/library/library.ts @@ -6,9 +6,9 @@ import { runTasksInSerial, Tree, updateJson, -} from '@nrwl/devkit'; -import { libraryGenerator as reactLibraryGenerator } from '@nrwl/react/src/generators/library/library'; -import { addTsConfigPath } from '@nrwl/js'; +} from '@nx/devkit'; +import { libraryGenerator as reactLibraryGenerator } from '@nx/react/src/generators/library/library'; +import { addTsConfigPath } from '@nx/js'; import { nextInitGenerator } from '../init/init'; import { Schema } from './schema'; diff --git a/packages/next/src/generators/library/schema.d.ts b/packages/next/src/generators/library/schema.d.ts index 284c3f0add7dd9..cb3cf33c46e7c4 100644 --- a/packages/next/src/generators/library/schema.d.ts +++ b/packages/next/src/generators/library/schema.d.ts @@ -1,5 +1,5 @@ -import { Linter } from '@nrwl/linter'; -import type { SupportedStyles } from '@nrwl/react'; +import { Linter } from '@nx/linter'; +import type { SupportedStyles } from '@nx/react'; export interface Schema { name: string; diff --git a/packages/next/src/generators/page/page.spec.ts b/packages/next/src/generators/page/page.spec.ts index ba315e38300140..9aa9d36013f4e7 100644 --- a/packages/next/src/generators/page/page.spec.ts +++ b/packages/next/src/generators/page/page.spec.ts @@ -1,7 +1,7 @@ import { applicationGenerator } from '../application/application'; import { pageGenerator } from './page'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { Tree } from '@nrwl/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { Tree } from '@nx/devkit'; describe('component', () => { let tree: Tree; diff --git a/packages/next/src/generators/page/page.ts b/packages/next/src/generators/page/page.ts index 9f1df0ed7aaa99..0a7befd299395f 100644 --- a/packages/next/src/generators/page/page.ts +++ b/packages/next/src/generators/page/page.ts @@ -1,10 +1,10 @@ -import { componentGenerator as reactComponentGenerator } from '@nrwl/react'; +import { componentGenerator as reactComponentGenerator } from '@nx/react'; import { convertNxGenerator, formatFiles, runTasksInSerial, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { addStyleDependencies } from '../../utils/styles'; import { Schema } from './schema'; diff --git a/packages/next/src/generators/page/schema.d.ts b/packages/next/src/generators/page/schema.d.ts index 44c986e84fb47f..48306c10b9a0c5 100644 --- a/packages/next/src/generators/page/schema.d.ts +++ b/packages/next/src/generators/page/schema.d.ts @@ -1,4 +1,4 @@ -import { SupportedStyles } from '@nrwl/react'; +import { SupportedStyles } from '@nx/react'; export interface Schema { name: string; diff --git a/packages/next/src/migrations/update-12-10-0/fix-page-dir-for-eslint.spec.ts b/packages/next/src/migrations/update-12-10-0/fix-page-dir-for-eslint.spec.ts index dc34deed7b4ff2..e17593417c9c17 100644 --- a/packages/next/src/migrations/update-12-10-0/fix-page-dir-for-eslint.spec.ts +++ b/packages/next/src/migrations/update-12-10-0/fix-page-dir-for-eslint.spec.ts @@ -1,5 +1,5 @@ -import { readJson, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { readJson, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { applicationGenerator } from '../../generators/application/application'; import { fixPageDirForEslint } from './fix-page-dir-for-eslint'; diff --git a/packages/next/src/migrations/update-12-10-0/fix-page-dir-for-eslint.ts b/packages/next/src/migrations/update-12-10-0/fix-page-dir-for-eslint.ts index 158c8d79e1a16c..159eede8ae8c1e 100644 --- a/packages/next/src/migrations/update-12-10-0/fix-page-dir-for-eslint.ts +++ b/packages/next/src/migrations/update-12-10-0/fix-page-dir-for-eslint.ts @@ -5,7 +5,7 @@ import { readJson, Tree, writeJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; export async function fixPageDirForEslint(host: Tree) { const projects = getProjects(host); diff --git a/packages/next/src/migrations/update-12-8-0/remove-styled-jsx-babel-plugin.spec.ts b/packages/next/src/migrations/update-12-8-0/remove-styled-jsx-babel-plugin.spec.ts index 1750806a7687b3..d3c580dc3c412b 100644 --- a/packages/next/src/migrations/update-12-8-0/remove-styled-jsx-babel-plugin.spec.ts +++ b/packages/next/src/migrations/update-12-8-0/remove-styled-jsx-babel-plugin.spec.ts @@ -1,6 +1,6 @@ -import { readJson, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { Linter } from '@nrwl/linter'; +import { readJson, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { Linter } from '@nx/linter'; import { libraryGenerator } from '../../generators/library/library'; import { removeStyledJsxBabelConfig } from './remove-styled-jsx-babel-plugin'; diff --git a/packages/next/src/migrations/update-12-8-0/remove-styled-jsx-babel-plugin.ts b/packages/next/src/migrations/update-12-8-0/remove-styled-jsx-babel-plugin.ts index ed63bf3bcc08d4..6946922434628f 100644 --- a/packages/next/src/migrations/update-12-8-0/remove-styled-jsx-babel-plugin.ts +++ b/packages/next/src/migrations/update-12-8-0/remove-styled-jsx-babel-plugin.ts @@ -5,7 +5,7 @@ import { readJson, joinPathFragments, writeJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; export async function removeStyledJsxBabelConfig(host: Tree) { const projects = getProjects(host); diff --git a/packages/next/src/migrations/update-13-0-0/update-emotion-setup.spec.ts b/packages/next/src/migrations/update-13-0-0/update-emotion-setup.spec.ts index 4bc771955a7d0d..cf4d5cae1d4179 100644 --- a/packages/next/src/migrations/update-13-0-0/update-emotion-setup.spec.ts +++ b/packages/next/src/migrations/update-13-0-0/update-emotion-setup.spec.ts @@ -1,5 +1,5 @@ -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { addProjectConfiguration, readJson, Tree } from '@nrwl/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { addProjectConfiguration, readJson, Tree } from '@nx/devkit'; import { updateEmotionSetup } from './update-emotion-setup'; describe('Update tsconfig config for Emotion', () => { diff --git a/packages/next/src/migrations/update-13-0-0/update-emotion-setup.ts b/packages/next/src/migrations/update-13-0-0/update-emotion-setup.ts index 36f38d7d05dc75..09e09a1d09ac31 100644 --- a/packages/next/src/migrations/update-13-0-0/update-emotion-setup.ts +++ b/packages/next/src/migrations/update-13-0-0/update-emotion-setup.ts @@ -4,7 +4,7 @@ import { Tree, readJson, updateJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; export async function updateEmotionSetup(host: Tree) { const projects = getProjects(host); diff --git a/packages/next/src/migrations/update-13-0-0/update-to-webpack-5.spec.ts b/packages/next/src/migrations/update-13-0-0/update-to-webpack-5.spec.ts index 6f22ae79dd5902..2f2689002b3555 100644 --- a/packages/next/src/migrations/update-13-0-0/update-to-webpack-5.spec.ts +++ b/packages/next/src/migrations/update-13-0-0/update-to-webpack-5.spec.ts @@ -1,5 +1,5 @@ -import { Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { applicationGenerator } from '../../generators/application/application'; import { update } from './update-to-webpack-5'; @@ -21,7 +21,7 @@ describe('Migration: enable webpack 5', () => { // Config that isn't configured properly tree.write( 'apps/demo/next.config.js', - `const withNx = require('@nrwl/next/plugins/with-nx'); + `const withNx = require('@nx/next/plugins/with-nx'); const nextConfig = { webpack5: false, }; @@ -47,7 +47,7 @@ module.exports = withNx(nextConfig); // Config that isn't configured properly tree.write( 'apps/demo/next.config.js', - `const withNx = require('@nrwl/next/plugins/with-nx'); + `const withNx = require('@nx/next/plugins/with-nx'); const withStylus = require('@zeit/next-stylus'); const nextConfig = { @@ -76,7 +76,7 @@ module.exports = withNx(withStylus(nextConfig)); // Config that isn't configured properly tree.write( 'apps/demo/next.config.js', - `const withNx = require('@nrwl/next/plugins/with-nx'); + `const withNx = require('@nx/next/plugins/with-nx'); const withLess = require('@zeit/next-less'); const nextConfig = { diff --git a/packages/next/src/migrations/update-13-0-0/update-to-webpack-5.ts b/packages/next/src/migrations/update-13-0-0/update-to-webpack-5.ts index 1f1ab230f0759e..4b6d045c7543fa 100644 --- a/packages/next/src/migrations/update-13-0-0/update-to-webpack-5.ts +++ b/packages/next/src/migrations/update-13-0-0/update-to-webpack-5.ts @@ -5,7 +5,7 @@ import { getProjects, joinPathFragments, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; export async function update(host: Tree) { const projects = getProjects(host); diff --git a/packages/next/src/migrations/update-13-0-3/fix-less.ts b/packages/next/src/migrations/update-13-0-3/fix-less.ts index c8d1be03b24e3a..f381cf847f1148 100644 --- a/packages/next/src/migrations/update-13-0-3/fix-less.ts +++ b/packages/next/src/migrations/update-13-0-3/fix-less.ts @@ -5,7 +5,7 @@ import { getProjects, joinPathFragments, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; export async function update(host: Tree) { const projects = getProjects(host); diff --git a/packages/next/src/migrations/update-13-1-1/enable-swc.spec.ts b/packages/next/src/migrations/update-13-1-1/enable-swc.spec.ts index 8e2b7fe6e5261c..8cab7097fbde74 100644 --- a/packages/next/src/migrations/update-13-1-1/enable-swc.spec.ts +++ b/packages/next/src/migrations/update-13-1-1/enable-swc.spec.ts @@ -2,8 +2,8 @@ import { readProjectConfiguration, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { applicationGenerator } from '../../generators/application/application'; import { update } from './enable-swc'; diff --git a/packages/next/src/migrations/update-13-1-1/enable-swc.ts b/packages/next/src/migrations/update-13-1-1/enable-swc.ts index 187adbfc798385..2b544e57416a85 100644 --- a/packages/next/src/migrations/update-13-1-1/enable-swc.ts +++ b/packages/next/src/migrations/update-13-1-1/enable-swc.ts @@ -5,7 +5,7 @@ import { logger, readJson, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; export async function update(host: Tree) { const projects = getProjects(host); diff --git a/packages/next/src/migrations/update-14-0-0/add-default-development-configurations.spec.ts b/packages/next/src/migrations/update-14-0-0/add-default-development-configurations.spec.ts index 9d42ab8e5a14ac..519d25ed5edcda 100644 --- a/packages/next/src/migrations/update-14-0-0/add-default-development-configurations.spec.ts +++ b/packages/next/src/migrations/update-14-0-0/add-default-development-configurations.spec.ts @@ -1,8 +1,5 @@ -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { - addProjectConfiguration, - readProjectConfiguration, -} from '@nrwl/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { addProjectConfiguration, readProjectConfiguration } from '@nx/devkit'; import update from './add-default-development-configurations'; describe('React default development configuration', () => { diff --git a/packages/next/src/migrations/update-14-0-0/add-default-development-configurations.ts b/packages/next/src/migrations/update-14-0-0/add-default-development-configurations.ts index 0242eba1711c67..7c47adf2fd2d80 100644 --- a/packages/next/src/migrations/update-14-0-0/add-default-development-configurations.ts +++ b/packages/next/src/migrations/update-14-0-0/add-default-development-configurations.ts @@ -3,7 +3,7 @@ import { getProjects, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; export async function update(tree: Tree) { const projects = getProjects(tree); diff --git a/packages/next/src/migrations/update-14-4-3/add-dev-output-path.spec.ts b/packages/next/src/migrations/update-14-4-3/add-dev-output-path.spec.ts index acdf912a6d4fe6..9742c753d2ad00 100644 --- a/packages/next/src/migrations/update-14-4-3/add-dev-output-path.spec.ts +++ b/packages/next/src/migrations/update-14-4-3/add-dev-output-path.spec.ts @@ -1,8 +1,5 @@ -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { - addProjectConfiguration, - readProjectConfiguration, -} from '@nrwl/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { addProjectConfiguration, readProjectConfiguration } from '@nx/devkit'; import update from './add-dev-output-path'; describe('React default development configuration', () => { diff --git a/packages/next/src/migrations/update-14-4-3/add-dev-output-path.ts b/packages/next/src/migrations/update-14-4-3/add-dev-output-path.ts index eaeaabc7af8ca2..d526c2e31e53a6 100644 --- a/packages/next/src/migrations/update-14-4-3/add-dev-output-path.ts +++ b/packages/next/src/migrations/update-14-4-3/add-dev-output-path.ts @@ -4,7 +4,7 @@ import { joinPathFragments, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; export async function update(tree: Tree) { const projects = getProjects(tree); diff --git a/packages/next/src/migrations/update-14-5-3/add-gitignore-entry.ts b/packages/next/src/migrations/update-14-5-3/add-gitignore-entry.ts index 6f078505f3ead5..7975167533ee90 100644 --- a/packages/next/src/migrations/update-14-5-3/add-gitignore-entry.ts +++ b/packages/next/src/migrations/update-14-5-3/add-gitignore-entry.ts @@ -1,4 +1,4 @@ -import { formatFiles, Tree } from '@nrwl/devkit'; +import { formatFiles, Tree } from '@nx/devkit'; import { addGitIgnoreEntry } from '../../utils/add-gitignore-entry'; export async function update(tree: Tree) { diff --git a/packages/next/src/migrations/update-14-5-3/update-dev-output-path.spec.ts b/packages/next/src/migrations/update-14-5-3/update-dev-output-path.spec.ts index 3219eaaafe883c..756aee37d4ed1a 100644 --- a/packages/next/src/migrations/update-14-5-3/update-dev-output-path.spec.ts +++ b/packages/next/src/migrations/update-14-5-3/update-dev-output-path.spec.ts @@ -1,8 +1,5 @@ -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { - addProjectConfiguration, - readProjectConfiguration, -} from '@nrwl/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { addProjectConfiguration, readProjectConfiguration } from '@nx/devkit'; import update from './update-dev-output-path'; describe('React default development configuration', () => { diff --git a/packages/next/src/migrations/update-14-5-3/update-dev-output-path.ts b/packages/next/src/migrations/update-14-5-3/update-dev-output-path.ts index 1bbf5fa94c8f74..ceea57814365d0 100644 --- a/packages/next/src/migrations/update-14-5-3/update-dev-output-path.ts +++ b/packages/next/src/migrations/update-14-5-3/update-dev-output-path.ts @@ -4,7 +4,7 @@ import { joinPathFragments, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; export async function update(tree: Tree) { const projects = getProjects(tree); diff --git a/packages/next/src/migrations/update-14-5-7/update-next-eslint.spec.ts b/packages/next/src/migrations/update-14-5-7/update-next-eslint.spec.ts index e64d5a5fed3993..e3387e42639305 100644 --- a/packages/next/src/migrations/update-14-5-7/update-next-eslint.spec.ts +++ b/packages/next/src/migrations/update-14-5-7/update-next-eslint.spec.ts @@ -1,5 +1,5 @@ -import { addProjectConfiguration, readJson, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { addProjectConfiguration, readJson, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { updateNextEslint } from './update-next-eslint'; describe('Add next eslint 14.5.7', () => { diff --git a/packages/next/src/migrations/update-14-5-7/update-next-eslint.ts b/packages/next/src/migrations/update-14-5-7/update-next-eslint.ts index e21930a6ad5f9d..3abb242c4b2105 100644 --- a/packages/next/src/migrations/update-14-5-7/update-next-eslint.ts +++ b/packages/next/src/migrations/update-14-5-7/update-next-eslint.ts @@ -1,4 +1,4 @@ -import { formatFiles, getProjects, Tree, updateJson } from '@nrwl/devkit'; +import { formatFiles, getProjects, Tree, updateJson } from '@nx/devkit'; export async function updateNextEslint(host: Tree) { const projects = getProjects(host); diff --git a/packages/next/src/migrations/update-15-8-8/add-style-packages.spec.ts b/packages/next/src/migrations/update-15-8-8/add-style-packages.spec.ts index 6573e0a4ede0fb..c98f78f19489b9 100644 --- a/packages/next/src/migrations/update-15-8-8/add-style-packages.spec.ts +++ b/packages/next/src/migrations/update-15-8-8/add-style-packages.spec.ts @@ -1,10 +1,5 @@ -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { - writeJson, - readJson, - Tree, - addProjectConfiguration, -} from '@nrwl/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { writeJson, readJson, Tree, addProjectConfiguration } from '@nx/devkit'; import update from './add-style-packages'; describe('Add less and stylus if needed', () => { diff --git a/packages/next/src/migrations/update-15-8-8/add-style-packages.ts b/packages/next/src/migrations/update-15-8-8/add-style-packages.ts index 012969a9cafcf8..6eb868756b4ce7 100644 --- a/packages/next/src/migrations/update-15-8-8/add-style-packages.ts +++ b/packages/next/src/migrations/update-15-8-8/add-style-packages.ts @@ -3,7 +3,7 @@ import { getProjects, joinPathFragments, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; export async function update(tree: Tree) { const projects = getProjects(tree); diff --git a/packages/next/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts b/packages/next/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts new file mode 100644 index 00000000000000..9e8a332ed3c328 --- /dev/null +++ b/packages/next/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts @@ -0,0 +1,37 @@ +import { Tree, readJson, updateJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import replacePackage from './update-16-0-0-add-nx-packages'; + +describe('update-16-0-0-add-nx-packages', () => { + let tree: Tree; + beforeEach(() => { + tree = createTreeWithEmptyWorkspace(); + + updateJson(tree, 'package.json', (json) => { + json.devDependencies['@nrwl/next'] = '16.0.0'; + return json; + }); + }); + + it('should remove the dependency on @nrwl/next', async () => { + await replacePackage(tree); + + expect( + readJson(tree, 'package.json').dependencies['@nrwl/next'] + ).not.toBeDefined(); + expect( + readJson(tree, 'package.json').devDependencies['@nrwl/next'] + ).not.toBeDefined(); + }); + + it('should add a dependency on @nx/next', async () => { + await replacePackage(tree); + + const packageJson = readJson(tree, 'package.json'); + const newDependencyVersion = + packageJson.devDependencies['@nx/next'] ?? + packageJson.dependencies['@nx/next']; + + expect(newDependencyVersion).toBeDefined(); + }); +}); diff --git a/packages/next/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts b/packages/next/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts new file mode 100644 index 00000000000000..577d5dd438365e --- /dev/null +++ b/packages/next/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts @@ -0,0 +1,8 @@ +import { Tree, formatFiles } from '@nx/devkit'; +import { replaceNrwlPackageWithNxPackage } from '@nx/devkit/src/utils/replace-package'; + +export default async function replacePackage(tree: Tree): Promise { + await replaceNrwlPackageWithNxPackage(tree, '@nrwl/next', '@nx/next'); + + await formatFiles(tree); +} diff --git a/packages/next/src/utils/config.spec.ts b/packages/next/src/utils/config.spec.ts index 8ae787ab0668fb..350fb5972e6475 100644 --- a/packages/next/src/utils/config.spec.ts +++ b/packages/next/src/utils/config.spec.ts @@ -3,7 +3,7 @@ import 'nx/src/utils/testing/mock-fs'; import { composePlugins, createWebpackConfig, NextConfigFn } from './config'; import { TsconfigPathsPlugin } from 'tsconfig-paths-webpack-plugin'; -jest.mock('@nrwl/webpack', () => ({})); +jest.mock('@nx/webpack', () => ({})); jest.mock('tsconfig-paths-webpack-plugin'); jest.mock('next/dist/server/config', () => ({ __esModule: true, diff --git a/packages/next/src/utils/config.ts b/packages/next/src/utils/config.ts index 1b50517d7a3337..2d9f4fa7b2d3c9 100644 --- a/packages/next/src/utils/config.ts +++ b/packages/next/src/utils/config.ts @@ -7,8 +7,8 @@ import { createCopyPlugin } from './create-copy-plugin'; import { createTmpTsConfig, DependentBuildableProjectNode, -} from '@nrwl/js/src/utils/buildable-libs-utils'; -import { NxWebpackExecutionContext } from '@nrwl/webpack'; +} from '@nx/js/src/utils/buildable-libs-utils'; +import { NxWebpackExecutionContext } from '@nx/webpack'; export function createWebpackConfig( workspaceRoot: string, diff --git a/packages/next/src/utils/generate-globs.ts b/packages/next/src/utils/generate-globs.ts index 128da842a07b57..b03d5275b85c22 100644 --- a/packages/next/src/utils/generate-globs.ts +++ b/packages/next/src/utils/generate-globs.ts @@ -1,5 +1,5 @@ -import { joinPathFragments, logger } from '@nrwl/devkit'; -import { workspaceRoot } from '@nrwl/devkit'; +import { joinPathFragments, logger } from '@nx/devkit'; +import { workspaceRoot } from '@nx/devkit'; import { getSourceDirOfDependentProjects } from 'nx/src/utils/project-graph-utils'; import { resolve } from 'path'; diff --git a/packages/next/src/utils/styles.ts b/packages/next/src/utils/styles.ts index 50782f7a5c6506..6bc5902a8b8a0a 100644 --- a/packages/next/src/utils/styles.ts +++ b/packages/next/src/utils/styles.ts @@ -3,10 +3,10 @@ import { GeneratorCallback, Tree, updateJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; -import { lessVersion, stylusVersion } from '@nrwl/react/src/utils/versions'; -import { CSS_IN_JS_DEPENDENCIES } from '@nrwl/react/src/utils/styled'; +import { lessVersion, stylusVersion } from '@nx/react/src/utils/versions'; +import { CSS_IN_JS_DEPENDENCIES } from '@nx/react/src/utils/styled'; import { babelPluginStyledComponentsVersion, emotionServerVersion, diff --git a/packages/next/tailwind.ts b/packages/next/tailwind.ts index 09436dfa9a7619..fc155407d56b61 100644 --- a/packages/next/tailwind.ts +++ b/packages/next/tailwind.ts @@ -1,3 +1,3 @@ // Re-exporting for convenience and backwards compatibility. -import { createGlobPatternsForDependencies } from '@nrwl/react/tailwind'; +import { createGlobPatternsForDependencies } from '@nx/react/tailwind'; export { createGlobPatternsForDependencies }; diff --git a/packages/node/migrations.json b/packages/node/migrations.json index 7d6b7f6cd231f6..bc27d650a1c7ce 100644 --- a/packages/node/migrations.json +++ b/packages/node/migrations.json @@ -29,6 +29,12 @@ "version": "14.7.6-beta.1", "description": "Update usages of webpack executors to @nrwl/webpack", "factory": "./src/migrations/update-14-7-6/update-webpack-executor" + }, + "update-16-0-0-add-nx-packages": { + "cli": "nx", + "version": "16.0.0-beta.1", + "description": "Replace @nrwl/node with @nx/node", + "implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages" } }, "packageJsonUpdates": { diff --git a/packages/node/migrations.spec.ts b/packages/node/migrations.spec.ts index 8a0daaa4211754..b6f50788ac4874 100644 --- a/packages/node/migrations.spec.ts +++ b/packages/node/migrations.spec.ts @@ -1,11 +1,14 @@ import path = require('path'); import json = require('./migrations.json'); +import { MigrationsJsonEntry } from 'nx/src/config/misc-interfaces'; describe('Node migrations', () => { it('should have valid paths', () => { - Object.values(json.generators).forEach((m) => { + Object.values(json.generators).forEach((m: MigrationsJsonEntry) => { expect(() => - require.resolve(path.join(__dirname, `${m.factory}.ts`)) + require.resolve( + path.join(__dirname, `${m.factory ?? m.implementation}.ts`) + ) ).not.toThrow(); }); }); diff --git a/packages/node/package.json b/packages/node/package.json index 65cd661b4fde0d..b59f27c868f7c7 100644 --- a/packages/node/package.json +++ b/packages/node/package.json @@ -1,5 +1,5 @@ { - "name": "@nrwl/node", + "name": "@nx/node", "version": "0.0.1", "private": false, "description": "The Node Plugin for Nx contains generators and executors to manage Node applications within an Nx workspace.", @@ -31,13 +31,13 @@ "migrations": "./migrations.json" }, "dependencies": { - "@nrwl/devkit": "file:../devkit", - "@nrwl/jest": "file:../jest", - "@nrwl/js": "file:../js", - "@nrwl/linter": "file:../linter", - "@nrwl/webpack": "file:../webpack", - "@nrwl/workspace": "file:../workspace", - "tslib": "^2.3.0" + "tslib": "^2.3.0", + "@nx/devkit": "file:../devkit", + "@nx/jest": "file:../jest", + "@nx/js": "file:../js", + "@nx/linter": "file:../linter", + "@nx/webpack": "file:../webpack", + "@nx/workspace": "file:../workspace" }, "publishConfig": { "access": "public" diff --git a/packages/node/project.json b/packages/node/project.json index 2904c3bfc0e567..99125ff0f55c3b 100644 --- a/packages/node/project.json +++ b/packages/node/project.json @@ -48,7 +48,10 @@ "executor": "nx:run-commands", "outputs": ["{workspaceRoot}/build/packages/node"], "options": { - "command": "node ./scripts/copy-readme.js node" + "commands": [ + "node ./scripts/copy-readme.js node", + "node ./scripts/add-dependency-to-build.js node @nrwl/node" + ] } }, "lint": {} diff --git a/packages/node/src/executors/node/compat.ts b/packages/node/src/executors/node/compat.ts index 44014a83a152af..03735e668e6414 100644 --- a/packages/node/src/executors/node/compat.ts +++ b/packages/node/src/executors/node/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import nodeExecutor from './node.impl'; export default convertNxExecutor(nodeExecutor); diff --git a/packages/node/src/executors/node/node.impl.ts b/packages/node/src/executors/node/node.impl.ts index 0fd9a881de304f..4ecf31b26b54ad 100644 --- a/packages/node/src/executors/node/node.impl.ts +++ b/packages/node/src/executors/node/node.impl.ts @@ -1,6 +1,6 @@ -import { ExecutorContext } from '@nrwl/devkit'; -import type { NodeExecutorOptions } from '@nrwl/js/src/executors/node/schema'; -import { nodeExecutor as jsNodeExecutor } from '@nrwl/js/src/executors/node/node.impl'; +import { ExecutorContext } from '@nx/devkit'; +import type { NodeExecutorOptions } from '@nx/js/src/executors/node/schema'; +import { nodeExecutor as jsNodeExecutor } from '@nx/js/src/executors/node/node.impl'; // TODO(jack): Remove for Nx 16 export async function* nodeExecutor( diff --git a/packages/node/src/executors/webpack/compat.ts b/packages/node/src/executors/webpack/compat.ts index 919858b9b3dd79..e04afb8239a55f 100644 --- a/packages/node/src/executors/webpack/compat.ts +++ b/packages/node/src/executors/webpack/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import { webpackExecutor } from './webpack.impl'; diff --git a/packages/node/src/executors/webpack/webpack.impl.ts b/packages/node/src/executors/webpack/webpack.impl.ts index 89fbd962db3420..d3f84cc5a14230 100644 --- a/packages/node/src/executors/webpack/webpack.impl.ts +++ b/packages/node/src/executors/webpack/webpack.impl.ts @@ -2,9 +2,9 @@ * For backwards compat. * TODO(v16): Remove in Nx 16. */ -import { ExecutorContext, logger } from '@nrwl/devkit'; -import type { WebpackExecutorOptions } from '@nrwl/webpack'; -import { webpackExecutor as baseWebpackExecutor } from '@nrwl/webpack'; +import { ExecutorContext, logger } from '@nx/devkit'; +import type { WebpackExecutorOptions } from '@nx/webpack'; +import { webpackExecutor as baseWebpackExecutor } from '@nx/webpack'; export async function* webpackExecutor( options: WebpackExecutorOptions, diff --git a/packages/node/src/generators/application/application.spec.ts b/packages/node/src/generators/application/application.spec.ts index 944e6c81044f49..50146a0d892639 100644 --- a/packages/node/src/generators/application/application.spec.ts +++ b/packages/node/src/generators/application/application.spec.ts @@ -1,17 +1,17 @@ -import * as devkit from '@nrwl/devkit'; +import * as devkit from '@nx/devkit'; import { getProjects, readJson, readProjectConfiguration, Tree, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; // nx-ignore-next-line -import { applicationGenerator as angularApplicationGenerator } from '@nrwl/angular/generators'; +import { applicationGenerator as angularApplicationGenerator } from '@nx/angular/generators'; import { Schema } from './schema'; import { applicationGenerator } from './application'; -import { overrideCollectionResolutionForTesting } from '@nrwl/devkit/ngcli-adapter'; +import { overrideCollectionResolutionForTesting } from '@nx/devkit/ngcli-adapter'; import { join } from 'path'; describe('app', () => { diff --git a/packages/node/src/generators/application/application.ts b/packages/node/src/generators/application/application.ts index 9a56a11d20f308..4ff34e16213877 100644 --- a/packages/node/src/generators/application/application.ts +++ b/packages/node/src/generators/application/application.ts @@ -21,11 +21,11 @@ import { updateJson, updateProjectConfiguration, updateTsConfigsToJs, -} from '@nrwl/devkit'; -import { Linter, lintProjectGenerator } from '@nrwl/linter'; -import { jestProjectGenerator } from '@nrwl/jest'; +} from '@nx/devkit'; +import { Linter, lintProjectGenerator } from '@nx/linter'; +import { jestProjectGenerator } from '@nx/jest'; -import { getRelativePathToRootTsConfig, tsConfigBaseOptions } from '@nrwl/js'; +import { getRelativePathToRootTsConfig, tsConfigBaseOptions } from '@nx/js'; import { join } from 'path'; import { initGenerator } from '../init/init'; @@ -45,7 +45,7 @@ import { e2eProjectGenerator } from '../e2e-project/e2e-project'; import { setupDockerGenerator } from '../setup-docker/setup-docker'; import { Schema } from './schema'; -import { mapLintPattern } from '@nrwl/linter/src/generators/lint-project/lint-project'; +import { mapLintPattern } from '@nx/linter/src/generators/lint-project/lint-project'; export interface NormalizedSchema extends Schema { appProjectRoot: string; @@ -370,7 +370,7 @@ export async function applicationGenerator(tree: Tree, schema: Schema) { const tasks: GeneratorCallback[] = []; if (options.framework === 'nest') { - const { applicationGenerator } = ensurePackage('@nrwl/nest', nxVersion); + const { applicationGenerator } = ensurePackage('@nx/nest', nxVersion); return await applicationGenerator(tree, { ...options, skipFormat: true }); } diff --git a/packages/node/src/generators/application/schema.d.ts b/packages/node/src/generators/application/schema.d.ts index 64269773fb8f18..aec0248728ffc3 100644 --- a/packages/node/src/generators/application/schema.d.ts +++ b/packages/node/src/generators/application/schema.d.ts @@ -1,4 +1,4 @@ -import { Linter } from '@nrwl/linter'; +import { Linter } from '@nx/linter'; export interface Schema { name: string; diff --git a/packages/node/src/generators/e2e-project/e2e-project.spec.ts b/packages/node/src/generators/e2e-project/e2e-project.spec.ts index 18a25879e388b1..0bed785f49d66d 100644 --- a/packages/node/src/generators/e2e-project/e2e-project.spec.ts +++ b/packages/node/src/generators/e2e-project/e2e-project.spec.ts @@ -1,5 +1,5 @@ -import { Tree } from '@nrwl/devkit/'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { applicationGenerator } from '../application/application'; import { e2eProjectGenerator } from './e2e-project'; diff --git a/packages/node/src/generators/e2e-project/e2e-project.ts b/packages/node/src/generators/e2e-project/e2e-project.ts index 4a6aa843f0628a..309f449b6a46e8 100644 --- a/packages/node/src/generators/e2e-project/e2e-project.ts +++ b/packages/node/src/generators/e2e-project/e2e-project.ts @@ -15,8 +15,8 @@ import { runTasksInSerial, Tree, updateJson, -} from '@nrwl/devkit'; -import { Linter, lintProjectGenerator } from '@nrwl/linter'; +} from '@nx/devkit'; +import { Linter, lintProjectGenerator } from '@nx/linter'; import { Schema } from './schema'; import { axiosVersion } from '../../utils/versions'; @@ -24,7 +24,7 @@ import { join } from 'path'; import { globalJavaScriptOverrides, globalTypeScriptOverrides, -} from '@nrwl/linter/src/generators/init/global-eslint-config'; +} from '@nx/linter/src/generators/init/global-eslint-config'; export async function e2eProjectGenerator(host: Tree, _options: Schema) { const tasks: GeneratorCallback[] = []; diff --git a/packages/node/src/generators/init/init.spec.ts b/packages/node/src/generators/init/init.spec.ts index b2d2cb434efbbe..9ba5160ee500f3 100644 --- a/packages/node/src/generators/init/init.spec.ts +++ b/packages/node/src/generators/init/init.spec.ts @@ -3,8 +3,8 @@ import { readJson, Tree, updateJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { nxVersion } from '../../utils/versions'; import { initGenerator } from './init'; diff --git a/packages/node/src/generators/init/init.ts b/packages/node/src/generators/init/init.ts index 849c09d8388571..40970bb6302a0c 100644 --- a/packages/node/src/generators/init/init.ts +++ b/packages/node/src/generators/init/init.ts @@ -6,10 +6,10 @@ import { removeDependenciesFromPackageJson, runTasksInSerial, Tree, -} from '@nrwl/devkit'; -import { jestInitGenerator } from '@nrwl/jest'; +} from '@nx/devkit'; +import { jestInitGenerator } from '@nx/jest'; -import { initGenerator as jsInitGenerator } from '@nrwl/js'; +import { initGenerator as jsInitGenerator } from '@nx/js'; import { nxVersion, tslibVersion, diff --git a/packages/node/src/generators/library/library.spec.ts b/packages/node/src/generators/library/library.spec.ts index be3d9fda337273..101301a79d27bd 100644 --- a/packages/node/src/generators/library/library.spec.ts +++ b/packages/node/src/generators/library/library.spec.ts @@ -3,8 +3,8 @@ import { readJson, readProjectConfiguration, Tree, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { Schema } from './schema.d'; import { libraryGenerator } from './library'; diff --git a/packages/node/src/generators/library/library.ts b/packages/node/src/generators/library/library.ts index 8ec461dddbc106..97451bb9895bf8 100644 --- a/packages/node/src/generators/library/library.ts +++ b/packages/node/src/generators/library/library.ts @@ -14,14 +14,14 @@ import { Tree, updateProjectConfiguration, updateTsConfigsToJs, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { getImportPath } from 'nx/src/utils/path'; import { Schema } from './schema'; -import { libraryGenerator as jsLibraryGenerator } from '@nrwl/js'; +import { libraryGenerator as jsLibraryGenerator } from '@nx/js'; import { join } from 'path'; -import { addSwcDependencies } from '@nrwl/js/src/utils/swc/add-swc-dependencies'; -import { addSwcConfig } from '@nrwl/js/src/utils/swc/add-swc-config'; +import { addSwcDependencies } from '@nx/js/src/utils/swc/add-swc-dependencies'; +import { addSwcConfig } from '@nx/js/src/utils/swc/add-swc-config'; import { initGenerator } from '../init/init'; export interface NormalizedSchema extends Schema { diff --git a/packages/node/src/generators/library/schema.d.ts b/packages/node/src/generators/library/schema.d.ts index 682a1c3a1ebc2e..837f21a69a9cd8 100644 --- a/packages/node/src/generators/library/schema.d.ts +++ b/packages/node/src/generators/library/schema.d.ts @@ -1,4 +1,4 @@ -import { Linter } from '@nrwl/linter'; +import { Linter } from '@nx/linter'; export interface Schema { name: string; diff --git a/packages/node/src/generators/setup-docker/setup-docker.spec.ts b/packages/node/src/generators/setup-docker/setup-docker.spec.ts index 7452261067c608..38ee8791e93231 100644 --- a/packages/node/src/generators/setup-docker/setup-docker.spec.ts +++ b/packages/node/src/generators/setup-docker/setup-docker.spec.ts @@ -1,5 +1,5 @@ -import { readProjectConfiguration, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { readProjectConfiguration, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { applicationGenerator } from '../application/application'; describe('setupDockerGenerator', () => { let tree: Tree; diff --git a/packages/node/src/generators/setup-docker/setup-docker.ts b/packages/node/src/generators/setup-docker/setup-docker.ts index 3d4fe934830b9a..cb99209198c6a7 100644 --- a/packages/node/src/generators/setup-docker/setup-docker.ts +++ b/packages/node/src/generators/setup-docker/setup-docker.ts @@ -10,7 +10,7 @@ import { runTasksInSerial, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { SetUpDockerOptions } from './schema'; diff --git a/packages/node/src/migrations/update-13-0-0/remove-deprecated-options-13-0-0.spec.ts b/packages/node/src/migrations/update-13-0-0/remove-deprecated-options-13-0-0.spec.ts index 8c1ea4427dc064..433db02429f767 100644 --- a/packages/node/src/migrations/update-13-0-0/remove-deprecated-options-13-0-0.spec.ts +++ b/packages/node/src/migrations/update-13-0-0/remove-deprecated-options-13-0-0.spec.ts @@ -2,8 +2,8 @@ import { addProjectConfiguration, readJson, readProjectConfiguration, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import subject from './remove-deprecated-options-13-0-0'; diff --git a/packages/node/src/migrations/update-13-0-0/remove-deprecated-options-13-0-0.ts b/packages/node/src/migrations/update-13-0-0/remove-deprecated-options-13-0-0.ts index bb2d93deb7d20a..0eae99eefc1b2c 100644 --- a/packages/node/src/migrations/update-13-0-0/remove-deprecated-options-13-0-0.ts +++ b/packages/node/src/migrations/update-13-0-0/remove-deprecated-options-13-0-0.ts @@ -4,7 +4,7 @@ import { logger, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; export default async function update(host: Tree) { const projects = getProjects(host); diff --git a/packages/node/src/migrations/update-13-0-0/remove-webpack-5-packages-13-0-0.spec.ts b/packages/node/src/migrations/update-13-0-0/remove-webpack-5-packages-13-0-0.spec.ts index 5d476d121434ad..a84c5800ae2fb6 100644 --- a/packages/node/src/migrations/update-13-0-0/remove-webpack-5-packages-13-0-0.spec.ts +++ b/packages/node/src/migrations/update-13-0-0/remove-webpack-5-packages-13-0-0.spec.ts @@ -1,5 +1,5 @@ -import { readJson } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { readJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import subject from './remove-webpack-5-packages-13-0-0'; diff --git a/packages/node/src/migrations/update-13-0-0/remove-webpack-5-packages-13-0-0.ts b/packages/node/src/migrations/update-13-0-0/remove-webpack-5-packages-13-0-0.ts index b9b9f61218a6b9..353b4810e7ed09 100644 --- a/packages/node/src/migrations/update-13-0-0/remove-webpack-5-packages-13-0-0.ts +++ b/packages/node/src/migrations/update-13-0-0/remove-webpack-5-packages-13-0-0.ts @@ -4,7 +4,7 @@ import { readJson, removeDependenciesFromPackageJson, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; const packages = [ 'webpack', diff --git a/packages/node/src/migrations/update-13-8-5/rename-build-to-webpack.spec.ts b/packages/node/src/migrations/update-13-8-5/rename-build-to-webpack.spec.ts index fcce7cb8e5fec4..ce7e2bf6d6e0cc 100644 --- a/packages/node/src/migrations/update-13-8-5/rename-build-to-webpack.spec.ts +++ b/packages/node/src/migrations/update-13-8-5/rename-build-to-webpack.spec.ts @@ -2,8 +2,8 @@ import { addProjectConfiguration, readJson, readProjectConfiguration, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import rename from './rename-build-to-webpack'; diff --git a/packages/node/src/migrations/update-13-8-5/rename-build-to-webpack.ts b/packages/node/src/migrations/update-13-8-5/rename-build-to-webpack.ts index fb94861fb3a455..c9a3d803ba83e7 100644 --- a/packages/node/src/migrations/update-13-8-5/rename-build-to-webpack.ts +++ b/packages/node/src/migrations/update-13-8-5/rename-build-to-webpack.ts @@ -3,8 +3,8 @@ import { readProjectConfiguration, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; +} from '@nx/devkit'; +import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils'; export default async function update(host: Tree) { forEachExecutorOptions( diff --git a/packages/node/src/migrations/update-13-8-5/rename-execute-to-node.spec.ts b/packages/node/src/migrations/update-13-8-5/rename-execute-to-node.spec.ts index 7279015beaa730..a59f09f23f4287 100644 --- a/packages/node/src/migrations/update-13-8-5/rename-execute-to-node.spec.ts +++ b/packages/node/src/migrations/update-13-8-5/rename-execute-to-node.spec.ts @@ -2,8 +2,8 @@ import { addProjectConfiguration, readJson, readProjectConfiguration, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import rename from './rename-execute-to-node'; diff --git a/packages/node/src/migrations/update-13-8-5/rename-execute-to-node.ts b/packages/node/src/migrations/update-13-8-5/rename-execute-to-node.ts index 35e88dc6a6a13d..44492a3f0f82ac 100644 --- a/packages/node/src/migrations/update-13-8-5/rename-execute-to-node.ts +++ b/packages/node/src/migrations/update-13-8-5/rename-execute-to-node.ts @@ -3,8 +3,8 @@ import { readProjectConfiguration, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; +} from '@nx/devkit'; +import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils'; export default async function update(tree: Tree) { forEachExecutorOptions( diff --git a/packages/node/src/migrations/update-13-8-5/update-package-to-tsc.spec.ts b/packages/node/src/migrations/update-13-8-5/update-package-to-tsc.spec.ts index 7a3b6a9e872748..20faacd62488a2 100644 --- a/packages/node/src/migrations/update-13-8-5/update-package-to-tsc.spec.ts +++ b/packages/node/src/migrations/update-13-8-5/update-package-to-tsc.spec.ts @@ -1,8 +1,5 @@ -import { - addProjectConfiguration, - readProjectConfiguration, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { addProjectConfiguration, readProjectConfiguration } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import update from './update-package-to-tsc'; diff --git a/packages/node/src/migrations/update-13-8-5/update-package-to-tsc.ts b/packages/node/src/migrations/update-13-8-5/update-package-to-tsc.ts index 75e84c704a8cbf..302ae27f2a225c 100644 --- a/packages/node/src/migrations/update-13-8-5/update-package-to-tsc.ts +++ b/packages/node/src/migrations/update-13-8-5/update-package-to-tsc.ts @@ -4,9 +4,9 @@ import { readProjectConfiguration, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; -import { nxVersion } from '@nrwl/workspace/src/utils/versions'; +} from '@nx/devkit'; +import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils'; +import { nxVersion } from '@nx/workspace/src/utils/versions'; export default async function update(host: Tree) { let installNeeded = false; diff --git a/packages/node/src/migrations/update-14-7-6/update-webpack-executor.spec.ts b/packages/node/src/migrations/update-14-7-6/update-webpack-executor.spec.ts index 551529dfeca2b3..f96f2b5783ba49 100644 --- a/packages/node/src/migrations/update-14-7-6/update-webpack-executor.spec.ts +++ b/packages/node/src/migrations/update-14-7-6/update-webpack-executor.spec.ts @@ -2,8 +2,8 @@ import { addProjectConfiguration, readJson, readProjectConfiguration, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import update from './update-webpack-executor'; diff --git a/packages/node/src/migrations/update-14-7-6/update-webpack-executor.ts b/packages/node/src/migrations/update-14-7-6/update-webpack-executor.ts index 1c7eb2162ea32e..c3b5ed39525338 100644 --- a/packages/node/src/migrations/update-14-7-6/update-webpack-executor.ts +++ b/packages/node/src/migrations/update-14-7-6/update-webpack-executor.ts @@ -3,7 +3,7 @@ import { getProjects, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; export default async function update(host: Tree) { const projects = getProjects(host); diff --git a/packages/node/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts b/packages/node/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts new file mode 100644 index 00000000000000..0b72ce84879c38 --- /dev/null +++ b/packages/node/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts @@ -0,0 +1,37 @@ +import { Tree, readJson, updateJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import replacePackage from './update-16-0-0-add-nx-packages'; + +describe('update-16-0-0-add-nx-packages', () => { + let tree: Tree; + beforeEach(() => { + tree = createTreeWithEmptyWorkspace(); + + updateJson(tree, 'package.json', (json) => { + json.devDependencies['@nrwl/node'] = '16.0.0'; + return json; + }); + }); + + it('should remove the dependency on @nrwl/node', async () => { + await replacePackage(tree); + + expect( + readJson(tree, 'package.json').dependencies['@nrwl/node'] + ).not.toBeDefined(); + expect( + readJson(tree, 'package.json').devDependencies['@nrwl/node'] + ).not.toBeDefined(); + }); + + it('should add a dependency on @nx/node', async () => { + await replacePackage(tree); + + const packageJson = readJson(tree, 'package.json'); + const newDependencyVersion = + packageJson.devDependencies['@nx/node'] ?? + packageJson.dependencies['@nx/node']; + + expect(newDependencyVersion).toBeDefined(); + }); +}); diff --git a/packages/node/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts b/packages/node/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts new file mode 100644 index 00000000000000..aa0821ebae2555 --- /dev/null +++ b/packages/node/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts @@ -0,0 +1,8 @@ +import { Tree, formatFiles } from '@nx/devkit'; +import { replaceNrwlPackageWithNxPackage } from '@nx/devkit/src/utils/replace-package'; + +export default async function replacePackage(tree: Tree): Promise { + await replaceNrwlPackageWithNxPackage(tree, '@nrwl/node', '@nx/node'); + + await formatFiles(tree); +} diff --git a/packages/nx-plugin/migrations.json b/packages/nx-plugin/migrations.json index 8b8e37a7b359f7..9dc213e219fd98 100644 --- a/packages/nx-plugin/migrations.json +++ b/packages/nx-plugin/migrations.json @@ -35,6 +35,12 @@ "cli": "nx", "description": "Removes CLI property within schema.json files and moves generators and schematics to the proper root node in migrations.json", "factory": "./src/migrations/update-16-0-0/cli-in-schema-json" + }, + "update-16-0-0-add-nx-packages": { + "cli": "nx", + "version": "16.0.0-beta.1", + "description": "Replace @nrwl/nx-plugin with @nx/nx-plugin", + "implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages" } } } diff --git a/packages/nx-plugin/package.json b/packages/nx-plugin/package.json index 4713daae7c6e51..16691ad31262d5 100644 --- a/packages/nx-plugin/package.json +++ b/packages/nx-plugin/package.json @@ -1,5 +1,5 @@ { - "name": "@nrwl/nx-plugin", + "name": "@nx/nx-plugin", "version": "0.0.1", "private": false, "description": "This plugin is used to create Nx plugins! It contains generators for generating common plugin features like generators, executors, migrations and more.", @@ -28,14 +28,14 @@ "migrations": "./migrations.json" }, "dependencies": { - "@nrwl/devkit": "file:../devkit", - "@nrwl/jest": "file:../jest", - "@nrwl/js": "file:../js", - "@nrwl/linter": "file:../linter", "@phenomnomnominal/tsquery": "~5.0.1", "dotenv": "~10.0.0", "fs-extra": "^11.1.0", - "tslib": "^2.3.0" + "tslib": "^2.3.0", + "@nx/devkit": "file:../devkit", + "@nx/jest": "file:../jest", + "@nx/js": "file:../js", + "@nx/linter": "file:../linter" }, "publishConfig": { "access": "public" diff --git a/packages/nx-plugin/project.json b/packages/nx-plugin/project.json index e376f5a655983d..9b2c6a09599093 100644 --- a/packages/nx-plugin/project.json +++ b/packages/nx-plugin/project.json @@ -48,7 +48,10 @@ "executor": "nx:run-commands", "outputs": ["{workspaceRoot}/build/packages/nx-plugin"], "options": { - "command": "node ./scripts/copy-readme.js nx-plugin" + "commands": [ + "node ./scripts/copy-readme.js nx-plugin", + "node ./scripts/add-dependency-to-build.js nx-plugin @nrwl/nx-plugin" + ] } }, "lint": {} diff --git a/packages/nx-plugin/src/executors/e2e/compat.ts b/packages/nx-plugin/src/executors/e2e/compat.ts index 13c6ece28c10c3..1b9fcf07a7ea68 100644 --- a/packages/nx-plugin/src/executors/e2e/compat.ts +++ b/packages/nx-plugin/src/executors/e2e/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import { nxPluginE2EExecutor } from './e2e.impl'; export const nxPluginE2EBuilder = convertNxExecutor(nxPluginE2EExecutor); diff --git a/packages/nx-plugin/src/executors/e2e/e2e.impl.ts b/packages/nx-plugin/src/executors/e2e/e2e.impl.ts index 11ef8b8aa5f4b6..5deaccee97b1c0 100644 --- a/packages/nx-plugin/src/executors/e2e/e2e.impl.ts +++ b/packages/nx-plugin/src/executors/e2e/e2e.impl.ts @@ -1,15 +1,15 @@ import 'dotenv/config'; -import type { ExecutorContext } from '@nrwl/devkit'; +import type { ExecutorContext } from '@nx/devkit'; import { logger, parseTargetString, readTargetOptions, runExecutor, -} from '@nrwl/devkit'; -import { JestExecutorOptions } from '@nrwl/jest/src/executors/jest/schema'; -import { jestExecutor } from '@nrwl/jest/src/executors/jest/jest.impl'; +} from '@nx/devkit'; +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? diff --git a/packages/nx-plugin/src/executors/e2e/schema.d.ts b/packages/nx-plugin/src/executors/e2e/schema.d.ts index cdd2c2193bfbcb..fe3fa1aaf18695 100644 --- a/packages/nx-plugin/src/executors/e2e/schema.d.ts +++ b/packages/nx-plugin/src/executors/e2e/schema.d.ts @@ -1,4 +1,4 @@ -import { JestExecutorOptions } from '@nrwl/jest/src/executors/jest/schema'; +import { JestExecutorOptions } from '@nx/jest/src/executors/jest/schema'; export interface NxPluginE2EExecutorOptions extends JestExecutorOptions { target: string; diff --git a/packages/nx-plugin/src/generators/e2e-project/e2e.spec.ts b/packages/nx-plugin/src/generators/e2e-project/e2e.spec.ts index 4fd839f2dddcfa..03976dbec1036f 100644 --- a/packages/nx-plugin/src/generators/e2e-project/e2e.spec.ts +++ b/packages/nx-plugin/src/generators/e2e-project/e2e.spec.ts @@ -5,8 +5,8 @@ import { readJson, getProjects, joinPathFragments, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { e2eProjectGenerator } from './e2e'; describe('NxPlugin e2e-project Generator', () => { diff --git a/packages/nx-plugin/src/generators/e2e-project/e2e.ts b/packages/nx-plugin/src/generators/e2e-project/e2e.ts index ab576298a36f96..00f81fd91e109f 100644 --- a/packages/nx-plugin/src/generators/e2e-project/e2e.ts +++ b/packages/nx-plugin/src/generators/e2e-project/e2e.ts @@ -1,4 +1,4 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { addProjectConfiguration, convertNxGenerator, @@ -12,13 +12,13 @@ import { readProjectConfiguration, runTasksInSerial, updateProjectConfiguration, -} from '@nrwl/devkit'; -import { jestProjectGenerator } from '@nrwl/jest'; -import { getRelativePathToRootTsConfig } from '@nrwl/js'; +} from '@nx/devkit'; +import { jestProjectGenerator } from '@nx/jest'; +import { getRelativePathToRootTsConfig } from '@nx/js'; import * as path from 'path'; import type { Schema } from './schema'; -import { Linter, lintProjectGenerator } from '@nrwl/linter'; +import { Linter, lintProjectGenerator } from '@nx/linter'; interface NormalizedSchema extends Schema { projectRoot: string; diff --git a/packages/nx-plugin/src/generators/e2e-project/schema.d.ts b/packages/nx-plugin/src/generators/e2e-project/schema.d.ts index f9c0f5cbaac1ee..124cd79bbc386c 100644 --- a/packages/nx-plugin/src/generators/e2e-project/schema.d.ts +++ b/packages/nx-plugin/src/generators/e2e-project/schema.d.ts @@ -1,4 +1,4 @@ -import { Linter } from '@nrwl/linter'; +import { Linter } from '@nx/linter'; export interface Schema { pluginName: string; diff --git a/packages/nx-plugin/src/generators/executor/executor.spec.ts b/packages/nx-plugin/src/generators/executor/executor.spec.ts index e2a2e7dc26b384..e8516168a51f65 100644 --- a/packages/nx-plugin/src/generators/executor/executor.spec.ts +++ b/packages/nx-plugin/src/generators/executor/executor.spec.ts @@ -1,8 +1,8 @@ -import { Tree, readJson, readProjectConfiguration } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { Tree, readJson, readProjectConfiguration } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { executorGenerator } from './executor'; import { pluginGenerator } from '../plugin/plugin'; -import { libraryGenerator as jsLibraryGenerator } from '@nrwl/js'; +import { libraryGenerator as jsLibraryGenerator } from '@nx/js'; describe('NxPlugin Executor Generator', () => { let tree: Tree; diff --git a/packages/nx-plugin/src/generators/executor/executor.ts b/packages/nx-plugin/src/generators/executor/executor.ts index 5b7b5209402a50..ce91248d22c0a6 100644 --- a/packages/nx-plugin/src/generators/executor/executor.ts +++ b/packages/nx-plugin/src/generators/executor/executor.ts @@ -9,8 +9,8 @@ import { writeJson, readJson, ExecutorsJson, -} from '@nrwl/devkit'; -import type { Tree } from '@nrwl/devkit'; +} from '@nx/devkit'; +import type { Tree } from '@nx/devkit'; import type { Schema } from './schema'; import * as path from 'path'; import { PackageJson } from 'nx/src/utils/package-json'; diff --git a/packages/nx-plugin/src/generators/generator/generator.spec.ts b/packages/nx-plugin/src/generators/generator/generator.spec.ts index 0ef4a1e40098b5..df19ec1ccc6634 100644 --- a/packages/nx-plugin/src/generators/generator/generator.spec.ts +++ b/packages/nx-plugin/src/generators/generator/generator.spec.ts @@ -3,9 +3,9 @@ import { readJson, readProjectConfiguration, Tree, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { libraryGenerator as jsLibraryGenerator } from '@nrwl/js'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { libraryGenerator as jsLibraryGenerator } from '@nx/js'; import { pluginGenerator } from '../plugin/plugin'; import { generatorGenerator } from './generator'; diff --git a/packages/nx-plugin/src/generators/generator/generator.ts b/packages/nx-plugin/src/generators/generator/generator.ts index f3205ec67753f2..3602a9beb5362b 100644 --- a/packages/nx-plugin/src/generators/generator/generator.ts +++ b/packages/nx-plugin/src/generators/generator/generator.ts @@ -1,9 +1,4 @@ -import { - GeneratorsJson, - joinPathFragments, - Tree, - writeJson, -} from '@nrwl/devkit'; +import { GeneratorsJson, joinPathFragments, Tree, writeJson } from '@nx/devkit'; import { convertNxGenerator, generateFiles, @@ -12,7 +7,7 @@ import { readJson, readProjectConfiguration, updateJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { PackageJson } from 'nx/src/utils/package-json'; import * as path from 'path'; import type { Schema } from './schema'; diff --git a/packages/nx-plugin/src/generators/lint-checks/generator.spec.ts b/packages/nx-plugin/src/generators/lint-checks/generator.spec.ts index bb54ee9009e61f..b527129391b271 100644 --- a/packages/nx-plugin/src/generators/lint-checks/generator.spec.ts +++ b/packages/nx-plugin/src/generators/lint-checks/generator.spec.ts @@ -1,4 +1,4 @@ -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { Tree, readProjectConfiguration, @@ -6,14 +6,14 @@ import { updateJson, joinPathFragments, writeJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import type { Linter as ESLint } from 'eslint'; -import { Schema as EsLintExecutorOptions } from '@nrwl/linter/src/executors/eslint/schema'; +import { Schema as EsLintExecutorOptions } from '@nx/linter/src/executors/eslint/schema'; import generator from './generator'; import pluginGenerator from '../plugin/plugin'; -import { Linter } from '@nrwl/linter'; +import { Linter } from '@nx/linter'; import { PackageJson } from 'nx/src/utils/package-json'; describe('lint-checks generator', () => { diff --git a/packages/nx-plugin/src/generators/lint-checks/generator.ts b/packages/nx-plugin/src/generators/lint-checks/generator.ts index d3f0d3720d40f9..027753403decbd 100644 --- a/packages/nx-plugin/src/generators/lint-checks/generator.ts +++ b/packages/nx-plugin/src/generators/lint-checks/generator.ts @@ -10,11 +10,11 @@ import { updateJson, updateProjectConfiguration, writeJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import type { Linter as ESLint } from 'eslint'; -import { Schema as EsLintExecutorOptions } from '@nrwl/linter/src/executors/eslint/schema'; +import { Schema as EsLintExecutorOptions } from '@nx/linter/src/executors/eslint/schema'; import { jsoncEslintParserVersion } from '../../utils/versions'; import { PluginLintChecksGeneratorSchema } from './schema'; diff --git a/packages/nx-plugin/src/generators/migration/migration.spec.ts b/packages/nx-plugin/src/generators/migration/migration.spec.ts index 796106af42ea1a..6a5ade948f8a75 100644 --- a/packages/nx-plugin/src/generators/migration/migration.spec.ts +++ b/packages/nx-plugin/src/generators/migration/migration.spec.ts @@ -1,5 +1,5 @@ -import { Tree, readProjectConfiguration, readJson } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { Tree, readProjectConfiguration, readJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { migrationGenerator } from './migration'; import { pluginGenerator } from '../plugin/plugin'; diff --git a/packages/nx-plugin/src/generators/migration/migration.ts b/packages/nx-plugin/src/generators/migration/migration.ts index e604e94e9cdfc4..9e25e506e168a8 100644 --- a/packages/nx-plugin/src/generators/migration/migration.ts +++ b/packages/nx-plugin/src/generators/migration/migration.ts @@ -9,8 +9,8 @@ import { writeJson, joinPathFragments, formatFiles, -} from '@nrwl/devkit'; -import type { Tree } from '@nrwl/devkit'; +} from '@nx/devkit'; +import type { Tree } from '@nx/devkit'; import type { Schema } from './schema'; import * as path from 'path'; import { addMigrationJsonChecks } from '../lint-checks/generator'; @@ -154,7 +154,9 @@ export async function migrationGenerator(host: Tree, schema: Schema) { ); } - await formatFiles(host); + if (!options.skipFormat) { + await formatFiles(host); + } } export default migrationGenerator; diff --git a/packages/nx-plugin/src/generators/migration/schema.d.ts b/packages/nx-plugin/src/generators/migration/schema.d.ts index d55df3f32f11df..32f3d9e2695fdf 100644 --- a/packages/nx-plugin/src/generators/migration/schema.d.ts +++ b/packages/nx-plugin/src/generators/migration/schema.d.ts @@ -4,4 +4,5 @@ export interface Schema { description?: string; packageVersion: string; packageJsonUpdates?: boolean; + skipFormat?: boolean; } diff --git a/packages/nx-plugin/src/generators/plugin/plugin.spec.ts b/packages/nx-plugin/src/generators/plugin/plugin.spec.ts index 964adc85bd9ff2..f901c3d69eda02 100644 --- a/packages/nx-plugin/src/generators/plugin/plugin.spec.ts +++ b/packages/nx-plugin/src/generators/plugin/plugin.spec.ts @@ -4,9 +4,9 @@ import { readJson, readProjectConfiguration, Tree, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { Linter } from '@nrwl/linter'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { Linter } from '@nx/linter'; import { pluginGenerator } from './plugin'; import { Schema } from './schema'; diff --git a/packages/nx-plugin/src/generators/plugin/plugin.ts b/packages/nx-plugin/src/generators/plugin/plugin.ts index 6853eb0e8ad3b0..9911a4cda06f4d 100644 --- a/packages/nx-plugin/src/generators/plugin/plugin.ts +++ b/packages/nx-plugin/src/generators/plugin/plugin.ts @@ -8,10 +8,10 @@ import { readProjectConfiguration, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; -import { libraryGenerator as jsLibraryGenerator } from '@nrwl/js'; -import { addSwcDependencies } from '@nrwl/js/src/utils/swc/add-swc-dependencies'; -import { Linter } from '@nrwl/linter'; +} from '@nx/devkit'; +import { libraryGenerator as jsLibraryGenerator } from '@nx/js'; +import { addSwcDependencies } from '@nx/js/src/utils/swc/add-swc-dependencies'; +import { Linter } from '@nx/linter'; import { swcNodeVersion } from 'nx/src/utils/versions'; import * as path from 'path'; diff --git a/packages/nx-plugin/src/generators/plugin/schema.d.ts b/packages/nx-plugin/src/generators/plugin/schema.d.ts index 2596b29095cd07..a8fbfb616e184b 100644 --- a/packages/nx-plugin/src/generators/plugin/schema.d.ts +++ b/packages/nx-plugin/src/generators/plugin/schema.d.ts @@ -1,4 +1,4 @@ -import { Linter } from '@nrwl/linter'; +import { Linter } from '@nx/linter'; export interface Schema { name: string; diff --git a/packages/nx-plugin/src/generators/plugin/utils/normalize-schema.ts b/packages/nx-plugin/src/generators/plugin/utils/normalize-schema.ts index 9585280bfcf38c..18fa3ae47e6ef3 100644 --- a/packages/nx-plugin/src/generators/plugin/utils/normalize-schema.ts +++ b/packages/nx-plugin/src/generators/plugin/utils/normalize-schema.ts @@ -5,7 +5,7 @@ import { joinPathFragments, names, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { Schema } from '../schema'; export interface NormalizedSchema extends Schema { diff --git a/packages/nx-plugin/src/generators/preset/generator.spec.ts b/packages/nx-plugin/src/generators/preset/generator.spec.ts index 838442e39a9912..0b1c1fb7021474 100644 --- a/packages/nx-plugin/src/generators/preset/generator.spec.ts +++ b/packages/nx-plugin/src/generators/preset/generator.spec.ts @@ -1,10 +1,10 @@ -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { Tree, readProjectConfiguration, readJson, readNxJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import generator from './generator'; import { PackageJson } from 'nx/src/utils/package-json'; diff --git a/packages/nx-plugin/src/generators/preset/generator.ts b/packages/nx-plugin/src/generators/preset/generator.ts index 066746ac9b2b68..3169c26075776e 100644 --- a/packages/nx-plugin/src/generators/preset/generator.ts +++ b/packages/nx-plugin/src/generators/preset/generator.ts @@ -5,8 +5,8 @@ import { updateJson, updateNxJson, readNxJson, -} from '@nrwl/devkit'; -import { Linter } from '@nrwl/linter'; +} from '@nx/devkit'; +import { Linter } from '@nx/linter'; import { PackageJson } from 'nx/src/utils/package-json'; import { pluginGenerator } from '../plugin/plugin'; import { PresetGeneratorSchema } from './schema'; diff --git a/packages/nx-plugin/src/migrations/update-14-1-9/add-swc-deps-if-needed.ts b/packages/nx-plugin/src/migrations/update-14-1-9/add-swc-deps-if-needed.ts index dbd3ecfceb38ab..38f7b3cea064e7 100644 --- a/packages/nx-plugin/src/migrations/update-14-1-9/add-swc-deps-if-needed.ts +++ b/packages/nx-plugin/src/migrations/update-14-1-9/add-swc-deps-if-needed.ts @@ -3,7 +3,7 @@ import { formatFiles, installPackagesTask, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { swcCoreVersion, swcNodeVersion } from 'nx/src/utils/versions'; export default async function addSwcNodeIfNeeded(tree: Tree) { diff --git a/packages/nx-plugin/src/migrations/update-15-0-0/specify-output-capture.spec.ts b/packages/nx-plugin/src/migrations/update-15-0-0/specify-output-capture.spec.ts index 81f9736bbe6b68..4a0f5c23fe7ded 100644 --- a/packages/nx-plugin/src/migrations/update-15-0-0/specify-output-capture.spec.ts +++ b/packages/nx-plugin/src/migrations/update-15-0-0/specify-output-capture.spec.ts @@ -1,6 +1,6 @@ -import { readJson, updateJson } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { Linter } from '@nrwl/linter'; +import { readJson, updateJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { Linter } from '@nx/linter'; import { ExecutorConfig } from 'nx/src/config/misc-interfaces'; import pluginGenerator from '../../generators/plugin/plugin'; import update from './specify-output-capture'; diff --git a/packages/nx-plugin/src/migrations/update-15-0-0/specify-output-capture.ts b/packages/nx-plugin/src/migrations/update-15-0-0/specify-output-capture.ts index b114f4d440a826..bb1efb05790170 100644 --- a/packages/nx-plugin/src/migrations/update-15-0-0/specify-output-capture.ts +++ b/packages/nx-plugin/src/migrations/update-15-0-0/specify-output-capture.ts @@ -6,7 +6,7 @@ import { updateJson, formatFiles, readJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { ExecutorConfig } from 'nx/src/config/misc-interfaces'; import { PackageJson } from 'nx/src/utils/package-json'; diff --git a/packages/nx-plugin/src/migrations/update-15-9-0/jest-29-configs.ts b/packages/nx-plugin/src/migrations/update-15-9-0/jest-29-configs.ts index aaae8ab7424298..7d0cdbaf5a17da 100644 --- a/packages/nx-plugin/src/migrations/update-15-9-0/jest-29-configs.ts +++ b/packages/nx-plugin/src/migrations/update-15-9-0/jest-29-configs.ts @@ -4,13 +4,13 @@ import { logger, stripIndents, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { tsquery } from '@phenomnomnominal/tsquery'; import * as ts from 'typescript'; -import { forEachExecutorOptionsInGraph } from '@nrwl/devkit/src/generators/executor-options-utils'; -import { TS_QUERY_JEST_CONFIG_PREFIX } from '@nrwl/jest/src/utils/ast-utils'; -import { findRootJestPreset } from '@nrwl/jest/src/utils/config/find-root-jest-files'; -import { JestExecutorOptions } from '@nrwl/jest/src/executors/jest/schema'; +import { forEachExecutorOptionsInGraph } from '@nx/devkit/src/generators/executor-options-utils'; +import { TS_QUERY_JEST_CONFIG_PREFIX } from '@nx/jest/src/utils/ast-utils'; +import { findRootJestPreset } from '@nx/jest/src/utils/config/find-root-jest-files'; +import { JestExecutorOptions } from '@nx/jest/src/executors/jest/schema'; // NOTE: this is a copy of the @nrwl/jest v15.8.0 migrations export async function updateConfigsJest29(tree: Tree) { diff --git a/packages/nx-plugin/src/migrations/update-15-9-0/jest-29-tests.ts b/packages/nx-plugin/src/migrations/update-15-9-0/jest-29-tests.ts index 4e7d1379bda233..a7045156c21d3f 100644 --- a/packages/nx-plugin/src/migrations/update-15-9-0/jest-29-tests.ts +++ b/packages/nx-plugin/src/migrations/update-15-9-0/jest-29-tests.ts @@ -4,10 +4,10 @@ import { readProjectConfiguration, Tree, visitNotIgnoredFiles, -} from '@nrwl/devkit'; -import { JestExecutorOptions } from '@nrwl/jest/src/executors/jest/schema'; -import { TEST_FILE_PATTERN } from '@nrwl/jest/src/utils/ast-utils'; -import { forEachExecutorOptionsInGraph } from '@nrwl/devkit/src/generators/executor-options-utils'; +} from '@nx/devkit'; +import { JestExecutorOptions } from '@nx/jest/src/executors/jest/schema'; +import { TEST_FILE_PATTERN } from '@nx/jest/src/utils/ast-utils'; +import { forEachExecutorOptionsInGraph } from '@nx/devkit/src/generators/executor-options-utils'; import { tsquery } from '@phenomnomnominal/tsquery'; import { CallExpression, diff --git a/packages/nx-plugin/src/migrations/update-15-9-0/update-configs-jest-29.spec.ts b/packages/nx-plugin/src/migrations/update-15-9-0/update-configs-jest-29.spec.ts index 7af07e9c24ee57..67cce2e2405d07 100644 --- a/packages/nx-plugin/src/migrations/update-15-9-0/update-configs-jest-29.spec.ts +++ b/packages/nx-plugin/src/migrations/update-15-9-0/update-configs-jest-29.spec.ts @@ -1,16 +1,16 @@ -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { ProjectGraph, readProjectConfiguration, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { updateConfigsJest29 } from './jest-29-configs'; -import { libraryGenerator } from '@nrwl/js'; +import { libraryGenerator } from '@nx/js'; let projectGraph: ProjectGraph; -jest.mock('@nrwl/devkit', () => ({ - ...jest.requireActual('@nrwl/devkit'), +jest.mock('@nx/devkit', () => ({ + ...jest.requireActual('@nx/devkit'), createProjectGraphAsync: jest.fn().mockImplementation(async () => { return projectGraph; }), diff --git a/packages/nx-plugin/src/migrations/update-15-9-0/update-tests-jest-29.spec.ts b/packages/nx-plugin/src/migrations/update-15-9-0/update-tests-jest-29.spec.ts index 399948d495cebc..7ee6cdf0bae2ae 100644 --- a/packages/nx-plugin/src/migrations/update-15-9-0/update-tests-jest-29.spec.ts +++ b/packages/nx-plugin/src/migrations/update-15-9-0/update-tests-jest-29.spec.ts @@ -3,14 +3,14 @@ import { readProjectConfiguration, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { libraryGenerator } from '@nrwl/js'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { libraryGenerator } from '@nx/js'; import { updateTestsJest29 } from './jest-29-tests'; let projectGraph: ProjectGraph; -jest.mock('@nrwl/devkit', () => ({ - ...jest.requireActual('@nrwl/devkit'), +jest.mock('@nx/devkit', () => ({ + ...jest.requireActual('@nx/devkit'), createProjectGraphAsync: jest .fn() .mockImplementation(async () => projectGraph), diff --git a/packages/nx-plugin/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts b/packages/nx-plugin/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts new file mode 100644 index 00000000000000..0677eaed4fb184 --- /dev/null +++ b/packages/nx-plugin/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts @@ -0,0 +1,37 @@ +import { Tree, readJson, updateJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import replacePackage from './update-16-0-0-add-nx-packages'; + +describe('update-16-0-0-add-nx-packages', () => { + let tree: Tree; + beforeEach(() => { + tree = createTreeWithEmptyWorkspace(); + + updateJson(tree, 'package.json', (json) => { + json.devDependencies['@nrwl/nx-plugin'] = '16.0.0'; + return json; + }); + }); + + it('should remove the dependency on @nrwl/nx-plugin', async () => { + await replacePackage(tree); + + expect( + readJson(tree, 'package.json').dependencies['@nrwl/nx-plugin'] + ).not.toBeDefined(); + expect( + readJson(tree, 'package.json').devDependencies['@nrwl/nx-plugin'] + ).not.toBeDefined(); + }); + + it('should add a dependency on @nx/nx-plugin', async () => { + await replacePackage(tree); + + const packageJson = readJson(tree, 'package.json'); + const newDependencyVersion = + packageJson.devDependencies['@nx/nx-plugin'] ?? + packageJson.dependencies['@nx/nx-plugin']; + + expect(newDependencyVersion).toBeDefined(); + }); +}); diff --git a/packages/nx-plugin/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts b/packages/nx-plugin/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts new file mode 100644 index 00000000000000..0b61581707113b --- /dev/null +++ b/packages/nx-plugin/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts @@ -0,0 +1,12 @@ +import { Tree, formatFiles } from '@nx/devkit'; +import { replaceNrwlPackageWithNxPackage } from '@nx/devkit/src/utils/replace-package'; + +export default async function replacePackage(tree: Tree): Promise { + await replaceNrwlPackageWithNxPackage( + tree, + '@nrwl/nx-plugin', + '@nx/nx-plugin' + ); + + await formatFiles(tree); +} diff --git a/packages/nx-plugin/src/migrations/update-16-0-0/cli-in-schema-json.spec.ts b/packages/nx-plugin/src/migrations/update-16-0-0/cli-in-schema-json.spec.ts index 6a0d175216700c..b0303335615d30 100644 --- a/packages/nx-plugin/src/migrations/update-16-0-0/cli-in-schema-json.spec.ts +++ b/packages/nx-plugin/src/migrations/update-16-0-0/cli-in-schema-json.spec.ts @@ -8,9 +8,9 @@ import { Tree, updateJson, writeJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { Linter } from '@nrwl/linter'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { Linter } from '@nx/linter'; import { PackageJson } from 'nx/src/utils/package-json'; import executorGenerator from '../../generators/executor/executor'; import generatorGenerator from '../../generators/generator/generator'; diff --git a/packages/nx-plugin/src/migrations/update-16-0-0/cli-in-schema-json.ts b/packages/nx-plugin/src/migrations/update-16-0-0/cli-in-schema-json.ts index 8be51fe2013c4a..fcb884847ae60f 100644 --- a/packages/nx-plugin/src/migrations/update-16-0-0/cli-in-schema-json.ts +++ b/packages/nx-plugin/src/migrations/update-16-0-0/cli-in-schema-json.ts @@ -7,7 +7,7 @@ import { readJson, Tree, updateJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { ExecutorsJsonEntry, GeneratorsJsonEntry, diff --git a/packages/nx-plugin/src/utils/testing-utils/async-commands.ts b/packages/nx-plugin/src/utils/testing-utils/async-commands.ts index 863e2be8b38430..2eaa0977fe850c 100644 --- a/packages/nx-plugin/src/utils/testing-utils/async-commands.ts +++ b/packages/nx-plugin/src/utils/testing-utils/async-commands.ts @@ -1,6 +1,6 @@ import { exec } from 'child_process'; import { tmpProjPath } from './paths'; -import { getPackageManagerCommand } from '@nrwl/devkit'; +import { getPackageManagerCommand } from '@nx/devkit'; import { fileExists } from './utils'; /** diff --git a/packages/nx-plugin/src/utils/testing-utils/commands.ts b/packages/nx-plugin/src/utils/testing-utils/commands.ts index 7e822968803905..62602a4221524a 100644 --- a/packages/nx-plugin/src/utils/testing-utils/commands.ts +++ b/packages/nx-plugin/src/utils/testing-utils/commands.ts @@ -1,6 +1,6 @@ import { ExecOptions, execSync } from 'child_process'; import { tmpProjPath } from './paths'; -import { getPackageManagerCommand } from '@nrwl/devkit'; +import { getPackageManagerCommand } from '@nx/devkit'; import { fileExists } from './utils'; /** diff --git a/packages/nx-plugin/src/utils/testing-utils/nx-project.ts b/packages/nx-plugin/src/utils/testing-utils/nx-project.ts index 6235b9e3917cd9..e8a5af6a7eac4e 100644 --- a/packages/nx-plugin/src/utils/testing-utils/nx-project.ts +++ b/packages/nx-plugin/src/utils/testing-utils/nx-project.ts @@ -1,9 +1,9 @@ -import { workspaceRoot } from '@nrwl/devkit'; +import { workspaceRoot } from '@nx/devkit'; import { getPackageManagerCommand, readJsonFile, writeJsonFile, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { execSync } from 'child_process'; import { dirname } from 'path'; import { ensureDirSync } from 'fs-extra'; diff --git a/packages/nx-plugin/src/utils/testing-utils/utils.ts b/packages/nx-plugin/src/utils/testing-utils/utils.ts index 5d6e0022ff69fc..f6a9b5741c49bc 100644 --- a/packages/nx-plugin/src/utils/testing-utils/utils.ts +++ b/packages/nx-plugin/src/utils/testing-utils/utils.ts @@ -10,8 +10,8 @@ import { } from 'fs-extra'; import { dirname, isAbsolute } from 'path'; import { tmpProjPath } from './paths'; -import { parseJson } from '@nrwl/devkit'; -import type { JsonParseOptions } from '@nrwl/devkit'; +import { parseJson } from '@nx/devkit'; +import type { JsonParseOptions } from '@nx/devkit'; import { directoryExists, fileExists } from 'nx/src/utils/fileutils'; export { directoryExists, fileExists }; diff --git a/packages/nx/native-packages/darwin-arm64/package.json b/packages/nx/native-packages/darwin-arm64/package.json index b55c2fe758f681..71fcaf25f2b983 100644 --- a/packages/nx/native-packages/darwin-arm64/package.json +++ b/packages/nx/native-packages/darwin-arm64/package.json @@ -1,5 +1,5 @@ { - "name": "@nrwl/nx-darwin-arm64", + "name": "@nx/nx-darwin-arm64", "version": "0.0.0", "os": [ "darwin" diff --git a/packages/nx/native-packages/darwin-x64/package.json b/packages/nx/native-packages/darwin-x64/package.json index 869be007d3c98f..23dc565ee3e646 100644 --- a/packages/nx/native-packages/darwin-x64/package.json +++ b/packages/nx/native-packages/darwin-x64/package.json @@ -1,5 +1,5 @@ { - "name": "@nrwl/nx-darwin-x64", + "name": "@nx/nx-darwin-x64", "version": "0.0.0", "os": [ "darwin" diff --git a/packages/nx/native-packages/linux-arm-gnueabihf/package.json b/packages/nx/native-packages/linux-arm-gnueabihf/package.json index 65079931d56646..292945213175e0 100644 --- a/packages/nx/native-packages/linux-arm-gnueabihf/package.json +++ b/packages/nx/native-packages/linux-arm-gnueabihf/package.json @@ -1,5 +1,5 @@ { - "name": "@nrwl/nx-linux-arm-gnueabihf", + "name": "@nx/nx-linux-arm-gnueabihf", "version": "0.0.0", "os": [ "linux" diff --git a/packages/nx/native-packages/linux-arm64-gnu/package.json b/packages/nx/native-packages/linux-arm64-gnu/package.json index 44e7389e015646..da3c648db0b456 100644 --- a/packages/nx/native-packages/linux-arm64-gnu/package.json +++ b/packages/nx/native-packages/linux-arm64-gnu/package.json @@ -1,5 +1,5 @@ { - "name": "@nrwl/nx-linux-arm64-gnu", + "name": "@nx/nx-linux-arm64-gnu", "version": "0.0.0", "os": [ "linux" diff --git a/packages/nx/native-packages/linux-arm64-musl/package.json b/packages/nx/native-packages/linux-arm64-musl/package.json index 52a89dc3c2acb1..aa3d35691efa66 100644 --- a/packages/nx/native-packages/linux-arm64-musl/package.json +++ b/packages/nx/native-packages/linux-arm64-musl/package.json @@ -1,5 +1,5 @@ { - "name": "@nrwl/nx-linux-arm64-musl", + "name": "@nx/nx-linux-arm64-musl", "version": "0.0.0", "os": [ "linux" diff --git a/packages/nx/native-packages/linux-x64-gnu/package.json b/packages/nx/native-packages/linux-x64-gnu/package.json index 2246bc062aad33..6518d8a83e0e0d 100644 --- a/packages/nx/native-packages/linux-x64-gnu/package.json +++ b/packages/nx/native-packages/linux-x64-gnu/package.json @@ -1,5 +1,5 @@ { - "name": "@nrwl/nx-linux-x64-gnu", + "name": "@nx/nx-linux-x64-gnu", "version": "0.0.0", "os": [ "linux" diff --git a/packages/nx/native-packages/linux-x64-musl/package.json b/packages/nx/native-packages/linux-x64-musl/package.json index cc240e3fb8119e..5b1476d91d77b9 100644 --- a/packages/nx/native-packages/linux-x64-musl/package.json +++ b/packages/nx/native-packages/linux-x64-musl/package.json @@ -1,5 +1,5 @@ { - "name": "@nrwl/nx-linux-x64-musl", + "name": "@nx/nx-linux-x64-musl", "version": "0.0.0", "os": [ "linux" diff --git a/packages/nx/native-packages/win32-arm64-msvc/package.json b/packages/nx/native-packages/win32-arm64-msvc/package.json index 29e791ee7b437c..98af841733df5a 100644 --- a/packages/nx/native-packages/win32-arm64-msvc/package.json +++ b/packages/nx/native-packages/win32-arm64-msvc/package.json @@ -1,5 +1,5 @@ { - "name": "@nrwl/nx-win32-arm64-msvc", + "name": "@nx/nx-win32-arm64-msvc", "version": "0.0.0", "os": [ "win32" diff --git a/packages/nx/native-packages/win32-x64-msvc/package.json b/packages/nx/native-packages/win32-x64-msvc/package.json index 431b2db2256364..375cf215822175 100644 --- a/packages/nx/native-packages/win32-x64-msvc/package.json +++ b/packages/nx/native-packages/win32-x64-msvc/package.json @@ -1,5 +1,5 @@ { - "name": "@nrwl/nx-win32-x64-msvc", + "name": "@nx/nx-win32-x64-msvc", "version": "0.0.0", "os": [ "win32" diff --git a/packages/nx/package.json b/packages/nx/package.json index e5c256802e6390..70f77010cf01fa 100644 --- a/packages/nx/package.json +++ b/packages/nx/package.json @@ -79,42 +79,65 @@ } }, "optionalDependencies": { - "@nrwl/nx-win32-x64-msvc": "*", - "@nrwl/nx-darwin-x64": "*", - "@nrwl/nx-linux-x64-gnu": "*", - "@nrwl/nx-darwin-arm64": "*", - "@nrwl/nx-linux-arm64-gnu": "*", - "@nrwl/nx-linux-arm64-musl": "*", - "@nrwl/nx-win32-arm64-msvc": "*", - "@nrwl/nx-linux-arm-gnueabihf": "*", - "@nrwl/nx-linux-x64-musl": "*" + "@nx/nx-win32-x64-msvc": "*", + "@nx/nx-darwin-x64": "*", + "@nx/nx-linux-x64-gnu": "*", + "@nx/nx-darwin-arm64": "*", + "@nx/nx-linux-arm64-gnu": "*", + "@nx/nx-linux-arm64-musl": "*", + "@nx/nx-win32-arm64-msvc": "*", + "@nx/nx-linux-arm-gnueabihf": "*", + "@nx/nx-linux-x64-musl": "*" }, "nx-migrations": { "migrations": "./migrations.json", "packageGroup": [ + "@nx/js", "@nrwl/js", + "@nx/jest", "@nrwl/jest", + "@nx/linter", "@nrwl/linter", + "@nx/workspace", "@nrwl/workspace", + "@nx/angular", "@nrwl/angular", + "@nx/cypress", "@nrwl/cypress", + "@nx/detox", "@nrwl/detox", + "@nx/devkit", "@nrwl/devkit", + "@nx/esbuild", "@nrwl/esbuild", + "@nx/eslint-plugin-nx", "@nrwl/eslint-plugin-nx", + "@nx/expo", "@nrwl/expo", + "@nx/express", "@nrwl/express", + "@nx/nest", "@nrwl/nest", + "@nx/next", "@nrwl/next", + "@nx/node", "@nrwl/node", + "@nx/nx-plugin", "@nrwl/nx-plugin", + "@nx/react", "@nrwl/react", + "@nx/react-native", "@nrwl/react-native", + "@nx/rollup", "@nrwl/rollup", + "@nx/storybook", "@nrwl/storybook", "@nrwl/tao", + "@nx/vite", "@nrwl/vite", + "@nx/web", "@nrwl/web", + "@nx/webpack", "@nrwl/webpack", { "package": "@nrwl/nx-cloud", @@ -134,7 +157,7 @@ "napi": { "name": "nx", "package": { - "name": "@nrwl/nx" + "name": "@nx/nx" }, "triples": { "additional": [ diff --git a/packages/nx/src/adapter/angular-json.ts b/packages/nx/src/adapter/angular-json.ts index 6bc1f8e4814195..f5d782ca11d19d 100644 --- a/packages/nx/src/adapter/angular-json.ts +++ b/packages/nx/src/adapter/angular-json.ts @@ -28,10 +28,15 @@ export function shouldMergeAngularProjects( function isNrwlAngularInstalled() { try { - require.resolve('@nrwl/angular'); + require.resolve('@nx/angular'); return true; } catch { - return false; + try { + require.resolve('@nrwl/angular'); + return true; + } catch { + return false; + } } } diff --git a/packages/nx/src/adapter/ngcli-adapter.ts b/packages/nx/src/adapter/ngcli-adapter.ts index a0445472d7336c..5eb810b39bf819 100644 --- a/packages/nx/src/adapter/ngcli-adapter.ts +++ b/packages/nx/src/adapter/ngcli-adapter.ts @@ -1,5 +1,3 @@ -/* eslint-disable no-restricted-imports */ -import type { Architect } from '@angular-devkit/architect'; import { fragment, logging, @@ -13,11 +11,19 @@ import { } from '@angular-devkit/core'; import { createConsoleLogger, NodeJsSyncHost } from '@angular-devkit/core/node'; import { FileBuffer } from '@angular-devkit/core/src/virtual-fs/host/interface'; + +/* eslint-disable no-restricted-imports */ +import type { Architect } from '@angular-devkit/architect'; +import { WorkspaceNodeModulesArchitectHost } from '@angular-devkit/architect/node'; +import { NodeModulesBuilderInfo } from '@angular-devkit/architect/node/node-modules-architect-host'; + import * as chalk from 'chalk'; import { Stats } from 'fs'; import { dirname, extname, join, resolve } from 'path'; + import { concat, from, Observable, of, zip } from 'rxjs'; import { catchError, concatMap, map, tap } from 'rxjs/operators'; + import { GenerateOptions } from '../command-line/generate'; import { NxJsonConfiguration } from '../config/nx-json'; import { ProjectConfiguration } from '../config/workspace-json-project-json'; @@ -36,6 +42,36 @@ import { NX_ERROR, NX_PREFIX } from '../utils/logger'; import { readModulePackageJson } from '../utils/package-json'; import { detectPackageManager } from '../utils/package-manager'; import { toNewFormat, toOldFormat } from './angular-json'; +import { Workspaces } from '../config/workspaces'; +import { ExecutorsJson } from '../config/misc-interfaces'; + +class WrappedWorkspaceNodeModulesArchitectHost extends WorkspaceNodeModulesArchitectHost { + private workspaces = new Workspaces(this.root); + + constructor(private workspace, private root) { + super(workspace, root); + } + async resolveBuilder(builderStr: string): Promise { + const [packageName, builderName] = builderStr.split(':'); + + const { executorsFilePath, executorConfig } = this.workspaces[ + 'readExecutorsJson' + ](packageName, builderName); + const builderInfo = this.workspaces.readExecutor(packageName, builderName); + return { + name: builderStr, + builderName, + description: + readJsonFile(executorsFilePath).builders[builderName] + .description, + optionSchema: builderInfo.schema, + import: this.workspaces['resolveImplementation']( + executorConfig.implementation, + dirname(executorsFilePath) + ), + }; + } +} export async function scheduleTarget( root: string, @@ -48,9 +84,6 @@ export async function scheduleTarget( verbose: boolean ): Promise> { const { Architect } = require('@angular-devkit/architect'); - const { - WorkspaceNodeModulesArchitectHost, - } = require('@angular-devkit/architect/node'); const logger = getLogger(verbose); const fsHost = new NxScopedHost(root); @@ -65,7 +98,10 @@ export async function scheduleTarget( // This happens when context.scheduleTarget is used to run a target using nx:run-commands return []; }); - const architectHost = new WorkspaceNodeModulesArchitectHost(workspace, root); + const architectHost = new WrappedWorkspaceNodeModulesArchitectHost( + workspace, + root + ); const architect: Architect = new Architect(architectHost, registry); const run = await architect.scheduleTarget( { diff --git a/packages/nx/src/native/index.js b/packages/nx/src/native/index.js index cd11e59a880598..2b08204b37f378 100644 --- a/packages/nx/src/native/index.js +++ b/packages/nx/src/native/index.js @@ -31,7 +31,7 @@ switch (platform) { if (localFileExisted) { nativeBinding = require('./nx.android-arm64.node') } else { - nativeBinding = require('@nrwl/nx-android-arm64') + nativeBinding = require('@nx/nx-android-arm64') } } catch (e) { loadError = e @@ -43,7 +43,7 @@ switch (platform) { if (localFileExisted) { nativeBinding = require('./nx.android-arm-eabi.node') } else { - nativeBinding = require('@nrwl/nx-android-arm-eabi') + nativeBinding = require('@nx/nx-android-arm-eabi') } } catch (e) { loadError = e @@ -63,7 +63,7 @@ switch (platform) { if (localFileExisted) { nativeBinding = require('./nx.win32-x64-msvc.node') } else { - nativeBinding = require('@nrwl/nx-win32-x64-msvc') + nativeBinding = require('@nx/nx-win32-x64-msvc') } } catch (e) { loadError = e @@ -77,7 +77,7 @@ switch (platform) { if (localFileExisted) { nativeBinding = require('./nx.win32-ia32-msvc.node') } else { - nativeBinding = require('@nrwl/nx-win32-ia32-msvc') + nativeBinding = require('@nx/nx-win32-ia32-msvc') } } catch (e) { loadError = e @@ -91,7 +91,7 @@ switch (platform) { if (localFileExisted) { nativeBinding = require('./nx.win32-arm64-msvc.node') } else { - nativeBinding = require('@nrwl/nx-win32-arm64-msvc') + nativeBinding = require('@nx/nx-win32-arm64-msvc') } } catch (e) { loadError = e @@ -107,7 +107,7 @@ switch (platform) { if (localFileExisted) { nativeBinding = require('./nx.darwin-universal.node') } else { - nativeBinding = require('@nrwl/nx-darwin-universal') + nativeBinding = require('@nx/nx-darwin-universal') } break } catch {} @@ -118,7 +118,7 @@ switch (platform) { if (localFileExisted) { nativeBinding = require('./nx.darwin-x64.node') } else { - nativeBinding = require('@nrwl/nx-darwin-x64') + nativeBinding = require('@nx/nx-darwin-x64') } } catch (e) { loadError = e @@ -132,7 +132,7 @@ switch (platform) { if (localFileExisted) { nativeBinding = require('./nx.darwin-arm64.node') } else { - nativeBinding = require('@nrwl/nx-darwin-arm64') + nativeBinding = require('@nx/nx-darwin-arm64') } } catch (e) { loadError = e @@ -151,7 +151,7 @@ switch (platform) { if (localFileExisted) { nativeBinding = require('./nx.freebsd-x64.node') } else { - nativeBinding = require('@nrwl/nx-freebsd-x64') + nativeBinding = require('@nx/nx-freebsd-x64') } } catch (e) { loadError = e @@ -168,7 +168,7 @@ switch (platform) { if (localFileExisted) { nativeBinding = require('./nx.linux-x64-musl.node') } else { - nativeBinding = require('@nrwl/nx-linux-x64-musl') + nativeBinding = require('@nx/nx-linux-x64-musl') } } catch (e) { loadError = e @@ -181,7 +181,7 @@ switch (platform) { if (localFileExisted) { nativeBinding = require('./nx.linux-x64-gnu.node') } else { - nativeBinding = require('@nrwl/nx-linux-x64-gnu') + nativeBinding = require('@nx/nx-linux-x64-gnu') } } catch (e) { loadError = e @@ -197,7 +197,7 @@ switch (platform) { if (localFileExisted) { nativeBinding = require('./nx.linux-arm64-musl.node') } else { - nativeBinding = require('@nrwl/nx-linux-arm64-musl') + nativeBinding = require('@nx/nx-linux-arm64-musl') } } catch (e) { loadError = e @@ -210,7 +210,7 @@ switch (platform) { if (localFileExisted) { nativeBinding = require('./nx.linux-arm64-gnu.node') } else { - nativeBinding = require('@nrwl/nx-linux-arm64-gnu') + nativeBinding = require('@nx/nx-linux-arm64-gnu') } } catch (e) { loadError = e @@ -225,7 +225,7 @@ switch (platform) { if (localFileExisted) { nativeBinding = require('./nx.linux-arm-gnueabihf.node') } else { - nativeBinding = require('@nrwl/nx-linux-arm-gnueabihf') + nativeBinding = require('@nx/nx-linux-arm-gnueabihf') } } catch (e) { loadError = e diff --git a/packages/nx/src/nx-init/add-nx-to-nest.ts b/packages/nx/src/nx-init/add-nx-to-nest.ts index e0ccef95421560..04b9e735c059c9 100644 --- a/packages/nx/src/nx-init/add-nx-to-nest.ts +++ b/packages/nx/src/nx-init/add-nx-to-nest.ts @@ -291,7 +291,7 @@ function tryCreateJestPreset(repoRoot: string) { writeFileSync( jestPresetPath, ` -const nxPreset = require('@nrwl/jest/preset').default; +const nxPreset = require('@nx/jest/preset').default; module.exports = {...nxPreset}; `, 'utf8' diff --git a/packages/nx/src/plugins/js/lock-file/__fixtures__/auxiliary-packages/package.json b/packages/nx/src/plugins/js/lock-file/__fixtures__/auxiliary-packages/package.json index e8b076d7b0e744..f8fd23e70c4623 100644 --- a/packages/nx/src/plugins/js/lock-file/__fixtures__/auxiliary-packages/package.json +++ b/packages/nx/src/plugins/js/lock-file/__fixtures__/auxiliary-packages/package.json @@ -3,10 +3,10 @@ "version": "0.0.0", "license": "MIT", "dependencies": { - "@nrwl/devkit": "15.0.13", "eslint-plugin-disable-autofix": "npm:@mattlewis92/eslint-plugin-disable-autofix@3.0.0", "postgres": "charsleysa/postgres#fix-errors-compiled", - "yargs": "17.6.2" + "yargs": "17.6.2", + "@nrwl/devkit": "15.0.13" }, "devDependencies": { "react": "18.2.0" diff --git a/packages/nx/src/plugins/js/lock-file/__fixtures__/duplicate-package/package.json b/packages/nx/src/plugins/js/lock-file/__fixtures__/duplicate-package/package.json index a8f6d3604e9e76..1cb575c04f8935 100644 --- a/packages/nx/src/plugins/js/lock-file/__fixtures__/duplicate-package/package.json +++ b/packages/nx/src/plugins/js/lock-file/__fixtures__/duplicate-package/package.json @@ -3,8 +3,8 @@ "version": "0.0.0", "license": "MIT", "dependencies": { + "nx": "15.4.0", "@nrwl/devkit": "^14.8.0", - "@nrwl/workspace": "^14.8.0", - "nx": "15.4.0" + "@nrwl/workspace": "^14.8.0" } } diff --git a/packages/nx/src/plugins/js/lock-file/__fixtures__/nextjs/app/package.json b/packages/nx/src/plugins/js/lock-file/__fixtures__/nextjs/app/package.json index 8251a73b831b52..63c6c59844d522 100644 --- a/packages/nx/src/plugins/js/lock-file/__fixtures__/nextjs/app/package.json +++ b/packages/nx/src/plugins/js/lock-file/__fixtures__/nextjs/app/package.json @@ -2,11 +2,11 @@ "name": "myapp", "version": "0.0.1", "dependencies": { - "@nrwl/next": "15.3.3", "next": "13.0.0", "react": "18.2.0", "react-dom": "18.2.0", - "typescript": "4.8.4" + "typescript": "4.8.4", + "@nrwl/next": "15.3.3" }, "scripts": { "start": "next start" diff --git a/packages/nx/src/plugins/js/lock-file/__fixtures__/nextjs/package.json b/packages/nx/src/plugins/js/lock-file/__fixtures__/nextjs/package.json index d14ad2ff8d8c6d..738a4fe4680f6b 100644 --- a/packages/nx/src/plugins/js/lock-file/__fixtures__/nextjs/package.json +++ b/packages/nx/src/plugins/js/lock-file/__fixtures__/nextjs/package.json @@ -9,23 +9,16 @@ }, "private": true, "dependencies": { - "@nrwl/next": "15.3.3", "core-js": "^3.6.5", "next": "13.0.0", "react": "18.2.0", "react-dom": "18.2.0", "regenerator-runtime": "0.13.7", - "tslib": "^2.3.0" + "tslib": "^2.3.0", + "@nrwl/next": "15.3.3" }, "devDependencies": { "@babel/preset-react": "^7.14.5", - "@nrwl/cypress": "15.3.3", - "@nrwl/eslint-plugin-nx": "15.3.3", - "@nrwl/jest": "15.3.3", - "@nrwl/linter": "15.3.3", - "@nrwl/react": "15.3.3", - "@nrwl/web": "15.3.3", - "@nrwl/workspace": "15.3.3", "@testing-library/react": "13.4.0", "@types/jest": "28.1.1", "@types/node": "18.11.9", @@ -50,6 +43,13 @@ "react-test-renderer": "18.2.0", "ts-jest": "28.0.5", "ts-node": "10.9.1", - "typescript": "~4.8.2" + "typescript": "~4.8.2", + "@nrwl/cypress": "15.3.3", + "@nrwl/eslint-plugin-nx": "15.3.3", + "@nrwl/jest": "15.3.3", + "@nrwl/linter": "15.3.3", + "@nrwl/react": "15.3.3", + "@nrwl/web": "15.3.3", + "@nrwl/workspace": "15.3.3" } } diff --git a/packages/nx/src/plugins/js/lock-file/yarn-parser.spec.ts b/packages/nx/src/plugins/js/lock-file/yarn-parser.spec.ts index 45610b432208ab..4ac0710d412b7b 100644 --- a/packages/nx/src/plugins/js/lock-file/yarn-parser.spec.ts +++ b/packages/nx/src/plugins/js/lock-file/yarn-parser.spec.ts @@ -8,8 +8,8 @@ import { ProjectGraphBuilder } from '../../../project-graph/project-graph-builde jest.mock('fs', () => require('memfs').fs); -jest.mock('@nrwl/devkit', () => ({ - ...jest.requireActual('@nrwl/devkit'), +jest.mock('@nx/devkit', () => ({ + ...jest.requireActual('@nx/devkit'), workspaceRoot: '/root', })); diff --git a/packages/nx/src/utils/plugins/core-plugins.ts b/packages/nx/src/utils/plugins/core-plugins.ts index 36238bcec23182..a63c74df502020 100644 --- a/packages/nx/src/utils/plugins/core-plugins.ts +++ b/packages/nx/src/utils/plugins/core-plugins.ts @@ -5,51 +5,51 @@ import type { CorePlugin, PluginCapabilities } from './models'; export function fetchCorePlugins(): CorePlugin[] { return [ { - name: '@nrwl/angular', + name: '@nx/angular', capabilities: 'executors,generators', }, { - name: '@nrwl/cypress', + name: '@nx/cypress', capabilities: 'executors,generators', }, { - name: '@nrwl/detox', + name: '@nx/detox', capabilities: 'executors,generators', }, { - name: '@nrwl/esbuild', + name: '@nx/esbuild', capabilities: 'executors,generators', }, { - name: '@nrwl/expo', + name: '@nx/expo', capabilities: 'executors,generators', }, { - name: '@nrwl/express', + name: '@nx/express', capabilities: 'generators', }, { - name: '@nrwl/jest', + name: '@nx/jest', capabilities: 'executors,generators', }, { - name: '@nrwl/js', + name: '@nx/js', capabilities: 'executors,generators', }, { - name: '@nrwl/linter', + name: '@nx/linter', capabilities: 'executors,generators', }, { - name: '@nrwl/nest', + name: '@nx/nest', capabilities: 'generators', }, { - name: '@nrwl/next', + name: '@nx/next', capabilities: 'executors,generators', }, { - name: '@nrwl/node', + name: '@nx/node', capabilities: 'executors,generators', }, { @@ -57,35 +57,39 @@ export function fetchCorePlugins(): CorePlugin[] { capabilities: 'executors', }, { - name: '@nrwl/nx-plugin', + name: '@nx/nx-plugin', capabilities: 'executors,generators', }, { - name: '@nrwl/react', + name: '@nx/react', capabilities: 'executors,generators', }, { - name: '@nrwl/react-native', + name: '@nx/react-native', capabilities: 'executors,generators', }, { - name: '@nrwl/rollup', + name: '@nx/rollup', capabilities: 'executors,generators', }, { - name: '@nrwl/storybook', + name: '@nx/storybook', capabilities: 'executors,generators', }, { - name: '@nrwl/web', + name: '@nx/vite', capabilities: 'executors,generators', }, { - name: '@nrwl/webpack', + name: '@nx/web', capabilities: 'executors,generators', }, { - name: '@nrwl/workspace', + name: '@nx/webpack', + capabilities: 'executors,generators', + }, + { + name: '@nx/workspace', capabilities: 'executors,generators', }, ]; diff --git a/packages/react-native/migrations.json b/packages/react-native/migrations.json index 5d6001a2abb679..97a6df903acf12 100644 --- a/packages/react-native/migrations.json +++ b/packages/react-native/migrations.json @@ -77,6 +77,12 @@ "version": "15.9.1-beta.0", "description": "Add target build-ios and pod-install for react native apps", "factory": "./src/migrations/update-15-9-1/add-build-ios-target" + }, + "update-16-0-0-add-nx-packages": { + "cli": "nx", + "version": "16.0.0-beta.1", + "description": "Replace @nrwl/react-native with @nx/react-native", + "implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages" } }, "packageJsonUpdates": { diff --git a/packages/react-native/migrations.spec.ts b/packages/react-native/migrations.spec.ts index 59f6c730a3b462..aed48d240386c9 100644 --- a/packages/react-native/migrations.spec.ts +++ b/packages/react-native/migrations.spec.ts @@ -1,11 +1,14 @@ import path = require('path'); import json = require('./migrations.json'); +import { MigrationsJsonEntry } from 'nx/src/config/misc-interfaces'; describe('React Native migrations', () => { it('should have valid paths', () => { - Object.values(json.generators).forEach((m) => { + Object.values(json.generators).forEach((m: MigrationsJsonEntry) => { expect(() => - require.resolve(path.join(__dirname, `${m.factory}.ts`)) + require.resolve( + path.join(__dirname, `${m.factory ?? m.implementation}.ts`) + ) ).not.toThrow(); }); }); diff --git a/packages/react-native/package.json b/packages/react-native/package.json index 8ca6b41ad6238c..a79fb68125a857 100644 --- a/packages/react-native/package.json +++ b/packages/react-native/package.json @@ -1,5 +1,5 @@ { - "name": "@nrwl/react-native", + "name": "@nx/react-native", "version": "0.0.1", "private": false, "description": "The Nx Plugin for React Native contains generators for managing React Native applications and libraries within an Nx workspace. It provides: \n\n-Integration with libraries such as Jest, Detox, and Storybook.\n-Scaffolding for creating buildable libraries that can be published to npm.\n-Utilities for automatic workspace refactoring.", @@ -25,13 +25,6 @@ "main": "./index", "types": "index.d.ts", "dependencies": { - "@nrwl/detox": "file:../detox", - "@nrwl/devkit": "file:../devkit", - "@nrwl/jest": "file:../jest", - "@nrwl/js": "file:../js", - "@nrwl/linter": "file:../linter", - "@nrwl/react": "file:../react", - "@nrwl/workspace": "file:../workspace", "chalk": "^4.1.0", "enhanced-resolve": "^5.8.3", "fs-extra": "^11.1.0", @@ -39,7 +32,14 @@ "metro-resolver": "^0.74.1", "minimatch": "3.0.5", "node-fetch": "^2.6.7", - "tsconfig-paths": "^4.1.2" + "tsconfig-paths": "^4.1.2", + "@nx/detox": "file:../detox", + "@nx/devkit": "file:../devkit", + "@nx/jest": "file:../jest", + "@nx/js": "file:../js", + "@nx/linter": "file:../linter", + "@nx/react": "file:../react", + "@nx/workspace": "file:../workspace" }, "peerDependencies": { "react-native": "^0.71.4" diff --git a/packages/react-native/plugins/metro-resolver.ts b/packages/react-native/plugins/metro-resolver.ts index 74153d2404f291..5a66c48ab0c063 100644 --- a/packages/react-native/plugins/metro-resolver.ts +++ b/packages/react-native/plugins/metro-resolver.ts @@ -5,7 +5,7 @@ import * as chalk from 'chalk'; import { CachedInputFileSystem, ResolverFactory } from 'enhanced-resolve'; import { dirname, join } from 'path'; import * as fs from 'fs'; -import { workspaceRoot } from '@nrwl/devkit'; +import { workspaceRoot } from '@nx/devkit'; /* * Use tsconfig to resolve additional workspace libs. diff --git a/packages/react-native/plugins/with-nx-metro.ts b/packages/react-native/plugins/with-nx-metro.ts index beace1dface6c7..1f82e0b5238b5c 100644 --- a/packages/react-native/plugins/with-nx-metro.ts +++ b/packages/react-native/plugins/with-nx-metro.ts @@ -1,4 +1,4 @@ -import { workspaceLayout, workspaceRoot } from '@nrwl/devkit'; +import { workspaceLayout, workspaceRoot } from '@nx/devkit'; import { join } from 'path'; import { existsSync } from 'fs-extra'; diff --git a/packages/react-native/project.json b/packages/react-native/project.json index cbfcde0582c55f..bfebc4314be790 100644 --- a/packages/react-native/project.json +++ b/packages/react-native/project.json @@ -54,7 +54,10 @@ "executor": "nx:run-commands", "outputs": ["{workspaceRoot}/build/packages/react-native"], "options": { - "command": "node ./scripts/copy-readme.js react-native" + "commands": [ + "node ./scripts/copy-readme.js react-native", + "node ./scripts/add-dependency-to-build.js react-native @nrwl/react-native" + ] } } } diff --git a/packages/react-native/src/executors/build-android/build-android.impl.ts b/packages/react-native/src/executors/build-android/build-android.impl.ts index 56be92996db08e..9f8c569d7fbecc 100644 --- a/packages/react-native/src/executors/build-android/build-android.impl.ts +++ b/packages/react-native/src/executors/build-android/build-android.impl.ts @@ -1,4 +1,4 @@ -import { ExecutorContext, names } from '@nrwl/devkit'; +import { ExecutorContext, names } from '@nx/devkit'; import { join } from 'path'; import { ensureNodeModulesSymlink } from '../../utils/ensure-node-modules-symlink'; import { ChildProcess, fork } from 'child_process'; diff --git a/packages/react-native/src/executors/build-android/compat.ts b/packages/react-native/src/executors/build-android/compat.ts index 12465b9fe895c1..bc72a9a5a624c9 100644 --- a/packages/react-native/src/executors/build-android/compat.ts +++ b/packages/react-native/src/executors/build-android/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import buildAndroidExecutor from './build-android.impl'; diff --git a/packages/react-native/src/executors/build-ios/build-ios.impl.ts b/packages/react-native/src/executors/build-ios/build-ios.impl.ts index f2a36eb002023e..c2319fa297a448 100644 --- a/packages/react-native/src/executors/build-ios/build-ios.impl.ts +++ b/packages/react-native/src/executors/build-ios/build-ios.impl.ts @@ -1,4 +1,4 @@ -import { ExecutorContext } from '@nrwl/devkit'; +import { ExecutorContext } from '@nx/devkit'; import { join } from 'path'; import { ChildProcess, fork } from 'child_process'; import { platform } from 'os'; diff --git a/packages/react-native/src/executors/build-ios/compat.ts b/packages/react-native/src/executors/build-ios/compat.ts index 3803011250b707..9e5d0e5510d7f7 100644 --- a/packages/react-native/src/executors/build-ios/compat.ts +++ b/packages/react-native/src/executors/build-ios/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import buildIosExecutor from './build-ios.impl'; diff --git a/packages/react-native/src/executors/bundle/bundle.impl.ts b/packages/react-native/src/executors/bundle/bundle.impl.ts index 01a5d5a4767b13..42f4a9004465f3 100644 --- a/packages/react-native/src/executors/bundle/bundle.impl.ts +++ b/packages/react-native/src/executors/bundle/bundle.impl.ts @@ -1,5 +1,5 @@ -import { createDirectory } from '@nrwl/workspace/src/utilities/fileutils'; -import { names, ExecutorContext } from '@nrwl/devkit'; +import { createDirectory } from '@nx/workspace/src/utilities/fileutils'; +import { names, ExecutorContext } from '@nx/devkit'; import { dirname, join } from 'path'; import { ChildProcess, fork } from 'child_process'; diff --git a/packages/react-native/src/executors/bundle/compat.ts b/packages/react-native/src/executors/bundle/compat.ts index 5ee72ffcf7032a..18728208bdba7b 100644 --- a/packages/react-native/src/executors/bundle/compat.ts +++ b/packages/react-native/src/executors/bundle/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import bundleExecutor from './bundle.impl'; diff --git a/packages/react-native/src/executors/ensure-symlink/compat.ts b/packages/react-native/src/executors/ensure-symlink/compat.ts index 94c2df8239aa6a..2b1fbac1599191 100644 --- a/packages/react-native/src/executors/ensure-symlink/compat.ts +++ b/packages/react-native/src/executors/ensure-symlink/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import ensureSymlinkExecutor from './ensure-symlink.impl'; diff --git a/packages/react-native/src/executors/ensure-symlink/ensure-symlink.impl.ts b/packages/react-native/src/executors/ensure-symlink/ensure-symlink.impl.ts index f7cb5b66757530..bda508e47a0dc5 100644 --- a/packages/react-native/src/executors/ensure-symlink/ensure-symlink.impl.ts +++ b/packages/react-native/src/executors/ensure-symlink/ensure-symlink.impl.ts @@ -1,4 +1,4 @@ -import { ExecutorContext } from '@nrwl/devkit'; +import { ExecutorContext } from '@nx/devkit'; import { ensureNodeModulesSymlink } from '../../utils/ensure-node-modules-symlink'; export interface ReactNativeEnsureSymlinkOutput { diff --git a/packages/react-native/src/executors/pod-install/compat.ts b/packages/react-native/src/executors/pod-install/compat.ts index cc20f27361001c..d3b90a4005b332 100644 --- a/packages/react-native/src/executors/pod-install/compat.ts +++ b/packages/react-native/src/executors/pod-install/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import podInstall from './pod-install.impl'; diff --git a/packages/react-native/src/executors/pod-install/pod-install.impl.ts b/packages/react-native/src/executors/pod-install/pod-install.impl.ts index ec595c75b70ac8..c4a283fca05d4e 100644 --- a/packages/react-native/src/executors/pod-install/pod-install.impl.ts +++ b/packages/react-native/src/executors/pod-install/pod-install.impl.ts @@ -1,5 +1,5 @@ import { join } from 'path'; -import { ExecutorContext } from '@nrwl/devkit'; +import { ExecutorContext } from '@nx/devkit'; import { runPodInstall } from '../../utils/pod-install-task'; import { ReactNativePodInstallOptions } from './schema'; diff --git a/packages/react-native/src/executors/run-android/compat.ts b/packages/react-native/src/executors/run-android/compat.ts index 42e734a8a7adc9..3cc09a92e51a8f 100644 --- a/packages/react-native/src/executors/run-android/compat.ts +++ b/packages/react-native/src/executors/run-android/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import runAndroidExecutor from './run-android.impl'; diff --git a/packages/react-native/src/executors/run-android/run-android.impl.ts b/packages/react-native/src/executors/run-android/run-android.impl.ts index 006b6567151fa4..f4d3bff0858c3a 100644 --- a/packages/react-native/src/executors/run-android/run-android.impl.ts +++ b/packages/react-native/src/executors/run-android/run-android.impl.ts @@ -1,4 +1,4 @@ -import { ExecutorContext } from '@nrwl/devkit'; +import { ExecutorContext } from '@nx/devkit'; import { join } from 'path'; import { ChildProcess, fork } from 'child_process'; diff --git a/packages/react-native/src/executors/run-ios/compat.ts b/packages/react-native/src/executors/run-ios/compat.ts index df1ef7090fb7be..beedbf9d6067e5 100644 --- a/packages/react-native/src/executors/run-ios/compat.ts +++ b/packages/react-native/src/executors/run-ios/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import runIosExecutor from './run-ios.impl'; diff --git a/packages/react-native/src/executors/run-ios/run-ios.impl.ts b/packages/react-native/src/executors/run-ios/run-ios.impl.ts index 8150aa95055b9b..b7f86533886e19 100644 --- a/packages/react-native/src/executors/run-ios/run-ios.impl.ts +++ b/packages/react-native/src/executors/run-ios/run-ios.impl.ts @@ -1,4 +1,4 @@ -import { ExecutorContext, logger, names } from '@nrwl/devkit'; +import { ExecutorContext, logger, names } from '@nx/devkit'; import { join } from 'path'; import { ChildProcess, fork } from 'child_process'; import { platform } from 'os'; diff --git a/packages/react-native/src/executors/start/compat.ts b/packages/react-native/src/executors/start/compat.ts index dfc3aa7e71e14a..d0a895af818ad6 100644 --- a/packages/react-native/src/executors/start/compat.ts +++ b/packages/react-native/src/executors/start/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import startExecutor from './start.impl'; diff --git a/packages/react-native/src/executors/start/start.impl.ts b/packages/react-native/src/executors/start/start.impl.ts index e5eb20b14683f5..8155da595bdeb4 100644 --- a/packages/react-native/src/executors/start/start.impl.ts +++ b/packages/react-native/src/executors/start/start.impl.ts @@ -1,5 +1,5 @@ import * as chalk from 'chalk'; -import { ExecutorContext, logger } from '@nrwl/devkit'; +import { ExecutorContext, logger } from '@nx/devkit'; import { ChildProcess, fork } from 'child_process'; import { join } from 'path'; import { ensureNodeModulesSymlink } from '../../utils/ensure-node-modules-symlink'; diff --git a/packages/react-native/src/executors/storybook/compat.ts b/packages/react-native/src/executors/storybook/compat.ts index c279293d0cd582..9ed1507ccc038d 100644 --- a/packages/react-native/src/executors/storybook/compat.ts +++ b/packages/react-native/src/executors/storybook/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import storybookExecutor from './storybook.impl'; diff --git a/packages/react-native/src/executors/storybook/storybook.impl.ts b/packages/react-native/src/executors/storybook/storybook.impl.ts index 475cf7989b159b..e4cd0bfecee741 100644 --- a/packages/react-native/src/executors/storybook/storybook.impl.ts +++ b/packages/react-native/src/executors/storybook/storybook.impl.ts @@ -1,6 +1,6 @@ import { join } from 'path'; -import { ExecutorContext, logger } from '@nrwl/devkit'; -import { fileExists } from '@nrwl/workspace/src/utilities/fileutils'; +import { ExecutorContext, logger } from '@nx/devkit'; +import { fileExists } from '@nx/workspace/src/utilities/fileutils'; import * as chalk from 'chalk'; import { ReactNativeStorybookOptions } from './schema'; diff --git a/packages/react-native/src/executors/sync-deps/compat.ts b/packages/react-native/src/executors/sync-deps/compat.ts index 91634e4ee6cba6..a0a363f75c0eea 100644 --- a/packages/react-native/src/executors/sync-deps/compat.ts +++ b/packages/react-native/src/executors/sync-deps/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import syncDepsExecutor from './sync-deps.impl'; diff --git a/packages/react-native/src/executors/sync-deps/sync-deps.impl.ts b/packages/react-native/src/executors/sync-deps/sync-deps.impl.ts index 2eb1e3284a641a..c5a7529e348814 100644 --- a/packages/react-native/src/executors/sync-deps/sync-deps.impl.ts +++ b/packages/react-native/src/executors/sync-deps/sync-deps.impl.ts @@ -6,7 +6,7 @@ import { ProjectGraph, readJsonFile, writeJsonFile, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { findAllNpmDependencies } from '../../utils/find-all-npm-dependencies'; diff --git a/packages/react-native/src/generators/application/application.spec.ts b/packages/react-native/src/generators/application/application.spec.ts index fa7d98cbf92202..aa50f34e6be5bd 100644 --- a/packages/react-native/src/generators/application/application.spec.ts +++ b/packages/react-native/src/generators/application/application.spec.ts @@ -3,9 +3,9 @@ import { getProjects, readJson, readProjectConfiguration, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { Linter } from '@nrwl/linter'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { Linter } from '@nx/linter'; import { reactNativeApplicationGenerator } from './application'; describe('app', () => { diff --git a/packages/react-native/src/generators/application/application.ts b/packages/react-native/src/generators/application/application.ts index 53ebd0342b6de9..675316c061f495 100644 --- a/packages/react-native/src/generators/application/application.ts +++ b/packages/react-native/src/generators/application/application.ts @@ -7,7 +7,7 @@ import { joinPathFragments, runTasksInSerial, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { runPodInstall } from '../../utils/pod-install-task'; import { runSymlink } from '../../utils/symlink-task'; diff --git a/packages/react-native/src/generators/application/lib/add-detox.ts b/packages/react-native/src/generators/application/lib/add-detox.ts index ca2a0b22de0470..61cdc400cada17 100644 --- a/packages/react-native/src/generators/application/lib/add-detox.ts +++ b/packages/react-native/src/generators/application/lib/add-detox.ts @@ -1,7 +1,7 @@ -import { detoxApplicationGenerator } from '@nrwl/detox'; -import { Tree } from '@nrwl/devkit'; +import { detoxApplicationGenerator } from '@nx/detox'; +import { Tree } from '@nx/devkit'; import { NormalizedSchema } from './normalize-options'; -import { Linter } from '@nrwl/linter'; +import { Linter } from '@nx/linter'; export async function addDetox(host: Tree, options: NormalizedSchema) { if (options?.e2eTestRunner !== 'detox') { diff --git a/packages/react-native/src/generators/application/lib/add-project.ts b/packages/react-native/src/generators/application/lib/add-project.ts index 6e145b0387c85f..8599c86f6a8973 100644 --- a/packages/react-native/src/generators/application/lib/add-project.ts +++ b/packages/react-native/src/generators/application/lib/add-project.ts @@ -3,7 +3,7 @@ import { ProjectConfiguration, TargetConfiguration, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { NormalizedSchema } from './normalize-options'; export function addProject(host: Tree, options: NormalizedSchema) { diff --git a/packages/react-native/src/generators/application/lib/create-application-files.ts b/packages/react-native/src/generators/application/lib/create-application-files.ts index b8ae5b82200e0c..7451091e20b083 100644 --- a/packages/react-native/src/generators/application/lib/create-application-files.ts +++ b/packages/react-native/src/generators/application/lib/create-application-files.ts @@ -1,5 +1,5 @@ -import { generateFiles, offsetFromRoot, toJS, Tree } from '@nrwl/devkit'; -import { getRelativePathToRootTsConfig } from '@nrwl/js'; +import { generateFiles, offsetFromRoot, toJS, Tree } from '@nx/devkit'; +import { getRelativePathToRootTsConfig } from '@nx/js'; import { join } from 'path'; import { NormalizedSchema } from './normalize-options'; diff --git a/packages/react-native/src/generators/application/lib/nomalize-options.spec.ts b/packages/react-native/src/generators/application/lib/nomalize-options.spec.ts index 6b59b71012a01f..ffa7b03c8386e7 100644 --- a/packages/react-native/src/generators/application/lib/nomalize-options.spec.ts +++ b/packages/react-native/src/generators/application/lib/nomalize-options.spec.ts @@ -1,6 +1,6 @@ -import { Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { Linter } from '@nrwl/linter'; +import { Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { Linter } from '@nx/linter'; import { Schema } from '../schema'; import { normalizeOptions } from './normalize-options'; diff --git a/packages/react-native/src/generators/application/lib/normalize-options.ts b/packages/react-native/src/generators/application/lib/normalize-options.ts index fe9875404c51de..6df4942fa79f01 100644 --- a/packages/react-native/src/generators/application/lib/normalize-options.ts +++ b/packages/react-native/src/generators/application/lib/normalize-options.ts @@ -1,9 +1,4 @@ -import { - getWorkspaceLayout, - joinPathFragments, - names, - Tree, -} from '@nrwl/devkit'; +import { getWorkspaceLayout, joinPathFragments, names, Tree } from '@nx/devkit'; import { join } from 'path'; import { Schema } from '../schema'; diff --git a/packages/react-native/src/generators/application/schema.d.ts b/packages/react-native/src/generators/application/schema.d.ts index fe6bd88365e436..5d098dee362492 100644 --- a/packages/react-native/src/generators/application/schema.d.ts +++ b/packages/react-native/src/generators/application/schema.d.ts @@ -1,4 +1,4 @@ -import { Linter } from '@nrwl/linter'; +import { Linter } from '@nx/linter'; export interface Schema { name: string; diff --git a/packages/react-native/src/generators/component-story/component-story.spec.ts b/packages/react-native/src/generators/component-story/component-story.spec.ts index 9000bf3f367a58..98e532541ba4bc 100644 --- a/packages/react-native/src/generators/component-story/component-story.spec.ts +++ b/packages/react-native/src/generators/component-story/component-story.spec.ts @@ -1,7 +1,7 @@ -import { getProjects, Tree, updateProjectConfiguration } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { getProjects, Tree, updateProjectConfiguration } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import componentStoryGenerator from './component-story'; -import { Linter } from '@nrwl/linter'; +import { Linter } from '@nx/linter'; import { formatFile } from '../../utils/format-file'; import libraryGenerator from '../library/library'; diff --git a/packages/react-native/src/generators/component-story/component-story.ts b/packages/react-native/src/generators/component-story/component-story.ts index 8de859eda685d8..19e157ac994166 100644 --- a/packages/react-native/src/generators/component-story/component-story.ts +++ b/packages/react-native/src/generators/component-story/component-story.ts @@ -6,13 +6,13 @@ import { joinPathFragments, normalizePath, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import * as ts from 'typescript'; import { findExportDeclarationsForJsx, getComponentNode, getComponentPropsInterface, -} from '@nrwl/react/src/utils/ast-utils'; +} from '@nx/react/src/utils/ast-utils'; import { CreateComponentStoriesFileSchema } from './schema'; export function getArgsDefaultValue(property: ts.SyntaxKind): string { diff --git a/packages/react-native/src/generators/component/component.spec.ts b/packages/react-native/src/generators/component/component.spec.ts index d6b10a472d5ae3..351ff3ae088660 100644 --- a/packages/react-native/src/generators/component/component.spec.ts +++ b/packages/react-native/src/generators/component/component.spec.ts @@ -1,5 +1,5 @@ -import { logger, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { logger, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { createApp, createLib } from '../../utils/testing-generators'; import { reactNativeComponentGenerator } from './component'; diff --git a/packages/react-native/src/generators/component/component.ts b/packages/react-native/src/generators/component/component.ts index 962162ddc7807f..2bfa9eb0cfc0c3 100644 --- a/packages/react-native/src/generators/component/component.ts +++ b/packages/react-native/src/generators/component/component.ts @@ -8,10 +8,10 @@ import { joinPathFragments, toJS, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { NormalizedSchema, normalizeOptions } from './lib/normalize-options'; import { addImport } from './lib/add-import'; -import { ensureTypescript } from '@nrwl/js/src/utils/typescript/ensure-typescript'; +import { ensureTypescript } from '@nx/js/src/utils/typescript/ensure-typescript'; export async function reactNativeComponentGenerator( host: Tree, diff --git a/packages/react-native/src/generators/component/lib/add-import.ts b/packages/react-native/src/generators/component/lib/add-import.ts index 46035d9023be93..ef5581e836ea4b 100644 --- a/packages/react-native/src/generators/component/lib/add-import.ts +++ b/packages/react-native/src/generators/component/lib/add-import.ts @@ -1,7 +1,7 @@ import { findNodes } from 'nx/src/utils/typescript'; import type * as ts from 'typescript'; -import { ChangeType, StringChange } from '@nrwl/devkit'; -import { ensureTypescript } from '@nrwl/js/src/utils/typescript/ensure-typescript'; +import { ChangeType, StringChange } from '@nx/devkit'; +import { ensureTypescript } from '@nx/js/src/utils/typescript/ensure-typescript'; let tsModule: typeof import('typescript'); export function addImport( diff --git a/packages/react-native/src/generators/component/lib/normalize-options.ts b/packages/react-native/src/generators/component/lib/normalize-options.ts index 23bc23c724f43a..186af0ed55f644 100644 --- a/packages/react-native/src/generators/component/lib/normalize-options.ts +++ b/packages/react-native/src/generators/component/lib/normalize-options.ts @@ -4,7 +4,7 @@ import { logger, names, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { Schema } from '../schema'; export interface NormalizedSchema extends Schema { diff --git a/packages/react-native/src/generators/init/init.spec.ts b/packages/react-native/src/generators/init/init.spec.ts index 843d25e7458df4..70d7648a27a6f6 100644 --- a/packages/react-native/src/generators/init/init.spec.ts +++ b/packages/react-native/src/generators/init/init.spec.ts @@ -1,6 +1,6 @@ -import { NxJsonConfiguration } from '@nrwl/devkit'; -import { Tree, readJson, updateJson } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { NxJsonConfiguration } from '@nx/devkit'; +import { Tree, readJson, updateJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { reactNativeInitGenerator } from './init'; describe('init', () => { diff --git a/packages/react-native/src/generators/init/init.ts b/packages/react-native/src/generators/init/init.ts index 7ef377e2160830..6c0a7c7b1c2fe5 100644 --- a/packages/react-native/src/generators/init/init.ts +++ b/packages/react-native/src/generators/init/init.ts @@ -7,14 +7,14 @@ import { removeDependenciesFromPackageJson, runTasksInSerial, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { Schema } from './schema'; -import { addBabelInputs } from '@nrwl/js/src/utils/add-babel-inputs'; -import { jestInitGenerator } from '@nrwl/jest'; -import { detoxInitGenerator } from '@nrwl/detox'; -import { babelPresetReactVersion } from '@nrwl/react/src/utils/versions'; -import { initGenerator as jsInitGenerator } from '@nrwl/js'; +import { addBabelInputs } from '@nx/js/src/utils/add-babel-inputs'; +import { jestInitGenerator } from '@nx/jest'; +import { detoxInitGenerator } from '@nx/detox'; +import { babelPresetReactVersion } from '@nx/react/src/utils/versions'; +import { initGenerator as jsInitGenerator } from '@nx/js'; import { babelRuntimeVersion, diff --git a/packages/react-native/src/generators/init/lib/add-git-ignore-entry.ts b/packages/react-native/src/generators/init/lib/add-git-ignore-entry.ts index d22015fb9bbbc8..b493f40c023bcd 100644 --- a/packages/react-native/src/generators/init/lib/add-git-ignore-entry.ts +++ b/packages/react-native/src/generators/init/lib/add-git-ignore-entry.ts @@ -1,4 +1,4 @@ -import { logger, Tree } from '@nrwl/devkit'; +import { logger, Tree } from '@nx/devkit'; import ignore from 'ignore'; import { gitIgnoreEntriesForReactNative } from './gitignore-entries'; diff --git a/packages/react-native/src/generators/library/lib/normalize-options.ts b/packages/react-native/src/generators/library/lib/normalize-options.ts index 37d0f18a53cd9c..8cb2245ef68b16 100644 --- a/packages/react-native/src/generators/library/lib/normalize-options.ts +++ b/packages/react-native/src/generators/library/lib/normalize-options.ts @@ -1,9 +1,4 @@ -import { - getWorkspaceLayout, - joinPathFragments, - names, - Tree, -} from '@nrwl/devkit'; +import { getWorkspaceLayout, joinPathFragments, names, Tree } from '@nx/devkit'; import { getImportPath } from 'nx/src/utils/path'; import { Schema } from '../schema'; diff --git a/packages/react-native/src/generators/library/library.spec.ts b/packages/react-native/src/generators/library/library.spec.ts index 0a1f273ebb592e..fa02cf2e9dbfd5 100644 --- a/packages/react-native/src/generators/library/library.spec.ts +++ b/packages/react-native/src/generators/library/library.spec.ts @@ -3,10 +3,10 @@ import { readProjectConfiguration, Tree, updateJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import libraryGenerator from './library'; -import { Linter } from '@nrwl/linter'; +import { Linter } from '@nx/linter'; import { Schema } from './schema'; describe('lib', () => { diff --git a/packages/react-native/src/generators/library/library.ts b/packages/react-native/src/generators/library/library.ts index 13e75be167aeb0..9c36142754de1f 100644 --- a/packages/react-native/src/generators/library/library.ts +++ b/packages/react-native/src/generators/library/library.ts @@ -13,9 +13,9 @@ import { toJS, Tree, updateJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; -import { addTsConfigPath, getRelativePathToRootTsConfig } from '@nrwl/js'; +import { addTsConfigPath, getRelativePathToRootTsConfig } from '@nx/js'; import init from '../init/init'; import { addLinting } from '../../utils/add-linting'; import { addJest } from '../../utils/add-jest'; diff --git a/packages/react-native/src/generators/library/schema.d.ts b/packages/react-native/src/generators/library/schema.d.ts index 4533284be4cd75..3046620cb011cf 100644 --- a/packages/react-native/src/generators/library/schema.d.ts +++ b/packages/react-native/src/generators/library/schema.d.ts @@ -1,4 +1,4 @@ -import { Linter } from '@nrwl/linter'; +import { Linter } from '@nx/linter'; /** * Same as the @nrwl/react library schema, except it removes keys: style, component, routing, appProject diff --git a/packages/react-native/src/generators/stories/stories-app.spec.ts b/packages/react-native/src/generators/stories/stories-app.spec.ts index e5128edae299cc..ea65b6618770ec 100644 --- a/packages/react-native/src/generators/stories/stories-app.spec.ts +++ b/packages/react-native/src/generators/stories/stories-app.spec.ts @@ -1,8 +1,8 @@ -import { Tree } from '@nrwl/devkit'; +import { Tree } from '@nx/devkit'; import storiesGenerator from './stories'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import applicationGenerator from '../application/application'; -import { Linter } from '@nrwl/linter'; +import { Linter } from '@nx/linter'; import { reactNativeComponentGenerator } from '../component/component'; describe('react:stories for applications', () => { diff --git a/packages/react-native/src/generators/stories/stories-lib.spec.ts b/packages/react-native/src/generators/stories/stories-lib.spec.ts index 525f2b8c138115..ddabca41f58fc2 100644 --- a/packages/react-native/src/generators/stories/stories-lib.spec.ts +++ b/packages/react-native/src/generators/stories/stories-lib.spec.ts @@ -1,8 +1,8 @@ -import { Tree } from '@nrwl/devkit'; +import { Tree } from '@nx/devkit'; import storiesGenerator from './stories'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import applicationGenerator from '../application/application'; -import { Linter } from '@nrwl/linter'; +import { Linter } from '@nx/linter'; import libraryGenerator from '../library/library'; import reactNativeComponentGenerator from '../component/component'; diff --git a/packages/react-native/src/generators/stories/stories.ts b/packages/react-native/src/generators/stories/stories.ts index 56879fdddc0682..8ddc53eca34734 100644 --- a/packages/react-native/src/generators/stories/stories.ts +++ b/packages/react-native/src/generators/stories/stories.ts @@ -5,14 +5,14 @@ import { getProjects, Tree, visitNotIgnoredFiles, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { join } from 'path'; import componentStoryGenerator from '../component-story/component-story'; import { StorybookStoriesSchema } from './schema'; import { containsComponentDeclaration, projectRootPath, -} from '@nrwl/react/src/generators/stories/stories'; +} from '@nx/react/src/generators/stories/stories'; import minimatch = require('minimatch'); import { nxVersion } from '../../utils/versions'; @@ -21,10 +21,8 @@ export async function createAllStories( projectName: string, ignorePaths?: string[] ) { - ensurePackage('@nrwl/storybook', nxVersion); - const { isTheFileAStory } = await import( - '@nrwl/storybook/src/utils/utilities' - ); + ensurePackage('@nx/storybook', nxVersion); + const { isTheFileAStory } = await import('@nx/storybook/src/utils/utilities'); const projects = getProjects(tree); const projectConfiguration = projects.get(projectName); diff --git a/packages/react-native/src/generators/storybook-configuration/configuration.spec.ts b/packages/react-native/src/generators/storybook-configuration/configuration.spec.ts index bf8bf982debab5..9062afc948d072 100644 --- a/packages/react-native/src/generators/storybook-configuration/configuration.spec.ts +++ b/packages/react-native/src/generators/storybook-configuration/configuration.spec.ts @@ -1,7 +1,7 @@ -import { Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { Linter } from '@nrwl/linter'; -import { logger } from '@nrwl/devkit'; +import { Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { Linter } from '@nx/linter'; +import { logger } from '@nx/devkit'; import libraryGenerator from '../library/library'; import applicationGenerator from '../application/application'; diff --git a/packages/react-native/src/generators/storybook-configuration/configuration.ts b/packages/react-native/src/generators/storybook-configuration/configuration.ts index bac077419d4fe6..df1c02197b472e 100644 --- a/packages/react-native/src/generators/storybook-configuration/configuration.ts +++ b/packages/react-native/src/generators/storybook-configuration/configuration.ts @@ -6,7 +6,7 @@ import { readProjectConfiguration, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { nxVersion } from '../../utils/versions'; import storiesGenerator from '../stories/stories'; @@ -29,8 +29,8 @@ export async function storybookConfigurationGenerator( schema: StorybookConfigureSchema ): Promise { const { configurationGenerator } = ensurePackage< - typeof import('@nrwl/storybook') - >('@nrwl/storybook', nxVersion); + typeof import('@nx/storybook') + >('@nx/storybook', nxVersion); const installTask = await configurationGenerator(host, { name: schema.name, diff --git a/packages/react-native/src/generators/storybook-configuration/lib/add-resolver-main-fields-to-metro-config.spec.ts b/packages/react-native/src/generators/storybook-configuration/lib/add-resolver-main-fields-to-metro-config.spec.ts index d1ff8fd3aebbcd..e6481c1f04d674 100644 --- a/packages/react-native/src/generators/storybook-configuration/lib/add-resolver-main-fields-to-metro-config.spec.ts +++ b/packages/react-native/src/generators/storybook-configuration/lib/add-resolver-main-fields-to-metro-config.spec.ts @@ -1,5 +1,5 @@ -import { addProjectConfiguration, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { addProjectConfiguration, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { formatFile } from '../../../utils/format-file'; @@ -21,7 +21,7 @@ describe('addResolverMainFieldsToMetroConfig', () => { tree.write( 'apps/products/metro.config.js', formatFile` -const { withNxMetro } = require('@nrwl/react-native'); +const { withNxMetro } = require('@nx/react-native'); const { getDefaultConfig } = require('metro-config'); const exclusionList = require('metro-config/src/defaults/exclusionList'); @@ -58,7 +58,7 @@ module.exports = (async () => { formatFile`${tree.read('apps/products/metro.config.js', 'utf-8')}` ).toEqual( formatFile` -const { withNxMetro } = require('@nrwl/react-native'); +const { withNxMetro } = require('@nx/react-native'); const { getDefaultConfig } = require('metro-config'); const exclusionList = require('metro-config/src/defaults/exclusionList'); @@ -93,7 +93,7 @@ module.exports = (async () => { tree.write( 'apps/products/metro.config.js', ` -const { withNxMetro } = require('@nrwl/react-native'); +const { withNxMetro } = require('@nx/react-native'); const { getDefaultConfig } = require('metro-config'); module.exports = (async () => { @@ -128,7 +128,7 @@ module.exports = (async () => { expect(tree.read('apps/products/metro.config.js', 'utf-8')).toEqual( ` -const { withNxMetro } = require('@nrwl/react-native'); +const { withNxMetro } = require('@nx/react-native'); const { getDefaultConfig } = require('metro-config'); module.exports = (async () => { diff --git a/packages/react-native/src/generators/storybook-configuration/lib/add-resolver-main-fields-to-metro-config.ts b/packages/react-native/src/generators/storybook-configuration/lib/add-resolver-main-fields-to-metro-config.ts index 93bd0bf53c8e15..5f0f049b140888 100644 --- a/packages/react-native/src/generators/storybook-configuration/lib/add-resolver-main-fields-to-metro-config.ts +++ b/packages/react-native/src/generators/storybook-configuration/lib/add-resolver-main-fields-to-metro-config.ts @@ -3,7 +3,7 @@ import { readProjectConfiguration, stripIndents, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { join } from 'path'; import { StorybookConfigureSchema } from '../schema'; diff --git a/packages/react-native/src/generators/storybook-configuration/lib/create-storybook-files.ts b/packages/react-native/src/generators/storybook-configuration/lib/create-storybook-files.ts index 0bcb4ae9921ab3..1cfd7a253ab880 100644 --- a/packages/react-native/src/generators/storybook-configuration/lib/create-storybook-files.ts +++ b/packages/react-native/src/generators/storybook-configuration/lib/create-storybook-files.ts @@ -5,7 +5,7 @@ import { readProjectConfiguration, toJS, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { join } from 'path'; import * as chalk from 'chalk'; diff --git a/packages/react-native/src/generators/storybook-configuration/lib/replace-app-import-with-storybook-toggle.spec.ts b/packages/react-native/src/generators/storybook-configuration/lib/replace-app-import-with-storybook-toggle.spec.ts index 14fcb46157a48d..280036b82d233a 100644 --- a/packages/react-native/src/generators/storybook-configuration/lib/replace-app-import-with-storybook-toggle.spec.ts +++ b/packages/react-native/src/generators/storybook-configuration/lib/replace-app-import-with-storybook-toggle.spec.ts @@ -1,5 +1,5 @@ -import { addProjectConfiguration, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { addProjectConfiguration, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { formatFile } from '../../../utils/format-file'; diff --git a/packages/react-native/src/generators/storybook-configuration/lib/replace-app-import-with-storybook-toggle.ts b/packages/react-native/src/generators/storybook-configuration/lib/replace-app-import-with-storybook-toggle.ts index 0f624be606db7a..9740ccc1e12335 100644 --- a/packages/react-native/src/generators/storybook-configuration/lib/replace-app-import-with-storybook-toggle.ts +++ b/packages/react-native/src/generators/storybook-configuration/lib/replace-app-import-with-storybook-toggle.ts @@ -3,7 +3,7 @@ import { readProjectConfiguration, stripIndents, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { join } from 'path'; import { StorybookConfigureSchema } from '../schema'; diff --git a/packages/react-native/src/generators/storybook-configuration/schema.d.ts b/packages/react-native/src/generators/storybook-configuration/schema.d.ts index aff6812b038959..74cb2eb7356302 100644 --- a/packages/react-native/src/generators/storybook-configuration/schema.d.ts +++ b/packages/react-native/src/generators/storybook-configuration/schema.d.ts @@ -1,4 +1,4 @@ -import { Linter } from '@nrwl/linter'; +import { Linter } from '@nx/linter'; export interface StorybookConfigureSchema { name: string; diff --git a/packages/react-native/src/generators/upgrade-native/lib/create-native-files.ts b/packages/react-native/src/generators/upgrade-native/lib/create-native-files.ts index 1378ec6c0e43b8..b1f3a20eabc904 100644 --- a/packages/react-native/src/generators/upgrade-native/lib/create-native-files.ts +++ b/packages/react-native/src/generators/upgrade-native/lib/create-native-files.ts @@ -1,4 +1,4 @@ -import { generateFiles, joinPathFragments, Tree } from '@nrwl/devkit'; +import { generateFiles, joinPathFragments, Tree } from '@nx/devkit'; import { join } from 'path'; import { normalizeOptions } from './normalize-options'; diff --git a/packages/react-native/src/generators/upgrade-native/lib/normalize-options.ts b/packages/react-native/src/generators/upgrade-native/lib/normalize-options.ts index d47e76fe99bca9..2287aaaab0352f 100644 --- a/packages/react-native/src/generators/upgrade-native/lib/normalize-options.ts +++ b/packages/react-native/src/generators/upgrade-native/lib/normalize-options.ts @@ -1,4 +1,4 @@ -import { names, offsetFromRoot } from '@nrwl/devkit'; +import { names, offsetFromRoot } from '@nx/devkit'; import { UpgradeNativeConfigureSchema } from '../schema'; export interface NormalizedSchema { diff --git a/packages/react-native/src/generators/upgrade-native/schema.d.ts b/packages/react-native/src/generators/upgrade-native/schema.d.ts index 8962cc481925b3..dd8403a234a5e3 100644 --- a/packages/react-native/src/generators/upgrade-native/schema.d.ts +++ b/packages/react-native/src/generators/upgrade-native/schema.d.ts @@ -1,4 +1,4 @@ -import { Linter } from '@nrwl/linter'; +import { Linter } from '@nx/linter'; export interface UpgradeNativeConfigureSchema { name: string; diff --git a/packages/react-native/src/generators/upgrade-native/upgrade-native.ts b/packages/react-native/src/generators/upgrade-native/upgrade-native.ts index 438a952ea0ca8c..4e5d5620d4e96a 100644 --- a/packages/react-native/src/generators/upgrade-native/upgrade-native.ts +++ b/packages/react-native/src/generators/upgrade-native/upgrade-native.ts @@ -10,7 +10,7 @@ import { readProjectConfiguration, runTasksInSerial, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { existsSync } from 'fs'; import { runPodInstall } from '../../utils/pod-install-task'; diff --git a/packages/react-native/src/migrations/update-12-10-0/add-react-native-svg-12-10-0.spec.ts b/packages/react-native/src/migrations/update-12-10-0/add-react-native-svg-12-10-0.spec.ts index 5f3b8979332bf1..05478802349faa 100644 --- a/packages/react-native/src/migrations/update-12-10-0/add-react-native-svg-12-10-0.spec.ts +++ b/packages/react-native/src/migrations/update-12-10-0/add-react-native-svg-12-10-0.spec.ts @@ -1,5 +1,5 @@ -import { addProjectConfiguration, readJson, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { addProjectConfiguration, readJson, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { reactNativeSvgTransformerVersion, reactNativeSvgVersion, diff --git a/packages/react-native/src/migrations/update-12-10-0/add-react-native-svg-12-10-0.ts b/packages/react-native/src/migrations/update-12-10-0/add-react-native-svg-12-10-0.ts index c8ca620213d44a..077767ba041651 100644 --- a/packages/react-native/src/migrations/update-12-10-0/add-react-native-svg-12-10-0.ts +++ b/packages/react-native/src/migrations/update-12-10-0/add-react-native-svg-12-10-0.ts @@ -7,7 +7,7 @@ import { ProjectConfiguration, logger, stripIndents, -} from '@nrwl/devkit'; +} from '@nx/devkit'; /** * Add support to display svg in react native: diff --git a/packages/react-native/src/migrations/update-12-5-0/update-jest-for-react-native.ts b/packages/react-native/src/migrations/update-12-5-0/update-jest-for-react-native.ts index f071494ffac689..18ce967355f4fa 100644 --- a/packages/react-native/src/migrations/update-12-5-0/update-jest-for-react-native.ts +++ b/packages/react-native/src/migrations/update-12-5-0/update-jest-for-react-native.ts @@ -4,10 +4,10 @@ import { readProjectConfiguration, stripIndents, Tree, -} from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; +} from '@nx/devkit'; +import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils'; import { join } from 'path'; -import { JestExecutorOptions } from '@nrwl/jest/src/executors/jest/schema'; +import { JestExecutorOptions } from '@nx/jest/src/executors/jest/schema'; /** * This function update jest.config.js and test.setup.ts for react native project for Jest 27. diff --git a/packages/react-native/src/migrations/update-13-5-0/add-babel-config-root-13-5-0.spec.ts b/packages/react-native/src/migrations/update-13-5-0/add-babel-config-root-13-5-0.spec.ts index a797776c713085..2a4d0484de1589 100644 --- a/packages/react-native/src/migrations/update-13-5-0/add-babel-config-root-13-5-0.spec.ts +++ b/packages/react-native/src/migrations/update-13-5-0/add-babel-config-root-13-5-0.spec.ts @@ -1,5 +1,5 @@ -import { addProjectConfiguration, readJson, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { addProjectConfiguration, readJson, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import update from './add-babel-config-root-13-5-0'; describe('Add react-native-svg to dev dependencies', () => { diff --git a/packages/react-native/src/migrations/update-13-5-0/add-babel-config-root-13-5-0.ts b/packages/react-native/src/migrations/update-13-5-0/add-babel-config-root-13-5-0.ts index 177ccd2a0630ef..a8363a35398763 100644 --- a/packages/react-native/src/migrations/update-13-5-0/add-babel-config-root-13-5-0.ts +++ b/packages/react-native/src/migrations/update-13-5-0/add-babel-config-root-13-5-0.ts @@ -1,5 +1,5 @@ -import { formatFiles, getProjects, Tree } from '@nrwl/devkit'; -import { addBabelInputs } from '@nrwl/js/src/utils/add-babel-inputs'; +import { formatFiles, getProjects, Tree } from '@nx/devkit'; +import { addBabelInputs } from '@nx/js/src/utils/add-babel-inputs'; export default async function update(tree: Tree) { const projects = getProjects(tree); diff --git a/packages/react-native/src/migrations/update-13-5-0/update-react-native-typing-svg-13-5-0.spec.ts b/packages/react-native/src/migrations/update-13-5-0/update-react-native-typing-svg-13-5-0.spec.ts index 46221b4e115a8e..3ec1e7e9f85089 100644 --- a/packages/react-native/src/migrations/update-13-5-0/update-react-native-typing-svg-13-5-0.spec.ts +++ b/packages/react-native/src/migrations/update-13-5-0/update-react-native-typing-svg-13-5-0.spec.ts @@ -1,5 +1,5 @@ -import { addProjectConfiguration, readJson, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { addProjectConfiguration, readJson, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import update from './update-react-native-typing-svg-13-5-0'; describe('Update svg typings in tsconfig for react native app', () => { diff --git a/packages/react-native/src/migrations/update-13-5-0/update-react-native-typing-svg-13-5-0.ts b/packages/react-native/src/migrations/update-13-5-0/update-react-native-typing-svg-13-5-0.ts index 68f8faf0692eca..fd1972f2c788d1 100644 --- a/packages/react-native/src/migrations/update-13-5-0/update-react-native-typing-svg-13-5-0.ts +++ b/packages/react-native/src/migrations/update-13-5-0/update-react-native-typing-svg-13-5-0.ts @@ -5,7 +5,7 @@ import { updateJson, offsetFromRoot, ProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; /** * Update svg typings in tsconfig for react native app diff --git a/packages/react-native/src/migrations/update-14-0-0/add-project-root-metro-config-14-0-0.spec.ts b/packages/react-native/src/migrations/update-14-0-0/add-project-root-metro-config-14-0-0.spec.ts index 846a0b67d4c0fe..5ca8fecf603656 100644 --- a/packages/react-native/src/migrations/update-14-0-0/add-project-root-metro-config-14-0-0.spec.ts +++ b/packages/react-native/src/migrations/update-14-0-0/add-project-root-metro-config-14-0-0.spec.ts @@ -1,5 +1,5 @@ -import { addProjectConfiguration, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { addProjectConfiguration, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import update from './add-project-root-metro-config-14-0-0'; @@ -26,7 +26,7 @@ describe('Add projectRoot option in metro.config.js', () => { tree.write( 'apps/products/metro.config.js', ` -const { withNxMetro } = require('@nrwl/react-native'); +const { withNxMetro } = require('@nx/react-native'); const { getDefaultConfig } = require('metro-config'); module.exports = (async () => { @@ -66,7 +66,7 @@ module.exports = (async () => { expect(tree.read('apps/products/metro.config.js', 'utf-8')) .toMatchInlineSnapshot(` - "const { withNxMetro } = require('@nrwl/react-native'); + "const { withNxMetro } = require('@nx/react-native'); const { getDefaultConfig } = require('metro-config'); module.exports = (async () => { @@ -110,7 +110,7 @@ module.exports = (async () => { tree.write( 'apps/products/metro.config.js', ` -const { withNxMetro } = require('@nrwl/react-native'); +const { withNxMetro } = require('@nx/react-native'); const { getDefaultConfig } = require('metro-config'); module.exports = (async () => { @@ -151,7 +151,7 @@ module.exports = (async () => { expect(tree.read('apps/products/metro.config.js', 'utf-8')) .toMatchInlineSnapshot(` - "const { withNxMetro } = require('@nrwl/react-native'); + "const { withNxMetro } = require('@nx/react-native'); const { getDefaultConfig } = require('metro-config'); module.exports = (async () => { diff --git a/packages/react-native/src/migrations/update-14-0-0/add-project-root-metro-config-14-0-0.ts b/packages/react-native/src/migrations/update-14-0-0/add-project-root-metro-config-14-0-0.ts index 839272174459ef..d50532537cc07e 100644 --- a/packages/react-native/src/migrations/update-14-0-0/add-project-root-metro-config-14-0-0.ts +++ b/packages/react-native/src/migrations/update-14-0-0/add-project-root-metro-config-14-0-0.ts @@ -4,7 +4,7 @@ import { logger, stripIndents, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; /** * Add projectRoot and watchFolders options in metro.config.js diff --git a/packages/react-native/src/migrations/update-14-0-0/update-entry-file-bundle-14-0-0.spec.ts b/packages/react-native/src/migrations/update-14-0-0/update-entry-file-bundle-14-0-0.spec.ts index c422aa00db0fc1..f550d26fb04672 100644 --- a/packages/react-native/src/migrations/update-14-0-0/update-entry-file-bundle-14-0-0.spec.ts +++ b/packages/react-native/src/migrations/update-14-0-0/update-entry-file-bundle-14-0-0.spec.ts @@ -1,5 +1,5 @@ -import { addProjectConfiguration, Tree, getProjects } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { addProjectConfiguration, Tree, getProjects } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import update from './update-entry-file-bundle-14-0-0'; diff --git a/packages/react-native/src/migrations/update-14-0-0/update-entry-file-bundle-14-0-0.ts b/packages/react-native/src/migrations/update-14-0-0/update-entry-file-bundle-14-0-0.ts index 01ff3dab4ec032..b353e2c5479171 100644 --- a/packages/react-native/src/migrations/update-14-0-0/update-entry-file-bundle-14-0-0.ts +++ b/packages/react-native/src/migrations/update-14-0-0/update-entry-file-bundle-14-0-0.ts @@ -3,7 +3,7 @@ import { getProjects, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { join } from 'path'; /** diff --git a/packages/react-native/src/migrations/update-14-0-2/change-main-to-class-name-14-0-2.spec.ts b/packages/react-native/src/migrations/update-14-0-2/change-main-to-class-name-14-0-2.spec.ts index 71a040b82ff2c6..4aa0a71aee4369 100644 --- a/packages/react-native/src/migrations/update-14-0-2/change-main-to-class-name-14-0-2.spec.ts +++ b/packages/react-native/src/migrations/update-14-0-2/change-main-to-class-name-14-0-2.spec.ts @@ -1,5 +1,5 @@ -import { addProjectConfiguration, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { addProjectConfiguration, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import update from './change-main-to-class-name-14-0-2'; diff --git a/packages/react-native/src/migrations/update-14-0-2/change-main-to-class-name-14-0-2.ts b/packages/react-native/src/migrations/update-14-0-2/change-main-to-class-name-14-0-2.ts index 3fcb3378cde84b..0579cca832a040 100644 --- a/packages/react-native/src/migrations/update-14-0-2/change-main-to-class-name-14-0-2.ts +++ b/packages/react-native/src/migrations/update-14-0-2/change-main-to-class-name-14-0-2.ts @@ -5,7 +5,7 @@ import { names, stripIndents, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { join } from 'path'; /** diff --git a/packages/react-native/src/migrations/update-14-2-1/rename-blockList-metro-config.spec.ts b/packages/react-native/src/migrations/update-14-2-1/rename-blockList-metro-config.spec.ts index c3b1a7ee0b07a6..3ef5749c3cd90d 100644 --- a/packages/react-native/src/migrations/update-14-2-1/rename-blockList-metro-config.spec.ts +++ b/packages/react-native/src/migrations/update-14-2-1/rename-blockList-metro-config.spec.ts @@ -1,5 +1,5 @@ -import { addProjectConfiguration, Tree, getProjects } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { addProjectConfiguration, Tree, getProjects } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import update from './rename-blockList-metro-config'; @@ -26,7 +26,7 @@ describe('Rename blacklistRE to blockList in metro.config.js for react native ap tree.write( 'apps/products/metro.config.js', ` -const { withNxMetro } = require('@nrwl/react-native'); +const { withNxMetro } = require('@nx/react-native'); const { getDefaultConfig } = require('metro-config'); module.exports = (async () => { @@ -66,7 +66,7 @@ module.exports = (async () => { await update(tree); expect(tree.read('apps/products/metro.config.js', 'utf-8')).toEqual(` -const { withNxMetro } = require('@nrwl/react-native'); +const { withNxMetro } = require('@nx/react-native'); const { getDefaultConfig } = require('metro-config'); module.exports = (async () => { @@ -108,7 +108,7 @@ module.exports = (async () => { tree.write( 'apps/products/metro.config.js', ` -const { withNxMetro } = require('@nrwl/react-native'); +const { withNxMetro } = require('@nx/react-native'); const { getDefaultConfig } = require('metro-config'); module.exports = (async () => { @@ -149,7 +149,7 @@ module.exports = (async () => { expect(tree.read('apps/products/metro.config.js', 'utf-8')) .toMatchInlineSnapshot(` - "const { withNxMetro } = require('@nrwl/react-native'); + "const { withNxMetro } = require('@nx/react-native'); const { getDefaultConfig } = require('metro-config'); module.exports = (async () => { diff --git a/packages/react-native/src/migrations/update-14-2-1/rename-blockList-metro-config.ts b/packages/react-native/src/migrations/update-14-2-1/rename-blockList-metro-config.ts index 589b63e855872d..f383bfe6287d0b 100644 --- a/packages/react-native/src/migrations/update-14-2-1/rename-blockList-metro-config.ts +++ b/packages/react-native/src/migrations/update-14-2-1/rename-blockList-metro-config.ts @@ -4,7 +4,7 @@ import { logger, stripIndents, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; /** * Rename blacklistRE to blockList in metro.config.js diff --git a/packages/react-native/src/migrations/update-14-5-5/add-exclude-sync-deps.spec.ts b/packages/react-native/src/migrations/update-14-5-5/add-exclude-sync-deps.spec.ts index d604ba131e14c6..5cc579354ad031 100644 --- a/packages/react-native/src/migrations/update-14-5-5/add-exclude-sync-deps.spec.ts +++ b/packages/react-native/src/migrations/update-14-5-5/add-exclude-sync-deps.spec.ts @@ -2,8 +2,8 @@ import { addProjectConfiguration, readProjectConfiguration, Tree, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import update from './add-exclude-sync-deps'; describe('add-exclude-sync-deps', () => { diff --git a/packages/react-native/src/migrations/update-14-5-5/add-exclude-sync-deps.ts b/packages/react-native/src/migrations/update-14-5-5/add-exclude-sync-deps.ts index d08f4fef2be0e3..d41f60da8d439b 100644 --- a/packages/react-native/src/migrations/update-14-5-5/add-exclude-sync-deps.ts +++ b/packages/react-native/src/migrations/update-14-5-5/add-exclude-sync-deps.ts @@ -3,7 +3,7 @@ import { getProjects, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; /** * This function changes include field from string to array for sync-deps target diff --git a/packages/react-native/src/migrations/update-14-5-8/change-searchDir-storybook.spec.ts b/packages/react-native/src/migrations/update-14-5-8/change-searchDir-storybook.spec.ts index 5ced57091a409d..1fba4f3de1ef57 100644 --- a/packages/react-native/src/migrations/update-14-5-8/change-searchDir-storybook.spec.ts +++ b/packages/react-native/src/migrations/update-14-5-8/change-searchDir-storybook.spec.ts @@ -2,8 +2,8 @@ import { addProjectConfiguration, readProjectConfiguration, Tree, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import update from './change-searchDir-storybook'; describe('change-searchDir-storybook', () => { diff --git a/packages/react-native/src/migrations/update-14-5-8/change-searchDir-storybook.ts b/packages/react-native/src/migrations/update-14-5-8/change-searchDir-storybook.ts index 0767b06b525ce7..e643841124b147 100644 --- a/packages/react-native/src/migrations/update-14-5-8/change-searchDir-storybook.ts +++ b/packages/react-native/src/migrations/update-14-5-8/change-searchDir-storybook.ts @@ -3,7 +3,7 @@ import { getProjects, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; /** * This function changes searchDir field from string to array for storybook target diff --git a/packages/react-native/src/migrations/update-14-6-0/remove-jest-transform.spec.ts b/packages/react-native/src/migrations/update-14-6-0/remove-jest-transform.spec.ts index 8c9579b5187c10..7e1785c227687e 100644 --- a/packages/react-native/src/migrations/update-14-6-0/remove-jest-transform.spec.ts +++ b/packages/react-native/src/migrations/update-14-6-0/remove-jest-transform.spec.ts @@ -1,5 +1,5 @@ -import { addProjectConfiguration, readJson, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { addProjectConfiguration, readJson, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import update from './remove-jest-transform'; describe('Rename jest preprocessor', () => { diff --git a/packages/react-native/src/migrations/update-14-6-0/remove-jest-transform.ts b/packages/react-native/src/migrations/update-14-6-0/remove-jest-transform.ts index b4425ceb0013b2..178087068427e4 100644 --- a/packages/react-native/src/migrations/update-14-6-0/remove-jest-transform.ts +++ b/packages/react-native/src/migrations/update-14-6-0/remove-jest-transform.ts @@ -5,10 +5,10 @@ import { readProjectConfiguration, stripIndents, Tree, -} from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; -import { removePropertyFromJestConfig } from '@nrwl/jest'; -import { JestExecutorOptions } from '@nrwl/jest/src/executors/jest/schema'; +} from '@nx/devkit'; +import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils'; +import { removePropertyFromJestConfig } from '@nx/jest'; +import { JestExecutorOptions } from '@nx/jest/src/executors/jest/schema'; import { join } from 'path'; /** diff --git a/packages/react-native/src/migrations/update-15-0-0/add-babel-inputs.spec.ts b/packages/react-native/src/migrations/update-15-0-0/add-babel-inputs.spec.ts index f1908d471a9095..d98c4d1b35ab3d 100644 --- a/packages/react-native/src/migrations/update-15-0-0/add-babel-inputs.spec.ts +++ b/packages/react-native/src/migrations/update-15-0-0/add-babel-inputs.spec.ts @@ -1,5 +1,5 @@ -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { Tree, readNxJson, updateNxJson } from '@nrwl/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { Tree, readNxJson, updateNxJson } from '@nx/devkit'; import addBabelInputs from './add-babel-inputs'; describe('15.0.0 migration (add-babel-inputs)', () => { diff --git a/packages/react-native/src/migrations/update-15-0-0/add-babel-inputs.ts b/packages/react-native/src/migrations/update-15-0-0/add-babel-inputs.ts index a3fa30fda387ea..aa7e721076fe20 100644 --- a/packages/react-native/src/migrations/update-15-0-0/add-babel-inputs.ts +++ b/packages/react-native/src/migrations/update-15-0-0/add-babel-inputs.ts @@ -1,5 +1,5 @@ -import { formatFiles, Tree } from '@nrwl/devkit'; -import { addBabelInputs } from '@nrwl/js/src/utils/add-babel-inputs'; +import { formatFiles, Tree } from '@nx/devkit'; +import { addBabelInputs } from '@nx/js/src/utils/add-babel-inputs'; export default async function (tree: Tree) { addBabelInputs(tree); diff --git a/packages/react-native/src/migrations/update-15-9-1/add-build-ios-target.spec.ts b/packages/react-native/src/migrations/update-15-9-1/add-build-ios-target.spec.ts index 3011e395cc9afc..6ed42afc3e39f8 100644 --- a/packages/react-native/src/migrations/update-15-9-1/add-build-ios-target.spec.ts +++ b/packages/react-native/src/migrations/update-15-9-1/add-build-ios-target.spec.ts @@ -1,5 +1,5 @@ -import { addProjectConfiguration, getProjects, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { addProjectConfiguration, getProjects, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import update from './add-build-ios-target'; describe('add-build-ios-target', () => { diff --git a/packages/react-native/src/migrations/update-15-9-1/add-build-ios-target.ts b/packages/react-native/src/migrations/update-15-9-1/add-build-ios-target.ts index 0ccaa673a4fe34..264ae70afd0ac2 100644 --- a/packages/react-native/src/migrations/update-15-9-1/add-build-ios-target.ts +++ b/packages/react-native/src/migrations/update-15-9-1/add-build-ios-target.ts @@ -3,7 +3,7 @@ import { formatFiles, getProjects, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; /** * Add build-ios target for react-native diff --git a/packages/react-native/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts b/packages/react-native/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts new file mode 100644 index 00000000000000..3342dbf72ee028 --- /dev/null +++ b/packages/react-native/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts @@ -0,0 +1,37 @@ +import { Tree, readJson, updateJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import replacePackage from './update-16-0-0-add-nx-packages'; + +describe('update-16-0-0-add-nx-packages', () => { + let tree: Tree; + beforeEach(() => { + tree = createTreeWithEmptyWorkspace(); + + updateJson(tree, 'package.json', (json) => { + json.devDependencies['@nrwl/react-native'] = '16.0.0'; + return json; + }); + }); + + it('should remove the dependency on @nrwl/react-native', async () => { + await replacePackage(tree); + + expect( + readJson(tree, 'package.json').dependencies['@nrwl/react-native'] + ).not.toBeDefined(); + expect( + readJson(tree, 'package.json').devDependencies['@nrwl/react-native'] + ).not.toBeDefined(); + }); + + it('should add a dependency on @nx/react-native', async () => { + await replacePackage(tree); + + const packageJson = readJson(tree, 'package.json'); + const newDependencyVersion = + packageJson.devDependencies['@nx/react-native'] ?? + packageJson.dependencies['@nx/react-native']; + + expect(newDependencyVersion).toBeDefined(); + }); +}); diff --git a/packages/react-native/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts b/packages/react-native/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts new file mode 100644 index 00000000000000..e2ddecb068c785 --- /dev/null +++ b/packages/react-native/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts @@ -0,0 +1,12 @@ +import { Tree, formatFiles } from '@nx/devkit'; +import { replaceNrwlPackageWithNxPackage } from '@nx/devkit/src/utils/replace-package'; + +export default async function replacePackage(tree: Tree): Promise { + await replaceNrwlPackageWithNxPackage( + tree, + '@nrwl/react-native', + '@nx/react-native' + ); + + await formatFiles(tree); +} diff --git a/packages/react-native/src/utils/add-jest.ts b/packages/react-native/src/utils/add-jest.ts index bb4a68e6f128a0..ec517265bf702c 100644 --- a/packages/react-native/src/utils/add-jest.ts +++ b/packages/react-native/src/utils/add-jest.ts @@ -1,5 +1,5 @@ -import { Tree } from '@nrwl/devkit'; -import { jestProjectGenerator } from '@nrwl/jest'; +import { Tree } from '@nx/devkit'; +import { jestProjectGenerator } from '@nx/jest'; export async function addJest( host: Tree, diff --git a/packages/react-native/src/utils/add-linting.spec.ts b/packages/react-native/src/utils/add-linting.spec.ts index 0925d6898f29e8..749b47794a060c 100644 --- a/packages/react-native/src/utils/add-linting.spec.ts +++ b/packages/react-native/src/utils/add-linting.spec.ts @@ -1,7 +1,7 @@ -import { readProjectConfiguration, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { Linter } from '@nrwl/linter'; -import { libraryGenerator } from '@nrwl/js'; +import { readProjectConfiguration, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { Linter } from '@nx/linter'; +import { libraryGenerator } from '@nx/js'; import { addLinting } from './add-linting'; describe('Add Linting', () => { diff --git a/packages/react-native/src/utils/add-linting.ts b/packages/react-native/src/utils/add-linting.ts index 7da37c92cf5a63..125d830624609d 100644 --- a/packages/react-native/src/utils/add-linting.ts +++ b/packages/react-native/src/utils/add-linting.ts @@ -1,4 +1,4 @@ -import { Linter, lintProjectGenerator } from '@nrwl/linter'; +import { Linter, lintProjectGenerator } from '@nx/linter'; import { addDependenciesToPackageJson, GeneratorCallback, @@ -6,11 +6,11 @@ import { runTasksInSerial, Tree, updateJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { extendReactEslintJson, extraEslintDependencies, -} from '@nrwl/react/src/utils/lint'; +} from '@nx/react/src/utils/lint'; import type { Linter as ESLintLinter } from 'eslint'; interface NormalizedSchema { diff --git a/packages/react-native/src/utils/chmod-android-gradle-files.ts b/packages/react-native/src/utils/chmod-android-gradle-files.ts index 0bbd1066dd2c47..63b09f0d25d793 100644 --- a/packages/react-native/src/utils/chmod-android-gradle-files.ts +++ b/packages/react-native/src/utils/chmod-android-gradle-files.ts @@ -1,4 +1,4 @@ -import { GeneratorCallback, logger } from '@nrwl/devkit'; +import { GeneratorCallback, logger } from '@nx/devkit'; import { chmodSync } from 'fs'; import { join } from 'path'; diff --git a/packages/react-native/src/utils/find-all-npm-dependencies.spec.ts b/packages/react-native/src/utils/find-all-npm-dependencies.spec.ts index 41ab0b2c1a46e9..73a17edbdf7563 100644 --- a/packages/react-native/src/utils/find-all-npm-dependencies.spec.ts +++ b/packages/react-native/src/utils/find-all-npm-dependencies.spec.ts @@ -1,5 +1,5 @@ import { findAllNpmDependencies } from './find-all-npm-dependencies'; -import { ProjectGraph } from '@nrwl/devkit'; +import { ProjectGraph } from '@nx/devkit'; test('findAllNpmDependencies', () => { const graph: ProjectGraph = { diff --git a/packages/react-native/src/utils/find-all-npm-dependencies.ts b/packages/react-native/src/utils/find-all-npm-dependencies.ts index 7943e9a668a3a2..fe1558ddddf0a9 100644 --- a/packages/react-native/src/utils/find-all-npm-dependencies.ts +++ b/packages/react-native/src/utils/find-all-npm-dependencies.ts @@ -1,4 +1,4 @@ -import { ProjectGraph } from '@nrwl/devkit'; +import { ProjectGraph } from '@nx/devkit'; export function findAllNpmDependencies( graph: ProjectGraph, diff --git a/packages/react-native/src/utils/format-file.ts b/packages/react-native/src/utils/format-file.ts index 84364f0ff7a5a8..f87d29401424a9 100644 --- a/packages/react-native/src/utils/format-file.ts +++ b/packages/react-native/src/utils/format-file.ts @@ -1,4 +1,4 @@ -import { stripIndents } from '@nrwl/devkit'; +import { stripIndents } from '@nx/devkit'; import { format } from 'prettier'; export function formatFile(content, ...values) { diff --git a/packages/react-native/src/utils/get-cli-options.ts b/packages/react-native/src/utils/get-cli-options.ts index 29b870896dd6d4..c2e183c53c7fdf 100644 --- a/packages/react-native/src/utils/get-cli-options.ts +++ b/packages/react-native/src/utils/get-cli-options.ts @@ -1,4 +1,4 @@ -import { names } from '@nrwl/devkit'; +import { names } from '@nx/devkit'; /** * This function normalizes the options passed in to the Nx and returns an array of strings that can be passed to the React Native CLI. diff --git a/packages/react-native/src/utils/pod-install-task.ts b/packages/react-native/src/utils/pod-install-task.ts index 6fd047394438b8..cfd7aa5adbf120 100644 --- a/packages/react-native/src/utils/pod-install-task.ts +++ b/packages/react-native/src/utils/pod-install-task.ts @@ -1,7 +1,7 @@ import { execSync } from 'child_process'; import { platform } from 'os'; import * as chalk from 'chalk'; -import { GeneratorCallback, logger } from '@nrwl/devkit'; +import { GeneratorCallback, logger } from '@nx/devkit'; import { rmdirSync, existsSync } from 'fs-extra'; import { join } from 'path'; diff --git a/packages/react-native/src/utils/symlink-task.ts b/packages/react-native/src/utils/symlink-task.ts index bc527097d20ab1..08bc05949c7a19 100644 --- a/packages/react-native/src/utils/symlink-task.ts +++ b/packages/react-native/src/utils/symlink-task.ts @@ -1,6 +1,6 @@ import { ensureNodeModulesSymlink } from './ensure-node-modules-symlink'; import * as chalk from 'chalk'; -import { GeneratorCallback, logger } from '@nrwl/devkit'; +import { GeneratorCallback, logger } from '@nx/devkit'; export function runSymlink( workspaceRoot: string, diff --git a/packages/react-native/src/utils/testing-generators.ts b/packages/react-native/src/utils/testing-generators.ts index 531858dfeada9d..fd4a91acf30a9e 100644 --- a/packages/react-native/src/utils/testing-generators.ts +++ b/packages/react-native/src/utils/testing-generators.ts @@ -1,6 +1,6 @@ -import { addProjectConfiguration, names, Tree } from '@nrwl/devkit'; +import { addProjectConfiguration, names, Tree } from '@nx/devkit'; import applicationGenerator from '../generators/application/application'; -import { Linter } from '@nrwl/linter'; +import { Linter } from '@nx/linter'; export async function createApp(tree: Tree, appName: string): Promise { await applicationGenerator(tree, { diff --git a/packages/react/babel.ts b/packages/react/babel.ts index 9573989790bf84..28b0fd3e087328 100644 --- a/packages/react/babel.ts +++ b/packages/react/babel.ts @@ -23,7 +23,7 @@ module.exports = function (api: any, options: NxReactBabelOptions) { */ const isNextJs = api.caller((caller) => caller?.pagesDir); - const presets: any[] = [['@nrwl/js/babel', options]]; + const presets: any[] = [[require.resolve('@nx/js/babel'), options]]; /** * Next.js already includes the preset-react, and including it diff --git a/packages/react/migrations.json b/packages/react/migrations.json index de6a55337d71ef..bdeeca3c2af3fa 100644 --- a/packages/react/migrations.json +++ b/packages/react/migrations.json @@ -83,6 +83,12 @@ "version": "15.6.3-beta.0", "description": "Creates or updates webpack.config.js file with the new options for webpack.", "factory": "./src/migrations/update-15-6-3/webpack-config-setup" + }, + "update-16-0-0-add-nx-packages": { + "cli": "nx", + "version": "16.0.0-beta.1", + "description": "Replace @nrwl/react with @nx/react", + "implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages" } }, "packageJsonUpdates": { diff --git a/packages/react/migrations.spec.ts b/packages/react/migrations.spec.ts index 601f8d262315c0..9eaa778c18908f 100644 --- a/packages/react/migrations.spec.ts +++ b/packages/react/migrations.spec.ts @@ -1,11 +1,14 @@ import path = require('path'); import json = require('./migrations.json'); +import { MigrationsJsonEntry } from 'nx/src/config/misc-interfaces'; describe('React migrations', () => { it('should have valid paths', () => { - Object.values(json.generators).forEach((m) => { + Object.values(json.generators).forEach((m: MigrationsJsonEntry) => { expect(() => - require.resolve(path.join(__dirname, `${m.factory}.ts`)) + require.resolve( + path.join(__dirname, `${m.factory ?? m.implementation}.ts`) + ) ).not.toThrow(); }); }); diff --git a/packages/react/module-federation.ts b/packages/react/module-federation.ts index da79035f5e236e..8fbc447290b309 100644 --- a/packages/react/module-federation.ts +++ b/packages/react/module-federation.ts @@ -4,7 +4,7 @@ import { withModuleFederationForSSR } from './src/module-federation/with-module- export { withModuleFederation }; export { withModuleFederationForSSR }; -// Support for older generated code: `const withModuleFederation = require('@nrwl/react/module-federation')` +// Support for older generated code: `const withModuleFederation = require('@nx/react/module-federation')` module.exports = withModuleFederation; // Allow newer generated code to work: `const { withModuleFederation } = require(...)`; diff --git a/packages/react/package.json b/packages/react/package.json index 0c03bdd4761865..d8a0568ca77de8 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,5 +1,5 @@ { - "name": "@nrwl/react", + "name": "@nx/react", "version": "0.0.1", "private": false, "description": "The React plugin for Nx contains executors and generators for managing React applications and libraries within an Nx workspace. It provides:\n\n\n- Integration with libraries such as Jest, Cypress, and Storybook.\n\n- Generators for applications, libraries, components, hooks, and more.\n\n- Library build support for publishing packages to npm or other registries.\n\n- Utilities for automatic workspace refactoring.", @@ -31,15 +31,14 @@ "migrations": "./migrations.json" }, "dependencies": { - "@nrwl/devkit": "file:../devkit", - "@nrwl/js": "file:../js", - "@nrwl/linter": "file:../linter", - "@nrwl/workspace": "file:../workspace", "@phenomnomnominal/tsquery": "~5.0.1", "@svgr/webpack": "^6.1.2", "chalk": "^4.1.0", "file-loader": "^6.2.0", - "minimatch": "3.0.5" + "minimatch": "3.0.5", + "@nx/devkit": "file:../devkit", + "@nx/js": "file:../js", + "@nx/linter": "file:../linter" }, "publishConfig": { "access": "public" diff --git a/packages/react/plugins/component-testing/index.ts b/packages/react/plugins/component-testing/index.ts index 7063e1f16ade6b..9da81e6df67fd1 100644 --- a/packages/react/plugins/component-testing/index.ts +++ b/packages/react/plugins/component-testing/index.ts @@ -1,8 +1,8 @@ import { nxBaseCypressPreset, NxComponentTestingOptions, -} from '@nrwl/cypress/plugins/cypress-preset'; -import type { CypressExecutorOptions } from '@nrwl/cypress/src/executors/cypress/cypress.impl'; +} from '@nx/cypress/plugins/cypress-preset'; +import type { CypressExecutorOptions } from '@nx/cypress/src/executors/cypress/cypress.impl'; import { ExecutorContext, logger, @@ -13,11 +13,11 @@ import { stripIndents, Target, workspaceRoot, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { createExecutorContext, getProjectConfigByPath, -} from '@nrwl/cypress/src/utils/ct-helpers'; +} from '@nx/cypress/src/utils/ct-helpers'; import type { Configuration } from 'webpack'; type ViteDevServer = { @@ -188,13 +188,13 @@ function buildTargetWebpack( const { normalizeOptions, - } = require('@nrwl/webpack/src/executors/webpack/lib/normalize-options'); + } = require('@nx/webpack/src/executors/webpack/lib/normalize-options'); const { resolveCustomWebpackConfig, - } = require('@nrwl/webpack/src/utils/webpack/custom-webpack'); + } = require('@nx/webpack/src/utils/webpack/custom-webpack'); const { getWebpackConfig, - } = require('@nrwl/webpack/src/executors/webpack/lib/get-webpack-config'); + } = require('@nx/webpack/src/executors/webpack/lib/get-webpack-config'); const options = normalizeOptions( withSchemaDefaults(parsed, context), diff --git a/packages/react/plugins/component-testing/webpack-fallback.ts b/packages/react/plugins/component-testing/webpack-fallback.ts index a35a6933c86c5c..7e472ed92acd6f 100644 --- a/packages/react/plugins/component-testing/webpack-fallback.ts +++ b/packages/react/plugins/component-testing/webpack-fallback.ts @@ -1,6 +1,6 @@ import { TsconfigPathsPlugin } from 'tsconfig-paths-webpack-plugin'; import { Configuration } from 'webpack'; -import { getCSSModuleLocalIdent } from '@nrwl/webpack'; +import { getCSSModuleLocalIdent } from '@nx/webpack'; export function buildBaseWebpackConfig({ tsConfigPath = 'tsconfig.cy.json', diff --git a/packages/react/plugins/jest.ts b/packages/react/plugins/jest.ts index b96ff9a34fe5bc..0bca2bfd865a69 100644 --- a/packages/react/plugins/jest.ts +++ b/packages/react/plugins/jest.ts @@ -1,5 +1,5 @@ import * as path from 'path'; -import { names } from '@nrwl/devkit'; +import { names } from '@nx/devkit'; const JS_SOURCE_EXTENSIONS = ['.ts', '.tsx', '.js', '.jsx', '.mjs', '.cjs']; diff --git a/packages/react/plugins/storybook/index.ts b/packages/react/plugins/storybook/index.ts index 0ebc2072f168db..dcdb767991ab6d 100644 --- a/packages/react/plugins/storybook/index.ts +++ b/packages/react/plugins/storybook/index.ts @@ -1,6 +1,6 @@ -import { ExecutorContext, logger, workspaceRoot } from '@nrwl/devkit'; -import { composePluginsSync } from '@nrwl/webpack/src/utils/config'; -import { NormalizedWebpackExecutorOptions } from '@nrwl/webpack/src/executors/webpack/schema'; +import { ExecutorContext, logger, workspaceRoot } from '@nx/devkit'; +import { composePluginsSync } from '@nx/webpack/src/utils/config'; +import { NormalizedWebpackExecutorOptions } from '@nx/webpack/src/executors/webpack/schema'; import { join } from 'path'; import { Configuration, @@ -68,14 +68,14 @@ export const webpack = async ( // In case anyone is missing dep and did not run migrations. // See: https://github.com/nrwl/nx/issues/14455 try { - require.resolve('@nrwl/webpack'); + require.resolve('@nx/webpack'); } catch { throw new Error( - `'@nrwl/webpack' package is not installed. Install it and try again.` + `'@nx/webpack' package is not installed. Install it and try again.` ); } - const { withNx, withWeb } = require('@nrwl/webpack'); + const { withNx, withWeb } = require('@nx/webpack'); const tsconfigPath = join(options.configDir, 'tsconfig.json'); const builderOptions: NormalizedWebpackExecutorOptions = { diff --git a/packages/react/plugins/with-react.ts b/packages/react/plugins/with-react.ts index bd6a1c91c2e4e7..47f94bfc3e14fb 100644 --- a/packages/react/plugins/with-react.ts +++ b/packages/react/plugins/with-react.ts @@ -1,6 +1,6 @@ import type { Configuration } from 'webpack'; -import type { WithWebOptions } from '@nrwl/webpack'; -import type { NxWebpackExecutionContext } from '@nrwl/webpack'; +import type { WithWebOptions } from '@nx/webpack'; +import type { NxWebpackExecutionContext } from '@nx/webpack'; const processed = new Set(); @@ -55,7 +55,7 @@ export function withReact(pluginOptions: WithReactOptions = {}) { config: Configuration, context: NxWebpackExecutionContext ): Configuration { - const { withWeb } = require('@nrwl/webpack'); + const { withWeb } = require('@nx/webpack'); if (processed.has(config)) return config; diff --git a/packages/react/project.json b/packages/react/project.json index a9b0c7a9b78486..668935a867b917 100644 --- a/packages/react/project.json +++ b/packages/react/project.json @@ -58,7 +58,10 @@ "executor": "nx:run-commands", "outputs": ["{workspaceRoot}/build/packages/react"], "options": { - "command": "node ./scripts/copy-readme.js react" + "commands": [ + "node ./scripts/copy-readme.js react", + "node ./scripts/add-dependency-to-build.js react @nrwl/react" + ] } }, "lint": {} diff --git a/packages/react/src/executors/module-federation-dev-server/compat.ts b/packages/react/src/executors/module-federation-dev-server/compat.ts index 9598da3f24e994..ed735f06370ea1 100644 --- a/packages/react/src/executors/module-federation-dev-server/compat.ts +++ b/packages/react/src/executors/module-federation-dev-server/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import devServer from './module-federation-dev-server.impl'; diff --git a/packages/react/src/executors/module-federation-dev-server/module-federation-dev-server.impl.ts b/packages/react/src/executors/module-federation-dev-server/module-federation-dev-server.impl.ts index 042a80ba0635af..b903807b5d8d3b 100644 --- a/packages/react/src/executors/module-federation-dev-server/module-federation-dev-server.impl.ts +++ b/packages/react/src/executors/module-federation-dev-server/module-federation-dev-server.impl.ts @@ -1,12 +1,12 @@ -import { ExecutorContext, logger, runExecutor } from '@nrwl/devkit'; -import devServerExecutor from '@nrwl/webpack/src/executors/dev-server/dev-server.impl'; -import { WebDevServerOptions } from '@nrwl/webpack/src/executors/dev-server/schema'; +import { ExecutorContext, logger, runExecutor } from '@nx/devkit'; +import devServerExecutor from '@nx/webpack/src/executors/dev-server/dev-server.impl'; +import { WebDevServerOptions } from '@nx/webpack/src/executors/dev-server/schema'; import { join } from 'path'; import * as chalk from 'chalk'; import { combineAsyncIterables, tapAsyncIterable, -} from '@nrwl/devkit/src/utils/async-iterable'; +} from '@nx/devkit/src/utils/async-iterable'; type ModuleFederationDevServerOptions = WebDevServerOptions & { devRemotes?: string | string[]; diff --git a/packages/react/src/executors/module-federation-ssr-dev-server/compat.ts b/packages/react/src/executors/module-federation-ssr-dev-server/compat.ts index 1659f720fa5036..2b8297f689c7b3 100644 --- a/packages/react/src/executors/module-federation-ssr-dev-server/compat.ts +++ b/packages/react/src/executors/module-federation-ssr-dev-server/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import ssrDevServer from './module-federation-ssr-dev-server.impl'; diff --git a/packages/react/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.ts b/packages/react/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.ts index 5482a4268c5a6b..e4e640c4af7c4a 100644 --- a/packages/react/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.ts +++ b/packages/react/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.ts @@ -3,9 +3,9 @@ import { logger, runExecutor, workspaceRoot, -} from '@nrwl/devkit'; -import ssrDevServerExecutor from '@nrwl/webpack/src/executors/ssr-dev-server/ssr-dev-server.impl'; -import { WebSsrDevServerOptions } from '@nrwl/webpack/src/executors/ssr-dev-server/schema'; +} from '@nx/devkit'; +import ssrDevServerExecutor from '@nx/webpack/src/executors/ssr-dev-server/ssr-dev-server.impl'; +import { WebSsrDevServerOptions } from '@nx/webpack/src/executors/ssr-dev-server/schema'; import { join } from 'path'; import * as chalk from 'chalk'; import { @@ -13,7 +13,7 @@ import { createAsyncIterable, mapAsyncIterable, tapAsyncIterable, -} from '@nrwl/devkit/src/utils/async-iterable'; +} from '@nx/devkit/src/utils/async-iterable'; import { execSync, fork } from 'child_process'; type ModuleFederationDevServerOptions = WebSsrDevServerOptions & { diff --git a/packages/react/src/generators/application/application.spec.ts b/packages/react/src/generators/application/application.spec.ts index cc95017942bad7..e005ff11791473 100644 --- a/packages/react/src/generators/application/application.spec.ts +++ b/packages/react/src/generators/application/application.spec.ts @@ -1,4 +1,4 @@ -import { installedCypressVersion } from '@nrwl/cypress/src/utils/cypress-version'; +import { installedCypressVersion } from '@nx/cypress/src/utils/cypress-version'; import { getProjects, readJson, @@ -6,14 +6,14 @@ import { readProjectConfiguration, Tree, updateNxJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { Linter } from '@nrwl/linter'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { Linter } from '@nx/linter'; import { applicationGenerator } from './application'; import { Schema } from './schema'; // need to mock cypress otherwise it'll use the nx installed version from package.json // which is v9 while we are testing for the new v10 version -jest.mock('@nrwl/cypress/src/utils/cypress-version'); +jest.mock('@nx/cypress/src/utils/cypress-version'); describe('app', () => { let appTree: Tree; let schema: Schema = { diff --git a/packages/react/src/generators/application/application.ts b/packages/react/src/generators/application/application.ts index d24db1b3439708..1db4964c4297fa 100644 --- a/packages/react/src/generators/application/application.ts +++ b/packages/react/src/generators/application/application.ts @@ -22,11 +22,11 @@ import { runTasksInSerial, Tree, updateJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import reactInitGenerator from '../init/init'; -import { Linter, lintProjectGenerator } from '@nrwl/linter'; -import { mapLintPattern } from '@nrwl/linter/src/generators/lint-project/lint-project'; +import { Linter, lintProjectGenerator } from '@nx/linter'; +import { mapLintPattern } from '@nx/linter/src/generators/lint-project/lint-project'; import { nxVersion, swcCoreVersion, @@ -107,8 +107,8 @@ export async function applicationGenerator( if (options.bundler === 'vite') { const { viteConfigurationGenerator } = ensurePackage< - typeof import('@nrwl/vite') - >('@nrwl/vite', nxVersion); + typeof import('@nx/vite') + >('@nx/vite', nxVersion); // We recommend users use `import.meta.env.MODE` and other variables in their code to differentiate between production and development. // See: https://vitejs.dev/guide/env-and-mode.html if ( @@ -130,8 +130,8 @@ export async function applicationGenerator( tasks.push(viteTask); } else if (options.bundler === 'webpack') { const { webpackInitGenerator } = ensurePackage< - typeof import('@nrwl/webpack') - >('@nrwl/webpack', nxVersion); + typeof import('@nx/webpack') + >('@nx/webpack', nxVersion); const webpackInitTask = await webpackInitGenerator(host, { uiFramework: 'react', skipFormat: true, @@ -140,8 +140,8 @@ export async function applicationGenerator( } if (options.bundler !== 'vite' && options.unitTestRunner === 'vitest') { - const { vitestGenerator } = ensurePackage( - '@nrwl/vite', + const { vitestGenerator } = ensurePackage( + '@nx/vite', nxVersion ); diff --git a/packages/react/src/generators/application/lib/add-cypress.ts b/packages/react/src/generators/application/lib/add-cypress.ts index e59466e24713ab..ac5cfc1052cbfa 100644 --- a/packages/react/src/generators/application/lib/add-cypress.ts +++ b/packages/react/src/generators/application/lib/add-cypress.ts @@ -1,4 +1,4 @@ -import { ensurePackage, joinPathFragments, Tree } from '@nrwl/devkit'; +import { ensurePackage, joinPathFragments, Tree } from '@nx/devkit'; import { nxVersion } from '../../../utils/versions'; import { NormalizedSchema } from '../schema'; @@ -7,15 +7,15 @@ export async function addCypress(host: Tree, options: NormalizedSchema) { return () => {}; } - const { webStaticServeGenerator } = ensurePackage('@nrwl/web', nxVersion); + const { webStaticServeGenerator } = ensurePackage('@nx/web', nxVersion); await webStaticServeGenerator(host, { buildTarget: `${options.projectName}:build`, targetName: 'serve-static', }); const { cypressProjectGenerator } = ensurePackage< - typeof import('@nrwl/cypress') - >('@nrwl/cypress', nxVersion); + typeof import('@nx/cypress') + >('@nx/cypress', nxVersion); return await cypressProjectGenerator(host, { ...options, diff --git a/packages/react/src/generators/application/lib/add-jest.ts b/packages/react/src/generators/application/lib/add-jest.ts index 9d5e262d275303..7773a009e7a5e9 100644 --- a/packages/react/src/generators/application/lib/add-jest.ts +++ b/packages/react/src/generators/application/lib/add-jest.ts @@ -1,4 +1,4 @@ -import { ensurePackage, GeneratorCallback, Tree } from '@nrwl/devkit'; +import { ensurePackage, GeneratorCallback, Tree } from '@nx/devkit'; import { NormalizedSchema } from '../schema'; import { nxVersion } from '../../../utils/versions'; @@ -6,8 +6,8 @@ export async function addJest( host: Tree, options: NormalizedSchema ): Promise { - const { jestProjectGenerator } = ensurePackage( - '@nrwl/jest', + const { jestProjectGenerator } = ensurePackage( + '@nx/jest', nxVersion ); diff --git a/packages/react/src/generators/application/lib/add-project.ts b/packages/react/src/generators/application/lib/add-project.ts index d9744ce2e5461f..f027602b140aba 100644 --- a/packages/react/src/generators/application/lib/add-project.ts +++ b/packages/react/src/generators/application/lib/add-project.ts @@ -4,7 +4,7 @@ import { joinPathFragments, ProjectConfiguration, TargetConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; export function addProject(host, options: NormalizedSchema) { const project: ProjectConfiguration = { diff --git a/packages/react/src/generators/application/lib/add-routing.ts b/packages/react/src/generators/application/lib/add-routing.ts index 29241f6c693990..3ea30287cece78 100644 --- a/packages/react/src/generators/application/lib/add-routing.ts +++ b/packages/react/src/generators/application/lib/add-routing.ts @@ -9,8 +9,8 @@ import { Tree, applyChangesToString, addDependenciesToPackageJson, -} from '@nrwl/devkit'; -import { ensureTypescript } from '@nrwl/js/src/utils/typescript/ensure-typescript'; +} from '@nx/devkit'; +import { ensureTypescript } from '@nx/js/src/utils/typescript/ensure-typescript'; let tsModule: typeof import('typescript'); diff --git a/packages/react/src/generators/application/lib/create-application-files.ts b/packages/react/src/generators/application/lib/create-application-files.ts index cee90900628fb1..473b9947886fb1 100644 --- a/packages/react/src/generators/application/lib/create-application-files.ts +++ b/packages/react/src/generators/application/lib/create-application-files.ts @@ -1,5 +1,5 @@ -import { names, offsetFromRoot, Tree, toJS, generateFiles } from '@nrwl/devkit'; -import { getRelativePathToRootTsConfig } from '@nrwl/js'; +import { names, offsetFromRoot, Tree, toJS, generateFiles } from '@nx/devkit'; +import { getRelativePathToRootTsConfig } from '@nx/js'; import { join } from 'path'; import { createTsConfig } from '../../../utils/create-ts-config'; import { getInSourceVitestTestsTemplate } from '../../../utils/get-in-source-vitest-tests-template'; diff --git a/packages/react/src/generators/application/lib/find-free-port.spec.ts b/packages/react/src/generators/application/lib/find-free-port.spec.ts index 2b946f93ee5e4c..42ed2a4d0802a7 100644 --- a/packages/react/src/generators/application/lib/find-free-port.spec.ts +++ b/packages/react/src/generators/application/lib/find-free-port.spec.ts @@ -1,5 +1,5 @@ -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { addProjectConfiguration, Tree } from '@nrwl/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { addProjectConfiguration, Tree } from '@nx/devkit'; import { findFreePort } from './find-free-port'; diff --git a/packages/react/src/generators/application/lib/find-free-port.ts b/packages/react/src/generators/application/lib/find-free-port.ts index bb2816f19ae755..887de4cef663c8 100644 --- a/packages/react/src/generators/application/lib/find-free-port.ts +++ b/packages/react/src/generators/application/lib/find-free-port.ts @@ -1,5 +1,5 @@ import { Tree } from 'nx/src/generators/tree'; -import { getProjects } from '@nrwl/devkit'; +import { getProjects } from '@nx/devkit'; export function findFreePort(host: Tree) { const projects = getProjects(host); diff --git a/packages/react/src/generators/application/lib/install-common-dependencies.ts b/packages/react/src/generators/application/lib/install-common-dependencies.ts index 5847c1dd250d7e..fb239fd4bec567 100644 --- a/packages/react/src/generators/application/lib/install-common-dependencies.ts +++ b/packages/react/src/generators/application/lib/install-common-dependencies.ts @@ -1,4 +1,4 @@ -import { addDependenciesToPackageJson, Tree } from '@nrwl/devkit'; +import { addDependenciesToPackageJson, Tree } from '@nx/devkit'; import { lessVersion, sassVersion, diff --git a/packages/react/src/generators/application/lib/normalize-options.ts b/packages/react/src/generators/application/lib/normalize-options.ts index 900d7fc263e8c3..5396453bdce12e 100644 --- a/packages/react/src/generators/application/lib/normalize-options.ts +++ b/packages/react/src/generators/application/lib/normalize-options.ts @@ -6,7 +6,7 @@ import { names, normalizePath, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { findFreePort } from './find-free-port'; export function normalizeDirectory(options: Schema) { diff --git a/packages/react/src/generators/application/lib/set-defaults.ts b/packages/react/src/generators/application/lib/set-defaults.ts index 4d2a1c59dac601..4ab20d3d2449ef 100644 --- a/packages/react/src/generators/application/lib/set-defaults.ts +++ b/packages/react/src/generators/application/lib/set-defaults.ts @@ -1,4 +1,4 @@ -import { readNxJson, Tree, updateNxJson } from '@nrwl/devkit'; +import { readNxJson, Tree, updateNxJson } from '@nx/devkit'; import { NormalizedSchema } from '../schema'; export function setDefaults(host: Tree, options: NormalizedSchema) { diff --git a/packages/react/src/generators/application/lib/update-jest-config.ts b/packages/react/src/generators/application/lib/update-jest-config.ts index 0e4260e5978608..e76e187d183340 100644 --- a/packages/react/src/generators/application/lib/update-jest-config.ts +++ b/packages/react/src/generators/application/lib/update-jest-config.ts @@ -1,6 +1,6 @@ import { updateJestConfigContent } from '../../../utils/jest-utils'; import { NormalizedSchema } from '../schema'; -import { offsetFromRoot, Tree, updateJson } from '@nrwl/devkit'; +import { offsetFromRoot, Tree, updateJson } from '@nx/devkit'; export function updateSpecConfig(host: Tree, options: NormalizedSchema) { if (options.unitTestRunner === 'none') { diff --git a/packages/react/src/generators/application/schema.d.ts b/packages/react/src/generators/application/schema.d.ts index 53586f8b196f83..42398cde01b3a5 100644 --- a/packages/react/src/generators/application/schema.d.ts +++ b/packages/react/src/generators/application/schema.d.ts @@ -1,4 +1,4 @@ -import { Linter } from '@nrwl/linter'; +import { Linter } from '@nx/linter'; import { SupportedStyles } from '../../../typings/style'; export interface Schema { diff --git a/packages/react/src/generators/component-cypress-spec/component-cypress-spec.spec.ts b/packages/react/src/generators/component-cypress-spec/component-cypress-spec.spec.ts index 926d3762a432c1..cce07715b37522 100644 --- a/packages/react/src/generators/component-cypress-spec/component-cypress-spec.spec.ts +++ b/packages/react/src/generators/component-cypress-spec/component-cypress-spec.spec.ts @@ -1,6 +1,6 @@ -import { Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { Linter } from '@nrwl/linter'; +import { Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { Linter } from '@nx/linter'; import { formatFile } from '../../utils/format-file'; import applicationGenerator from '../application/application'; import libraryGenerator from '../library/library'; diff --git a/packages/react/src/generators/component-cypress-spec/component-cypress-spec.ts b/packages/react/src/generators/component-cypress-spec/component-cypress-spec.ts index cfe40a37faa716..5c5b9434e28af1 100644 --- a/packages/react/src/generators/component-cypress-spec/component-cypress-spec.ts +++ b/packages/react/src/generators/component-cypress-spec/component-cypress-spec.ts @@ -5,7 +5,7 @@ import { getProjects, joinPathFragments, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { basename, join } from 'path'; import type * as ts from 'typescript'; import { @@ -13,7 +13,7 @@ import { getComponentNode, getComponentPropsInterface, } from '../../utils/ast-utils'; -import { ensureTypescript } from '@nrwl/js/src/utils/typescript/ensure-typescript'; +import { ensureTypescript } from '@nx/js/src/utils/typescript/ensure-typescript'; let tsModule: typeof import('typescript'); diff --git a/packages/react/src/generators/component-story/component-story.spec.ts b/packages/react/src/generators/component-story/component-story.spec.ts index 8ef4df73670405..9a77bdd4dde4e4 100644 --- a/packages/react/src/generators/component-story/component-story.spec.ts +++ b/packages/react/src/generators/component-story/component-story.spec.ts @@ -1,8 +1,8 @@ -import { getProjects, Tree, updateProjectConfiguration } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { getProjects, Tree, updateProjectConfiguration } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import libraryGenerator from '../library/library'; import componentStoryGenerator from './component-story'; -import { Linter } from '@nrwl/linter'; +import { Linter } from '@nx/linter'; describe('react:component-story', () => { let appTree: Tree; diff --git a/packages/react/src/generators/component-story/component-story.ts b/packages/react/src/generators/component-story/component-story.ts index 4cf9025070203c..6c1f494f962624 100644 --- a/packages/react/src/generators/component-story/component-story.ts +++ b/packages/react/src/generators/component-story/component-story.ts @@ -6,14 +6,14 @@ import { joinPathFragments, normalizePath, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import type * as ts from 'typescript'; import { findExportDeclarationsForJsx, getComponentNode, } from '../../utils/ast-utils'; import { getDefaultsForComponent } from '../../utils/component-props'; -import { ensureTypescript } from '@nrwl/js/src/utils/typescript/ensure-typescript'; +import { ensureTypescript } from '@nx/js/src/utils/typescript/ensure-typescript'; let tsModule: typeof import('typescript'); diff --git a/packages/react/src/generators/component-test/component-test.spec.ts b/packages/react/src/generators/component-test/component-test.spec.ts index 3ae419c199a217..d01d9c8675db87 100644 --- a/packages/react/src/generators/component-test/component-test.spec.ts +++ b/packages/react/src/generators/component-test/component-test.spec.ts @@ -1,11 +1,11 @@ -import { assertMinimumCypressVersion } from '@nrwl/cypress/src/utils/cypress-version'; -import { Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { Linter } from '@nrwl/linter'; +import { assertMinimumCypressVersion } from '@nx/cypress/src/utils/cypress-version'; +import { Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { Linter } from '@nx/linter'; import libraryGenerator from '../library/library'; import { componentTestGenerator } from './component-test'; -jest.mock('@nrwl/cypress/src/utils/cypress-version'); +jest.mock('@nx/cypress/src/utils/cypress-version'); describe(componentTestGenerator.name, () => { let tree: Tree; let mockedAssertMinimumCypressVersion: jest.Mock< diff --git a/packages/react/src/generators/component-test/component-test.ts b/packages/react/src/generators/component-test/component-test.ts index e39efdd404f72c..aea81fa1bcad29 100644 --- a/packages/react/src/generators/component-test/component-test.ts +++ b/packages/react/src/generators/component-test/component-test.ts @@ -4,7 +4,7 @@ import { joinPathFragments, readProjectConfiguration, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { basename, dirname, extname, relative } from 'path'; import { findExportDeclarationsForJsx, @@ -13,7 +13,7 @@ import { import { getDefaultsForComponent } from '../../utils/component-props'; import { nxVersion } from '../../utils/versions'; import { ComponentTestSchema } from './schema'; -import { ensureTypescript } from '@nrwl/js/src/utils/typescript/ensure-typescript'; +import { ensureTypescript } from '@nx/js/src/utils/typescript/ensure-typescript'; let tsModule: typeof import('typescript'); @@ -21,9 +21,9 @@ export async function componentTestGenerator( tree: Tree, options: ComponentTestSchema ) { - ensurePackage('@nrwl/cypress', nxVersion); + ensurePackage('@nx/cypress', nxVersion); const { assertMinimumCypressVersion } = await import( - '@nrwl/cypress/src/utils/cypress-version' + '@nx/cypress/src/utils/cypress-version' ); assertMinimumCypressVersion(10); diff --git a/packages/react/src/generators/component/component.spec.ts b/packages/react/src/generators/component/component.spec.ts index 12aeb175b02382..7a6f914f0d58e3 100644 --- a/packages/react/src/generators/component/component.spec.ts +++ b/packages/react/src/generators/component/component.spec.ts @@ -1,11 +1,11 @@ -import { installedCypressVersion } from '@nrwl/cypress/src/utils/cypress-version'; -import { logger, readJson, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { installedCypressVersion } from '@nx/cypress/src/utils/cypress-version'; +import { logger, readJson, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { createApp, createLib } from '../../utils/testing-generators'; import { componentGenerator } from './component'; // need to mock cypress otherwise it'll use the nx installed version from package.json // which is v9 while we are testing for the new v10 version -jest.mock('@nrwl/cypress/src/utils/cypress-version'); +jest.mock('@nx/cypress/src/utils/cypress-version'); describe('component', () => { let appTree: Tree; let projectName: string; diff --git a/packages/react/src/generators/component/component.ts b/packages/react/src/generators/component/component.ts index 3c381f9347775a..f5ff7aff60cc82 100644 --- a/packages/react/src/generators/component/component.ts +++ b/packages/react/src/generators/component/component.ts @@ -12,7 +12,7 @@ import { runTasksInSerial, toJS, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { addStyledModuleDependencies } from '../../rules/add-styled-dependencies'; import { assertValidStyle } from '../../utils/assertion'; @@ -25,7 +25,7 @@ import { import { getComponentTests } from './get-component-tests'; import { NormalizedSchema } from './noramlized-schema'; import { Schema } from './schema'; -import { ensureTypescript } from '@nrwl/js/src/utils/typescript/ensure-typescript'; +import { ensureTypescript } from '@nx/js/src/utils/typescript/ensure-typescript'; export async function componentGenerator(host: Tree, schema: Schema) { const options = await normalizeOptions(host, schema); diff --git a/packages/react/src/generators/cypress-component-configuration/cypress-component-configuration.spec.ts b/packages/react/src/generators/cypress-component-configuration/cypress-component-configuration.spec.ts index 071860fee53b41..fd70c035ac6c98 100644 --- a/packages/react/src/generators/cypress-component-configuration/cypress-component-configuration.spec.ts +++ b/packages/react/src/generators/cypress-component-configuration/cypress-component-configuration.spec.ts @@ -1,27 +1,27 @@ -import { assertMinimumCypressVersion } from '@nrwl/cypress/src/utils/cypress-version'; +import { assertMinimumCypressVersion } from '@nx/cypress/src/utils/cypress-version'; import { DependencyType, ProjectGraph, readProjectConfiguration, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { Linter } from '@nrwl/linter'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { Linter } from '@nx/linter'; import { applicationGenerator } from '../application/application'; import { componentGenerator } from '../component/component'; import { libraryGenerator } from '../library/library'; import { cypressComponentConfigGenerator } from './cypress-component-configuration'; let projectGraph: ProjectGraph; -jest.mock('@nrwl/devkit', () => ({ - ...jest.requireActual('@nrwl/devkit'), +jest.mock('@nx/devkit', () => ({ + ...jest.requireActual('@nx/devkit'), readTargetOptions: jest.fn().mockImplementation(() => ({})), createProjectGraphAsync: jest .fn() .mockImplementation(async () => projectGraph), })); -jest.mock('@nrwl/cypress/src/utils/cypress-version'); +jest.mock('@nx/cypress/src/utils/cypress-version'); // nested code imports graph from the repo, which might have innacurate graph version jest.mock('nx/src/project-graph/project-graph', () => ({ ...jest.requireActual('nx/src/project-graph/project-graph'), diff --git a/packages/react/src/generators/cypress-component-configuration/cypress-component-configuration.ts b/packages/react/src/generators/cypress-component-configuration/cypress-component-configuration.ts index e8491b076ad17a..a6241ea89f5f5b 100644 --- a/packages/react/src/generators/cypress-component-configuration/cypress-component-configuration.ts +++ b/packages/react/src/generators/cypress-component-configuration/cypress-component-configuration.ts @@ -3,7 +3,7 @@ import { formatFiles, readProjectConfiguration, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { nxVersion } from '../../utils/versions'; import { addFiles } from './lib/add-files'; import { FoundTarget, updateProjectConfig } from './lib/update-configs'; @@ -18,7 +18,7 @@ export async function cypressComponentConfigGenerator( tree: Tree, options: CypressComponentConfigurationSchema ) { - const { cypressComponentProject } = ensurePackage('@nrwl/cypress', nxVersion); + const { cypressComponentProject } = ensurePackage('@nx/cypress', nxVersion); const projectConfig = readProjectConfiguration(tree, options.project); const installTask = await cypressComponentProject(tree, { project: options.project, diff --git a/packages/react/src/generators/cypress-component-configuration/lib/add-files.ts b/packages/react/src/generators/cypress-component-configuration/lib/add-files.ts index 99cb3759512650..7d2d2d752c2725 100644 --- a/packages/react/src/generators/cypress-component-configuration/lib/add-files.ts +++ b/packages/react/src/generators/cypress-component-configuration/lib/add-files.ts @@ -10,13 +10,13 @@ import { readProjectConfiguration, Tree, visitNotIgnoredFiles, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { nxVersion } from 'nx/src/utils/versions'; import { getComponentNode } from '../../../utils/ast-utils'; import { componentTestGenerator } from '../../component-test/component-test'; import { CypressComponentConfigurationSchema } from '../schema'; import { FoundTarget } from './update-configs'; -import { ensureTypescript } from '@nrwl/js/src/utils/typescript/ensure-typescript'; +import { ensureTypescript } from '@nx/js/src/utils/typescript/ensure-typescript'; let tsModule: typeof import('typescript'); diff --git a/packages/react/src/generators/cypress-component-configuration/lib/update-configs.ts b/packages/react/src/generators/cypress-component-configuration/lib/update-configs.ts index ecb91734fa8e0a..b48e50a00f9533 100644 --- a/packages/react/src/generators/cypress-component-configuration/lib/update-configs.ts +++ b/packages/react/src/generators/cypress-component-configuration/lib/update-configs.ts @@ -3,7 +3,7 @@ import { TargetConfiguration, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { CypressComponentConfigurationSchema } from '../schema'; export interface FoundTarget { @@ -16,7 +16,7 @@ export async function updateProjectConfig( options: CypressComponentConfigurationSchema ): Promise { const { findBuildConfig } = await import( - '@nrwl/cypress/src/utils/find-target-options' + '@nx/cypress/src/utils/find-target-options' ); const found = await findBuildConfig(tree, { project: options.project, diff --git a/packages/react/src/generators/hook/hook.spec.ts b/packages/react/src/generators/hook/hook.spec.ts index b37b34f6f23317..4f0e4bec79b007 100644 --- a/packages/react/src/generators/hook/hook.spec.ts +++ b/packages/react/src/generators/hook/hook.spec.ts @@ -1,6 +1,6 @@ import { createApp, createLib } from '../../utils/testing-generators'; -import { logger, readJson, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { logger, readJson, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { hookGenerator } from './hook'; describe('hook', () => { diff --git a/packages/react/src/generators/hook/hook.ts b/packages/react/src/generators/hook/hook.ts index 39dbfc340ee904..07110aface77b8 100644 --- a/packages/react/src/generators/hook/hook.ts +++ b/packages/react/src/generators/hook/hook.ts @@ -10,11 +10,11 @@ import { names, toJS, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { Schema } from './schema'; import { addImport } from '../../utils/ast-utils'; -import { ensureTypescript } from '@nrwl/js/src/utils/typescript/ensure-typescript'; +import { ensureTypescript } from '@nx/js/src/utils/typescript/ensure-typescript'; interface NormalizedSchema extends Schema { projectSourceRoot: string; diff --git a/packages/react/src/generators/host/host.spec.ts b/packages/react/src/generators/host/host.spec.ts index 4a70a53dbb4ccf..64ff617f0385e5 100644 --- a/packages/react/src/generators/host/host.spec.ts +++ b/packages/react/src/generators/host/host.spec.ts @@ -1,8 +1,8 @@ -import type { Tree } from '@nrwl/devkit'; -import { readJson } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import type { Tree } from '@nx/devkit'; +import { readJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import hostGenerator from './host'; -import { Linter } from '@nrwl/linter'; +import { Linter } from '@nx/linter'; describe('hostGenerator', () => { let tree: Tree; diff --git a/packages/react/src/generators/host/host.ts b/packages/react/src/generators/host/host.ts index 894abfb44c0e12..1d6c4780d58195 100644 --- a/packages/react/src/generators/host/host.ts +++ b/packages/react/src/generators/host/host.ts @@ -6,7 +6,7 @@ import { runTasksInSerial, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import applicationGenerator from '../application/application'; import { normalizeOptions } from '../application/lib/normalize-options'; diff --git a/packages/react/src/generators/host/lib/add-module-federation-files.ts b/packages/react/src/generators/host/lib/add-module-federation-files.ts index 60f75cc897f682..5b9e2b54c2d523 100644 --- a/packages/react/src/generators/host/lib/add-module-federation-files.ts +++ b/packages/react/src/generators/host/lib/add-module-federation-files.ts @@ -1,5 +1,5 @@ import { NormalizedSchema } from '../schema'; -import { generateFiles, names } from '@nrwl/devkit'; +import { generateFiles, names } from '@nx/devkit'; import { join } from 'path'; import { normalizeProjectName } from '../../application/lib/normalize-options'; diff --git a/packages/react/src/generators/host/lib/setup-ssr-for-host.ts b/packages/react/src/generators/host/lib/setup-ssr-for-host.ts index ba123e7757813b..69b53aa7a79e0b 100644 --- a/packages/react/src/generators/host/lib/setup-ssr-for-host.ts +++ b/packages/react/src/generators/host/lib/setup-ssr-for-host.ts @@ -1,4 +1,4 @@ -import type { GeneratorCallback, Tree } from '@nrwl/devkit'; +import type { GeneratorCallback, Tree } from '@nx/devkit'; import { addDependenciesToPackageJson, generateFiles, @@ -7,7 +7,7 @@ import { readProjectConfiguration, runTasksInSerial, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import type { Schema } from '../schema'; import { moduleFederationNodeVersion } from '../../../utils/versions'; diff --git a/packages/react/src/generators/host/lib/update-module-federation-e2e-project.ts b/packages/react/src/generators/host/lib/update-module-federation-e2e-project.ts index 1b4fef60cd9478..6254ffe23f489c 100644 --- a/packages/react/src/generators/host/lib/update-module-federation-e2e-project.ts +++ b/packages/react/src/generators/host/lib/update-module-federation-e2e-project.ts @@ -3,7 +3,7 @@ import { Tree, readProjectConfiguration, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; export function updateModuleFederationE2eProject( host: Tree, diff --git a/packages/react/src/generators/host/schema.d.ts b/packages/react/src/generators/host/schema.d.ts index b109f622bfd918..e8c63c6e83c032 100644 --- a/packages/react/src/generators/host/schema.d.ts +++ b/packages/react/src/generators/host/schema.d.ts @@ -1,4 +1,4 @@ -import { Linter } from '@nrwl/linter'; +import { Linter } from '@nx/linter'; import { SupportedStyles } from '../../../typings'; export interface Schema { diff --git a/packages/react/src/generators/init/init.spec.ts b/packages/react/src/generators/init/init.spec.ts index 56f74d069b71d5..cfff15bda301ce 100644 --- a/packages/react/src/generators/init/init.spec.ts +++ b/packages/react/src/generators/init/init.spec.ts @@ -1,5 +1,5 @@ -import { readJson, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { readJson, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import reactInitGenerator from './init'; import { InitSchema } from './schema'; diff --git a/packages/react/src/generators/init/init.ts b/packages/react/src/generators/init/init.ts index 1744147e91fdc4..4a4cbb7381cff0 100755 --- a/packages/react/src/generators/init/init.ts +++ b/packages/react/src/generators/init/init.ts @@ -9,9 +9,9 @@ import { Tree, updateNxJson, writeJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; -import { initGenerator as jsInitGenerator } from '@nrwl/js'; +import { initGenerator as jsInitGenerator } from '@nx/js'; import { babelPresetReactVersion, nxVersion, @@ -100,9 +100,9 @@ export async function reactInitGenerator(host: Tree, schema: InitSchema) { setDefault(host); if (!schema.e2eTestRunner || schema.e2eTestRunner === 'cypress') { - ensurePackage('@nrwl/cypress', nxVersion); + ensurePackage('@nx/cypress', nxVersion); const { cypressInitGenerator } = await import( - '@nrwl/cypress/src/generators/init/init' + '@nx/cypress/src/generators/init/init' ); const cypressTask = await cypressInitGenerator(host, {}); tasks.push(cypressTask); diff --git a/packages/react/src/generators/library/lib/add-linting.ts b/packages/react/src/generators/library/lib/add-linting.ts index fb89624b117360..b78b11ba552560 100644 --- a/packages/react/src/generators/library/lib/add-linting.ts +++ b/packages/react/src/generators/library/lib/add-linting.ts @@ -1,8 +1,8 @@ import { Tree } from 'nx/src/generators/tree'; -import { Linter, lintProjectGenerator } from '@nrwl/linter'; +import { Linter, lintProjectGenerator } from '@nx/linter'; import { joinPathFragments } from 'nx/src/utils/path'; import { updateJson } from 'nx/src/generators/utils/json'; -import { addDependenciesToPackageJson, runTasksInSerial } from '@nrwl/devkit'; +import { addDependenciesToPackageJson, runTasksInSerial } from '@nx/devkit'; import { NormalizedSchema } from '../schema'; import { diff --git a/packages/react/src/generators/library/lib/add-rollup-build-target.ts b/packages/react/src/generators/library/lib/add-rollup-build-target.ts index f438fbd8003280..fa82532303dbf6 100644 --- a/packages/react/src/generators/library/lib/add-rollup-build-target.ts +++ b/packages/react/src/generators/library/lib/add-rollup-build-target.ts @@ -6,7 +6,7 @@ import { joinPathFragments, readProjectConfiguration, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { maybeJs } from './maybe-js'; import { NormalizedSchema } from '../schema'; @@ -20,8 +20,8 @@ export async function addRollupBuildTarget( host: Tree, options: NormalizedSchema ) { - const { rollupInitGenerator } = ensurePackage( - '@nrwl/rollup', + const { rollupInitGenerator } = ensurePackage( + '@nx/rollup', nxVersion ); diff --git a/packages/react/src/generators/library/lib/create-files.ts b/packages/react/src/generators/library/lib/create-files.ts index be4ce71e1b8c9a..55579e7379bcc8 100644 --- a/packages/react/src/generators/library/lib/create-files.ts +++ b/packages/react/src/generators/library/lib/create-files.ts @@ -1,12 +1,12 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { generateFiles, joinPathFragments, names, offsetFromRoot, toJS, -} from '@nrwl/devkit'; -import { getRelativePathToRootTsConfig } from '@nrwl/js'; +} from '@nx/devkit'; +import { getRelativePathToRootTsConfig } from '@nx/js'; import { NormalizedSchema } from '../schema'; import { createTsConfig } from '../../../utils/create-ts-config'; diff --git a/packages/react/src/generators/library/lib/install-common-dependencies.ts b/packages/react/src/generators/library/lib/install-common-dependencies.ts index a4f39be3e6a819..9453e2fc018074 100644 --- a/packages/react/src/generators/library/lib/install-common-dependencies.ts +++ b/packages/react/src/generators/library/lib/install-common-dependencies.ts @@ -1,4 +1,4 @@ -import { addDependenciesToPackageJson, Tree } from '@nrwl/devkit'; +import { addDependenciesToPackageJson, Tree } from '@nx/devkit'; import { lessVersion, reactDomVersion, diff --git a/packages/react/src/generators/library/lib/normalize-options.spec.ts b/packages/react/src/generators/library/lib/normalize-options.spec.ts index af3ce7b8009376..541bf0739dcdf0 100644 --- a/packages/react/src/generators/library/lib/normalize-options.spec.ts +++ b/packages/react/src/generators/library/lib/normalize-options.spec.ts @@ -1,6 +1,6 @@ -import type { Tree } from '@nrwl/devkit'; -import { Linter } from '@nrwl/linter'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import type { Tree } from '@nx/devkit'; +import { Linter } from '@nx/linter'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { normalizeOptions } from './normalize-options'; describe('normalizeOptions', () => { diff --git a/packages/react/src/generators/library/lib/normalize-options.ts b/packages/react/src/generators/library/lib/normalize-options.ts index c9d897c242ccb1..b1f764563a3a93 100644 --- a/packages/react/src/generators/library/lib/normalize-options.ts +++ b/packages/react/src/generators/library/lib/normalize-options.ts @@ -8,7 +8,7 @@ import { names, normalizePath, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { assertValidStyle } from '../../../utils/assertion'; import { NormalizedSchema, Schema } from '../schema'; diff --git a/packages/react/src/generators/library/lib/set-defaults.ts b/packages/react/src/generators/library/lib/set-defaults.ts index 771e97ccaec43c..13ad52bb7080ad 100644 --- a/packages/react/src/generators/library/lib/set-defaults.ts +++ b/packages/react/src/generators/library/lib/set-defaults.ts @@ -1,4 +1,4 @@ -import { readNxJson, Tree, updateNxJson } from '@nrwl/devkit'; +import { readNxJson, Tree, updateNxJson } from '@nx/devkit'; import { NormalizedSchema } from '../schema'; export function setDefaults(host: Tree, options: NormalizedSchema) { diff --git a/packages/react/src/generators/library/lib/update-app-routes.ts b/packages/react/src/generators/library/lib/update-app-routes.ts index 6b587b575646b2..756edd7383c4d4 100644 --- a/packages/react/src/generators/library/lib/update-app-routes.ts +++ b/packages/react/src/generators/library/lib/update-app-routes.ts @@ -3,7 +3,7 @@ import { applyChangesToString, getWorkspaceLayout, names, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { Tree } from 'nx/src/generators/tree'; import { getImportPath, joinPathFragments } from 'nx/src/utils/path'; import type * as ts from 'typescript'; @@ -20,7 +20,7 @@ import { reactRouterDomVersion, typesReactRouterDomVersion, } from '../../../utils/versions'; -import { ensureTypescript } from '@nrwl/js/src/utils/typescript/ensure-typescript'; +import { ensureTypescript } from '@nx/js/src/utils/typescript/ensure-typescript'; let tsModule: typeof import('typescript'); diff --git a/packages/react/src/generators/library/library.spec.ts b/packages/react/src/generators/library/library.spec.ts index 85ddaca620dada..75d8eda9aeb4cf 100644 --- a/packages/react/src/generators/library/library.spec.ts +++ b/packages/react/src/generators/library/library.spec.ts @@ -1,20 +1,20 @@ -import { installedCypressVersion } from '@nrwl/cypress/src/utils/cypress-version'; +import { installedCypressVersion } from '@nx/cypress/src/utils/cypress-version'; import { getProjects, readJson, readProjectConfiguration, Tree, updateJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { Linter } from '@nrwl/linter'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { Linter } from '@nx/linter'; import { nxVersion } from '../../utils/versions'; import applicationGenerator from '../application/application'; import libraryGenerator from './library'; import { Schema } from './schema'; // need to mock cypress otherwise it'll use the nx installed version from package.json // which is v9 while we are testing for the new v10 version -jest.mock('@nrwl/cypress/src/utils/cypress-version'); +jest.mock('@nx/cypress/src/utils/cypress-version'); describe('lib', () => { let tree: Tree; let mockedInstalledCypressVersion: jest.Mock< diff --git a/packages/react/src/generators/library/library.ts b/packages/react/src/generators/library/library.ts index f9145ad2cf81d8..ab36bb87002403 100644 --- a/packages/react/src/generators/library/library.ts +++ b/packages/react/src/generators/library/library.ts @@ -8,9 +8,9 @@ import { runTasksInSerial, Tree, updateJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; -import { addTsConfigPath } from '@nrwl/js'; +import { addTsConfigPath } from '@nx/js'; import { nxVersion } from '../../utils/versions'; import componentGenerator from '../component/component'; @@ -64,8 +64,8 @@ export async function libraryGenerator(host: Tree, schema: Schema) { // Set up build target if (options.buildable && options.bundler === 'vite') { const { viteConfigurationGenerator } = ensurePackage< - typeof import('@nrwl/vite') - >('@nrwl/vite', nxVersion); + typeof import('@nx/vite') + >('@nx/vite', nxVersion); const viteTask = await viteConfigurationGenerator(host, { uiFramework: 'react', project: options.name, @@ -83,8 +83,8 @@ export async function libraryGenerator(host: Tree, schema: Schema) { // Set up test target if (options.unitTestRunner === 'jest') { - const { jestProjectGenerator } = ensurePackage( - '@nrwl/jest', + const { jestProjectGenerator } = ensurePackage( + '@nx/jest', nxVersion ); @@ -112,8 +112,8 @@ export async function libraryGenerator(host: Tree, schema: Schema) { options.unitTestRunner === 'vitest' && options.bundler !== 'vite' // tests are already configured if bundler is vite ) { - const { vitestGenerator } = ensurePackage( - '@nrwl/vite', + const { vitestGenerator } = ensurePackage( + '@nx/vite', nxVersion ); const vitestTask = await vitestGenerator(host, { diff --git a/packages/react/src/generators/library/schema.d.ts b/packages/react/src/generators/library/schema.d.ts index 507ea0f4898031..752335398065b1 100644 --- a/packages/react/src/generators/library/schema.d.ts +++ b/packages/react/src/generators/library/schema.d.ts @@ -1,4 +1,4 @@ -import type { Linter } from '@nrwl/linter'; +import type { Linter } from '@nx/linter'; import { SupportedStyles } from '../../../typings/style'; export interface Schema { diff --git a/packages/react/src/generators/redux/redux.spec.ts b/packages/react/src/generators/redux/redux.spec.ts index 0923bbf35a6a8b..d721d5d2d3faa7 100644 --- a/packages/react/src/generators/redux/redux.spec.ts +++ b/packages/react/src/generators/redux/redux.spec.ts @@ -1,6 +1,6 @@ -import { readJson, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { Linter } from '@nrwl/linter'; +import { readJson, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { Linter } from '@nx/linter'; import { applicationGenerator } from '../application/application'; import { libraryGenerator } from '../library/library'; import { reduxGenerator } from './redux'; diff --git a/packages/react/src/generators/redux/redux.ts b/packages/react/src/generators/redux/redux.ts index 71cdf02bc975fa..0784b516291c35 100644 --- a/packages/react/src/generators/redux/redux.ts +++ b/packages/react/src/generators/redux/redux.ts @@ -18,9 +18,9 @@ import { readJson, toJS, Tree, -} from '@nrwl/devkit'; -import { getRootTsConfigPathInTree } from '@nrwl/js'; -import { ensureTypescript } from '@nrwl/js/src/utils/typescript/ensure-typescript'; +} from '@nx/devkit'; +import { getRootTsConfigPathInTree } from '@nx/js'; +import { ensureTypescript } from '@nx/js/src/utils/typescript/ensure-typescript'; let tsModule: typeof import('typescript'); diff --git a/packages/react/src/generators/remote/lib/setup-ssr-for-remote.ts b/packages/react/src/generators/remote/lib/setup-ssr-for-remote.ts index 751489ed27a8bc..0cb1ce3760ffca 100644 --- a/packages/react/src/generators/remote/lib/setup-ssr-for-remote.ts +++ b/packages/react/src/generators/remote/lib/setup-ssr-for-remote.ts @@ -1,4 +1,4 @@ -import type { GeneratorCallback, Tree } from '@nrwl/devkit'; +import type { GeneratorCallback, Tree } from '@nx/devkit'; import { addDependenciesToPackageJson, generateFiles, @@ -6,7 +6,7 @@ import { readProjectConfiguration, runTasksInSerial, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { NormalizedSchema } from '../../application/schema'; import type { Schema } from '../schema'; diff --git a/packages/react/src/generators/remote/lib/update-host-with-remote.ts b/packages/react/src/generators/remote/lib/update-host-with-remote.ts index 9cf53e7fda5ebe..e73a34598b5ed5 100644 --- a/packages/react/src/generators/remote/lib/update-host-with-remote.ts +++ b/packages/react/src/generators/remote/lib/update-host-with-remote.ts @@ -5,13 +5,13 @@ import { names, readProjectConfiguration, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { addRemoteDefinition, addRemoteRoute, addRemoteToConfig, } from '../../../module-federation/ast-utils'; -import { ensureTypescript } from '@nrwl/js/src/utils/typescript/ensure-typescript'; +import { ensureTypescript } from '@nx/js/src/utils/typescript/ensure-typescript'; let tsModule: typeof import('typescript'); diff --git a/packages/react/src/generators/remote/remote.spec.ts b/packages/react/src/generators/remote/remote.spec.ts index fc282887356777..008f1800b2b09b 100644 --- a/packages/react/src/generators/remote/remote.spec.ts +++ b/packages/react/src/generators/remote/remote.spec.ts @@ -1,6 +1,6 @@ -import { readJson, readNxJson } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { Linter } from '@nrwl/linter'; +import { readJson, readNxJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { Linter } from '@nx/linter'; import remote from './remote'; describe('remote generator', () => { diff --git a/packages/react/src/generators/remote/remote.ts b/packages/react/src/generators/remote/remote.ts index 22d292735799fb..a4ba8e44afe36d 100644 --- a/packages/react/src/generators/remote/remote.ts +++ b/packages/react/src/generators/remote/remote.ts @@ -9,7 +9,7 @@ import { runTasksInSerial, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { normalizeOptions } from '../application/lib/normalize-options'; import applicationGenerator from '../application/application'; diff --git a/packages/react/src/generators/remote/schema.d.ts b/packages/react/src/generators/remote/schema.d.ts index 4c5eb8c8820a5b..2fa825a4e5791d 100644 --- a/packages/react/src/generators/remote/schema.d.ts +++ b/packages/react/src/generators/remote/schema.d.ts @@ -1,4 +1,4 @@ -import { Linter } from '@nrwl/linter'; +import { Linter } from '@nx/linter'; import { SupportedStyles } from '../../../typings'; diff --git a/packages/react/src/generators/setup-ssr/setup-ssr.spec.ts b/packages/react/src/generators/setup-ssr/setup-ssr.spec.ts index ff2b7e4b5a1b2c..662e50b65550aa 100644 --- a/packages/react/src/generators/setup-ssr/setup-ssr.spec.ts +++ b/packages/react/src/generators/setup-ssr/setup-ssr.spec.ts @@ -1,8 +1,8 @@ -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { readJson, Tree } from '@nrwl/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { readJson, Tree } from '@nx/devkit'; import applicationGenerator from '../application/application'; import setupSsrGenerator from './setup-ssr'; -import { Linter } from '@nrwl/linter'; +import { Linter } from '@nx/linter'; describe('setupSsrGenerator', () => { let tree: Tree; diff --git a/packages/react/src/generators/setup-ssr/setup-ssr.ts b/packages/react/src/generators/setup-ssr/setup-ssr.ts index b303c638284c3d..f67e748bd23a91 100644 --- a/packages/react/src/generators/setup-ssr/setup-ssr.ts +++ b/packages/react/src/generators/setup-ssr/setup-ssr.ts @@ -11,7 +11,7 @@ import { Tree, updateNxJson, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import initGenerator from '../init/init'; import type { Schema } from './schema'; @@ -23,7 +23,7 @@ import { typesExpressVersion, } from '../../utils/versions'; import { addStaticRouter } from '../../utils/ast-utils'; -import { ensureTypescript } from '@nrwl/js/src/utils/typescript/ensure-typescript'; +import { ensureTypescript } from '@nx/js/src/utils/typescript/ensure-typescript'; let tsModule: typeof import('typescript'); diff --git a/packages/react/src/generators/setup-tailwind/lib/add-tailwind-style-imports.ts b/packages/react/src/generators/setup-tailwind/lib/add-tailwind-style-imports.ts index facf23da2262b4..669d682e5b10ac 100644 --- a/packages/react/src/generators/setup-tailwind/lib/add-tailwind-style-imports.ts +++ b/packages/react/src/generators/setup-tailwind/lib/add-tailwind-style-imports.ts @@ -4,7 +4,7 @@ import { ProjectConfiguration, stripIndents, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import * as chalk from 'chalk'; import { SetupTailwindOptions } from '../schema'; diff --git a/packages/react/src/generators/setup-tailwind/lib/update-project.ts b/packages/react/src/generators/setup-tailwind/lib/update-project.ts index e1032f5909befd..d9c1d0c2440507 100644 --- a/packages/react/src/generators/setup-tailwind/lib/update-project.ts +++ b/packages/react/src/generators/setup-tailwind/lib/update-project.ts @@ -1,5 +1,5 @@ -import type { ProjectConfiguration, Tree } from '@nrwl/devkit'; -import { joinPathFragments, updateProjectConfiguration } from '@nrwl/devkit'; +import type { ProjectConfiguration, Tree } from '@nx/devkit'; +import { joinPathFragments, updateProjectConfiguration } from '@nx/devkit'; import { SetupTailwindOptions } from '../schema'; diff --git a/packages/react/src/generators/setup-tailwind/setup-tailwind.spec.ts b/packages/react/src/generators/setup-tailwind/setup-tailwind.spec.ts index dacafd938533bd..3efd10f9b10cd0 100644 --- a/packages/react/src/generators/setup-tailwind/setup-tailwind.spec.ts +++ b/packages/react/src/generators/setup-tailwind/setup-tailwind.spec.ts @@ -4,8 +4,8 @@ import { readProjectConfiguration, stripIndents, writeJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import update from './setup-tailwind'; describe('setup-tailwind', () => { diff --git a/packages/react/src/generators/setup-tailwind/setup-tailwind.ts b/packages/react/src/generators/setup-tailwind/setup-tailwind.ts index f4193b7f01658a..c27731e37ab77a 100644 --- a/packages/react/src/generators/setup-tailwind/setup-tailwind.ts +++ b/packages/react/src/generators/setup-tailwind/setup-tailwind.ts @@ -1,4 +1,4 @@ -import type { GeneratorCallback, Tree } from '@nrwl/devkit'; +import type { GeneratorCallback, Tree } from '@nx/devkit'; import { addDependenciesToPackageJson, convertNxGenerator, @@ -8,7 +8,7 @@ import { logger, readProjectConfiguration, runTasksInSerial, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { autoprefixerVersion, diff --git a/packages/react/src/generators/stories/stories.app.spec.ts b/packages/react/src/generators/stories/stories.app.spec.ts index 0fa98ca1853ab1..4f581029ffc37b 100644 --- a/packages/react/src/generators/stories/stories.app.spec.ts +++ b/packages/react/src/generators/stories/stories.app.spec.ts @@ -1,12 +1,12 @@ -import { installedCypressVersion } from '@nrwl/cypress/src/utils/cypress-version'; -import { Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { Linter } from '@nrwl/linter'; +import { installedCypressVersion } from '@nx/cypress/src/utils/cypress-version'; +import { Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { Linter } from '@nx/linter'; import applicationGenerator from '../application/application'; import storiesGenerator from './stories'; // need to mock cypress otherwise it'll use the nx installed version from package.json // which is v9 while we are testing for the new v10 version -jest.mock('@nrwl/cypress/src/utils/cypress-version'); +jest.mock('@nx/cypress/src/utils/cypress-version'); describe('react:stories for applications', () => { let appTree: Tree; let mockedInstalledCypressVersion: jest.Mock< diff --git a/packages/react/src/generators/stories/stories.lib.spec.ts b/packages/react/src/generators/stories/stories.lib.spec.ts index 4b166450cdf9c1..93eb95768d887d 100644 --- a/packages/react/src/generators/stories/stories.lib.spec.ts +++ b/packages/react/src/generators/stories/stories.lib.spec.ts @@ -1,8 +1,8 @@ -import { Tree } from '@nrwl/devkit'; +import { Tree } from '@nx/devkit'; import storiesGenerator from './stories'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import applicationGenerator from '../application/application'; -import { Linter } from '@nrwl/linter'; +import { Linter } from '@nx/linter'; import libraryGenerator from '../library/library'; describe('react:stories for libraries', () => { diff --git a/packages/react/src/generators/stories/stories.nextjs.spec.ts b/packages/react/src/generators/stories/stories.nextjs.spec.ts index fba3b27d5af7dc..8b323a459ccc98 100644 --- a/packages/react/src/generators/stories/stories.nextjs.spec.ts +++ b/packages/react/src/generators/stories/stories.nextjs.spec.ts @@ -2,11 +2,11 @@ import { readProjectConfiguration, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import storiesGenerator from './stories'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import applicationGenerator from '../application/application'; -import { Linter } from '@nrwl/linter'; +import { Linter } from '@nx/linter'; describe('nextjs:stories for applications', () => { let tree: Tree; diff --git a/packages/react/src/generators/stories/stories.ts b/packages/react/src/generators/stories/stories.ts index 3fee97c4af01f2..30afa8be0d42b6 100644 --- a/packages/react/src/generators/stories/stories.ts +++ b/packages/react/src/generators/stories/stories.ts @@ -13,10 +13,10 @@ import { ProjectConfiguration, Tree, visitNotIgnoredFiles, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { basename, join } from 'path'; import minimatch = require('minimatch'); -import { ensureTypescript } from '@nrwl/js/src/utils/typescript/ensure-typescript'; +import { ensureTypescript } from '@nx/js/src/utils/typescript/ensure-typescript'; let tsModule: typeof import('typescript'); @@ -34,7 +34,7 @@ export async function projectRootPath( config: ProjectConfiguration ): Promise { const { findStorybookAndBuildTargetsAndCompiler } = await import( - '@nrwl/storybook/src/utils/utilities' + '@nx/storybook/src/utils/utilities' ); let projectDir: string; if (config.projectType === 'application') { @@ -89,9 +89,7 @@ export async function createAllStories( cypressProject?: string, ignorePaths?: string[] ) { - const { isTheFileAStory } = await import( - '@nrwl/storybook/src/utils/utilities' - ); + const { isTheFileAStory } = await import('@nx/storybook/src/utils/utilities'); const projects = getProjects(tree); const projectConfiguration = projects.get(projectName); const { sourceRoot, root } = projectConfiguration; diff --git a/packages/react/src/generators/storybook-configuration/configuration.spec.ts b/packages/react/src/generators/storybook-configuration/configuration.spec.ts index 067bc3afe06fed..fda21288dcfaea 100644 --- a/packages/react/src/generators/storybook-configuration/configuration.spec.ts +++ b/packages/react/src/generators/storybook-configuration/configuration.spec.ts @@ -1,14 +1,14 @@ -import { installedCypressVersion } from '@nrwl/cypress/src/utils/cypress-version'; -import { logger, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { Linter } from '@nrwl/linter'; +import { installedCypressVersion } from '@nx/cypress/src/utils/cypress-version'; +import { logger, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { Linter } from '@nx/linter'; import applicationGenerator from '../application/application'; import componentGenerator from '../component/component'; import libraryGenerator from '../library/library'; import storybookConfigurationGenerator from './configuration'; // need to mock cypress otherwise it'll use the nx installed version from package.json // which is v9 while we are testing for the new v10 version -jest.mock('@nrwl/cypress/src/utils/cypress-version'); +jest.mock('@nx/cypress/src/utils/cypress-version'); // nested code imports graph from the repo, which might have innacurate graph version jest.mock('nx/src/project-graph/project-graph', () => ({ ...jest.requireActual('nx/src/project-graph/project-graph'), diff --git a/packages/react/src/generators/storybook-configuration/configuration.ts b/packages/react/src/generators/storybook-configuration/configuration.ts index 9ddb6bc3b20423..1419e84421c876 100644 --- a/packages/react/src/generators/storybook-configuration/configuration.ts +++ b/packages/react/src/generators/storybook-configuration/configuration.ts @@ -6,13 +6,13 @@ import { logger, readProjectConfiguration, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { nxVersion } from '../../utils/versions'; async function generateStories(host: Tree, schema: StorybookConfigureSchema) { - ensurePackage('@nrwl/cypress', nxVersion); + ensurePackage('@nx/cypress', nxVersion); const { getE2eProjectName } = await import( - '@nrwl/cypress/src/utils/project-name' + '@nx/cypress/src/utils/project-name' ); const projectConfig = readProjectConfiguration(host, schema.name); const cypressProject = getE2eProjectName( @@ -36,8 +36,8 @@ export async function storybookConfigurationGenerator( schema: StorybookConfigureSchema ) { const { configurationGenerator } = ensurePackage< - typeof import('@nrwl/storybook') - >('@nrwl/storybook', nxVersion); + typeof import('@nx/storybook') + >('@nx/storybook', nxVersion); let bundler = schema.bundler ?? 'webpack'; const projectConfig = readProjectConfiguration(host, schema.name); diff --git a/packages/react/src/generators/storybook-configuration/schema.d.ts b/packages/react/src/generators/storybook-configuration/schema.d.ts index 71129cbc948fdd..ffd93e2fb4d8dd 100644 --- a/packages/react/src/generators/storybook-configuration/schema.d.ts +++ b/packages/react/src/generators/storybook-configuration/schema.d.ts @@ -1,4 +1,4 @@ -import { Linter } from '@nrwl/linter'; +import { Linter } from '@nx/linter'; export interface StorybookConfigureSchema { name: string; diff --git a/packages/react/src/migrations/update-12-0-0/remove-react-redux-types-package.ts b/packages/react/src/migrations/update-12-0-0/remove-react-redux-types-package.ts index 242d033576d97e..8985b1af77ef9b 100644 --- a/packages/react/src/migrations/update-12-0-0/remove-react-redux-types-package.ts +++ b/packages/react/src/migrations/update-12-0-0/remove-react-redux-types-package.ts @@ -1,4 +1,4 @@ -import { removeDependenciesFromPackageJson, Tree } from '@nrwl/devkit'; +import { removeDependenciesFromPackageJson, Tree } from '@nx/devkit'; export async function removeReactReduxTypesFromPackageJson(host: Tree) { return removeDependenciesFromPackageJson( diff --git a/packages/react/src/migrations/update-12-0-0/update-emotion-setup.spec.ts b/packages/react/src/migrations/update-12-0-0/update-emotion-setup.spec.ts index 5e8143db59774f..230a9b19acf112 100644 --- a/packages/react/src/migrations/update-12-0-0/update-emotion-setup.spec.ts +++ b/packages/react/src/migrations/update-12-0-0/update-emotion-setup.spec.ts @@ -1,5 +1,5 @@ -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { addProjectConfiguration, readJson, Tree } from '@nrwl/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { addProjectConfiguration, readJson, Tree } from '@nx/devkit'; import { updateEmotionSetup } from './update-emotion-setup'; describe('Update babel config for emotion', () => { diff --git a/packages/react/src/migrations/update-12-0-0/update-emotion-setup.ts b/packages/react/src/migrations/update-12-0-0/update-emotion-setup.ts index 50ca6b56281a5e..f1554ff178d077 100644 --- a/packages/react/src/migrations/update-12-0-0/update-emotion-setup.ts +++ b/packages/react/src/migrations/update-12-0-0/update-emotion-setup.ts @@ -1,4 +1,4 @@ -import { formatFiles, getProjects, Tree, updateJson } from '@nrwl/devkit'; +import { formatFiles, getProjects, Tree, updateJson } from '@nx/devkit'; export async function updateEmotionSetup(host: Tree) { const projects = getProjects(host); diff --git a/packages/react/src/migrations/update-12-0-0/use-react-jsx-in-tsconfig.spec.ts b/packages/react/src/migrations/update-12-0-0/use-react-jsx-in-tsconfig.spec.ts index 382c279f5d7559..b647652fb1f097 100644 --- a/packages/react/src/migrations/update-12-0-0/use-react-jsx-in-tsconfig.spec.ts +++ b/packages/react/src/migrations/update-12-0-0/use-react-jsx-in-tsconfig.spec.ts @@ -1,5 +1,5 @@ -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { addProjectConfiguration, readJson, Tree } from '@nrwl/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { addProjectConfiguration, readJson, Tree } from '@nx/devkit'; import { useReactJsxInTsconfig } from './use-react-jsx-in-tsconfig'; describe('Update tsconfig for React apps', () => { diff --git a/packages/react/src/migrations/update-12-0-0/use-react-jsx-in-tsconfig.ts b/packages/react/src/migrations/update-12-0-0/use-react-jsx-in-tsconfig.ts index d414ed408cc316..d2b8ba57a19c28 100644 --- a/packages/react/src/migrations/update-12-0-0/use-react-jsx-in-tsconfig.ts +++ b/packages/react/src/migrations/update-12-0-0/use-react-jsx-in-tsconfig.ts @@ -1,4 +1,4 @@ -import { formatFiles, getProjects, Tree, updateJson } from '@nrwl/devkit'; +import { formatFiles, getProjects, Tree, updateJson } from '@nx/devkit'; export async function useReactJsxInTsconfig(host: Tree) { const projects = getProjects(host); diff --git a/packages/react/src/migrations/update-12-8-0/update-12-8-0.ts b/packages/react/src/migrations/update-12-8-0/update-12-8-0.ts index 909cc00cbeeb97..03a416eef3160b 100644 --- a/packages/react/src/migrations/update-12-8-0/update-12-8-0.ts +++ b/packages/react/src/migrations/update-12-8-0/update-12-8-0.ts @@ -1,4 +1,4 @@ -import { addDependenciesToPackageJson, Tree } from '@nrwl/devkit'; +import { addDependenciesToPackageJson, Tree } from '@nx/devkit'; export async function removeReactReduxTypesFromPackageJson(host: Tree) { return addDependenciesToPackageJson( diff --git a/packages/react/src/migrations/update-13-0-0/migrate-storybook-to-webpack-5.spec.ts b/packages/react/src/migrations/update-13-0-0/migrate-storybook-to-webpack-5.spec.ts index aae9b0bf2f9dfb..14672a7fca487d 100644 --- a/packages/react/src/migrations/update-13-0-0/migrate-storybook-to-webpack-5.spec.ts +++ b/packages/react/src/migrations/update-13-0-0/migrate-storybook-to-webpack-5.spec.ts @@ -3,8 +3,8 @@ import { readJson, Tree, updateJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { migrateStorybookToWebPack5 } from './migrate-storybook-to-webpack-5'; describe('migrateStorybookToWebPack5', () => { diff --git a/packages/react/src/migrations/update-13-0-0/migrate-storybook-to-webpack-5.ts b/packages/react/src/migrations/update-13-0-0/migrate-storybook-to-webpack-5.ts index d05226e1822d77..3cc9b990fb6d46 100644 --- a/packages/react/src/migrations/update-13-0-0/migrate-storybook-to-webpack-5.ts +++ b/packages/react/src/migrations/update-13-0-0/migrate-storybook-to-webpack-5.ts @@ -1,4 +1,4 @@ -import { Tree, logger, updateJson, readJson } from '@nrwl/devkit'; +import { Tree, logger, updateJson, readJson } from '@nx/devkit'; import { migrateToWebPack5, workspaceHasStorybookForReact, diff --git a/packages/react/src/migrations/update-13-0-0/update-emotion-setup.spec.ts b/packages/react/src/migrations/update-13-0-0/update-emotion-setup.spec.ts index fa58b752dccd0f..76f3bfec3f4bcd 100644 --- a/packages/react/src/migrations/update-13-0-0/update-emotion-setup.spec.ts +++ b/packages/react/src/migrations/update-13-0-0/update-emotion-setup.spec.ts @@ -1,5 +1,5 @@ -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { addProjectConfiguration, readJson, Tree } from '@nrwl/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { addProjectConfiguration, readJson, Tree } from '@nx/devkit'; import { updateEmotionSetup } from './update-emotion-setup'; describe('Update tsconfig config for Emotion', () => { diff --git a/packages/react/src/migrations/update-13-0-0/update-emotion-setup.ts b/packages/react/src/migrations/update-13-0-0/update-emotion-setup.ts index 7978f7dd91dcc5..c78099d8e2c4d6 100644 --- a/packages/react/src/migrations/update-13-0-0/update-emotion-setup.ts +++ b/packages/react/src/migrations/update-13-0-0/update-emotion-setup.ts @@ -4,7 +4,7 @@ import { Tree, readJson, updateJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; export async function updateEmotionSetup(host: Tree) { const projects = getProjects(host); diff --git a/packages/react/src/migrations/update-13-0-0/webpack5-changes-utils.spec.ts b/packages/react/src/migrations/update-13-0-0/webpack5-changes-utils.spec.ts index 74a7d2cb0cee62..c1b2938962c967 100644 --- a/packages/react/src/migrations/update-13-0-0/webpack5-changes-utils.spec.ts +++ b/packages/react/src/migrations/update-13-0-0/webpack5-changes-utils.spec.ts @@ -1,6 +1,6 @@ -import { addProjectConfiguration, Tree, updateJson } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { allReactProjectsWithStorybookConfiguration } from '@nrwl/react/src/migrations/update-13-0-0/webpack5-changes-utils'; +import { addProjectConfiguration, Tree, updateJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { allReactProjectsWithStorybookConfiguration } from '@nx/react/src/migrations/update-13-0-0/webpack5-changes-utils'; describe('webpack5ChangesUtils', () => { let tree: Tree; diff --git a/packages/react/src/migrations/update-13-0-0/webpack5-changes-utils.ts b/packages/react/src/migrations/update-13-0-0/webpack5-changes-utils.ts index d856735cefa592..d1648a4283e3cc 100644 --- a/packages/react/src/migrations/update-13-0-0/webpack5-changes-utils.ts +++ b/packages/react/src/migrations/update-13-0-0/webpack5-changes-utils.ts @@ -1,10 +1,10 @@ -import { getProjects, Tree } from '@nrwl/devkit'; +import { getProjects, Tree } from '@nx/devkit'; import { logger, formatFiles, applyChangesToString, ChangeType, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import ts = require('typescript'); import { findNodes } from 'nx/src/utils/typescript'; diff --git a/packages/react/src/migrations/update-13-10-0/update-13-10-0.spec.ts b/packages/react/src/migrations/update-13-10-0/update-13-10-0.spec.ts index dd7d1490b3dd42..787c2e05f4c4f3 100644 --- a/packages/react/src/migrations/update-13-10-0/update-13-10-0.spec.ts +++ b/packages/react/src/migrations/update-13-10-0/update-13-10-0.spec.ts @@ -1,5 +1,5 @@ -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { writeJson, readJson, Tree } from '@nrwl/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { writeJson, readJson, Tree } from '@nx/devkit'; import migrate from './update-13-10-0'; describe('Update tsconfig for React apps', () => { diff --git a/packages/react/src/migrations/update-13-10-0/update-13-10-0.ts b/packages/react/src/migrations/update-13-10-0/update-13-10-0.ts index a4e30afbbe9059..7658ba64e85d1d 100644 --- a/packages/react/src/migrations/update-13-10-0/update-13-10-0.ts +++ b/packages/react/src/migrations/update-13-10-0/update-13-10-0.ts @@ -3,7 +3,7 @@ import { logger, readJson, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; // Putting this here because React Native 0.67 is incompatible with React 18. // Waiting for 0.68 to come out with support for React 18. diff --git a/packages/react/src/migrations/update-14-0-0/add-default-development-configurations.spec.ts b/packages/react/src/migrations/update-14-0-0/add-default-development-configurations.spec.ts index c25e721f5effbc..305c0f17634e5a 100644 --- a/packages/react/src/migrations/update-14-0-0/add-default-development-configurations.spec.ts +++ b/packages/react/src/migrations/update-14-0-0/add-default-development-configurations.spec.ts @@ -1,8 +1,5 @@ -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { - addProjectConfiguration, - readProjectConfiguration, -} from '@nrwl/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { addProjectConfiguration, readProjectConfiguration } from '@nx/devkit'; import update from './add-default-development-configurations'; describe('React default development configuration', () => { diff --git a/packages/react/src/migrations/update-14-0-0/add-default-development-configurations.ts b/packages/react/src/migrations/update-14-0-0/add-default-development-configurations.ts index e52d7482c8a7b8..955705183d78ce 100644 --- a/packages/react/src/migrations/update-14-0-0/add-default-development-configurations.ts +++ b/packages/react/src/migrations/update-14-0-0/add-default-development-configurations.ts @@ -3,7 +3,7 @@ import { getProjects, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; export async function update(tree: Tree) { const projects = getProjects(tree); diff --git a/packages/react/src/migrations/update-14-0-0/replace-testing-library-react-hook.spec.ts b/packages/react/src/migrations/update-14-0-0/replace-testing-library-react-hook.spec.ts index 21681b72062227..51fe9e83816923 100644 --- a/packages/react/src/migrations/update-14-0-0/replace-testing-library-react-hook.spec.ts +++ b/packages/react/src/migrations/update-14-0-0/replace-testing-library-react-hook.spec.ts @@ -1,10 +1,10 @@ -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { addProjectConfiguration, readJson, stripIndents, writeJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import update from './replace-testing-library-react-hook'; describe('Remove deprecated hook testing package', () => { diff --git a/packages/react/src/migrations/update-14-0-0/replace-testing-library-react-hook.ts b/packages/react/src/migrations/update-14-0-0/replace-testing-library-react-hook.ts index 2709f98dab5395..ba42fceca82793 100644 --- a/packages/react/src/migrations/update-14-0-0/replace-testing-library-react-hook.ts +++ b/packages/react/src/migrations/update-14-0-0/replace-testing-library-react-hook.ts @@ -3,7 +3,7 @@ import { Tree, getProjects, removeDependenciesFromPackageJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; export async function update(tree: Tree) { const projects = getProjects(tree); diff --git a/packages/react/src/migrations/update-14-0-0/update-react-dom-render-for-v18.spec.ts b/packages/react/src/migrations/update-14-0-0/update-react-dom-render-for-v18.spec.ts index 52c912b1775147..fe5bcbcc2806ef 100644 --- a/packages/react/src/migrations/update-14-0-0/update-react-dom-render-for-v18.spec.ts +++ b/packages/react/src/migrations/update-14-0-0/update-react-dom-render-for-v18.spec.ts @@ -1,10 +1,10 @@ -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { addProjectConfiguration, readJson, stripIndents, writeJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import update from './update-react-dom-render-for-v18'; describe('React update for Nx 14', () => { diff --git a/packages/react/src/migrations/update-14-0-0/update-react-dom-render-for-v18.ts b/packages/react/src/migrations/update-14-0-0/update-react-dom-render-for-v18.ts index ef5e3eb1c7d6a7..c23bf678b75271 100644 --- a/packages/react/src/migrations/update-14-0-0/update-react-dom-render-for-v18.ts +++ b/packages/react/src/migrations/update-14-0-0/update-react-dom-render-for-v18.ts @@ -6,7 +6,7 @@ import { stripIndents, Tree, formatFiles, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { findNodes } from 'nx/src/utils/typescript'; import * as ts from 'typescript'; diff --git a/packages/react/src/migrations/update-14-1-0/update-external-emotion-jsx-runtime.spec.ts b/packages/react/src/migrations/update-14-1-0/update-external-emotion-jsx-runtime.spec.ts index fd388f21b2714f..77dcb48c6a3eef 100644 --- a/packages/react/src/migrations/update-14-1-0/update-external-emotion-jsx-runtime.spec.ts +++ b/packages/react/src/migrations/update-14-1-0/update-external-emotion-jsx-runtime.spec.ts @@ -1,8 +1,5 @@ -import { - addProjectConfiguration, - readProjectConfiguration, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { addProjectConfiguration, readProjectConfiguration } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { updateExternalEmotionJsxRuntime } from './update-external-emotion-jsx-runtime'; diff --git a/packages/react/src/migrations/update-14-1-0/update-external-emotion-jsx-runtime.ts b/packages/react/src/migrations/update-14-1-0/update-external-emotion-jsx-runtime.ts index e8593f2df1778c..e64860333429ee 100644 --- a/packages/react/src/migrations/update-14-1-0/update-external-emotion-jsx-runtime.ts +++ b/packages/react/src/migrations/update-14-1-0/update-external-emotion-jsx-runtime.ts @@ -2,8 +2,8 @@ import { readProjectConfiguration, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; +} from '@nx/devkit'; +import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils'; export async function updateExternalEmotionJsxRuntime(tree: Tree) { forEachExecutorOptions( diff --git a/packages/react/src/migrations/update-14-6-0/add-preset-jest-config.spec.ts b/packages/react/src/migrations/update-14-6-0/add-preset-jest-config.spec.ts index 3fe7e3875bcb73..86cb3a29a01e61 100644 --- a/packages/react/src/migrations/update-14-6-0/add-preset-jest-config.spec.ts +++ b/packages/react/src/migrations/update-14-6-0/add-preset-jest-config.spec.ts @@ -2,8 +2,8 @@ import { addProjectConfiguration, ProjectConfiguration, Tree, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { addBabelJestPresetTransformerOption } from './add-preset-jest-config'; function setup( diff --git a/packages/react/src/migrations/update-14-6-0/add-preset-jest-config.ts b/packages/react/src/migrations/update-14-6-0/add-preset-jest-config.ts index c7665e858b55aa..b71d9f3fcb303c 100644 --- a/packages/react/src/migrations/update-14-6-0/add-preset-jest-config.ts +++ b/packages/react/src/migrations/update-14-6-0/add-preset-jest-config.ts @@ -3,9 +3,9 @@ import { ProjectConfiguration, readProjectConfiguration, Tree, -} from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; -import type { JestExecutorOptions } from '@nrwl/jest/src/executors/jest/schema'; +} from '@nx/devkit'; +import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils'; +import type { JestExecutorOptions } from '@nx/jest/src/executors/jest/schema'; import { tsquery } from '@phenomnomnominal/tsquery'; import { StringLiteral } from 'typescript'; diff --git a/packages/react/src/migrations/update-15-3-0/install-webpack-rollup-dependencies.spec.ts b/packages/react/src/migrations/update-15-3-0/install-webpack-rollup-dependencies.spec.ts index 7f1f04f193a168..dd268dbba06b04 100644 --- a/packages/react/src/migrations/update-15-3-0/install-webpack-rollup-dependencies.spec.ts +++ b/packages/react/src/migrations/update-15-3-0/install-webpack-rollup-dependencies.spec.ts @@ -1,5 +1,5 @@ -import { addProjectConfiguration, readJson } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { addProjectConfiguration, readJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { installWebpackRollupDependencies } from './install-webpack-rollup-dependencies'; describe('installWebpackRollupDependencies', () => { diff --git a/packages/react/src/migrations/update-15-3-0/install-webpack-rollup-dependencies.ts b/packages/react/src/migrations/update-15-3-0/install-webpack-rollup-dependencies.ts index 1c77f3f341cc31..0730af4b906f10 100644 --- a/packages/react/src/migrations/update-15-3-0/install-webpack-rollup-dependencies.ts +++ b/packages/react/src/migrations/update-15-3-0/install-webpack-rollup-dependencies.ts @@ -1,4 +1,4 @@ -import { addDependenciesToPackageJson, getProjects, Tree } from '@nrwl/devkit'; +import { addDependenciesToPackageJson, getProjects, Tree } from '@nx/devkit'; import { nxVersion } from '../../utils/versions'; export function installWebpackRollupDependencies(tree: Tree) { const projects = getProjects(tree); diff --git a/packages/react/src/migrations/update-15-3-0/update-rollup-executor.spec.ts b/packages/react/src/migrations/update-15-3-0/update-rollup-executor.spec.ts index 399894c53ebd5d..2657520253b449 100644 --- a/packages/react/src/migrations/update-15-3-0/update-rollup-executor.spec.ts +++ b/packages/react/src/migrations/update-15-3-0/update-rollup-executor.spec.ts @@ -3,8 +3,8 @@ import { ProjectConfiguration, readProjectConfiguration, Tree, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { updateRollupExecutor } from './update-rollup-executor'; describe('updateRollupExecutor', () => { diff --git a/packages/react/src/migrations/update-15-3-0/update-rollup-executor.ts b/packages/react/src/migrations/update-15-3-0/update-rollup-executor.ts index d38e7b6d833a75..3c0c6c18a1b627 100644 --- a/packages/react/src/migrations/update-15-3-0/update-rollup-executor.ts +++ b/packages/react/src/migrations/update-15-3-0/update-rollup-executor.ts @@ -1,4 +1,4 @@ -import { getProjects, Tree, updateProjectConfiguration } from '@nrwl/devkit'; +import { getProjects, Tree, updateProjectConfiguration } from '@nx/devkit'; export function updateRollupExecutor(tree: Tree) { const projects = getProjects(tree); diff --git a/packages/react/src/migrations/update-15-6-3/webpack-config-setup.spec.ts b/packages/react/src/migrations/update-15-6-3/webpack-config-setup.spec.ts index 1dd67348e63ba9..1720c1f2dad336 100644 --- a/packages/react/src/migrations/update-15-6-3/webpack-config-setup.spec.ts +++ b/packages/react/src/migrations/update-15-6-3/webpack-config-setup.spec.ts @@ -1,9 +1,9 @@ -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { addProjectConfiguration, readProjectConfiguration, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import webpackConfigSetup from './webpack-config-setup'; describe('15.6.3 migration (setup webpack.config file for React apps)', () => { diff --git a/packages/react/src/migrations/update-15-6-3/webpack-config-setup.ts b/packages/react/src/migrations/update-15-6-3/webpack-config-setup.ts index f256c4457661e3..b8cce3363a810a 100644 --- a/packages/react/src/migrations/update-15-6-3/webpack-config-setup.ts +++ b/packages/react/src/migrations/update-15-6-3/webpack-config-setup.ts @@ -4,10 +4,10 @@ import { readProjectConfiguration, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; +} from '@nx/devkit'; +import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils'; import { basename } from 'path'; -import type { WebpackExecutorOptions } from '@nrwl/webpack'; +import type { WebpackExecutorOptions } from '@nx/webpack'; export default async function (tree: Tree) { // Since projects can have multiple configurations, we need to know if the default options diff --git a/packages/react/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts b/packages/react/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts new file mode 100644 index 00000000000000..63e3112c5825d7 --- /dev/null +++ b/packages/react/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts @@ -0,0 +1,37 @@ +import { Tree, readJson, updateJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import replacePackage from './update-16-0-0-add-nx-packages'; + +describe('update-16-0-0-add-nx-packages', () => { + let tree: Tree; + beforeEach(() => { + tree = createTreeWithEmptyWorkspace(); + + updateJson(tree, 'package.json', (json) => { + json.devDependencies['@nrwl/react'] = '16.0.0'; + return json; + }); + }); + + it('should remove the dependency on @nrwl/react', async () => { + await replacePackage(tree); + + expect( + readJson(tree, 'package.json').dependencies['@nrwl/react'] + ).not.toBeDefined(); + expect( + readJson(tree, 'package.json').devDependencies['@nrwl/react'] + ).not.toBeDefined(); + }); + + it('should add a dependency on @nx/react', async () => { + await replacePackage(tree); + + const packageJson = readJson(tree, 'package.json'); + const newDependencyVersion = + packageJson.devDependencies['@nx/react'] ?? + packageJson.dependencies['@nx/react']; + + expect(newDependencyVersion).toBeDefined(); + }); +}); diff --git a/packages/react/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts b/packages/react/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts new file mode 100644 index 00000000000000..951796732f0416 --- /dev/null +++ b/packages/react/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts @@ -0,0 +1,8 @@ +import { Tree, formatFiles } from '@nx/devkit'; +import { replaceNrwlPackageWithNxPackage } from '@nx/devkit/src/utils/replace-package'; + +export default async function replacePackage(tree: Tree): Promise { + await replaceNrwlPackageWithNxPackage(tree, '@nrwl/react', '@nx/react'); + + await formatFiles(tree); +} diff --git a/packages/react/src/module-federation/ast-utils.spec.ts b/packages/react/src/module-federation/ast-utils.spec.ts index 94ab033beee67a..0b79423575fc93 100644 --- a/packages/react/src/module-federation/ast-utils.spec.ts +++ b/packages/react/src/module-federation/ast-utils.spec.ts @@ -1,5 +1,5 @@ import * as ts from 'typescript'; -import { applyChangesToString, stripIndents } from '@nrwl/devkit'; +import { applyChangesToString, stripIndents } from '@nx/devkit'; import { addRemoteRoute, addRemoteDefinition, diff --git a/packages/react/src/module-federation/ast-utils.ts b/packages/react/src/module-federation/ast-utils.ts index c784722980b323..920578a3bec081 100644 --- a/packages/react/src/module-federation/ast-utils.ts +++ b/packages/react/src/module-federation/ast-utils.ts @@ -1,12 +1,12 @@ import type * as ts from 'typescript'; -import { ChangeType, StringChange } from '@nrwl/devkit'; +import { ChangeType, StringChange } from '@nx/devkit'; import { findNodes } from 'nx/src/utils/typescript'; import { findClosestOpening, findElements, addImport, } from '../utils/ast-utils'; -import { ensureTypescript } from '@nrwl/js/src/utils/typescript/ensure-typescript'; +import { ensureTypescript } from '@nx/js/src/utils/typescript/ensure-typescript'; let tsModule: typeof import('typescript'); diff --git a/packages/react/src/module-federation/load-config.ts b/packages/react/src/module-federation/load-config.ts index a8d249b334b5e7..ff00ee36476de3 100644 --- a/packages/react/src/module-federation/load-config.ts +++ b/packages/react/src/module-federation/load-config.ts @@ -1,4 +1,4 @@ -import { ExecutorContext } from '@nrwl/devkit'; +import { ExecutorContext } from '@nx/devkit'; import { join } from 'path'; import { ModuleFederationConfig } from './models'; diff --git a/packages/react/src/module-federation/package-json.ts b/packages/react/src/module-federation/package-json.ts index b0fbff11dea14c..64d424bf87c4f6 100644 --- a/packages/react/src/module-federation/package-json.ts +++ b/packages/react/src/module-federation/package-json.ts @@ -1,4 +1,4 @@ -import { joinPathFragments, readJsonFile, workspaceRoot } from '@nrwl/devkit'; +import { joinPathFragments, readJsonFile, workspaceRoot } from '@nx/devkit'; import { existsSync } from 'fs'; export function readRootPackageJson(): { diff --git a/packages/react/src/module-federation/utils.ts b/packages/react/src/module-federation/utils.ts index 6191e5ca9888f7..47d28700d5c719 100644 --- a/packages/react/src/module-federation/utils.ts +++ b/packages/react/src/module-federation/utils.ts @@ -11,7 +11,7 @@ import { readCachedProjectGraph, sharePackages, shareWorkspaceLibraries, -} from '@nrwl/devkit'; +} from '@nx/devkit'; export async function getModuleFederationConfig( mfConfig: ModuleFederationConfig, diff --git a/packages/react/src/module-federation/with-module-federation-ssr.ts b/packages/react/src/module-federation/with-module-federation-ssr.ts index c361ceb2bc0709..807e7ec160b509 100644 --- a/packages/react/src/module-federation/with-module-federation-ssr.ts +++ b/packages/react/src/module-federation/with-module-federation-ssr.ts @@ -1,4 +1,4 @@ -import { ModuleFederationConfig } from '@nrwl/devkit'; +import { ModuleFederationConfig } from '@nx/devkit'; import { readCachedProjectConfiguration } from 'nx/src/project-graph/project-graph'; import { getModuleFederationConfig } from './utils'; diff --git a/packages/react/src/module-federation/with-module-federation.ts b/packages/react/src/module-federation/with-module-federation.ts index f7213f2caee480..28a341d4f85981 100644 --- a/packages/react/src/module-federation/with-module-federation.ts +++ b/packages/react/src/module-federation/with-module-federation.ts @@ -1,8 +1,8 @@ -import { ModuleFederationConfig } from '@nrwl/devkit'; +import { ModuleFederationConfig } from '@nx/devkit'; import { readCachedProjectConfiguration } from 'nx/src/project-graph/project-graph'; import { getModuleFederationConfig } from './utils'; import ModuleFederationPlugin = require('webpack/lib/container/ModuleFederationPlugin'); -import type { AsyncNxWebpackPlugin, NxWebpackPlugin } from '@nrwl/webpack'; +import type { AsyncNxWebpackPlugin, NxWebpackPlugin } from '@nx/webpack'; function determineRemoteUrl(remote: string) { const remoteConfiguration = readCachedProjectConfiguration(remote); diff --git a/packages/react/src/rules/add-styled-dependencies.ts b/packages/react/src/rules/add-styled-dependencies.ts index ac5c93aef52ec2..9bd910121a9cb1 100644 --- a/packages/react/src/rules/add-styled-dependencies.ts +++ b/packages/react/src/rules/add-styled-dependencies.ts @@ -1,5 +1,5 @@ import { CSS_IN_JS_DEPENDENCIES } from '../utils/styled'; -import { addDependenciesToPackageJson, Tree } from '@nrwl/devkit'; +import { addDependenciesToPackageJson, Tree } from '@nx/devkit'; export function addStyledModuleDependencies(host: Tree, styledModule: string) { const extraDependencies = CSS_IN_JS_DEPENDENCIES[styledModule]; diff --git a/packages/react/src/rules/update-module-federation-project.ts b/packages/react/src/rules/update-module-federation-project.ts index e622c10af033df..a7156348367603 100644 --- a/packages/react/src/rules/update-module-federation-project.ts +++ b/packages/react/src/rules/update-module-federation-project.ts @@ -4,7 +4,7 @@ import { readProjectConfiguration, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { nxVersion } from '../utils/versions'; export function updateModuleFederationProject( diff --git a/packages/react/src/utils/ast-utils.spec.ts b/packages/react/src/utils/ast-utils.spec.ts index 8553e04177ef42..d97b3b3e53606a 100644 --- a/packages/react/src/utils/ast-utils.spec.ts +++ b/packages/react/src/utils/ast-utils.spec.ts @@ -1,7 +1,7 @@ import * as utils from './ast-utils'; import * as ts from 'typescript'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { applyChangesToString, Tree } from '@nrwl/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { applyChangesToString, Tree } from '@nx/devkit'; describe('findDefaultExport', () => { it('should find exported variable', () => { diff --git a/packages/react/src/utils/ast-utils.ts b/packages/react/src/utils/ast-utils.ts index 69ccd77a3455db..938f0578424d85 100644 --- a/packages/react/src/utils/ast-utils.ts +++ b/packages/react/src/utils/ast-utils.ts @@ -1,12 +1,7 @@ import type * as ts from 'typescript'; import { findNodes } from 'nx/src/utils/typescript'; -import { - ChangeType, - logger, - StringChange, - StringInsertion, -} from '@nrwl/devkit'; -import { ensureTypescript } from '@nrwl/js/src/utils/typescript/ensure-typescript'; +import { ChangeType, logger, StringChange, StringInsertion } from '@nx/devkit'; +import { ensureTypescript } from '@nx/js/src/utils/typescript/ensure-typescript'; let tsModule: typeof import('typescript'); diff --git a/packages/react/src/utils/component-props.ts b/packages/react/src/utils/component-props.ts index eb8aa249b1c9ff..c8c3bf8bd3c570 100644 --- a/packages/react/src/utils/component-props.ts +++ b/packages/react/src/utils/component-props.ts @@ -1,4 +1,4 @@ -import { ensureTypescript } from '@nrwl/js/src/utils/typescript/ensure-typescript'; +import { ensureTypescript } from '@nx/js/src/utils/typescript/ensure-typescript'; import type * as ts from 'typescript'; import { getComponentPropsInterface } from './ast-utils'; diff --git a/packages/react/src/utils/create-ts-config.ts b/packages/react/src/utils/create-ts-config.ts index 2e1ba17c5952c6..a86d0ca52b53c0 100644 --- a/packages/react/src/utils/create-ts-config.ts +++ b/packages/react/src/utils/create-ts-config.ts @@ -1,5 +1,5 @@ import { Tree } from 'nx/src/generators/tree'; -import * as shared from '@nrwl/js/src/utils/typescript/create-ts-config'; +import * as shared from '@nx/js/src/utils/typescript/create-ts-config'; import { updateJson, writeJson } from 'nx/src/generators/utils/json'; export function createTsConfig( diff --git a/packages/react/src/utils/format-file.ts b/packages/react/src/utils/format-file.ts index e10b69524fda84..650cf4e50c3225 100644 --- a/packages/react/src/utils/format-file.ts +++ b/packages/react/src/utils/format-file.ts @@ -1,5 +1,5 @@ import { format } from 'prettier'; -import { stripIndents } from '@nrwl/devkit'; +import { stripIndents } from '@nx/devkit'; export function formatFile(content, ...values) { return format(stripIndents(content, values), { diff --git a/packages/react/src/utils/lint.ts b/packages/react/src/utils/lint.ts index 4cf982fbac1d33..f68196d831641c 100644 --- a/packages/react/src/utils/lint.ts +++ b/packages/react/src/utils/lint.ts @@ -1,4 +1,4 @@ -import { offsetFromRoot } from '@nrwl/devkit'; +import { offsetFromRoot } from '@nx/devkit'; import type { Linter } from 'eslint'; import { eslintPluginImportVersion, diff --git a/packages/react/src/utils/testing-generators.ts b/packages/react/src/utils/testing-generators.ts index 69abd898992ad3..18dd46793e5cf3 100644 --- a/packages/react/src/utils/testing-generators.ts +++ b/packages/react/src/utils/testing-generators.ts @@ -1,6 +1,6 @@ -import { addProjectConfiguration, names, Tree } from '@nrwl/devkit'; +import { addProjectConfiguration, names, Tree } from '@nx/devkit'; import applicationGenerator from '../generators/application/application'; -import { Linter } from '@nrwl/linter'; +import { Linter } from '@nx/linter'; export async function createApp(tree: Tree, appName: string): Promise { await applicationGenerator(tree, { diff --git a/packages/react/tailwind.ts b/packages/react/tailwind.ts index 378bce16b58a98..12f448ac9509f1 100644 --- a/packages/react/tailwind.ts +++ b/packages/react/tailwind.ts @@ -1,4 +1,4 @@ -import { createGlobPatternsForDependencies as jsGenerateGlobs } from '@nrwl/js/src/utils/generate-globs'; +import { createGlobPatternsForDependencies as jsGenerateGlobs } from '@nx/js/src/utils/generate-globs'; /** * Generates a set of glob patterns based off the source root of the app and its dependencies diff --git a/packages/rollup/migrations.json b/packages/rollup/migrations.json index 6923a80fb28dde..ad135dd94f011d 100644 --- a/packages/rollup/migrations.json +++ b/packages/rollup/migrations.json @@ -5,6 +5,12 @@ "version": "15.0.0-beta.0", "description": "Adds babel.config.json to the hash of all tasks", "factory": "./src/migrations/update-15-0-0/add-babel-inputs" + }, + "update-16-0-0-add-nx-packages": { + "cli": "nx", + "version": "16.0.0-beta.1", + "description": "Replace @nrwl/rollup with @nx/rollup", + "implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages" } }, "packageJsonUpdates": {} diff --git a/packages/rollup/migrations.spec.ts b/packages/rollup/migrations.spec.ts index c8f2f175a1244b..06fde8470ed1ca 100644 --- a/packages/rollup/migrations.spec.ts +++ b/packages/rollup/migrations.spec.ts @@ -1,11 +1,14 @@ import path = require('path'); import json = require('./migrations.json'); +import { MigrationsJsonEntry } from 'nx/src/config/misc-interfaces'; describe('Rollup migrations', () => { it('should have valid paths', () => { - Object.values(json.generators).forEach((m) => { + Object.values(json.generators).forEach((m: MigrationsJsonEntry) => { expect(() => - require.resolve(path.join(__dirname, `${m.factory}.ts`)) + require.resolve( + path.join(__dirname, `${m.factory ?? m.implementation}.ts`) + ) ).not.toThrow(); }); }); diff --git a/packages/rollup/package.json b/packages/rollup/package.json index 1271e2d3699514..29f9e17b6409f9 100644 --- a/packages/rollup/package.json +++ b/packages/rollup/package.json @@ -1,5 +1,5 @@ { - "name": "@nrwl/rollup", + "name": "@nx/rollup", "version": "0.0.1", "private": false, "description": "The Nx Plugin for Rollup contains executors and generators that support building applications using Rollup.", @@ -29,9 +29,6 @@ "migrations": "./migrations.json" }, "dependencies": { - "@nrwl/devkit": "file:../devkit", - "@nrwl/js": "file:../js", - "@nrwl/workspace": "file:../workspace", "@rollup/plugin-babel": "^5.3.0", "@rollup/plugin-commonjs": "^20.0.0", "@rollup/plugin-image": "^2.1.0", @@ -48,7 +45,9 @@ "rollup-plugin-postcss": "^4.0.1", "rollup-plugin-typescript2": "0.34.1", "rxjs": "^6.5.4", - "tslib": "^2.3.0" + "tslib": "^2.3.0", + "@nx/devkit": "file:../devkit", + "@nx/js": "file:../js" }, "publishConfig": { "access": "public" diff --git a/packages/rollup/project.json b/packages/rollup/project.json index 594382b068ec00..db47231437e51c 100644 --- a/packages/rollup/project.json +++ b/packages/rollup/project.json @@ -48,7 +48,10 @@ "executor": "nx:run-commands", "outputs": ["{workspaceRoot}/build/packages/rollup"], "options": { - "command": "node ./scripts/copy-readme.js rollup" + "commands": [ + "node ./scripts/copy-readme.js rollup", + "node ./scripts/add-dependency-to-build.js rollup @nrwl/rollup" + ] } }, "lint": {} diff --git a/packages/rollup/src/executors/rollup/compat.ts b/packages/rollup/src/executors/rollup/compat.ts index e9dd420efbac07..4681ebee42de54 100644 --- a/packages/rollup/src/executors/rollup/compat.ts +++ b/packages/rollup/src/executors/rollup/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import rollupExecutor from './rollup.impl'; diff --git a/packages/rollup/src/executors/rollup/lib/analyze-plugin.ts b/packages/rollup/src/executors/rollup/lib/analyze-plugin.ts index 244a24f6110175..74f64efcea36dc 100644 --- a/packages/rollup/src/executors/rollup/lib/analyze-plugin.ts +++ b/packages/rollup/src/executors/rollup/lib/analyze-plugin.ts @@ -1,5 +1,5 @@ import * as chalk from 'chalk'; -import { logger } from '@nrwl/devkit'; +import { logger } from '@nx/devkit'; const formatBytes = (bytes) => { if (bytes === 0) return '0 Byte'; diff --git a/packages/rollup/src/executors/rollup/lib/normalize.ts b/packages/rollup/src/executors/rollup/lib/normalize.ts index 2a3717e4a070a7..567dabade76f88 100644 --- a/packages/rollup/src/executors/rollup/lib/normalize.ts +++ b/packages/rollup/src/executors/rollup/lib/normalize.ts @@ -1,6 +1,6 @@ import { basename, dirname, join, relative, resolve } from 'path'; import { statSync } from 'fs'; -import { normalizePath } from '@nrwl/devkit'; +import { normalizePath } from '@nx/devkit'; import type { AssetGlobPattern, RollupExecutorOptions } from '../schema'; diff --git a/packages/rollup/src/executors/rollup/lib/update-package-json.ts b/packages/rollup/src/executors/rollup/lib/update-package-json.ts index 02c7937a1c7dbd..84645d173eacaa 100644 --- a/packages/rollup/src/executors/rollup/lib/update-package-json.ts +++ b/packages/rollup/src/executors/rollup/lib/update-package-json.ts @@ -4,7 +4,7 @@ import { ProjectGraphProjectNode } from 'nx/src/config/project-graph'; import { DependentBuildableProjectNode, updateBuildableProjectPackageJsonDependencies, -} from '@nrwl/js/src/utils/buildable-libs-utils'; +} from '@nx/js/src/utils/buildable-libs-utils'; import { writeJsonFile } from 'nx/src/utils/fileutils'; import { PackageJson } from 'nx/src/utils/package-json'; import { NormalizedRollupExecutorOptions } from './normalize'; diff --git a/packages/rollup/src/executors/rollup/lib/validate-types.ts b/packages/rollup/src/executors/rollup/lib/validate-types.ts index 1c89c1ca0ffffb..59628f2f316e70 100644 --- a/packages/rollup/src/executors/rollup/lib/validate-types.ts +++ b/packages/rollup/src/executors/rollup/lib/validate-types.ts @@ -1,4 +1,4 @@ -import { printDiagnostics, runTypeCheck } from '@nrwl/js'; +import { printDiagnostics, runTypeCheck } from '@nx/js'; import { join } from 'path'; export async function validateTypes(opts: { diff --git a/packages/rollup/src/executors/rollup/rollup.impl.spec.ts b/packages/rollup/src/executors/rollup/rollup.impl.spec.ts index 1ce20162544fe5..e04f60b1c024c3 100644 --- a/packages/rollup/src/executors/rollup/rollup.impl.spec.ts +++ b/packages/rollup/src/executors/rollup/rollup.impl.spec.ts @@ -1,4 +1,4 @@ -import { ExecutorContext } from '@nrwl/devkit'; +import { ExecutorContext } from '@nx/devkit'; import * as rollup from 'rollup'; import { RollupExecutorOptions } from './schema'; import { createRollupOptions } from './rollup.impl'; diff --git a/packages/rollup/src/executors/rollup/rollup.impl.ts b/packages/rollup/src/executors/rollup/rollup.impl.ts index 781052a87ceb0e..d4fdf1f29694f7 100644 --- a/packages/rollup/src/executors/rollup/rollup.impl.ts +++ b/packages/rollup/src/executors/rollup/rollup.impl.ts @@ -6,15 +6,15 @@ import { getBabelInputPlugin } from '@rollup/plugin-babel'; import { dirname, join, parse, resolve } from 'path'; import { from, Observable, of } from 'rxjs'; import { catchError, concatMap, last, scan, tap } from 'rxjs/operators'; -import { eachValueFrom } from '@nrwl/devkit/src/utils/rxjs-for-await'; +import { eachValueFrom } from '@nx/devkit/src/utils/rxjs-for-await'; import * as autoprefixer from 'autoprefixer'; -import type { ExecutorContext } from '@nrwl/devkit'; -import { joinPathFragments, logger, names, readJsonFile } from '@nrwl/devkit'; +import type { ExecutorContext } from '@nx/devkit'; +import { joinPathFragments, logger, names, readJsonFile } from '@nx/devkit'; import { calculateProjectDependencies, computeCompilerOptionsPaths, DependentBuildableProjectNode, -} from '@nrwl/js/src/utils/buildable-libs-utils'; +} from '@nx/js/src/utils/buildable-libs-utils'; import nodeResolve from '@rollup/plugin-node-resolve'; import { AssetGlobPattern, RollupExecutorOptions } from './schema'; diff --git a/packages/rollup/src/generators/init/init.spec.ts b/packages/rollup/src/generators/init/init.spec.ts index af84514e6d847d..0ff46d283c3115 100644 --- a/packages/rollup/src/generators/init/init.spec.ts +++ b/packages/rollup/src/generators/init/init.spec.ts @@ -1,5 +1,5 @@ -import { Tree, readJson, NxJsonConfiguration, updateJson } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { Tree, readJson, NxJsonConfiguration, updateJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { nxVersion } from '../../utils/versions'; import { rollupInitGenerator } from './init'; diff --git a/packages/rollup/src/generators/init/init.ts b/packages/rollup/src/generators/init/init.ts index b5916b8e2a60c3..5185daeffced4b 100644 --- a/packages/rollup/src/generators/init/init.ts +++ b/packages/rollup/src/generators/init/init.ts @@ -4,15 +4,15 @@ import { formatFiles, GeneratorCallback, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { Schema } from './schema'; -import { swcCoreVersion, swcHelpersVersion } from '@nrwl/js/src/utils/versions'; +import { swcCoreVersion, swcHelpersVersion } from '@nx/js/src/utils/versions'; import { nxVersion, swcLoaderVersion, tsLibVersion, } from '../../utils/versions'; -import { addBabelInputs } from '@nrwl/js/src/utils/add-babel-inputs'; +import { addBabelInputs } from '@nx/js/src/utils/add-babel-inputs'; export async function rollupInitGenerator(tree: Tree, schema: Schema) { let task: GeneratorCallback; diff --git a/packages/rollup/src/generators/rollup-project/rollup-project.spec.ts b/packages/rollup/src/generators/rollup-project/rollup-project.spec.ts index 330250573ee089..9bd7c3287f942d 100644 --- a/packages/rollup/src/generators/rollup-project/rollup-project.spec.ts +++ b/packages/rollup/src/generators/rollup-project/rollup-project.spec.ts @@ -4,8 +4,8 @@ import { readProjectConfiguration, Tree, writeJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { rollupProjectGenerator } from './rollup-project'; diff --git a/packages/rollup/src/generators/rollup-project/rollup-project.ts b/packages/rollup/src/generators/rollup-project/rollup-project.ts index 2f38d0033b0392..8723dcfda19e1e 100644 --- a/packages/rollup/src/generators/rollup-project/rollup-project.ts +++ b/packages/rollup/src/generators/rollup-project/rollup-project.ts @@ -1,4 +1,4 @@ -import type { Tree } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; import { convertNxGenerator, formatFiles, @@ -8,7 +8,7 @@ import { readProjectConfiguration, updateProjectConfiguration, writeJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { rollupInitGenerator } from '../init/init'; import { RollupExecutorOptions } from '../../executors/rollup/schema'; diff --git a/packages/rollup/src/migrations/update-15-0-0/add-babel-inputs.spec.ts b/packages/rollup/src/migrations/update-15-0-0/add-babel-inputs.spec.ts index 00c3a49afb8dc0..3ac51f6d230330 100644 --- a/packages/rollup/src/migrations/update-15-0-0/add-babel-inputs.spec.ts +++ b/packages/rollup/src/migrations/update-15-0-0/add-babel-inputs.spec.ts @@ -1,5 +1,5 @@ -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { readNxJson, Tree, updateNxJson } from '@nrwl/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { readNxJson, Tree, updateNxJson } from '@nx/devkit'; import addBabelInputs from './add-babel-inputs'; describe('15.0.0 migration (add-babel-inputs)', () => { diff --git a/packages/rollup/src/migrations/update-15-0-0/add-babel-inputs.ts b/packages/rollup/src/migrations/update-15-0-0/add-babel-inputs.ts index a3fa30fda387ea..aa7e721076fe20 100644 --- a/packages/rollup/src/migrations/update-15-0-0/add-babel-inputs.ts +++ b/packages/rollup/src/migrations/update-15-0-0/add-babel-inputs.ts @@ -1,5 +1,5 @@ -import { formatFiles, Tree } from '@nrwl/devkit'; -import { addBabelInputs } from '@nrwl/js/src/utils/add-babel-inputs'; +import { formatFiles, Tree } from '@nx/devkit'; +import { addBabelInputs } from '@nx/js/src/utils/add-babel-inputs'; export default async function (tree: Tree) { addBabelInputs(tree); diff --git a/packages/rollup/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts b/packages/rollup/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts new file mode 100644 index 00000000000000..6b5307270d6bfd --- /dev/null +++ b/packages/rollup/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts @@ -0,0 +1,37 @@ +import { Tree, readJson, updateJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import replacePackage from './update-16-0-0-add-nx-packages'; + +describe('update-16-0-0-add-nx-packages', () => { + let tree: Tree; + beforeEach(() => { + tree = createTreeWithEmptyWorkspace(); + + updateJson(tree, 'package.json', (json) => { + json.devDependencies['@nrwl/rollup'] = '16.0.0'; + return json; + }); + }); + + it('should remove the dependency on @nrwl/rollup', async () => { + await replacePackage(tree); + + expect( + readJson(tree, 'package.json').dependencies['@nrwl/rollup'] + ).not.toBeDefined(); + expect( + readJson(tree, 'package.json').devDependencies['@nrwl/rollup'] + ).not.toBeDefined(); + }); + + it('should add a dependency on @nx/rollup', async () => { + await replacePackage(tree); + + const packageJson = readJson(tree, 'package.json'); + const newDependencyVersion = + packageJson.devDependencies['@nx/rollup'] ?? + packageJson.dependencies['@nx/rollup']; + + expect(newDependencyVersion).toBeDefined(); + }); +}); diff --git a/packages/rollup/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts b/packages/rollup/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts new file mode 100644 index 00000000000000..785c3859ba5aab --- /dev/null +++ b/packages/rollup/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts @@ -0,0 +1,8 @@ +import { Tree, formatFiles } from '@nx/devkit'; +import { replaceNrwlPackageWithNxPackage } from '@nx/devkit/src/utils/replace-package'; + +export default async function replacePackage(tree: Tree): Promise { + await replaceNrwlPackageWithNxPackage(tree, '@nrwl/rollup', '@nx/rollup'); + + await formatFiles(tree); +} diff --git a/packages/storybook/migrations.json b/packages/storybook/migrations.json index f4af3c0c123fdd..f33e5298da3071 100644 --- a/packages/storybook/migrations.json +++ b/packages/storybook/migrations.json @@ -41,6 +41,12 @@ "version": "15.7.0-beta.0", "description": "Add @storybook/addon-essentials to all project-level configs and attempt to remove root config.", "factory": "./src/migrations/update-15-7-0/add-addon-essentials-to-all" + }, + "update-16-0-0-add-nx-packages": { + "cli": "nx", + "version": "16.0.0-beta.1", + "description": "Replace @nrwl/storybook with @nx/storybook", + "implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages" } }, "packageJsonUpdates": { diff --git a/packages/storybook/migrations.spec.ts b/packages/storybook/migrations.spec.ts index 209b7e4f9b6b51..294c032036c071 100644 --- a/packages/storybook/migrations.spec.ts +++ b/packages/storybook/migrations.spec.ts @@ -1,11 +1,14 @@ import path = require('path'); import json = require('./migrations.json'); +import { MigrationsJsonEntry } from 'nx/src/config/misc-interfaces'; describe('Storybook migrations', () => { it('should have valid paths', () => { - Object.values(json.generators).forEach((m) => { + Object.values(json.generators).forEach((m: MigrationsJsonEntry) => { expect(() => - require.resolve(path.join(__dirname, `${m.factory}.ts`)) + require.resolve( + path.join(__dirname, `${m.factory ?? m.implementation}.ts`) + ) ).not.toThrow(); }); }); diff --git a/packages/storybook/package.json b/packages/storybook/package.json index c3757ebc9ff437..dc03414f5b0af9 100644 --- a/packages/storybook/package.json +++ b/packages/storybook/package.json @@ -1,5 +1,5 @@ { - "name": "@nrwl/storybook", + "name": "@nx/storybook", "version": "0.0.1", "private": false, "description": "The Nx Plugin for Storybook contains executors and generators for allowing your workspace to use the powerful Storybook integration testing & documenting capabilities.", @@ -30,15 +30,15 @@ "migrations": "./migrations.json" }, "dependencies": { - "@nrwl/cypress": "file:../cypress", - "@nrwl/devkit": "file:../devkit", - "@nrwl/linter": "file:../linter", - "@nrwl/js": "file:../js", - "@nrwl/workspace": "file:../workspace", "dotenv": "~10.0.0", "enquirer": "~2.3.6", "@phenomnomnominal/tsquery": "~5.0.1", - "semver": "7.3.4" + "semver": "7.3.4", + "@nx/cypress": "file:../cypress", + "@nx/devkit": "file:../devkit", + "@nx/js": "file:../js", + "@nx/linter": "file:../linter", + "@nx/workspace": "file:../workspace" }, "publishConfig": { "access": "public" diff --git a/packages/storybook/presets/cypress.ts b/packages/storybook/presets/cypress.ts index ece9209cf92b1d..30d5e9bf3774ae 100644 --- a/packages/storybook/presets/cypress.ts +++ b/packages/storybook/presets/cypress.ts @@ -1,4 +1,4 @@ -import { nxE2EPreset } from '@nrwl/cypress/plugins/cypress-preset'; +import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset'; export function nxE2EStorybookPreset(filePath: string) { return { diff --git a/packages/storybook/project.json b/packages/storybook/project.json index 1487baf067f9fa..e29dd74f6839f1 100644 --- a/packages/storybook/project.json +++ b/packages/storybook/project.json @@ -68,7 +68,10 @@ "executor": "nx:run-commands", "outputs": ["{workspaceRoot}/build/packages/storybook"], "options": { - "command": "node ./scripts/copy-readme.js storybook" + "commands": [ + "node ./scripts/copy-readme.js storybook", + "node ./scripts/add-dependency-to-build.js storybook @nrwl/storybook" + ] } }, "lint": {} diff --git a/packages/storybook/src/executors/build-storybook/build-storybook.impl.spec.ts b/packages/storybook/src/executors/build-storybook/build-storybook.impl.spec.ts index 067ea5f9ccab1a..4ddebbe3aabb3c 100644 --- a/packages/storybook/src/executors/build-storybook/build-storybook.impl.spec.ts +++ b/packages/storybook/src/executors/build-storybook/build-storybook.impl.spec.ts @@ -1,4 +1,4 @@ -import { ExecutorContext, logger } from '@nrwl/devkit'; +import { ExecutorContext, logger } from '@nx/devkit'; import { join } from 'path'; import storybookBuilder from './build-storybook.impl'; import * as executorContext from '../../utils/test-configs/executor-context.json'; diff --git a/packages/storybook/src/executors/build-storybook/build-storybook.impl.ts b/packages/storybook/src/executors/build-storybook/build-storybook.impl.ts index 9b37d37028041e..af817d7c5b7880 100644 --- a/packages/storybook/src/executors/build-storybook/build-storybook.impl.ts +++ b/packages/storybook/src/executors/build-storybook/build-storybook.impl.ts @@ -1,4 +1,4 @@ -import { ExecutorContext, logger } from '@nrwl/devkit'; +import { ExecutorContext, logger } from '@nx/devkit'; import * as build from '@storybook/core-server'; import { CLIOptions } from '@storybook/types'; // TODO(katerina): Remove when Storybook 7 import 'dotenv/config'; diff --git a/packages/storybook/src/executors/build-storybook/compat.ts b/packages/storybook/src/executors/build-storybook/compat.ts index b339343ae7a2ab..3edcd4e5839746 100644 --- a/packages/storybook/src/executors/build-storybook/compat.ts +++ b/packages/storybook/src/executors/build-storybook/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import buildStorybookExecutor from './build-storybook.impl'; export default convertNxExecutor(buildStorybookExecutor); diff --git a/packages/storybook/src/executors/storybook/compat.ts b/packages/storybook/src/executors/storybook/compat.ts index e49c497e58c5b1..0297cd761897b0 100644 --- a/packages/storybook/src/executors/storybook/compat.ts +++ b/packages/storybook/src/executors/storybook/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import storybookExecutor from './storybook.impl'; export default convertNxExecutor(storybookExecutor); diff --git a/packages/storybook/src/executors/storybook/storybook.impl.spec.ts b/packages/storybook/src/executors/storybook/storybook.impl.spec.ts index 0b70ab7689a74b..37de4075f301e4 100644 --- a/packages/storybook/src/executors/storybook/storybook.impl.spec.ts +++ b/packages/storybook/src/executors/storybook/storybook.impl.spec.ts @@ -1,7 +1,7 @@ import { fs as fsMock, vol } from 'memfs'; import * as fs from 'fs'; -import { ExecutorContext } from '@nrwl/devkit'; +import { ExecutorContext } from '@nx/devkit'; jest.mock('@storybook/core-server', () => ({ buildDev: jest.fn().mockImplementation(() => Promise.resolve()), diff --git a/packages/storybook/src/executors/storybook/storybook.impl.ts b/packages/storybook/src/executors/storybook/storybook.impl.ts index 8eb515dad0612e..c4ff7f89ce69a3 100644 --- a/packages/storybook/src/executors/storybook/storybook.impl.ts +++ b/packages/storybook/src/executors/storybook/storybook.impl.ts @@ -1,4 +1,4 @@ -import { ExecutorContext } from '@nrwl/devkit'; +import { ExecutorContext } from '@nx/devkit'; import * as build from '@storybook/core-server'; import 'dotenv/config'; import { diff --git a/packages/storybook/src/executors/utils.spec.ts b/packages/storybook/src/executors/utils.spec.ts index f160b81e41833c..941c4c9c3d8a4b 100644 --- a/packages/storybook/src/executors/utils.spec.ts +++ b/packages/storybook/src/executors/utils.spec.ts @@ -1,5 +1,5 @@ import * as ts from 'typescript'; -import { stripIndents } from '@nrwl/devkit'; +import { stripIndents } from '@nx/devkit'; import { builderIsWebpackButNotWebpack5 } from './utils'; describe('testing utilities', () => { diff --git a/packages/storybook/src/executors/utils.ts b/packages/storybook/src/executors/utils.ts index a1d1657b7bb1e8..22420eef968e02 100644 --- a/packages/storybook/src/executors/utils.ts +++ b/packages/storybook/src/executors/utils.ts @@ -1,4 +1,4 @@ -import { joinPathFragments, logger } from '@nrwl/devkit'; +import { joinPathFragments, logger } from '@nx/devkit'; import { findNodes } from 'nx/src/utils/typescript'; import 'dotenv/config'; import { existsSync, readFileSync } from 'fs'; diff --git a/packages/storybook/src/generators/configuration/configuration-nested.spec.ts b/packages/storybook/src/generators/configuration/configuration-nested.spec.ts index 2d237fd36b649b..c2f94304a58a4b 100644 --- a/packages/storybook/src/generators/configuration/configuration-nested.spec.ts +++ b/packages/storybook/src/generators/configuration/configuration-nested.spec.ts @@ -4,8 +4,8 @@ import { Tree, updateJson, writeJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import * as enquirer from 'enquirer'; import configurationGenerator from './configuration'; diff --git a/packages/storybook/src/generators/configuration/configuration-v7.spec.ts b/packages/storybook/src/generators/configuration/configuration-v7.spec.ts index 1b7704f8b9f076..bd18d53da25a7b 100644 --- a/packages/storybook/src/generators/configuration/configuration-v7.spec.ts +++ b/packages/storybook/src/generators/configuration/configuration-v7.spec.ts @@ -8,12 +8,12 @@ import { Tree, updateJson, writeJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import * as enquirer from 'enquirer'; -import { Linter } from '@nrwl/linter'; -import { libraryGenerator } from '@nrwl/js'; +import { Linter } from '@nx/linter'; +import { libraryGenerator } from '@nx/js'; import { TsConfig } from '../../utils/utilities'; import { storybook7Version } from '../../utils/versions'; import configurationGenerator from './configuration'; diff --git a/packages/storybook/src/generators/configuration/configuration.spec.ts b/packages/storybook/src/generators/configuration/configuration.spec.ts index d6758a5e24df04..215eb1c0d7cfb6 100644 --- a/packages/storybook/src/generators/configuration/configuration.spec.ts +++ b/packages/storybook/src/generators/configuration/configuration.spec.ts @@ -6,12 +6,12 @@ import { Tree, updateJson, writeJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import * as enquirer from 'enquirer'; -import { Linter } from '@nrwl/linter'; -import { libraryGenerator } from '@nrwl/js'; +import { Linter } from '@nx/linter'; +import { libraryGenerator } from '@nx/js'; import { nxVersion } from '../../utils/versions'; import { TsConfig } from '../../utils/utilities'; import configurationGenerator from './configuration'; diff --git a/packages/storybook/src/generators/configuration/configuration.ts b/packages/storybook/src/generators/configuration/configuration.ts index 38f4c165a344fc..9d1e1194e85c0a 100644 --- a/packages/storybook/src/generators/configuration/configuration.ts +++ b/packages/storybook/src/generators/configuration/configuration.ts @@ -7,7 +7,7 @@ import { readProjectConfiguration, runTasksInSerial, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { cypressProjectGenerator } from '../cypress-project/cypress-project'; import { StorybookConfigureSchema } from './schema'; @@ -27,7 +27,7 @@ import { projectIsRootProjectInStandaloneWorkspace, updateLintConfig, } from './lib/util-functions'; -import { Linter } from '@nrwl/linter'; +import { Linter } from '@nx/linter'; import { findStorybookAndBuildTargetsAndCompiler, storybookMajorVersion, diff --git a/packages/storybook/src/generators/configuration/lib/user-prompts.ts b/packages/storybook/src/generators/configuration/lib/user-prompts.ts index b65a0f65de120c..6d3918282a6a32 100644 --- a/packages/storybook/src/generators/configuration/lib/user-prompts.ts +++ b/packages/storybook/src/generators/configuration/lib/user-prompts.ts @@ -1,5 +1,5 @@ -import { UiFramework, UiFramework7 } from '@nrwl/storybook/src/utils/models'; -import { Constants } from '@nrwl/storybook/src/utils/utilities'; +import { UiFramework, UiFramework7 } from '../../../utils/models'; +import { Constants } from '../../../utils/utilities'; import { prompt } from 'enquirer'; import { StorybookConfigureSchema } from '../schema'; diff --git a/packages/storybook/src/generators/configuration/lib/util-functions.ts b/packages/storybook/src/generators/configuration/lib/util-functions.ts index 2898c9eeebe3be..ac52d408be382d 100644 --- a/packages/storybook/src/generators/configuration/lib/util-functions.ts +++ b/packages/storybook/src/generators/configuration/lib/util-functions.ts @@ -16,9 +16,9 @@ import { updateProjectConfiguration, workspaceRoot, writeJson, -} from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; -import { Linter } from '@nrwl/linter'; +} from '@nx/devkit'; +import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils'; +import { Linter } from '@nx/linter'; import { join, relative } from 'path'; import { dedupe, @@ -143,10 +143,7 @@ export function addAngularStorybookTask( } export function addStaticTarget(tree: Tree, opts: StorybookConfigureSchema) { - const nrwlWeb = ensurePackage( - '@nrwl/web', - nxVersion - ); + const nrwlWeb = ensurePackage('@nx/web', nxVersion); nrwlWeb.webStaticServeGenerator(tree, { buildTarget: `${opts.name}:build-storybook`, outputPath: joinPathFragments('dist/storybook', opts.name), diff --git a/packages/storybook/src/generators/configuration/schema.d.ts b/packages/storybook/src/generators/configuration/schema.d.ts index 7f2cacadbb281e..4533ec27f74a30 100644 --- a/packages/storybook/src/generators/configuration/schema.d.ts +++ b/packages/storybook/src/generators/configuration/schema.d.ts @@ -1,4 +1,4 @@ -import { Linter } from '@nrwl/linter'; +import { Linter } from '@nx/linter'; import { UiFramework7, UiFramework } from '../../utils/models'; export interface StorybookConfigureSchema { diff --git a/packages/storybook/src/generators/cypress-project/cypress-project.spec.ts b/packages/storybook/src/generators/cypress-project/cypress-project.spec.ts index 2da2b928892bbe..dae678454f7f21 100644 --- a/packages/storybook/src/generators/cypress-project/cypress-project.spec.ts +++ b/packages/storybook/src/generators/cypress-project/cypress-project.spec.ts @@ -1,11 +1,11 @@ -import { installedCypressVersion } from '@nrwl/cypress/src/utils/cypress-version'; -import { readJson, readProjectConfiguration, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { Linter } from '@nrwl/linter'; -import { libraryGenerator } from '@nrwl/js'; +import { installedCypressVersion } from '@nx/cypress/src/utils/cypress-version'; +import { readJson, readProjectConfiguration, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { Linter } from '@nx/linter'; +import { libraryGenerator } from '@nx/js'; import { cypressProjectGenerator } from './cypress-project'; -jest.mock('@nrwl/cypress/src/utils/cypress-version'); +jest.mock('@nx/cypress/src/utils/cypress-version'); describe('@nrwl/storybook:cypress-project', () => { let tree: Tree; let mockedInstalledCypressVersion: jest.Mock< diff --git a/packages/storybook/src/generators/cypress-project/cypress-project.ts b/packages/storybook/src/generators/cypress-project/cypress-project.ts index 59c9a751a20395..27d66cc6f2cea6 100644 --- a/packages/storybook/src/generators/cypress-project/cypress-project.ts +++ b/packages/storybook/src/generators/cypress-project/cypress-project.ts @@ -1,11 +1,11 @@ import { cypressInitGenerator as _cypressInitGenerator, cypressProjectGenerator as _cypressProjectGenerator, -} from '@nrwl/cypress'; +} from '@nx/cypress'; import { getE2eProjectName, getUnscopedLibName, -} from '@nrwl/cypress/src/utils/project-name'; +} from '@nx/cypress/src/utils/project-name'; import { convertNxGenerator, formatFiles, @@ -18,8 +18,8 @@ import { Tree, updateJson, updateProjectConfiguration, -} from '@nrwl/devkit'; -import { Linter } from '@nrwl/linter'; +} from '@nx/devkit'; +import { Linter } from '@nx/linter'; import { join } from 'path'; import { safeFileDelete } from '../../utils/utilities'; diff --git a/packages/storybook/src/generators/init/init.spec.ts b/packages/storybook/src/generators/init/init.spec.ts index b7ba92ca357bca..cb75be97bd60e1 100644 --- a/packages/storybook/src/generators/init/init.spec.ts +++ b/packages/storybook/src/generators/init/init.spec.ts @@ -3,8 +3,8 @@ import { NxJsonConfiguration, readJson, Tree, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { storybookVersion } from '../../utils/versions'; import { initGenerator } from './init'; diff --git a/packages/storybook/src/generators/init/init.ts b/packages/storybook/src/generators/init/init.ts index 75b5c2838f0f2e..1737418786ae5a 100644 --- a/packages/storybook/src/generators/init/init.ts +++ b/packages/storybook/src/generators/init/init.ts @@ -8,8 +8,8 @@ import { Tree, updateJson, updateNxJson, -} from '@nrwl/devkit'; -import { initGenerator as jsInitGenerator } from '@nrwl/js'; +} from '@nx/devkit'; +import { initGenerator as jsInitGenerator } from '@nx/js'; import { babelCoreVersion, diff --git a/packages/storybook/src/generators/migrate-7/calling-storybook-cli.ts b/packages/storybook/src/generators/migrate-7/calling-storybook-cli.ts index 108b62b474df94..e38d783b2663b4 100644 --- a/packages/storybook/src/generators/migrate-7/calling-storybook-cli.ts +++ b/packages/storybook/src/generators/migrate-7/calling-storybook-cli.ts @@ -1,4 +1,4 @@ -import { output } from '@nrwl/devkit'; +import { output } from '@nx/devkit'; import { execSync } from 'child_process'; import { Schema } from './schema'; diff --git a/packages/storybook/src/generators/migrate-7/helper-functions.spec.ts b/packages/storybook/src/generators/migrate-7/helper-functions.spec.ts index 17ccfe5b32614c..65de35a035c88c 100644 --- a/packages/storybook/src/generators/migrate-7/helper-functions.spec.ts +++ b/packages/storybook/src/generators/migrate-7/helper-functions.spec.ts @@ -4,8 +4,8 @@ import { ProjectConfiguration, readProjectConfiguration, Tree, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import * as allProjects from './test-configs/all-projects.json'; import { addViteConfigFilePathInFrameworkOptions, diff --git a/packages/storybook/src/generators/migrate-7/helper-functions.ts b/packages/storybook/src/generators/migrate-7/helper-functions.ts index 593bd9da2a05c5..19ac4d220323a0 100644 --- a/packages/storybook/src/generators/migrate-7/helper-functions.ts +++ b/packages/storybook/src/generators/migrate-7/helper-functions.ts @@ -8,8 +8,8 @@ import { Tree, updateProjectConfiguration, workspaceRoot, -} from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; +} from '@nx/devkit'; +import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils'; import { tsquery } from '@phenomnomnominal/tsquery'; import ts = require('typescript'); import * as fs from 'fs'; diff --git a/packages/storybook/src/generators/migrate-7/migrate-7.ts b/packages/storybook/src/generators/migrate-7/migrate-7.ts index 4518858c13a3cd..1daeee2eed3e17 100644 --- a/packages/storybook/src/generators/migrate-7/migrate-7.ts +++ b/packages/storybook/src/generators/migrate-7/migrate-7.ts @@ -6,7 +6,7 @@ import { readJson, runTasksInSerial, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { output } from 'nx/src/utils/output'; import { litVersion } from '../../utils/versions'; diff --git a/packages/storybook/src/migrations/update-13-4-6/set-project-build-config.ts b/packages/storybook/src/migrations/update-13-4-6/set-project-build-config.ts index a7dd382f80d061..5ae34163b54e9c 100644 --- a/packages/storybook/src/migrations/update-13-4-6/set-project-build-config.ts +++ b/packages/storybook/src/migrations/update-13-4-6/set-project-build-config.ts @@ -4,7 +4,7 @@ import { formatFiles, updateProjectConfiguration, getProjects, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { findStorybookAndBuildTargetsAndCompiler } from '../../utils/utilities'; export default async function setProjectBuildConfig(tree: Tree) { diff --git a/packages/storybook/src/migrations/update-14-0-0/migrate-defaults-5-to-6/migrate-defaults-5-to-6.spec.ts b/packages/storybook/src/migrations/update-14-0-0/migrate-defaults-5-to-6/migrate-defaults-5-to-6.spec.ts index 0416b15360cf7c..60270612ccf67f 100644 --- a/packages/storybook/src/migrations/update-14-0-0/migrate-defaults-5-to-6/migrate-defaults-5-to-6.spec.ts +++ b/packages/storybook/src/migrations/update-14-0-0/migrate-defaults-5-to-6/migrate-defaults-5-to-6.spec.ts @@ -4,8 +4,8 @@ import { Tree, updateJson, updateProjectConfiguration, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { storybookVersion } from '../../../utils/versions'; import configurationGenerator from '../../../generators/configuration/configuration'; import { diff --git a/packages/storybook/src/migrations/update-14-0-0/migrate-defaults-5-to-6/migrate-defaults-5-to-6.ts b/packages/storybook/src/migrations/update-14-0-0/migrate-defaults-5-to-6/migrate-defaults-5-to-6.ts index 5d9ee4c67b410c..78b50f14555a62 100644 --- a/packages/storybook/src/migrations/update-14-0-0/migrate-defaults-5-to-6/migrate-defaults-5-to-6.ts +++ b/packages/storybook/src/migrations/update-14-0-0/migrate-defaults-5-to-6/migrate-defaults-5-to-6.ts @@ -7,9 +7,9 @@ import { Tree, updateJson, visitNotIgnoredFiles, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { lte } from 'semver'; -import { checkAndCleanWithSemver } from '@nrwl/devkit/src/utils/semver'; +import { checkAndCleanWithSemver } from '@nx/devkit/src/utils/semver'; import { storybookVersion } from '../../../utils/versions'; import { createProjectStorybookDir } from '../../../generators/configuration/lib/util-functions'; import { StorybookConfigureSchema } from '../../../generators/configuration/schema'; diff --git a/packages/storybook/src/migrations/update-14-0-0/migrate-stories-to-6-2/migrate-stories-to-6-2.spec.ts b/packages/storybook/src/migrations/update-14-0-0/migrate-stories-to-6-2/migrate-stories-to-6-2.spec.ts index 83369028e6a2b2..0fd3f486761762 100644 --- a/packages/storybook/src/migrations/update-14-0-0/migrate-stories-to-6-2/migrate-stories-to-6-2.spec.ts +++ b/packages/storybook/src/migrations/update-14-0-0/migrate-stories-to-6-2/migrate-stories-to-6-2.spec.ts @@ -2,10 +2,10 @@ import { readProjectConfiguration, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; -import { joinPathFragments, writeJson } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { storybookVersion } from '@nrwl/storybook'; +} from '@nx/devkit'; +import { joinPathFragments, writeJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { storybookVersion } from '@nx/storybook'; import { findNodes } from 'nx/src/utils/typescript'; import * as ts from 'typescript'; import { SyntaxKind } from 'typescript'; @@ -14,8 +14,8 @@ import { migrateStoriesTo62Generator } from './migrate-stories-to-6-2'; import { overrideCollectionResolutionForTesting, wrapAngularDevkitSchematic, -} from '@nrwl/devkit/ngcli-adapter'; -import { getTsSourceFile } from '@nrwl/storybook/src/utils/utilities'; +} from '@nx/devkit/ngcli-adapter'; +import { getTsSourceFile } from '@nx/storybook/src/utils/utilities'; // nested code imports graph from the repo, which might have innacurate graph version jest.mock('nx/src/project-graph/project-graph', () => ({ @@ -35,7 +35,7 @@ const runAngularLibrarySchematic = wrapAngularDevkitSchematic( ); const runAngularStorybookSchematic = wrapAngularDevkitSchematic( - '@nrwl/angular', + '@nx/angular', 'storybook-configuration' ); diff --git a/packages/storybook/src/migrations/update-14-0-0/migrate-stories-to-6-2/migrate-stories-to-6-2.ts b/packages/storybook/src/migrations/update-14-0-0/migrate-stories-to-6-2/migrate-stories-to-6-2.ts index f907177590385b..68bb23faa4af63 100644 --- a/packages/storybook/src/migrations/update-14-0-0/migrate-stories-to-6-2/migrate-stories-to-6-2.ts +++ b/packages/storybook/src/migrations/update-14-0-0/migrate-stories-to-6-2/migrate-stories-to-6-2.ts @@ -7,8 +7,8 @@ import { stripIndents, Tree, visitNotIgnoredFiles, -} from '@nrwl/devkit'; -import { fileExists } from '@nrwl/workspace/src/utilities/fileutils'; +} from '@nx/devkit'; +import { fileExists } from '@nx/workspace/src/utilities/fileutils'; import { findNodes } from 'nx/src/utils/typescript'; import { join, normalize } from 'path'; import { SyntaxKind } from 'typescript'; diff --git a/packages/storybook/src/migrations/update-14-0-0/migrate-to-storybook-6.ts b/packages/storybook/src/migrations/update-14-0-0/migrate-to-storybook-6.ts index 3e84c94c746fb4..c6af606dd3770e 100644 --- a/packages/storybook/src/migrations/update-14-0-0/migrate-to-storybook-6.ts +++ b/packages/storybook/src/migrations/update-14-0-0/migrate-to-storybook-6.ts @@ -1,4 +1,4 @@ -import { Tree } from '@nrwl/devkit'; +import { Tree } from '@nx/devkit'; import { migrateDefaultsGenerator } from './migrate-defaults-5-to-6/migrate-defaults-5-to-6'; import { migrateStoriesTo62Generator } from './migrate-stories-to-6-2/migrate-stories-to-6-2'; diff --git a/packages/storybook/src/migrations/update-14-1-8/change-storybook-targets-generator.spec.ts b/packages/storybook/src/migrations/update-14-1-8/change-storybook-targets-generator.spec.ts index 7a92ac86326d45..892d0b1579ec07 100644 --- a/packages/storybook/src/migrations/update-14-1-8/change-storybook-targets-generator.spec.ts +++ b/packages/storybook/src/migrations/update-14-1-8/change-storybook-targets-generator.spec.ts @@ -1,5 +1,5 @@ -import { addProjectConfiguration, readNxJson, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { addProjectConfiguration, readNxJson, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import changeStorybookTargetsGenerator from './change-storybook-targets-generator'; import * as defaultConfig from './test-configs/default-config.json'; import * as customNames from './test-configs/custom-names-config.json'; diff --git a/packages/storybook/src/migrations/update-14-1-8/change-storybook-targets-generator.ts b/packages/storybook/src/migrations/update-14-1-8/change-storybook-targets-generator.ts index 9224f6753aaa25..e02e94ac7e86ff 100644 --- a/packages/storybook/src/migrations/update-14-1-8/change-storybook-targets-generator.ts +++ b/packages/storybook/src/migrations/update-14-1-8/change-storybook-targets-generator.ts @@ -8,7 +8,7 @@ import { ProjectConfiguration, Target, convertNxGenerator, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { findStorybookAndBuildTargetsAndCompiler } from '../../utils/utilities'; export async function changeStorybookTargetsGenerator(tree: Tree) { diff --git a/packages/storybook/src/migrations/update-14-1-8/change-storybook-targets.ts b/packages/storybook/src/migrations/update-14-1-8/change-storybook-targets.ts index d4cb386abd32ef..a754d7c897c2c3 100644 --- a/packages/storybook/src/migrations/update-14-1-8/change-storybook-targets.ts +++ b/packages/storybook/src/migrations/update-14-1-8/change-storybook-targets.ts @@ -1,4 +1,4 @@ -import { Tree } from '@nrwl/devkit'; +import { Tree } from '@nx/devkit'; import { changeStorybookTargetsGenerator } from './change-storybook-targets-generator'; export default async function changeStorybookTargets(tree: Tree) { diff --git a/packages/storybook/src/migrations/update-15-0-0/add-storybook-inputs.spec.ts b/packages/storybook/src/migrations/update-15-0-0/add-storybook-inputs.spec.ts index 5dea0a77cc81e4..be6df9dfea0f35 100644 --- a/packages/storybook/src/migrations/update-15-0-0/add-storybook-inputs.spec.ts +++ b/packages/storybook/src/migrations/update-15-0-0/add-storybook-inputs.spec.ts @@ -1,10 +1,10 @@ -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { addProjectConfiguration, readNxJson, Tree, updateNxJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import addStorybookInputs from './add-storybook-inputs'; describe('15.0.0 migration (add-storybook-inputs)', () => { diff --git a/packages/storybook/src/migrations/update-15-0-0/add-storybook-inputs.ts b/packages/storybook/src/migrations/update-15-0-0/add-storybook-inputs.ts index 4d20a68391ec66..ccb297a0b5f648 100644 --- a/packages/storybook/src/migrations/update-15-0-0/add-storybook-inputs.ts +++ b/packages/storybook/src/migrations/update-15-0-0/add-storybook-inputs.ts @@ -1,5 +1,5 @@ -import { formatFiles, readNxJson, Tree, updateNxJson } from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; +import { formatFiles, readNxJson, Tree, updateNxJson } from '@nx/devkit'; +import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils'; export default async function (tree: Tree) { const nxJson = readNxJson(tree); diff --git a/packages/storybook/src/migrations/update-15-4-6/refactor-executor-options.spec.ts b/packages/storybook/src/migrations/update-15-4-6/refactor-executor-options.spec.ts index f7d229abdd9fe0..92c1c75fe21fdc 100644 --- a/packages/storybook/src/migrations/update-15-4-6/refactor-executor-options.spec.ts +++ b/packages/storybook/src/migrations/update-15-4-6/refactor-executor-options.spec.ts @@ -3,8 +3,8 @@ import { getProjects, ProjectConfiguration, Tree, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import refactorExecutorOptions from './refactor-executor-options'; import * as variousProjects from './test-configs/various-projects.json'; diff --git a/packages/storybook/src/migrations/update-15-4-6/refactor-executor-options.ts b/packages/storybook/src/migrations/update-15-4-6/refactor-executor-options.ts index 69e615da7fe782..3df99cb64a5073 100644 --- a/packages/storybook/src/migrations/update-15-4-6/refactor-executor-options.ts +++ b/packages/storybook/src/migrations/update-15-4-6/refactor-executor-options.ts @@ -3,8 +3,8 @@ import { readProjectConfiguration, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; +} from '@nx/devkit'; +import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils'; export default async function (tree: Tree) { updateNonAngularStorybookBuildTargets(tree); diff --git a/packages/storybook/src/migrations/update-15-5-3/ensure-webpack-package.spec.ts b/packages/storybook/src/migrations/update-15-5-3/ensure-webpack-package.spec.ts index 84658474966144..16679c3c8e1f67 100644 --- a/packages/storybook/src/migrations/update-15-5-3/ensure-webpack-package.spec.ts +++ b/packages/storybook/src/migrations/update-15-5-3/ensure-webpack-package.spec.ts @@ -1,10 +1,5 @@ -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { - readJson, - writeJson, - addProjectConfiguration, - Tree, -} from '@nrwl/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { readJson, writeJson, addProjectConfiguration, Tree } from '@nx/devkit'; import update from './ensure-webpack-package'; describe('ensure-webpack-package', () => { diff --git a/packages/storybook/src/migrations/update-15-5-3/ensure-webpack-package.ts b/packages/storybook/src/migrations/update-15-5-3/ensure-webpack-package.ts index 4e3d6d279e725c..06fa4dedb5edc7 100644 --- a/packages/storybook/src/migrations/update-15-5-3/ensure-webpack-package.ts +++ b/packages/storybook/src/migrations/update-15-5-3/ensure-webpack-package.ts @@ -3,7 +3,7 @@ import { getProjects, joinPathFragments, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { nxVersion } from '../../utils/versions'; // Add @nrwl/webpack as needed. diff --git a/packages/storybook/src/migrations/update-15-7-0/add-addon-essentials-to-all.spec.ts b/packages/storybook/src/migrations/update-15-7-0/add-addon-essentials-to-all.spec.ts index 70b87016ea59aa..01e5b27e8e45d9 100644 --- a/packages/storybook/src/migrations/update-15-7-0/add-addon-essentials-to-all.spec.ts +++ b/packages/storybook/src/migrations/update-15-7-0/add-addon-essentials-to-all.spec.ts @@ -2,8 +2,8 @@ import { addProjectConfiguration, ProjectConfiguration, Tree, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import * as variousProjects from './test-configs/various-configs.json'; import addAddonEssentialsToAll from './add-addon-essentials-to-all'; diff --git a/packages/storybook/src/migrations/update-15-7-0/add-addon-essentials-to-all.ts b/packages/storybook/src/migrations/update-15-7-0/add-addon-essentials-to-all.ts index 78d6097fc3b030..ef3c55dfc2c13e 100644 --- a/packages/storybook/src/migrations/update-15-7-0/add-addon-essentials-to-all.ts +++ b/packages/storybook/src/migrations/update-15-7-0/add-addon-essentials-to-all.ts @@ -4,8 +4,8 @@ import { formatFiles, logger, Tree, -} from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; +} from '@nx/devkit'; +import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils'; import { tsquery } from '@phenomnomnominal/tsquery'; import { removeRootConfig } from './remove-root-config'; import ts = require('typescript'); diff --git a/packages/storybook/src/migrations/update-15-7-0/remove-root-config.ts b/packages/storybook/src/migrations/update-15-7-0/remove-root-config.ts index bdc8761835ba9a..175d8995b1a813 100644 --- a/packages/storybook/src/migrations/update-15-7-0/remove-root-config.ts +++ b/packages/storybook/src/migrations/update-15-7-0/remove-root-config.ts @@ -4,8 +4,8 @@ import { logger, StringChange, Tree, -} from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; +} from '@nx/devkit'; +import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils'; import { tsquery } from '@phenomnomnominal/tsquery'; import { getRootMainVariableName } from './add-addon-essentials-to-all'; import ts = require('typescript'); diff --git a/packages/storybook/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts b/packages/storybook/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts new file mode 100644 index 00000000000000..741918e260e60b --- /dev/null +++ b/packages/storybook/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts @@ -0,0 +1,37 @@ +import { Tree, readJson, updateJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import replacePackage from './update-16-0-0-add-nx-packages'; + +describe('update-16-0-0-add-nx-packages', () => { + let tree: Tree; + beforeEach(() => { + tree = createTreeWithEmptyWorkspace(); + + updateJson(tree, 'package.json', (json) => { + json.devDependencies['@nrwl/storybook'] = '16.0.0'; + return json; + }); + }); + + it('should remove the dependency on @nrwl/storybook', async () => { + await replacePackage(tree); + + expect( + readJson(tree, 'package.json').dependencies['@nrwl/storybook'] + ).not.toBeDefined(); + expect( + readJson(tree, 'package.json').devDependencies['@nrwl/storybook'] + ).not.toBeDefined(); + }); + + it('should add a dependency on @nx/storybook', async () => { + await replacePackage(tree); + + const packageJson = readJson(tree, 'package.json'); + const newDependencyVersion = + packageJson.devDependencies['@nx/storybook'] ?? + packageJson.dependencies['@nx/storybook']; + + expect(newDependencyVersion).toBeDefined(); + }); +}); diff --git a/packages/storybook/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts b/packages/storybook/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts new file mode 100644 index 00000000000000..52e070036430a8 --- /dev/null +++ b/packages/storybook/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts @@ -0,0 +1,12 @@ +import { Tree, formatFiles } from '@nx/devkit'; +import { replaceNrwlPackageWithNxPackage } from '@nx/devkit/src/utils/replace-package'; + +export default async function replacePackage(tree: Tree): Promise { + await replaceNrwlPackageWithNxPackage( + tree, + '@nrwl/storybook', + '@nx/storybook' + ); + + await formatFiles(tree); +} diff --git a/packages/storybook/src/utils/testing.ts b/packages/storybook/src/utils/testing.ts index 286859fd1f972c..c89f80f34e16e6 100644 --- a/packages/storybook/src/utils/testing.ts +++ b/packages/storybook/src/utils/testing.ts @@ -1,7 +1,7 @@ -import { Tree } from '@nrwl/devkit'; +import { Tree } from '@nx/devkit'; -import { libraryGenerator } from '@nrwl/js'; -import { Linter } from '@nrwl/linter'; +import { libraryGenerator } from '@nx/js'; +import { Linter } from '@nx/linter'; export async function createTestUILibNoNgDevkit( appTree: Tree, diff --git a/packages/storybook/src/utils/utilities.spec.ts b/packages/storybook/src/utils/utilities.spec.ts index 8bf151e09a1a79..296db7ae6e7a14 100644 --- a/packages/storybook/src/utils/utilities.spec.ts +++ b/packages/storybook/src/utils/utilities.spec.ts @@ -1,9 +1,9 @@ -import { joinPathFragments, Tree, writeJson } from '@nrwl/devkit'; +import { joinPathFragments, Tree, writeJson } from '@nx/devkit'; import { overrideCollectionResolutionForTesting, wrapAngularDevkitSchematic, -} from '@nrwl/devkit/ngcli-adapter'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit/ngcli-adapter'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { findStorybookAndBuildTargetsAndCompiler, isTheFileAStory, @@ -28,7 +28,7 @@ const runAngularLibrarySchematic = wrapAngularDevkitSchematic( 'library' ); const runAngularStorybookSchematic = wrapAngularDevkitSchematic( - '@nrwl/angular', + '@nx/angular', 'storybook-configuration' ); diff --git a/packages/storybook/src/utils/utilities.ts b/packages/storybook/src/utils/utilities.ts index b7f1c1034fd5f5..70f7e2fc287e65 100644 --- a/packages/storybook/src/utils/utilities.ts +++ b/packages/storybook/src/utils/utilities.ts @@ -1,9 +1,4 @@ -import { - readJson, - readJsonFile, - TargetConfiguration, - Tree, -} from '@nrwl/devkit'; +import { readJson, readJsonFile, TargetConfiguration, Tree } from '@nx/devkit'; import { CompilerOptions } from 'typescript'; import { storybookVersion } from './versions'; import { statSync } from 'fs'; diff --git a/packages/vite/migrations.json b/packages/vite/migrations.json index a560cb4c1f38c5..f6a30eac900143 100644 --- a/packages/vite/migrations.json +++ b/packages/vite/migrations.json @@ -17,6 +17,12 @@ "version": "15.4.3-beta.0", "description": "Update @nrwl/vite:test reportsDirectory and outputs properties to point to correct paths.", "factory": "./src/migrations/update-15-4-3/update-report-directory" + }, + "update-16-0-0-add-nx-packages": { + "cli": "nx", + "version": "16.0.0-beta.1", + "description": "Replace @nrwl/vite with @nx/vite", + "implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages" } }, "packageJsonUpdates": { diff --git a/packages/vite/migrations.spec.ts b/packages/vite/migrations.spec.ts index 588c02488b1f78..b655f6206ab24e 100644 --- a/packages/vite/migrations.spec.ts +++ b/packages/vite/migrations.spec.ts @@ -1,11 +1,14 @@ import path = require('path'); import json = require('./migrations.json'); +import { MigrationsJsonEntry } from 'nx/src/config/misc-interfaces'; describe('Vite migrations', () => { it('should have valid paths', () => { - Object.values(json.generators).forEach((m) => { + Object.values(json.generators).forEach((m: MigrationsJsonEntry) => { expect(() => - require.resolve(path.join(__dirname, `${m.factory}.ts`)) + require.resolve( + path.join(__dirname, `${m.factory ?? m.implementation}.ts`) + ) ).not.toThrow(); }); }); diff --git a/packages/vite/package.json b/packages/vite/package.json index b82abb548bb5e7..b86d471bf2bddc 100644 --- a/packages/vite/package.json +++ b/packages/vite/package.json @@ -1,5 +1,5 @@ { - "name": "@nrwl/vite", + "name": "@nx/vite", "version": "0.0.1", "private": false, "description": "The Nx Plugin for building and testing applications using Vite", @@ -29,13 +29,12 @@ "migrations": "./migrations.json" }, "dependencies": { - "@nrwl/devkit": "file:../devkit", - "@nrwl/workspace": "file:../workspace", - "@nrwl/js": "file:../js", "@phenomnomnominal/tsquery": "~5.0.1", "@swc/helpers": "^0.4.11", "dotenv": "~10.0.0", - "enquirer": "~2.3.6" + "enquirer": "~2.3.6", + "@nx/devkit": "file:../devkit", + "@nx/js": "file:../js" }, "peerDependencies": { "vite": "^4.0.1", @@ -48,6 +47,9 @@ "./package.json": { "require": "./package.json" }, - "./executors": "./executors.js" + "./executors": "./executors.js", + "./src/executors/*/schema.json": "./src/executors/*/schema.json", + "./src/executors/*.impl": "./src/executors/*.impl.js", + "./src/executors/*/compat": "./src/executors/*/compat.js" } } diff --git a/packages/vite/project.json b/packages/vite/project.json index 145b0cd0f198a7..1ad858b07c28d4 100644 --- a/packages/vite/project.json +++ b/packages/vite/project.json @@ -60,7 +60,10 @@ "executor": "nx:run-commands", "outputs": ["{workspaceRoot}/build/packages/vite"], "options": { - "command": "node ./scripts/copy-readme.js vite" + "commands": [ + "node ./scripts/copy-readme.js vite", + "node ./scripts/add-dependency-to-build.js vite @nrwl/vite" + ] } }, "lint": { diff --git a/packages/vite/src/executors/build/build.impl.ts b/packages/vite/src/executors/build/build.impl.ts index 65439586f746b0..c999f2e9387d00 100644 --- a/packages/vite/src/executors/build/build.impl.ts +++ b/packages/vite/src/executors/build/build.impl.ts @@ -1,15 +1,15 @@ import 'dotenv/config'; -import { ExecutorContext } from '@nrwl/devkit'; +import { ExecutorContext } from '@nx/devkit'; import { build, InlineConfig, mergeConfig } from 'vite'; import { getViteBuildOptions, getViteSharedConfig, } from '../../utils/options-utils'; import { ViteBuildExecutorOptions } from './schema'; -import { copyAssets } from '@nrwl/js'; +import { copyAssets } from '@nx/js'; import { existsSync } from 'fs'; import { resolve } from 'path'; -import { createAsyncIterable } from '@nrwl/devkit/src/utils/async-iterable'; +import { createAsyncIterable } from '@nx/devkit/src/utils/async-iterable'; import { registerTsConfigPaths } from 'nx/src/utils/register'; diff --git a/packages/vite/src/executors/build/compat.ts b/packages/vite/src/executors/build/compat.ts index 2b50cdcb9c1f61..2afd7fccda742c 100644 --- a/packages/vite/src/executors/build/compat.ts +++ b/packages/vite/src/executors/build/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import viteBuildExecutor from './build.impl'; export default convertNxExecutor(viteBuildExecutor); diff --git a/packages/vite/src/executors/dev-server/compat.ts b/packages/vite/src/executors/dev-server/compat.ts index 94526d95f8e814..c421ad4a0a3ff1 100644 --- a/packages/vite/src/executors/dev-server/compat.ts +++ b/packages/vite/src/executors/dev-server/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import viteDevServerExecutor from './dev-server.impl'; export default convertNxExecutor(viteDevServerExecutor); diff --git a/packages/vite/src/executors/dev-server/dev-server.impl.ts b/packages/vite/src/executors/dev-server/dev-server.impl.ts index 971cb6d05ba79d..3b7627afad51b7 100644 --- a/packages/vite/src/executors/dev-server/dev-server.impl.ts +++ b/packages/vite/src/executors/dev-server/dev-server.impl.ts @@ -1,5 +1,5 @@ import 'dotenv/config'; -import { ExecutorContext } from '@nrwl/devkit'; +import { ExecutorContext } from '@nx/devkit'; import { createServer, InlineConfig, mergeConfig, ViteDevServer } from 'vite'; import { diff --git a/packages/vite/src/executors/preview-server/compat.ts b/packages/vite/src/executors/preview-server/compat.ts index a7ff6313d660d0..4db969a9ade691 100644 --- a/packages/vite/src/executors/preview-server/compat.ts +++ b/packages/vite/src/executors/preview-server/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import vitePreviewServerExecutor from './preview-server.impl'; export default convertNxExecutor(vitePreviewServerExecutor); diff --git a/packages/vite/src/executors/preview-server/preview-server.impl.ts b/packages/vite/src/executors/preview-server/preview-server.impl.ts index 6ffd5f39d6438a..69de9446078476 100644 --- a/packages/vite/src/executors/preview-server/preview-server.impl.ts +++ b/packages/vite/src/executors/preview-server/preview-server.impl.ts @@ -1,4 +1,4 @@ -import { ExecutorContext, parseTargetString, runExecutor } from '@nrwl/devkit'; +import { ExecutorContext, parseTargetString, runExecutor } from '@nx/devkit'; import { InlineConfig, mergeConfig, preview, PreviewServer } from 'vite'; import { getNxTargetOptions, diff --git a/packages/vite/src/executors/test/compat.ts b/packages/vite/src/executors/test/compat.ts index 489e1beafc5116..1d57bb2653ff64 100644 --- a/packages/vite/src/executors/test/compat.ts +++ b/packages/vite/src/executors/test/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import vitestExecutor from './vitest.impl'; export default convertNxExecutor(vitestExecutor); diff --git a/packages/vite/src/executors/test/vitest.impl.ts b/packages/vite/src/executors/test/vitest.impl.ts index 733a4388b7dcca..5af2472dbb3831 100644 --- a/packages/vite/src/executors/test/vitest.impl.ts +++ b/packages/vite/src/executors/test/vitest.impl.ts @@ -3,7 +3,7 @@ import { logger, stripIndents, workspaceRoot, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { CoverageOptions, File, Reporter } from 'vitest'; import { loadConfigFromFile } from 'vite'; import { VitestExecutorOptions } from './schema'; diff --git a/packages/vite/src/generators/configuration/configuration.spec.ts b/packages/vite/src/generators/configuration/configuration.spec.ts index a10a592769e9d6..053e1b0d0c821d 100644 --- a/packages/vite/src/generators/configuration/configuration.spec.ts +++ b/packages/vite/src/generators/configuration/configuration.spec.ts @@ -3,8 +3,8 @@ import { addProjectConfiguration, readJson, Tree, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { nxVersion } from '../../utils/versions'; import { viteConfigurationGenerator } from './configuration'; diff --git a/packages/vite/src/generators/configuration/configuration.ts b/packages/vite/src/generators/configuration/configuration.ts index b8b258df83114e..fdc3af3d303cde 100644 --- a/packages/vite/src/generators/configuration/configuration.ts +++ b/packages/vite/src/generators/configuration/configuration.ts @@ -5,7 +5,7 @@ import { readProjectConfiguration, runTasksInSerial, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { addOrChangeBuildTarget, diff --git a/packages/vite/src/generators/init/init.spec.ts b/packages/vite/src/generators/init/init.spec.ts index 30ee94ab5b3b41..193f7a45333cbc 100644 --- a/packages/vite/src/generators/init/init.spec.ts +++ b/packages/vite/src/generators/init/init.spec.ts @@ -4,8 +4,8 @@ import { readJson, Tree, updateJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { nxVersion } from '../../utils/versions'; import { initGenerator } from './init'; diff --git a/packages/vite/src/generators/init/init.ts b/packages/vite/src/generators/init/init.ts index 77e28422f2d9cf..3810462086ddbe 100644 --- a/packages/vite/src/generators/init/init.ts +++ b/packages/vite/src/generators/init/init.ts @@ -7,9 +7,9 @@ import { Tree, updateJson, updateNxJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; -import { initGenerator as jsInitGenerator } from '@nrwl/js'; +import { initGenerator as jsInitGenerator } from '@nx/js'; import { jsdomVersion, diff --git a/packages/vite/src/generators/vitest/vitest-generator.ts b/packages/vite/src/generators/vitest/vitest-generator.ts index 9d2a8586637dcc..036c73f72c4be4 100644 --- a/packages/vite/src/generators/vitest/vitest-generator.ts +++ b/packages/vite/src/generators/vitest/vitest-generator.ts @@ -10,7 +10,7 @@ import { runTasksInSerial, Tree, updateJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { addOrChangeTestTarget, createOrEditViteConfig, diff --git a/packages/vite/src/generators/vitest/vitest.spec.ts b/packages/vite/src/generators/vitest/vitest.spec.ts index 9d1ed9319553f6..4d37096b81a57f 100644 --- a/packages/vite/src/generators/vitest/vitest.spec.ts +++ b/packages/vite/src/generators/vitest/vitest.spec.ts @@ -1,9 +1,9 @@ -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { Tree, readProjectConfiguration, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import generator from './vitest-generator'; import { VitestGeneratorSchema } from './schema'; diff --git a/packages/vite/src/migrations/update-15-3-1/update-vite-tsconfig-paths.spec.ts b/packages/vite/src/migrations/update-15-3-1/update-vite-tsconfig-paths.spec.ts index 6a55cdc1e1a5c8..39def737f3b2ec 100644 --- a/packages/vite/src/migrations/update-15-3-1/update-vite-tsconfig-paths.spec.ts +++ b/packages/vite/src/migrations/update-15-3-1/update-vite-tsconfig-paths.spec.ts @@ -1,5 +1,5 @@ -import { addDependenciesToPackageJson, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { addDependenciesToPackageJson, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { tsquery } from '@phenomnomnominal/tsquery'; import { mockViteReactAppGenerator } from '../../utils/test-utils'; import { removeProjectsFromViteTsConfigPaths } from './update-vite-tsconfig-paths'; diff --git a/packages/vite/src/migrations/update-15-3-1/update-vite-tsconfig-paths.ts b/packages/vite/src/migrations/update-15-3-1/update-vite-tsconfig-paths.ts index f7424600a847f6..866819a2f38bf3 100644 --- a/packages/vite/src/migrations/update-15-3-1/update-vite-tsconfig-paths.ts +++ b/packages/vite/src/migrations/update-15-3-1/update-vite-tsconfig-paths.ts @@ -4,8 +4,8 @@ import { formatFiles, readProjectConfiguration, Tree, -} from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; +} from '@nx/devkit'; +import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils'; import { tsquery } from '@phenomnomnominal/tsquery'; import { findNodes } from 'nx/src/utils/typescript'; import { normalizeViteConfigFilePathWithTree } from '../../utils/generator-utils'; diff --git a/packages/vite/src/migrations/update-15-3-4/set-mode-in-configuration.spec.ts b/packages/vite/src/migrations/update-15-3-4/set-mode-in-configuration.spec.ts index c00b4d9ea1db91..621bd0595c1e67 100644 --- a/packages/vite/src/migrations/update-15-3-4/set-mode-in-configuration.spec.ts +++ b/packages/vite/src/migrations/update-15-3-4/set-mode-in-configuration.spec.ts @@ -1,5 +1,5 @@ -import { readProjectConfiguration, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { readProjectConfiguration, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { mockViteReactAppGenerator } from '../../utils/test-utils'; import { setModeInConfiguration } from './set-mode-in-configuration'; diff --git a/packages/vite/src/migrations/update-15-3-4/set-mode-in-configuration.ts b/packages/vite/src/migrations/update-15-3-4/set-mode-in-configuration.ts index 16bc4b7ae8dffa..fb3ad6e0d42bff 100644 --- a/packages/vite/src/migrations/update-15-3-4/set-mode-in-configuration.ts +++ b/packages/vite/src/migrations/update-15-3-4/set-mode-in-configuration.ts @@ -3,8 +3,8 @@ import { readProjectConfiguration, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; +} from '@nx/devkit'; +import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils'; export async function setModeInConfiguration(tree: Tree) { forAllProjectsUsingViteAddMode(tree); diff --git a/packages/vite/src/migrations/update-15-4-3/update-report-directory.spec.ts b/packages/vite/src/migrations/update-15-4-3/update-report-directory.spec.ts index 770542a70a471a..511fa829dad25d 100644 --- a/packages/vite/src/migrations/update-15-4-3/update-report-directory.spec.ts +++ b/packages/vite/src/migrations/update-15-4-3/update-report-directory.spec.ts @@ -2,8 +2,8 @@ import { addProjectConfiguration, readProjectConfiguration, Tree, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { updateReportDirectoryPlaceholders } from './update-report-directory'; describe('Update Report Directory Vitest Migration', () => { diff --git a/packages/vite/src/migrations/update-15-4-3/update-report-directory.ts b/packages/vite/src/migrations/update-15-4-3/update-report-directory.ts index 6b0276a6e12f4f..66d0c02e3e8b45 100644 --- a/packages/vite/src/migrations/update-15-4-3/update-report-directory.ts +++ b/packages/vite/src/migrations/update-15-4-3/update-report-directory.ts @@ -3,8 +3,8 @@ import { offsetFromRoot, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; +} from '@nx/devkit'; +import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils'; import { VitestExecutorOptions } from '../../executors/test/schema'; export function updateReportDirectoryPlaceholders(tree: Tree) { diff --git a/packages/vite/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts b/packages/vite/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts new file mode 100644 index 00000000000000..2d2cf0571de3b8 --- /dev/null +++ b/packages/vite/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts @@ -0,0 +1,37 @@ +import { Tree, readJson, updateJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import replacePackage from './update-16-0-0-add-nx-packages'; + +describe('update-16-0-0-add-nx-packages', () => { + let tree: Tree; + beforeEach(() => { + tree = createTreeWithEmptyWorkspace(); + + updateJson(tree, 'package.json', (json) => { + json.devDependencies['@nrwl/vite'] = '16.0.0'; + return json; + }); + }); + + it('should remove the dependency on @nrwl/vite', async () => { + await replacePackage(tree); + + expect( + readJson(tree, 'package.json').dependencies['@nrwl/vite'] + ).not.toBeDefined(); + expect( + readJson(tree, 'package.json').devDependencies['@nrwl/vite'] + ).not.toBeDefined(); + }); + + it('should add a dependency on @nx/vite', async () => { + await replacePackage(tree); + + const packageJson = readJson(tree, 'package.json'); + const newDependencyVersion = + packageJson.devDependencies['@nx/vite'] ?? + packageJson.dependencies['@nx/vite']; + + expect(newDependencyVersion).toBeDefined(); + }); +}); diff --git a/packages/vite/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts b/packages/vite/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts new file mode 100644 index 00000000000000..8e629b564c3164 --- /dev/null +++ b/packages/vite/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts @@ -0,0 +1,8 @@ +import { Tree, formatFiles } from '@nx/devkit'; +import { replaceNrwlPackageWithNxPackage } from '@nx/devkit/src/utils/replace-package'; + +export default async function replacePackage(tree: Tree): Promise { + await replaceNrwlPackageWithNxPackage(tree, '@nrwl/vite', '@nx/vite'); + + await formatFiles(tree); +} diff --git a/packages/vite/src/utils/generator-utils.spec.ts b/packages/vite/src/utils/generator-utils.spec.ts index b0034156755084..0dee514ae22857 100644 --- a/packages/vite/src/utils/generator-utils.spec.ts +++ b/packages/vite/src/utils/generator-utils.spec.ts @@ -2,8 +2,8 @@ import { readProjectConfiguration, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { findExistingTargetsInProject, getViteConfigPathForProject, diff --git a/packages/vite/src/utils/generator-utils.ts b/packages/vite/src/utils/generator-utils.ts index 7f5bb97cbcbd18..56117f59f78f42 100644 --- a/packages/vite/src/utils/generator-utils.ts +++ b/packages/vite/src/utils/generator-utils.ts @@ -8,7 +8,7 @@ import { Tree, updateProjectConfiguration, writeJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { ViteBuildExecutorOptions } from '../executors/build/schema'; import { ViteDevServerExecutorOptions } from '../executors/dev-server/schema'; import { VitePreviewServerExecutorOptions } from '../executors/preview-server/schema'; diff --git a/packages/vite/src/utils/options-utils.ts b/packages/vite/src/utils/options-utils.ts index 0f44068ba0213a..086340bbef2d8e 100644 --- a/packages/vite/src/utils/options-utils.ts +++ b/packages/vite/src/utils/options-utils.ts @@ -4,7 +4,7 @@ import { logger, parseTargetString, readTargetOptions, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { existsSync } from 'fs'; import { join, relative } from 'path'; import { diff --git a/packages/vite/src/utils/test-utils.ts b/packages/vite/src/utils/test-utils.ts index e1dfc88278c66d..ce37dc314203b0 100644 --- a/packages/vite/src/utils/test-utils.ts +++ b/packages/vite/src/utils/test-utils.ts @@ -1,4 +1,4 @@ -import { Tree, writeJson } from '@nrwl/devkit'; +import { Tree, writeJson } from '@nx/devkit'; import * as reactAppConfig from './test-files/react-project.config.json'; import * as reactViteConfig from './test-files/react-vite-project.config.json'; import * as webAppConfig from './test-files/web-project.config.json'; diff --git a/packages/vite/src/utils/vite-config-edit-utils.spec.ts b/packages/vite/src/utils/vite-config-edit-utils.spec.ts index 9b22a626a9ba10..d4fbf56b6a8d99 100644 --- a/packages/vite/src/utils/vite-config-edit-utils.spec.ts +++ b/packages/vite/src/utils/vite-config-edit-utils.spec.ts @@ -1,5 +1,5 @@ -import { Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { tsquery } from '@phenomnomnominal/tsquery'; import { buildOption, diff --git a/packages/vite/src/utils/vite-config-edit-utils.ts b/packages/vite/src/utils/vite-config-edit-utils.ts index d7a279658549b6..58727b504c2e31 100644 --- a/packages/vite/src/utils/vite-config-edit-utils.ts +++ b/packages/vite/src/utils/vite-config-edit-utils.ts @@ -1,4 +1,4 @@ -import { applyChangesToString, ChangeType, Tree } from '@nrwl/devkit'; +import { applyChangesToString, ChangeType, Tree } from '@nx/devkit'; import { findNodes } from 'nx/src/utils/typescript'; import { TargetFlags } from './generator-utils'; import type { Node, ReturnStatement } from 'typescript'; diff --git a/packages/web/babel.ts b/packages/web/babel.ts index df03c9b82253e5..200ce1ebfcbd24 100644 --- a/packages/web/babel.ts +++ b/packages/web/babel.ts @@ -1,9 +1,9 @@ -const nxJsBabelPreset = require('@nrwl/js/babel'); +const nxJsBabelPreset = require('@nx/js/babel'); /** @deprecated Use `@nrwl/js/babel`. */ module.exports = function (api: any, options: any = {}) { console.warn( - '`@nrwl/web/babel` has been deprecated. Use `@nrwl/js/babel` instead in your .babelrc files.' + '`@nx/web/babel` has been deprecated. Use `@nx/js/babel` instead in your .babelrc files.' ); return nxJsBabelPreset(api, options); }; diff --git a/packages/web/migrations.json b/packages/web/migrations.json index f585fb2107dd0e..4106e1b67bd9da 100644 --- a/packages/web/migrations.json +++ b/packages/web/migrations.json @@ -59,6 +59,12 @@ "version": "15.9.1", "description": "Add @nrwl/linter, @nrwl/cypress, @nrwl/jest, @nrwl/rollup if they are used", "factory": "./src/migrations/update-15-9-1/add-dropped-dependencies" + }, + "update-16-0-0-add-nx-packages": { + "cli": "nx", + "version": "16.0.0-beta.1", + "description": "Replace @nrwl/web with @nx/web", + "implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages" } }, "packageJsonUpdates": { diff --git a/packages/web/migrations.spec.ts b/packages/web/migrations.spec.ts index 0bf905a29f7199..8bc24c2dac16d1 100644 --- a/packages/web/migrations.spec.ts +++ b/packages/web/migrations.spec.ts @@ -1,11 +1,14 @@ import path = require('path'); import json = require('./migrations.json'); +import { MigrationsJsonEntry } from 'nx/src/config/misc-interfaces'; describe('Web migrations', () => { it('should have valid paths', () => { - Object.values(json.generators).forEach((m) => { + Object.values(json.generators).forEach((m: MigrationsJsonEntry) => { expect(() => - require.resolve(path.join(__dirname, `${m.factory}.ts`)) + require.resolve( + path.join(__dirname, `${m.factory ?? m.implementation}.ts`) + ) ).not.toThrow(); }); }); diff --git a/packages/web/package.json b/packages/web/package.json index 685eb14ff613d0..1a3085746c1d3d 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -1,5 +1,5 @@ { - "name": "@nrwl/web", + "name": "@nx/web", "version": "0.0.1", "private": false, "description": "The Nx Plugin for Web Components contains generators for managing Web Component applications and libraries within an Nx workspace. It provides:\n\n\n- Integration with libraries such as Jest, Cypress, and Storybook.\n\n- Scaffolding for creating buildable libraries that can be published to npm.\n\n- Utilities for automatic workspace refactoring.", @@ -30,14 +30,13 @@ "migrations": "./migrations.json" }, "dependencies": { - "@nrwl/devkit": "file:../devkit", - "@nrwl/js": "file:../js", - "@nrwl/workspace": "file:../workspace", "chalk": "^4.1.0", "chokidar": "^3.5.1", "http-server": "^14.1.0", "ignore": "^5.0.4", - "tslib": "^2.3.0" + "tslib": "^2.3.0", + "@nx/devkit": "file:../devkit", + "@nx/js": "file:../js" }, "publishConfig": { "access": "public" diff --git a/packages/web/project.json b/packages/web/project.json index d328b3dcf1e277..337b29eaeb5893 100644 --- a/packages/web/project.json +++ b/packages/web/project.json @@ -53,7 +53,10 @@ "executor": "nx:run-commands", "outputs": ["{workspaceRoot}/build/packages/web"], "options": { - "command": "node ./scripts/copy-readme.js web" + "commands": [ + "node ./scripts/copy-readme.js web", + "node ./scripts/add-dependency-to-build.js web @nrwl/web" + ] } }, "lint": {} diff --git a/packages/web/src/executors/dev-server/compat.ts b/packages/web/src/executors/dev-server/compat.ts index a587ba361b1076..34b277b04ec4ad 100644 --- a/packages/web/src/executors/dev-server/compat.ts +++ b/packages/web/src/executors/dev-server/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import devServerExecutor from './dev-server.impl'; diff --git a/packages/web/src/executors/dev-server/dev-server.impl.ts b/packages/web/src/executors/dev-server/dev-server.impl.ts index ff278146019158..300c9255e36e0b 100644 --- a/packages/web/src/executors/dev-server/dev-server.impl.ts +++ b/packages/web/src/executors/dev-server/dev-server.impl.ts @@ -2,15 +2,15 @@ * This is here for backwards-compat. * TODO(v16): remove in Nx 16. */ -import { ExecutorContext, logger } from '@nrwl/devkit'; +import { ExecutorContext, logger } from '@nx/devkit'; export async function* devServerExecutor( options: any, context: ExecutorContext ) { - const { devServerExecutor: baseDevServerExecutor } = require('@nrwl/webpack'); + const { devServerExecutor: baseDevServerExecutor } = require('@nx/webpack'); logger.warn( - '"@nrwl/web:dev-server" executor is deprecated. Use "@nrwl/webpack:dev-server" instead in your project.json.' + '"@nx/web:dev-server" executor is deprecated. Use "@nx/webpack:dev-server" instead in your project.json.' ); yield* baseDevServerExecutor( { diff --git a/packages/web/src/executors/file-server/compat.ts b/packages/web/src/executors/file-server/compat.ts index 094efc42315234..d1efb972769d10 100644 --- a/packages/web/src/executors/file-server/compat.ts +++ b/packages/web/src/executors/file-server/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import fileServerExecutor from './file-server.impl'; diff --git a/packages/web/src/executors/file-server/file-server.impl.ts b/packages/web/src/executors/file-server/file-server.impl.ts index 49aef06c2c40d7..4ba44ce844a312 100644 --- a/packages/web/src/executors/file-server/file-server.impl.ts +++ b/packages/web/src/executors/file-server/file-server.impl.ts @@ -6,7 +6,7 @@ import { parseTargetString, readTargetOptions, workspaceLayout, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import ignore from 'ignore'; import { copyFileSync, readFileSync, unlinkSync } from 'fs'; import { Schema } from './schema'; diff --git a/packages/web/src/executors/rollup/compat.ts b/packages/web/src/executors/rollup/compat.ts index e9dd420efbac07..4681ebee42de54 100644 --- a/packages/web/src/executors/rollup/compat.ts +++ b/packages/web/src/executors/rollup/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import rollupExecutor from './rollup.impl'; diff --git a/packages/web/src/executors/rollup/rollup.impl.ts b/packages/web/src/executors/rollup/rollup.impl.ts index b79a63a17a703c..d3149dcaf53f35 100644 --- a/packages/web/src/executors/rollup/rollup.impl.ts +++ b/packages/web/src/executors/rollup/rollup.impl.ts @@ -5,7 +5,7 @@ import { rollupExecutor as _rollupExecutor, RollupExecutorOptions as WebRollupOptions, -} from '@nrwl/rollup'; +} from '@nx/rollup'; import { logger } from 'nx/src/utils/logger'; export { WebRollupOptions }; diff --git a/packages/web/src/executors/webpack/compat.ts b/packages/web/src/executors/webpack/compat.ts index 919858b9b3dd79..e04afb8239a55f 100644 --- a/packages/web/src/executors/webpack/compat.ts +++ b/packages/web/src/executors/webpack/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import { webpackExecutor } from './webpack.impl'; diff --git a/packages/web/src/executors/webpack/webpack.impl.ts b/packages/web/src/executors/webpack/webpack.impl.ts index 7d186d77a16c38..6962a67398605f 100644 --- a/packages/web/src/executors/webpack/webpack.impl.ts +++ b/packages/web/src/executors/webpack/webpack.impl.ts @@ -2,12 +2,12 @@ * For backwards compat. * TODO(v16): Remove in Nx 16. */ -import { ExecutorContext, logger } from '@nrwl/devkit'; +import { ExecutorContext, logger } from '@nx/devkit'; export async function* webpackExecutor(options: any, context: ExecutorContext) { - const { webpackExecutor: baseWebpackExecutor } = require('@nrwl/webpack'); + const { webpackExecutor: baseWebpackExecutor } = require('@nx/webpack'); logger.warn( - '"@nrwl/web:webpack" executor is deprecated. Use "@nrwl/webpack:webpack" instead in your project.json.' + '"@nx/web:webpack" executor is deprecated. Use "@nx/webpack:webpack" instead in your project.json.' ); yield* baseWebpackExecutor( { diff --git a/packages/web/src/generators/application/application.spec.ts b/packages/web/src/generators/application/application.spec.ts index 4a6bfbac18773c..2cc187e634faba 100644 --- a/packages/web/src/generators/application/application.spec.ts +++ b/packages/web/src/generators/application/application.spec.ts @@ -1,13 +1,13 @@ -import { installedCypressVersion } from '@nrwl/cypress/src/utils/cypress-version'; -import { readProjectConfiguration, Tree } from '@nrwl/devkit'; -import { getProjects, readJson } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { installedCypressVersion } from '@nx/cypress/src/utils/cypress-version'; +import { readProjectConfiguration, Tree } from '@nx/devkit'; +import { getProjects, readJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { applicationGenerator } from './application'; import { Schema } from './schema'; // need to mock cypress otherwise it'll use the nx installed version from package.json // which is v9 while we are testing for the new v10 version -jest.mock('@nrwl/cypress/src/utils/cypress-version'); +jest.mock('@nx/cypress/src/utils/cypress-version'); describe('app', () => { let tree: Tree; let mockedInstalledCypressVersion: jest.Mock< diff --git a/packages/web/src/generators/application/application.ts b/packages/web/src/generators/application/application.ts index bff98f88a287e4..dadb76556640d1 100644 --- a/packages/web/src/generators/application/application.ts +++ b/packages/web/src/generators/application/application.ts @@ -19,11 +19,11 @@ import { Tree, updateNxJson, updateProjectConfiguration, -} from '@nrwl/devkit'; -import { swcCoreVersion } from '@nrwl/js/src/utils/versions'; -import type { Linter } from '@nrwl/linter'; +} from '@nx/devkit'; +import { swcCoreVersion } from '@nx/js/src/utils/versions'; +import type { Linter } from '@nx/linter'; -import { getRelativePathToRootTsConfig } from '@nrwl/js'; +import { getRelativePathToRootTsConfig } from '@nx/js'; import { nxVersion, swcLoaderVersion } from '../../utils/versions'; import { webInitGenerator } from '../init/init'; @@ -73,10 +73,7 @@ async function setupBundler(tree: Tree, options: NormalizedSchema) { ]; if (options.bundler === 'webpack') { - const { webpackProjectGenerator } = ensurePackage( - '@nrwl/webpack', - nxVersion - ); + const { webpackProjectGenerator } = ensurePackage('@nx/webpack', nxVersion); await webpackProjectGenerator(tree, { project: options.projectName, main, @@ -197,8 +194,8 @@ export async function applicationGenerator(host: Tree, schema: Schema) { if (options.bundler === 'vite') { const { viteConfigurationGenerator } = ensurePackage< - typeof import('@nrwl/vite') - >('@nrwl/vite', nxVersion); + typeof import('@nx/vite') + >('@nx/vite', nxVersion); // We recommend users use `import.meta.env.MODE` and other variables in their code to differentiate between production and development. // See: https://vitejs.dev/guide/env-and-mode.html if ( @@ -221,8 +218,8 @@ export async function applicationGenerator(host: Tree, schema: Schema) { } if (options.bundler !== 'vite' && options.unitTestRunner === 'vitest') { - const { vitestGenerator } = ensurePackage( - '@nrwl/vite', + const { vitestGenerator } = ensurePackage( + '@nx/vite', nxVersion ); const vitestTask = await vitestGenerator(host, { @@ -246,7 +243,7 @@ export async function applicationGenerator(host: Tree, schema: Schema) { if (options.linter === 'eslint') { const { lintProjectGenerator } = await ensurePackage( - '@nrwl/linter', + '@nx/linter', nxVersion ); const lintTask = await lintProjectGenerator(host, { @@ -265,8 +262,8 @@ export async function applicationGenerator(host: Tree, schema: Schema) { if (options.e2eTestRunner === 'cypress') { const { cypressProjectGenerator } = await ensurePackage< - typeof import('@nrwl/cypress') - >('@nrwl/cypress', nxVersion); + typeof import('@nx/cypress') + >('@nx/cypress', nxVersion); const cypressTask = await cypressProjectGenerator(host, { ...options, name: `${options.name}-e2e`, @@ -278,8 +275,8 @@ export async function applicationGenerator(host: Tree, schema: Schema) { } if (options.unitTestRunner === 'jest') { const { jestProjectGenerator } = await ensurePackage< - typeof import('@nrwl/jest') - >('@nrwl/jest', nxVersion); + typeof import('@nx/jest') + >('@nx/jest', nxVersion); const jestTask = await jestProjectGenerator(host, { project: options.projectName, skipSerializers: true, diff --git a/packages/web/src/generators/application/schema.d.ts b/packages/web/src/generators/application/schema.d.ts index e6af676c23b9ae..16d493d58c46cc 100644 --- a/packages/web/src/generators/application/schema.d.ts +++ b/packages/web/src/generators/application/schema.d.ts @@ -1,4 +1,4 @@ -import type { Linter } from '@nrwl/linter'; +import type { Linter } from '@nx/linter'; export interface Schema { name: string; diff --git a/packages/web/src/generators/init/init.spec.ts b/packages/web/src/generators/init/init.spec.ts index 6a6922949e39d2..1fdb7f20123c88 100644 --- a/packages/web/src/generators/init/init.spec.ts +++ b/packages/web/src/generators/init/init.spec.ts @@ -4,8 +4,8 @@ import { readJson, Tree, updateJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { nxVersion } from '../../utils/versions'; diff --git a/packages/web/src/generators/init/init.ts b/packages/web/src/generators/init/init.ts index bc7a0ee4429b94..f6345149cd67ba 100644 --- a/packages/web/src/generators/init/init.ts +++ b/packages/web/src/generators/init/init.ts @@ -7,10 +7,10 @@ import { removeDependenciesFromPackageJson, runTasksInSerial, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; -import { addBabelInputs } from '@nrwl/js/src/utils/add-babel-inputs'; -import { initGenerator as jsInitGenerator } from '@nrwl/js'; +import { addBabelInputs } from '@nx/js/src/utils/add-babel-inputs'; +import { initGenerator as jsInitGenerator } from '@nx/js'; import { nxVersion, tsLibVersion, @@ -47,7 +47,7 @@ export async function webInitGenerator(tree: Tree, schema: Schema) { tasks.push(jsInitTask); if (!schema.unitTestRunner || schema.unitTestRunner === 'jest') { - const { jestInitGenerator } = await ensurePackage('@nrwl/jest', nxVersion); + const { jestInitGenerator } = await ensurePackage('@nx/jest', nxVersion); const jestTask = await jestInitGenerator(tree, { skipPackageJson: schema.skipPackageJson, }); @@ -55,7 +55,7 @@ export async function webInitGenerator(tree: Tree, schema: Schema) { } if (!schema.e2eTestRunner || schema.e2eTestRunner === 'cypress') { const { cypressInitGenerator } = await ensurePackage( - '@nrwl/cypress', + '@nx/cypress', nxVersion ); const cypressTask = await cypressInitGenerator(tree, { diff --git a/packages/web/src/generators/static-serve/static-serve-configuration.spec.ts b/packages/web/src/generators/static-serve/static-serve-configuration.spec.ts index 904f975f3f44a7..8de64e2ea31311 100644 --- a/packages/web/src/generators/static-serve/static-serve-configuration.spec.ts +++ b/packages/web/src/generators/static-serve/static-serve-configuration.spec.ts @@ -3,8 +3,8 @@ import { readProjectConfiguration, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { webStaticServeGenerator } from './static-serve-configuration'; describe('Static serve configuration generator', () => { diff --git a/packages/web/src/generators/static-serve/static-serve-configuration.ts b/packages/web/src/generators/static-serve/static-serve-configuration.ts index 6e7f2557601e34..76f7aa40c379bc 100644 --- a/packages/web/src/generators/static-serve/static-serve-configuration.ts +++ b/packages/web/src/generators/static-serve/static-serve-configuration.ts @@ -7,7 +7,7 @@ import { TargetConfiguration, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { Schema as FileServerExecutorSchema } from '../../executors/file-server/schema.d'; interface WebStaticServeSchema { buildTarget: string; diff --git a/packages/web/src/migrations/update-13-0-0/remove-deprecated-options-13-0-0.spec.ts b/packages/web/src/migrations/update-13-0-0/remove-deprecated-options-13-0-0.spec.ts index c702327f7f502e..9e3286936b9eaa 100644 --- a/packages/web/src/migrations/update-13-0-0/remove-deprecated-options-13-0-0.spec.ts +++ b/packages/web/src/migrations/update-13-0-0/remove-deprecated-options-13-0-0.spec.ts @@ -2,8 +2,8 @@ import { addProjectConfiguration, readJson, readProjectConfiguration, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import subject from './remove-deprecated-options-13-0-0'; diff --git a/packages/web/src/migrations/update-13-0-0/remove-deprecated-options-13-0-0.ts b/packages/web/src/migrations/update-13-0-0/remove-deprecated-options-13-0-0.ts index 0cc3d68405797b..b768690433da77 100644 --- a/packages/web/src/migrations/update-13-0-0/remove-deprecated-options-13-0-0.ts +++ b/packages/web/src/migrations/update-13-0-0/remove-deprecated-options-13-0-0.ts @@ -4,7 +4,7 @@ import { logger, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; const deprecatedOptions = ['showCircularDependencies', 'budgets']; diff --git a/packages/web/src/migrations/update-13-0-0/remove-node-sass-13-0-0.spec.ts b/packages/web/src/migrations/update-13-0-0/remove-node-sass-13-0-0.spec.ts index 83f7060ec187e4..58cc864bc59a48 100644 --- a/packages/web/src/migrations/update-13-0-0/remove-node-sass-13-0-0.spec.ts +++ b/packages/web/src/migrations/update-13-0-0/remove-node-sass-13-0-0.spec.ts @@ -1,5 +1,5 @@ -import { readJson } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { readJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import subject from './remove-node-sass-13-0-0'; diff --git a/packages/web/src/migrations/update-13-0-0/remove-node-sass-13-0-0.ts b/packages/web/src/migrations/update-13-0-0/remove-node-sass-13-0-0.ts index 2bad29b1e660b3..7792a558cdc56d 100644 --- a/packages/web/src/migrations/update-13-0-0/remove-node-sass-13-0-0.ts +++ b/packages/web/src/migrations/update-13-0-0/remove-node-sass-13-0-0.ts @@ -4,7 +4,7 @@ import { readJson, removeDependenciesFromPackageJson, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; /** * For web/react apps with style scss option, remove node-sass sine it is deprecated. diff --git a/packages/web/src/migrations/update-13-0-0/remove-webpack-5-packages-13-0-0.spec.ts b/packages/web/src/migrations/update-13-0-0/remove-webpack-5-packages-13-0-0.spec.ts index 5d476d121434ad..a84c5800ae2fb6 100644 --- a/packages/web/src/migrations/update-13-0-0/remove-webpack-5-packages-13-0-0.spec.ts +++ b/packages/web/src/migrations/update-13-0-0/remove-webpack-5-packages-13-0-0.spec.ts @@ -1,5 +1,5 @@ -import { readJson } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { readJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import subject from './remove-webpack-5-packages-13-0-0'; diff --git a/packages/web/src/migrations/update-13-0-0/remove-webpack-5-packages-13-0-0.ts b/packages/web/src/migrations/update-13-0-0/remove-webpack-5-packages-13-0-0.ts index b9b9f61218a6b9..353b4810e7ed09 100644 --- a/packages/web/src/migrations/update-13-0-0/remove-webpack-5-packages-13-0-0.ts +++ b/packages/web/src/migrations/update-13-0-0/remove-webpack-5-packages-13-0-0.ts @@ -4,7 +4,7 @@ import { readJson, removeDependenciesFromPackageJson, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; const packages = [ 'webpack', diff --git a/packages/web/src/migrations/update-13-3-0/rename-build-to-webpack.spec.ts b/packages/web/src/migrations/update-13-3-0/rename-build-to-webpack.spec.ts index 73ccaf0c9ff97c..d8c4d585a1d5b4 100644 --- a/packages/web/src/migrations/update-13-3-0/rename-build-to-webpack.spec.ts +++ b/packages/web/src/migrations/update-13-3-0/rename-build-to-webpack.spec.ts @@ -2,8 +2,8 @@ import { addProjectConfiguration, readJson, readProjectConfiguration, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import rename from './rename-build-to-webpack'; diff --git a/packages/web/src/migrations/update-13-3-0/rename-build-to-webpack.ts b/packages/web/src/migrations/update-13-3-0/rename-build-to-webpack.ts index 18b83729c1b707..03a04047903bdd 100644 --- a/packages/web/src/migrations/update-13-3-0/rename-build-to-webpack.ts +++ b/packages/web/src/migrations/update-13-3-0/rename-build-to-webpack.ts @@ -3,7 +3,7 @@ import { getProjects, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; export default async function update(host: Tree) { const projects = getProjects(host); diff --git a/packages/web/src/migrations/update-13-3-0/rename-package-to-rollup.spec.ts b/packages/web/src/migrations/update-13-3-0/rename-package-to-rollup.spec.ts index 3ee4f966a4e23b..4a627b5e687e9f 100644 --- a/packages/web/src/migrations/update-13-3-0/rename-package-to-rollup.spec.ts +++ b/packages/web/src/migrations/update-13-3-0/rename-package-to-rollup.spec.ts @@ -2,8 +2,8 @@ import { addProjectConfiguration, readJson, readProjectConfiguration, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import renamePackageToRollup from './rename-package-to-rollup'; diff --git a/packages/web/src/migrations/update-13-3-0/rename-package-to-rollup.ts b/packages/web/src/migrations/update-13-3-0/rename-package-to-rollup.ts index 28bd85b4bdb5d2..c4ea0a48d33573 100644 --- a/packages/web/src/migrations/update-13-3-0/rename-package-to-rollup.ts +++ b/packages/web/src/migrations/update-13-3-0/rename-package-to-rollup.ts @@ -3,7 +3,7 @@ import { getProjects, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; export default async function update(host: Tree) { const projects = getProjects(host); diff --git a/packages/web/src/migrations/update-13-8-0/add-postcss-config-option.spec.ts b/packages/web/src/migrations/update-13-8-0/add-postcss-config-option.spec.ts index 99ac6014d37d45..769924a650efd3 100644 --- a/packages/web/src/migrations/update-13-8-0/add-postcss-config-option.spec.ts +++ b/packages/web/src/migrations/update-13-8-0/add-postcss-config-option.spec.ts @@ -2,8 +2,8 @@ import { addProjectConfiguration, readJson, readProjectConfiguration, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import migrate from './add-postcss-config-option'; diff --git a/packages/web/src/migrations/update-13-8-0/add-postcss-config-option.ts b/packages/web/src/migrations/update-13-8-0/add-postcss-config-option.ts index 50bb4fe44b22a3..fd37969356e149 100644 --- a/packages/web/src/migrations/update-13-8-0/add-postcss-config-option.ts +++ b/packages/web/src/migrations/update-13-8-0/add-postcss-config-option.ts @@ -3,7 +3,7 @@ import { getProjects, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; /* * This migration ensures that the previous behavior of applying the app postcss config diff --git a/packages/web/src/migrations/update-14-1-7/rollup-format-backwards-compatibility.spec.ts b/packages/web/src/migrations/update-14-1-7/rollup-format-backwards-compatibility.spec.ts index d611a04f3436f2..f060c07194c2e4 100644 --- a/packages/web/src/migrations/update-14-1-7/rollup-format-backwards-compatibility.spec.ts +++ b/packages/web/src/migrations/update-14-1-7/rollup-format-backwards-compatibility.spec.ts @@ -1,5 +1,5 @@ -import { addProjectConfiguration, readJson } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { addProjectConfiguration, readJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import update from './rollup-format-backwards-compatibility'; describe('rollup-format-backwards-compatibility', () => { diff --git a/packages/web/src/migrations/update-14-1-7/rollup-format-backwards-compatibility.ts b/packages/web/src/migrations/update-14-1-7/rollup-format-backwards-compatibility.ts index 47b393e085c5bb..9ea5111b2e3c36 100644 --- a/packages/web/src/migrations/update-14-1-7/rollup-format-backwards-compatibility.ts +++ b/packages/web/src/migrations/update-14-1-7/rollup-format-backwards-compatibility.ts @@ -3,7 +3,7 @@ import { getProjects, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; /* * diff --git a/packages/web/src/migrations/update-14-7-6/update-webpack-executor.spec.ts b/packages/web/src/migrations/update-14-7-6/update-webpack-executor.spec.ts index 14e77436584de9..074cf9872bc599 100644 --- a/packages/web/src/migrations/update-14-7-6/update-webpack-executor.spec.ts +++ b/packages/web/src/migrations/update-14-7-6/update-webpack-executor.spec.ts @@ -2,8 +2,8 @@ import { addProjectConfiguration, readJson, readProjectConfiguration, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import update from './update-webpack-executor'; diff --git a/packages/web/src/migrations/update-14-7-6/update-webpack-executor.ts b/packages/web/src/migrations/update-14-7-6/update-webpack-executor.ts index c85ca888677118..216ff3f86c7832 100644 --- a/packages/web/src/migrations/update-14-7-6/update-webpack-executor.ts +++ b/packages/web/src/migrations/update-14-7-6/update-webpack-executor.ts @@ -3,7 +3,7 @@ import { getProjects, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; export default async function update(host: Tree) { const projects = getProjects(host); diff --git a/packages/web/src/migrations/update-15-0-0/add-babel-inputs.spec.ts b/packages/web/src/migrations/update-15-0-0/add-babel-inputs.spec.ts index 00c3a49afb8dc0..3ac51f6d230330 100644 --- a/packages/web/src/migrations/update-15-0-0/add-babel-inputs.spec.ts +++ b/packages/web/src/migrations/update-15-0-0/add-babel-inputs.spec.ts @@ -1,5 +1,5 @@ -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { readNxJson, Tree, updateNxJson } from '@nrwl/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { readNxJson, Tree, updateNxJson } from '@nx/devkit'; import addBabelInputs from './add-babel-inputs'; describe('15.0.0 migration (add-babel-inputs)', () => { diff --git a/packages/web/src/migrations/update-15-0-0/add-babel-inputs.ts b/packages/web/src/migrations/update-15-0-0/add-babel-inputs.ts index a3fa30fda387ea..aa7e721076fe20 100644 --- a/packages/web/src/migrations/update-15-0-0/add-babel-inputs.ts +++ b/packages/web/src/migrations/update-15-0-0/add-babel-inputs.ts @@ -1,5 +1,5 @@ -import { formatFiles, Tree } from '@nrwl/devkit'; -import { addBabelInputs } from '@nrwl/js/src/utils/add-babel-inputs'; +import { formatFiles, Tree } from '@nx/devkit'; +import { addBabelInputs } from '@nx/js/src/utils/add-babel-inputs'; export default async function (tree: Tree) { addBabelInputs(tree); diff --git a/packages/web/src/migrations/update-15-0-0/update-rollup-executor.spec.ts b/packages/web/src/migrations/update-15-0-0/update-rollup-executor.spec.ts index f1bf44b7797362..f52bb2b714280c 100644 --- a/packages/web/src/migrations/update-15-0-0/update-rollup-executor.spec.ts +++ b/packages/web/src/migrations/update-15-0-0/update-rollup-executor.spec.ts @@ -1,8 +1,5 @@ -import { - addProjectConfiguration, - readProjectConfiguration, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { addProjectConfiguration, readProjectConfiguration } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import update from './update-rollup-executor'; diff --git a/packages/web/src/migrations/update-15-0-0/update-rollup-executor.ts b/packages/web/src/migrations/update-15-0-0/update-rollup-executor.ts index 9bbd2c9ba418e7..723bcb73d172d3 100644 --- a/packages/web/src/migrations/update-15-0-0/update-rollup-executor.ts +++ b/packages/web/src/migrations/update-15-0-0/update-rollup-executor.ts @@ -3,7 +3,7 @@ import { getProjects, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; export default async function update(host: Tree) { const projects = getProjects(host); diff --git a/packages/web/src/migrations/update-15-5-4/update-babel-preset.spec.ts b/packages/web/src/migrations/update-15-5-4/update-babel-preset.spec.ts index e7059e7a40630e..1de235709f7f3f 100644 --- a/packages/web/src/migrations/update-15-5-4/update-babel-preset.spec.ts +++ b/packages/web/src/migrations/update-15-5-4/update-babel-preset.spec.ts @@ -1,10 +1,5 @@ -import { - addProjectConfiguration, - readJson, - Tree, - writeJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { addProjectConfiguration, readJson, Tree, writeJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import update from './update-babel-preset'; diff --git a/packages/web/src/migrations/update-15-5-4/update-babel-preset.ts b/packages/web/src/migrations/update-15-5-4/update-babel-preset.ts index bf7ec9b9520bc4..a5955cb7b6f5ea 100644 --- a/packages/web/src/migrations/update-15-5-4/update-babel-preset.ts +++ b/packages/web/src/migrations/update-15-5-4/update-babel-preset.ts @@ -5,7 +5,7 @@ import { addDependenciesToPackageJson, getProjects, joinPathFragments, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { nxVersion } from '../../utils/versions'; /* Updates @nrwl/web/babel to @nrwl/js/babel because web package is no longer necessary to use webpack/rollup + babel. */ diff --git a/packages/web/src/migrations/update-15-9-1/add-dropped-dependencies.spec.ts b/packages/web/src/migrations/update-15-9-1/add-dropped-dependencies.spec.ts index f279b19a34656b..7b34dcd24edbe3 100644 --- a/packages/web/src/migrations/update-15-9-1/add-dropped-dependencies.spec.ts +++ b/packages/web/src/migrations/update-15-9-1/add-dropped-dependencies.spec.ts @@ -3,8 +3,8 @@ import { readJson, Tree, updateNxJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import addDroppedDependencies from './add-dropped-dependencies'; diff --git a/packages/web/src/migrations/update-15-9-1/add-dropped-dependencies.ts b/packages/web/src/migrations/update-15-9-1/add-dropped-dependencies.ts index aab2692732bcf5..abca261df85539 100644 --- a/packages/web/src/migrations/update-15-9-1/add-dropped-dependencies.ts +++ b/packages/web/src/migrations/update-15-9-1/add-dropped-dependencies.ts @@ -5,7 +5,7 @@ import { NX_VERSION, readNxJson, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; export default async function addDroppedDependencies(tree: Tree) { const devDependencies = {}; diff --git a/packages/web/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts b/packages/web/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts new file mode 100644 index 00000000000000..b30cdd58958c0f --- /dev/null +++ b/packages/web/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts @@ -0,0 +1,37 @@ +import { Tree, readJson, updateJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import replacePackage from './update-16-0-0-add-nx-packages'; + +describe('update-16-0-0-add-nx-packages', () => { + let tree: Tree; + beforeEach(() => { + tree = createTreeWithEmptyWorkspace(); + + updateJson(tree, 'package.json', (json) => { + json.devDependencies['@nrwl/web'] = '16.0.0'; + return json; + }); + }); + + it('should remove the dependency on @nrwl/web', async () => { + await replacePackage(tree); + + expect( + readJson(tree, 'package.json').dependencies['@nrwl/web'] + ).not.toBeDefined(); + expect( + readJson(tree, 'package.json').devDependencies['@nrwl/web'] + ).not.toBeDefined(); + }); + + it('should add a dependency on @nx/web', async () => { + await replacePackage(tree); + + const packageJson = readJson(tree, 'package.json'); + const newDependencyVersion = + packageJson.devDependencies['@nx/web'] ?? + packageJson.dependencies['@nx/web']; + + expect(newDependencyVersion).toBeDefined(); + }); +}); diff --git a/packages/web/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts b/packages/web/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts new file mode 100644 index 00000000000000..58d705a1a25b4e --- /dev/null +++ b/packages/web/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts @@ -0,0 +1,8 @@ +import { Tree, formatFiles } from '@nx/devkit'; +import { replaceNrwlPackageWithNxPackage } from '@nx/devkit/src/utils/replace-package'; + +export default async function replacePackage(tree: Tree): Promise { + await replaceNrwlPackageWithNxPackage(tree, '@nrwl/web', '@nx/web'); + + await formatFiles(tree); +} diff --git a/packages/web/src/plugins/webpack-nx-build-coordination-plugin.ts b/packages/web/src/plugins/webpack-nx-build-coordination-plugin.ts index f41ba3db68df5b..f3667bd4ca8cb5 100644 --- a/packages/web/src/plugins/webpack-nx-build-coordination-plugin.ts +++ b/packages/web/src/plugins/webpack-nx-build-coordination-plugin.ts @@ -1 +1 @@ -export { WebpackNxBuildCoordinationPlugin } from '@nrwl/webpack/src/plugins/webpack-nx-build-coordination-plugin'; +export { WebpackNxBuildCoordinationPlugin } from '@nx/webpack/src/plugins/webpack-nx-build-coordination-plugin'; diff --git a/packages/web/src/utils/fs.ts b/packages/web/src/utils/fs.ts index 062d8b7e19ef43..3482082faffab8 100644 --- a/packages/web/src/utils/fs.ts +++ b/packages/web/src/utils/fs.ts @@ -1 +1 @@ -export * from '@nrwl/webpack/src/utils/fs'; +export * from '@nx/webpack/src/utils/fs'; diff --git a/packages/web/src/utils/normalize.ts b/packages/web/src/utils/normalize.ts index db1481fe6cdadf..304d771c5f3169 100644 --- a/packages/web/src/utils/normalize.ts +++ b/packages/web/src/utils/normalize.ts @@ -1 +1 @@ -export * from '@nrwl/webpack/src/executors/webpack/lib/normalize-options'; +export * from '@nx/webpack/src/executors/webpack/lib/normalize-options'; diff --git a/packages/webpack/migrations.json b/packages/webpack/migrations.json index daee2f4559b6eb..16d66d3fc10741 100644 --- a/packages/webpack/migrations.json +++ b/packages/webpack/migrations.json @@ -23,6 +23,12 @@ "version": "15.7.2-beta.0", "description": "Add the babelUpwardRootMode option to the build executor options.", "factory": "./src/migrations/update-15-7-2/add-babelUpwardRootMode-flag" + }, + "update-16-0-0-add-nx-packages": { + "cli": "nx", + "version": "16.0.0-beta.1", + "description": "Replace @nrwl/webpack with @nx/webpack", + "implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages" } }, "packageJsonUpdates": {} diff --git a/packages/webpack/migrations.spec.ts b/packages/webpack/migrations.spec.ts index dec578273166cc..602b5b55de4c5f 100644 --- a/packages/webpack/migrations.spec.ts +++ b/packages/webpack/migrations.spec.ts @@ -1,11 +1,14 @@ import path = require('path'); import json = require('./migrations.json'); +import { MigrationsJsonEntry } from 'nx/src/config/misc-interfaces'; describe('Webpack migrations', () => { it('should have valid paths', () => { - Object.values(json.generators).forEach((m) => { + Object.values(json.generators).forEach((m: MigrationsJsonEntry) => { expect(() => - require.resolve(path.join(__dirname, `${m.factory}.ts`)) + require.resolve( + path.join(__dirname, `${m.factory ?? m.implementation}.ts`) + ) ).not.toThrow(); }); }); diff --git a/packages/webpack/package.json b/packages/webpack/package.json index 3e7bab39690509..810f3d2da6a71f 100644 --- a/packages/webpack/package.json +++ b/packages/webpack/package.json @@ -1,5 +1,5 @@ { - "name": "@nrwl/webpack", + "name": "@nx/webpack", "version": "0.0.1", "private": false, "description": "The Nx Plugin for Webpack contains executors and generators that support building applications using Webpack.", @@ -30,9 +30,6 @@ }, "dependencies": { "@babel/core": "^7.15.0", - "@nrwl/devkit": "file:../devkit", - "@nrwl/js": "file:../js", - "@nrwl/workspace": "file:../workspace", "autoprefixer": "^10.4.9", "babel-loader": "^9.1.2", "chalk": "^4.1.0", @@ -69,7 +66,9 @@ "webpack": "^5.75.0", "webpack-dev-server": "^4.9.3", "webpack-node-externals": "^3.0.0", - "webpack-subresource-integrity": "^5.1.0" + "webpack-subresource-integrity": "^5.1.0", + "@nx/devkit": "file:../devkit", + "@nx/js": "file:../js" }, "publishConfig": { "access": "public" diff --git a/packages/webpack/project.json b/packages/webpack/project.json index ee47dc1e122d8f..cceabe15b37296 100644 --- a/packages/webpack/project.json +++ b/packages/webpack/project.json @@ -48,7 +48,10 @@ "executor": "nx:run-commands", "outputs": ["{workspaceRoot}/build/packages/webpack"], "options": { - "command": "node ./scripts/copy-readme.js webpack" + "commands": [ + "node ./scripts/copy-readme.js webpack", + "node ./scripts/add-dependency-to-build.js webpack @nrwl/webpack" + ] } }, "lint": {} diff --git a/packages/webpack/src/executors/dev-server/compat.ts b/packages/webpack/src/executors/dev-server/compat.ts index a587ba361b1076..34b277b04ec4ad 100644 --- a/packages/webpack/src/executors/dev-server/compat.ts +++ b/packages/webpack/src/executors/dev-server/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import devServerExecutor from './dev-server.impl'; diff --git a/packages/webpack/src/executors/dev-server/dev-server.impl.ts b/packages/webpack/src/executors/dev-server/dev-server.impl.ts index 13ce79db066505..a53c0807dd85fb 100644 --- a/packages/webpack/src/executors/dev-server/dev-server.impl.ts +++ b/packages/webpack/src/executors/dev-server/dev-server.impl.ts @@ -3,9 +3,9 @@ import { ExecutorContext, parseTargetString, readTargetOptions, -} from '@nrwl/devkit'; +} from '@nx/devkit'; -import { eachValueFrom } from '@nrwl/devkit/src/utils/rxjs-for-await'; +import { eachValueFrom } from '@nx/devkit/src/utils/rxjs-for-await'; import { map, tap } from 'rxjs/operators'; import * as WebpackDevServer from 'webpack-dev-server'; @@ -13,7 +13,7 @@ import { getDevServerConfig } from './lib/get-dev-server-config'; import { calculateProjectDependencies, createTmpTsConfig, -} from '@nrwl/js/src/utils/buildable-libs-utils'; +} from '@nx/js/src/utils/buildable-libs-utils'; import { runWebpackDevServer } from '../../utils/run-webpack'; import { resolveCustomWebpackConfig } from '../../utils/webpack/custom-webpack'; import { normalizeOptions } from '../webpack/lib/normalize-options'; diff --git a/packages/webpack/src/executors/dev-server/lib/get-dev-server-config.ts b/packages/webpack/src/executors/dev-server/lib/get-dev-server-config.ts index 34f2e4e6d3153a..c86b2fb135ae68 100644 --- a/packages/webpack/src/executors/dev-server/lib/get-dev-server-config.ts +++ b/packages/webpack/src/executors/dev-server/lib/get-dev-server-config.ts @@ -1,4 +1,4 @@ -import { ExecutorContext, logger } from '@nrwl/devkit'; +import { ExecutorContext, logger } from '@nx/devkit'; import type { Configuration as WebpackConfiguration } from 'webpack'; import type { Configuration as WebpackDevServerConfiguration } from 'webpack-dev-server'; import * as path from 'path'; diff --git a/packages/webpack/src/executors/ssr-dev-server/compat.ts b/packages/webpack/src/executors/ssr-dev-server/compat.ts index 1c387a219e3bb0..1ce89e1e8899bd 100644 --- a/packages/webpack/src/executors/ssr-dev-server/compat.ts +++ b/packages/webpack/src/executors/ssr-dev-server/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import ssrDevServerExecutor from './ssr-dev-server.impl'; diff --git a/packages/webpack/src/executors/ssr-dev-server/ssr-dev-server.impl.ts b/packages/webpack/src/executors/ssr-dev-server/ssr-dev-server.impl.ts index f712414e54dc08..1be8dccd074455 100644 --- a/packages/webpack/src/executors/ssr-dev-server/ssr-dev-server.impl.ts +++ b/packages/webpack/src/executors/ssr-dev-server/ssr-dev-server.impl.ts @@ -3,9 +3,9 @@ import { parseTargetString, readTargetOptions, runExecutor, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import * as chalk from 'chalk'; -import { combineAsyncIterables } from '@nrwl/devkit/src/utils/async-iterable'; +import { combineAsyncIterables } from '@nx/devkit/src/utils/async-iterable'; import { WebpackExecutorOptions } from '../webpack/schema'; import { TargetOptions, WebSsrDevServerOptions } from './schema'; diff --git a/packages/webpack/src/executors/webpack/compat.ts b/packages/webpack/src/executors/webpack/compat.ts index 919858b9b3dd79..e04afb8239a55f 100644 --- a/packages/webpack/src/executors/webpack/compat.ts +++ b/packages/webpack/src/executors/webpack/compat.ts @@ -1,4 +1,4 @@ -import { convertNxExecutor } from '@nrwl/devkit'; +import { convertNxExecutor } from '@nx/devkit'; import { webpackExecutor } from './webpack.impl'; diff --git a/packages/webpack/src/executors/webpack/lib/get-webpack-config.ts b/packages/webpack/src/executors/webpack/lib/get-webpack-config.ts index a04fe00851519d..f6a8e06ff1b2b4 100644 --- a/packages/webpack/src/executors/webpack/lib/get-webpack-config.ts +++ b/packages/webpack/src/executors/webpack/lib/get-webpack-config.ts @@ -1,5 +1,5 @@ import type { Configuration } from 'webpack'; -import { ExecutorContext } from '@nrwl/devkit'; +import { ExecutorContext } from '@nx/devkit'; import { NormalizedWebpackExecutorOptions } from '../schema'; import { withNx } from '../../../utils/with-nx'; diff --git a/packages/webpack/src/executors/webpack/lib/normalize-options.ts b/packages/webpack/src/executors/webpack/lib/normalize-options.ts index efc8cf72bcb2c1..b744abcdfdf75d 100644 --- a/packages/webpack/src/executors/webpack/lib/normalize-options.ts +++ b/packages/webpack/src/executors/webpack/lib/normalize-options.ts @@ -1,6 +1,6 @@ import { basename, dirname, relative, resolve } from 'path'; import { statSync } from 'fs'; -import { normalizePath } from '@nrwl/devkit'; +import { normalizePath } from '@nx/devkit'; import type { AssetGlobPattern, diff --git a/packages/webpack/src/executors/webpack/schema.d.ts b/packages/webpack/src/executors/webpack/schema.d.ts index c3f170ac7c8903..554b1a50384bf7 100644 --- a/packages/webpack/src/executors/webpack/schema.d.ts +++ b/packages/webpack/src/executors/webpack/schema.d.ts @@ -1,4 +1,4 @@ -import { AssetGlob } from '@nrwl/js/src/utils/assets/assets'; +import { AssetGlob } from '@nx/js/src/utils/assets/assets'; export interface AssetGlobPattern { glob: string; diff --git a/packages/webpack/src/executors/webpack/webpack.impl.ts b/packages/webpack/src/executors/webpack/webpack.impl.ts index d377dfb802b6a8..73982730683a3e 100644 --- a/packages/webpack/src/executors/webpack/webpack.impl.ts +++ b/packages/webpack/src/executors/webpack/webpack.impl.ts @@ -1,6 +1,6 @@ import 'dotenv/config'; -import { ExecutorContext, logger } from '@nrwl/devkit'; -import { eachValueFrom } from '@nrwl/devkit/src/utils/rxjs-for-await'; +import { ExecutorContext, logger } from '@nx/devkit'; +import { eachValueFrom } from '@nx/devkit/src/utils/rxjs-for-await'; import type { Configuration, Stats } from 'webpack'; import { from, of } from 'rxjs'; import { @@ -14,7 +14,7 @@ import { resolve } from 'path'; import { calculateProjectDependencies, createTmpTsConfig, -} from '@nrwl/js/src/utils/buildable-libs-utils'; +} from '@nx/js/src/utils/buildable-libs-utils'; import { getWebpackConfig } from './lib/get-webpack-config'; import { runWebpack } from './lib/run-webpack'; diff --git a/packages/webpack/src/generators/init/init.spec.ts b/packages/webpack/src/generators/init/init.spec.ts index 5d70626e171a5a..671ab0a84040dd 100644 --- a/packages/webpack/src/generators/init/init.spec.ts +++ b/packages/webpack/src/generators/init/init.spec.ts @@ -1,5 +1,5 @@ -import { Tree, readJson, NxJsonConfiguration, updateJson } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { Tree, readJson, NxJsonConfiguration, updateJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { webpackInitGenerator } from './init'; diff --git a/packages/webpack/src/generators/init/init.ts b/packages/webpack/src/generators/init/init.ts index 70275d2888136e..a5fce9f73bfdaf 100644 --- a/packages/webpack/src/generators/init/init.ts +++ b/packages/webpack/src/generators/init/init.ts @@ -3,8 +3,8 @@ import { convertNxGenerator, formatFiles, Tree, -} from '@nrwl/devkit'; -import { swcCoreVersion } from '@nrwl/js/src/utils/versions'; +} from '@nx/devkit'; +import { swcCoreVersion } from '@nx/js/src/utils/versions'; import { Schema } from './schema'; import { @@ -17,7 +17,7 @@ import { tsLibVersion, urlLoaderVersion, } from '../../utils/versions'; -import { addBabelInputs } from '@nrwl/js/src/utils/add-babel-inputs'; +import { addBabelInputs } from '@nx/js/src/utils/add-babel-inputs'; export async function webpackInitGenerator(tree: Tree, schema: Schema) { if (schema.compiler === 'babel') { diff --git a/packages/webpack/src/generators/webpack-project/webpack-project.spec.ts b/packages/webpack/src/generators/webpack-project/webpack-project.spec.ts index c4c4059f6a2091..92cc3e113a56e0 100644 --- a/packages/webpack/src/generators/webpack-project/webpack-project.spec.ts +++ b/packages/webpack/src/generators/webpack-project/webpack-project.spec.ts @@ -2,8 +2,8 @@ import { addProjectConfiguration, readProjectConfiguration, Tree, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { webpackProjectGenerator } from './webpack-project'; diff --git a/packages/webpack/src/generators/webpack-project/webpack-project.ts b/packages/webpack/src/generators/webpack-project/webpack-project.ts index 316a46da77bc0e..517085f41ff2c1 100644 --- a/packages/webpack/src/generators/webpack-project/webpack-project.ts +++ b/packages/webpack/src/generators/webpack-project/webpack-project.ts @@ -1,11 +1,11 @@ -import type { ProjectConfiguration, Tree } from '@nrwl/devkit'; +import type { ProjectConfiguration, Tree } from '@nx/devkit'; import { convertNxGenerator, formatFiles, joinPathFragments, readProjectConfiguration, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { webpackInitGenerator } from '../init/init'; import { WebpackProjectGeneratorSchema } from './schema'; @@ -79,7 +79,7 @@ function addBuildTarget(tree: Tree, options: WebpackProjectGeneratorSchema) { tree.write( joinPathFragments(project.root, 'webpack.config.js'), ` -const { composePlugins, withNx } = require('@nrwl/webpack'); +const { composePlugins, withNx } = require('@nx/webpack'); // Nx plugins for webpack. module.exports = composePlugins(withNx(), (config) => { @@ -93,7 +93,7 @@ module.exports = composePlugins(withNx(), (config) => { tree.write( joinPathFragments(project.root, 'webpack.config.js'), ` -const { composePlugins, withNx, withWeb } = require('@nrwl/webpack'); +const { composePlugins, withNx, withWeb } = require('@nx/webpack'); // Nx plugins for webpack. module.exports = composePlugins(withNx(), withWeb(), (config) => { diff --git a/packages/webpack/src/migrations/update-15-0-0/add-babel-inputs.spec.ts b/packages/webpack/src/migrations/update-15-0-0/add-babel-inputs.spec.ts index 00c3a49afb8dc0..3ac51f6d230330 100644 --- a/packages/webpack/src/migrations/update-15-0-0/add-babel-inputs.spec.ts +++ b/packages/webpack/src/migrations/update-15-0-0/add-babel-inputs.spec.ts @@ -1,5 +1,5 @@ -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { readNxJson, Tree, updateNxJson } from '@nrwl/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { readNxJson, Tree, updateNxJson } from '@nx/devkit'; import addBabelInputs from './add-babel-inputs'; describe('15.0.0 migration (add-babel-inputs)', () => { diff --git a/packages/webpack/src/migrations/update-15-0-0/add-babel-inputs.ts b/packages/webpack/src/migrations/update-15-0-0/add-babel-inputs.ts index a3fa30fda387ea..aa7e721076fe20 100644 --- a/packages/webpack/src/migrations/update-15-0-0/add-babel-inputs.ts +++ b/packages/webpack/src/migrations/update-15-0-0/add-babel-inputs.ts @@ -1,5 +1,5 @@ -import { formatFiles, Tree } from '@nrwl/devkit'; -import { addBabelInputs } from '@nrwl/js/src/utils/add-babel-inputs'; +import { formatFiles, Tree } from '@nx/devkit'; +import { addBabelInputs } from '@nx/js/src/utils/add-babel-inputs'; export default async function (tree: Tree) { addBabelInputs(tree); diff --git a/packages/webpack/src/migrations/update-15-4-5/remove-es2015-polyfills-option.spec.ts b/packages/webpack/src/migrations/update-15-4-5/remove-es2015-polyfills-option.spec.ts index 76391c572cc6a0..b3b207dd1fc20e 100644 --- a/packages/webpack/src/migrations/update-15-4-5/remove-es2015-polyfills-option.spec.ts +++ b/packages/webpack/src/migrations/update-15-4-5/remove-es2015-polyfills-option.spec.ts @@ -1,9 +1,9 @@ -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { addProjectConfiguration, readProjectConfiguration, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import update from './remove-es2015-polyfills-option'; describe('15.4.5 migration (remove es2015-polyfills)', () => { diff --git a/packages/webpack/src/migrations/update-15-4-5/remove-es2015-polyfills-option.ts b/packages/webpack/src/migrations/update-15-4-5/remove-es2015-polyfills-option.ts index 5b84820f201f3b..b1eb7663437441 100644 --- a/packages/webpack/src/migrations/update-15-4-5/remove-es2015-polyfills-option.ts +++ b/packages/webpack/src/migrations/update-15-4-5/remove-es2015-polyfills-option.ts @@ -1,4 +1,4 @@ -import { getProjects, Tree, updateProjectConfiguration } from '@nrwl/devkit'; +import { getProjects, Tree, updateProjectConfiguration } from '@nx/devkit'; export default async function (tree: Tree) { const projects = getProjects(tree); diff --git a/packages/webpack/src/migrations/update-15-6-3/webpack-config-setup.spec.ts b/packages/webpack/src/migrations/update-15-6-3/webpack-config-setup.spec.ts index f06b8561b0fc7d..8e92a5079bd784 100644 --- a/packages/webpack/src/migrations/update-15-6-3/webpack-config-setup.spec.ts +++ b/packages/webpack/src/migrations/update-15-6-3/webpack-config-setup.spec.ts @@ -1,9 +1,9 @@ -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { addProjectConfiguration, readProjectConfiguration, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import webpackConfigSetup from './webpack-config-setup'; describe('15.6.3 migration (setup webpack.config file)', () => { diff --git a/packages/webpack/src/migrations/update-15-6-3/webpack-config-setup.ts b/packages/webpack/src/migrations/update-15-6-3/webpack-config-setup.ts index cdcf6744208878..b15ff5720c7a3c 100644 --- a/packages/webpack/src/migrations/update-15-6-3/webpack-config-setup.ts +++ b/packages/webpack/src/migrations/update-15-6-3/webpack-config-setup.ts @@ -4,8 +4,8 @@ import { readProjectConfiguration, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; +} from '@nx/devkit'; +import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils'; import { WebpackExecutorOptions } from '../../executors/webpack/schema'; import { basename } from 'path'; diff --git a/packages/webpack/src/migrations/update-15-7-2/add-babelUpwardRootMode-flag.spec.ts b/packages/webpack/src/migrations/update-15-7-2/add-babelUpwardRootMode-flag.spec.ts index c81be94ac9abe4..7baad1244d942e 100644 --- a/packages/webpack/src/migrations/update-15-7-2/add-babelUpwardRootMode-flag.spec.ts +++ b/packages/webpack/src/migrations/update-15-7-2/add-babelUpwardRootMode-flag.spec.ts @@ -1,9 +1,9 @@ -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { addProjectConfiguration, readProjectConfiguration, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import addBabelUpwardRootModeFlag from './add-babelUpwardRootMode-flag'; describe('15.7.2 migration (add babelUpwardRootMode flag)', () => { diff --git a/packages/webpack/src/migrations/update-15-7-2/add-babelUpwardRootMode-flag.ts b/packages/webpack/src/migrations/update-15-7-2/add-babelUpwardRootMode-flag.ts index 399dbdd715d21c..bfc3018244c5e0 100644 --- a/packages/webpack/src/migrations/update-15-7-2/add-babelUpwardRootMode-flag.ts +++ b/packages/webpack/src/migrations/update-15-7-2/add-babelUpwardRootMode-flag.ts @@ -3,8 +3,8 @@ import { readProjectConfiguration, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; +} from '@nx/devkit'; +import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils'; import { WebpackExecutorOptions } from '../../executors/webpack/schema'; export default async function (tree: Tree) { diff --git a/packages/webpack/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts b/packages/webpack/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts new file mode 100644 index 00000000000000..c890c2cc1f468c --- /dev/null +++ b/packages/webpack/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts @@ -0,0 +1,37 @@ +import { Tree, readJson, updateJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import replacePackage from './update-16-0-0-add-nx-packages'; + +describe('update-16-0-0-add-nx-packages', () => { + let tree: Tree; + beforeEach(() => { + tree = createTreeWithEmptyWorkspace(); + + updateJson(tree, 'package.json', (json) => { + json.devDependencies['@nrwl/webpack'] = '16.0.0'; + return json; + }); + }); + + it('should remove the dependency on @nrwl/webpack', async () => { + await replacePackage(tree); + + expect( + readJson(tree, 'package.json').dependencies['@nrwl/webpack'] + ).not.toBeDefined(); + expect( + readJson(tree, 'package.json').devDependencies['@nrwl/webpack'] + ).not.toBeDefined(); + }); + + it('should add a dependency on @nx/webpack', async () => { + await replacePackage(tree); + + const packageJson = readJson(tree, 'package.json'); + const newDependencyVersion = + packageJson.devDependencies['@nx/webpack'] ?? + packageJson.dependencies['@nx/webpack']; + + expect(newDependencyVersion).toBeDefined(); + }); +}); diff --git a/packages/webpack/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts b/packages/webpack/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts new file mode 100644 index 00000000000000..bfe97ade6961fb --- /dev/null +++ b/packages/webpack/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts @@ -0,0 +1,8 @@ +import { Tree, formatFiles } from '@nx/devkit'; +import { replaceNrwlPackageWithNxPackage } from '@nx/devkit/src/utils/replace-package'; + +export default async function replacePackage(tree: Tree): Promise { + await replaceNrwlPackageWithNxPackage(tree, '@nrwl/webpack', '@nx/webpack'); + + await formatFiles(tree); +} diff --git a/packages/webpack/src/plugins/generate-package-json-plugin.ts b/packages/webpack/src/plugins/generate-package-json-plugin.ts index dbfbe40a6471b3..3b6e3eb25e0777 100644 --- a/packages/webpack/src/plugins/generate-package-json-plugin.ts +++ b/packages/webpack/src/plugins/generate-package-json-plugin.ts @@ -1,15 +1,11 @@ import { type Compiler, sources, type WebpackPluginInstance } from 'webpack'; -import { createLockFile, createPackageJson } from '@nrwl/js'; -import { - ExecutorContext, - type ProjectGraph, - serializeJson, -} from '@nrwl/devkit'; +import { createLockFile, createPackageJson } from '@nx/js'; +import { ExecutorContext, type ProjectGraph, serializeJson } from '@nx/devkit'; import { getHelperDependenciesFromProjectGraph, HelperDependency, readTsConfig, -} from '@nrwl/js'; +} from '@nx/js'; import { getLockFileName } from 'nx/src/plugins/js/lock-file/lock-file'; const pluginName = 'GeneratePackageJsonPlugin'; diff --git a/packages/webpack/src/plugins/webpack-nx-build-coordination-plugin.ts b/packages/webpack/src/plugins/webpack-nx-build-coordination-plugin.ts index 2864c747a55083..b64c74277c1a28 100644 --- a/packages/webpack/src/plugins/webpack-nx-build-coordination-plugin.ts +++ b/packages/webpack/src/plugins/webpack-nx-build-coordination-plugin.ts @@ -1,7 +1,7 @@ import { watch } from 'chokidar'; import { execSync } from 'child_process'; -import { workspaceLayout } from '@nrwl/devkit'; -import { joinPathFragments } from '@nrwl/devkit'; +import { workspaceLayout } from '@nx/devkit'; +import { joinPathFragments } from '@nx/devkit'; import ignore from 'ignore'; import { readFileSync } from 'fs'; import type { Compiler } from 'webpack'; diff --git a/packages/webpack/src/utils/config.ts b/packages/webpack/src/utils/config.ts index 3e4b671f170f93..ffadd834b67bb6 100644 --- a/packages/webpack/src/utils/config.ts +++ b/packages/webpack/src/utils/config.ts @@ -1,4 +1,4 @@ -import { ExecutorContext } from '@nrwl/devkit'; +import { ExecutorContext } from '@nx/devkit'; import { Configuration } from 'webpack'; import { NormalizedWebpackExecutorOptions } from '../executors/webpack/schema'; diff --git a/packages/webpack/src/utils/with-nx.ts b/packages/webpack/src/utils/with-nx.ts index 442d076b25946f..b8e0bfb9bfa18a 100644 --- a/packages/webpack/src/utils/with-nx.ts +++ b/packages/webpack/src/utils/with-nx.ts @@ -2,7 +2,7 @@ import * as path from 'path'; import { Configuration, WebpackPluginInstance, ProgressPlugin } from 'webpack'; import { ExecutorContext } from 'nx/src/config/misc-interfaces'; import { TsconfigPathsPlugin } from 'tsconfig-paths-webpack-plugin'; -import { readTsConfig } from '@nrwl/js'; +import { readTsConfig } from '@nx/js'; import { LicenseWebpackPlugin } from 'license-webpack-plugin'; import TerserPlugin = require('terser-webpack-plugin'); import nodeExternals = require('webpack-node-externals'); @@ -326,7 +326,7 @@ export function createLoaderFromCompiler( }, }; case 'tsc': - const { loadTsTransformers } = require('@nrwl/js'); + const { loadTsTransformers } = require('@nx/js'); const { compilerPluginHooks, hasPlugin } = loadTsTransformers( options.transformers ); diff --git a/packages/webpack/src/utils/with-web.ts b/packages/webpack/src/utils/with-web.ts index 64de7014a446a0..2b47f973eb859f 100644 --- a/packages/webpack/src/utils/with-web.ts +++ b/packages/webpack/src/utils/with-web.ts @@ -8,9 +8,9 @@ import { import { SubresourceIntegrityPlugin } from 'webpack-subresource-integrity'; import * as path from 'path'; import { basename, join } from 'path'; -import { getOutputHashFormat } from '@nrwl/webpack/src/utils/hash-format'; -import { PostcssCliResources } from '@nrwl/webpack/src/utils/webpack/plugins/postcss-cli-resources'; -import { normalizeExtraEntryPoints } from '@nrwl/webpack/src/utils/webpack/normalize-entry'; +import { getOutputHashFormat } from './hash-format'; +import { PostcssCliResources } from './webpack/plugins/postcss-cli-resources'; +import { normalizeExtraEntryPoints } from './webpack/normalize-entry'; import { NxWebpackPlugin } from './config'; import { @@ -21,12 +21,11 @@ import { getClientEnvironment } from './get-client-environment'; import { ScriptsWebpackPlugin } from './webpack/plugins/scripts-webpack-plugin'; import { getCSSModuleLocalIdent } from './get-css-module-local-ident'; import { WriteIndexHtmlPlugin } from '../plugins/write-index-html-plugin'; -import { ExecutorContext } from '@nrwl/devkit'; import CssMinimizerPlugin = require('css-minimizer-webpack-plugin'); import MiniCssExtractPlugin = require('mini-css-extract-plugin'); import autoprefixer = require('autoprefixer'); import postcssImports = require('postcss-import'); -import { NxWebpackExecutionContext } from '@nrwl/webpack/src/utils/config'; +import { NxWebpackExecutionContext } from './config'; interface PostcssOptions { (loader: any): any; diff --git a/packages/workspace/index.ts b/packages/workspace/index.ts index 3bd716849233cc..0327ac2b6ce2f6 100644 --- a/packages/workspace/index.ts +++ b/packages/workspace/index.ts @@ -7,7 +7,7 @@ export { createDirectory, } from './src/utilities/fileutils'; -export { names } from '@nrwl/devkit'; +export { names } from '@nx/devkit'; export { output } from './src/utilities/output'; diff --git a/packages/workspace/migrations.json b/packages/workspace/migrations.json index 78a9652bc57b83..52036a96202965 100644 --- a/packages/workspace/migrations.json +++ b/packages/workspace/migrations.json @@ -83,6 +83,12 @@ "description": "Split global configuration files (e.g., workspace.json) into individual project.json files.", "cli": "nx", "implementation": "./src/migrations/update-15-7-0/split-configuration-into-project-json-files" + }, + "update-16-0-0-add-nx-packages": { + "cli": "nx", + "version": "16.0.0-beta.1", + "description": "Replace @nrwl/workspace with @nx/workspace", + "implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages" } }, "packageJsonUpdates": { diff --git a/packages/workspace/package.json b/packages/workspace/package.json index cfda8fe0c8d2b3..78f9d11558dde5 100644 --- a/packages/workspace/package.json +++ b/packages/workspace/package.json @@ -1,5 +1,5 @@ { - "name": "@nrwl/workspace", + "name": "@nx/workspace", "version": "0.0.1", "private": false, "description": "The Workspace plugin contains executors and generators that are useful for any Nx workspace. It should be present in every Nx workspace and other plugins build on it.", @@ -61,7 +61,6 @@ } }, "dependencies": { - "@nrwl/devkit": "file:../devkit", "@parcel/watcher": "2.0.4", "chalk": "^4.1.0", "chokidar": "^3.5.1", @@ -78,7 +77,8 @@ "tmp": "~0.2.1", "tslib": "^2.3.0", "yargs": "^17.6.2", - "yargs-parser": "21.1.1" + "yargs-parser": "21.1.1", + "@nx/devkit": "file:../devkit" }, "publishConfig": { "access": "public" diff --git a/packages/workspace/project.json b/packages/workspace/project.json index bd83c03304189d..138ea48fbf67db 100644 --- a/packages/workspace/project.json +++ b/packages/workspace/project.json @@ -87,7 +87,8 @@ }, { "command": "node ./scripts/add-dependency-to-build.js workspace nx" - } + }, + "node ./scripts/add-dependency-to-build.js workspace @nrwl/workspace" ], "parallel": false } diff --git a/packages/workspace/src/generators/ci-workflow/ci-workflow.spec.ts b/packages/workspace/src/generators/ci-workflow/ci-workflow.spec.ts index 49a00a9a8ad481..84569a5605cf76 100644 --- a/packages/workspace/src/generators/ci-workflow/ci-workflow.spec.ts +++ b/packages/workspace/src/generators/ci-workflow/ci-workflow.spec.ts @@ -4,8 +4,8 @@ import { Tree, updateJson, writeJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { ciWorkflowGenerator } from './ci-workflow'; describe('lib', () => { diff --git a/packages/workspace/src/generators/ci-workflow/ci-workflow.ts b/packages/workspace/src/generators/ci-workflow/ci-workflow.ts index b7510f607acf1f..6c9ab2b247cf65 100644 --- a/packages/workspace/src/generators/ci-workflow/ci-workflow.ts +++ b/packages/workspace/src/generators/ci-workflow/ci-workflow.ts @@ -8,7 +8,7 @@ import { NxJsonConfiguration, formatFiles, writeJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { deduceDefaultBase } from '../../utilities/default-base'; export interface Schema { diff --git a/packages/workspace/src/generators/convert-to-nx-project/convert-to-nx-project.ts b/packages/workspace/src/generators/convert-to-nx-project/convert-to-nx-project.ts index fa4d853afbc163..effc2ecb8aab03 100644 --- a/packages/workspace/src/generators/convert-to-nx-project/convert-to-nx-project.ts +++ b/packages/workspace/src/generators/convert-to-nx-project/convert-to-nx-project.ts @@ -6,7 +6,7 @@ import { Tree, updateProjectConfiguration, writeJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { join } from 'path'; import { Schema } from './schema'; import { toNewFormat, toOldFormat } from 'nx/src/adapter/angular-json'; diff --git a/packages/workspace/src/generators/move/lib/check-destination.spec.ts b/packages/workspace/src/generators/move/lib/check-destination.spec.ts index 2cdfa9a7950659..17267ac8c6a8d9 100644 --- a/packages/workspace/src/generators/move/lib/check-destination.spec.ts +++ b/packages/workspace/src/generators/move/lib/check-destination.spec.ts @@ -2,13 +2,13 @@ import { ProjectConfiguration, readProjectConfiguration, Tree, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { Schema } from '../schema'; import { checkDestination } from './check-destination'; // nx-ignore-next-line -const { libraryGenerator } = require('@nrwl/js'); +const { libraryGenerator } = require('@nx/js'); describe('checkDestination', () => { let tree: Tree; diff --git a/packages/workspace/src/generators/move/lib/check-destination.ts b/packages/workspace/src/generators/move/lib/check-destination.ts index b2665bd79136e4..930eaed0718840 100644 --- a/packages/workspace/src/generators/move/lib/check-destination.ts +++ b/packages/workspace/src/generators/move/lib/check-destination.ts @@ -1,4 +1,4 @@ -import { ProjectConfiguration, Tree } from '@nrwl/devkit'; +import { ProjectConfiguration, Tree } from '@nx/devkit'; import { Schema } from '../schema'; import { getDestination } from './utils'; diff --git a/packages/workspace/src/generators/move/lib/create-project-configuration-in-new-destination.spec.ts b/packages/workspace/src/generators/move/lib/create-project-configuration-in-new-destination.spec.ts index b443c724f343ed..1ebc1f1bf11607 100644 --- a/packages/workspace/src/generators/move/lib/create-project-configuration-in-new-destination.spec.ts +++ b/packages/workspace/src/generators/move/lib/create-project-configuration-in-new-destination.spec.ts @@ -3,8 +3,8 @@ import { ProjectConfiguration, readProjectConfiguration, Tree, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import type { NormalizedSchema } from '../schema'; import { createProjectConfigurationInNewDestination } from './create-project-configuration-in-new-destination'; diff --git a/packages/workspace/src/generators/move/lib/create-project-configuration-in-new-destination.ts b/packages/workspace/src/generators/move/lib/create-project-configuration-in-new-destination.ts index 5c7d4a569d4b50..e8dd804227de11 100644 --- a/packages/workspace/src/generators/move/lib/create-project-configuration-in-new-destination.ts +++ b/packages/workspace/src/generators/move/lib/create-project-configuration-in-new-destination.ts @@ -2,7 +2,7 @@ import { addProjectConfiguration, ProjectConfiguration, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { NormalizedSchema } from '../schema'; export function createProjectConfigurationInNewDestination( diff --git a/packages/workspace/src/generators/move/lib/move-project-files.spec.ts b/packages/workspace/src/generators/move/lib/move-project-files.spec.ts index 861489fc03f2b4..d39e3caa397372 100644 --- a/packages/workspace/src/generators/move/lib/move-project-files.spec.ts +++ b/packages/workspace/src/generators/move/lib/move-project-files.spec.ts @@ -2,13 +2,13 @@ import { ProjectConfiguration, readProjectConfiguration, Tree, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { NormalizedSchema } from '../schema'; import { moveProjectFiles } from './move-project-files'; // nx-ignore-next-line -const { libraryGenerator } = require('@nrwl/js'); +const { libraryGenerator } = require('@nx/js'); describe('moveProject', () => { let tree: Tree; diff --git a/packages/workspace/src/generators/move/lib/move-project-files.ts b/packages/workspace/src/generators/move/lib/move-project-files.ts index 3a9dadcf9c1a23..363b2438055eb8 100644 --- a/packages/workspace/src/generators/move/lib/move-project-files.ts +++ b/packages/workspace/src/generators/move/lib/move-project-files.ts @@ -1,4 +1,4 @@ -import { ProjectConfiguration, Tree, visitNotIgnoredFiles } from '@nrwl/devkit'; +import { ProjectConfiguration, Tree, visitNotIgnoredFiles } from '@nx/devkit'; import { join, relative } from 'path'; import { NormalizedSchema } from '../schema'; diff --git a/packages/workspace/src/generators/move/lib/normalize-schema.spec.ts b/packages/workspace/src/generators/move/lib/normalize-schema.spec.ts index 154d69b868a04f..d5209d38524e7f 100644 --- a/packages/workspace/src/generators/move/lib/normalize-schema.spec.ts +++ b/packages/workspace/src/generators/move/lib/normalize-schema.spec.ts @@ -5,8 +5,8 @@ import { readProjectConfiguration, Tree, updateJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { NormalizedSchema, Schema } from '../schema'; import { normalizeSchema } from './normalize-schema'; diff --git a/packages/workspace/src/generators/move/lib/normalize-schema.ts b/packages/workspace/src/generators/move/lib/normalize-schema.ts index ce128e78af1fc2..5a922e29c9fc39 100644 --- a/packages/workspace/src/generators/move/lib/normalize-schema.ts +++ b/packages/workspace/src/generators/move/lib/normalize-schema.ts @@ -1,4 +1,4 @@ -import { getWorkspaceLayout, ProjectConfiguration, Tree } from '@nrwl/devkit'; +import { getWorkspaceLayout, ProjectConfiguration, Tree } from '@nx/devkit'; import { getImportPath } from 'nx/src/utils/path'; import type { NormalizedSchema, Schema } from '../schema'; import { getDestination, getNewProjectName, normalizeSlashes } from './utils'; diff --git a/packages/workspace/src/generators/move/lib/update-build-targets.spec.ts b/packages/workspace/src/generators/move/lib/update-build-targets.spec.ts index 9f340d3c47650d..f1f8197e706b3a 100644 --- a/packages/workspace/src/generators/move/lib/update-build-targets.spec.ts +++ b/packages/workspace/src/generators/move/lib/update-build-targets.spec.ts @@ -2,9 +2,9 @@ import { addProjectConfiguration, readProjectConfiguration, Tree, -} from '@nrwl/devkit'; -import * as nxDevkit from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import * as nxDevkit from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { NormalizedSchema } from '../schema'; import { updateBuildTargets } from './update-build-targets'; import { array } from 'yargs'; diff --git a/packages/workspace/src/generators/move/lib/update-build-targets.ts b/packages/workspace/src/generators/move/lib/update-build-targets.ts index 18ec236c5dca64..f4b916ccc3a24e 100644 --- a/packages/workspace/src/generators/move/lib/update-build-targets.ts +++ b/packages/workspace/src/generators/move/lib/update-build-targets.ts @@ -3,7 +3,7 @@ import { TargetConfiguration, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { NormalizedSchema } from '../schema'; /** diff --git a/packages/workspace/src/generators/move/lib/update-cypress-config.spec.ts b/packages/workspace/src/generators/move/lib/update-cypress-config.spec.ts index 088242c6eb4aff..12d10e20eefbab 100644 --- a/packages/workspace/src/generators/move/lib/update-cypress-config.spec.ts +++ b/packages/workspace/src/generators/move/lib/update-cypress-config.spec.ts @@ -4,13 +4,13 @@ import { readProjectConfiguration, Tree, writeJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { NormalizedSchema } from '../schema'; import { updateCypressConfig } from './update-cypress-config'; // nx-ignore-next-line -const { libraryGenerator } = require('@nrwl/js'); +const { libraryGenerator } = require('@nx/js'); describe('updateCypressConfig', () => { let tree: Tree; diff --git a/packages/workspace/src/generators/move/lib/update-cypress-config.ts b/packages/workspace/src/generators/move/lib/update-cypress-config.ts index 67670b512127df..f5e2409187b3ca 100644 --- a/packages/workspace/src/generators/move/lib/update-cypress-config.ts +++ b/packages/workspace/src/generators/move/lib/update-cypress-config.ts @@ -1,4 +1,4 @@ -import { ProjectConfiguration, Tree } from '@nrwl/devkit'; +import { ProjectConfiguration, Tree } from '@nx/devkit'; import * as path from 'path'; import { NormalizedSchema } from '../schema'; diff --git a/packages/workspace/src/generators/move/lib/update-default-project.spec.ts b/packages/workspace/src/generators/move/lib/update-default-project.spec.ts index 91e84bd31f43c7..80bca67b1bb32a 100644 --- a/packages/workspace/src/generators/move/lib/update-default-project.spec.ts +++ b/packages/workspace/src/generators/move/lib/update-default-project.spec.ts @@ -3,8 +3,8 @@ import { readNxJson, Tree, updateNxJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { NormalizedSchema } from '../schema'; import { updateDefaultProject } from './update-default-project'; diff --git a/packages/workspace/src/generators/move/lib/update-default-project.ts b/packages/workspace/src/generators/move/lib/update-default-project.ts index f1d8dc6a3c21a2..632328bccf7c21 100644 --- a/packages/workspace/src/generators/move/lib/update-default-project.ts +++ b/packages/workspace/src/generators/move/lib/update-default-project.ts @@ -1,4 +1,4 @@ -import { readNxJson, Tree, updateNxJson } from '@nrwl/devkit'; +import { readNxJson, Tree, updateNxJson } from '@nx/devkit'; import { NormalizedSchema } from '../schema'; /** diff --git a/packages/workspace/src/generators/move/lib/update-eslintrc-json.spec.ts b/packages/workspace/src/generators/move/lib/update-eslintrc-json.spec.ts index a62c100a42dd92..311b996e1a5e94 100644 --- a/packages/workspace/src/generators/move/lib/update-eslintrc-json.spec.ts +++ b/packages/workspace/src/generators/move/lib/update-eslintrc-json.spec.ts @@ -3,14 +3,14 @@ import { readProjectConfiguration, Tree, updateJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { Linter } from '../../../utils/lint'; import { NormalizedSchema } from '../schema'; import { updateEslintrcJson } from './update-eslintrc-json'; // nx-ignore-next-line -const { libraryGenerator } = require('@nrwl/js'); +const { libraryGenerator } = require('@nx/js'); describe('updateEslint', () => { let tree: Tree; diff --git a/packages/workspace/src/generators/move/lib/update-eslintrc-json.ts b/packages/workspace/src/generators/move/lib/update-eslintrc-json.ts index ac903122de28b6..fe385740f110fa 100644 --- a/packages/workspace/src/generators/move/lib/update-eslintrc-json.ts +++ b/packages/workspace/src/generators/move/lib/update-eslintrc-json.ts @@ -4,7 +4,7 @@ import { ProjectConfiguration, Tree, updateJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { join } from 'path'; import { NormalizedSchema } from '../schema'; diff --git a/packages/workspace/src/generators/move/lib/update-implicit-dependencies.spec.ts b/packages/workspace/src/generators/move/lib/update-implicit-dependencies.spec.ts index 84d47aaab19fa2..0aa5bb22d8be8b 100644 --- a/packages/workspace/src/generators/move/lib/update-implicit-dependencies.spec.ts +++ b/packages/workspace/src/generators/move/lib/update-implicit-dependencies.spec.ts @@ -2,8 +2,8 @@ import { addProjectConfiguration, readProjectConfiguration, Tree, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { NormalizedSchema } from '../schema'; import { updateImplicitDependencies } from './update-implicit-dependencies'; diff --git a/packages/workspace/src/generators/move/lib/update-implicit-dependencies.ts b/packages/workspace/src/generators/move/lib/update-implicit-dependencies.ts index d7baf3f3f37ff5..8c90d6b1fe3fee 100644 --- a/packages/workspace/src/generators/move/lib/update-implicit-dependencies.ts +++ b/packages/workspace/src/generators/move/lib/update-implicit-dependencies.ts @@ -1,5 +1,5 @@ -import type { Tree } from '@nrwl/devkit'; -import { getProjects, updateProjectConfiguration } from '@nrwl/devkit'; +import type { Tree } from '@nx/devkit'; +import { getProjects, updateProjectConfiguration } from '@nx/devkit'; import type { NormalizedSchema } from '../schema'; /** diff --git a/packages/workspace/src/generators/move/lib/update-imports.spec.ts b/packages/workspace/src/generators/move/lib/update-imports.spec.ts index 6b57fcf53b7590..02a0765bbb5b31 100644 --- a/packages/workspace/src/generators/move/lib/update-imports.spec.ts +++ b/packages/workspace/src/generators/move/lib/update-imports.spec.ts @@ -1,11 +1,11 @@ -import { readJson, readProjectConfiguration, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { readJson, readProjectConfiguration, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { Schema } from '../schema'; import { updateImports } from './update-imports'; import { normalizeSchema } from './normalize-schema'; // nx-ignore-next-line -const { libraryGenerator } = require('@nrwl/js'); +const { libraryGenerator } = require('@nx/js'); describe('updateImports', () => { let tree: Tree; diff --git a/packages/workspace/src/generators/move/lib/update-imports.ts b/packages/workspace/src/generators/move/lib/update-imports.ts index 37ebecf7c30727..2f6ac990198dd2 100644 --- a/packages/workspace/src/generators/move/lib/update-imports.ts +++ b/packages/workspace/src/generators/move/lib/update-imports.ts @@ -11,7 +11,7 @@ import { writeJson, readJson, getImportPath, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import type * as ts from 'typescript'; import { getRootTsConfigPathInTree } from '../../../utilities/ts-config'; import { findNodes } from 'nx/src/utils/typescript'; diff --git a/packages/workspace/src/generators/move/lib/update-jest-config.spec.ts b/packages/workspace/src/generators/move/lib/update-jest-config.spec.ts index 707129c7191552..ed7c4ba781ab70 100644 --- a/packages/workspace/src/generators/move/lib/update-jest-config.spec.ts +++ b/packages/workspace/src/generators/move/lib/update-jest-config.spec.ts @@ -1,10 +1,10 @@ -import { readProjectConfiguration, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { readProjectConfiguration, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { NormalizedSchema } from '../schema'; import { updateJestConfig } from './update-jest-config'; // nx-ignore-next-line -const { libraryGenerator } = require('@nrwl/js'); +const { libraryGenerator } = require('@nx/js'); describe('updateJestConfig', () => { let tree: Tree; @@ -149,7 +149,7 @@ describe('updateJestConfig', () => { }); tree.write( rootJestConfigPath, - `const { getJestProjects } = require('@nrwl/jest'); + `const { getJestProjects } = require('@nx/jest'); module.exports = { projects: [...getJestProjects(), '/libs/some/test/dir/my-source'] @@ -188,7 +188,7 @@ module.exports = { }); tree.write( rootJestConfigPath, - `const { getJestProjects } = require('@nrwl/jest'); + `const { getJestProjects } = require('@nx/jest'); module.exports = { projects: [...getJestProjects(), '/libs/some/test/dir/my-source', '/libs/foo'] diff --git a/packages/workspace/src/generators/move/lib/update-jest-config.ts b/packages/workspace/src/generators/move/lib/update-jest-config.ts index 3181aea9bc80e8..e0b8447662041a 100644 --- a/packages/workspace/src/generators/move/lib/update-jest-config.ts +++ b/packages/workspace/src/generators/move/lib/update-jest-config.ts @@ -1,4 +1,4 @@ -import { ProjectConfiguration, Tree } from '@nrwl/devkit'; +import { ProjectConfiguration, Tree } from '@nx/devkit'; import * as path from 'path'; import { NormalizedSchema } from '../schema'; diff --git a/packages/workspace/src/generators/move/lib/update-package-json.spec.ts b/packages/workspace/src/generators/move/lib/update-package-json.spec.ts index 4d2ee39149a362..2307319609e358 100644 --- a/packages/workspace/src/generators/move/lib/update-package-json.spec.ts +++ b/packages/workspace/src/generators/move/lib/update-package-json.spec.ts @@ -1,10 +1,10 @@ -import { readJson, Tree, writeJson } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { readJson, Tree, writeJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { NormalizedSchema } from '../schema'; import { updatePackageJson } from './update-package-json'; // nx-ignore-next-line -const { libraryGenerator } = require('@nrwl/js'); +const { libraryGenerator } = require('@nx/js'); describe('updatePackageJson', () => { let tree: Tree; diff --git a/packages/workspace/src/generators/move/lib/update-package-json.ts b/packages/workspace/src/generators/move/lib/update-package-json.ts index 6dd227294a4982..ef8f3f9673b733 100644 --- a/packages/workspace/src/generators/move/lib/update-package-json.ts +++ b/packages/workspace/src/generators/move/lib/update-package-json.ts @@ -1,4 +1,4 @@ -import { readJson, Tree } from '@nrwl/devkit'; +import { readJson, Tree } from '@nx/devkit'; import * as path from 'path'; import { NormalizedSchema } from '../schema'; diff --git a/packages/workspace/src/generators/move/lib/update-project-root-files.spec.ts b/packages/workspace/src/generators/move/lib/update-project-root-files.spec.ts index 2c17898991cb11..3cebac62b2fdd4 100644 --- a/packages/workspace/src/generators/move/lib/update-project-root-files.spec.ts +++ b/packages/workspace/src/generators/move/lib/update-project-root-files.spec.ts @@ -1,10 +1,10 @@ -import { readProjectConfiguration, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { readProjectConfiguration, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { NormalizedSchema } from '../schema'; import { updateProjectRootFiles } from './update-project-root-files'; // nx-ignore-next-line -const { libraryGenerator } = require('@nrwl/js'); +const { libraryGenerator } = require('@nx/js'); describe('updateProjectRootFiles', () => { let tree: Tree; diff --git a/packages/workspace/src/generators/move/lib/update-project-root-files.ts b/packages/workspace/src/generators/move/lib/update-project-root-files.ts index 22d377088c8ff2..10e34db9edccdf 100644 --- a/packages/workspace/src/generators/move/lib/update-project-root-files.ts +++ b/packages/workspace/src/generators/move/lib/update-project-root-files.ts @@ -1,5 +1,5 @@ -import { ProjectConfiguration, Tree } from '@nrwl/devkit'; -import { workspaceRoot } from '@nrwl/devkit'; +import { ProjectConfiguration, Tree } from '@nx/devkit'; +import { workspaceRoot } from '@nx/devkit'; import * as path from 'path'; import { extname, join } from 'path'; import { NormalizedSchema } from '../schema'; diff --git a/packages/workspace/src/generators/move/lib/update-readme.spec.ts b/packages/workspace/src/generators/move/lib/update-readme.spec.ts index 15cf99cd5160f5..f1f895ed084595 100644 --- a/packages/workspace/src/generators/move/lib/update-readme.spec.ts +++ b/packages/workspace/src/generators/move/lib/update-readme.spec.ts @@ -1,11 +1,11 @@ -import { Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { join } from 'path'; import { NormalizedSchema } from '../schema'; import { updateReadme } from './update-readme'; // nx-ignore-next-line -const { libraryGenerator } = require('@nrwl/js'); +const { libraryGenerator } = require('@nx/js'); describe('updateReadme', () => { let tree: Tree; diff --git a/packages/workspace/src/generators/move/lib/update-readme.ts b/packages/workspace/src/generators/move/lib/update-readme.ts index ebc66f433a866e..e1080ccdd1208d 100644 --- a/packages/workspace/src/generators/move/lib/update-readme.ts +++ b/packages/workspace/src/generators/move/lib/update-readme.ts @@ -1,4 +1,4 @@ -import { Tree } from '@nrwl/devkit'; +import { Tree } from '@nx/devkit'; import { join } from 'path'; import { NormalizedSchema } from '../schema'; diff --git a/packages/workspace/src/generators/move/lib/update-storybook-config.spec.ts b/packages/workspace/src/generators/move/lib/update-storybook-config.spec.ts index 3919d1e3f8600d..817df8a31b862f 100644 --- a/packages/workspace/src/generators/move/lib/update-storybook-config.spec.ts +++ b/packages/workspace/src/generators/move/lib/update-storybook-config.spec.ts @@ -1,10 +1,10 @@ -import { readProjectConfiguration, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { readProjectConfiguration, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { NormalizedSchema } from '../schema'; import { updateStorybookConfig } from './update-storybook-config'; // nx-ignore-next-line -const { libraryGenerator } = require('@nrwl/js'); +const { libraryGenerator } = require('@nx/js'); describe('updateStorybookConfig', () => { let tree: Tree; diff --git a/packages/workspace/src/generators/move/lib/update-storybook-config.ts b/packages/workspace/src/generators/move/lib/update-storybook-config.ts index 977dc21f31f2d2..5a36ecb0fa9e7b 100644 --- a/packages/workspace/src/generators/move/lib/update-storybook-config.ts +++ b/packages/workspace/src/generators/move/lib/update-storybook-config.ts @@ -1,5 +1,5 @@ -import { ProjectConfiguration, Tree } from '@nrwl/devkit'; -import { workspaceRoot } from '@nrwl/devkit'; +import { ProjectConfiguration, Tree } from '@nx/devkit'; +import { workspaceRoot } from '@nx/devkit'; import * as path from 'path'; import { join } from 'path'; import { NormalizedSchema } from '../schema'; diff --git a/packages/workspace/src/generators/move/lib/utils.ts b/packages/workspace/src/generators/move/lib/utils.ts index 26b5453c777b96..2fc7d808c5def7 100644 --- a/packages/workspace/src/generators/move/lib/utils.ts +++ b/packages/workspace/src/generators/move/lib/utils.ts @@ -3,7 +3,7 @@ import { joinPathFragments, ProjectConfiguration, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { Schema } from '../schema'; diff --git a/packages/workspace/src/generators/move/move.spec.ts b/packages/workspace/src/generators/move/move.spec.ts index aaa39bba075d6a..2c5346fe23f04d 100644 --- a/packages/workspace/src/generators/move/move.spec.ts +++ b/packages/workspace/src/generators/move/move.spec.ts @@ -1,9 +1,9 @@ -import { readJson, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { readJson, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { moveGenerator } from './move'; // nx-ignore-next-line -const { libraryGenerator } = require('@nrwl/js'); +const { libraryGenerator } = require('@nx/js'); describe('move', () => { let tree: Tree; diff --git a/packages/workspace/src/generators/move/move.ts b/packages/workspace/src/generators/move/move.ts index 897c104c9a0b9e..811f0fb556d5e6 100644 --- a/packages/workspace/src/generators/move/move.ts +++ b/packages/workspace/src/generators/move/move.ts @@ -4,7 +4,7 @@ import { readProjectConfiguration, removeProjectConfiguration, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { checkDestination } from './lib/check-destination'; import { createProjectConfigurationInNewDestination } from './lib/create-project-configuration-in-new-destination'; import { moveProjectFiles } from './lib/move-project-files'; diff --git a/packages/workspace/src/generators/new/generate-preset.ts b/packages/workspace/src/generators/new/generate-preset.ts index 6b8ba4aca7a87c..e79133e6c5731c 100644 --- a/packages/workspace/src/generators/new/generate-preset.ts +++ b/packages/workspace/src/generators/new/generate-preset.ts @@ -2,7 +2,7 @@ import { addDependenciesToPackageJson, getPackageManagerCommand, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { Preset } from '../utils/presets'; import { angularCliVersion, diff --git a/packages/workspace/src/generators/new/generate-workspace-files.spec.ts b/packages/workspace/src/generators/new/generate-workspace-files.spec.ts index 7faa5cae9c3f09..c56d1157d1abf0 100644 --- a/packages/workspace/src/generators/new/generate-workspace-files.spec.ts +++ b/packages/workspace/src/generators/new/generate-workspace-files.spec.ts @@ -1,8 +1,8 @@ -import type { NxJsonConfiguration, Tree } from '@nrwl/devkit'; -import { readJson } from '@nrwl/devkit'; +import type { NxJsonConfiguration, Tree } from '@nx/devkit'; +import { readJson } from '@nx/devkit'; import Ajv from 'ajv'; import { generateWorkspaceFiles } from './generate-workspace-files'; -import { createTree } from '@nrwl/devkit/testing'; +import { createTree } from '@nx/devkit/testing'; import { Preset } from '../utils/presets'; import * as nxSchema from '../../../../nx/schemas/nx-schema.json'; diff --git a/packages/workspace/src/generators/new/generate-workspace-files.ts b/packages/workspace/src/generators/new/generate-workspace-files.ts index 4b651329bb9d47..f6fe12724c42c4 100644 --- a/packages/workspace/src/generators/new/generate-workspace-files.ts +++ b/packages/workspace/src/generators/new/generate-workspace-files.ts @@ -8,7 +8,7 @@ import { Tree, updateJson, writeJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { nxVersion } from '../../utils/versions'; import { join, join as pathJoin } from 'path'; import { Preset } from '../utils/presets'; diff --git a/packages/workspace/src/generators/new/new.spec.ts b/packages/workspace/src/generators/new/new.spec.ts index 336da7e1c96be5..af8dbb3ca2e37a 100644 --- a/packages/workspace/src/generators/new/new.spec.ts +++ b/packages/workspace/src/generators/new/new.spec.ts @@ -1,5 +1,5 @@ -import { readJson, Tree, writeJson } from '@nrwl/devkit'; -import { createTree } from '@nrwl/devkit/testing'; +import { readJson, Tree, writeJson } from '@nx/devkit'; +import { createTree } from '@nx/devkit/testing'; import { Linter } from '../../utils/lint'; import { angularCliVersion, diff --git a/packages/workspace/src/generators/new/new.ts b/packages/workspace/src/generators/new/new.ts index 66adbf390374fc..79cc3816428e14 100644 --- a/packages/workspace/src/generators/new/new.ts +++ b/packages/workspace/src/generators/new/new.ts @@ -4,7 +4,7 @@ import { names, PackageManager, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { join } from 'path'; import { Preset } from '../utils/presets'; diff --git a/packages/workspace/src/generators/npm-package/npm-package.spec.ts b/packages/workspace/src/generators/npm-package/npm-package.spec.ts index 7a2cdda41f1ef9..daf0ba0a58aba6 100644 --- a/packages/workspace/src/generators/npm-package/npm-package.spec.ts +++ b/packages/workspace/src/generators/npm-package/npm-package.spec.ts @@ -5,8 +5,8 @@ import { Tree, updateNxJson, writeJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { npmPackageGenerator } from './npm-package'; describe('@nrwl/workspace:npm-package', () => { diff --git a/packages/workspace/src/generators/npm-package/npm-package.ts b/packages/workspace/src/generators/npm-package/npm-package.ts index 1116f5cf656421..84c375102540f7 100644 --- a/packages/workspace/src/generators/npm-package/npm-package.ts +++ b/packages/workspace/src/generators/npm-package/npm-package.ts @@ -7,7 +7,7 @@ import { names, Tree, writeJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { join } from 'path'; import { getImportPath } from 'nx/src/utils/path'; diff --git a/packages/workspace/src/generators/preset/preset.spec.ts b/packages/workspace/src/generators/preset/preset.spec.ts index c318f9bda6fbfa..12f26974f7b9e6 100644 --- a/packages/workspace/src/generators/preset/preset.spec.ts +++ b/packages/workspace/src/generators/preset/preset.spec.ts @@ -1,6 +1,6 @@ -import { readProjectConfiguration, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import { overrideCollectionResolutionForTesting } from '@nrwl/devkit/ngcli-adapter'; +import { readProjectConfiguration, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import { overrideCollectionResolutionForTesting } from '@nx/devkit/ngcli-adapter'; import { presetGenerator } from './preset'; import * as path from 'path'; import { Preset } from '../utils/presets'; diff --git a/packages/workspace/src/generators/preset/preset.ts b/packages/workspace/src/generators/preset/preset.ts index 4550e60bea7833..d36375155f5454 100644 --- a/packages/workspace/src/generators/preset/preset.ts +++ b/packages/workspace/src/generators/preset/preset.ts @@ -4,7 +4,7 @@ import { readNxJson, Tree, updateNxJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { Schema } from './schema'; import { Preset } from '../utils/presets'; @@ -25,7 +25,7 @@ async function createPreset(tree: Tree, options: Schema) { } else if (options.preset === Preset.AngularMonorepo) { const { applicationGenerator: angularApplicationGenerator, - } = require('@nrwl' + '/angular/generators'); + } = require('@nx' + '/angular/generators'); return angularApplicationGenerator(tree, { name: options.name, @@ -37,7 +37,7 @@ async function createPreset(tree: Tree, options: Schema) { } else if (options.preset === Preset.AngularStandalone) { const { applicationGenerator: angularApplicationGenerator, - } = require('@nrwl' + '/angular/generators'); + } = require('@nx' + '/angular/generators'); return angularApplicationGenerator(tree, { name: options.name, @@ -48,9 +48,8 @@ async function createPreset(tree: Tree, options: Schema) { standalone: options.standaloneApi, }); } else if (options.preset === Preset.ReactMonorepo) { - const { - applicationGenerator: reactApplicationGenerator, - } = require('@nrwl' + '/react'); + const { applicationGenerator: reactApplicationGenerator } = require('@nx' + + '/react'); return reactApplicationGenerator(tree, { name: options.name, @@ -59,9 +58,8 @@ async function createPreset(tree: Tree, options: Schema) { bundler: options.bundler ?? 'webpack', }); } else if (options.preset === Preset.ReactStandalone) { - const { - applicationGenerator: reactApplicationGenerator, - } = require('@nrwl' + '/react'); + const { applicationGenerator: reactApplicationGenerator } = require('@nx' + + '/react'); return reactApplicationGenerator(tree, { name: options.name, @@ -73,7 +71,7 @@ async function createPreset(tree: Tree, options: Schema) { unitTestRunner: options.bundler === 'vite' ? 'vitest' : 'jest', }); } else if (options.preset === Preset.NextJs) { - const { applicationGenerator: nextApplicationGenerator } = require('@nrwl' + + const { applicationGenerator: nextApplicationGenerator } = require('@nx' + '/next'); return nextApplicationGenerator(tree, { @@ -82,7 +80,7 @@ async function createPreset(tree: Tree, options: Schema) { linter: options.linter, }); } else if (options.preset === Preset.WebComponents) { - const { applicationGenerator: webApplicationGenerator } = require('@nrwl' + + const { applicationGenerator: webApplicationGenerator } = require('@nx' + '/web'); return webApplicationGenerator(tree, { @@ -92,7 +90,7 @@ async function createPreset(tree: Tree, options: Schema) { bundler: 'vite', }); } else if (options.preset === Preset.Nest) { - const { applicationGenerator: nestApplicationGenerator } = require('@nrwl' + + const { applicationGenerator: nestApplicationGenerator } = require('@nx' + '/nest'); return nestApplicationGenerator(tree, { @@ -102,13 +100,13 @@ async function createPreset(tree: Tree, options: Schema) { } else if (options.preset === Preset.Express) { const { applicationGenerator: expressApplicationGenerator, - } = require('@nrwl' + '/express'); + } = require('@nx' + '/express'); return expressApplicationGenerator(tree, { name: options.name, linter: options.linter, }); } else if (options.preset === Preset.ReactNative) { - const { reactNativeApplicationGenerator } = require('@nrwl' + + const { reactNativeApplicationGenerator } = require('@nx' + '/react-native'); return reactNativeApplicationGenerator(tree, { name: options.name, @@ -116,7 +114,7 @@ async function createPreset(tree: Tree, options: Schema) { e2eTestRunner: 'detox', }); } else if (options.preset === Preset.Expo) { - const { expoApplicationGenerator } = require('@nrwl' + '/expo'); + const { expoApplicationGenerator } = require('@nx' + '/expo'); return expoApplicationGenerator(tree, { name: options.name, linter: options.linter, @@ -124,7 +122,7 @@ async function createPreset(tree: Tree, options: Schema) { }); } else if (options.preset === Preset.TS) { const c = readNxJson(tree); - const { initGenerator } = require('@nrwl' + '/js'); + const { initGenerator } = require('@nx' + '/js'); c.workspaceLayout = { appsDir: 'packages', libsDir: 'packages', @@ -132,7 +130,7 @@ async function createPreset(tree: Tree, options: Schema) { updateNxJson(tree, c); return initGenerator(tree, {}); } else if (options.preset === Preset.NodeStandalone) { - const { applicationGenerator: nodeApplicationGenerator } = require('@nrwl' + + const { applicationGenerator: nodeApplicationGenerator } = require('@nx' + '/node'); return nodeApplicationGenerator(tree, { name: options.name, diff --git a/packages/workspace/src/generators/preset/schema.d.ts b/packages/workspace/src/generators/preset/schema.d.ts index 50c5ecedda24f0..aa6f25925edd20 100644 --- a/packages/workspace/src/generators/preset/schema.d.ts +++ b/packages/workspace/src/generators/preset/schema.d.ts @@ -1,5 +1,5 @@ import { Preset } from '../utils/presets'; -import { PackageManager } from '@nrwl/devkit'; +import { PackageManager } from '@nx/devkit'; export interface Schema { name: string; diff --git a/packages/workspace/src/generators/remove/lib/check-dependencies.spec.ts b/packages/workspace/src/generators/remove/lib/check-dependencies.spec.ts index 69c39889ab80f6..8047fbf3a536d0 100644 --- a/packages/workspace/src/generators/remove/lib/check-dependencies.spec.ts +++ b/packages/workspace/src/generators/remove/lib/check-dependencies.spec.ts @@ -4,10 +4,10 @@ import { readProjectConfiguration, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { Schema } from '../schema'; import { checkDependencies } from './check-dependencies'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; // import { libraryGenerator } from '../../library/library'; // let projectGraph: ProjectGraph; // jest.mock('../../../core/project-graph', () => ({ diff --git a/packages/workspace/src/generators/remove/lib/check-dependencies.ts b/packages/workspace/src/generators/remove/lib/check-dependencies.ts index 5f8bb5f5ff1100..51ffeb17d01c97 100644 --- a/packages/workspace/src/generators/remove/lib/check-dependencies.ts +++ b/packages/workspace/src/generators/remove/lib/check-dependencies.ts @@ -1,4 +1,4 @@ -import { createProjectGraphAsync, ProjectGraph, reverse } from '@nrwl/devkit'; +import { createProjectGraphAsync, ProjectGraph, reverse } from '@nx/devkit'; import { Schema } from '../schema'; /** diff --git a/packages/workspace/src/generators/remove/lib/check-project-is-safe-to-remove.spec.ts b/packages/workspace/src/generators/remove/lib/check-project-is-safe-to-remove.spec.ts index 0aefc97af3c5d2..b2ed9e77624184 100644 --- a/packages/workspace/src/generators/remove/lib/check-project-is-safe-to-remove.spec.ts +++ b/packages/workspace/src/generators/remove/lib/check-project-is-safe-to-remove.spec.ts @@ -1,9 +1,9 @@ -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { addProjectConfiguration, readProjectConfiguration, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { checkProjectIsSafeToRemove } from './check-project-is-safe-to-remove'; describe('checkProjectIsSafeToRemove', () => { diff --git a/packages/workspace/src/generators/remove/lib/check-project-is-safe-to-remove.ts b/packages/workspace/src/generators/remove/lib/check-project-is-safe-to-remove.ts index fa77d3ddfc5e1d..93bd2ecc4e5a55 100644 --- a/packages/workspace/src/generators/remove/lib/check-project-is-safe-to-remove.ts +++ b/packages/workspace/src/generators/remove/lib/check-project-is-safe-to-remove.ts @@ -4,7 +4,7 @@ import { normalizePath, ProjectConfiguration, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { Schema } from '../schema'; import { relative } from 'path'; diff --git a/packages/workspace/src/generators/remove/lib/check-targets.spec.ts b/packages/workspace/src/generators/remove/lib/check-targets.spec.ts index ea9a59cd7d8930..3379a5dd1396af 100644 --- a/packages/workspace/src/generators/remove/lib/check-targets.spec.ts +++ b/packages/workspace/src/generators/remove/lib/check-targets.spec.ts @@ -1,5 +1,5 @@ -import { addProjectConfiguration, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { addProjectConfiguration, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { Schema } from '../schema'; import { checkTargets } from './check-targets'; diff --git a/packages/workspace/src/generators/remove/lib/check-targets.ts b/packages/workspace/src/generators/remove/lib/check-targets.ts index dd1d8c1d0e0d03..1cc66b8948eb02 100644 --- a/packages/workspace/src/generators/remove/lib/check-targets.ts +++ b/packages/workspace/src/generators/remove/lib/check-targets.ts @@ -4,7 +4,7 @@ import { parseTargetString, TargetConfiguration, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { Schema } from '../schema'; /** diff --git a/packages/workspace/src/generators/remove/lib/remove-project-references-in-config.spec.ts b/packages/workspace/src/generators/remove/lib/remove-project-references-in-config.spec.ts index 4495e8fa4c32f1..732758447b9c94 100644 --- a/packages/workspace/src/generators/remove/lib/remove-project-references-in-config.spec.ts +++ b/packages/workspace/src/generators/remove/lib/remove-project-references-in-config.spec.ts @@ -4,8 +4,8 @@ import { readNxJson, Tree, updateNxJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { Schema } from '../schema'; import { removeProjectReferencesInConfig } from './remove-project-references-in-config'; diff --git a/packages/workspace/src/generators/remove/lib/remove-project-references-in-config.ts b/packages/workspace/src/generators/remove/lib/remove-project-references-in-config.ts index 56808ce5e18c1e..8856b266337989 100644 --- a/packages/workspace/src/generators/remove/lib/remove-project-references-in-config.ts +++ b/packages/workspace/src/generators/remove/lib/remove-project-references-in-config.ts @@ -6,7 +6,7 @@ import { Tree, updateNxJson, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; export function removeProjectReferencesInConfig(tree: Tree, schema: Schema) { // Unset default project if deleting the default project diff --git a/packages/workspace/src/generators/remove/lib/remove-project.spec.ts b/packages/workspace/src/generators/remove/lib/remove-project.spec.ts index b00de890980b0f..15452ab0fb2385 100644 --- a/packages/workspace/src/generators/remove/lib/remove-project.spec.ts +++ b/packages/workspace/src/generators/remove/lib/remove-project.spec.ts @@ -1,10 +1,10 @@ -import { readProjectConfiguration, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { readProjectConfiguration, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { Schema } from '../schema'; -import { removeProject } from '@nrwl/workspace/src/generators/remove/lib/remove-project'; +import { removeProject } from '@nx/workspace/src/generators/remove/lib/remove-project'; // nx-ignore-next-line -const { libraryGenerator } = require('@nrwl/js'); +const { libraryGenerator } = require('@nx/js'); describe('moveProject', () => { let schema: Schema; diff --git a/packages/workspace/src/generators/remove/lib/remove-project.ts b/packages/workspace/src/generators/remove/lib/remove-project.ts index 8e3a09309e3d2f..38ba48ff1cac9d 100644 --- a/packages/workspace/src/generators/remove/lib/remove-project.ts +++ b/packages/workspace/src/generators/remove/lib/remove-project.ts @@ -1,4 +1,4 @@ -import { ProjectConfiguration, Tree, visitNotIgnoredFiles } from '@nrwl/devkit'; +import { ProjectConfiguration, Tree, visitNotIgnoredFiles } from '@nx/devkit'; /** * Removes (deletes) a project's files from the folder tree diff --git a/packages/workspace/src/generators/remove/lib/update-jest-config.spec.ts b/packages/workspace/src/generators/remove/lib/update-jest-config.spec.ts index 0011832cdf8492..24a658fbaacde0 100644 --- a/packages/workspace/src/generators/remove/lib/update-jest-config.spec.ts +++ b/packages/workspace/src/generators/remove/lib/update-jest-config.spec.ts @@ -1,5 +1,5 @@ -import { readProjectConfiguration, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { readProjectConfiguration, Tree } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { readFileSync } from 'fs'; import { join } from 'path'; @@ -8,7 +8,7 @@ import { Schema } from '../schema'; import { updateJestConfig } from './update-jest-config'; // nx-ignore-next-line -const { libraryGenerator } = require('@nrwl/js'); +const { libraryGenerator } = require('@nx/js'); describe('updateRootJestConfig', () => { let tree: Tree; diff --git a/packages/workspace/src/generators/remove/lib/update-jest-config.ts b/packages/workspace/src/generators/remove/lib/update-jest-config.ts index 9925b9ca3ee432..89e1f0e0f53e59 100644 --- a/packages/workspace/src/generators/remove/lib/update-jest-config.ts +++ b/packages/workspace/src/generators/remove/lib/update-jest-config.ts @@ -3,7 +3,7 @@ import { ChangeType, ProjectConfiguration, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { getSourceNodes } from '../../../utilities/typescript/get-source-nodes'; import { Schema } from '../schema'; diff --git a/packages/workspace/src/generators/remove/lib/update-tsconfig.spec.ts b/packages/workspace/src/generators/remove/lib/update-tsconfig.spec.ts index 9fb6dcd805d9de..66196252613d44 100644 --- a/packages/workspace/src/generators/remove/lib/update-tsconfig.spec.ts +++ b/packages/workspace/src/generators/remove/lib/update-tsconfig.spec.ts @@ -3,18 +3,18 @@ import { readJson, readProjectConfiguration, Tree, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { Schema } from '../schema'; import { updateTsconfig } from './update-tsconfig'; // nx-ignore-next-line -const { libraryGenerator } = require('@nrwl/js'); +const { libraryGenerator } = require('@nx/js'); let graph: ProjectGraph; -jest.mock('@nrwl/devkit', () => { +jest.mock('@nx/devkit', () => { return { - ...jest.requireActual('@nrwl/devkit'), + ...jest.requireActual('@nx/devkit'), createProjectGraphAsync: jest.fn().mockImplementation(() => graph), }; }); diff --git a/packages/workspace/src/generators/remove/lib/update-tsconfig.ts b/packages/workspace/src/generators/remove/lib/update-tsconfig.ts index 19dc1e18683f03..a1caf16d2f2dfd 100644 --- a/packages/workspace/src/generators/remove/lib/update-tsconfig.ts +++ b/packages/workspace/src/generators/remove/lib/update-tsconfig.ts @@ -4,7 +4,7 @@ import { ProjectGraph, Tree, updateJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { getRootTsConfigPathInTree } from '../../../utilities/ts-config'; import { Schema } from '../schema'; import { diff --git a/packages/workspace/src/generators/remove/remove.ts b/packages/workspace/src/generators/remove/remove.ts index 4e9a6fee807bfa..c86575b38c2a3b 100644 --- a/packages/workspace/src/generators/remove/remove.ts +++ b/packages/workspace/src/generators/remove/remove.ts @@ -3,7 +3,7 @@ import { formatFiles, readProjectConfiguration, Tree, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { checkProjectIsSafeToRemove } from './lib/check-project-is-safe-to-remove'; import { checkDependencies } from './lib/check-dependencies'; diff --git a/packages/workspace/src/generators/run-commands/run-commands.spec.ts b/packages/workspace/src/generators/run-commands/run-commands.spec.ts index 7151bde0b5f7d8..845eb5df9a1dc4 100644 --- a/packages/workspace/src/generators/run-commands/run-commands.spec.ts +++ b/packages/workspace/src/generators/run-commands/run-commands.spec.ts @@ -1,9 +1,9 @@ -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import runCommands from './run-commands'; import { readProjectConfiguration } from 'nx/src/generators/utils/project-configuration'; // nx-ignore-next-line -const { libraryGenerator } = require('@nrwl/js'); +const { libraryGenerator } = require('@nx/js'); describe('run-commands', () => { it('should generate a target', async () => { diff --git a/packages/workspace/src/generators/run-commands/run-commands.ts b/packages/workspace/src/generators/run-commands/run-commands.ts index 416b3b08dca8e5..a121aa448486f2 100644 --- a/packages/workspace/src/generators/run-commands/run-commands.ts +++ b/packages/workspace/src/generators/run-commands/run-commands.ts @@ -6,7 +6,7 @@ import { readProjectConfiguration, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; export async function runCommandsGenerator(host: Tree, schema: Schema) { const project = readProjectConfiguration(host, schema.project); diff --git a/packages/workspace/src/generators/utils/insert-import.spec.ts b/packages/workspace/src/generators/utils/insert-import.spec.ts index 18d3c258ca80fd..cd0d3d168d3439 100644 --- a/packages/workspace/src/generators/utils/insert-import.spec.ts +++ b/packages/workspace/src/generators/utils/insert-import.spec.ts @@ -1,5 +1,5 @@ -import { Tree } from '@nrwl/devkit'; -import { createTree } from '@nrwl/devkit/testing'; +import { Tree } from '@nx/devkit'; +import { createTree } from '@nx/devkit/testing'; import { insertImport } from './insert-import'; describe('insertImport', () => { diff --git a/packages/workspace/src/generators/utils/insert-import.ts b/packages/workspace/src/generators/utils/insert-import.ts index fd06fd7dfa72af..8057840b94541e 100644 --- a/packages/workspace/src/generators/utils/insert-import.ts +++ b/packages/workspace/src/generators/utils/insert-import.ts @@ -1,5 +1,5 @@ import { insertStatement } from './insert-statement'; -import { applyChangesToString, ChangeType, Tree } from '@nrwl/devkit'; +import { applyChangesToString, ChangeType, Tree } from '@nx/devkit'; import type { NamedImports } from 'typescript'; import { ensureTypescript } from '../../utilities/typescript'; diff --git a/packages/workspace/src/generators/utils/insert-statement.spec.ts b/packages/workspace/src/generators/utils/insert-statement.spec.ts index 527ac03f3efe63..556ad35a9992a1 100644 --- a/packages/workspace/src/generators/utils/insert-statement.spec.ts +++ b/packages/workspace/src/generators/utils/insert-statement.spec.ts @@ -1,5 +1,5 @@ -import { Tree } from '@nrwl/devkit'; -import { createTree } from '@nrwl/devkit/testing'; +import { Tree } from '@nx/devkit'; +import { createTree } from '@nx/devkit/testing'; import { insertStatement } from './insert-statement'; describe('insertStatement', () => { diff --git a/packages/workspace/src/generators/utils/insert-statement.ts b/packages/workspace/src/generators/utils/insert-statement.ts index 43de32823099d5..c33e31032fcc32 100644 --- a/packages/workspace/src/generators/utils/insert-statement.ts +++ b/packages/workspace/src/generators/utils/insert-statement.ts @@ -1,4 +1,4 @@ -import { applyChangesToString, ChangeType, Tree } from '@nrwl/devkit'; +import { applyChangesToString, ChangeType, Tree } from '@nx/devkit'; import { ensureTypescript } from '../../utilities/typescript'; let tsModule: typeof import('typescript'); diff --git a/packages/workspace/src/generators/workspace-generator/workspace-generator.spec.ts b/packages/workspace/src/generators/workspace-generator/workspace-generator.spec.ts index 86ae683d54722d..a4f14b145a98b3 100644 --- a/packages/workspace/src/generators/workspace-generator/workspace-generator.spec.ts +++ b/packages/workspace/src/generators/workspace-generator/workspace-generator.spec.ts @@ -1,4 +1,4 @@ -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import workspaceGenerator from './workspace-generator'; describe('workspace-generator', () => { diff --git a/packages/workspace/src/generators/workspace-generator/workspace-generator.ts b/packages/workspace/src/generators/workspace-generator/workspace-generator.ts index 6a7c00a0f66fd7..0f09d0fbbe96fd 100644 --- a/packages/workspace/src/generators/workspace-generator/workspace-generator.ts +++ b/packages/workspace/src/generators/workspace-generator/workspace-generator.ts @@ -6,7 +6,7 @@ import { names, joinPathFragments, addDependenciesToPackageJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { nxVersion } from '../../utils/versions'; export default async function (host: Tree, schema: Schema) { diff --git a/packages/workspace/src/migrations/update-12-5-0/add-target-dependencies.ts b/packages/workspace/src/migrations/update-12-5-0/add-target-dependencies.ts index 68528b766761ec..eac1cf226dd99b 100644 --- a/packages/workspace/src/migrations/update-12-5-0/add-target-dependencies.ts +++ b/packages/workspace/src/migrations/update-12-5-0/add-target-dependencies.ts @@ -5,7 +5,7 @@ import { TargetDependencyConfig, Tree, updateNxJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { output } from '../../utilities/output'; export async function setTargetDependencies(host: Tree) { diff --git a/packages/workspace/src/migrations/update-13-0-0/config-locations/config-locations.ts b/packages/workspace/src/migrations/update-13-0-0/config-locations/config-locations.ts index 8a828117c0a399..113fca24a8b087 100644 --- a/packages/workspace/src/migrations/update-13-0-0/config-locations/config-locations.ts +++ b/packages/workspace/src/migrations/update-13-0-0/config-locations/config-locations.ts @@ -7,7 +7,7 @@ import { Tree, updateProjectConfiguration, writeJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; export default async function update(tree: Tree) { const nxJson = readJson(tree, 'nx.json') as NxJsonConfiguration & { diff --git a/packages/workspace/src/migrations/update-13-0-0/set-default-base-if-not-set.spec.ts b/packages/workspace/src/migrations/update-13-0-0/set-default-base-if-not-set.spec.ts index 16d39e310ceb16..ea8f60811d2af7 100644 --- a/packages/workspace/src/migrations/update-13-0-0/set-default-base-if-not-set.spec.ts +++ b/packages/workspace/src/migrations/update-13-0-0/set-default-base-if-not-set.spec.ts @@ -1,5 +1,5 @@ -import { readNxJson, Tree, writeJson } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { readNxJson, Tree, writeJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { setDefaultBaseIfNotSet } from './set-default-base-if-not-set'; describe('add `defaultBase` in nx.json', () => { diff --git a/packages/workspace/src/migrations/update-13-0-0/set-default-base-if-not-set.ts b/packages/workspace/src/migrations/update-13-0-0/set-default-base-if-not-set.ts index c0e9a7ef4f54cb..77d4e1fbc24ecc 100644 --- a/packages/workspace/src/migrations/update-13-0-0/set-default-base-if-not-set.ts +++ b/packages/workspace/src/migrations/update-13-0-0/set-default-base-if-not-set.ts @@ -1,4 +1,4 @@ -import { formatFiles, readNxJson, Tree, updateNxJson } from '@nrwl/devkit'; +import { formatFiles, readNxJson, Tree, updateNxJson } from '@nx/devkit'; import { output } from '../../utilities/output'; export async function setDefaultBaseIfNotSet(host: Tree) { diff --git a/packages/workspace/src/migrations/update-13-10-0/update-decorate-cli.ts b/packages/workspace/src/migrations/update-13-10-0/update-decorate-cli.ts index 9334b9a9916732..e9ece2e06038ae 100644 --- a/packages/workspace/src/migrations/update-13-10-0/update-decorate-cli.ts +++ b/packages/workspace/src/migrations/update-13-10-0/update-decorate-cli.ts @@ -1,4 +1,4 @@ -import { Tree } from '@nrwl/devkit'; +import { Tree } from '@nx/devkit'; export function updateDecorateAngularCLI(host: Tree) { const decorate = host.read('decorate-angular-cli.js')?.toString(); diff --git a/packages/workspace/src/migrations/update-13-10-0/update-tasks-runner.ts b/packages/workspace/src/migrations/update-13-10-0/update-tasks-runner.ts index ef7aa520b18a6f..8df9fdf31ff121 100644 --- a/packages/workspace/src/migrations/update-13-10-0/update-tasks-runner.ts +++ b/packages/workspace/src/migrations/update-13-10-0/update-tasks-runner.ts @@ -1,4 +1,4 @@ -import { readNxJson, Tree, updateNxJson } from '@nrwl/devkit'; +import { readNxJson, Tree, updateNxJson } from '@nx/devkit'; export function updateTasksRunner(host: Tree) { const config = readNxJson(host); diff --git a/packages/workspace/src/migrations/update-13-2-0/set-parallel-default.ts b/packages/workspace/src/migrations/update-13-2-0/set-parallel-default.ts index b3413807b807a0..3550fa30cd48b1 100644 --- a/packages/workspace/src/migrations/update-13-2-0/set-parallel-default.ts +++ b/packages/workspace/src/migrations/update-13-2-0/set-parallel-default.ts @@ -1,4 +1,4 @@ -import { formatFiles, readNxJson, Tree, updateNxJson } from '@nrwl/devkit'; +import { formatFiles, readNxJson, Tree, updateNxJson } from '@nx/devkit'; export async function setParallelDefault(host: Tree) { const config = readNxJson(host); diff --git a/packages/workspace/src/migrations/update-13-3-0/update-tsc-executor-location.spec.ts b/packages/workspace/src/migrations/update-13-3-0/update-tsc-executor-location.spec.ts index e8d5ed2e571995..820c6043c4aa0a 100644 --- a/packages/workspace/src/migrations/update-13-3-0/update-tsc-executor-location.spec.ts +++ b/packages/workspace/src/migrations/update-13-3-0/update-tsc-executor-location.spec.ts @@ -3,8 +3,8 @@ import { addProjectConfiguration, getProjects, readJson, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { updateTscExecutorLocation } from './update-tsc-executor-location'; describe('add `defaultBase` in nx.json', () => { diff --git a/packages/workspace/src/migrations/update-13-3-0/update-tsc-executor-location.ts b/packages/workspace/src/migrations/update-13-3-0/update-tsc-executor-location.ts index 2850c235418b92..36473a695e82e4 100644 --- a/packages/workspace/src/migrations/update-13-3-0/update-tsc-executor-location.ts +++ b/packages/workspace/src/migrations/update-13-3-0/update-tsc-executor-location.ts @@ -6,7 +6,7 @@ import { installPackagesTask, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import { nxVersion } from '../../utils/versions'; export async function updateTscExecutorLocation( diff --git a/packages/workspace/src/migrations/update-13-6-0/remove-old-task-runner-options.spec.ts b/packages/workspace/src/migrations/update-13-6-0/remove-old-task-runner-options.spec.ts index cb0b9a25dddf22..2134cb0a188001 100644 --- a/packages/workspace/src/migrations/update-13-6-0/remove-old-task-runner-options.spec.ts +++ b/packages/workspace/src/migrations/update-13-6-0/remove-old-task-runner-options.spec.ts @@ -1,6 +1,6 @@ -import { NxJsonConfiguration, readJson, Tree, writeJson } from '@nrwl/devkit'; -import { createTree } from '@nrwl/devkit/testing'; -import removeOldTaskRunnerOptions from '@nrwl/workspace/src/migrations/update-13-6-0/remove-old-task-runner-options'; +import { NxJsonConfiguration, readJson, Tree, writeJson } from '@nx/devkit'; +import { createTree } from '@nx/devkit/testing'; +import removeOldTaskRunnerOptions from '@nx/workspace/src/migrations/update-13-6-0/remove-old-task-runner-options'; describe('removeOldTaskRunnerOptions', () => { let tree: Tree; diff --git a/packages/workspace/src/migrations/update-13-6-0/remove-old-task-runner-options.ts b/packages/workspace/src/migrations/update-13-6-0/remove-old-task-runner-options.ts index 9bf65664d53849..301cbbccaf5bfb 100644 --- a/packages/workspace/src/migrations/update-13-6-0/remove-old-task-runner-options.ts +++ b/packages/workspace/src/migrations/update-13-6-0/remove-old-task-runner-options.ts @@ -1,4 +1,4 @@ -import { readNxJson, Tree, updateNxJson } from '@nrwl/devkit'; +import { readNxJson, Tree, updateNxJson } from '@nx/devkit'; export function removeOldTaskRunnerOptions(host: Tree) { const nxJson = readNxJson(host); diff --git a/packages/workspace/src/migrations/update-13-9-0/replace-tao-with-nx.ts b/packages/workspace/src/migrations/update-13-9-0/replace-tao-with-nx.ts index addea9c1bc5a5e..f23e265a018cfa 100644 --- a/packages/workspace/src/migrations/update-13-9-0/replace-tao-with-nx.ts +++ b/packages/workspace/src/migrations/update-13-9-0/replace-tao-with-nx.ts @@ -1,9 +1,4 @@ -import { - getPackageManagerCommand, - logger, - Tree, - updateJson, -} from '@nrwl/devkit'; +import { getPackageManagerCommand, logger, Tree, updateJson } from '@nx/devkit'; export function replaceTaoWithNx(host: Tree) { updateJson(host, 'package.json', (json: any) => { diff --git a/packages/workspace/src/migrations/update-13-9-0/update-decorate-cli.ts b/packages/workspace/src/migrations/update-13-9-0/update-decorate-cli.ts index eae7efc8c2562e..0d2699667d1bb9 100644 --- a/packages/workspace/src/migrations/update-13-9-0/update-decorate-cli.ts +++ b/packages/workspace/src/migrations/update-13-9-0/update-decorate-cli.ts @@ -1,4 +1,4 @@ -import { Tree } from '@nrwl/devkit'; +import { Tree } from '@nx/devkit'; export function updateDecorateAngularCLI(host: Tree) { const decorate = host.read('decorate-angular-cli.js')?.toString(); diff --git a/packages/workspace/src/migrations/update-14-0-0/change-npm-script-executor.spec.ts b/packages/workspace/src/migrations/update-14-0-0/change-npm-script-executor.spec.ts index 8dfec069c6eb39..45b61263b51ca1 100644 --- a/packages/workspace/src/migrations/update-14-0-0/change-npm-script-executor.spec.ts +++ b/packages/workspace/src/migrations/update-14-0-0/change-npm-script-executor.spec.ts @@ -2,8 +2,8 @@ import { addProjectConfiguration, readProjectConfiguration, Tree, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import changeNpmScriptExecutor from './change-npm-script-executor'; describe('changeNxJsonPresets', () => { diff --git a/packages/workspace/src/migrations/update-14-0-0/change-npm-script-executor.ts b/packages/workspace/src/migrations/update-14-0-0/change-npm-script-executor.ts index 671aa483b249a0..744a0f5a7d8efc 100644 --- a/packages/workspace/src/migrations/update-14-0-0/change-npm-script-executor.ts +++ b/packages/workspace/src/migrations/update-14-0-0/change-npm-script-executor.ts @@ -3,9 +3,9 @@ import { readProjectConfiguration, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; -import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; +import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils'; export async function changeNpmScriptExecutor(tree: Tree) { forEachExecutorOptions( diff --git a/packages/workspace/src/migrations/update-14-0-0/change-nx-json-presets.ts b/packages/workspace/src/migrations/update-14-0-0/change-nx-json-presets.ts index fd87e78ad64e2b..461afc1e7beb49 100644 --- a/packages/workspace/src/migrations/update-14-0-0/change-nx-json-presets.ts +++ b/packages/workspace/src/migrations/update-14-0-0/change-nx-json-presets.ts @@ -1,4 +1,4 @@ -import { formatFiles, readNxJson, Tree, updateNxJson } from '@nrwl/devkit'; +import { formatFiles, readNxJson, Tree, updateNxJson } from '@nx/devkit'; export async function changeNxJsonPresets(tree: Tree) { const nxJson = readNxJson(tree); diff --git a/packages/workspace/src/migrations/update-14-2-0/enable-source-analysis.ts b/packages/workspace/src/migrations/update-14-2-0/enable-source-analysis.ts index 3a2187e31353c6..b356211c557ef2 100644 --- a/packages/workspace/src/migrations/update-14-2-0/enable-source-analysis.ts +++ b/packages/workspace/src/migrations/update-14-2-0/enable-source-analysis.ts @@ -1,9 +1,4 @@ -import { - formatFiles, - NxJsonConfiguration, - Tree, - updateJson, -} from '@nrwl/devkit'; +import { formatFiles, NxJsonConfiguration, Tree, updateJson } from '@nx/devkit'; export async function enableSourceAnalysis(tree: Tree) { updateJson(tree, 'nx.json', (config) => { diff --git a/packages/workspace/src/migrations/update-14-8-0/change-run-commands-executor.spec.ts b/packages/workspace/src/migrations/update-14-8-0/change-run-commands-executor.spec.ts index f231856c1ebc61..92d625b1230be0 100644 --- a/packages/workspace/src/migrations/update-14-8-0/change-run-commands-executor.spec.ts +++ b/packages/workspace/src/migrations/update-14-8-0/change-run-commands-executor.spec.ts @@ -2,8 +2,8 @@ import { addProjectConfiguration, readProjectConfiguration, Tree, -} from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import changeRunCommandsExecutor from './change-run-commands-executor'; describe('changeRunCommandsExecutor', () => { diff --git a/packages/workspace/src/migrations/update-14-8-0/change-run-commands-executor.ts b/packages/workspace/src/migrations/update-14-8-0/change-run-commands-executor.ts index 4333d44d70c4c3..f638f35cc1cb85 100644 --- a/packages/workspace/src/migrations/update-14-8-0/change-run-commands-executor.ts +++ b/packages/workspace/src/migrations/update-14-8-0/change-run-commands-executor.ts @@ -3,9 +3,9 @@ import { readProjectConfiguration, Tree, updateProjectConfiguration, -} from '@nrwl/devkit'; +} from '@nx/devkit'; -import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; +import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils'; export async function changeRunCommandsExecutor(tree: Tree) { forEachExecutorOptions( diff --git a/packages/workspace/src/migrations/update-15-7-0/split-configuration-into-project-json-files.ts b/packages/workspace/src/migrations/update-15-7-0/split-configuration-into-project-json-files.ts index a87fb9fd09d4da..4f88365512a174 100644 --- a/packages/workspace/src/migrations/update-15-7-0/split-configuration-into-project-json-files.ts +++ b/packages/workspace/src/migrations/update-15-7-0/split-configuration-into-project-json-files.ts @@ -1,5 +1,5 @@ -import { formatFiles, Tree } from '@nrwl/devkit'; -import convertToNxProject from '@nrwl/workspace/src/generators/convert-to-nx-project/convert-to-nx-project'; +import { formatFiles, Tree } from '@nx/devkit'; +import convertToNxProject from '../../generators/convert-to-nx-project/convert-to-nx-project'; export async function splitConfigurationIntoProjectJsonFiles(tree: Tree) { await convertToNxProject(tree, { all: true }); diff --git a/packages/workspace/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts b/packages/workspace/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts new file mode 100644 index 00000000000000..70f3b546b161c8 --- /dev/null +++ b/packages/workspace/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts @@ -0,0 +1,37 @@ +import { Tree, readJson, updateJson } from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import replacePackage from './update-16-0-0-add-nx-packages'; + +describe('update-16-0-0-add-nx-packages', () => { + let tree: Tree; + beforeEach(() => { + tree = createTreeWithEmptyWorkspace(); + + updateJson(tree, 'package.json', (json) => { + json.devDependencies['@nrwl/workspace'] = '16.0.0'; + return json; + }); + }); + + it('should remove the dependency on @nrwl/workspace', async () => { + await replacePackage(tree); + + expect( + readJson(tree, 'package.json').dependencies['@nrwl/workspace'] + ).not.toBeDefined(); + expect( + readJson(tree, 'package.json').devDependencies['@nrwl/workspace'] + ).not.toBeDefined(); + }); + + it('should add a dependency on @nx/workspace', async () => { + await replacePackage(tree); + + const packageJson = readJson(tree, 'package.json'); + const newDependencyVersion = + packageJson.devDependencies['@nx/workspace'] ?? + packageJson.dependencies['@nx/workspace']; + + expect(newDependencyVersion).toBeDefined(); + }); +}); diff --git a/packages/workspace/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts b/packages/workspace/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts new file mode 100644 index 00000000000000..b2b9c4844a2380 --- /dev/null +++ b/packages/workspace/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts @@ -0,0 +1,12 @@ +import { Tree, formatFiles } from '@nx/devkit'; +import { replaceNrwlPackageWithNxPackage } from '@nx/devkit/src/utils/replace-package'; + +export default async function replacePackage(tree: Tree): Promise { + await replaceNrwlPackageWithNxPackage( + tree, + '@nrwl/workspace', + '@nx/workspace' + ); + + await formatFiles(tree); +} diff --git a/packages/workspace/src/tasks-runner/tasks-runner.ts b/packages/workspace/src/tasks-runner/tasks-runner.ts index bb2a5effd8a2d5..7ca2f43b312963 100644 --- a/packages/workspace/src/tasks-runner/tasks-runner.ts +++ b/packages/workspace/src/tasks-runner/tasks-runner.ts @@ -1,2 +1,2 @@ export * from 'nx/src/tasks-runner/tasks-runner'; -export { Task } from '@nrwl/devkit'; +export { Task } from '@nx/devkit'; diff --git a/packages/workspace/src/utilities/buildable-libs-utils.spec.ts b/packages/workspace/src/utilities/buildable-libs-utils.spec.ts index 2c4d3ee8fa7586..5b128a2159e7c4 100644 --- a/packages/workspace/src/utilities/buildable-libs-utils.spec.ts +++ b/packages/workspace/src/utilities/buildable-libs-utils.spec.ts @@ -1,4 +1,4 @@ -import { DependencyType, ProjectGraph } from '@nrwl/devkit'; +import { DependencyType, ProjectGraph } from '@nx/devkit'; import { calculateProjectDependencies, DependentBuildableProjectNode, diff --git a/packages/workspace/src/utilities/buildable-libs-utils.ts b/packages/workspace/src/utilities/buildable-libs-utils.ts index e79cb6a6f98dd3..fd2228a19cdf80 100644 --- a/packages/workspace/src/utilities/buildable-libs-utils.ts +++ b/packages/workspace/src/utilities/buildable-libs-utils.ts @@ -1,13 +1,13 @@ import { dirname, join, relative } from 'path'; import { directoryExists, fileExists } from './fileutils'; -import type { ProjectGraph, ProjectGraphProjectNode } from '@nrwl/devkit'; +import type { ProjectGraph, ProjectGraphProjectNode } from '@nx/devkit'; import { getOutputsForTargetAndConfiguration, ProjectGraphExternalNode, readJsonFile, stripIndents, writeJsonFile, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import type * as ts from 'typescript'; import { unlinkSync } from 'fs'; import { output } from './output'; diff --git a/packages/workspace/src/utilities/run-tasks-in-serial.ts b/packages/workspace/src/utilities/run-tasks-in-serial.ts index 1ae6233c90f41d..6e9d3492636cfb 100644 --- a/packages/workspace/src/utilities/run-tasks-in-serial.ts +++ b/packages/workspace/src/utilities/run-tasks-in-serial.ts @@ -1,4 +1,4 @@ -import type { GeneratorCallback } from '@nrwl/devkit'; +import type { GeneratorCallback } from '@nx/devkit'; /** * Run tasks in serial diff --git a/packages/workspace/src/utilities/ts-config.ts b/packages/workspace/src/utilities/ts-config.ts index f30687b3006268..e7ebaa44b4b81a 100644 --- a/packages/workspace/src/utilities/ts-config.ts +++ b/packages/workspace/src/utilities/ts-config.ts @@ -1,4 +1,4 @@ -import { offsetFromRoot, Tree, workspaceRoot } from '@nrwl/devkit'; +import { offsetFromRoot, Tree, workspaceRoot } from '@nx/devkit'; import { existsSync } from 'fs'; import { dirname, join } from 'path'; import { ensureTypescript } from './typescript'; diff --git a/packages/workspace/src/utilities/typescript.ts b/packages/workspace/src/utilities/typescript.ts index 4f233a0c2ad8db..d4952d22860f0e 100644 --- a/packages/workspace/src/utilities/typescript.ts +++ b/packages/workspace/src/utilities/typescript.ts @@ -1,4 +1,4 @@ -import { ensurePackage, Tree, workspaceRoot } from '@nrwl/devkit'; +import { ensurePackage, Tree, workspaceRoot } from '@nx/devkit'; import { dirname } from 'path'; import type * as ts from 'typescript'; import { typescriptVersion } from '../utils/versions'; diff --git a/packages/workspace/src/utilities/typescript/compilation.ts b/packages/workspace/src/utilities/typescript/compilation.ts index f4f2db090a1cc1..2bdd92d0ba4dad 100644 --- a/packages/workspace/src/utilities/typescript/compilation.ts +++ b/packages/workspace/src/utilities/typescript/compilation.ts @@ -1,4 +1,4 @@ -import { joinPathFragments, logger } from '@nrwl/devkit'; +import { joinPathFragments, logger } from '@nx/devkit'; import { rmSync } from 'fs'; import type * as ts from 'typescript'; import type { CustomTransformers, Diagnostic, Program } from 'typescript'; diff --git a/packages/workspace/src/utilities/version-utils.ts b/packages/workspace/src/utilities/version-utils.ts index be50705b1eda35..690fa960a02199 100644 --- a/packages/workspace/src/utilities/version-utils.ts +++ b/packages/workspace/src/utilities/version-utils.ts @@ -1,5 +1,5 @@ -import { checkAndCleanWithSemver as _checkAndCleanWithSemver } from '@nrwl/devkit/src/utils/semver'; -import { logger } from '@nrwl/devkit'; +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. * 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). diff --git a/packages/workspace/src/utils/rules/format-files.ts b/packages/workspace/src/utils/rules/format-files.ts index 0e7bf2c7efa2ca..c5afdab2e7e327 100644 --- a/packages/workspace/src/utils/rules/format-files.ts +++ b/packages/workspace/src/utils/rules/format-files.ts @@ -9,7 +9,7 @@ import { import { from } from 'rxjs'; import { filter, map, mergeMap } from 'rxjs/operators'; import * as path from 'path'; -import { workspaceRoot } from '@nrwl/devkit'; +import { workspaceRoot } from '@nx/devkit'; /** * @deprecated This will be removed in v17. Prefer writing Nx Generators with @nrwl/devkit. This function can be replaced with 'formatFiles' from @nrwl/devkit. diff --git a/packages/workspace/src/utils/testing-utils.ts b/packages/workspace/src/utils/testing-utils.ts index 9103a265ab542c..f452588414e515 100644 --- a/packages/workspace/src/utils/testing-utils.ts +++ b/packages/workspace/src/utils/testing-utils.ts @@ -3,7 +3,7 @@ import { _test_addWorkspaceFile, WorkspaceFormat, } from '@angular-devkit/core/src/workspace/core'; -import type { NxJsonConfiguration } from '@nrwl/devkit'; +import type { NxJsonConfiguration } from '@nx/devkit'; import { Architect, BuilderContext, Target } from '@angular-devkit/architect'; import { TestingArchitectHost } from '@angular-devkit/architect/testing'; import { json, JsonObject } from '@angular-devkit/core'; diff --git a/scripts/build-angular.js b/scripts/build-angular.js deleted file mode 100644 index 02531d0be85296..00000000000000 --- a/scripts/build-angular.js +++ /dev/null @@ -1,8 +0,0 @@ -const childProcess = require('child_process'); -const fs = require('fs-extra'); - -childProcess.execSync(`npx ng-packagr -p packages/angular/ng-package.json`, { - stdio: [0, 1, 2], -}); -fs.copySync('packages/angular/dist/', 'build/packages/angular/'); -fs.removeSync('packages/angular/dist/'); diff --git a/scripts/depcheck/missing.ts b/scripts/depcheck/missing.ts index c904d9c7a7ab7a..9e3d262e03a1f6 100644 --- a/scripts/depcheck/missing.ts +++ b/scripts/depcheck/missing.ts @@ -7,15 +7,13 @@ const IGNORE_MATCHES_IN_PACKAGE = { 'nx', 'prettier', 'typescript', - 'rxjs', - '@nrwl/workspace', // These are installed as needed and should not be added to package.json - '@nrwl/cypress', - '@nrwl/jest', - '@nrwl/rollup', - '@nrwl/storybook', - '@nrwl/vite', - '@nrwl/webpack', + '@nx/cypress', + '@nx/jest', + '@nx/rollup', + '@nx/storybook', + '@nx/vite', + '@nx/webpack', ], angular: [ '@angular-devkit/architect', @@ -55,7 +53,7 @@ const IGNORE_MATCHES_IN_PACKAGE = { 'cypress', ], cli: ['nx'], - cypress: ['cypress', '@angular-devkit/schematics', '@nrwl/cypress', 'vite'], + cypress: ['cypress', '@angular-devkit/schematics', 'vite'], devkit: [ '@angular-devkit/architect', '@angular-devkit/schematics', @@ -69,7 +67,7 @@ const IGNORE_MATCHES_IN_PACKAGE = { 'identity-obj-proxy', '@angular-devkit/schematics', ], - js: ['@nrwl/linter'], + js: [], linter: [ 'eslint', '@angular-devkit/schematics', @@ -81,7 +79,6 @@ const IGNORE_MATCHES_IN_PACKAGE = { ], next: [ '@angular-devkit/architect', - '@nrwl/devkit', 'express', 'http-proxy-middleware', 'next', @@ -118,6 +115,7 @@ const IGNORE_MATCHES_IN_PACKAGE = { 'webpack', 'webpack-merge', ], + 'react-native': ['@nx/storybook'], rollup: ['@swc/core'], storybook: [ '@angular-devkit/architect', @@ -129,7 +127,11 @@ const IGNORE_MATCHES_IN_PACKAGE = { '@storybook/core-server', '@storybook/types', // lazy installed with ensurePackage - '@nrwl/web', + '@nx/web', + '@nx/jest', + '@nx/rollup', + '@nx/vite', + '@nx/webpack', 'rxjs', ], nx: [ @@ -138,24 +140,26 @@ const IGNORE_MATCHES_IN_PACKAGE = { '@angular-devkit/core', '@angular-devkit/architect', '@angular/cli', + '@nx/angular', '@nrwl/angular', '@nrwl/cli', + 'rxjs', '@nestjs/cli', // nx init nest makes use of nestjs cli (which should be available in NestJS CLI app) to parse the nest-cli.json file 'ts-node', // We *may* fall back on ts-node, but we want to encourage the use of @swc-node instead so we don't explicitly list ts-node as an optional dep - '@nrwl/nx-android-arm-eabi', // native optional deps - '@nrwl/nx-android-arm64', // native optional deps - '@nrwl/nx-darwin-arm64', // native optional deps - '@nrwl/nx-darwin-universal', // native optional deps - '@nrwl/nx-darwin-x64', // native optional deps - '@nrwl/nx-freebsd-x64', // native optional deps - '@nrwl/nx-linux-arm-gnueabihf', // native optional deps - '@nrwl/nx-linux-arm64-gnu', // native optional deps - '@nrwl/nx-linux-arm64-musl', // native optional deps - '@nrwl/nx-linux-x64-gnu', // native optional deps - '@nrwl/nx-linux-x64-musl', // native optional deps - '@nrwl/nx-win32-arm64-msvc', // native optional deps - '@nrwl/nx-win32-ia32-msvc', // native optional deps - '@nrwl/nx-win32-x64-msvc', // native optional deps + '@nx/nx-android-arm-eabi', // native optional deps + '@nx/nx-android-arm64', // native optional deps + '@nx/nx-darwin-arm64', // native optional deps + '@nx/nx-darwin-universal', // native optional deps + '@nx/nx-darwin-x64', // native optional deps + '@nx/nx-freebsd-x64', // native optional deps + '@nx/nx-linux-arm-gnueabihf', // native optional deps + '@nx/nx-linux-arm64-gnu', // native optional deps + '@nx/nx-linux-arm64-musl', // native optional deps + '@nx/nx-linux-x64-gnu', // native optional deps + '@nx/nx-linux-x64-musl', // native optional deps + '@nx/nx-win32-arm64-msvc', // native optional deps + '@nx/nx-win32-ia32-msvc', // native optional deps + '@nx/nx-win32-x64-msvc', // native optional deps 'memfs', // used in mock for handling .node files in tests ], web: [ @@ -163,21 +167,20 @@ const IGNORE_MATCHES_IN_PACKAGE = { '@swc/core', 'swc-loader', + '@nx/cypress', + '@nx/jest', + '@nx/rollup', + '@nx/vite', + '@nx/webpack', 'fibers', 'node-sass', ], webpack: ['@swc/core', 'style-loader', 'swc-loader'], workspace: [ - 'tslint', '@angular-devkit/architect', '@angular-devkit/core', '@angular-devkit/schematics', - 'webpack', - 'webpack-dev-server', - '@nrwl/cli', - '@nrwl/jest', - '@nrwl/linter', - 'tsconfig-paths', + '@phenomnomnominal/tsquery', ], nest: ['semver'], }; diff --git a/scripts/documentation/internal-link-checker.ts b/scripts/documentation/internal-link-checker.ts index f38ee2ba5ec139..e13935b997e38d 100644 --- a/scripts/documentation/internal-link-checker.ts +++ b/scripts/documentation/internal-link-checker.ts @@ -1,4 +1,4 @@ -import { workspaceRoot } from '@nrwl/devkit'; +import { workspaceRoot } from '@nx/devkit'; import { XMLParser } from 'fast-xml-parser'; import * as glob from 'glob'; import { readFileSync } from 'node:fs'; diff --git a/scripts/documentation/package-schemas/package-metadata.ts b/scripts/documentation/package-schemas/package-metadata.ts index 6c5308895c1a89..ad299e6a5bbdc3 100644 --- a/scripts/documentation/package-schemas/package-metadata.ts +++ b/scripts/documentation/package-schemas/package-metadata.ts @@ -129,7 +129,8 @@ export function getPackageMetadataList( return { githubRoot: 'https://github.com/nrwl/nx/blob/master', name: folderName, - packageName: packageJson.name, + // TODO(v16): Remove this replace + packageName: packageJson.name.replace('@nx/', '@nrwl/'), description: packageJson.description, root: relativeFolderPath, source: join(relativeFolderPath, '/src'), diff --git a/scripts/patched-jest-resolver.js b/scripts/patched-jest-resolver.js index 6a0c038f0f708a..5ab8b1c4dfb6a7 100644 --- a/scripts/patched-jest-resolver.js +++ b/scripts/patched-jest-resolver.js @@ -63,11 +63,10 @@ module.exports = function (path, options) { } // Try to use the defaultResolver try { - if (path.startsWith('@nrwl/') && !path.startsWith('@nrwl/nx-cloud')) - throw new Error('custom resolution'); + if (path.startsWith('@nx/')) throw new Error('custom resolution'); if (path.startsWith('nx/')) throw new Error('custom resolution'); - if (path.indexOf('@nrwl/workspace') > -1) { + if (path.indexOf('@nx/workspace') > -1) { throw new Error( 'Reference to local Nx package found. Use local version instead.' ); @@ -86,9 +85,9 @@ module.exports = function (path, options) { // TODO(v17): Remove this workaround // We have some weird d.ts + .js business going on for these 2 imports so this is a workaround - if (path === '@nrwl/devkit') { + if (path === '@nx/devkit') { return join(__dirname, '../', './packages/devkit/index.js'); - } else if (path === '@nrwl/devkit/testing') { + } else if (path === '@nx/devkit/testing') { return join(__dirname, '../', './packages/devkit/testing.js'); } return ts.resolveModuleName( diff --git a/tsconfig.base.json b/tsconfig.base.json index 4673491aff46c9..8c70e65a4618e9 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -17,31 +17,10 @@ "rootDir": ".", "allowJs": true, "paths": { - "@nrwl/angular": ["packages/angular"], - "@nrwl/angular/*": ["packages/angular/*"], - "@nrwl/cypress": ["packages/cypress"], - "@nrwl/cypress/*": ["packages/cypress/*"], - "@nrwl/detox": ["packages/detox"], - "@nrwl/devkit": ["packages/devkit"], - "@nrwl/devkit/*": ["packages/devkit/*"], "@nrwl/e2e/utils": ["e2e/utils"], - "@nrwl/esbuild": ["packages/esbuild"], - "@nrwl/eslint-plugin-nx": ["packages/eslint-plugin-nx/src"], - "@nrwl/expo": ["packages/expo"], - "@nrwl/express": ["packages/express"], "@nrwl/graph/ui-components": ["graph/ui-components/src/index.ts"], "@nrwl/graph/ui-graph": ["graph/ui-graph/src/index.ts"], "@nrwl/graph/ui-tooltips": ["graph/ui-tooltips/src/index.ts"], - "@nrwl/jest": ["packages/jest"], - "@nrwl/jest/*": ["packages/jest/*"], - "@nrwl/js": ["packages/js/src"], - "@nrwl/js/*": ["packages/js/*"], - "@nrwl/linter": ["packages/linter"], - "@nrwl/linter/*": ["packages/linter/*"], - "@nrwl/nest": ["packages/nest"], - "@nrwl/next": ["packages/next"], - "@nrwl/node": ["packages/node"], - "@nrwl/node/*": ["packages/node/*"], "@nrwl/nx-dev-feature-package-schema-viewer": [ "nx-dev/feature-package-schema-viewer/src/index.ts" ], @@ -85,26 +64,51 @@ "@nrwl/nx-dev/ui-references": ["nx-dev/ui-references/src/index.ts"], "@nrwl/nx-dev/ui-sponsor-card": ["nx-dev/ui-sponsor-card/src/index.ts"], "@nrwl/nx-dev/ui-theme": ["nx-dev/ui-theme/src/index.ts"], - "@nrwl/nx-plugin": ["packages/nx-plugin"], - "@nrwl/react": ["packages/react"], - "@nrwl/react-native": ["packages/react-native"], - "@nrwl/react/*": ["packages/react/*"], - "@nrwl/rollup": ["packages/rollup"], - "@nrwl/rollup/*": ["packages/rollup/*"], - "@nrwl/storybook": ["packages/storybook"], - "@nrwl/storybook/*": ["packages/storybook/*"], "@nrwl/tao": ["packages/tao"], "@nrwl/tao/*": ["packages/tao/*"], "@nrwl/typedoc-theme": ["/typedoc-theme/src/index.ts"], - "@nrwl/vite": ["packages/vite"], - "@nrwl/vite/*": ["packages/vite/*"], - "@nrwl/web": ["packages/web"], - "@nrwl/web/*": ["packages/web/*"], - "@nrwl/webpack": ["packages/webpack"], - "@nrwl/webpack/*": ["packages/webpack/*"], - "@nrwl/workspace": ["packages/workspace"], - "@nrwl/workspace/*": ["packages/workspace/*"], - "@nrwl/workspace/testing": ["packages/workspace/testing"], + "@nx/angular": ["packages/angular"], + "@nx/angular/*": ["packages/angular/*"], + "@nx/cypress": ["packages/cypress"], + "@nx/cypress/*": ["packages/cypress/*"], + "@nx/detox": ["packages/detox"], + "@nx/devkit": ["packages/devkit"], + "@nx/devkit/*": ["packages/devkit/*"], + "@nx/esbuild": ["packages/esbuild"], + "@nx/eslint-plugin-nx": ["packages/eslint-plugin-nx/src"], + "@nx/expo": ["packages/expo"], + "@nx/expo/*": ["packages/expo/*"], + "@nx/express": ["packages/express"], + "@nx/jest": ["packages/jest"], + "@nx/jest/*": ["packages/jest/*"], + "@nx/js": ["packages/js/src"], + "@nx/js/*": ["packages/js/*"], + "@nx/linter": ["packages/linter"], + "@nx/linter/*": ["packages/linter/*"], + "@nx/nest": ["packages/nest"], + "@nx/next": ["packages/next"], + "@nx/next/*": ["packages/next/*"], + "@nx/node": ["packages/node"], + "@nx/node/*": ["packages/node/*"], + "@nx/nx-plugin": ["packages/nx-plugin"], + "@nx/nx-plugin/*": ["packages/nx-plugin/*"], + "@nx/react": ["packages/react"], + "@nx/react/*": ["packages/react/*"], + "@nx/react-native": ["packages/react-native"], + "@nx/react-native/*": ["packages/react-native/*"], + "@nx/rollup": ["packages/rollup"], + "@nx/rollup/*": ["packages/rollup/*"], + "@nx/storybook": ["packages/storybook"], + "@nx/storybook/*": ["packages/storybook/*"], + "@nx/vite": ["packages/vite"], + "@nx/vite/*": ["packages/vite/*"], + "@nx/web": ["packages/web"], + "@nx/web/*": ["packages/web/*"], + "@nx/webpack": ["packages/webpack"], + "@nx/webpack/*": ["packages/webpack/*"], + "@nx/workspace": ["packages/workspace"], + "@nx/workspace/*": ["packages/workspace/*"], + "@nx/workspace/testing": ["packages/workspace/testing"], "create-nx-workspace": ["packages/create-nx-workspace/index.ts"], "create-nx-workspace/*": ["packages/create-nx-workspace/*"], "nx": ["packages/nx"], diff --git a/yarn.lock b/yarn.lock index ff00ac628ad7df..35bce112139039 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5294,6 +5294,33 @@ read-package-json-fast "^3.0.0" which "^3.0.0" +"@nrwl/angular@16.0.0-beta.0": + version "16.0.0-beta.0" + resolved "https://registry.yarnpkg.com/@nrwl/angular/-/angular-16.0.0-beta.0.tgz#91e396ecc2e5c280984ab307dd5db6a99b557001" + integrity sha512-wz5Ots/Zsp7LWWXw9Zg3c79QZBUikOa7pHwxzLhxrMVDXW5Gb8OH5P4LRDLJXvmMhFJDQWMdMNqURx3vcegXeg== + dependencies: + "@nrwl/cypress" "16.0.0-beta.0" + "@nrwl/devkit" "16.0.0-beta.0" + "@nrwl/jest" "16.0.0-beta.0" + "@nrwl/js" "16.0.0-beta.0" + "@nrwl/linter" "16.0.0-beta.0" + "@nrwl/webpack" "16.0.0-beta.0" + "@nrwl/workspace" "16.0.0-beta.0" + "@phenomnomnominal/tsquery" "~5.0.1" + chalk "^4.1.0" + chokidar "^3.5.1" + enquirer "^2.3.6" + http-server "^14.1.0" + ignore "^5.0.4" + magic-string "~0.26.2" + minimatch "3.0.5" + semver "7.3.4" + ts-node "10.9.1" + tsconfig-paths "^4.1.2" + tslib "^2.3.0" + webpack "^5.75.0" + webpack-merge "5.7.3" + "@nrwl/cli@15.0.3": version "15.0.3" resolved "https://registry.yarnpkg.com/@nrwl/cli/-/cli-15.0.3.tgz#31cd05f775930f23623c64bebcf45889865fc83b" @@ -26135,6 +26162,14 @@ webpack-log@^2.0.0: ansi-colors "^3.0.0" uuid "^3.3.2" +webpack-merge@5.7.3: + version "5.7.3" + resolved "https://registry.yarnpkg.com/webpack-merge/-/webpack-merge-5.7.3.tgz#2a0754e1877a25a8bbab3d2475ca70a052708213" + integrity sha512-6/JUQv0ELQ1igjGDzHkXbVDRxkfA57Zw7PfiupdLFJYrgFqY5ZP8xxbpp2lU3EPwYx89ht5Z/aDkD40hFCm5AA== + dependencies: + clone-deep "^4.0.1" + wildcard "^2.0.0" + webpack-merge@5.8.0, webpack-merge@^5.8.0: version "5.8.0" resolved "https://registry.yarnpkg.com/webpack-merge/-/webpack-merge-5.8.0.tgz#2b39dbf22af87776ad744c390223731d30a68f61"