From a0d18bb588fe5bde29f180636e764b5a0260bfa3 Mon Sep 17 00:00:00 2001 From: Jason Jean Date: Mon, 24 Apr 2023 18:48:44 -0400 Subject: [PATCH] chore(repo): replace references to @nrwl in e2e tests (#16441) --- e2e/angular-core/src/config.test.ts | 14 ++--- .../src/module-federation.test.ts | 22 +++---- e2e/angular-core/src/ng-add.test.ts | 18 +++--- e2e/angular-core/src/projects.test.ts | 22 +++---- .../src/cypress-component-tests.test.ts | 28 ++++----- e2e/angular-extensions/src/misc.test.ts | 16 ++--- e2e/angular-extensions/src/ngrx.test.ts | 26 ++++---- e2e/angular-extensions/src/tailwind.test.ts | 22 +++---- e2e/cypress/src/cypress.test.ts | 12 ++-- e2e/detox/src/detox.test.ts | 6 +- e2e/esbuild/src/esbuild.test.ts | 14 ++--- e2e/expo/src/expo.test.ts | 8 +-- e2e/jest/src/jest-root.test.ts | 12 ++-- e2e/jest/src/jest.test.ts | 14 ++--- e2e/js/src/js-bundling.test.ts | 6 +- e2e/js/src/js-inlining.test.ts | 18 +++--- e2e/js/src/js-swc.test.ts | 6 +- e2e/js/src/js-tsc.test.ts | 8 +-- e2e/js/src/js.test.ts | 14 ++--- .../src/lerna-smoke-tests.test.ts | 4 +- e2e/linter/src/linter.test.ts | 34 +++++----- e2e/next/src/next-component-tests.test.ts | 21 +++---- e2e/next/src/next-storybook.test.ts | 8 +-- e2e/next/src/next-styles.test.ts | 12 ++-- e2e/next/src/next.test.ts | 32 +++++----- e2e/node/src/node-esbuild.test.ts | 4 +- e2e/node/src/node-server.test.ts | 18 +++--- e2e/node/src/node-webpack.test.ts | 4 +- e2e/node/src/node.test.ts | 34 +++++----- e2e/nx-init/src/nx-init-monorepo.test.ts | 2 +- e2e/nx-init/src/nx-init-nest.test.ts | 2 +- e2e/nx-init/src/nx-init-npm-repo.test.ts | 2 +- e2e/nx-init/src/nx-init-react.test.ts | 2 +- e2e/nx-init/src/nx-project-graph.test.ts | 10 +-- e2e/nx-misc/src/extras.test.ts | 14 ++--- e2e/nx-misc/src/misc.test.ts | 22 +++---- e2e/nx-misc/src/nxw.test.ts | 16 ++--- e2e/nx-misc/src/watch.test.ts | 8 +-- e2e/nx-misc/src/workspace.test.ts | 56 ++++++++--------- e2e/nx-run/src/affected-graph.test.ts | 44 ++++++------- e2e/nx-run/src/cache.test.ts | 14 ++--- e2e/nx-run/src/invoke-runner.test.ts | 4 +- e2e/nx-run/src/run.test.ts | 46 +++++++------- e2e/plugin/src/nx-plugin.fixtures.ts | 2 +- e2e/plugin/src/nx-plugin.test.ts | 62 ++++++++----------- .../src/react-module-federation.test.ts | 18 +++--- e2e/react-core/src/react-package.test.ts | 16 ++--- e2e/react-core/src/react.test.ts | 38 ++++++------ .../src/cypress-component-tests.test.ts | 22 +++---- e2e/react-extensions/src/react-vite.test.ts | 18 +++--- e2e/react-native/src/react-native.test.ts | 14 ++--- e2e/rollup/src/rollup.test.ts | 14 ++--- .../src/storybook-angular.test.ts | 2 +- e2e/storybook/src/storybook-nested.test.ts | 2 +- e2e/storybook/src/storybook.test.ts | 2 +- e2e/utils/command-utils.ts | 6 +- e2e/utils/create-project-utils.ts | 39 ++++++------ e2e/utils/test-utils.ts | 14 ++--- e2e/vite/src/vite.test.ts | 28 ++++----- e2e/web/src/file-server.test.ts | 14 ++--- e2e/web/src/web-vite.test.ts | 8 +-- e2e/web/src/web-webpack.test.ts | 4 +- e2e/web/src/web.test.ts | 20 +++--- e2e/webpack/src/webpack.test.ts | 10 +-- .../src/create-nx-workspace-npm.test.ts | 62 +++++++++---------- .../src/create-nx-plugin.test.ts | 6 +- .../src/create-nx-workspace.test.ts | 2 +- nx-dev/nx-dev-e2e/src/e2e/recipes.cy.ts | 2 +- tsconfig.base.json | 2 +- 69 files changed, 552 insertions(+), 574 deletions(-) diff --git a/e2e/angular-core/src/config.test.ts b/e2e/angular-core/src/config.test.ts index 1a9076b3d2c4a..28f8a804e8cbe 100644 --- a/e2e/angular-core/src/config.test.ts +++ b/e2e/angular-core/src/config.test.ts @@ -6,14 +6,14 @@ import { runCLI, uniq, updateFile, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; describe('angular.json v1 config', () => { const app1 = uniq('app1'); beforeAll(() => { newProject(); - runCLI(`generate @nrwl/angular:app ${app1} --no-interactive`); + runCLI(`generate @nx/angular:app ${app1} --no-interactive`); // reset workspace to use v1 config updateFile(`angular.json`, angularV1Json(app1)); removeFile(`apps/${app1}/project.json`); @@ -31,7 +31,7 @@ describe('angular.json v1 config', () => { it('should generate new app with project.json and keep the existing in angular.json', async () => { // create new app const app2 = uniq('app2'); - runCLI(`generate @nrwl/angular:app ${app2} --no-interactive`); + runCLI(`generate @nx/angular:app ${app2} --no-interactive`); // should generate project.json for new projects checkFilesExist(`apps/${app2}/project.json`); @@ -116,7 +116,7 @@ const angularV1Json = (appName: string) => `{ } }, "lint": { - "builder": "@nrwl/linter:eslint", + "builder": "@nx/linter:eslint", "options": { "lintFilePatterns": [ "apps/${appName}/src/**/*.ts", @@ -125,7 +125,7 @@ const angularV1Json = (appName: string) => `{ } }, "test": { - "builder": "@nrwl/jest:jest", + "builder": "@nx/jest:jest", "outputs": ["coverage/apps/${appName}"], "options": { "jestConfig": "apps/${appName}/jest.config.ts", @@ -141,7 +141,7 @@ const angularV1Json = (appName: string) => `{ "projectType": "application", "architect": { "e2e": { - "builder": "@nrwl/cypress:cypress", + "builder": "@nx/cypress:cypress", "options": { "cypressConfig": "apps/${appName}-e2e/cypress.json", "devServerTarget": "${appName}:serve:development", @@ -154,7 +154,7 @@ const angularV1Json = (appName: string) => `{ } }, "lint": { - "builder": "@nrwl/linter:eslint", + "builder": "@nx/linter:eslint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["apps/${appName}-e2e/**/*.{js,ts}"] diff --git a/e2e/angular-core/src/module-federation.test.ts b/e2e/angular-core/src/module-federation.test.ts index 22ab2734dfb5d..1626c86073de2 100644 --- a/e2e/angular-core/src/module-federation.test.ts +++ b/e2e/angular-core/src/module-federation.test.ts @@ -8,7 +8,7 @@ import { runCommandUntil, uniq, updateFile, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; describe('Angular Module Federation', () => { let proj: string; @@ -33,12 +33,10 @@ describe('Angular Module Federation', () => { const remotePort = 4301; // generate host app - runCLI( - `generate @nrwl/angular:host ${hostApp} --style=css --no-interactive` - ); + runCLI(`generate @nx/angular:host ${hostApp} --style=css --no-interactive`); // generate remote app runCLI( - `generate @nrwl/angular:remote ${remoteApp1} --host=${hostApp} --port=${remotePort} --style=css --no-interactive` + `generate @nx/angular:remote ${remoteApp1} --host=${hostApp} --port=${remotePort} --style=css --no-interactive` ); // check default generated host is built successfully @@ -47,10 +45,10 @@ describe('Angular Module Federation', () => { // generate a shared lib with a seconary entry point runCLI( - `generate @nrwl/angular:library ${sharedLib} --buildable --no-interactive` + `generate @nx/angular:library ${sharedLib} --buildable --no-interactive` ); runCLI( - `generate @nrwl/angular:library-secondary-entry-point --library=${sharedLib} --name=${secondaryEntry} --no-interactive` + `generate @nx/angular:library-secondary-entry-point --library=${sharedLib} --name=${secondaryEntry} --no-interactive` ); // update host & remote files to use shared library updateFile( @@ -139,16 +137,16 @@ describe('Angular Module Federation', () => { // generate apps runCLI( - `generate @nrwl/angular:application ${app1} --routing --no-interactive` + `generate @nx/angular:application ${app1} --routing --no-interactive` ); - runCLI(`generate @nrwl/angular:application ${app2} --no-interactive`); + runCLI(`generate @nx/angular:application ${app2} --no-interactive`); // convert apps runCLI( - `generate @nrwl/angular:setup-mf ${app1} --mfType=host --port=${app1Port} --no-interactive` + `generate @nx/angular:setup-mf ${app1} --mfType=host --port=${app1Port} --no-interactive` ); runCLI( - `generate @nrwl/angular:setup-mf ${app2} --mfType=remote --host=${app1} --port=${app2Port} --no-interactive` + `generate @nx/angular:setup-mf ${app2} --mfType=remote --host=${app1} --port=${app2Port} --no-interactive` ); const process = await runCommandUntil( @@ -170,7 +168,7 @@ describe('Angular Module Federation', () => { // generate remote apps runCLI( - `generate @nrwl/angular:host ${host} --ssr --remotes=${remote1},${remote2} --no-interactive` + `generate @nx/angular:host ${host} --ssr --remotes=${remote1},${remote2} --no-interactive` ); // ports diff --git a/e2e/angular-core/src/ng-add.test.ts b/e2e/angular-core/src/ng-add.test.ts index ccf834958d921..753ad75ea1ab7 100644 --- a/e2e/angular-core/src/ng-add.test.ts +++ b/e2e/angular-core/src/ng-add.test.ts @@ -11,7 +11,7 @@ import { runNgNew, uniq, updateFile, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; import { PackageManager } from 'nx/src/utils/package-manager'; describe('convert Angular CLI workspace to an Nx workspace', () => { @@ -101,11 +101,11 @@ describe('convert Angular CLI workspace to an Nx workspace', () => { ]; updateFile('angular.json', JSON.stringify(angularJson, null, 2)); - // confirm that @nrwl dependencies do not exist yet + // confirm that @nx dependencies do not exist yet expect(packageJson.devDependencies['@nx/workspace']).not.toBeDefined(); // run ng add - runNgAdd('@nrwl/angular', '--npm-scope projscope --default-base main'); + runNgAdd('@nx/angular', '--npm-scope projscope --default-base main'); // check that prettier config exits and that files have been moved checkFilesExist( @@ -268,7 +268,7 @@ describe('convert Angular CLI workspace to an Nx workspace', () => { it('should handle a workspace with cypress v9', () => { addCypress9(); - runNgAdd('@nrwl/angular', '--npm-scope projscope --skip-install'); + runNgAdd('@nx/angular', '--npm-scope projscope --skip-install'); const e2eProject = `${project}-e2e`; //check e2e project files @@ -335,7 +335,7 @@ describe('convert Angular CLI workspace to an Nx workspace', () => { it('should handle a workspace with cypress v10', () => { addCypress10(); - runNgAdd('@nrwl/angular', '--npm-scope projscope --skip-install'); + runNgAdd('@nx/angular', '--npm-scope projscope --skip-install'); const e2eProject = `${project}-e2e`; //check e2e project files @@ -400,12 +400,12 @@ describe('convert Angular CLI workspace to an Nx workspace', () => { }); // TODO(leo): The current Verdaccio setup fails to resolve older versions - // of @nrwl/* packages, the @angular-eslint/builder package depends on an - // older version of @nrwl/devkit so we skip this test for now. + // of @nx/* packages, the @angular-eslint/builder package depends on an + // older version of @nx/devkit so we skip this test for now. it.skip('should handle a workspace with ESLint', () => { addEsLint(); - runNgAdd('@nrwl/angular', '--npm-scope projscope'); + runNgAdd('@nx/angular', '--npm-scope projscope'); checkFilesExist(`apps/${project}/.eslintrc.json`, `.eslintrc.json`); @@ -442,7 +442,7 @@ describe('convert Angular CLI workspace to an Nx workspace', () => { runCommand(`ng g @schematics/angular:application ${app1}`); runCommand(`ng g @schematics/angular:library ${lib1}`); - runNgAdd('@nrwl/angular', '--npm-scope projscope'); + runNgAdd('@nx/angular', '--npm-scope projscope'); // check angular.json does not exist checkFilesDoNotExist('angular.json'); diff --git a/e2e/angular-core/src/projects.test.ts b/e2e/angular-core/src/projects.test.ts index 6ea4aca22b4c1..9fdac6b92a10a 100644 --- a/e2e/angular-core/src/projects.test.ts +++ b/e2e/angular-core/src/projects.test.ts @@ -15,7 +15,7 @@ import { uniq, updateFile, updateProjectConfig, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; import { normalize } from 'path'; describe('Angular Projects', () => { @@ -27,9 +27,9 @@ describe('Angular Projects', () => { beforeAll(() => { proj = newProject(); - runCLI(`generate @nrwl/angular:app ${app1} --no-interactive`); + runCLI(`generate @nx/angular:app ${app1} --no-interactive`); runCLI( - `generate @nrwl/angular:lib ${lib1} --add-module-spec --no-interactive` + `generate @nx/angular:lib ${lib1} --add-module-spec --no-interactive` ); app1DefaultModule = readFile(`apps/${app1}/src/app/app.module.ts`); app1DefaultComponentTemplate = readFile( @@ -50,7 +50,7 @@ describe('Angular Projects', () => { it('should successfully generate apps and libs and work correctly', async () => { const standaloneApp = uniq('standalone-app'); runCLI( - `generate @nrwl/angular:app ${standaloneApp} --directory=myDir --standalone=true --no-interactive` + `generate @nx/angular:app ${standaloneApp} --directory=myDir --standalone=true --no-interactive` ); updateFile( @@ -162,10 +162,10 @@ describe('Angular Projects', () => { const buildableChildLib = uniq('buildlib2'); runCLI( - `generate @nrwl/angular:library ${buildableLib} --buildable=true --no-interactive` + `generate @nx/angular:library ${buildableLib} --buildable=true --no-interactive` ); runCLI( - `generate @nrwl/angular:library ${buildableChildLib} --buildable=true --no-interactive` + `generate @nx/angular:library ${buildableChildLib} --buildable=true --no-interactive` ); // update the app module to include a ref to the buildable lib @@ -211,7 +211,7 @@ describe('Angular Projects', () => { // update the angular.json updateProjectConfig(app1, (config) => { - config.targets.build.executor = '@nrwl/angular:webpack-browser'; + config.targets.build.executor = '@nx/angular:webpack-browser'; config.targets.build.options = { ...config.targets.build.options, buildLibsFromSource: false, @@ -241,17 +241,17 @@ describe('Angular Projects', () => { const entryPoint = uniq('entrypoint'); runCLI( - `generate @nrwl/angular:lib ${lib} --publishable --importPath=@${proj}/${lib} --no-interactive` + `generate @nx/angular:lib ${lib} --publishable --importPath=@${proj}/${lib} --no-interactive` ); runCLI( - `generate @nrwl/angular:secondary-entry-point --name=${entryPoint} --library=${lib} --no-interactive` + `generate @nx/angular:secondary-entry-point --name=${entryPoint} --library=${lib} --no-interactive` ); runCLI( - `generate @nrwl/angular:library ${childLib} --publishable=true --importPath=@${proj}/${childLib} --no-interactive` + `generate @nx/angular:library ${childLib} --publishable=true --importPath=@${proj}/${childLib} --no-interactive` ); runCLI( - `generate @nrwl/angular:secondary-entry-point --name=sub --library=${childLib} --no-interactive` + `generate @nx/angular:secondary-entry-point --name=sub --library=${childLib} --no-interactive` ); const moduleContent = ` diff --git a/e2e/angular-extensions/src/cypress-component-tests.test.ts b/e2e/angular-extensions/src/cypress-component-tests.test.ts index 71806fdae1a28..c5a19786bdef0 100644 --- a/e2e/angular-extensions/src/cypress-component-tests.test.ts +++ b/e2e/angular-extensions/src/cypress-component-tests.test.ts @@ -37,7 +37,7 @@ describe('Angular Cypress Component Tests', () => { it('should test app', () => { runCLI( - `generate @nrwl/angular:cypress-component-configuration --project=${appName} --generate-tests --no-interactive` + `generate @nx/angular:cypress-component-configuration --project=${appName} --generate-tests --no-interactive` ); if (runCypressTests()) { expect(runCLI(`component-test ${appName} --no-watch`)).toContain( @@ -48,7 +48,7 @@ describe('Angular Cypress Component Tests', () => { it('should successfully component test lib being used in app', () => { runCLI( - `generate @nrwl/angular:cypress-component-configuration --project=${usedInAppLibName} --generate-tests --no-interactive` + `generate @nx/angular:cypress-component-configuration --project=${usedInAppLibName} --generate-tests --no-interactive` ); if (runCypressTests()) { expect(runCLI(`component-test ${usedInAppLibName} --no-watch`)).toContain( @@ -61,14 +61,14 @@ describe('Angular Cypress Component Tests', () => { expect(() => { // should error since no edge in graph between lib and app runCLI( - `generate @nrwl/angular:cypress-component-configuration --project=${buildableLibName} --generate-tests --no-interactive` + `generate @nx/angular:cypress-component-configuration --project=${buildableLibName} --generate-tests --no-interactive` ); }).toThrow(); updateTestToAssertTailwindIsNotApplied(buildableLibName); runCLI( - `generate @nrwl/angular:cypress-component-configuration --project=${buildableLibName} --generate-tests --build-target=${appName}:build --no-interactive` + `generate @nx/angular:cypress-component-configuration --project=${buildableLibName} --generate-tests --build-target=${appName}:build --no-interactive` ); if (runCypressTests()) { expect(runCLI(`component-test ${buildableLibName} --no-watch`)).toContain( @@ -76,9 +76,7 @@ describe('Angular Cypress Component Tests', () => { ); } // add tailwind - runCLI( - `generate @nrwl/angular:setup-tailwind --project=${buildableLibName}` - ); + runCLI(`generate @nx/angular:setup-tailwind --project=${buildableLibName}`); updateFile( `libs/${buildableLibName}/src/lib/input/input.component.cy.ts`, (content) => { @@ -133,19 +131,19 @@ describe('Angular Cypress Component Tests', () => { }); function createApp(appName: string) { - runCLI(`generate @nrwl/angular:app ${appName} --no-interactive`); + runCLI(`generate @nx/angular:app ${appName} --no-interactive`); runCLI( - `generate @nrwl/angular:component fancy-component --project=${appName} --no-interactive` + `generate @nx/angular:component fancy-component --project=${appName} --no-interactive` ); } function createLib(projectName: string, appName: string, libName: string) { - runCLI(`generate @nrwl/angular:lib ${libName} --no-interactive`); + runCLI(`generate @nx/angular:lib ${libName} --no-interactive`); runCLI( - `generate @nrwl/angular:component btn --project=${libName} --inlineTemplate --inlineStyle --export --no-interactive` + `generate @nx/angular:component btn --project=${libName} --inlineTemplate --inlineStyle --export --no-interactive` ); runCLI( - `generate @nrwl/angular:component btn-standalone --project=${libName} --inlineTemplate --inlineStyle --export --standalone --no-interactive` + `generate @nx/angular:component btn-standalone --project=${libName} --inlineTemplate --inlineStyle --export --standalone --no-interactive` ); updateFile( `libs/${libName}/src/lib/btn/btn.component.ts`, @@ -183,14 +181,14 @@ export class BtnStandaloneComponent { function createBuildableLib(projectName: string, libName: string) { // create lib - runCLI(`generate @nrwl/angular:lib ${libName} --buildable --no-interactive`); + runCLI(`generate @nx/angular:lib ${libName} --buildable --no-interactive`); // create cmp for lib runCLI( - `generate @nrwl/angular:component input --project=${libName} --inlineTemplate --inlineStyle --export --no-interactive` + `generate @nx/angular:component input --project=${libName} --inlineTemplate --inlineStyle --export --no-interactive` ); // create standlone cmp for lib runCLI( - `generate @nrwl/angular:component input-standalone --project=${libName} --inlineTemplate --inlineStyle --export --standalone --no-interactive` + `generate @nx/angular:component input-standalone --project=${libName} --inlineTemplate --inlineStyle --export --standalone --no-interactive` ); // update cmp implmentation to use tailwind clasasserting in tests updateFile( diff --git a/e2e/angular-extensions/src/misc.test.ts b/e2e/angular-extensions/src/misc.test.ts index 4945063f74d5c..4232d0f61127e 100644 --- a/e2e/angular-extensions/src/misc.test.ts +++ b/e2e/angular-extensions/src/misc.test.ts @@ -6,7 +6,7 @@ import { runCLI, uniq, updateFile, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; import { classify } from '@nx/devkit/src/utils/string-utils'; describe('Move Angular Project', () => { @@ -20,7 +20,7 @@ describe('Move Angular Project', () => { app1 = uniq('app1'); app2 = uniq('app2'); newPath = `subfolder/${app2}`; - runCLI(`generate @nrwl/angular:app ${app1} --no-interactive`); + runCLI(`generate @nx/angular:app ${app1} --no-interactive`); }); afterAll(() => cleanupProject()); @@ -30,7 +30,7 @@ describe('Move Angular Project', () => { */ it('should work for apps', () => { const moveOutput = runCLI( - `generate @nrwl/angular:move --project ${app1} ${newPath}` + `generate @nx/angular:move --project ${app1} ${newPath}` ); // just check the output @@ -64,7 +64,7 @@ describe('Move Angular Project', () => { `apps/${app1}-e2e/cypress.config.ts`, ` import { defineConfig } from 'cypress'; - import { nxE2EPreset } from '@nrwl/cypress/plugins/cypress-preset'; + import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset'; export default defineConfig({ e2e: { @@ -76,7 +76,7 @@ describe('Move Angular Project', () => { ` ); const moveOutput = runCLI( - `generate @nrwl/angular:move --projectName=${app1}-e2e --destination=${newPath}-e2e` + `generate @nx/angular:move --projectName=${app1}-e2e --destination=${newPath}-e2e` ); // just check that the cypress.config.ts is updated correctly @@ -99,13 +99,13 @@ describe('Move Angular Project', () => { it('should work for libraries', () => { const lib1 = uniq('mylib'); const lib2 = uniq('mylib'); - runCLI(`generate @nrwl/angular:lib ${lib1} --no-interactive`); + runCLI(`generate @nx/angular:lib ${lib1} --no-interactive`); /** * Create a library which imports the module from the other lib */ - runCLI(`generate @nrwl/angular:lib ${lib2} --no-interactive`); + runCLI(`generate @nx/angular:lib ${lib2} --no-interactive`); updateFile( `libs/${lib2}/src/lib/${lib2}.module.ts`, @@ -115,7 +115,7 @@ describe('Move Angular Project', () => { ); const moveOutput = runCLI( - `generate @nrwl/angular:move --projectName=${lib1} --destination=shared/${lib1}` + `generate @nx/angular:move --projectName=${lib1} --destination=shared/${lib1}` ); const newPath = `libs/shared/${lib1}`; diff --git a/e2e/angular-extensions/src/ngrx.test.ts b/e2e/angular-extensions/src/ngrx.test.ts index 17813356579f5..7f090a5037960 100644 --- a/e2e/angular-extensions/src/ngrx.test.ts +++ b/e2e/angular-extensions/src/ngrx.test.ts @@ -7,7 +7,7 @@ import { runCLI, runCLIAsync, uniq, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; describe('Angular Package', () => { describe('ngrx', () => { @@ -20,11 +20,11 @@ describe('Angular Package', () => { it('should work', async () => { const myapp = uniq('myapp'); - runCLI(`generate @nrwl/angular:app ${myapp} --no-interactive`); + runCLI(`generate @nx/angular:app ${myapp} --no-interactive`); // Generate root ngrx state management runCLI( - `generate @nrwl/angular:ngrx users --parent=apps/${myapp}/src/app/app.module.ts --root --minimal=false` + `generate @nx/angular:ngrx users --parent=apps/${myapp}/src/app/app.module.ts --root --minimal=false` ); const packageJson = readJson('package.json'); expect(packageJson.dependencies['@ngrx/store']).toBeDefined(); @@ -34,9 +34,9 @@ describe('Angular Package', () => { const mylib = uniq('mylib'); // Generate feature library and ngrx state within that library - runCLI(`g @nrwl/angular:lib ${mylib} --prefix=fl`); + runCLI(`g @nx/angular:lib ${mylib} --prefix=fl`); runCLI( - `generate @nrwl/angular:ngrx flights --parent=libs/${mylib}/src/lib/${mylib}.module.ts --facade` + `generate @nx/angular:ngrx flights --parent=libs/${mylib}/src/lib/${mylib}.module.ts --facade` ); expect(runCLI(`build ${myapp}`)).toMatch(/main\.[a-z0-9]+\.js/); @@ -49,11 +49,11 @@ describe('Angular Package', () => { it('should work with creators', async () => { const myapp = uniq('myapp'); - runCLI(`generate @nrwl/angular:app ${myapp} --routing --no-interactive`); + runCLI(`generate @nx/angular:app ${myapp} --routing --no-interactive`); // Generate root ngrx state management runCLI( - `generate @nrwl/angular:ngrx users --parent=apps/${myapp}/src/app/app.module.ts --root` + `generate @nx/angular:ngrx users --parent=apps/${myapp}/src/app/app.module.ts --root` ); const packageJson = readJson('package.json'); expect(packageJson.dependencies['@ngrx/entity']).toBeDefined(); @@ -65,11 +65,11 @@ describe('Angular Package', () => { const mylib = uniq('mylib'); // Generate feature library and ngrx state within that library - runCLI(`g @nrwl/angular:lib ${mylib} --prefix=fl`); + runCLI(`g @nx/angular:lib ${mylib} --prefix=fl`); const flags = `--facade --barrels`; runCLI( - `generate @nrwl/angular:ngrx flights --parent=libs/${mylib}/src/lib/${mylib}.module.ts ${flags}` + `generate @nx/angular:ngrx flights --parent=libs/${mylib}/src/lib/${mylib}.module.ts ${flags}` ); expect(runCLI(`build ${myapp}`)).toMatch(/main\.[a-z0-9]+\.js/); @@ -82,11 +82,11 @@ describe('Angular Package', () => { it('should work with creators using --module', async () => { const myapp = uniq('myapp'); - runCLI(`generate @nrwl/angular:app ${myapp} --routing --no-interactive`); + runCLI(`generate @nx/angular:app ${myapp} --routing --no-interactive`); // Generate root ngrx state management runCLI( - `generate @nrwl/angular:ngrx users --parent=apps/${myapp}/src/app/app.module.ts --root` + `generate @nx/angular:ngrx users --parent=apps/${myapp}/src/app/app.module.ts --root` ); const packageJson = readJson('package.json'); expect(packageJson.dependencies['@ngrx/entity']).toBeDefined(); @@ -98,11 +98,11 @@ describe('Angular Package', () => { const mylib = uniq('mylib'); // Generate feature library and ngrx state within that library - runCLI(`g @nrwl/angular:lib ${mylib} --prefix=fl`); + runCLI(`g @nx/angular:lib ${mylib} --prefix=fl`); const flags = `--facade --barrels`; runCLI( - `generate @nrwl/angular:ngrx flights --module=libs/${mylib}/src/lib/${mylib}.module.ts ${flags}` + `generate @nx/angular:ngrx flights --module=libs/${mylib}/src/lib/${mylib}.module.ts ${flags}` ); expect(runCLI(`build ${myapp}`)).toMatch(/main\.[a-z0-9]+\.js/); diff --git a/e2e/angular-extensions/src/tailwind.test.ts b/e2e/angular-extensions/src/tailwind.test.ts index e9a4ee686f4b9..fe37942ed3884 100644 --- a/e2e/angular-extensions/src/tailwind.test.ts +++ b/e2e/angular-extensions/src/tailwind.test.ts @@ -8,7 +8,7 @@ import { uniq, updateFile, updateProjectConfig, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; // TODO(Colum or Leosvel): Investigate and fix these tests @@ -188,7 +188,7 @@ describe('Tailwind support', () => { it('should generate a buildable library with tailwind and build correctly', () => { runCLI( - `generate @nrwl/angular:lib ${buildLibWithTailwind.name} --buildable --add-tailwind --no-interactive` + `generate @nx/angular:lib ${buildLibWithTailwind.name} --buildable --add-tailwind --no-interactive` ); updateTailwindConfig( `libs/${buildLibWithTailwind.name}/tailwind.config.js`, @@ -210,10 +210,10 @@ describe('Tailwind support', () => { it('should set up tailwind in a previously generated buildable library and build correctly', () => { const buildLibSetupTailwind = uniq('build-lib-setup-tailwind'); runCLI( - `generate @nrwl/angular:lib ${buildLibSetupTailwind} --buildable --no-interactive` + `generate @nx/angular:lib ${buildLibSetupTailwind} --buildable --no-interactive` ); runCLI( - `generate @nrwl/angular:setup-tailwind ${buildLibSetupTailwind} --no-interactive` + `generate @nx/angular:setup-tailwind ${buildLibSetupTailwind} --no-interactive` ); updateTailwindConfig( `libs/${buildLibSetupTailwind}/tailwind.config.js`, @@ -229,7 +229,7 @@ describe('Tailwind support', () => { it('should correctly build a buildable library with a tailwind.config.js file in the project root or workspace root', () => { const buildLibNoProjectConfig = uniq('build-lib-no-project-config'); runCLI( - `generate @nrwl/angular:lib ${buildLibNoProjectConfig} --buildable --no-interactive` + `generate @nx/angular:lib ${buildLibNoProjectConfig} --buildable --no-interactive` ); createTailwindConfigFile( `libs/${buildLibNoProjectConfig}/tailwind.config.js`, @@ -254,7 +254,7 @@ describe('Tailwind support', () => { it('should generate a publishable library with tailwind and build correctly', () => { runCLI( - `generate @nrwl/angular:lib ${pubLibWithTailwind.name} --publishable --add-tailwind --importPath=@${project}/${pubLibWithTailwind.name} --no-interactive` + `generate @nx/angular:lib ${pubLibWithTailwind.name} --publishable --add-tailwind --importPath=@${project}/${pubLibWithTailwind.name} --no-interactive` ); updateTailwindConfig( `libs/${pubLibWithTailwind.name}/tailwind.config.js`, @@ -276,10 +276,10 @@ describe('Tailwind support', () => { it('should set up tailwind in a previously generated publishable library and build correctly', () => { const pubLibSetupTailwind = uniq('pub-lib-setup-tailwind'); runCLI( - `generate @nrwl/angular:lib ${pubLibSetupTailwind} --publishable --importPath=@${project}/${pubLibSetupTailwind} --no-interactive` + `generate @nx/angular:lib ${pubLibSetupTailwind} --publishable --importPath=@${project}/${pubLibSetupTailwind} --no-interactive` ); runCLI( - `generate @nrwl/angular:setup-tailwind ${pubLibSetupTailwind} --no-interactive` + `generate @nx/angular:setup-tailwind ${pubLibSetupTailwind} --no-interactive` ); updateTailwindConfig( `libs/${pubLibSetupTailwind}/tailwind.config.js`, @@ -295,7 +295,7 @@ describe('Tailwind support', () => { it('should correctly build a publishable library with a tailwind.config.js file in the project root or workspace root', () => { const pubLibNoProjectConfig = uniq('pub-lib-no-project-config'); runCLI( - `generate @nrwl/angular:lib ${pubLibNoProjectConfig} --publishable --importPath=@${project}/${pubLibNoProjectConfig} --no-interactive` + `generate @nx/angular:lib ${pubLibNoProjectConfig} --publishable --importPath=@${project}/${pubLibNoProjectConfig} --no-interactive` ); createTailwindConfigFile( `libs/${pubLibNoProjectConfig}/tailwind.config.js`, @@ -358,10 +358,10 @@ describe('Tailwind support', () => { it('should build correctly and only output the tailwind utilities used', async () => { const appWithTailwind = uniq('app-with-tailwind'); runCLI( - `generate @nrwl/angular:app ${appWithTailwind} --add-tailwind --no-interactive` + `generate @nx/angular:app ${appWithTailwind} --add-tailwind --no-interactive` ); updateProjectConfig(appWithTailwind, (config) => { - config.targets.build.executor = '@nrwl/angular:webpack-browser'; + config.targets.build.executor = '@nx/angular:webpack-browser'; config.targets.build.options = { ...config.targets.build.options, buildLibsFromSource: false, diff --git a/e2e/cypress/src/cypress.test.ts b/e2e/cypress/src/cypress.test.ts index 59a2fb8e79978..60b3a12948d2f 100644 --- a/e2e/cypress/src/cypress.test.ts +++ b/e2e/cypress/src/cypress.test.ts @@ -11,7 +11,7 @@ import { uniq, updateFile, updateJson, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; describe('Cypress E2E Test runner', () => { const myapp = uniq('myapp'); @@ -25,7 +25,7 @@ describe('Cypress E2E Test runner', () => { it('should generate an app with the Cypress as e2e test runner', () => { runCLI( - `generate @nrwl/react:app ${myapp} --e2eTestRunner=cypress --linter=eslint` + `generate @nx/react:app ${myapp} --e2eTestRunner=cypress --linter=eslint` ); // Making sure the package.json file contains the Cypress dependency @@ -97,7 +97,7 @@ describe('env vars', () => { `apps/${myapp}-e2e/cypress.config.ts`, ` import { defineConfig } from 'cypress'; -import { nxE2EPreset } from '@nrwl/cypress/plugins/cypress-preset'; +import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset'; export default defineConfig({ e2e: { @@ -146,7 +146,7 @@ describe('env vars', () => { it('should run e2e in parallel', () => { const ngAppName = uniq('ng-app'); runCLI( - `generate @nrwl/angular:app ${ngAppName} --e2eTestRunner=cypress --linter=eslint --no-interactive` + `generate @nx/angular:app ${ngAppName} --e2eTestRunner=cypress --linter=eslint --no-interactive` ); const results = runCLI( @@ -156,8 +156,8 @@ describe('env vars', () => { expect(results).toContain('Using port 4201'); expect(results).toContain('Successfully ran target e2e for 2 projects'); checkFilesDoNotExist( - `node_modules/@nrwl/cypress/src/executors/cypress/4200.txt`, - `node_modules/@nrwl/cypress/src/executors/cypress/4201.txt` + `node_modules/@nx/cypress/src/executors/cypress/4200.txt`, + `node_modules/@nx/cypress/src/executors/cypress/4201.txt` ); }); }); diff --git a/e2e/detox/src/detox.test.ts b/e2e/detox/src/detox.test.ts index c2f7b0a5b9d12..b96291ecccb5c 100644 --- a/e2e/detox/src/detox.test.ts +++ b/e2e/detox/src/detox.test.ts @@ -7,7 +7,7 @@ import { uniq, killPorts, cleanupProject, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; describe('Detox', () => { const appName = uniq('myapp'); @@ -20,7 +20,7 @@ describe('Detox', () => { it('should create files and run lint command for react-native apps', async () => { runCLI( - `generate @nrwl/react-native:app ${appName} --e2eTestRunner=detox --linter=eslint --install=false` + `generate @nx/react-native:app ${appName} --e2eTestRunner=detox --linter=eslint --install=false` ); checkFilesExist(`apps/${appName}-e2e/.detoxrc.json`); checkFilesExist(`apps/${appName}-e2e/tsconfig.json`); @@ -35,7 +35,7 @@ describe('Detox', () => { it('should create files and run lint command for expo apps', async () => { const expoAppName = uniq('myapp'); runCLI( - `generate @nrwl/expo:app ${expoAppName} --e2eTestRunner=detox --linter=eslint` + `generate @nx/expo:app ${expoAppName} --e2eTestRunner=detox --linter=eslint` ); checkFilesExist(`apps/${expoAppName}-e2e/.detoxrc.json`); checkFilesExist(`apps/${expoAppName}-e2e/tsconfig.json`); diff --git a/e2e/esbuild/src/esbuild.test.ts b/e2e/esbuild/src/esbuild.test.ts index c96f7ec8746d3..66e0f983b611f 100644 --- a/e2e/esbuild/src/esbuild.test.ts +++ b/e2e/esbuild/src/esbuild.test.ts @@ -14,7 +14,7 @@ import { updateFile, updateProjectConfig, waitUntil, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; describe('EsBuild Plugin', () => { let proj: string; @@ -25,7 +25,7 @@ describe('EsBuild Plugin', () => { it('should setup and build projects using build', async () => { const myPkg = uniq('my-pkg'); - runCLI(`generate @nrwl/js:lib ${myPkg} --bundler=esbuild`); + runCLI(`generate @nx/js:lib ${myPkg} --bundler=esbuild`); updateFile(`libs/${myPkg}/src/index.ts`, `console.log('Hello');\n`); updateProjectConfig(myPkg, (json) => { json.targets.build.options.assets = [`libs/${myPkg}/assets/*`]; @@ -114,8 +114,8 @@ describe('EsBuild Plugin', () => { packageInstall('lodash', undefined, '~4.14.0', 'prod'); const parentLib = uniq('parent-lib'); const childLib = uniq('child-lib'); - runCLI(`generate @nrwl/js:lib ${parentLib} --bundler=esbuild`); - runCLI(`generate @nrwl/js:lib ${childLib} --bundler=none`); + runCLI(`generate @nx/js:lib ${parentLib} --bundler=esbuild`); + runCLI(`generate @nx/js:lib ${childLib} --bundler=none`); updateFile( `libs/${parentLib}/src/index.ts`, ` @@ -162,7 +162,7 @@ describe('EsBuild Plugin', () => { it('should support non-bundle builds', () => { const myPkg = uniq('my-pkg'); - runCLI(`generate @nrwl/js:lib ${myPkg} --bundler=esbuild`); + runCLI(`generate @nx/js:lib ${myPkg} --bundler=esbuild`); updateFile(`libs/${myPkg}/src/lib/${myPkg}.ts`, `console.log('Hello');\n`); updateFile(`libs/${myPkg}/src/index.ts`, `import './lib/${myPkg}.js';\n`); @@ -180,7 +180,7 @@ describe('EsBuild Plugin', () => { it('should support additional entry points', () => { const myPkg = uniq('my-pkg'); - runCLI(`generate @nrwl/js:lib ${myPkg} --bundler=esbuild`); + runCLI(`generate @nx/js:lib ${myPkg} --bundler=esbuild`); updateFile(`libs/${myPkg}/src/index.ts`, `console.log('main');\n`); updateFile(`libs/${myPkg}/src/extra.ts`, `console.log('extra');\n`); updateProjectConfig(myPkg, (json) => { @@ -198,7 +198,7 @@ describe('EsBuild Plugin', () => { it('should support external esbuild.config.js file', async () => { const myPkg = uniq('my-pkg'); - runCLI(`generate @nrwl/js:lib ${myPkg} --bundler=esbuild`); + runCLI(`generate @nx/js:lib ${myPkg} --bundler=esbuild`); updateFile( `libs/${myPkg}/esbuild.config.js`, `console.log('custom config loaded');\nmodule.exports = {};\n` diff --git a/e2e/expo/src/expo.test.ts b/e2e/expo/src/expo.test.ts index d08dd78e4ed27..139fb29b112ff 100644 --- a/e2e/expo/src/expo.test.ts +++ b/e2e/expo/src/expo.test.ts @@ -12,7 +12,7 @@ import { runCommandUntil, uniq, updateFile, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; import { join } from 'path'; describe('expo', () => { @@ -22,9 +22,9 @@ describe('expo', () => { beforeAll(() => { proj = newProject(); - runCLI(`generate @nrwl/expo:application ${appName} --no-interactive`); + runCLI(`generate @nx/expo:application ${appName} --no-interactive`); runCLI( - `generate @nrwl/expo:library ${libName} --buildable --publishable --importPath=${proj}/${libName}` + `generate @nx/expo:library ${libName} --buildable --publishable --importPath=${proj}/${libName}` ); }); afterAll(() => cleanupProject()); @@ -33,7 +33,7 @@ describe('expo', () => { const componentName = uniq('component'); runCLI( - `generate @nrwl/expo:component ${componentName} --project=${libName} --export --no-interactive` + `generate @nx/expo:component ${componentName} --project=${libName} --export --no-interactive` ); updateFile(`apps/${appName}/src/app/App.tsx`, (content) => { diff --git a/e2e/jest/src/jest-root.test.ts b/e2e/jest/src/jest-root.test.ts index e7f965850e04a..e7bb8db7087de 100644 --- a/e2e/jest/src/jest-root.test.ts +++ b/e2e/jest/src/jest-root.test.ts @@ -1,4 +1,4 @@ -import { newProject, runCLI, runCLIAsync, uniq } from '@nrwl/e2e/utils'; +import { newProject, runCLI, runCLIAsync, uniq } from '@nx/e2e/utils'; describe('Jest root projects', () => { const myapp = uniq('myapp'); @@ -11,7 +11,7 @@ describe('Jest root projects', () => { it('should test root level app projects', async () => { runCLI( - `generate @nrwl/angular:app ${myapp} --rootProject=true --no-interactive` + `generate @nx/angular:app ${myapp} --rootProject=true --no-interactive` ); const rootProjectTestResults = await runCLIAsync(`test ${myapp}`); expect(rootProjectTestResults.combinedOutput).toContain( @@ -20,9 +20,9 @@ describe('Jest root projects', () => { }, 300_000); it('should add lib project and tests should still work', async () => { - runCLI(`generate @nrwl/angular:lib ${mylib} --no-interactive`); + runCLI(`generate @nx/angular:lib ${mylib} --no-interactive`); runCLI( - `generate @nrwl/angular:component ${mylib} --export --standalone --project=${mylib} --no-interactive` + `generate @nx/angular:component ${mylib} --export --standalone --project=${mylib} --no-interactive` ); const libProjectTestResults = await runCLIAsync(`test ${mylib}`); @@ -45,7 +45,7 @@ describe('Jest root projects', () => { }); it('should test root level app projects', async () => { - runCLI(`generate @nrwl/react:app ${myapp} --rootProject=true`); + runCLI(`generate @nx/react:app ${myapp} --rootProject=true`); const rootProjectTestResults = await runCLIAsync(`test ${myapp}`); @@ -55,7 +55,7 @@ describe('Jest root projects', () => { }, 300_000); it('should add lib project and tests should still work', async () => { - runCLI(`generate @nrwl/react:lib ${mylib} --unitTestRunner=jest`); + runCLI(`generate @nx/react:lib ${mylib} --unitTestRunner=jest`); const libProjectTestResults = await runCLIAsync(`test ${mylib}`); diff --git a/e2e/jest/src/jest.test.ts b/e2e/jest/src/jest.test.ts index eb8e3a317df45..fc1175c3d370d 100644 --- a/e2e/jest/src/jest.test.ts +++ b/e2e/jest/src/jest.test.ts @@ -7,7 +7,7 @@ import { updateFile, expectJestTestsToPass, cleanupProject, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; describe('Jest', () => { beforeAll(() => { @@ -17,15 +17,15 @@ describe('Jest', () => { afterAll(() => cleanupProject()); it('should be able test projects using jest', async () => { - await expectJestTestsToPass('@nrwl/js:lib'); + await expectJestTestsToPass('@nx/js:lib'); }, 500000); it('should merge with jest config globals', async () => { const testGlobal = `'My Test Global'`; const mylib = uniq('mylib'); const utilLib = uniq('util-lib'); - runCLI(`generate @nrwl/js:lib ${mylib} --unit-test-runner jest`); - runCLI(`generate @nrwl/js:lib ${utilLib} --importPath=@global-fun/globals`); + runCLI(`generate @nx/js:lib ${mylib} --unit-test-runner jest`); + runCLI(`generate @nx/js:lib ${utilLib} --importPath=@global-fun/globals`); updateFile( `libs/${utilLib}/src/index.ts`, stripIndents` @@ -95,7 +95,7 @@ describe('Jest', () => { it('should set the NODE_ENV to `test`', async () => { const mylib = uniq('mylib'); - runCLI(`generate @nrwl/js:lib ${mylib} --unit-test-runner jest`); + runCLI(`generate @nx/js:lib ${mylib} --unit-test-runner jest`); updateFile( `libs/${mylib}/src/lib/${mylib}.spec.ts`, @@ -113,7 +113,7 @@ describe('Jest', () => { it('should support multiple `coverageReporters` through CLI', async () => { const mylib = uniq('mylib'); - runCLI(`generate @nrwl/js:lib ${mylib} --unit-test-runner jest`); + runCLI(`generate @nx/js:lib ${mylib} --unit-test-runner jest`); updateFile( `libs/${mylib}/src/lib/${mylib}.spec.ts`, @@ -136,7 +136,7 @@ describe('Jest', () => { it('should be able to test node lib with babel-jest', async () => { const libName = uniq('babel-test-lib'); runCLI( - `generate @nrwl/node:lib ${libName} --buildable --importPath=@some-org/babel-test --publishable --babelJest` + `generate @nx/node:lib ${libName} --buildable --importPath=@some-org/babel-test --publishable --babelJest` ); const cliResults = await runCLIAsync(`test ${libName}`); diff --git a/e2e/js/src/js-bundling.test.ts b/e2e/js/src/js-bundling.test.ts index d0382b18561f1..d2ad326b6c202 100644 --- a/e2e/js/src/js-bundling.test.ts +++ b/e2e/js/src/js-bundling.test.ts @@ -4,7 +4,7 @@ import { newProject, runCLI, uniq, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; describe('bundling libs', () => { let scope: string; @@ -20,9 +20,9 @@ describe('bundling libs', () => { const viteLib = uniq('vitelib'); runCLI( - `generate @nrwl/js:lib ${esbuildLib} --bundler=esbuild --no-interactive` + `generate @nx/js:lib ${esbuildLib} --bundler=esbuild --no-interactive` ); - runCLI(`generate @nrwl/js:lib ${viteLib} --bundler=vite --no-interactive`); + runCLI(`generate @nx/js:lib ${viteLib} --bundler=vite --no-interactive`); runCLI(`build ${esbuildLib}`); runCLI(`build ${viteLib}`); diff --git a/e2e/js/src/js-inlining.test.ts b/e2e/js/src/js-inlining.test.ts index 0b59a5c795231..9a9cab5ddf435 100644 --- a/e2e/js/src/js-inlining.test.ts +++ b/e2e/js/src/js-inlining.test.ts @@ -6,7 +6,7 @@ import { runCLI, uniq, updateFile, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; import { execSync } from 'child_process'; describe('inlining', () => { @@ -23,22 +23,22 @@ describe('inlining', () => { async (bundler) => { const parent = uniq('parent'); runCLI( - `generate @nrwl/js:lib ${parent} --bundler=${bundler} --no-interactive` + `generate @nx/js:lib ${parent} --bundler=${bundler} --no-interactive` ); const buildable = uniq('buildable'); runCLI( - `generate @nrwl/js:lib ${buildable} --bundler=${bundler} --no-interactive` + `generate @nx/js:lib ${buildable} --bundler=${bundler} --no-interactive` ); const buildableTwo = uniq('buildabletwo'); runCLI( - `generate @nrwl/js:lib ${buildableTwo} --bundler=${bundler} --no-interactive` + `generate @nx/js:lib ${buildableTwo} --bundler=${bundler} --no-interactive` ); const nonBuildable = uniq('nonbuildable'); runCLI( - `generate @nrwl/js:lib ${nonBuildable} --bundler=none --no-interactive` + `generate @nx/js:lib ${nonBuildable} --bundler=none --no-interactive` ); updateFile(`libs/${parent}/src/lib/${parent}.ts`, () => { @@ -102,15 +102,13 @@ describe('inlining', () => { it('should inline nesting libraries', async () => { const parent = uniq('parent'); - runCLI(`generate @nrwl/js:lib ${parent} --no-interactive`); + runCLI(`generate @nx/js:lib ${parent} --no-interactive`); const child = uniq('child'); - runCLI(`generate @nrwl/js:lib ${child} --bundler=none --no-interactive`); + runCLI(`generate @nx/js:lib ${child} --bundler=none --no-interactive`); const grandChild = uniq('grandchild'); - runCLI( - `generate @nrwl/js:lib ${grandChild} --bundler=none --no-interactive` - ); + runCLI(`generate @nx/js:lib ${grandChild} --bundler=none --no-interactive`); updateFile(`libs/${parent}/src/lib/${parent}.ts`, () => { return ` diff --git a/e2e/js/src/js-swc.test.ts b/e2e/js/src/js-swc.test.ts index 6724570ee6be1..502abcf3ffaba 100644 --- a/e2e/js/src/js-swc.test.ts +++ b/e2e/js/src/js-swc.test.ts @@ -29,7 +29,7 @@ describe('js e2e', () => { it('should create libs with js executors (--bundler=swc)', async () => { const lib = uniq('lib'); - runCLI(`generate @nrwl/js:lib ${lib} --bundler=swc --no-interactive`); + runCLI(`generate @nx/js:lib ${lib} --bundler=swc --no-interactive`); const libPackageJson = readJson(`libs/${lib}/package.json`); expect(libPackageJson.scripts).toBeUndefined(); @@ -48,7 +48,7 @@ describe('js e2e', () => { checkFilesDoNotExist(`libs/${lib}/.babelrc`); const parentLib = uniq('parentlib'); - runCLI(`generate @nrwl/js:lib ${parentLib} --bundler=swc --no-interactive`); + runCLI(`generate @nx/js:lib ${parentLib} --bundler=swc --no-interactive`); const parentLibPackageJson = readJson(`libs/${parentLib}/package.json`); expect(parentLibPackageJson.scripts).toBeUndefined(); expect((await runCLIAsync(`test ${parentLib}`)).combinedOutput).toContain( @@ -120,7 +120,7 @@ describe('js e2e', () => { it('should handle swcrc path mappings', async () => { const lib = uniq('lib'); - runCLI(`generate @nrwl/js:lib ${lib} --bundler=swc --no-interactive`); + runCLI(`generate @nx/js:lib ${lib} --bundler=swc --no-interactive`); // add a dummy x.ts file for path mappings updateFile( diff --git a/e2e/js/src/js-tsc.test.ts b/e2e/js/src/js-tsc.test.ts index d77ae1bbe3267..0a2eb9440ab09 100644 --- a/e2e/js/src/js-tsc.test.ts +++ b/e2e/js/src/js-tsc.test.ts @@ -28,7 +28,7 @@ describe('js e2e', () => { it('should create libs with js executors (--compiler=tsc)', async () => { const lib = uniq('lib'); - runCLI(`generate @nrwl/js:lib ${lib} --bundler=tsc --no-interactive`); + runCLI(`generate @nx/js:lib ${lib} --bundler=tsc --no-interactive`); const libPackageJson = readJson(`libs/${lib}/package.json`); expect(libPackageJson.scripts).toBeUndefined(); @@ -88,7 +88,7 @@ describe('js e2e', () => { libBuildProcess.kill(); const parentLib = uniq('parentlib'); - runCLI(`generate @nrwl/js:lib ${parentLib} --bundler=tsc --no-interactive`); + runCLI(`generate @nx/js:lib ${parentLib} --bundler=tsc --no-interactive`); const parentLibPackageJson = readJson(`libs/${parentLib}/package.json`); expect(parentLibPackageJson.scripts).toBeUndefined(); expect((await runCLIAsync(`test ${parentLib}`)).combinedOutput).toContain( @@ -154,7 +154,7 @@ describe('js e2e', () => { it('should not create a `.babelrc` file when creating libs with js executors (--compiler=tsc)', () => { const lib = uniq('lib'); runCLI( - `generate @nrwl/js:lib ${lib} --compiler=tsc --includeBabelRc=false --no-interactive` + `generate @nx/js:lib ${lib} --compiler=tsc --includeBabelRc=false --no-interactive` ); checkFilesDoNotExist(`libs/${lib}/.babelrc`); @@ -169,7 +169,7 @@ describe('package.json updates', () => { it('should update package.json with detected dependencies', async () => { const pmc = getPackageManagerCommand(); const lib = uniq('lib'); - runCLI(`generate @nrwl/js:lib ${lib} --bundler=tsc --no-interactive`); + runCLI(`generate @nx/js:lib ${lib} --bundler=tsc --no-interactive`); // Add a dependency for this lib to check the built package.json runCommand(`${pmc.addProd} react`); diff --git a/e2e/js/src/js.test.ts b/e2e/js/src/js.test.ts index dd38f365f5bca..cb07d60ad710d 100644 --- a/e2e/js/src/js.test.ts +++ b/e2e/js/src/js.test.ts @@ -24,7 +24,7 @@ describe('js e2e', () => { it('should create libs with npm scripts', () => { const npmScriptsLib = uniq('npmscriptslib'); runCLI( - `generate @nrwl/js:lib ${npmScriptsLib} --config=npm-scripts --no-interactive` + `generate @nx/js:lib ${npmScriptsLib} --config=npm-scripts --no-interactive` ); const libPackageJson = readJson(`libs/${npmScriptsLib}/package.json`); expect(libPackageJson.scripts.test).toBeDefined(); @@ -39,10 +39,10 @@ describe('js e2e', () => { it('should allow wildcard ts path alias', async () => { const base = uniq('base'); - runCLI(`generate @nrwl/js:lib ${base} --bundler=tsc --no-interactive`); + runCLI(`generate @nx/js:lib ${base} --bundler=tsc --no-interactive`); const lib = uniq('lib'); - runCLI(`generate @nrwl/js:lib ${lib} --bundler=tsc --no-interactive`); + runCLI(`generate @nx/js:lib ${lib} --bundler=tsc --no-interactive`); updateFile(`libs/${base}/src/index.ts`, () => { return ` @@ -93,7 +93,7 @@ export function ${lib}Wildcard() { const libName = uniq('mylib'); const dirName = uniq('dir'); - runCLI(`generate @nrwl/js:lib ${libName} --directory ${dirName}`); + runCLI(`generate @nx/js:lib ${libName} --directory ${dirName}`); checkFilesExist( `libs/${dirName}/${libName}/src/index.ts`, @@ -117,8 +117,8 @@ export function ${lib}Wildcard() { const consumerLib = uniq('consumer'); const producerLib = uniq('producer'); - runCLI(`generate @nrwl/js:lib ${consumerLib} --bundler=none`); - runCLI(`generate @nrwl/js:lib ${producerLib} --bundler=none`); + runCLI(`generate @nx/js:lib ${consumerLib} --bundler=none`); + runCLI(`generate @nx/js:lib ${producerLib} --bundler=none`); updateFile( `libs/${producerLib}/src/lib/${producerLib}.ts`, @@ -151,7 +151,7 @@ export function ${lib}Wildcard() { it('should not be able to be built when it has no bundler', () => { const nonBuildable = uniq('buildable'); - runCLI(`generate @nrwl/js:lib ${nonBuildable} --bundler=none`); + runCLI(`generate @nx/js:lib ${nonBuildable} --bundler=none`); expect(() => runCLI(`build ${nonBuildable}`)).toThrow(); diff --git a/e2e/lerna-smoke-tests/src/lerna-smoke-tests.test.ts b/e2e/lerna-smoke-tests/src/lerna-smoke-tests.test.ts index ff5237b041447..db4d11cadf9ad 100644 --- a/e2e/lerna-smoke-tests/src/lerna-smoke-tests.test.ts +++ b/e2e/lerna-smoke-tests/src/lerna-smoke-tests.test.ts @@ -1,6 +1,6 @@ /** * These minimal smoke tests are here to ensure that we do not break assumptions on the lerna side - * when making updates to nx or @nrwl/devkit. + * when making updates to nx or @nx/devkit. */ import { @@ -9,7 +9,7 @@ import { runLernaCLI, tmpProjPath, updateJson, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; expect.addSnapshotSerializer({ serialize(str: string) { diff --git a/e2e/linter/src/linter.test.ts b/e2e/linter/src/linter.test.ts index 64d7b82225e2c..7c4476cbf2c01 100644 --- a/e2e/linter/src/linter.test.ts +++ b/e2e/linter/src/linter.test.ts @@ -9,7 +9,7 @@ import { runCLI, uniq, updateFile, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; import * as ts from 'typescript'; /** @@ -28,8 +28,8 @@ describe('Linter', () => { beforeAll(() => { projScope = newProject(); - runCLI(`generate @nrwl/react:app ${myapp} --tags=validtag`); - runCLI(`generate @nrwl/js:lib ${mylib}`); + runCLI(`generate @nx/react:app ${myapp} --tags=validtag`); + runCLI(`generate @nx/js:lib ${mylib}`); }); afterAll(() => cleanupProject()); @@ -148,7 +148,7 @@ describe('Linter', () => { // Generate a new rule (should also scaffold the required workspace project and tests) const newRuleName = 'e2e-test-rule-name'; - runCLI(`generate @nrwl/linter:workspace-rule ${newRuleName}`); + runCLI(`generate @nx/linter:workspace-rule ${newRuleName}`); // Ensure that the unit tests for the new rule are runnable const unitTestsOutput = runCLI(`test eslint-rules`); @@ -192,10 +192,10 @@ describe('Linter', () => { const invalidtaglib = uniq('invalidtaglib'); const validtaglib = uniq('validtaglib'); - runCLI(`generate @nrwl/react:app ${myapp2}`); - runCLI(`generate @nrwl/react:lib ${lazylib}`); - runCLI(`generate @nrwl/js:lib ${invalidtaglib} --tags=invalidtag`); - runCLI(`generate @nrwl/js:lib ${validtaglib} --tags=validtag`); + runCLI(`generate @nx/react:app ${myapp2}`); + runCLI(`generate @nx/react:lib ${lazylib}`); + runCLI(`generate @nx/js:lib ${invalidtaglib} --tags=invalidtag`); + runCLI(`generate @nx/js:lib ${validtaglib} --tags=validtag`); const eslint = readJson('.eslintrc.json'); eslint.overrides[0].rules[ @@ -253,9 +253,9 @@ describe('Linter', () => { const libC = uniq('tslib-c'); beforeAll(() => { - runCLI(`generate @nrwl/js:lib ${libA}`); - runCLI(`generate @nrwl/js:lib ${libB}`); - runCLI(`generate @nrwl/js:lib ${libC}`); + runCLI(`generate @nx/js:lib ${libA}`); + runCLI(`generate @nx/js:lib ${libB}`); + runCLI(`generate @nx/js:lib ${libC}`); /** * create tslib-a structure @@ -493,7 +493,7 @@ describe('Linter', () => { const myapp = uniq('myapp'); const mylib = uniq('mylib'); - runCLI(`generate @nrwl/react:app ${myapp} --rootProject=true`); + runCLI(`generate @nx/react:app ${myapp} --rootProject=true`); verifySuccessfulStandaloneSetup(myapp); let appEslint = readJson('.eslintrc.json'); @@ -504,7 +504,7 @@ describe('Linter', () => { expect(appEslint.overrides[1].extends).toBeDefined(); expect(e2eEslint.overrides[0].extends).toBeDefined(); - runCLI(`generate @nrwl/js:lib ${mylib} --unitTestRunner=jest`); + runCLI(`generate @nx/js:lib ${mylib} --unitTestRunner=jest`); verifySuccessfulMigratedSetup(myapp, mylib); appEslint = readJson(`.eslintrc.json`); @@ -521,7 +521,7 @@ describe('Linter', () => { const mylib = uniq('mylib'); runCLI( - `generate @nrwl/angular:app ${myapp} --rootProject=true --no-interactive` + `generate @nx/angular:app ${myapp} --rootProject=true --no-interactive` ); verifySuccessfulStandaloneSetup(myapp); @@ -533,7 +533,7 @@ describe('Linter', () => { expect(appEslint.overrides[1].extends).toBeDefined(); expect(e2eEslint.overrides[0].extends).toBeDefined(); - runCLI(`generate @nrwl/js:lib ${mylib} --no-interactive`); + runCLI(`generate @nx/js:lib ${mylib} --no-interactive`); verifySuccessfulMigratedSetup(myapp, mylib); appEslint = readJson(`.eslintrc.json`); @@ -552,7 +552,7 @@ describe('Linter', () => { const mylib = uniq('mylib'); runCLI( - `generate @nrwl/node:app ${myapp} --rootProject=true --no-interactive` + `generate @nx/node:app ${myapp} --rootProject=true --no-interactive` ); verifySuccessfulStandaloneSetup(myapp); @@ -564,7 +564,7 @@ describe('Linter', () => { expect(appEslint.overrides[1].extends).toBeDefined(); expect(e2eEslint.overrides[0].extends).toBeDefined(); - runCLI(`generate @nrwl/js:lib ${mylib} --no-interactive`); + runCLI(`generate @nx/js:lib ${mylib} --no-interactive`); verifySuccessfulMigratedSetup(myapp, mylib); appEslint = readJson(`.eslintrc.json`); diff --git a/e2e/next/src/next-component-tests.test.ts b/e2e/next/src/next-component-tests.test.ts index 98de2658362c2..a5ec4f0142ab2 100644 --- a/e2e/next/src/next-component-tests.test.ts +++ b/e2e/next/src/next-component-tests.test.ts @@ -2,11 +2,10 @@ import { createFile, newProject, runCLI, + runCypressTests, uniq, updateFile, - runCypressTests, - updateJson, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; describe('NextJs Component Testing', () => { beforeAll(() => { @@ -66,9 +65,9 @@ describe('NextJs Component Testing', () => { }); function createAppWithCt(appName: string) { - runCLI(`generate @nrwl/next:app ${appName} --no-interactive`); + runCLI(`generate @nx/next:app ${appName} --no-interactive`); runCLI( - `generate @nrwl/next:component button --project=${appName} --directory=components --flat --no-interactive` + `generate @nx/next:component button --project=${appName} --directory=components --flat --no-interactive` ); createFile( `apps/${appName}/public/data.json`, @@ -100,13 +99,13 @@ export default function Button(props: ButtonProps) { }); runCLI( - `generate @nrwl/next:cypress-component-configuration --project=${appName} --generate-tests --no-interactive` + `generate @nx/next:cypress-component-configuration --project=${appName} --generate-tests --no-interactive` ); } function addTailwindToApp(appName: string) { runCLI( - `generate @nrwl/react:setup-tailwind --project=${appName} --no-interactive` + `generate @nx/react:setup-tailwind --project=${appName} --no-interactive` ); updateFile(`apps/${appName}/cypress/support/component.ts`, (content) => { return `${content} @@ -134,11 +133,11 @@ describe(Button.name, () => { function createLibWithCt(libName: string, buildable: boolean) { runCLI( - `generate @nrwl/next:lib ${libName} --buildable=${buildable} --no-interactive` + `generate @nx/next:lib ${libName} --buildable=${buildable} --no-interactive` ); runCLI( - `generate @nrwl/next:component button --project=${libName} --flat --export --no-interactive` + `generate @nx/next:component button --project=${libName} --flat --export --no-interactive` ); updateFile(`libs/${libName}/src/lib/button.tsx`, (content) => { return `import { useEffect, useState } from 'react'; @@ -155,13 +154,13 @@ export default Button; }); runCLI( - `generate @nrwl/next:cypress-component-configuration --project=${libName} --generate-tests --no-interactive` + `generate @nx/next:cypress-component-configuration --project=${libName} --generate-tests --no-interactive` ); } function addTailwindToLib(libName: string) { createFile(`libs/${libName}/src/lib/styles.css`, ``); runCLI( - `generate @nrwl/react:setup-tailwind --project=${libName} --no-interactive` + `generate @nx/react:setup-tailwind --project=${libName} --no-interactive` ); updateFile(`libs/${libName}/src/lib/button.cy.tsx`, (content) => { return `import * as React from 'react'; diff --git a/e2e/next/src/next-storybook.test.ts b/e2e/next/src/next-storybook.test.ts index d8c2c88835f61..e5abbfae9dc75 100644 --- a/e2e/next/src/next-storybook.test.ts +++ b/e2e/next/src/next-storybook.test.ts @@ -7,7 +7,7 @@ import { runCommand, uniq, updateJson, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; describe('Next.js Applications', () => { let proj: string; @@ -24,14 +24,14 @@ describe('Next.js Applications', () => { it('should run a Next.js based Storybook setup', async () => { const appName = uniq('app'); - runCLI(`generate @nrwl/next:app ${appName} --no-interactive`); + runCLI(`generate @nx/next:app ${appName} --no-interactive`); runCLI( - `generate @nrwl/next:component Foo --project=${appName} --no-interactive` + `generate @nx/next:component Foo --project=${appName} --no-interactive` ); // Currently due to auto-installing peer deps in pnpm, the generator can fail while installing deps with unmet peet deps. runCLI( - `generate @nrwl/react:storybook-configuration ${appName} --generateStories --no-interactive`, + `generate @nx/react:storybook-configuration ${appName} --generateStories --no-interactive`, { silenceError: true, } diff --git a/e2e/next/src/next-styles.test.ts b/e2e/next/src/next-styles.test.ts index e445fcc2fc9bd..b8b02e7c5fd4c 100644 --- a/e2e/next/src/next-styles.test.ts +++ b/e2e/next/src/next-styles.test.ts @@ -1,4 +1,4 @@ -import { cleanupProject, newProject, runCLI, uniq } from '@nrwl/e2e/utils'; +import { cleanupProject, newProject, runCLI, uniq } from '@nx/e2e/utils'; import { checkApp } from './utils'; describe('Next.js apps', () => { @@ -22,7 +22,7 @@ describe('Next.js apps', () => { xit('should support different --style options', async () => { const lessApp = uniq('app'); - runCLI(`generate @nrwl/next:app ${lessApp} --no-interactive --style=less`); + runCLI(`generate @nx/next:app ${lessApp} --no-interactive --style=less`); await checkApp(lessApp, { checkUnitTest: false, @@ -33,9 +33,7 @@ describe('Next.js apps', () => { const stylusApp = uniq('app'); - runCLI( - `generate @nrwl/next:app ${stylusApp} --no-interactive --style=styl` - ); + runCLI(`generate @nx/next:app ${stylusApp} --no-interactive --style=styl`); await checkApp(stylusApp, { checkUnitTest: false, @@ -47,7 +45,7 @@ describe('Next.js apps', () => { const scApp = uniq('app'); runCLI( - `generate @nrwl/next:app ${scApp} --no-interactive --style=styled-components` + `generate @nx/next:app ${scApp} --no-interactive --style=styled-components` ); await checkApp(scApp, { @@ -60,7 +58,7 @@ describe('Next.js apps', () => { const emotionApp = uniq('app'); runCLI( - `generate @nrwl/next:app ${emotionApp} --no-interactive --style=@emotion/styled` + `generate @nx/next:app ${emotionApp} --no-interactive --style=@emotion/styled` ); await checkApp(emotionApp, { diff --git a/e2e/next/src/next.test.ts b/e2e/next/src/next.test.ts index bf340cf28f944..9c033a729b79c 100644 --- a/e2e/next/src/next.test.ts +++ b/e2e/next/src/next.test.ts @@ -18,7 +18,7 @@ import { uniq, updateFile, updateProjectConfig, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; import * as http from 'http'; import { checkApp } from './utils'; @@ -44,11 +44,11 @@ describe('Next.js Applications', () => { const jsLib = uniq('tslib'); const buildableLib = uniq('buildablelib'); - runCLI(`generate @nrwl/next:app ${appName} --no-interactive --style=css`); - runCLI(`generate @nrwl/next:lib ${nextLib} --no-interactive`); - runCLI(`generate @nrwl/js:lib ${jsLib} --no-interactive`); + runCLI(`generate @nx/next:app ${appName} --no-interactive --style=css`); + runCLI(`generate @nx/next:lib ${nextLib} --no-interactive`); + runCLI(`generate @nx/js:lib ${jsLib} --no-interactive`); runCLI( - `generate @nrwl/js:lib ${buildableLib} --no-interactive --bundler=vite` + `generate @nx/js:lib ${buildableLib} --no-interactive --bundler=vite` ); // Create file in public that should be copied to dist @@ -71,7 +71,7 @@ describe('Next.js Applications', () => { // create a css file in node_modules so that it can be imported in a lib // to test that it works as expected updateFile( - 'node_modules/@nrwl/next/test-styles.css', + 'node_modules/@nx/next/test-styles.css', 'h1 { background-color: red; }' ); @@ -184,7 +184,7 @@ describe('Next.js Applications', () => { cwd: distPath, }); runCLI( - `generate @nrwl/workspace:run-commands serve-prod --project ${appName} --cwd=dist/apps/${appName} --command="npx next start --port=${selfContainedPort}"` + `generate @nx/workspace:run-commands serve-prod --project ${appName} --cwd=dist/apps/${appName} --command="npx next start --port=${selfContainedPort}"` ); const selfContainedProcess = await runCommandUntil( `run ${appName}:serve-prod`, @@ -201,7 +201,7 @@ describe('Next.js Applications', () => { it('should build and install pruned lock file', () => { const appName = uniq('app'); - runCLI(`generate @nrwl/next:app ${appName} --no-interactive --style=css`); + runCLI(`generate @nx/next:app ${appName} --no-interactive --style=css`); const result = runCLI(`build ${appName} --generateLockfile=true`); expect(result).not.toMatch(/Graph is not consistent/); @@ -220,8 +220,8 @@ describe('Next.js Applications', () => { const port = 4200; - runCLI(`generate @nrwl/next:app ${appName}`); - runCLI(`generate @nrwl/js:lib ${jsLib} --no-interactive`); + runCLI(`generate @nx/next:app ${appName}`); + runCLI(`generate @nx/js:lib ${jsLib} --no-interactive`); const proxyConf = { '/external-api': { @@ -286,7 +286,7 @@ describe('Next.js Applications', () => { it('should support custom next.config.js and output it in dist', async () => { const appName = uniq('app'); - runCLI(`generate @nrwl/next:app ${appName} --no-interactive --style=css`); + runCLI(`generate @nx/next:app ${appName} --no-interactive --style=css`); updateFile( `apps/${appName}/next.config.js`, @@ -343,7 +343,7 @@ describe('Next.js Applications', () => { it('should support --js flag', async () => { const appName = uniq('app'); - runCLI(`generate @nrwl/next:app ${appName} --no-interactive --js`); + runCLI(`generate @nx/next:app ${appName} --no-interactive --js`); checkFilesExist(`apps/${appName}/pages/index.js`); @@ -358,7 +358,7 @@ describe('Next.js Applications', () => { const libName = uniq('lib'); runCLI( - `generate @nrwl/next:lib ${libName} --no-interactive --style=none --js` + `generate @nx/next:lib ${libName} --no-interactive --style=none --js` ); const mainPath = `apps/${appName}/pages/index.js`; @@ -395,7 +395,7 @@ describe('Next.js Applications', () => { it('should support --no-swc flag', async () => { const appName = uniq('app'); - runCLI(`generate @nrwl/next:app ${appName} --no-interactive --no-swc`); + runCLI(`generate @nx/next:app ${appName} --no-interactive --no-swc`); // Next.js enables SWC when custom .babelrc is not provided. checkFilesExist(`apps/${appName}/.babelrc`); @@ -413,7 +413,7 @@ describe('Next.js Applications', () => { const appName = uniq('app'); runCLI( - `generate @nrwl/next:app ${appName} --style=css --no-interactive --custom-server` + `generate @nx/next:app ${appName} --style=css --no-interactive --custom-server` ); checkFilesExist(`apps/${appName}/server/main.ts`); @@ -430,7 +430,7 @@ describe('Next.js Applications', () => { const appName = uniq('app'); runCLI( - `generate @nrwl/next:app ${appName} --style=css --appDir --no-interactive` + `generate @nx/next:app ${appName} --style=css --appDir --no-interactive` ); checkFilesExist(`apps/${appName}/app/api/hello/route.ts`); diff --git a/e2e/node/src/node-esbuild.test.ts b/e2e/node/src/node-esbuild.test.ts index 16d68a9fce20e..da62589510368 100644 --- a/e2e/node/src/node-esbuild.test.ts +++ b/e2e/node/src/node-esbuild.test.ts @@ -8,7 +8,7 @@ import { tmpProjPath, uniq, updateFile, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; import { execSync } from 'child_process'; describe('Node Applications + esbuild', () => { @@ -19,7 +19,7 @@ describe('Node Applications + esbuild', () => { it('should generate an app using esbuild', async () => { const app = uniq('nodeapp'); - runCLI(`generate @nrwl/node:app ${app} --bundler=esbuild --no-interactive`); + runCLI(`generate @nx/node:app ${app} --bundler=esbuild --no-interactive`); checkFilesDoNotExist(`apps/${app}/webpack.config.js`); diff --git a/e2e/node/src/node-server.test.ts b/e2e/node/src/node-server.test.ts index 08ba99e7f758d..94e02db3da0cc 100644 --- a/e2e/node/src/node-server.test.ts +++ b/e2e/node/src/node-server.test.ts @@ -10,7 +10,7 @@ import { runCommandUntil, uniq, updateFile, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; describe('Node Applications + webpack', () => { let proj: string; @@ -66,19 +66,17 @@ describe('Node Applications + webpack', () => { const koaApp = uniq('koaapp'); const nestApp = uniq('koaapp'); - runCLI(`generate @nrwl/node:lib ${testLib1}`); - runCLI(`generate @nrwl/node:lib ${testLib2} --importPath=@acme/test2`); + runCLI(`generate @nx/node:lib ${testLib1}`); + runCLI(`generate @nx/node:lib ${testLib2} --importPath=@acme/test2`); runCLI( - `generate @nrwl/node:app ${expressApp} --framework=express --no-interactive` + `generate @nx/node:app ${expressApp} --framework=express --no-interactive` ); runCLI( - `generate @nrwl/node:app ${fastifyApp} --framework=fastify --no-interactive` + `generate @nx/node:app ${fastifyApp} --framework=fastify --no-interactive` ); + runCLI(`generate @nx/node:app ${koaApp} --framework=koa --no-interactive`); runCLI( - `generate @nrwl/node:app ${koaApp} --framework=koa --no-interactive` - ); - runCLI( - `generate @nrwl/node:app ${nestApp} --framework=nest --bundler=webpack --no-interactive` + `generate @nx/node:app ${nestApp} --framework=nest --bundler=webpack --no-interactive` ); // Use esbuild by default @@ -122,7 +120,7 @@ describe('Node Applications + webpack', () => { const expressApp = uniq('expressapp'); runCLI( - `generate @nrwl/node:app ${expressApp} --framework=express --docker --no-interactive` + `generate @nx/node:app ${expressApp} --framework=express --docker --no-interactive` ); checkFilesExist(`apps/${expressApp}/Dockerfile`); diff --git a/e2e/node/src/node-webpack.test.ts b/e2e/node/src/node-webpack.test.ts index 5f1a0eec8b1f2..c1ecda50cad9f 100644 --- a/e2e/node/src/node-webpack.test.ts +++ b/e2e/node/src/node-webpack.test.ts @@ -8,7 +8,7 @@ import { tmpProjPath, uniq, updateFile, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; import { execSync } from 'child_process'; describe('Node Applications + webpack', () => { @@ -19,7 +19,7 @@ describe('Node Applications + webpack', () => { it('should generate an app using webpack', async () => { const app = uniq('nodeapp'); - runCLI(`generate @nrwl/node:app ${app} --bundler=webpack --no-interactive`); + runCLI(`generate @nx/node:app ${app} --bundler=webpack --no-interactive`); checkFilesExist(`apps/${app}/webpack.config.js`); diff --git a/e2e/node/src/node.test.ts b/e2e/node/src/node.test.ts index 35253133bf661..5204f83d2c3cf 100644 --- a/e2e/node/src/node.test.ts +++ b/e2e/node/src/node.test.ts @@ -22,7 +22,7 @@ import { uniq, updateFile, updateProjectConfig, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; import { exec, execSync } from 'child_process'; import * as http from 'http'; import { getLockFileName } from '@nx/js'; @@ -55,7 +55,7 @@ describe('Node Applications', () => { it('should be able to generate an empty application', async () => { const nodeapp = uniq('nodeapp'); - runCLI(`generate @nrwl/node:app ${nodeapp} --linter=eslint`); + runCLI(`generate @nx/node:app ${nodeapp} --linter=eslint`); const lintResults = runCLI(`lint ${nodeapp}`); expect(lintResults).toContain('All files pass linting.'); @@ -72,7 +72,7 @@ describe('Node Applications', () => { it('should be able to generate the correct outputFileName in options', async () => { const nodeapp = uniq('nodeapp'); - runCLI(`generate @nrwl/node:app ${nodeapp} --linter=eslint`); + runCLI(`generate @nx/node:app ${nodeapp} --linter=eslint`); updateProjectConfig(nodeapp, (config) => { config.targets.build.options.outputFileName = 'index.js'; @@ -87,7 +87,7 @@ describe('Node Applications', () => { const nodeapp = uniq('nodeapp'); runCLI( - `generate @nrwl/node:app ${nodeapp} --linter=eslint --bundler=webpack` + `generate @nx/node:app ${nodeapp} --linter=eslint --bundler=webpack` ); const lintResults = runCLI(`lint ${nodeapp}`); @@ -134,7 +134,7 @@ describe('Node Applications', () => { const port = 3456; process.env.PORT = `${port}`; - runCLI(`generate @nrwl/express:app ${nodeapp} --linter=eslint`); + runCLI(`generate @nx/express:app ${nodeapp} --linter=eslint`); const lintResults = runCLI(`lint ${nodeapp}`); expect(lintResults).toContain('All files pass linting.'); @@ -175,7 +175,7 @@ describe('Node Applications', () => { xit('should be able to generate a nest application', async () => { const nestapp = uniq('nestapp'); const port = 3335; - runCLI(`generate @nrwl/nest:app ${nestapp} --linter=eslint`); + runCLI(`generate @nx/nest:app ${nestapp} --linter=eslint`); const lintResults = runCLI(`lint ${nestapp}`); expect(lintResults).toContain('All files pass linting.'); @@ -241,7 +241,7 @@ describe('Build Node apps', () => { const scope = newProject(); const packageManager = detectPackageManager(tmpProjPath()); const nestapp = uniq('nestapp'); - runCLI(`generate @nrwl/nest:app ${nestapp} --linter=eslint`); + runCLI(`generate @nx/nest:app ${nestapp} --linter=eslint`); await runCLIAsync(`build ${nestapp} --generatePackageJson`); @@ -302,10 +302,10 @@ describe('Build Node apps', () => { }); const nodeapp = uniq('nodeapp'); - runCLI(`generate @nrwl/node:app ${nodeapp} --bundler=webpack`); + runCLI(`generate @nx/node:app ${nodeapp} --bundler=webpack`); const jslib = uniq('jslib'); - runCLI(`generate @nrwl/js:lib ${jslib} --bundler=tsc`); + runCLI(`generate @nx/js:lib ${jslib} --bundler=tsc`); updateFile( `apps/${nodeapp}/src/main.ts`, @@ -342,7 +342,7 @@ ${jslib}(); it('should remove previous output before building with the --deleteOutputPath option set', async () => { const appName = uniq('app'); - runCLI(`generate @nrwl/node:app ${appName} --no-interactive`); + runCLI(`generate @nx/node:app ${appName} --no-interactive`); // deleteOutputPath should default to true createFile(`dist/apps/${appName}/_should_remove.txt`); @@ -378,7 +378,7 @@ ${jslib}(); it('should have plugin output if specified in `tsPlugins`', async () => { newProject(); const nestapp = uniq('nestapp'); - runCLI(`generate @nrwl/nest:app ${nestapp} --linter=eslint`); + runCLI(`generate @nx/nest:app ${nestapp} --linter=eslint`); packageInstall('@nestjs/swagger', undefined, '^6.0.0'); @@ -435,7 +435,7 @@ describe('nest libraries', function () { it('should be able to generate a nest library', async () => { const nestlib = uniq('nestlib'); - runCLI(`generate @nrwl/nest:lib ${nestlib}`); + runCLI(`generate @nx/nest:lib ${nestlib}`); const lintResults = runCLI(`lint ${nestlib}`); expect(lintResults).toContain('All files pass linting.'); @@ -449,7 +449,7 @@ describe('nest libraries', function () { it('should be able to generate a nest library w/ service', async () => { const nestlib = uniq('nestlib'); - runCLI(`generate @nrwl/nest:lib ${nestlib} --service`); + runCLI(`generate @nx/nest:lib ${nestlib} --service`); const lintResults = runCLI(`lint ${nestlib}`); expect(lintResults).toContain('All files pass linting.'); @@ -463,7 +463,7 @@ describe('nest libraries', function () { it('should be able to generate a nest library w/ controller', async () => { const nestlib = uniq('nestlib'); - runCLI(`generate @nrwl/nest:lib ${nestlib} --controller`); + runCLI(`generate @nx/nest:lib ${nestlib} --controller`); const lintResults = runCLI(`lint ${nestlib}`); expect(lintResults).toContain('All files pass linting.'); @@ -477,7 +477,7 @@ describe('nest libraries', function () { it('should be able to generate a nest library w/ controller and service', async () => { const nestlib = uniq('nestlib'); - runCLI(`generate @nrwl/nest:lib ${nestlib} --controller --service`); + runCLI(`generate @nx/nest:lib ${nestlib} --controller --service`); const lintResults = runCLI(`lint ${nestlib}`); expect(lintResults).toContain('All files pass linting.'); @@ -491,7 +491,7 @@ describe('nest libraries', function () { it('should have plugin output if specified in `transformers`', async () => { newProject(); const nestlib = uniq('nestlib'); - runCLI(`generate @nrwl/nest:lib ${nestlib} --buildable`); + runCLI(`generate @nx/nest:lib ${nestlib} --buildable`); packageInstall('@nestjs/swagger', undefined, '~6.0.0'); @@ -537,6 +537,6 @@ exports.FooModel = FooModel; }, 300000); it('should run default jest tests', async () => { - await expectJestTestsToPass('@nrwl/node:lib'); + await expectJestTestsToPass('@nx/node:lib'); }, 100000); }); diff --git a/e2e/nx-init/src/nx-init-monorepo.test.ts b/e2e/nx-init/src/nx-init-monorepo.test.ts index 7287f1810cc61..5c4cf8dcc68db 100644 --- a/e2e/nx-init/src/nx-init-monorepo.test.ts +++ b/e2e/nx-init/src/nx-init-monorepo.test.ts @@ -6,7 +6,7 @@ import { runCLI, runCommand, updateFile, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; describe('nx init (Monorepo)', () => { const pmc = getPackageManagerCommand({ diff --git a/e2e/nx-init/src/nx-init-nest.test.ts b/e2e/nx-init/src/nx-init-nest.test.ts index 122e7402e48e3..747e49998bf24 100644 --- a/e2e/nx-init/src/nx-init-nest.test.ts +++ b/e2e/nx-init/src/nx-init-nest.test.ts @@ -4,7 +4,7 @@ import { getPackageManagerCommand, getPublishedVersion, runCLI, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; import { execSync } from 'child_process'; import { removeSync } from 'fs-extra'; diff --git a/e2e/nx-init/src/nx-init-npm-repo.test.ts b/e2e/nx-init/src/nx-init-npm-repo.test.ts index 4bf4e470abe6b..079e1c9d102cb 100644 --- a/e2e/nx-init/src/nx-init-npm-repo.test.ts +++ b/e2e/nx-init/src/nx-init-npm-repo.test.ts @@ -8,7 +8,7 @@ import { runCLI, runCommand, updateFile, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; describe('nx init (NPM repo)', () => { const pmc = getPackageManagerCommand({ diff --git a/e2e/nx-init/src/nx-init-react.test.ts b/e2e/nx-init/src/nx-init-react.test.ts index 603475f7448ea..ee27eadd48bc5 100644 --- a/e2e/nx-init/src/nx-init-react.test.ts +++ b/e2e/nx-init/src/nx-init-react.test.ts @@ -9,7 +9,7 @@ import { runCLI, runCommand, updateFile, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; import { copySync, renameSync } from 'fs-extra'; import { sync as globSync } from 'glob'; import { join } from 'path'; diff --git a/e2e/nx-init/src/nx-project-graph.test.ts b/e2e/nx-init/src/nx-project-graph.test.ts index 37cf4e6551bb3..c9f5a58cadc1a 100644 --- a/e2e/nx-init/src/nx-project-graph.test.ts +++ b/e2e/nx-init/src/nx-project-graph.test.ts @@ -5,7 +5,7 @@ import { runCLI, uniq, updateJson, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; describe('project graph creation', () => { beforeEach(() => newProject()); @@ -14,7 +14,7 @@ describe('project graph creation', () => { it('should correctly build the nxdeps.json containing files for the project', () => { const libName = uniq('mylib'); - runCLI(`generate @nrwl/js:lib ${libName}`); + runCLI(`generate @nx/js:lib ${libName}`); runCLI(`graph --file=graph.json`); const { graph: graphJson } = readJson('graph.json'); @@ -25,7 +25,7 @@ describe('project graph creation', () => { it("should correctly build the nxdeps.json containing files for the project when root is ''", () => { const libName = uniq('mylib'); - runCLI(`generate @nrwl/js:lib ${libName}`); + runCLI(`generate @nx/js:lib ${libName}`); updateJson(`libs/${libName}/project.json`, (json) => ({ ...json, root: '', @@ -41,8 +41,8 @@ describe('project graph creation', () => { const libName = uniq('mylib'); const secondLibName = uniq('mysecondlib'); - runCLI(`generate @nrwl/js:lib ${libName}`); - runCLI(`generate @nrwl/js:lib ${secondLibName}`); + runCLI(`generate @nx/js:lib ${libName}`); + runCLI(`generate @nx/js:lib ${secondLibName}`); updateJson(`libs/${libName}/project.json`, (json) => ({ ...json, root: '', diff --git a/e2e/nx-misc/src/extras.test.ts b/e2e/nx-misc/src/extras.test.ts index fb36680bcde9e..86859a38ad05b 100644 --- a/e2e/nx-misc/src/extras.test.ts +++ b/e2e/nx-misc/src/extras.test.ts @@ -8,7 +8,7 @@ import { uniq, updateFile, updateProjectConfig, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; describe('Extra Nx Misc Tests', () => { beforeAll(() => newProject()); @@ -17,7 +17,7 @@ describe('Extra Nx Misc Tests', () => { describe('Output Style', () => { it('should stream output', async () => { const myapp = 'abcdefghijklmon'; - runCLI(`generate @nrwl/web:app ${myapp}`); + runCLI(`generate @nx/web:app ${myapp}`); updateProjectConfig(myapp, (c) => { c.targets['inner'] = { command: 'echo inner', @@ -99,7 +99,7 @@ describe('Extra Nx Misc Tests', () => { describe('Run Commands', () => { const mylib = uniq('lib'); beforeAll(() => { - runCLI(`generate @nrwl/js:lib ${mylib}`); + runCLI(`generate @nx/js:lib ${mylib}`); }); it('should not override environment variables already set when setting a custom env file path', async () => { @@ -115,7 +115,7 @@ describe('Extra Nx Misc Tests', () => { const envFile = `apps/${mylib}/.custom.env`; runCLI( - `generate @nrwl/workspace:run-commands echoEnvVariables --command=echo --envFile=${envFile} --project=${mylib}` + `generate @nx/workspace:run-commands echoEnvVariables --command=echo --envFile=${envFile} --project=${mylib}` ); const command = @@ -229,10 +229,10 @@ describe('Extra Nx Misc Tests', () => { const folder = `dist/libs/${mylib}/some-folder`; - runCLI(`generate @nrwl/js:lib ${mylib}`); + runCLI(`generate @nx/js:lib ${mylib}`); runCLI( - `generate @nrwl/workspace:run-commands build --command=echo --outputs=${folder}/ --project=${mylib}` + `generate @nx/workspace:run-commands build --command=echo --outputs=${folder}/ --project=${mylib}` ); const commands = [ @@ -263,7 +263,7 @@ describe('Extra Nx Misc Tests', () => { describe('generate --quiet', () => { it('should not log tree operations or install tasks', () => { - const output = runCLI('generate @nrwl/react:app --quiet test-project', { + const output = runCLI('generate @nx/react:app --quiet test-project', { verbose: false, }); expect(output).not.toContain('CREATE'); diff --git a/e2e/nx-misc/src/misc.test.ts b/e2e/nx-misc/src/misc.test.ts index 5c3ac777b252d..37fe45d92c9ea 100644 --- a/e2e/nx-misc/src/misc.test.ts +++ b/e2e/nx-misc/src/misc.test.ts @@ -16,7 +16,7 @@ import { uniq, updateFile, updateJson, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; import { renameSync, writeFileSync } from 'fs'; import { ensureDirSync } from 'fs-extra'; import * as path from 'path'; @@ -36,8 +36,8 @@ describe('Nx Commands', () => { runCLI('show projects').replace(/.*nx show projects( --verbose)?\n/, '') ).toEqual(''); - runCLI(`generate @nrwl/web:app ${app1}`); - runCLI(`generate @nrwl/web:app ${app2}`); + runCLI(`generate @nx/web:app ${app1}`); + runCLI(`generate @nx/web:app ${app2}`); const s = runCLI('show projects').split('\n'); @@ -55,10 +55,10 @@ describe('Nx Commands', () => { expect(reportOutput).toEqual( expect.stringMatching( - new RegExp(`\@nrwl\/workspace.*:.*${getPublishedVersion()}`) + new RegExp(`\@nx\/workspace.*:.*${getPublishedVersion()}`) ) ); - expect(reportOutput).toContain('@nrwl/workspace'); + expect(reportOutput).toContain('@nx/workspace'); }, 120000); it(`should list plugins`, async () => { @@ -71,8 +71,8 @@ describe('Nx Commands', () => { // temporarily make it look like this isn't installed renameSync( - tmpProjPath('node_modules/@nrwl/angular'), - tmpProjPath('node_modules/@nrwl/angular_tmp') + tmpProjPath('node_modules/@nx/angular'), + tmpProjPath('node_modules/@nx/angular_tmp') ); listOutput = runCLI('list'); @@ -106,8 +106,8 @@ describe('Nx Commands', () => { // 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') + tmpProjPath('node_modules/@nx/angular_tmp'), + tmpProjPath('node_modules/@nx/angular') ); }, 120000); }); @@ -117,8 +117,8 @@ describe('Nx Commands', () => { const mylib = uniq('mylib'); beforeAll(() => { - runCLI(`generate @nrwl/web:app ${myapp}`); - runCLI(`generate @nrwl/js:lib ${mylib}`); + runCLI(`generate @nx/web:app ${myapp}`); + runCLI(`generate @nx/js:lib ${mylib}`); }); beforeEach(() => { diff --git a/e2e/nx-misc/src/nxw.test.ts b/e2e/nx-misc/src/nxw.test.ts index 29e017b899c9f..5a73e00d0481b 100644 --- a/e2e/nx-misc/src/nxw.test.ts +++ b/e2e/nx-misc/src/nxw.test.ts @@ -10,7 +10,7 @@ import { uniq, readJson, readFile, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; import { bold } from 'chalk'; describe('nx wrapper / .nx installation', () => { @@ -42,7 +42,7 @@ describe('nx wrapper / .nx installation', () => { updateJson('nx.json', (json) => { json.tasksRunnerOptions.default.options.cacheableOperations = ['echo']; json.installation.plugins = { - '@nrwl/js': getPublishedVersion(), + '@nx/js': getPublishedVersion(), }; return json; }); @@ -66,8 +66,8 @@ 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/js.*:.*${getPublishedVersion()}`)); - expect(output).not.toContain('@nrwl/express'); + expect(output).toMatch(new RegExp(`@nx/js.*:.*${getPublishedVersion()}`)); + expect(output).not.toContain('@nx/express'); }); it('should work with nx list', () => { @@ -85,16 +85,16 @@ describe('nx wrapper / .nx installation', () => { ); expect(installedPluginLines.some((x) => x.includes(`${bold('nx')}`))); - expect(installedPluginLines.some((x) => x.includes(`${bold('@nrwl/js')}`))); + expect(installedPluginLines.some((x) => x.includes(`${bold('@nx/js')}`))); - output = runNxWrapper('list @nrwl/js'); - expect(output).toContain('Capabilities in @nrwl/js'); + output = runNxWrapper('list @nx/js'); + expect(output).toContain('Capabilities in @nx/js'); }); it('should work with basic generators', () => { updateJson('nx.json', (j) => { j.installation.plugins ??= {}; - j.installation.plugins['@nrwl/workspace'] = getPublishedVersion(); + j.installation.plugins['@nx/workspace'] = getPublishedVersion(); return j; }); expect(() => runNxWrapper(`g npm-package ${uniq('pkg')}`)).not.toThrow(); diff --git a/e2e/nx-misc/src/watch.test.ts b/e2e/nx-misc/src/watch.test.ts index b67e687cebb17..314932b473c05 100644 --- a/e2e/nx-misc/src/watch.test.ts +++ b/e2e/nx-misc/src/watch.test.ts @@ -8,7 +8,7 @@ import { getStrippedEnvironmentVariables, updateJson, isVerboseE2ERun, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; import { spawn } from 'child_process'; describe('Nx Commands', () => { @@ -17,9 +17,9 @@ describe('Nx Commands', () => { let proj3 = uniq('proj3'); beforeAll(() => { newProject({ packageManager: 'npm' }); - runCLI(`generate @nrwl/js:lib ${proj1}`); - runCLI(`generate @nrwl/js:lib ${proj2}`); - runCLI(`generate @nrwl/js:lib ${proj3}`); + runCLI(`generate @nx/js:lib ${proj1}`); + runCLI(`generate @nx/js:lib ${proj2}`); + runCLI(`generate @nx/js:lib ${proj3}`); }); afterAll(() => cleanupProject()); diff --git a/e2e/nx-misc/src/workspace.test.ts b/e2e/nx-misc/src/workspace.test.ts index 57d4c68554f53..f27deea8efee6 100644 --- a/e2e/nx-misc/src/workspace.test.ts +++ b/e2e/nx-misc/src/workspace.test.ts @@ -16,7 +16,7 @@ import { getSelectedPackageManager, runCommand, runCreateWorkspace, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; let proj: string; @@ -27,11 +27,11 @@ describe('Workspace Tests', () => { afterAll(() => cleanupProject()); - describe('@nrwl/workspace:npm-package', () => { + describe('@nx/workspace:npm-package', () => { it('should create a minimal npm package', () => { const npmPackage = uniq('npm-package'); - runCLI(`generate @nrwl/workspace:npm-package ${npmPackage}`); + runCLI(`generate @nx/workspace:npm-package ${npmPackage}`); updateFile('package.json', (content) => { const json = JSON.parse(content); @@ -58,7 +58,7 @@ describe('Workspace Tests', () => { const lib1 = uniq('mylib'); const lib2 = uniq('mylib'); const lib3 = uniq('mylib'); - runCLI(`generate @nrwl/js:lib ${lib1}/data-access`); + runCLI(`generate @nx/js:lib ${lib1}/data-access`); updateFile( `libs/${lib1}/data-access/src/lib/${lib1}-data-access.ts`, @@ -74,7 +74,7 @@ describe('Workspace Tests', () => { * Create a library which imports a class from lib1 */ - runCLI(`generate @nrwl/js:lib ${lib2}/ui`); + runCLI(`generate @nx/js:lib ${lib2}/ui`); updateFile( `libs/${lib2}/ui/src/lib/${lib2}-ui.ts`, @@ -87,7 +87,7 @@ describe('Workspace Tests', () => { * Create a library which has an implicit dependency on lib1 */ - runCLI(`generate @nrwl/js:lib ${lib3}`); + runCLI(`generate @nx/js:lib ${lib3}`); updateProjectConfig(lib3, (config) => { config.implicitDependencies = [`${lib1}-data-access`]; return config; @@ -98,7 +98,7 @@ describe('Workspace Tests', () => { */ const moveOutput = runCLI( - `generate @nrwl/workspace:move --project ${lib1}-data-access shared/${lib1}/data-access` + `generate @nx/workspace:move --project ${lib1}-data-access shared/${lib1}/data-access` ); expect(moveOutput).toContain(`DELETE libs/${lib1}/data-access`); @@ -194,7 +194,7 @@ describe('Workspace Tests', () => { const lib2 = uniq('mylib'); const lib3 = uniq('mylib'); runCLI( - `generate @nrwl/js:lib ${lib1}/data-access --importPath=${importPath}` + `generate @nx/js:lib ${lib1}/data-access --importPath=${importPath}` ); updateFile( @@ -211,7 +211,7 @@ describe('Workspace Tests', () => { * Create a library which imports a class from lib1 */ - runCLI(`generate @nrwl/js:lib ${lib2}/ui`); + runCLI(`generate @nx/js:lib ${lib2}/ui`); updateFile( `libs/${lib2}/ui/src/lib/${lib2}-ui.ts`, @@ -224,7 +224,7 @@ describe('Workspace Tests', () => { * Create a library which has an implicit dependency on lib1 */ - runCLI(`generate @nrwl/js:lib ${lib3}`); + runCLI(`generate @nx/js:lib ${lib3}`); updateProjectConfig(lib3, (config) => { config.implicitDependencies = [`${lib1}-data-access`]; return config; @@ -235,7 +235,7 @@ describe('Workspace Tests', () => { */ const moveOutput = runCLI( - `generate @nrwl/workspace:move --project ${lib1}-data-access shared/${lib1}/data-access` + `generate @nx/workspace:move --project ${lib1}-data-access shared/${lib1}/data-access` ); expect(moveOutput).toContain(`DELETE libs/${lib1}/data-access`); @@ -327,7 +327,7 @@ describe('Workspace Tests', () => { nxJson.workspaceLayout = { libsDir: 'packages' }; updateFile('nx.json', JSON.stringify(nxJson)); - runCLI(`generate @nrwl/js:lib ${lib1}/data-access`); + runCLI(`generate @nx/js:lib ${lib1}/data-access`); updateFile( `packages/${lib1}/data-access/src/lib/${lib1}-data-access.ts`, @@ -343,7 +343,7 @@ describe('Workspace Tests', () => { * Create a library which imports a class from lib1 */ - runCLI(`generate @nrwl/js:lib ${lib2}/ui`); + runCLI(`generate @nx/js:lib ${lib2}/ui`); updateFile( `packages/${lib2}/ui/src/lib/${lib2}-ui.ts`, @@ -356,7 +356,7 @@ describe('Workspace Tests', () => { * Create a library which has an implicit dependency on lib1 */ - runCLI(`generate @nrwl/js:lib ${lib3}`); + runCLI(`generate @nx/js:lib ${lib3}`); updateProjectConfig(lib3, (config) => { config.implicitDependencies = [`${lib1}-data-access`]; return config; @@ -367,7 +367,7 @@ describe('Workspace Tests', () => { */ const moveOutput = runCLI( - `generate @nrwl/workspace:move --project ${lib1}-data-access shared/${lib1}/data-access` + `generate @nx/workspace:move --project ${lib1}-data-access shared/${lib1}/data-access` ); expect(moveOutput).toContain(`DELETE packages/${lib1}/data-access`); @@ -455,7 +455,7 @@ describe('Workspace Tests', () => { const lib1 = uniq('lib1'); const lib2 = uniq('lib2'); const lib3 = uniq('lib3'); - runCLI(`generate @nrwl/js:lib ${lib1}`); + runCLI(`generate @nx/js:lib ${lib1}`); updateFile( `libs/${lib1}/src/lib/${lib1}.ts`, @@ -471,7 +471,7 @@ describe('Workspace Tests', () => { * Create a library which imports a class from lib1 */ - runCLI(`generate @nrwl/js:lib ${lib2}/ui`); + runCLI(`generate @nx/js:lib ${lib2}/ui`); updateFile( `libs/${lib2}/ui/src/lib/${lib2}-ui.ts`, @@ -484,7 +484,7 @@ describe('Workspace Tests', () => { * Create a library which has an implicit dependency on lib1 */ - runCLI(`generate @nrwl/js:lib ${lib3}`); + runCLI(`generate @nx/js:lib ${lib3}`); updateProjectConfig(lib3, (config) => { config.implicitDependencies = [lib1]; return config; @@ -495,7 +495,7 @@ describe('Workspace Tests', () => { */ const moveOutput = runCLI( - `generate @nrwl/workspace:move --project ${lib1} ${lib1}/data-access` + `generate @nx/workspace:move --project ${lib1} ${lib1}/data-access` ); expect(moveOutput).toContain(`DELETE libs/${lib1}/project.json`); @@ -589,7 +589,7 @@ describe('Workspace Tests', () => { const lib1 = uniq('mylib'); const lib2 = uniq('mylib'); const lib3 = uniq('mylib'); - runCLI(`generate @nrwl/js:lib ${lib1}/data-access`); + runCLI(`generate @nx/js:lib ${lib1}/data-access`); let rootTsConfig = readJson('tsconfig.base.json'); expect( rootTsConfig.compilerOptions.paths[`@${proj}/${lib1}/data-access`] @@ -612,7 +612,7 @@ describe('Workspace Tests', () => { * Create a library which imports a class from lib1 */ - runCLI(`generate @nrwl/js:lib ${lib2}/ui`); + runCLI(`generate @nx/js:lib ${lib2}/ui`); updateFile( `libs/${lib2}/ui/src/lib/${lib2}-ui.ts`, @@ -625,7 +625,7 @@ describe('Workspace Tests', () => { * Create a library which has an implicit dependency on lib1 */ - runCLI(`generate @nrwl/js:lib ${lib3}`); + runCLI(`generate @nx/js:lib ${lib3}`); updateProjectConfig(lib3, (config) => { config.implicitDependencies = [`${lib1}-data-access`]; return config; @@ -636,7 +636,7 @@ describe('Workspace Tests', () => { */ const moveOutput = runCLI( - `generate @nrwl/workspace:move --project ${lib1}-data-access shared/${lib1}/data-access` + `generate @nx/workspace:move --project ${lib1}-data-access shared/${lib1}/data-access` ); expect(moveOutput).toContain(`DELETE libs/${lib1}/data-access`); @@ -703,14 +703,14 @@ describe('Workspace Tests', () => { const lib1 = uniq('myliba'); const lib2 = uniq('mylibb'); - runCLI(`generate @nrwl/js:lib ${lib1}`); + runCLI(`generate @nx/js:lib ${lib1}`); expect(exists(tmpProjPath(`libs/${lib1}`))).toBeTruthy(); /** * Create a library which has an implicit dependency on lib1 */ - runCLI(`generate @nrwl/js:lib ${lib2}`); + runCLI(`generate @nx/js:lib ${lib2}`); updateProjectConfig(lib2, (config) => { config.implicitDependencies = [lib1]; return config; @@ -722,9 +722,7 @@ describe('Workspace Tests', () => { let error; try { - console.log( - runCLI(`generate @nrwl/workspace:remove --project ${lib1}`) - ); + console.log(runCLI(`generate @nx/workspace:remove --project ${lib1}`)); } catch (e) { error = e; } @@ -740,7 +738,7 @@ describe('Workspace Tests', () => { */ const removeOutputForced = runCLI( - `generate @nrwl/workspace:remove --project ${lib1} --forceRemove` + `generate @nx/workspace:remove --project ${lib1} --forceRemove` ); expect(removeOutputForced).toContain(`DELETE libs/${lib1}`); diff --git a/e2e/nx-run/src/affected-graph.test.ts b/e2e/nx-run/src/affected-graph.test.ts index 923f44ef4d6bf..83d0b307ecac9 100644 --- a/e2e/nx-run/src/affected-graph.test.ts +++ b/e2e/nx-run/src/affected-graph.test.ts @@ -17,7 +17,7 @@ import { fileExists, removeFile, readResolvedConfiguration, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; describe('Nx Affected and Graph Tests', () => { let proj: string; @@ -33,12 +33,12 @@ describe('Nx Affected and Graph Tests', () => { const mylib = uniq('mylib'); const mylib2 = uniq('mylib2'); const mypublishablelib = uniq('mypublishablelib'); - runCLI(`generate @nrwl/web:app ${myapp}`); - runCLI(`generate @nrwl/web:app ${myapp2}`); - runCLI(`generate @nrwl/js:lib ${mylib}`); - runCLI(`generate @nrwl/js:lib ${mylib2}`); + runCLI(`generate @nx/web:app ${myapp}`); + runCLI(`generate @nx/web:app ${myapp2}`); + runCLI(`generate @nx/js:lib ${mylib}`); + runCLI(`generate @nx/js:lib ${mylib2}`); runCLI( - `generate @nrwl/js:lib ${mypublishablelib} --publishable --importPath=@${proj}/${mypublishablelib} --tags=ui` + `generate @nx/js:lib ${mypublishablelib} --publishable --importPath=@${proj}/${mypublishablelib} --tags=ui` ); updateFile( @@ -187,26 +187,26 @@ describe('Nx Affected and Graph Tests', () => { }); function generateAll() { - runCLI(`generate @nrwl/web:app ${myapp}`); - runCLI(`generate @nrwl/web:app ${myapp2}`); - runCLI(`generate @nrwl/js:lib ${mylib}`); + runCLI(`generate @nx/web:app ${myapp}`); + runCLI(`generate @nx/web:app ${myapp2}`); + runCLI(`generate @nx/js:lib ${mylib}`); runCommand(`git add . && git commit -am "add all"`); } it('should not affect other projects by generating a new project', () => { // TODO: investigate why affected gives different results on windows if (isNotWindows()) { - runCLI(`generate @nrwl/web:app ${myapp}`); + runCLI(`generate @nx/web:app ${myapp}`); expect(runCLI('print-affected --select projects')).toContain(myapp); runCommand(`git add . && git commit -am "add ${myapp}"`); - runCLI(`generate @nrwl/web:app ${myapp2}`); + runCLI(`generate @nx/web:app ${myapp2}`); let output = runCLI('print-affected --select projects'); expect(output).not.toContain(myapp); expect(output).toContain(myapp2); runCommand(`git add . && git commit -am "add ${myapp2}"`); - runCLI(`generate @nrwl/js:lib ${mylib}`); + runCLI(`generate @nx/js:lib ${mylib}`); output = runCLI('print-affected --select projects'); expect(output).not.toContain(myapp); expect(output).not.toContain(myapp2); @@ -294,11 +294,11 @@ describe('Nx Affected and Graph Tests', () => { const mylib2 = uniq('mylib2'); const mypublishablelib = uniq('mypublishablelib'); - runCLI(`generate @nrwl/web:app ${myapp}`); - runCLI(`generate @nrwl/web:app ${myapp2}`); - runCLI(`generate @nrwl/js:lib ${mylib}`); - runCLI(`generate @nrwl/js:lib ${mylib2}`); - runCLI(`generate @nrwl/js:lib ${mypublishablelib}`); + runCLI(`generate @nx/web:app ${myapp}`); + runCLI(`generate @nx/web:app ${myapp2}`); + runCLI(`generate @nx/js:lib ${mylib}`); + runCLI(`generate @nx/js:lib ${mylib2}`); + runCLI(`generate @nx/js:lib ${mypublishablelib}`); const app1ElementSpec = readFile( `apps/${myapp}/src/app/app.element.spec.ts` @@ -412,11 +412,11 @@ describe('Nx Affected and Graph Tests', () => { mylib = uniq('mylib'); mylib2 = uniq('mylib2'); - runCLI(`generate @nrwl/web:app ${myapp}`); - runCLI(`generate @nrwl/web:app ${myapp2}`); - runCLI(`generate @nrwl/web:app ${myapp3}`); - runCLI(`generate @nrwl/js:lib ${mylib}`); - runCLI(`generate @nrwl/js:lib ${mylib2}`); + runCLI(`generate @nx/web:app ${myapp}`); + runCLI(`generate @nx/web:app ${myapp2}`); + runCLI(`generate @nx/web:app ${myapp3}`); + runCLI(`generate @nx/js:lib ${mylib}`); + runCLI(`generate @nx/js:lib ${mylib2}`); runCommand(`git init`); runCommand(`git config user.email "test@test.com"`); diff --git a/e2e/nx-run/src/cache.test.ts b/e2e/nx-run/src/cache.test.ts index 7412df84cca62..ab6f420008994 100644 --- a/e2e/nx-run/src/cache.test.ts +++ b/e2e/nx-run/src/cache.test.ts @@ -9,7 +9,7 @@ import { updateFile, updateJson, updateProjectConfig, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; describe('cache', () => { beforeEach(() => newProject()); @@ -19,8 +19,8 @@ describe('cache', () => { it('should cache command execution', async () => { const myapp1 = uniq('myapp1'); const myapp2 = uniq('myapp2'); - runCLI(`generate @nrwl/web:app ${myapp1}`); - runCLI(`generate @nrwl/web:app ${myapp2}`); + runCLI(`generate @nx/web:app ${myapp1}`); + runCLI(`generate @nx/web:app ${myapp2}`); const files = `--files="apps/${myapp1}/src/main.ts,apps/${myapp2}/src/main.ts"`; // run build with caching @@ -144,7 +144,7 @@ describe('cache', () => { it('should support using globs as outputs', async () => { const mylib = uniq('mylib'); - runCLI(`generate @nrwl/js:library ${mylib}`); + runCLI(`generate @nx/js:library ${mylib}`); updateProjectConfig(mylib, (c) => { c.targets.build = { executor: 'nx:run-commands', @@ -216,9 +216,9 @@ describe('cache', () => { const parent = uniq('parent'); const child1 = uniq('child1'); const child2 = uniq('child2'); - runCLI(`generate @nrwl/js:lib ${parent}`); - runCLI(`generate @nrwl/js:lib ${child1}`); - runCLI(`generate @nrwl/js:lib ${child2}`); + runCLI(`generate @nx/js:lib ${parent}`); + runCLI(`generate @nx/js:lib ${child1}`); + runCLI(`generate @nx/js:lib ${child2}`); updateJson(`nx.json`, (c) => { c.namedInputs = { default: ['{projectRoot}/**/*'], diff --git a/e2e/nx-run/src/invoke-runner.test.ts b/e2e/nx-run/src/invoke-runner.test.ts index eb27ab6331aae..5e13e381355c4 100644 --- a/e2e/nx-run/src/invoke-runner.test.ts +++ b/e2e/nx-run/src/invoke-runner.test.ts @@ -6,7 +6,7 @@ import { uniq, updateFile, updateProjectConfig, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; describe('Invoke Runner', () => { let proj: string; @@ -15,7 +15,7 @@ describe('Invoke Runner', () => { it('should invoke runner imperatively ', async () => { const mylib = uniq('mylib'); - runCLI(`generate @nrwl/js:lib ${mylib}`); + runCLI(`generate @nx/js:lib ${mylib}`); updateProjectConfig(mylib, (c) => { c.targets['prebuild'] = { command: 'echo prebuild', diff --git a/e2e/nx-run/src/run.test.ts b/e2e/nx-run/src/run.test.ts index 94ba220807f3e..a5228b9854d0e 100644 --- a/e2e/nx-run/src/run.test.ts +++ b/e2e/nx-run/src/run.test.ts @@ -16,7 +16,7 @@ import { updateFile, updateJson, updateProjectConfig, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; import { PackageJson } from 'nx/src/utils/package-json'; import * as path from 'path'; @@ -29,7 +29,7 @@ describe('Nx Running Tests', () => { describe('(forwarding params)', () => { let proj = uniq('proj'); beforeAll(() => { - runCLI(`generate @nrwl/js:lib ${proj}`); + runCLI(`generate @nx/js:lib ${proj}`); updateProjectConfig(proj, (c) => { c.targets['echo'] = { command: 'echo ECHO:', @@ -56,10 +56,10 @@ describe('Nx Running Tests', () => { it('should execute long running tasks', async () => { const myapp = uniq('myapp'); - runCLI(`generate @nrwl/web:app ${myapp}`); + runCLI(`generate @nx/web:app ${myapp}`); updateProjectConfig(myapp, (c) => { c.targets['counter'] = { - executor: '@nrwl/workspace:counter', + executor: '@nx/workspace:counter', options: { to: 2, }, @@ -76,7 +76,7 @@ describe('Nx Running Tests', () => { it('should run npm scripts', async () => { const mylib = uniq('mylib'); - runCLI(`generate @nrwl/node:lib ${mylib}`); + runCLI(`generate @nx/node:lib ${mylib}`); // Used to restore targets to lib after test const original = readProjectConfig(mylib); @@ -121,8 +121,8 @@ describe('Nx Running Tests', () => { it('should stop executing all tasks when one of the tasks fails', async () => { const myapp1 = uniq('a'); const myapp2 = uniq('b'); - runCLI(`generate @nrwl/web:app ${myapp1}`); - runCLI(`generate @nrwl/web:app ${myapp2}`); + runCLI(`generate @nx/web:app ${myapp1}`); + runCLI(`generate @nx/web:app ${myapp2}`); updateProjectConfig(myapp1, (c) => { c.targets['error'] = { command: 'echo boom1 && exit 1', @@ -173,14 +173,14 @@ describe('Nx Running Tests', () => { describe('run-one', () => { it('should build a specific project', () => { const myapp = uniq('app'); - runCLI(`generate @nrwl/web:app ${myapp}`); + runCLI(`generate @nx/web:app ${myapp}`); runCLI(`build ${myapp}`); }, 10000); it('should support project name positional arg non-consecutive to target', () => { const myapp = uniq('app'); - runCLI(`generate @nrwl/web:app ${myapp}`); + runCLI(`generate @nx/web:app ${myapp}`); runCLI(`build --verbose ${myapp}`); }, 10000); @@ -190,7 +190,7 @@ describe('Nx Running Tests', () => { const target = uniq('script'); const expectedOutput = uniq('myEchoedString'); - runCLI(`generate @nrwl/web:app ${myapp}`); + runCLI(`generate @nx/web:app ${myapp}`); updateFile( `apps/${myapp}/package.json`, JSON.stringify({ @@ -207,7 +207,7 @@ describe('Nx Running Tests', () => { it('should run targets inferred from plugin-specified project files', () => { // Setup an app to extend const myapp = uniq('app'); - runCLI(`generate @nrwl/web:app ${myapp}`); + runCLI(`generate @nx/web:app ${myapp}`); // Register an Nx plugin const plugin = `module.exports = { @@ -236,7 +236,7 @@ describe('Nx Running Tests', () => { it('should build a specific project with the daemon disabled', () => { const myapp = uniq('app'); - runCLI(`generate @nrwl/web:app ${myapp}`); + runCLI(`generate @nx/web:app ${myapp}`); const buildWithDaemon = runCLI(`build ${myapp}`, { env: { ...process.env, NX_DAEMON: 'false' }, @@ -253,7 +253,7 @@ describe('Nx Running Tests', () => { it('should build the project when within the project root', () => { const myapp = uniq('app'); - runCLI(`generate @nrwl/web:app ${myapp}`); + runCLI(`generate @nx/web:app ${myapp}`); // Should work within the project directory expect(runCommand(`cd apps/${myapp}/src && npx nx build`)).toContain( @@ -332,9 +332,9 @@ describe('Nx Running Tests', () => { myapp = uniq('myapp'); mylib1 = uniq('mylib1'); mylib2 = uniq('mylib1'); - runCLI(`generate @nrwl/web:app ${myapp}`); - runCLI(`generate @nrwl/js:lib ${mylib1}`); - runCLI(`generate @nrwl/js:lib ${mylib2}`); + runCLI(`generate @nx/web:app ${myapp}`); + runCLI(`generate @nx/js:lib ${mylib1}`); + runCLI(`generate @nx/js:lib ${mylib2}`); updateFile( `apps/${myapp}/src/main.ts`, @@ -419,15 +419,15 @@ describe('Nx Running Tests', () => { const libC = uniq('libc-rand'); const libD = uniq('libd-rand'); - runCLI(`generate @nrwl/web:app ${appA}`); - runCLI(`generate @nrwl/js:lib ${libA} --bundler=tsc --defaults`); + runCLI(`generate @nx/web:app ${appA}`); + runCLI(`generate @nx/js:lib ${libA} --bundler=tsc --defaults`); runCLI( - `generate @nrwl/js:lib ${libB} --bundler=tsc --defaults --tags=ui-a` + `generate @nx/js:lib ${libB} --bundler=tsc --defaults --tags=ui-a` ); runCLI( - `generate @nrwl/js:lib ${libC} --bundler=tsc --defaults --tags=ui-b,shared` + `generate @nx/js:lib ${libC} --bundler=tsc --defaults --tags=ui-b,shared` ); - runCLI(`generate @nrwl/node:lib ${libD} --defaults --tags=api`); + runCLI(`generate @nx/node:lib ${libD} --defaults --tags=api`); // libA depends on libC updateFile( @@ -532,8 +532,8 @@ describe('Nx Running Tests', () => { it('should run multiple targets', () => { const myapp1 = uniq('myapp'); const myapp2 = uniq('myapp'); - runCLI(`generate @nrwl/web:app ${myapp1}`); - runCLI(`generate @nrwl/web:app ${myapp2}`); + runCLI(`generate @nx/web:app ${myapp1}`); + runCLI(`generate @nx/web:app ${myapp2}`); let outputs = runCLI( // Options with lists can be specified using multiple args or with a delimiter (comma or space). diff --git a/e2e/plugin/src/nx-plugin.fixtures.ts b/e2e/plugin/src/nx-plugin.fixtures.ts index e9f2c368c6b94..d4d67cad6ebe7 100644 --- a/e2e/plugin/src/nx-plugin.fixtures.ts +++ b/e2e/plugin/src/nx-plugin.fixtures.ts @@ -1,4 +1,4 @@ -export const ASYNC_GENERATOR_EXECUTOR_CONTENTS = `import { ExecutorContext } from '@nrwl/devkit'; +export const ASYNC_GENERATOR_EXECUTOR_CONTENTS = `import { ExecutorContext } from '@nx/devkit'; async function* asyncGenerator( ) { diff --git a/e2e/plugin/src/nx-plugin.test.ts b/e2e/plugin/src/nx-plugin.test.ts index c5ec429bd31d3..829dba3a13c6f 100644 --- a/e2e/plugin/src/nx-plugin.test.ts +++ b/e2e/plugin/src/nx-plugin.test.ts @@ -14,7 +14,7 @@ import { uniq, updateFile, updateJson, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; import type { PackageJson } from 'nx/src/utils/package-json'; import { ASYNC_GENERATOR_EXECUTOR_CONTENTS } from './nx-plugin.fixtures'; @@ -31,7 +31,7 @@ describe('Nx Plugin', () => { it('should be able to generate a Nx Plugin ', async () => { const plugin = uniq('plugin'); - runCLI(`generate @nrwl/nx-plugin:plugin ${plugin} --linter=eslint`); + runCLI(`generate @nx/plugin:plugin ${plugin} --linter=eslint`); const lintResults = runCLI(`lint ${plugin}`); expect(lintResults).toContain('All files pass linting.'); @@ -51,9 +51,9 @@ describe('Nx Plugin', () => { const plugin = uniq('plugin'); const version = '1.0.0'; - runCLI(`generate @nrwl/nx-plugin:plugin ${plugin} --linter=eslint`); + runCLI(`generate @nx/plugin:plugin ${plugin} --linter=eslint`); runCLI( - `generate @nrwl/nx-plugin:migration --project=${plugin} --packageVersion=${version} --packageJsonUpdates=false` + `generate @nx/plugin:migration --project=${plugin} --packageVersion=${version} --packageJsonUpdates=false` ); const lintResults = runCLI(`lint ${plugin}`); @@ -84,10 +84,8 @@ describe('Nx Plugin', () => { const plugin = uniq('plugin'); const generator = uniq('generator'); - runCLI(`generate @nrwl/nx-plugin:plugin ${plugin} --linter=eslint`); - runCLI( - `generate @nrwl/nx-plugin:generator ${generator} --project=${plugin}` - ); + runCLI(`generate @nx/plugin:plugin ${plugin} --linter=eslint`); + runCLI(`generate @nx/plugin:generator ${generator} --project=${plugin}`); const lintResults = runCLI(`lint ${plugin}`); expect(lintResults).toContain('All files pass linting.'); @@ -121,9 +119,9 @@ describe('Nx Plugin', () => { const plugin = uniq('plugin'); const executor = uniq('executor'); - runCLI(`generate @nrwl/nx-plugin:plugin ${plugin} --linter=eslint`); + runCLI(`generate @nx/plugin:plugin ${plugin} --linter=eslint`); runCLI( - `generate @nrwl/nx-plugin:executor ${executor} --project=${plugin} --includeHasher` + `generate @nx/plugin:executor ${executor} --project=${plugin} --includeHasher` ); const lintResults = runCLI(`lint ${plugin}`); @@ -169,34 +167,32 @@ describe('Nx Plugin', () => { // Generating the plugin results in a generator also called {plugin}, // as well as an executor called "build" - runCLI(`generate @nrwl/nx-plugin:plugin ${plugin} --linter=eslint`); + runCLI(`generate @nx/plugin:plugin ${plugin} --linter=eslint`); runCLI( - `generate @nrwl/nx-plugin:generator ${goodGenerator} --project=${plugin}` + `generate @nx/plugin:generator ${goodGenerator} --project=${plugin}` ); runCLI( - `generate @nrwl/nx-plugin:generator ${badFactoryPath} --project=${plugin}` + `generate @nx/plugin:generator ${badFactoryPath} --project=${plugin}` ); - runCLI( - `generate @nrwl/nx-plugin:executor ${goodExecutor} --project=${plugin}` - ); + runCLI(`generate @nx/plugin:executor ${goodExecutor} --project=${plugin}`); runCLI( - `generate @nrwl/nx-plugin:executor ${badExecutorBadImplPath} --project=${plugin}` + `generate @nx/plugin:executor ${badExecutorBadImplPath} --project=${plugin}` ); runCLI( - `generate @nrwl/nx-plugin:migration ${badMigrationVersion} --project=${plugin} --packageVersion="invalid"` + `generate @nx/plugin:migration ${badMigrationVersion} --project=${plugin} --packageVersion="invalid"` ); runCLI( - `generate @nrwl/nx-plugin:migration ${missingMigrationVersion} --project=${plugin} --packageVersion="0.1.0"` + `generate @nx/plugin:migration ${missingMigrationVersion} --project=${plugin} --packageVersion="0.1.0"` ); runCLI( - `generate @nrwl/nx-plugin:migration ${goodMigration} --project=${plugin} --packageVersion="0.1.0"` + `generate @nx/plugin:migration ${goodMigration} --project=${plugin} --packageVersion="0.1.0"` ); updateFile(`libs/${plugin}/generators.json`, (f) => { @@ -262,7 +258,7 @@ describe('Nx Plugin', () => { let plugin: string; beforeEach(() => { plugin = uniq('plugin'); - runCLI(`generate @nrwl/nx-plugin:plugin ${plugin} --linter=eslint`); + runCLI(`generate @nx/plugin:plugin ${plugin} --linter=eslint`); }); it('should be able to infer projects and targets', async () => { @@ -310,13 +306,9 @@ describe('Nx Plugin', () => { const executor = uniq('executor'); const generatedProject = uniq('project'); - runCLI( - `generate @nrwl/nx-plugin:generator ${generator} --project=${plugin}` - ); + runCLI(`generate @nx/plugin:generator ${generator} --project=${plugin}`); - runCLI( - `generate @nrwl/nx-plugin:executor ${executor} --project=${plugin}` - ); + runCLI(`generate @nx/plugin:executor ${executor} --project=${plugin}`); updateFile( `libs/${plugin}/src/executors/${executor}/executor.ts`, @@ -352,7 +344,7 @@ describe('Nx Plugin', () => { expect(() => { runCLI( - `generate @nrwl/nx-plugin:generator ${generator} --project=${plugin}` + `generate @nx/plugin:generator ${generator} --project=${plugin}` ); runCLI( @@ -370,9 +362,9 @@ describe('Nx Plugin', () => { it('should work with generate wrapper', () => { custom = uniq('custom'); const project = uniq('generated-project'); - runCLI(`g @nrwl/nx-plugin:plugin workspace-plugin --no-interactive`); + runCLI(`g @nx/plugin:plugin workspace-plugin --no-interactive`); runCLI( - `g @nrwl/nx-plugin:generator ${custom} --project workspace-plugin --no-interactive` + `g @nx/plugin:generator ${custom} --project workspace-plugin --no-interactive` ); runCLI( `workspace-generator ${custom} --name ${project} --no-interactive` @@ -390,7 +382,7 @@ describe('Nx Plugin', () => { it('should create a plugin in the specified directory', () => { const plugin = uniq('plugin'); runCLI( - `generate @nrwl/nx-plugin:plugin ${plugin} --linter=eslint --directory subdir --e2eTestRunner=jest` + `generate @nx/plugin:plugin ${plugin} --linter=eslint --directory subdir --e2eTestRunner=jest` ); checkFilesExist(`libs/subdir/${plugin}/package.json`); const pluginProject = readProjectConfig(`subdir-${plugin}`); @@ -403,7 +395,7 @@ describe('Nx Plugin', () => { it('should add tags to project configuration', async () => { const plugin = uniq('plugin'); runCLI( - `generate @nrwl/nx-plugin:plugin ${plugin} --linter=eslint --tags=e2etag,e2ePackage ` + `generate @nx/plugin:plugin ${plugin} --linter=eslint --tags=e2etag,e2ePackage ` ); const pluginProject = readProjectConfig(plugin); expect(pluginProject.tags).toEqual(['e2etag', 'e2ePackage']); @@ -413,9 +405,9 @@ describe('Nx Plugin', () => { it('should be able to generate a create-package plugin ', async () => { const plugin = uniq('plugin'); const createAppName = `create-${plugin}-app`; - runCLI(`generate @nrwl/nx-plugin:plugin ${plugin}`); + runCLI(`generate @nx/plugin:plugin ${plugin}`); runCLI( - `generate @nrwl/nx-plugin:create-package ${createAppName} --project=${plugin}` + `generate @nx/plugin:create-package ${createAppName} --project=${plugin}` ); const buildResults = runCLI(`build ${createAppName}`); @@ -432,7 +424,7 @@ describe('Nx Plugin', () => { const plugin = uniq('plugin'); expect(() => runCLI( - `generate @nrwl/nx-plugin:create-package ${plugin} --project=invalid-plugin` + `generate @nx/plugin:create-package ${plugin} --project=invalid-plugin` ) ).toThrow(); }); diff --git a/e2e/react-core/src/react-module-federation.test.ts b/e2e/react-core/src/react-module-federation.test.ts index fbd2c7326ebe6..f078a3a513f62 100644 --- a/e2e/react-core/src/react-module-federation.test.ts +++ b/e2e/react-core/src/react-module-federation.test.ts @@ -10,7 +10,7 @@ import { runCypressTests, uniq, updateFile, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; describe('React Module Federation', () => { let proj: string; @@ -25,15 +25,15 @@ describe('React Module Federation', () => { const remote2 = uniq('remote2'); const remote3 = uniq('remote3'); - runCLI(`generate @nrwl/react:host ${shell} --style=css --no-interactive`); + runCLI(`generate @nx/react:host ${shell} --style=css --no-interactive`); runCLI( - `generate @nrwl/react:remote ${remote1} --style=css --host=${shell} --no-interactive` + `generate @nx/react:remote ${remote1} --style=css --host=${shell} --no-interactive` ); runCLI( - `generate @nrwl/react:remote ${remote2} --style=css --host=${shell} --no-interactive` + `generate @nx/react:remote ${remote2} --style=css --host=${shell} --no-interactive` ); runCLI( - `generate @nrwl/react:remote ${remote3} --style=css --host=${shell} --no-interactive` + `generate @nx/react:remote ${remote3} --style=css --host=${shell} --no-interactive` ); checkFilesExist(`apps/${shell}/module-federation.config.js`); @@ -48,10 +48,10 @@ describe('React Module Federation', () => { updateFile( `apps/${shell}/webpack.config.js`, stripIndents` - import { ModuleFederationConfig } from '@nrwl/devkit'; - import { composePlugins, withNx } from '@nrwl/webpack'; - import { withReact } from '@nrwl/react'; - import { withModuleFederation } from '@nrwl/react/module-federation'); + import { ModuleFederationConfig } from '@nx/devkit'; + import { composePlugins, withNx } from '@nx/webpack'; + import { withReact } from '@nx/react'; + import { withModuleFederation } from '@nx/react/module-federation'); const baseConfig = require('./module-federation.config'); diff --git a/e2e/react-core/src/react-package.test.ts b/e2e/react-core/src/react-package.test.ts index e1ace52e05f77..30bf79ff1f61c 100644 --- a/e2e/react-core/src/react-package.test.ts +++ b/e2e/react-core/src/react-package.test.ts @@ -15,7 +15,7 @@ import { updateFile, updateJson, updateProjectConfig, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; import { names } from '@nx/devkit'; describe('Build React libraries and apps', () => { @@ -65,12 +65,12 @@ describe('Build React libraries and apps', () => { ); }; - runCLI(`generate @nrwl/react:app ${app} `); + runCLI(`generate @nx/react:app ${app} `); updateJson('nx.json', (json) => ({ ...json, generators: { ...json.generators, - '@nrwl/react': { + '@nx/react': { library: { unitTestRunner: 'none', }, @@ -79,13 +79,13 @@ describe('Build React libraries and apps', () => { })); // generate buildable libs runCLI( - `generate @nrwl/react:library ${parentLib} --bundler=rollup --importPath=@${proj}/${parentLib} --no-interactive --unitTestRunner=jest` + `generate @nx/react:library ${parentLib} --bundler=rollup --importPath=@${proj}/${parentLib} --no-interactive --unitTestRunner=jest` ); runCLI( - `generate @nrwl/react:library ${childLib} --bundler=rollup --importPath=@${proj}/${childLib} --no-interactive --unitTestRunner=jest` + `generate @nx/react:library ${childLib} --bundler=rollup --importPath=@${proj}/${childLib} --no-interactive --unitTestRunner=jest` ); runCLI( - `generate @nrwl/react:library ${childLib2} --bundler=rollup --importPath=@${proj}/${childLib2} --no-interactive --unitTestRunner=jest` + `generate @nx/react:library ${childLib2} --bundler=rollup --importPath=@${proj}/${childLib2} --no-interactive --unitTestRunner=jest` ); createDep(parentLib, [childLib, childLib2]); @@ -190,7 +190,7 @@ export async function h() { return 'c'; } // Setup const myLib = uniq('my-lib'); runCLI( - `generate @nrwl/react:library ${myLib} --bundler=rollup --publishable --importPath="@mproj/${myLib}" --no-interactive --unitTestRunner=jest` + `generate @nx/react:library ${myLib} --bundler=rollup --publishable --importPath="@mproj/${myLib}" --no-interactive --unitTestRunner=jest` ); /** @@ -249,7 +249,7 @@ export async function h() { return 'c'; } const libName = uniq('lib'); runCLI( - `generate @nrwl/react:lib ${libName} --bundler=rollup --importPath=@${proj}/${libName} --no-interactive --unitTestRunner=jest` + `generate @nx/react:lib ${libName} --bundler=rollup --importPath=@${proj}/${libName} --no-interactive --unitTestRunner=jest` ); const mainPath = `libs/${libName}/src/lib/${libName}.tsx`; diff --git a/e2e/react-core/src/react.test.ts b/e2e/react-core/src/react.test.ts index 4eb5eeef3cde8..754bed605b7b1 100644 --- a/e2e/react-core/src/react.test.ts +++ b/e2e/react-core/src/react.test.ts @@ -14,7 +14,7 @@ import { updateFile, updateJson, updateProjectConfig, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; import { readFileSync } from 'fs-extra'; import { join } from 'path'; @@ -35,13 +35,13 @@ describe('React Applications', () => { const logoSvg = readFileSync(join(__dirname, 'logo.svg')).toString(); runCLI( - `generate @nrwl/react:app ${appName} --style=css --bundler=webpack --no-interactive` + `generate @nx/react:app ${appName} --style=css --bundler=webpack --no-interactive` ); runCLI( - `generate @nrwl/react:lib ${libName} --style=css --no-interactive --unit-test-runner=jest` + `generate @nx/react:lib ${libName} --style=css --no-interactive --unit-test-runner=jest` ); runCLI( - `generate @nrwl/react:lib ${libWithNoComponents} --no-interactive --no-component --unit-test-runner=jest` + `generate @nx/react:lib ${libWithNoComponents} --no-interactive --no-component --unit-test-runner=jest` ); // Libs should not include package.json by default @@ -107,7 +107,7 @@ describe('React Applications', () => { }); // Set up SSR and check app - runCLI(`generate @nrwl/react:setup-ssr ${appName}`); + runCLI(`generate @nx/react:setup-ssr ${appName}`); checkFilesExist(`apps/${appName}/src/main.server.tsx`); checkFilesExist(`apps/${appName}/server.ts`); @@ -129,15 +129,15 @@ describe('React Applications', () => { const plainJsLib = uniq('jslib'); runCLI( - `generate @nrwl/react:app ${appName} --bundler=webpack --no-interactive --js` + `generate @nx/react:app ${appName} --bundler=webpack --no-interactive --js` ); runCLI( - `generate @nrwl/react:lib ${libName} --no-interactive --js --unit-test-runner=none` + `generate @nx/react:lib ${libName} --no-interactive --js --unit-test-runner=none` ); // Make sure plain JS libs can be imported as well. // There was an issue previously: https://github.com/nrwl/nx/issues/10990 runCLI( - `generate @nrwl/js:lib ${plainJsLib} --js --unit-test-runner=none --bundler=none --compiler=tsc --no-interactive` + `generate @nx/js:lib ${plainJsLib} --js --unit-test-runner=none --bundler=none --compiler=tsc --no-interactive` ); const mainPath = `apps/${appName}/src/main.js`; @@ -159,11 +159,9 @@ describe('React Applications', () => { const appName = uniq('app'); const libName = uniq('lib'); + runCLI(`generate @nx/react:app ${appName} --bundler=vite --no-interactive`); runCLI( - `generate @nrwl/react:app ${appName} --bundler=vite --no-interactive` - ); - runCLI( - `generate @nrwl/react:lib ${libName} --bundler=none --no-interactive --unit-test-runner=vitest` + `generate @nx/react:lib ${libName} --bundler=none --no-interactive --unit-test-runner=vitest` ); // Library generated with Vite @@ -191,7 +189,7 @@ describe('React Applications', () => { const appName = uniq('app'); runCLI( - `generate @nrwl/react:app ${appName} --routing --bundler=webpack --no-interactive` + `generate @nx/react:app ${appName} --routing --bundler=webpack --no-interactive` ); runCLI(`build ${appName} --outputHashing none`); @@ -207,12 +205,12 @@ describe('React Applications', () => { const appName = uniq('app'); const libName = uniq('lib'); - runCLI(`g @nrwl/react:app ${appName} --bundler=webpack --no-interactive`); - runCLI(`g @nrwl/react:redux lemon --project=${appName}`); + runCLI(`g @nx/react:app ${appName} --bundler=webpack --no-interactive`); + runCLI(`g @nx/react:redux lemon --project=${appName}`); runCLI( - `g @nrwl/react:lib ${libName} --unit-test-runner=jest --no-interactive` + `g @nx/react:lib ${libName} --unit-test-runner=jest --no-interactive` ); - runCLI(`g @nrwl/react:redux orange --project=${libName}`); + runCLI(`g @nx/react:redux orange --project=${libName}`); const appTestResults = await runCLIAsync(`test ${appName}`); expect(appTestResults.combinedOutput).toContain( @@ -235,7 +233,7 @@ describe('React Applications', () => { `('should support global and css modules', ({ style }) => { const appName = uniq('app'); runCLI( - `generate @nrwl/react:app ${appName} --style=${style} --bundler=webpack --no-interactive` + `generate @nx/react:app ${appName} --style=${style} --bundler=webpack --no-interactive` ); // make sure stylePreprocessorOptions works @@ -271,9 +269,9 @@ describe('React Applications', () => { const appName = uniq('app'); const libName = uniq('lib'); - runCLI(`g @nrwl/react:app ${appName} --bundler=webpack --no-interactive`); + runCLI(`g @nx/react:app ${appName} --bundler=webpack --no-interactive`); runCLI( - `g @nrwl/react:lib ${libName} --no-interactive --unit-test-runner=none` + `g @nx/react:lib ${libName} --no-interactive --unit-test-runner=none` ); const mainPath = `apps/${appName}/src/main.tsx`; diff --git a/e2e/react-extensions/src/cypress-component-tests.test.ts b/e2e/react-extensions/src/cypress-component-tests.test.ts index 3cb71c0ba35f5..1f1ffe073683d 100644 --- a/e2e/react-extensions/src/cypress-component-tests.test.ts +++ b/e2e/react-extensions/src/cypress-component-tests.test.ts @@ -21,14 +21,14 @@ describe('React Cypress Component Tests', () => { ensureCypressInstallation(); runCLI( - `generate @nrwl/react:app ${appName} --bundler=webpack --no-interactive` + `generate @nx/react:app ${appName} --bundler=webpack --no-interactive` ); updateJson('nx.json', (json) => ({ ...json, generators: { ...json.generators, - '@nrwl/react': { + '@nx/react': { library: { unitTestRunner: 'jest', }, @@ -37,13 +37,13 @@ describe('React Cypress Component Tests', () => { })); runCLI( - `generate @nrwl/react:component fancy-cmp --project=${appName} --no-interactive` + `generate @nx/react:component fancy-cmp --project=${appName} --no-interactive` ); runCLI( - `generate @nrwl/react:lib ${usedInAppLibName} --no-interactive --unitTestRunner=jest` + `generate @nx/react:lib ${usedInAppLibName} --no-interactive --unitTestRunner=jest` ); runCLI( - `generate @nrwl/react:component btn --project=${usedInAppLibName} --export --no-interactive` + `generate @nx/react:component btn --project=${usedInAppLibName} --export --no-interactive` ); // makes sure custom webpack is loading createFile( @@ -102,10 +102,10 @@ export default App;` ); runCLI( - `generate @nrwl/react:lib ${buildableLibName} --buildable --no-interactive --unitTestRunner=jest` + `generate @nx/react:lib ${buildableLibName} --buildable --no-interactive --unitTestRunner=jest` ); runCLI( - `generate @nrwl/react:component input --project=${buildableLibName} --export --no-interactive` + `generate @nx/react:component input --project=${buildableLibName} --export --no-interactive` ); updateFile( @@ -144,7 +144,7 @@ export default Input; it('should test app', () => { runCLI( - `generate @nrwl/react:cypress-component-configuration --project=${appName} --generate-tests` + `generate @nx/react:cypress-component-configuration --project=${appName} --generate-tests` ); expect(runCLI(`component-test ${appName} --no-watch`)).toContain( 'All specs passed!' @@ -153,7 +153,7 @@ export default Input; it('should successfully component test lib being used in app', () => { runCLI( - `generate @nrwl/react:cypress-component-configuration --project=${usedInAppLibName} --generate-tests` + `generate @nx/react:cypress-component-configuration --project=${usedInAppLibName} --generate-tests` ); expect(runCLI(`component-test ${usedInAppLibName} --no-watch`)).toContain( 'All specs passed!' @@ -182,14 +182,14 @@ describe(Input.name, () => { ); runCLI( - `generate @nrwl/react:cypress-component-configuration --project=${buildableLibName} --generate-tests --build-target=${appName}:build` + `generate @nx/react:cypress-component-configuration --project=${buildableLibName} --generate-tests --build-target=${appName}:build` ); expect(runCLI(`component-test ${buildableLibName} --no-watch`)).toContain( 'All specs passed!' ); // add tailwind - runCLI(`generate @nrwl/react:setup-tailwind --project=${buildableLibName}`); + runCLI(`generate @nx/react:setup-tailwind --project=${buildableLibName}`); updateFile( `libs/${buildableLibName}/src/styles.css`, ` diff --git a/e2e/react-extensions/src/react-vite.test.ts b/e2e/react-extensions/src/react-vite.test.ts index 675251d71588c..c2f27328e0955 100644 --- a/e2e/react-extensions/src/react-vite.test.ts +++ b/e2e/react-extensions/src/react-vite.test.ts @@ -6,7 +6,7 @@ import { runCLI, runCLIAsync, uniq, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; describe('Build React applications and libraries with Vite', () => { let proj: string; @@ -23,7 +23,7 @@ describe('Build React applications and libraries with Vite', () => { const viteApp = uniq('viteapp'); runCLI( - `generate @nrwl/react:app ${viteApp} --bundler=vite --unitTestRunner=vitest --no-interactive` + `generate @nx/react:app ${viteApp} --bundler=vite --unitTestRunner=vitest --no-interactive` ); const appTestResults = await runCLIAsync(`test ${viteApp}`); @@ -45,7 +45,7 @@ describe('Build React applications and libraries with Vite', () => { const viteLib = uniq('vitelib'); runCLI( - `generate @nrwl/react:app ${viteApp} --bundler=vite --unitTestRunner=vitest --inSourceTests --no-interactive` + `generate @nx/react:app ${viteApp} --bundler=vite --unitTestRunner=vitest --inSourceTests --no-interactive` ); expect(() => { checkFilesExist(`apps/${viteApp}/src/app/app.spec.tsx`); @@ -65,21 +65,21 @@ describe('Build React applications and libraries with Vite', () => { checkFilesExist(`dist/apps/${viteApp}/index.html`); runCLI( - `generate @nrwl/react:lib ${viteLib} --bundler=vite --inSourceTests --unitTestRunner=vitest --no-interactive` + `generate @nx/react:lib ${viteLib} --bundler=vite --inSourceTests --unitTestRunner=vitest --no-interactive` ); expect(() => { checkFilesExist(`libs/${viteLib}/src/lib/${viteLib}.spec.tsx`); }).toThrow(); runCLI( - `generate @nrwl/react:component comp1 --inSourceTests --export --project=${viteLib} --no-interactive` + `generate @nx/react:component comp1 --inSourceTests --export --project=${viteLib} --no-interactive` ); expect(() => { checkFilesExist(`libs/${viteLib}/src/lib/comp1/comp1.spec.tsx`); }).toThrow(); runCLI( - `generate @nrwl/react:component comp2 --export --project=${viteLib} --no-interactive` + `generate @nx/react:component comp2 --export --project=${viteLib} --no-interactive` ); checkFilesExist(`libs/${viteLib}/src/lib/comp2/comp2.spec.tsx`); @@ -105,7 +105,7 @@ describe('Build React applications and libraries with Vite', () => { const viteLib = uniq('vitelib'); runCLI( - `generate @nrwl/react:lib ${viteLib} --bundler=vite --no-interactive --unit-test-runner=none` + `generate @nx/react:lib ${viteLib} --bundler=vite --no-interactive --unit-test-runner=none` ); const packageJson = readJson('package.json'); @@ -125,10 +125,10 @@ describe('Build React applications and libraries with Vite', () => { // Convert non-buildable lib to buildable one const nonBuildableLib = uniq('nonbuildablelib'); runCLI( - `generate @nrwl/react:lib ${nonBuildableLib} --no-interactive --unitTestRunner=jest` + `generate @nx/react:lib ${nonBuildableLib} --no-interactive --unitTestRunner=jest` ); runCLI( - `generate @nrwl/vite:configuration ${nonBuildableLib} --uiFramework=react --no-interactive` + `generate @nx/vite:configuration ${nonBuildableLib} --uiFramework=react --no-interactive` ); await runCLIAsync(`build ${nonBuildableLib}`); checkFilesExist( diff --git a/e2e/react-native/src/react-native.test.ts b/e2e/react-native/src/react-native.test.ts index 07e89ca91715c..1fb166162d7e7 100644 --- a/e2e/react-native/src/react-native.test.ts +++ b/e2e/react-native/src/react-native.test.ts @@ -12,7 +12,7 @@ import { runCommandUntil, uniq, updateFile, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; import { ChildProcess } from 'child_process'; import { join } from 'path'; @@ -24,10 +24,10 @@ describe('react native', () => { beforeAll(() => { proj = newProject(); runCLI( - `generate @nrwl/react-native:application ${appName} --install=false --no-interactive` + `generate @nx/react-native:application ${appName} --install=false --no-interactive` ); runCLI( - `generate @nrwl/react-native:library ${libName} --buildable --publishable --importPath=${proj}/${libName} --no-interactive` + `generate @nx/react-native:library ${libName} --buildable --publishable --importPath=${proj}/${libName} --no-interactive` ); }); afterAll(() => cleanupProject()); @@ -35,7 +35,7 @@ describe('react native', () => { it('should test and lint', async () => { const componentName = uniq('component'); runCLI( - `generate @nrwl/react-native:component ${componentName} --project=${libName} --export --no-interactive` + `generate @nx/react-native:component ${componentName} --project=${libName} --export --no-interactive` ); updateFile(`apps/${appName}/src/app/App.tsx`, (content) => { @@ -119,7 +119,7 @@ describe('react native', () => { it('should create storybook with application', async () => { runCLI( - `generate @nrwl/react-native:storybook-configuration ${appName} --generateStories --no-interactive` + `generate @nx/react-native:storybook-configuration ${appName} --generateStories --no-interactive` ); expect(() => checkFilesExist( @@ -145,7 +145,7 @@ describe('react native', () => { it('should upgrade native for application', async () => { expect(() => runCLI( - `generate @nrwl/react-native:upgrade-native ${appName} --install=false` + `generate @nx/react-native:upgrade-native ${appName} --install=false` ) ).not.toThrow(); }); @@ -154,7 +154,7 @@ describe('react native', () => { const componentName = uniq('component'); runCLI( - `generate @nrwl/react-native:component ${componentName} --project=${libName} --export` + `generate @nx/react-native:component ${componentName} --project=${libName} --export` ); expect(() => { runCLI(`build ${libName}`); diff --git a/e2e/rollup/src/rollup.test.ts b/e2e/rollup/src/rollup.test.ts index 37ec6ebbaa7a6..85777bab98801 100644 --- a/e2e/rollup/src/rollup.test.ts +++ b/e2e/rollup/src/rollup.test.ts @@ -7,7 +7,7 @@ import { uniq, updateFile, updateProjectConfig, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; describe('Rollup Plugin', () => { beforeAll(() => newProject()); @@ -15,12 +15,12 @@ describe('Rollup Plugin', () => { it('should be able to setup project to build node programs with rollup and different compilers', async () => { const myPkg = uniq('my-pkg'); - runCLI(`generate @nrwl/js:lib ${myPkg} --bundler=none`); + runCLI(`generate @nx/js:lib ${myPkg} --bundler=none`); updateFile(`libs/${myPkg}/src/index.ts`, `console.log('Hello');\n`); // babel (default) runCLI( - `generate @nrwl/rollup:rollup-project ${myPkg} --target=node --tsConfig=libs/${myPkg}/tsconfig.lib.json --main=libs/${myPkg}/src/index.ts` + `generate @nx/rollup:rollup-project ${myPkg} --target=node --tsConfig=libs/${myPkg}/tsconfig.lib.json --main=libs/${myPkg}/src/index.ts` ); rmDist(); runCLI(`build ${myPkg}`); @@ -34,7 +34,7 @@ describe('Rollup Plugin', () => { // swc runCLI( - `generate @nrwl/rollup:rollup-project ${myPkg} --target=node --tsConfig=libs/${myPkg}/tsconfig.lib.json --main=libs/${myPkg}/src/index.ts --compiler=swc` + `generate @nx/rollup:rollup-project ${myPkg} --target=node --tsConfig=libs/${myPkg}/tsconfig.lib.json --main=libs/${myPkg}/src/index.ts --compiler=swc` ); rmDist(); runCLI(`build ${myPkg}`); @@ -48,7 +48,7 @@ describe('Rollup Plugin', () => { // tsc runCLI( - `generate @nrwl/rollup:rollup-project ${myPkg} --target=node --tsConfig=libs/${myPkg}/tsconfig.lib.json --main=libs/${myPkg}/src/index.ts --compiler=tsc` + `generate @nx/rollup:rollup-project ${myPkg} --target=node --tsConfig=libs/${myPkg}/tsconfig.lib.json --main=libs/${myPkg}/src/index.ts --compiler=tsc` ); rmDist(); runCLI(`build ${myPkg}`); @@ -56,9 +56,9 @@ describe('Rollup Plugin', () => { expect(output).toMatch(/Hello/); }, 500000); - it('should be able to build libs generated with @nrwl/js:lib --bundler rollup', () => { + it('should be able to build libs generated with @nx/js:lib --bundler rollup', () => { const jsLib = uniq('jslib'); - runCLI(`generate @nrwl/js:lib ${jsLib} --bundler rollup`); + runCLI(`generate @nx/js:lib ${jsLib} --bundler rollup`); expect(() => runCLI(`build ${jsLib}`)).not.toThrow(); }); }); diff --git a/e2e/storybook-angular/src/storybook-angular.test.ts b/e2e/storybook-angular/src/storybook-angular.test.ts index 8ccd123ab4c34..01c008d9d55bb 100644 --- a/e2e/storybook-angular/src/storybook-angular.test.ts +++ b/e2e/storybook-angular/src/storybook-angular.test.ts @@ -8,7 +8,7 @@ import { runCypressTests, tmpProjPath, uniq, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; import { writeFileSync } from 'fs'; describe('Storybook executors for Angular', () => { diff --git a/e2e/storybook/src/storybook-nested.test.ts b/e2e/storybook/src/storybook-nested.test.ts index 389a166eb9302..21c0a14e87b85 100644 --- a/e2e/storybook/src/storybook-nested.test.ts +++ b/e2e/storybook/src/storybook-nested.test.ts @@ -9,7 +9,7 @@ import { runCreateWorkspace, tmpProjPath, uniq, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; import { writeFileSync } from 'fs'; import { createFileSync } from 'fs-extra'; diff --git a/e2e/storybook/src/storybook.test.ts b/e2e/storybook/src/storybook.test.ts index a02f823426585..a2598f8e5355d 100644 --- a/e2e/storybook/src/storybook.test.ts +++ b/e2e/storybook/src/storybook.test.ts @@ -7,7 +7,7 @@ import { runCommandUntil, tmpProjPath, uniq, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; import { writeFileSync } from 'fs'; // TODO: re-enable once the issue is fixed with long build times diff --git a/e2e/utils/command-utils.ts b/e2e/utils/command-utils.ts index 5f77623da9f3d..ea1f0bd8ff42d 100644 --- a/e2e/utils/command-utils.ts +++ b/e2e/utils/command-utils.ts @@ -48,9 +48,9 @@ export function setMaxWorkers() { const executor = build.executor as string; if ( - executor.startsWith('@nrwl/node') || - executor.startsWith('@nrwl/web') || - executor.startsWith('@nrwl/jest') + executor.startsWith('@nx/node') || + executor.startsWith('@nx/web') || + executor.startsWith('@nx/jest') ) { build.options.maxWorkers = 4; } diff --git a/e2e/utils/create-project-utils.ts b/e2e/utils/create-project-utils.ts index 2ae49857981fb..04d1d5926c27a 100644 --- a/e2e/utils/create-project-utils.ts +++ b/e2e/utils/create-project-utils.ts @@ -61,25 +61,25 @@ export function newProject({ // TODO(jack): we should tag the projects (e.g. tags: ['package']) and filter from that rather than hard-code packages. const packages = [ - `@nrwl/angular`, - `@nrwl/eslint-plugin-nx`, - `@nrwl/express`, - `@nrwl/esbuild`, - `@nrwl/jest`, - `@nrwl/js`, - `@nrwl/linter`, - `@nrwl/nest`, - `@nrwl/next`, - `@nrwl/node`, - `@nrwl/nx-plugin`, - `@nrwl/rollup`, - `@nrwl/react`, - `@nrwl/storybook`, - `@nrwl/vite`, - `@nrwl/web`, - `@nrwl/webpack`, - `@nrwl/react-native`, - `@nrwl/expo`, + `@nx/angular`, + `@nx/eslint-plugin`, + `@nx/express`, + `@nx/esbuild`, + `@nx/jest`, + `@nx/js`, + `@nx/linter`, + `@nx/nest`, + `@nx/next`, + `@nx/node`, + `@nx/plugin`, + `@nx/rollup`, + `@nx/react`, + `@nx/storybook`, + `@nx/vite`, + `@nx/web`, + `@nx/webpack`, + `@nx/react-native`, + `@nx/expo`, ]; packageInstall(packages.join(` `), projScope); @@ -400,6 +400,7 @@ export function newLernaWorkspace({ ...json.overrides, nx: nxVersion, '@nrwl/devkit': nxVersion, + '@nx/devkit': nxVersion, }; if (packageManager === 'pnpm') { json.pnpm = { diff --git a/e2e/utils/test-utils.ts b/e2e/utils/test-utils.ts index d0f260b14d92b..a932f52e9dac2 100644 --- a/e2e/utils/test-utils.ts +++ b/e2e/utils/test-utils.ts @@ -9,13 +9,13 @@ import { uniq } from './create-project-utils'; import { readFile } from './file-utils'; type GeneratorsWithDefaultTests = - | '@nrwl/js:lib' - | '@nrwl/node:lib' - | '@nrwl/react:lib' - | '@nrwl/react:app' - | '@nrwl/next:app' - | '@nrwl/angular:app' - | '@nrwl/web:app'; + | '@nx/js:lib' + | '@nx/node:lib' + | '@nx/react:lib' + | '@nx/react:app' + | '@nx/next:app' + | '@nx/angular:app' + | '@nx/web:app'; /** * Runs the pass in generator and then runs test on diff --git a/e2e/vite/src/vite.test.ts b/e2e/vite/src/vite.test.ts index 7d65c332dbab5..c5c22b481f6a7 100644 --- a/e2e/vite/src/vite.test.ts +++ b/e2e/vite/src/vite.test.ts @@ -17,7 +17,7 @@ import { uniq, updateFile, updateProjectConfig, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; const myApp = uniq('my-app'); @@ -28,8 +28,8 @@ describe('Vite Plugin', () => { describe('convert React webpack app to vite using the vite:configuration generator', () => { beforeEach(() => { proj = newProject(); - runCLI(`generate @nrwl/react:app ${myApp} --bundler=webpack`); - runCLI(`generate @nrwl/vite:configuration ${myApp}`); + runCLI(`generate @nx/react:app ${myApp} --bundler=webpack`); + runCLI(`generate @nx/vite:configuration ${myApp}`); }); afterEach(() => cleanupProject()); @@ -64,7 +64,7 @@ describe('Vite Plugin', () => { describe('set up new React app with --bundler=vite option', () => { beforeEach(() => { proj = newProject(); - runCLI(`generate @nrwl/react:app ${myApp} --bundler=vite`); + runCLI(`generate @nx/react:app ${myApp} --bundler=vite`); createFile(`apps/${myApp}/public/hello.md`, `# Hello World`); updateFile( `apps/${myApp}/src/environments/environment.prod.ts`, @@ -127,10 +127,10 @@ describe('Vite Plugin', () => { }); describe('Vite on Web apps', () => { - describe('set up new @nrwl/web app with --bundler=vite option', () => { + describe('set up new @nx/web app with --bundler=vite option', () => { beforeEach(() => { proj = newProject(); - runCLI(`generate @nrwl/web:app ${myApp} --bundler=vite`); + runCLI(`generate @nx/web:app ${myApp} --bundler=vite`); }); afterEach(() => cleanupProject()); it('should build application', async () => { @@ -146,11 +146,11 @@ describe('Vite Plugin', () => { }, 200_000); }); - describe('convert @nrwl/web webpack app to vite using the vite:configuration generator', () => { + describe('convert @nx/web webpack app to vite using the vite:configuration generator', () => { beforeEach(() => { proj = newProject(); - runCLI(`generate @nrwl/web:app ${myApp} --bundler=webpack`); - runCLI(`generate @nrwl/vite:configuration ${myApp}`); + runCLI(`generate @nx/web:app ${myApp} --bundler=webpack`); + runCLI(`generate @nx/vite:configuration ${myApp}`); }); afterEach(() => cleanupProject()); it('should build application', async () => { @@ -198,7 +198,7 @@ describe('Vite Plugin', () => { 100_000; it('should be able to run tests', async () => { - runCLI(`generate @nrwl/react:lib ${lib} --unitTestRunner=vitest`); + runCLI(`generate @nx/react:lib ${lib} --unitTestRunner=vitest`); expect(exists(tmpProjPath(`libs/${lib}/vite.config.ts`))).toBeTruthy(); const result = await runCLIAsync(`test ${lib}`); @@ -216,7 +216,7 @@ describe('Vite Plugin', () => { }, 100_000); it('should collect coverage', () => { - runCLI(`generate @nrwl/react:lib ${lib} --unitTestRunner=vitest`); + runCLI(`generate @nx/react:lib ${lib} --unitTestRunner=vitest`); updateFile(`libs/${lib}/vite.config.ts`, () => { return `/// import { defineConfig } from 'vite'; @@ -267,8 +267,8 @@ export default defineConfig({ it('should not delete the project directory when coverage is enabled', () => { // when coverage is enabled in the vite.config.ts but reportsDirectory is removed - // from the @nrwl/vite:test executor options, vite will delete the project root directory - runCLI(`generate @nrwl/react:lib ${lib} --unitTestRunner=vitest`); + // from the @nx/vite:test executor options, vite will delete the project root directory + runCLI(`generate @nx/react:lib ${lib} --unitTestRunner=vitest`); updateFile(`libs/${lib}/vite.config.ts`, () => { return `import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react'; @@ -320,7 +320,7 @@ export default defineConfig({ it('should be able to run tests with inSourceTests set to true', async () => { runCLI( - `generate @nrwl/react:lib ${lib} --unitTestRunner=vitest --inSourceTests` + `generate @nx/react:lib ${lib} --unitTestRunner=vitest --inSourceTests` ); expect( exists(tmpProjPath(`libs/${lib}/src/lib/${lib}.spec.tsx`)) diff --git a/e2e/web/src/file-server.test.ts b/e2e/web/src/file-server.test.ts index 5cd8a4e0ca7da..19d36cede407d 100644 --- a/e2e/web/src/file-server.test.ts +++ b/e2e/web/src/file-server.test.ts @@ -7,7 +7,7 @@ import { runCommandUntil, uniq, updateProjectConfig, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; describe('file-server', () => { beforeAll(() => { @@ -19,9 +19,9 @@ describe('file-server', () => { const appName = uniq('app'); const port = 4301; - runCLI(`generate @nrwl/web:app ${appName} --no-interactive`); + runCLI(`generate @nx/web:app ${appName} --no-interactive`); updateProjectConfig(appName, (config) => { - config.targets['serve'].executor = '@nrwl/web:file-server'; + config.targets['serve'].executor = '@nx/web:file-server'; return config; }); @@ -45,16 +45,16 @@ describe('file-server', () => { const reactAppName = uniq('react-app'); runCLI( - `generate @nrwl/angular:app ${ngAppName} --no-interactive --e2eTestRunner=none` + `generate @nx/angular:app ${ngAppName} --no-interactive --e2eTestRunner=none` ); runCLI( - `generate @nrwl/react:app ${reactAppName} --no-interactive --e2eTestRunner=none` + `generate @nx/react:app ${reactAppName} --no-interactive --e2eTestRunner=none` ); runCLI( - `generate @nrwl/web:static-config --buildTarget=${ngAppName}:build --no-interactive` + `generate @nx/web:static-config --buildTarget=${ngAppName}:build --no-interactive` ); runCLI( - `generate @nrwl/web:static-config --buildTarget=${reactAppName}:build --targetName=custom-serve-static --no-interactive` + `generate @nx/web:static-config --buildTarget=${reactAppName}:build --targetName=custom-serve-static --no-interactive` ); const port = 6200; diff --git a/e2e/web/src/web-vite.test.ts b/e2e/web/src/web-vite.test.ts index e0df4ec220215..7bba72a225ca1 100644 --- a/e2e/web/src/web-vite.test.ts +++ b/e2e/web/src/web-vite.test.ts @@ -11,7 +11,7 @@ import { runCLIAsync, runCypressTests, uniq, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; describe('Web Components Applications with bundler set as vite', () => { beforeEach(() => newProject()); @@ -19,7 +19,7 @@ describe('Web Components Applications with bundler set as vite', () => { it('should be able to generate a web app', async () => { const appName = uniq('app'); - runCLI(`generate @nrwl/web:app ${appName} --bundler=vite --no-interactive`); + runCLI(`generate @nx/web:app ${appName} --bundler=vite --no-interactive`); const lintResults = runCLI(`lint ${appName}`); expect(lintResults).toContain('All files pass linting.'); @@ -46,9 +46,9 @@ describe('Web Components Applications with bundler set as vite', () => { const appName = uniq('app'); const libName = uniq('lib'); - runCLI(`generate @nrwl/web:app ${appName} --bundler=vite --no-interactive`); + runCLI(`generate @nx/web:app ${appName} --bundler=vite --no-interactive`); runCLI( - `generate @nrwl/react:lib ${libName} --bundler=vite --no-interactive --unitTestRunner=vitest` + `generate @nx/react:lib ${libName} --bundler=vite --no-interactive --unitTestRunner=vitest` ); createFile(`dist/apps/${appName}/_should_remove.txt`); diff --git a/e2e/web/src/web-webpack.test.ts b/e2e/web/src/web-webpack.test.ts index 6175ae5143724..5a9651aa3513c 100644 --- a/e2e/web/src/web-webpack.test.ts +++ b/e2e/web/src/web-webpack.test.ts @@ -4,7 +4,7 @@ import { runCLI, runCommandUntil, uniq, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; describe('Web Components Applications with bundler set as webpack', () => { beforeEach(() => newProject()); @@ -13,7 +13,7 @@ describe('Web Components Applications with bundler set as webpack', () => { it('should support https for dev-server', async () => { const appName = uniq('app'); runCLI( - `generate @nrwl/web:app ${appName} --bundler=webpack --no-interactive` + `generate @nx/web:app ${appName} --bundler=webpack --no-interactive` ); await runCommandUntil(`serve ${appName} --port=5000 --ssl`, (output) => { diff --git a/e2e/web/src/web.test.ts b/e2e/web/src/web.test.ts index 3ef4aefb45eba..90cd40195b062 100644 --- a/e2e/web/src/web.test.ts +++ b/e2e/web/src/web.test.ts @@ -15,7 +15,7 @@ import { uniq, updateFile, updateProjectConfig, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; describe('Web Components Applications', () => { beforeEach(() => newProject()); @@ -24,7 +24,7 @@ describe('Web Components Applications', () => { it('should be able to generate a web app', async () => { const appName = uniq('app'); runCLI( - `generate @nrwl/web:app ${appName} --bundler=webpack --no-interactive` + `generate @nx/web:app ${appName} --bundler=webpack --no-interactive` ); const lintResults = runCLI(`lint ${appName}`); @@ -64,10 +64,10 @@ describe('Web Components Applications', () => { const libName = uniq('lib'); runCLI( - `generate @nrwl/web:app ${appName} --bundler=webpack --no-interactive --compiler swc` + `generate @nx/web:app ${appName} --bundler=webpack --no-interactive --compiler swc` ); runCLI( - `generate @nrwl/react:lib ${libName} --bundler=rollup --no-interactive --compiler swc --unitTestRunner=jest` + `generate @nx/react:lib ${libName} --bundler=rollup --no-interactive --compiler swc --unitTestRunner=jest` ); createFile(`dist/apps/${appName}/_should_remove.txt`); @@ -103,7 +103,7 @@ describe('Web Components Applications', () => { it('should emit decorator metadata when it is enabled in tsconfig', async () => { const appName = uniq('app'); runCLI( - `generate @nrwl/web:app ${appName} --bundler=webpack --no-interactive` + `generate @nx/web:app ${appName} --bundler=webpack --no-interactive` ); updateFile(`apps/${appName}/src/app/app.element.ts`, (content) => { @@ -158,7 +158,7 @@ describe('Web Components Applications', () => { it('should support custom webpackConfig option', async () => { const appName = uniq('app'); runCLI( - `generate @nrwl/web:app ${appName} --bundler=webpack --no-interactive` + `generate @nx/web:app ${appName} --bundler=webpack --no-interactive` ); updateProjectConfig(appName, (config) => { @@ -257,7 +257,7 @@ describe('CLI - Environment Variables', () => { `; runCLI( - `generate @nrwl/web:app ${appName} --bundler=webpack --no-interactive` + `generate @nx/web:app ${appName} --bundler=webpack --no-interactive` ); const content = readFile(main); @@ -282,7 +282,7 @@ describe('CLI - Environment Variables', () => { const newCode2 = `const envVars = [process.env.NODE_ENV, process.env.NX_BUILD, process.env.NX_API, process.env.NX_WS_BASE, process.env.NX_WS_ENV_LOCAL, process.env.NX_WS_LOCAL_ENV, process.env.NX_APP_BASE, process.env.NX_APP_ENV_LOCAL, process.env.NX_APP_LOCAL_ENV, process.env.NX_SHARED_ENV];`; runCLI( - `generate @nrwl/web:app ${appName2} --bundler=webpack --no-interactive` + `generate @nx/web:app ${appName2} --bundler=webpack --no-interactive` ); const content2 = readFile(main2); @@ -316,7 +316,7 @@ describe('Build Options', () => { const appName = uniq('app'); runCLI( - `generate @nrwl/web:app ${appName} --bundler=webpack --no-interactive` + `generate @nx/web:app ${appName} --bundler=webpack --no-interactive` ); const srcPath = `apps/${appName}/src`; @@ -395,7 +395,7 @@ describe('index.html interpolation', () => { const appName = uniq('app'); runCLI( - `generate @nrwl/web:app ${appName} --bundler=webpack --no-interactive` + `generate @nx/web:app ${appName} --bundler=webpack --no-interactive` ); const srcPath = `apps/${appName}/src`; diff --git a/e2e/webpack/src/webpack.test.ts b/e2e/webpack/src/webpack.test.ts index 0852597981188..db48eb0bd7ab9 100644 --- a/e2e/webpack/src/webpack.test.ts +++ b/e2e/webpack/src/webpack.test.ts @@ -7,7 +7,7 @@ import { uniq, updateFile, updateProjectConfig, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; describe('Webpack Plugin', () => { beforeEach(() => newProject()); @@ -15,12 +15,12 @@ describe('Webpack Plugin', () => { it('should be able to setup project to build node programs with webpack and different compilers', async () => { const myPkg = uniq('my-pkg'); - runCLI(`generate @nrwl/js:lib ${myPkg} --bundler=none`); + runCLI(`generate @nx/js:lib ${myPkg} --bundler=none`); updateFile(`libs/${myPkg}/src/index.ts`, `console.log('Hello');\n`); // babel (default) runCLI( - `generate @nrwl/webpack:webpack-project ${myPkg} --target=node --tsConfig=libs/${myPkg}/tsconfig.lib.json --main=libs/${myPkg}/src/index.ts` + `generate @nx/webpack:webpack-project ${myPkg} --target=node --tsConfig=libs/${myPkg}/tsconfig.lib.json --main=libs/${myPkg}/src/index.ts` ); // Test `scriptType` later during during. @@ -53,7 +53,7 @@ module.exports = composePlugins(withNx(), (config) => { // swc runCLI( - `generate @nrwl/webpack:webpack-project ${myPkg} --target=node --tsConfig=libs/${myPkg}/tsconfig.lib.json --main=libs/${myPkg}/src/index.ts --compiler=swc` + `generate @nx/webpack:webpack-project ${myPkg} --target=node --tsConfig=libs/${myPkg}/tsconfig.lib.json --main=libs/${myPkg}/src/index.ts --compiler=swc` ); rmDist(); runCLI(`build ${myPkg}`); @@ -67,7 +67,7 @@ module.exports = composePlugins(withNx(), (config) => { // tsc runCLI( - `generate @nrwl/webpack:webpack-project ${myPkg} --target=node --tsConfig=libs/${myPkg}/tsconfig.lib.json --main=libs/${myPkg}/src/index.ts --compiler=tsc` + `generate @nx/webpack:webpack-project ${myPkg} --target=node --tsConfig=libs/${myPkg}/tsconfig.lib.json --main=libs/${myPkg}/src/index.ts --compiler=tsc` ); rmDist(); runCLI(`build ${myPkg}`); diff --git a/e2e/workspace-create-npm/src/create-nx-workspace-npm.test.ts b/e2e/workspace-create-npm/src/create-nx-workspace-npm.test.ts index c6f5f7a5a0580..f54ece8d56281 100644 --- a/e2e/workspace-create-npm/src/create-nx-workspace-npm.test.ts +++ b/e2e/workspace-create-npm/src/create-nx-workspace-npm.test.ts @@ -8,7 +8,7 @@ import { runCommand, runCreateWorkspace, uniq, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; describe('create-nx-workspace --preset=npm', () => { const wsName = uniq('npm'); @@ -38,21 +38,21 @@ describe('create-nx-workspace --preset=npm', () => { }); it('should add angular application', () => { - packageInstall('@nrwl/angular', wsName); + packageInstall('@nx/angular', wsName); const appName = uniq('my-app'); expect(() => { - runCLI(`generate @nrwl/angular:app ${appName} --no-interactive`); + runCLI(`generate @nx/angular:app ${appName} --no-interactive`); }).not.toThrowError(); checkFilesExist('tsconfig.base.json'); }, 1_000_000); it('should add angular library', () => { - packageInstall('@nrwl/angular', wsName); + packageInstall('@nx/angular', wsName); const libName = uniq('lib'); expect(() => { - runCLI(`generate @nrwl/angular:lib ${libName} --no-interactive`); + runCLI(`generate @nx/angular:lib ${libName} --no-interactive`); }).not.toThrowError(); checkFilesExist('tsconfig.base.json'); const tsconfig = readJson(`tsconfig.base.json`); @@ -62,12 +62,12 @@ describe('create-nx-workspace --preset=npm', () => { }, 1_000_000); it('should add js library', () => { - packageInstall('@nrwl/js', wsName); + packageInstall('@nx/js', wsName); const libName = uniq('lib'); expect(() => - runCLI(`generate @nrwl/js:library ${libName} --no-interactive`) + runCLI(`generate @nx/js:library ${libName} --no-interactive`) ).not.toThrowError(); checkFilesExist('tsconfig.base.json'); const tsconfig = readJson(`tsconfig.base.json`); @@ -77,34 +77,34 @@ describe('create-nx-workspace --preset=npm', () => { }); it('should add web application', () => { - packageInstall('@nrwl/web', wsName); + packageInstall('@nx/web', wsName); const appName = uniq('my-app'); expect(() => - runCLI(`generate @nrwl/web:app ${appName} --no-interactive`) + runCLI(`generate @nx/web:app ${appName} --no-interactive`) ).not.toThrowError(); checkFilesExist('tsconfig.base.json'); }); it('should add react application', () => { - packageInstall('@nrwl/react', wsName); + packageInstall('@nx/react', wsName); const appName = uniq('my-app'); expect(() => { - runCLI(`generate @nrwl/react:app ${appName} --no-interactive`); + runCLI(`generate @nx/react:app ${appName} --no-interactive`); }).not.toThrowError(); checkFilesExist('tsconfig.base.json'); }); it('should add react library', () => { - packageInstall('@nrwl/react', wsName); + packageInstall('@nx/react', wsName); const libName = uniq('lib'); expect(() => { - runCLI(`generate @nrwl/react:lib ${libName} --no-interactive`); + runCLI(`generate @nx/react:lib ${libName} --no-interactive`); }).not.toThrowError(); checkFilesExist('tsconfig.base.json'); const tsconfig = readJson(`tsconfig.base.json`); @@ -114,23 +114,23 @@ describe('create-nx-workspace --preset=npm', () => { }); it('should add next application', () => { - packageInstall('@nrwl/next', wsName); + packageInstall('@nx/next', wsName); const appName = uniq('my-app'); expect(() => { - runCLI(`generate @nrwl/next:app ${appName} --no-interactive`); + runCLI(`generate @nx/next:app ${appName} --no-interactive`); }).not.toThrowError(); checkFilesExist('tsconfig.base.json'); }); it('should add next library', () => { - packageInstall('@nrwl/next', wsName); + packageInstall('@nx/next', wsName); const libName = uniq('lib'); expect(() => { - runCLI(`generate @nrwl/next:lib ${libName} --no-interactive`); + runCLI(`generate @nx/next:lib ${libName} --no-interactive`); }).not.toThrowError(); checkFilesExist('tsconfig.base.json'); const tsconfig = readJson(`tsconfig.base.json`); @@ -141,25 +141,25 @@ describe('create-nx-workspace --preset=npm', () => { }); it('should add react-native application', () => { - packageInstall('@nrwl/react-native', wsName); + packageInstall('@nx/react-native', wsName); const appName = uniq('my-app'); expect(() => { runCLI( - `generate @nrwl/react-native:app ${appName} --install=false --no-interactive` + `generate @nx/react-native:app ${appName} --install=false --no-interactive` ); }).not.toThrowError(); checkFilesExist('tsconfig.base.json'); }); it('should add react-native library', () => { - packageInstall('@nrwl/react-native', wsName); + packageInstall('@nx/react-native', wsName); const libName = uniq('lib'); expect(() => { - runCLI(`generate @nrwl/react-native:lib ${libName} --no-interactive`); + runCLI(`generate @nx/react-native:lib ${libName} --no-interactive`); }).not.toThrowError(); checkFilesExist('tsconfig.base.json'); const tsconfig = readJson(`tsconfig.base.json`); @@ -169,23 +169,23 @@ describe('create-nx-workspace --preset=npm', () => { }); it('should add node application', () => { - packageInstall('@nrwl/node', wsName); + packageInstall('@nx/node', wsName); const appName = uniq('my-app'); expect(() => { - runCLI(`generate @nrwl/node:app ${appName} --no-interactive`); + runCLI(`generate @nx/node:app ${appName} --no-interactive`); }).not.toThrowError(); checkFilesExist('tsconfig.base.json'); }); it('should add node library', () => { - packageInstall('@nrwl/node', wsName); + packageInstall('@nx/node', wsName); const libName = uniq('lib'); expect(() => { - runCLI(`generate @nrwl/node:lib ${libName} --no-interactive`); + runCLI(`generate @nx/node:lib ${libName} --no-interactive`); }).not.toThrowError(); checkFilesExist('tsconfig.base.json'); const tsconfig = readJson(`tsconfig.base.json`); @@ -195,23 +195,23 @@ describe('create-nx-workspace --preset=npm', () => { }); it('should add nest application', () => { - packageInstall('@nrwl/nest', wsName); + packageInstall('@nx/nest', wsName); const appName = uniq('my-app'); expect(() => { - runCLI(`generate @nrwl/nest:app ${appName} --no-interactive`); + runCLI(`generate @nx/nest:app ${appName} --no-interactive`); }).not.toThrowError(); checkFilesExist('tsconfig.base.json'); }); it('should add nest library', () => { - packageInstall('@nrwl/nest', wsName); + packageInstall('@nx/nest', wsName); const libName = uniq('lib'); expect(() => { - runCLI(`generate @nrwl/nest:lib ${libName} --no-interactive`); + runCLI(`generate @nx/nest:lib ${libName} --no-interactive`); }).not.toThrowError(); checkFilesExist('tsconfig.base.json'); const tsconfig = readJson(`tsconfig.base.json`); @@ -221,12 +221,12 @@ describe('create-nx-workspace --preset=npm', () => { }); it('should add express application', () => { - packageInstall('@nrwl/express', wsName); + packageInstall('@nx/express', wsName); const appName = uniq('my-app'); expect(() => { - runCLI(`generate @nrwl/express:app ${appName} --no-interactive`); + runCLI(`generate @nx/express:app ${appName} --no-interactive`); }).not.toThrowError(); checkFilesExist('tsconfig.base.json'); }); diff --git a/e2e/workspace-create/src/create-nx-plugin.test.ts b/e2e/workspace-create/src/create-nx-plugin.test.ts index 12416907b8b2a..9bf3783e7be88 100644 --- a/e2e/workspace-create/src/create-nx-plugin.test.ts +++ b/e2e/workspace-create/src/create-nx-plugin.test.ts @@ -7,7 +7,7 @@ import { runCreatePlugin, cleanupProject, tmpProjPath, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; describe('create-nx-plugin', () => { const packageManager = getSelectedPackageManager() || 'pnpm'; @@ -38,10 +38,10 @@ describe('create-nx-plugin', () => { ); runCLI( - `generate @nrwl/nx-plugin:generator ${generatorName} --project=${pluginName}` + `generate @nx/plugin:generator ${generatorName} --project=${pluginName}` ); runCLI( - `generate @nrwl/nx-plugin:executor ${executorName} --project=${pluginName}` + `generate @nx/plugin:executor ${executorName} --project=${pluginName}` ); runCLI(`build ${pluginName}`); diff --git a/e2e/workspace-create/src/create-nx-workspace.test.ts b/e2e/workspace-create/src/create-nx-workspace.test.ts index 2015ded63e6b2..3a1a434be44a4 100644 --- a/e2e/workspace-create/src/create-nx-workspace.test.ts +++ b/e2e/workspace-create/src/create-nx-workspace.test.ts @@ -11,7 +11,7 @@ import { readJson, runCreateWorkspace, uniq, -} from '@nrwl/e2e/utils'; +} from '@nx/e2e/utils'; import { existsSync, mkdirSync } from 'fs-extra'; describe('create-nx-workspace', () => { diff --git a/nx-dev/nx-dev-e2e/src/e2e/recipes.cy.ts b/nx-dev/nx-dev-e2e/src/e2e/recipes.cy.ts index 4cee1af391f15..a0da574041c9c 100644 --- a/nx-dev/nx-dev-e2e/src/e2e/recipes.cy.ts +++ b/nx-dev/nx-dev-e2e/src/e2e/recipes.cy.ts @@ -1,4 +1,4 @@ -import { uniq } from '@nrwl/e2e/utils'; +import { uniq } from '@nx/e2e/utils'; describe('nx-dev: Recipes pages', () => { it('should list related recipes based on tags', () => { diff --git a/tsconfig.base.json b/tsconfig.base.json index dae45653f2f64..aa20dc6a5a13c 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -17,7 +17,6 @@ "rootDir": ".", "allowJs": true, "paths": { - "@nrwl/e2e/utils": ["e2e/utils"], "@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"], @@ -74,6 +73,7 @@ "@nx/detox": ["packages/detox"], "@nx/devkit": ["packages/devkit"], "@nx/devkit/*": ["packages/devkit/*"], + "@nx/e2e/utils": ["e2e/utils"], "@nx/esbuild": ["packages/esbuild"], "@nx/eslint-plugin": ["packages/eslint-plugin/src"], "@nx/expo": ["packages/expo"],