diff --git a/e2e/angular-core/src/ng-add.test.ts b/e2e/angular-core/src/ng-add.test.ts index f466585ec7dc0..ccf834958d921 100644 --- a/e2e/angular-core/src/ng-add.test.ts +++ b/e2e/angular-core/src/ng-add.test.ts @@ -102,7 +102,7 @@ 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 - expect(packageJson.devDependencies['@nrwl/workspace']).not.toBeDefined(); + expect(packageJson.devDependencies['@nx/workspace']).not.toBeDefined(); // run ng add runNgAdd('@nrwl/angular', '--npm-scope projscope --default-base main'); @@ -133,7 +133,7 @@ describe('convert Angular CLI workspace to an Nx workspace', () => { watch: 'nx build --watch --configuration development', test: 'nx test', }); - expect(updatedPackageJson.devDependencies['@nrwl/workspace']).toBeDefined(); + expect(updatedPackageJson.devDependencies['@nx/workspace']).toBeDefined(); expect(updatedPackageJson.devDependencies['@angular/cli']).toBeDefined(); // check nx.json @@ -297,7 +297,7 @@ describe('convert Angular CLI workspace to an Nx workspace', () => { // check e2e project config const e2eProjectConfig = readJson(`apps/${project}-e2e/project.json`); expect(e2eProjectConfig.targets['cypress-run']).toEqual({ - executor: '@nrwl/cypress:cypress', + executor: '@nx/cypress:cypress', options: { devServerTarget: `${project}:serve`, cypressConfig: `apps/${e2eProject}/cypress.json`, @@ -309,7 +309,7 @@ describe('convert Angular CLI workspace to an Nx workspace', () => { }, }); expect(e2eProjectConfig.targets['cypress-open']).toEqual({ - executor: '@nrwl/cypress:cypress', + executor: '@nx/cypress:cypress', options: { watch: true, headless: false, @@ -317,7 +317,7 @@ describe('convert Angular CLI workspace to an Nx workspace', () => { }, }); expect(e2eProjectConfig.targets.e2e).toEqual({ - executor: '@nrwl/cypress:cypress', + executor: '@nx/cypress:cypress', options: { devServerTarget: `${project}:serve`, watch: true, @@ -364,7 +364,7 @@ describe('convert Angular CLI workspace to an Nx workspace', () => { // check e2e project config const e2eProjectConfig = readJson(`apps/${project}-e2e/project.json`); expect(e2eProjectConfig.targets['cypress-run']).toEqual({ - executor: '@nrwl/cypress:cypress', + executor: '@nx/cypress:cypress', options: { devServerTarget: `${project}:serve`, cypressConfig: `apps/${e2eProject}/cypress.config.ts`, @@ -376,7 +376,7 @@ describe('convert Angular CLI workspace to an Nx workspace', () => { }, }); expect(e2eProjectConfig.targets['cypress-open']).toEqual({ - executor: '@nrwl/cypress:cypress', + executor: '@nx/cypress:cypress', options: { watch: true, headless: false, @@ -384,7 +384,7 @@ describe('convert Angular CLI workspace to an Nx workspace', () => { }, }); expect(e2eProjectConfig.targets.e2e).toEqual({ - executor: '@nrwl/cypress:cypress', + executor: '@nx/cypress:cypress', options: { devServerTarget: `${project}:serve`, watch: true, @@ -411,7 +411,7 @@ describe('convert Angular CLI workspace to an Nx workspace', () => { const projectConfig = readJson(`apps/${project}/project.json`); expect(projectConfig.targets.lint).toStrictEqual({ - executor: '@nrwl/linter:eslint', + executor: '@nx/linter:eslint', options: { lintFilePatterns: [ `apps/${project}/src/**/*.ts`, diff --git a/packages/angular/.eslintrc.json b/packages/angular/.eslintrc.json index c58bbc02588d5..73db888ed1f11 100644 --- a/packages/angular/.eslintrc.json +++ b/packages/angular/.eslintrc.json @@ -19,7 +19,7 @@ "files": ["**/*.ts"], "excludedFiles": ["./src/migrations/**"], "rules": { - "no-restricted-imports": ["error", "@nrwl/workspace"] + "no-restricted-imports": ["error", "@nx/workspace"] } }, { diff --git a/packages/angular/generators.json b/packages/angular/generators.json index 90e67caa908e7..790ded7555f39 100644 --- a/packages/angular/generators.json +++ b/packages/angular/generators.json @@ -1,7 +1,7 @@ { "name": "Nx Angular", "version": "0.1", - "extends": ["@schematics/angular", "@nrwl/workspace"], + "extends": ["@schematics/angular", "@nx/workspace"], "schematics": { "add-linting": { "factory": "./src/generators/add-linting/compat", diff --git a/packages/angular/ng-package.json b/packages/angular/ng-package.json index d6605fd4ba81d..0a10730af0f58 100644 --- a/packages/angular/ng-package.json +++ b/packages/angular/ng-package.json @@ -7,7 +7,6 @@ "deleteDestPath": false, "allowedNonPeerDependencies": [ "@nx/", - "@nrwl/", "@angular-devkit", "@angular-eslint/", "@nguniversal/builders", diff --git a/packages/angular/src/builders/utilities/module-federation.ts b/packages/angular/src/builders/utilities/module-federation.ts index db627511834ff..c7eb08d2d6139 100644 --- a/packages/angular/src/builders/utilities/module-federation.ts +++ b/packages/angular/src/builders/utilities/module-federation.ts @@ -81,7 +81,7 @@ export function getStaticRemotes( mfeConfig = require(mfConfigPath); } catch { throw new Error( - `Could not load ${mfConfigPath}. Was this project generated with "@nrwl/angular:host"?` + `Could not load ${mfConfigPath}. Was this project generated with "@nx/angular:host"?` ); } diff --git a/packages/angular/src/generators/application/__snapshots__/application.spec.ts.snap b/packages/angular/src/generators/application/__snapshots__/application.spec.ts.snap index d3f472878787c..b16443a284b08 100644 --- a/packages/angular/src/generators/application/__snapshots__/application.spec.ts.snap +++ b/packages/angular/src/generators/application/__snapshots__/application.spec.ts.snap @@ -487,7 +487,7 @@ exports[`app nested should create project configs 1`] = ` "executor": "@angular-devkit/build-angular:dev-server", }, "serve-static": { - "executor": "@nrwl/web:file-server", + "executor": "@nx/web:file-server", "options": { "buildTarget": "my-dir-my-app:build", }, @@ -645,7 +645,7 @@ exports[`app not nested should create project configs 1`] = ` "executor": "@angular-devkit/build-angular:dev-server", }, "serve-static": { - "executor": "@nrwl/web:file-server", + "executor": "@nx/web:file-server", "options": { "buildTarget": "my-app:build", }, diff --git a/packages/angular/src/generators/application/application.spec.ts b/packages/angular/src/generators/application/application.spec.ts index 7aceaf62ce8df..54bbaa8f7d574 100644 --- a/packages/angular/src/generators/application/application.spec.ts +++ b/packages/angular/src/generators/application/application.spec.ts @@ -666,7 +666,7 @@ describe('app', () => { // should not update workspace configuration since --strict=true is the default const nxJson = readJson(appTree, 'nx.json'); expect( - nxJson.generators['@nrwl/angular:application'].strict + nxJson.generators['@nx/angular:application'].strict ).not.toBeDefined(); }); @@ -676,7 +676,7 @@ describe('app', () => { // check to see if the workspace configuration has been updated to turn off // strict mode by default in future applications const nxJson = readJson(appTree, 'nx.json'); - expect(nxJson.generators['@nrwl/angular:application'].strict).toBe(false); + expect(nxJson.generators['@nx/angular:application'].strict).toBe(false); }); }); @@ -712,7 +712,7 @@ describe('app', () => { // ASSERT expect(appTree.read('apps/app1/tailwind.config.js', 'utf-8')) .toMatchInlineSnapshot(` - "const { createGlobPatternsForDependencies } = require('@nrwl/angular/tailwind'); + "const { createGlobPatternsForDependencies } = require('@nx/angular/tailwind'); const { join } = require('path'); /** @type {import('tailwindcss').Config} */ diff --git a/packages/angular/src/generators/application/files/ng-module/src/app/nx-welcome.component.ts__tpl__ b/packages/angular/src/generators/application/files/ng-module/src/app/nx-welcome.component.ts__tpl__ index a81d4ca952918..47c3e2ed7ba49 100644 --- a/packages/angular/src/generators/application/files/ng-module/src/app/nx-welcome.component.ts__tpl__ +++ b/packages/angular/src/generators/application/files/ng-module/src/app/nx-welcome.component.ts__tpl__ @@ -722,9 +722,9 @@ import { Component, ViewEncapsulation } from '@angular/core'; Add UI library
# Generate UI lib
-nx g @nrwl/angular:lib ui
+nx g @nx/angular:lib ui
 # Add a component
-nx g @nrwl/angular:component button --project ui
+nx g @nx/angular:component button --project ui
diff --git a/packages/angular/src/generators/application/files/standalone-components/src/app/nx-welcome.component.ts__tpl__ b/packages/angular/src/generators/application/files/standalone-components/src/app/nx-welcome.component.ts__tpl__ index aa879b8da0a09..f7ca04c85c840 100644 --- a/packages/angular/src/generators/application/files/standalone-components/src/app/nx-welcome.component.ts__tpl__ +++ b/packages/angular/src/generators/application/files/standalone-components/src/app/nx-welcome.component.ts__tpl__ @@ -725,9 +725,9 @@ import { CommonModule } from '@angular/common'; Add UI library
# Generate UI lib
-nx g @nrwl/angular:lib ui
+nx g @nx/angular:lib ui
 # Add a component
-nx g @nrwl/angular:component button --project ui
+nx g @nx/angular:component button --project ui
diff --git a/packages/angular/src/generators/application/lib/add-e2e.ts b/packages/angular/src/generators/application/lib/add-e2e.ts index 6f979405b6be3..7e60957d8eb54 100644 --- a/packages/angular/src/generators/application/lib/add-e2e.ts +++ b/packages/angular/src/generators/application/lib/add-e2e.ts @@ -13,7 +13,7 @@ export async function addE2e(tree: Tree, options: NormalizedSchema) { removeScaffoldedE2e(tree, options, options.ngCliSchematicE2ERoot); if (options.e2eTestRunner === 'cypress') { - // TODO: This can call `@nrwl/web:static-config` generator when ready + // TODO: This can call `@nx/web:static-config` generator when ready addFileServerTarget(tree, options, 'serve-static'); await cypressProjectGenerator(tree, { @@ -33,11 +33,11 @@ function addFileServerTarget( options: NormalizedSchema, targetName: string ) { - addDependenciesToPackageJson(tree, {}, { '@nrwl/web': nxVersion }); + addDependenciesToPackageJson(tree, {}, { '@nx/web': nxVersion }); const projectConfig = readProjectConfiguration(tree, options.name); projectConfig.targets[targetName] = { - executor: '@nrwl/web:file-server', + executor: '@nx/web:file-server', options: { buildTarget: `${options.name}:build`, port: options.port, diff --git a/packages/angular/src/generators/application/lib/set-app-strict-default.ts b/packages/angular/src/generators/application/lib/set-app-strict-default.ts index 5199426c206b3..05cb50a5ae003 100644 --- a/packages/angular/src/generators/application/lib/set-app-strict-default.ts +++ b/packages/angular/src/generators/application/lib/set-app-strict-default.ts @@ -5,10 +5,10 @@ export function setApplicationStrictDefault(host: Tree, strict: boolean) { const nxJson = readNxJson(host); nxJson.generators = nxJson.generators || {}; - nxJson.generators['@nrwl/angular:application'] = - nxJson.generators['@nrwl/angular:application'] || {}; - nxJson.generators['@nrwl/angular:application'].strict = - nxJson.generators['@nrwl/angular:application'].strict ?? strict; + nxJson.generators['@nx/angular:application'] = + nxJson.generators['@nx/angular:application'] || {}; + nxJson.generators['@nx/angular:application'].strict = + nxJson.generators['@nx/angular:application'].strict ?? strict; updateNxJson(host, nxJson); } diff --git a/packages/angular/src/generators/convert-to-with-mf/__snapshots__/convert-to-with-mf.spec.ts.snap b/packages/angular/src/generators/convert-to-with-mf/__snapshots__/convert-to-with-mf.spec.ts.snap index 8ad2bd6467d43..7d350bd0137ce 100644 --- a/packages/angular/src/generators/convert-to-with-mf/__snapshots__/convert-to-with-mf.spec.ts.snap +++ b/packages/angular/src/generators/convert-to-with-mf/__snapshots__/convert-to-with-mf.spec.ts.snap @@ -1,21 +1,21 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`convertToWithMF should migrate a standard previous generated host config correctly 1`] = ` -"const { withModuleFederation } = require('@nrwl/angular/module-federation'); +"const { withModuleFederation } = require('@nx/angular/module-federation'); const config = require('./module-federation.config'); module.exports = withModuleFederation(config); " `; exports[`convertToWithMF should migrate a standard previous generated remote config correctly 1`] = ` -"const { withModuleFederation } = require('@nrwl/angular/module-federation'); +"const { withModuleFederation } = require('@nx/angular/module-federation'); const config = require('./module-federation.config'); module.exports = withModuleFederation(config); " `; exports[`convertToWithMF should migrate a standard previous generated remote config using object shared syntax correctly 1`] = ` -"const { withModuleFederation } = require('@nrwl/angular/module-federation'); +"const { withModuleFederation } = require('@nx/angular/module-federation'); const config = require('./module-federation.config'); module.exports = withModuleFederation(config); " diff --git a/packages/angular/src/generators/convert-to-with-mf/convert-to-with-mf.spec.ts b/packages/angular/src/generators/convert-to-with-mf/convert-to-with-mf.spec.ts index d731e6a75dcb5..9995910bc5cc6 100644 --- a/packages/angular/src/generators/convert-to-with-mf/convert-to-with-mf.spec.ts +++ b/packages/angular/src/generators/convert-to-with-mf/convert-to-with-mf.spec.ts @@ -19,7 +19,7 @@ describe('convertToWithMF', () => { sourceRoot: 'apps/host1/src', targets: { build: { - executor: '@nrwl/angular:webpack-browser', + executor: '@nx/angular:webpack-browser', options: { customWebpackConfig: { path: 'apps/host1/webpack.config.js', @@ -50,7 +50,7 @@ describe('convertToWithMF', () => { sourceRoot: 'apps/remote1/src', targets: { build: { - executor: '@nrwl/angular:webpack-browser', + executor: '@nx/angular:webpack-browser', options: { customWebpackConfig: { path: 'apps/remote1/webpack.config.js', @@ -81,7 +81,7 @@ describe('convertToWithMF', () => { sourceRoot: 'apps/remote1/src', targets: { build: { - executor: '@nrwl/angular:webpack-browser', + executor: '@nx/angular:webpack-browser', options: { customWebpackConfig: { path: 'apps/remote1/webpack.config.js', @@ -112,7 +112,7 @@ describe('convertToWithMF', () => { sourceRoot: 'apps/remote1/src', targets: { build: { - executor: '@nrwl/angular:webpack-browser', + executor: '@nx/angular:webpack-browser', options: { customWebpackConfig: { path: 'apps/remote1/webpack.config.js', @@ -141,7 +141,7 @@ describe('convertToWithMF', () => { sourceRoot: 'apps/host1/src', targets: { build: { - executor: '@nrwl/angular:webpack-browser', + executor: '@nx/angular:webpack-browser', options: { customWebpackConfig: { path: 'apps/host1/webpack.config.js', diff --git a/packages/angular/src/generators/convert-to-with-mf/convert-to-with-mf.test-data.ts b/packages/angular/src/generators/convert-to-with-mf/convert-to-with-mf.test-data.ts index 04ca8907cd496..ce071e5a575eb 100644 --- a/packages/angular/src/generators/convert-to-with-mf/convert-to-with-mf.test-data.ts +++ b/packages/angular/src/generators/convert-to-with-mf/convert-to-with-mf.test-data.ts @@ -4,12 +4,12 @@ const path = require('path'); const share = mf.share; /** - * We use the NX_TSCONFIG_PATH environment variable when using the @nrwl/angular:webpack-browser + * We use the NX_TSCONFIG_PATH environment variable when using the @nx/angular:webpack-browser * builder as it will generate a temporary tsconfig file which contains any required remappings of * shared libraries. * A remapping will occur when a library is buildable, as webpack needs to know the location of the * built files for the buildable library. - * This NX_TSCONFIG_PATH environment variable is set by the @nrwl/angular:webpack-browser and it contains + * This NX_TSCONFIG_PATH environment variable is set by the @nx/angular:webpack-browser and it contains * the location of the generated temporary tsconfig file. */ const tsConfigPath = @@ -95,12 +95,12 @@ const path = require('path'); const share = mf.share; /** - * We use the NX_TSCONFIG_PATH environment variable when using the @nrwl/angular:webpack-browser + * We use the NX_TSCONFIG_PATH environment variable when using the @nx/angular:webpack-browser * builder as it will generate a temporary tsconfig file which contains any required remappings of * shared libraries. * A remapping will occur when a library is buildable, as webpack needs to know the location of the * built files for the buildable library. - * This NX_TSCONFIG_PATH environment variable is set by the @nrwl/angular:webpack-browser and it contains + * This NX_TSCONFIG_PATH environment variable is set by the @nx/angular:webpack-browser and it contains * the location of the generated temporary tsconfig file. */ const tsConfigPath = @@ -188,12 +188,12 @@ const path = require('path'); const share = mf.share; /** - * We use the NX_TSCONFIG_PATH environment variable when using the @nrwl/angular:webpack-browser + * We use the NX_TSCONFIG_PATH environment variable when using the @nx/angular:webpack-browser * builder as it will generate a temporary tsconfig file which contains any required remappings of * shared libraries. * A remapping will occur when a library is buildable, as webpack needs to know the location of the * built files for the buildable library. - * This NX_TSCONFIG_PATH environment variable is set by the @nrwl/angular:webpack-browser and it contains + * This NX_TSCONFIG_PATH environment variable is set by the @nx/angular:webpack-browser and it contains * the location of the generated temporary tsconfig file. */ const tsConfigPath = @@ -270,12 +270,12 @@ const path = require('path'); const share = mf.share; /** - * We use the NX_TSCONFIG_PATH environment variable when using the @nrwl/angular:webpack-browser + * We use the NX_TSCONFIG_PATH environment variable when using the @nx/angular:webpack-browser * builder as it will generate a temporary tsconfig file which contains any required remappings of * shared libraries. * A remapping will occur when a library is buildable, as webpack needs to know the location of the * built files for the buildable library. - * This NX_TSCONFIG_PATH environment variable is set by the @nrwl/angular:webpack-browser and it contains + * This NX_TSCONFIG_PATH environment variable is set by the @nx/angular:webpack-browser and it contains * the location of the generated temporary tsconfig file. */ const tsConfigPath = @@ -363,12 +363,12 @@ const path = require('path'); const share = mf.share; /** - * We use the NX_TSCONFIG_PATH environment variable when using the @nrwl/angular:webpack-browser + * We use the NX_TSCONFIG_PATH environment variable when using the @nx/angular:webpack-browser * builder as it will generate a temporary tsconfig file which contains any required remappings of * shared libraries. * A remapping will occur when a library is buildable, as webpack needs to know the location of the * built files for the buildable library. - * This NX_TSCONFIG_PATH environment variable is set by the @nrwl/angular:webpack-browser and it contains + * This NX_TSCONFIG_PATH environment variable is set by the @nx/angular:webpack-browser and it contains * the location of the generated temporary tsconfig file. */ const tsConfigPath = diff --git a/packages/angular/src/generators/convert-to-with-mf/lib/__snapshots__/write-new-webpack-config.spec.ts.snap b/packages/angular/src/generators/convert-to-with-mf/lib/__snapshots__/write-new-webpack-config.spec.ts.snap index e3c044ee64a70..9e5cf9c98774d 100644 --- a/packages/angular/src/generators/convert-to-with-mf/lib/__snapshots__/write-new-webpack-config.spec.ts.snap +++ b/packages/angular/src/generators/convert-to-with-mf/lib/__snapshots__/write-new-webpack-config.spec.ts.snap @@ -2,7 +2,7 @@ exports[`writeNewWebpackConfig should convert config that is both remote and host correctly 1`] = ` [ - "const { withModuleFederation } = require('@nrwl/angular/module-federation'); + "const { withModuleFederation } = require('@nx/angular/module-federation'); const config = require('./module-federation.config'); module.exports = withModuleFederation(config);", " @@ -18,7 +18,7 @@ exports[`writeNewWebpackConfig should convert config that is both remote and hos exports[`writeNewWebpackConfig should convert config that is neither remote and host correctly 1`] = ` [ - "const { withModuleFederation } = require('@nrwl/angular/module-federation'); + "const { withModuleFederation } = require('@nx/angular/module-federation'); const config = require('./module-federation.config'); module.exports = withModuleFederation(config);", " @@ -30,7 +30,7 @@ exports[`writeNewWebpackConfig should convert config that is neither remote and exports[`writeNewWebpackConfig should convert host config correctly 1`] = ` [ - "const { withModuleFederation } = require('@nrwl/angular/module-federation'); + "const { withModuleFederation } = require('@nx/angular/module-federation'); const config = require('./module-federation.config'); module.exports = withModuleFederation(config);", " @@ -43,7 +43,7 @@ exports[`writeNewWebpackConfig should convert host config correctly 1`] = ` exports[`writeNewWebpackConfig should convert remote config correctly 1`] = ` [ - "const { withModuleFederation } = require('@nrwl/angular/module-federation'); + "const { withModuleFederation } = require('@nx/angular/module-federation'); const config = require('./module-federation.config'); module.exports = withModuleFederation(config);", " diff --git a/packages/angular/src/generators/convert-to-with-mf/lib/get-webpack-config-path.ts b/packages/angular/src/generators/convert-to-with-mf/lib/get-webpack-config-path.ts index c236c0b5f84e0..293ad2a98013e 100644 --- a/packages/angular/src/generators/convert-to-with-mf/lib/get-webpack-config-path.ts +++ b/packages/angular/src/generators/convert-to-with-mf/lib/get-webpack-config-path.ts @@ -7,7 +7,8 @@ export function getWebpackConfigPath( let pathToWebpackConfig = ''; for (const target of Object.values(project.targets ?? {})) { if ( - target.executor === '@nrwl/angular:webpack-browser' && + (target.executor === '@nx/angular:webpack-browser' || + target.executor === '@nrwl/angular:webpack-browser') && target.options.customWebpackConfig?.path ) { pathToWebpackConfig = target.options.customWebpackConfig?.path; diff --git a/packages/angular/src/generators/convert-to-with-mf/lib/write-new-webpack-config.ts b/packages/angular/src/generators/convert-to-with-mf/lib/write-new-webpack-config.ts index 7dee84dea38fd..175d8bdcab6ec 100644 --- a/packages/angular/src/generators/convert-to-with-mf/lib/write-new-webpack-config.ts +++ b/packages/angular/src/generators/convert-to-with-mf/lib/write-new-webpack-config.ts @@ -10,7 +10,7 @@ export function writeNewWebpackConfig( mfType: IsHostRemoteConfigResult, projectName: string ) { - const webpackConfig = `const { withModuleFederation } = require('@nrwl/angular/module-federation'); + const webpackConfig = `const { withModuleFederation } = require('@nx/angular/module-federation'); const config = require('./module-federation.config'); module.exports = withModuleFederation(config);`; diff --git a/packages/angular/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.ts b/packages/angular/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.ts index 9d04cabb36f25..155a871e10ff4 100755 --- a/packages/angular/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.ts +++ b/packages/angular/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.ts @@ -14,8 +14,8 @@ export async function conversionGenerator( * to perform in order to convert a project from TSLint to ESLint, as well as some * extensibility points for adjusting the behavior on a per package basis. * - * E.g. @nrwl/angular projects might need to make different changes to the final - * ESLint config when compared with @nrwl/next projects. + * E.g. @nx/angular projects might need to make different changes to the final + * ESLint config when compared with @nx/next projects. * * See the ProjectConverter implementation for a full breakdown of what it does. */ @@ -82,7 +82,7 @@ export async function conversionGenerator( /** * Store user preferences for the collection */ - projectConverter.setDefaults('@nrwl/angular', defaults); + projectConverter.setDefaults('@nx/angular', defaults); /** * If the Angular project is an app which has an e2e project, try and convert that as well. diff --git a/packages/angular/src/generators/cypress-component-configuration/cypress-component-configuration.spec.ts b/packages/angular/src/generators/cypress-component-configuration/cypress-component-configuration.spec.ts index b99de223cc275..75b3d27890221 100644 --- a/packages/angular/src/generators/cypress-component-configuration/cypress-component-configuration.spec.ts +++ b/packages/angular/src/generators/cypress-component-configuration/cypress-component-configuration.spec.ts @@ -218,7 +218,7 @@ describe('Cypress Component Testing Configuration', () => { "Error trying to find build configuration. Try manually specifying the build target with the --build-target flag. Provided project? fancy-lib Provided build target? fancy-app:build - Provided Executors? @nrwl/angular:webpack-browser, @angular-devkit/build-angular:browser" + Provided Executors? @nx/angular:webpack-browser, @nrwl/angular:webpack-browser, @angular-devkit/build-angular:browser" `); }); it('should use own project config', async () => { diff --git a/packages/angular/src/generators/cypress-component-configuration/cypress-component-configuration.ts b/packages/angular/src/generators/cypress-component-configuration/cypress-component-configuration.ts index 632e3f27407b9..9c6437a2135c2 100644 --- a/packages/angular/src/generators/cypress-component-configuration/cypress-component-configuration.ts +++ b/packages/angular/src/generators/cypress-component-configuration/cypress-component-configuration.ts @@ -108,6 +108,7 @@ async function updateProjectConfig( project: options.project, buildTarget: options.buildTarget, validExecutorNames: new Set([ + '@nx/angular:webpack-browser', '@nrwl/angular:webpack-browser', '@angular-devkit/build-angular:browser', ]), diff --git a/packages/angular/src/generators/cypress-component-configuration/files/cypress.config.ts__tpl__ b/packages/angular/src/generators/cypress-component-configuration/files/cypress.config.ts__tpl__ index ade9ea3c0eeb5..7287d91cd670c 100644 --- a/packages/angular/src/generators/cypress-component-configuration/files/cypress.config.ts__tpl__ +++ b/packages/angular/src/generators/cypress-component-configuration/files/cypress.config.ts__tpl__ @@ -1,5 +1,5 @@ import { defineConfig } from 'cypress'; -import { nxComponentTestingPreset } from '@nrwl/angular/plugins/component-testing'; +import { nxComponentTestingPreset } from '@nx/angular/plugins/component-testing'; export default defineConfig({ component: nxComponentTestingPreset(__filename), diff --git a/packages/angular/src/generators/host/__snapshots__/host.spec.ts.snap b/packages/angular/src/generators/host/__snapshots__/host.spec.ts.snap index 604c605858c82..e203117311d2c 100644 --- a/packages/angular/src/generators/host/__snapshots__/host.spec.ts.snap +++ b/packages/angular/src/generators/host/__snapshots__/host.spec.ts.snap @@ -139,9 +139,7 @@ exports[`Host App Generator --ssr should generate the correct files 6`] = ` `; exports[`Host App Generator --ssr should generate the correct files 7`] = ` -"const { - withModuleFederationForSSR, -} = require('@nrwl/angular/module-federation'); +"const { withModuleFederationForSSR } = require('@nx/angular/module-federation'); const config = require('./module-federation.config'); module.exports = withModuleFederationForSSR(config); " @@ -176,7 +174,7 @@ exports[`Host App Generator --ssr should generate the correct files 9`] = ` "dependsOn": [ "build", ], - "executor": "@nrwl/angular:webpack-server", + "executor": "@nx/angular:webpack-server", "options": { "customWebpackConfig": { "path": "apps/test/webpack.server.config.js", @@ -201,26 +199,26 @@ exports[`Host App Generator --ssr should generate the correct files 10`] = ` }, }, "defaultConfiguration": "development", - "executor": "@nrwl/angular:module-federation-dev-ssr", + "executor": "@nx/angular:module-federation-dev-ssr", } `; exports[`Host App Generator should generate a host app with a remote 1`] = ` -"const { withModuleFederation } = require('@nrwl/angular/module-federation'); +"const { withModuleFederation } = require('@nx/angular/module-federation'); const config = require('./module-federation.config'); module.exports = withModuleFederation(config); " `; exports[`Host App Generator should generate a host app with a remote 2`] = ` -"const { withModuleFederation } = require('@nrwl/angular/module-federation'); +"const { withModuleFederation } = require('@nx/angular/module-federation'); const config = require('./module-federation.config'); module.exports = withModuleFederation(config); " `; exports[`Host App Generator should generate a host app with no remotes 1`] = ` -"const { withModuleFederation } = require('@nrwl/angular/module-federation'); +"const { withModuleFederation } = require('@nx/angular/module-federation'); const config = require('./module-federation.config'); module.exports = withModuleFederation(config); " diff --git a/packages/angular/src/generators/host/files/webpack.server.config.js__tmpl__ b/packages/angular/src/generators/host/files/webpack.server.config.js__tmpl__ index a859109e6d32d..a5f4e5c712117 100644 --- a/packages/angular/src/generators/host/files/webpack.server.config.js__tmpl__ +++ b/packages/angular/src/generators/host/files/webpack.server.config.js__tmpl__ @@ -1,3 +1,3 @@ -const { withModuleFederationForSSR } = require('@nrwl/angular/module-federation'); +const { withModuleFederationForSSR } = require('@nx/angular/module-federation'); const config = require('./module-federation.config'); -module.exports = withModuleFederationForSSR(config) \ No newline at end of file +module.exports = withModuleFederationForSSR(config) diff --git a/packages/angular/src/generators/host/lib/add-ssr.ts b/packages/angular/src/generators/host/lib/add-ssr.ts index 2738ea958899f..abac3ea74c9ba 100644 --- a/packages/angular/src/generators/host/lib/add-ssr.ts +++ b/packages/angular/src/generators/host/lib/add-ssr.ts @@ -50,13 +50,13 @@ export async function addSsr(tree: Tree, options: Schema, appName: string) { // update project.json project = readProjectConfiguration(tree, appName); - project.targets.server.executor = '@nrwl/angular:webpack-server'; + project.targets.server.executor = '@nx/angular:webpack-server'; project.targets.server.options.customWebpackConfig = { path: joinPathFragments(project.root, 'webpack.server.config.js'), }; project.targets['serve-ssr'].executor = - '@nrwl/angular:module-federation-dev-ssr'; + '@nx/angular:module-federation-dev-ssr'; updateProjectConfiguration(tree, appName, project); diff --git a/packages/angular/src/generators/init/init.spec.ts b/packages/angular/src/generators/init/init.spec.ts index d9dce57f5260f..7c4906b4cdcfc 100644 --- a/packages/angular/src/generators/init/init.spec.ts +++ b/packages/angular/src/generators/init/init.spec.ts @@ -160,10 +160,10 @@ describe('init', () => { const { generators } = readJson(tree, 'nx.json'); // ASSERT - expect(generators['@nrwl/angular:application'].unitTestRunner).toEqual( + expect(generators['@nx/angular:application'].unitTestRunner).toEqual( 'jest' ); - expect(generators['@nrwl/angular:library'].unitTestRunner).toEqual( + expect(generators['@nx/angular:library'].unitTestRunner).toEqual( 'jest' ); }); @@ -200,7 +200,7 @@ describe('init', () => { const { generators } = readJson(tree, 'nx.json'); // ASSERT - expect(generators['@nrwl/angular:application'].e2eTestRunner).toEqual( + expect(generators['@nx/angular:application'].e2eTestRunner).toEqual( 'cypress' ); }); @@ -220,10 +220,8 @@ describe('init', () => { const { generators } = readJson(tree, 'nx.json'); // ASSERT - expect(generators['@nrwl/angular:application'].linter).toEqual( - 'eslint' - ); - expect(generators['@nrwl/angular:library'].linter).toEqual('eslint'); + expect(generators['@nx/angular:application'].linter).toEqual('eslint'); + expect(generators['@nx/angular:library'].linter).toEqual('eslint'); }); }); @@ -239,8 +237,8 @@ describe('init', () => { const { generators } = readJson(tree, 'nx.json'); // ASSERT - expect(generators['@nrwl/angular:application'].linter).toEqual('none'); - expect(generators['@nrwl/angular:library'].linter).toEqual('none'); + expect(generators['@nx/angular:application'].linter).toEqual('none'); + expect(generators['@nx/angular:library'].linter).toEqual('none'); }); }); }); @@ -514,10 +512,10 @@ bar const { generators } = readJson(tree, 'nx.json'); // ASSERT - expect( - generators['@nrwl/angular:application'].unitTestRunner - ).toEqual('jest'); - expect(generators['@nrwl/angular:library'].unitTestRunner).toEqual( + expect(generators['@nx/angular:application'].unitTestRunner).toEqual( + 'jest' + ); + expect(generators['@nx/angular:library'].unitTestRunner).toEqual( 'jest' ); }); @@ -554,7 +552,7 @@ bar const { generators } = readJson(tree, 'nx.json'); // ASSERT - expect(generators['@nrwl/angular:application'].e2eTestRunner).toEqual( + expect(generators['@nx/angular:application'].e2eTestRunner).toEqual( 'cypress' ); }); @@ -574,10 +572,10 @@ bar const { generators } = readJson(tree, 'nx.json'); // ASSERT - expect(generators['@nrwl/angular:application'].linter).toEqual( + expect(generators['@nx/angular:application'].linter).toEqual( 'eslint' ); - expect(generators['@nrwl/angular:library'].linter).toEqual('eslint'); + expect(generators['@nx/angular:library'].linter).toEqual('eslint'); }); }); @@ -593,10 +591,8 @@ bar const { generators } = readJson(tree, 'nx.json'); // ASSERT - expect(generators['@nrwl/angular:application'].linter).toEqual( - 'none' - ); - expect(generators['@nrwl/angular:library'].linter).toEqual('none'); + expect(generators['@nx/angular:application'].linter).toEqual('none'); + expect(generators['@nx/angular:library'].linter).toEqual('none'); }); }); }); diff --git a/packages/angular/src/generators/init/init.ts b/packages/angular/src/generators/init/init.ts index 7382eceec0a37..e2c2eb3426fe2 100755 --- a/packages/angular/src/generators/init/init.ts +++ b/packages/angular/src/generators/init/init.ts @@ -102,21 +102,21 @@ function setDefaults(host: Tree, options: Schema) { const nxJson = readNxJson(host); nxJson.generators = nxJson.generators || {}; - nxJson.generators['@nrwl/angular:application'] = { + nxJson.generators['@nx/angular:application'] = { style: options.style, linter: options.linter, unitTestRunner: options.unitTestRunner, e2eTestRunner: options.e2eTestRunner, - ...(nxJson.generators['@nrwl/angular:application'] || {}), + ...(nxJson.generators['@nx/angular:application'] || {}), }; - nxJson.generators['@nrwl/angular:library'] = { + nxJson.generators['@nx/angular:library'] = { linter: options.linter, unitTestRunner: options.unitTestRunner, - ...(nxJson.generators['@nrwl/angular:library'] || {}), + ...(nxJson.generators['@nx/angular:library'] || {}), }; - nxJson.generators['@nrwl/angular:component'] = { + nxJson.generators['@nx/angular:component'] = { style: options.style, - ...(nxJson.generators['@nrwl/angular:component'] || {}), + ...(nxJson.generators['@nx/angular:component'] || {}), }; updateNxJson(host, nxJson); diff --git a/packages/angular/src/generators/library/lib/add-project.ts b/packages/angular/src/generators/library/lib/add-project.ts index dc1da88c238ef..e9934cfca433c 100644 --- a/packages/angular/src/generators/library/lib/add-project.ts +++ b/packages/angular/src/generators/library/lib/add-project.ts @@ -19,8 +19,8 @@ export function addProject( libraryOptions.buildable || libraryOptions.publishable ? { executor: libraryOptions.publishable - ? '@nrwl/angular:package' - : '@nrwl/angular:ng-packagr-lite', + ? '@nx/angular:package' + : '@nx/angular:ng-packagr-lite', outputs: ['{workspaceRoot}/dist/{projectRoot}'], options: { project: `${libraryOptions.projectRoot}/ng-package.json`, diff --git a/packages/angular/src/generators/library/lib/enable-strict-type-checking.ts b/packages/angular/src/generators/library/lib/enable-strict-type-checking.ts index e0428f19c61be..8ada56d655e65 100644 --- a/packages/angular/src/generators/library/lib/enable-strict-type-checking.ts +++ b/packages/angular/src/generators/library/lib/enable-strict-type-checking.ts @@ -19,11 +19,11 @@ export function setLibraryStrictDefault(host: Tree, isStrict: boolean) { nxJson.generators = nxJson.generators || {}; - nxJson.generators['@nrwl/angular:library'] = - nxJson.generators['@nrwl/angular:library'] || {}; + nxJson.generators['@nx/angular:library'] = + nxJson.generators['@nx/angular:library'] || {}; - nxJson.generators['@nrwl/angular:library'].strict = - nxJson.generators['@nrwl/angular:library'].strict ?? isStrict; + nxJson.generators['@nx/angular:library'].strict = + nxJson.generators['@nx/angular:library'].strict ?? isStrict; updateNxJson(host, nxJson); } diff --git a/packages/angular/src/generators/library/library.spec.ts b/packages/angular/src/generators/library/library.spec.ts index de8a53dfdb93b..913bcd2a53775 100644 --- a/packages/angular/src/generators/library/library.spec.ts +++ b/packages/angular/src/generators/library/library.spec.ts @@ -1078,7 +1078,7 @@ describe('lib', () => { // check to see if the workspace configuration has been updated to use strict // mode by default in future libraries - expect(generators['@nrwl/angular:library'].strict).not.toBeDefined(); + expect(generators['@nx/angular:library'].strict).not.toBeDefined(); }); it('should set defaults when --strict=false', async () => { @@ -1093,7 +1093,7 @@ describe('lib', () => { // check to see if the workspace configuration has been updated to turn off // strict mode by default in future libraries const { generators } = readJson(tree, 'nx.json'); - expect(generators['@nrwl/angular:library'].strict).toBe(false); + expect(generators['@nx/angular:library'].strict).toBe(false); }); }); @@ -1234,7 +1234,7 @@ describe('lib', () => { // ASSERT expect(tree.read('libs/my-lib/tailwind.config.js', 'utf-8')) .toMatchInlineSnapshot(` - "const { createGlobPatternsForDependencies } = require('@nrwl/angular/tailwind'); + "const { createGlobPatternsForDependencies } = require('@nx/angular/tailwind'); const { join } = require('path'); /** @type {import('tailwindcss').Config} */ diff --git a/packages/angular/src/generators/move/move.spec.ts b/packages/angular/src/generators/move/move.spec.ts index 5a731d6bbac34..ffb74dbc35960 100644 --- a/packages/angular/src/generators/move/move.spec.ts +++ b/packages/angular/src/generators/move/move.spec.ts @@ -6,7 +6,7 @@ import { UnitTestRunner } from '../../utils/test-runners'; import { generateTestLibrary } from '../utils/testing'; import { angularMoveGenerator } from './move'; -describe('@nrwl/angular:move', () => { +describe('@nx/angular:move', () => { let tree: Tree; beforeEach(async () => { diff --git a/packages/angular/src/generators/move/move.ts b/packages/angular/src/generators/move/move.ts index 029751ff72296..530ba72fece44 100644 --- a/packages/angular/src/generators/move/move.ts +++ b/packages/angular/src/generators/move/move.ts @@ -8,7 +8,7 @@ import { Schema } from './schema'; * Moves an Angular lib/app to another folder (and renames it in the process) * * @remarks It's important to note that `updateModuleName` is done after the update - * to the workspace, so it can't use the same tricks as the `@nrwl/workspace` rules + * to the workspace, so it can't use the same tricks as the `@nx/workspace` rules * to get the before and after names and paths. */ export async function angularMoveGenerator( diff --git a/packages/angular/src/generators/ng-add/__snapshots__/migrate-from-angular-cli.spec.ts.snap b/packages/angular/src/generators/ng-add/__snapshots__/migrate-from-angular-cli.spec.ts.snap index a353287623177..46a168e13bf75 100644 --- a/packages/angular/src/generators/ng-add/__snapshots__/migrate-from-angular-cli.spec.ts.snap +++ b/packages/angular/src/generators/ng-add/__snapshots__/migrate-from-angular-cli.spec.ts.snap @@ -53,7 +53,7 @@ exports[`workspace move to nx layout should create a root eslint config 1`] = ` "*.jsx", ], "rules": { - "@nrwl/nx/enforce-module-boundaries": [ + "@nx/nx/enforce-module-boundaries": [ "error", { "allow": [], @@ -72,7 +72,7 @@ exports[`workspace move to nx layout should create a root eslint config 1`] = ` }, ], "plugins": [ - "@nrwl/nx", + "@nx/nx", ], "root": true, } diff --git a/packages/angular/src/generators/ng-add/migrate-from-angular-cli.spec.ts b/packages/angular/src/generators/ng-add/migrate-from-angular-cli.spec.ts index 67bf4cbb04fc8..cccf256a10c3a 100644 --- a/packages/angular/src/generators/ng-add/migrate-from-angular-cli.spec.ts +++ b/packages/angular/src/generators/ng-add/migrate-from-angular-cli.spec.ts @@ -213,7 +213,7 @@ describe('workspace', () => { expect(tree.exists('angular.json')).toBe(false); }); - it('should set the default collection to @nrwl/angular', async () => { + it('should set the default collection to @nx/angular', async () => { await migrateFromAngularCli(tree, {}); expect( readJson(tree, 'nx.json').cli?.defaultCollection diff --git a/packages/angular/src/generators/ng-add/migrators/builders/angular-devkit-ng-packagr.migrator.ts b/packages/angular/src/generators/ng-add/migrators/builders/angular-devkit-ng-packagr.migrator.ts index f0fbfcf821a74..51bca4acf5cfe 100644 --- a/packages/angular/src/generators/ng-add/migrators/builders/angular-devkit-ng-packagr.migrator.ts +++ b/packages/angular/src/generators/ng-add/migrators/builders/angular-devkit-ng-packagr.migrator.ts @@ -58,7 +58,7 @@ export class AngularDevkitNgPackagrMigrator extends BuilderMigrator { targetName: string, target: TargetConfiguration ): void { - target.executor = '@nrwl/angular:package'; + target.executor = '@nx/angular:package'; if ( !target.options && diff --git a/packages/angular/src/generators/ng-add/migrators/builders/angular-eslint-lint.migrator.ts b/packages/angular/src/generators/ng-add/migrators/builders/angular-eslint-lint.migrator.ts index 610f86626de7d..eabbd9808c5d9 100644 --- a/packages/angular/src/generators/ng-add/migrators/builders/angular-eslint-lint.migrator.ts +++ b/packages/angular/src/generators/ng-add/migrators/builders/angular-eslint-lint.migrator.ts @@ -69,7 +69,7 @@ export class AngularEslintLintMigrator extends BuilderMigrator { targetName: string, target: TargetConfiguration ): Promise { - target.executor = '@nrwl/linter:eslint'; + target.executor = '@nx/linter:eslint'; if (!target.options) { this.logger.warn( diff --git a/packages/angular/src/generators/ng-add/migrators/projects/__snapshots__/e2e.migrator.spec.ts.snap b/packages/angular/src/generators/ng-add/migrators/projects/__snapshots__/e2e.migrator.spec.ts.snap index 0271e05c55914..9e51d165ab2d8 100644 --- a/packages/angular/src/generators/ng-add/migrators/projects/__snapshots__/e2e.migrator.spec.ts.snap +++ b/packages/angular/src/generators/ng-add/migrators/projects/__snapshots__/e2e.migrator.spec.ts.snap @@ -2,7 +2,7 @@ exports[`e2e migrator cypress with project root at "" cypress version >=10 should add paths to the e2e config from the global config when they differ from the nx preset defaults 1`] = ` "import { defineConfig } from 'cypress'; -import { nxE2EPreset } from '@nrwl/cypress/plugins/cypress-preset'; +import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset'; export default defineConfig({ fixturesFolder: 'src/my-fixtures', @@ -25,7 +25,7 @@ export default defineConfig({ exports[`e2e migrator cypress with project root at "" cypress version >=10 should keep paths in the e2e config when they differ from the nx preset defaults 1`] = ` "import { defineConfig } from 'cypress'; -import { nxE2EPreset } from '@nrwl/cypress/plugins/cypress-preset'; +import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset'; export default defineConfig({ e2e: {...nxE2EPreset(__dirname), @@ -38,7 +38,7 @@ export default defineConfig({ exports[`e2e migrator cypress with project root at "" cypress version >=10 should remove paths in the e2e config when they match the nx preset defaults 1`] = ` "import { defineConfig } from 'cypress'; -import { nxE2EPreset } from '@nrwl/cypress/plugins/cypress-preset'; +import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset'; export default defineConfig({ e2e: {...nxE2EPreset(__dirname), @@ -49,7 +49,7 @@ export default defineConfig({ exports[`e2e migrator cypress with project root at "" cypress version >=10 should update e2e config with the nx preset 1`] = ` "import { defineConfig } from 'cypress'; -import { nxE2EPreset } from '@nrwl/cypress/plugins/cypress-preset'; +import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset'; export default defineConfig({ e2e: {...nxE2EPreset(__dirname), @@ -60,7 +60,7 @@ import { nxE2EPreset } from '@nrwl/cypress/plugins/cypress-preset'; exports[`e2e migrator cypress with project root at "" cypress version >=10 should update paths in the config 1`] = ` "import { defineConfig } from 'cypress'; -import { nxE2EPreset } from '@nrwl/cypress/plugins/cypress-preset'; +import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset'; export default defineConfig({ fixturesFolder: 'src/fixtures', @@ -78,7 +78,7 @@ export default defineConfig({ exports[`e2e migrator cypress with project root at "projects/app1" cypress version >=10 should add paths to the e2e config from the global config when they differ from the nx preset defaults 1`] = ` "import { defineConfig } from 'cypress'; -import { nxE2EPreset } from '@nrwl/cypress/plugins/cypress-preset'; +import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset'; export default defineConfig({ fixturesFolder: 'src/my-fixtures', @@ -101,7 +101,7 @@ export default defineConfig({ exports[`e2e migrator cypress with project root at "projects/app1" cypress version >=10 should keep paths in the e2e config when they differ from the nx preset defaults 1`] = ` "import { defineConfig } from 'cypress'; -import { nxE2EPreset } from '@nrwl/cypress/plugins/cypress-preset'; +import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset'; export default defineConfig({ e2e: {...nxE2EPreset(__dirname), @@ -114,7 +114,7 @@ export default defineConfig({ exports[`e2e migrator cypress with project root at "projects/app1" cypress version >=10 should remove paths in the e2e config when they match the nx preset defaults 1`] = ` "import { defineConfig } from 'cypress'; -import { nxE2EPreset } from '@nrwl/cypress/plugins/cypress-preset'; +import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset'; export default defineConfig({ e2e: {...nxE2EPreset(__dirname), @@ -125,7 +125,7 @@ export default defineConfig({ exports[`e2e migrator cypress with project root at "projects/app1" cypress version >=10 should update e2e config with the nx preset 1`] = ` "import { defineConfig } from 'cypress'; -import { nxE2EPreset } from '@nrwl/cypress/plugins/cypress-preset'; +import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset'; export default defineConfig({ e2e: {...nxE2EPreset(__dirname), @@ -136,7 +136,7 @@ import { nxE2EPreset } from '@nrwl/cypress/plugins/cypress-preset'; exports[`e2e migrator cypress with project root at "projects/app1" cypress version >=10 should update paths in the config 1`] = ` "import { defineConfig } from 'cypress'; -import { nxE2EPreset } from '@nrwl/cypress/plugins/cypress-preset'; +import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset'; export default defineConfig({ fixturesFolder: 'src/fixtures', diff --git a/packages/angular/src/generators/ng-add/migrators/projects/app.migrator.spec.ts b/packages/angular/src/generators/ng-add/migrators/projects/app.migrator.spec.ts index 0cc791ae21c84..65a3e313e80a3 100644 --- a/packages/angular/src/generators/ng-add/migrators/projects/app.migrator.spec.ts +++ b/packages/angular/src/generators/ng-add/migrators/projects/app.migrator.spec.ts @@ -877,7 +877,7 @@ describe('app migrator', () => { const { targets } = readProjectConfiguration(tree, 'app1'); expect(targets.lint).toStrictEqual({ - executor: '@nrwl/linter:eslint', + executor: '@nx/linter:eslint', options: { lintFilePatterns: ['apps/app1/**/*.ts', 'apps/app1/**/*.html'], }, @@ -903,7 +903,7 @@ describe('app migrator', () => { const { targets } = readProjectConfiguration(tree, 'app1'); expect(targets.myCustomLintTarget).toStrictEqual({ - executor: '@nrwl/linter:eslint', + executor: '@nx/linter:eslint', options: { lintFilePatterns: ['apps/app1/**/*.ts', 'apps/app1/**/*.html'], }, @@ -930,7 +930,7 @@ describe('app migrator', () => { const { targets } = readProjectConfiguration(tree, 'app1'); expect(targets.lint).toStrictEqual({ - executor: '@nrwl/linter:eslint', + executor: '@nx/linter:eslint', options: { eslintConfig: 'apps/app1/.eslintrc.json', lintFilePatterns: ['apps/app1/**/*.ts', 'apps/app1/**/*.html'], @@ -945,7 +945,7 @@ describe('app migrator', () => { overrides: [ { files: ['*.ts', '*.tsx'], - extends: ['plugin:@nrwl/nx/typescript'], + extends: ['plugin:@nx/nx/typescript'], rules: { '@typescript-eslint/await-thenable': 'error' }, }, ], @@ -969,7 +969,7 @@ describe('app migrator', () => { const { targets } = readProjectConfiguration(tree, 'app1'); expect(targets.lint).toStrictEqual({ - executor: '@nrwl/linter:eslint', + executor: '@nx/linter:eslint', options: { eslintConfig: 'apps/app1/.eslintrc.json', hasTypeAwareRules: true, diff --git a/packages/angular/src/generators/ng-add/migrators/projects/e2e.migrator.spec.ts b/packages/angular/src/generators/ng-add/migrators/projects/e2e.migrator.spec.ts index 00f1dc016d3f5..2103b73204f11 100644 --- a/packages/angular/src/generators/ng-add/migrators/projects/e2e.migrator.spec.ts +++ b/packages/angular/src/generators/ng-add/migrators/projects/e2e.migrator.spec.ts @@ -544,7 +544,7 @@ describe('e2e migrator', () => { projectType: 'application', targets: { e2e: { - executor: '@nrwl/cypress:cypress', + executor: '@nx/cypress:cypress', options: { cypressConfig: 'apps/app1-e2e/cypress.json' }, }, }, @@ -610,15 +610,15 @@ describe('e2e migrator', () => { projectType: 'application', targets: { 'cypress-run': { - executor: '@nrwl/cypress:cypress', + executor: '@nx/cypress:cypress', options: { cypressConfig: 'apps/app1-e2e/cypress.json' }, }, 'cypress-open': { - executor: '@nrwl/cypress:cypress', + executor: '@nx/cypress:cypress', options: { cypressConfig: 'apps/app1-e2e/cypress.json' }, }, e2e: { - executor: '@nrwl/cypress:cypress', + executor: '@nx/cypress:cypress', options: { cypressConfig: 'apps/app1-e2e/cypress.json' }, }, }, @@ -664,18 +664,18 @@ describe('e2e migrator', () => { projectType: 'application', targets: { 'cypress-run': { - executor: '@nrwl/cypress:cypress', + executor: '@nx/cypress:cypress', options: { cypressConfig: 'apps/app1-e2e/cypress.json', tsConfig: 'apps/app1-e2e/tsconfig.json', }, }, 'cypress-open': { - executor: '@nrwl/cypress:cypress', + executor: '@nx/cypress:cypress', options: { cypressConfig: 'apps/app1-e2e/cypress.json' }, }, e2e: { - executor: '@nrwl/cypress:cypress', + executor: '@nx/cypress:cypress', options: { cypressConfig: 'apps/app1-e2e/cypress.json', tsConfig: 'apps/app1-e2e/tsconfig.json', diff --git a/packages/angular/src/generators/ng-add/migrators/projects/e2e.migrator.ts b/packages/angular/src/generators/ng-add/migrators/projects/e2e.migrator.ts index cc1c25499eae6..4f39e9bdedd0e 100644 --- a/packages/angular/src/generators/ng-add/migrators/projects/e2e.migrator.ts +++ b/packages/angular/src/generators/ng-add/migrators/projects/e2e.migrator.ts @@ -459,7 +459,7 @@ export class E2eMigrator extends ProjectMigrator { ): TargetConfiguration { const updatedTarget = { ...existingTarget, - executor: '@nrwl/cypress:cypress', + executor: '@nx/cypress:cypress', options: { ...existingTarget.options, cypressConfig, @@ -781,7 +781,7 @@ export class E2eMigrator extends ProjectMigrator { sourceFile, configFilePath, 'nxE2EPreset', - '@nrwl/cypress/plugins/cypress-preset' + '@nx/cypress/plugins/cypress-preset' ); // update recorder with the new content from the file recorder.setContentToFileContent(); diff --git a/packages/angular/src/generators/ng-add/migrators/projects/lib.migrator.spec.ts b/packages/angular/src/generators/ng-add/migrators/projects/lib.migrator.spec.ts index effd824d78a63..713af801e0abf 100644 --- a/packages/angular/src/generators/ng-add/migrators/projects/lib.migrator.spec.ts +++ b/packages/angular/src/generators/ng-add/migrators/projects/lib.migrator.spec.ts @@ -570,7 +570,7 @@ describe('lib migrator', () => { const { targets } = readProjectConfiguration(tree, 'lib1'); expect(targets.build).toStrictEqual({ - executor: '@nrwl/angular:package', + executor: '@nx/angular:package', options: { project: 'libs/lib1/ng-package.json' }, configurations: { production: { tsConfig: 'libs/lib1/tsconfig.lib.prod.json' }, @@ -602,7 +602,7 @@ describe('lib migrator', () => { const { targets } = readProjectConfiguration(tree, 'lib1'); expect(targets.myCustomBuildTarget).toStrictEqual({ - executor: '@nrwl/angular:package', + executor: '@nx/angular:package', options: { project: 'libs/lib1/ng-package.json' }, configurations: { production: { tsConfig: 'libs/lib1/tsconfig.lib.prod.json' }, @@ -639,7 +639,7 @@ describe('lib migrator', () => { const { targets } = readProjectConfiguration(tree, 'lib1'); expect(targets.build).toStrictEqual({ - executor: '@nrwl/angular:package', + executor: '@nx/angular:package', configurations: { production: { project: 'libs/lib1/ng-package.json', @@ -677,7 +677,7 @@ describe('lib migrator', () => { const { targets } = readProjectConfiguration(tree, 'lib1'); expect(targets.build).toStrictEqual({ - executor: '@nrwl/angular:package', + executor: '@nx/angular:package', options: { project: 'libs/lib1/ng-package.json', tsConfig: 'libs/lib1/tsconfig.lib.json', @@ -710,7 +710,7 @@ describe('lib migrator', () => { const { targets } = readProjectConfiguration(tree, 'lib1'); expect(targets.lint).toStrictEqual({ - executor: '@nrwl/linter:eslint', + executor: '@nx/linter:eslint', options: { lintFilePatterns: ['libs/lib1/**/*.ts', 'libs/lib1/**/*.html'], }, @@ -739,7 +739,7 @@ describe('lib migrator', () => { const { targets } = readProjectConfiguration(tree, 'lib1'); expect(targets.myCustomLintTarget).toStrictEqual({ - executor: '@nrwl/linter:eslint', + executor: '@nx/linter:eslint', options: { lintFilePatterns: ['libs/lib1/**/*.ts', 'libs/lib1/**/*.html'], }, @@ -769,7 +769,7 @@ describe('lib migrator', () => { const { targets } = readProjectConfiguration(tree, 'lib1'); expect(targets.lint).toStrictEqual({ - executor: '@nrwl/linter:eslint', + executor: '@nx/linter:eslint', options: { eslintConfig: 'libs/lib1/.eslintrc.json', lintFilePatterns: ['libs/lib1/**/*.ts', 'libs/lib1/**/*.html'], @@ -784,7 +784,7 @@ describe('lib migrator', () => { overrides: [ { files: ['*.ts', '*.tsx'], - extends: ['plugin:@nrwl/nx/typescript'], + extends: ['plugin:@nx/nx/typescript'], rules: { '@typescript-eslint/await-thenable': 'error' }, }, ], @@ -811,7 +811,7 @@ describe('lib migrator', () => { const { targets } = readProjectConfiguration(tree, 'lib1'); expect(targets.lint).toStrictEqual({ - executor: '@nrwl/linter:eslint', + executor: '@nx/linter:eslint', options: { eslintConfig: 'libs/lib1/.eslintrc.json', hasTypeAwareRules: true, diff --git a/packages/angular/src/generators/ng-add/utilities/workspace.ts b/packages/angular/src/generators/ng-add/utilities/workspace.ts index ac63e3375e0d1..3d59f5ac5c88d 100644 --- a/packages/angular/src/generators/ng-add/utilities/workspace.ts +++ b/packages/angular/src/generators/ng-add/utilities/workspace.ts @@ -172,8 +172,11 @@ export function updatePackageJson(tree: Tree): void { if (!packageJson.devDependencies['@angular/cli']) { packageJson.devDependencies['@angular/cli'] = angularDevkitVersion; } - if (!packageJson.devDependencies['@nrwl/workspace']) { - packageJson.devDependencies['@nrwl/workspace'] = nxVersion; + if ( + !packageJson.devDependencies['@nx/workspace'] && + !packageJson.devDependencies['@nrwl/workspace'] + ) { + packageJson.devDependencies['@nx/workspace'] = nxVersion; } if (!packageJson.devDependencies['nx']) { packageJson.devDependencies['nx'] = nxVersion; @@ -209,9 +212,11 @@ export function updateRootEsLintConfig( } existingEsLintConfig.ignorePatterns = ['**/*']; - existingEsLintConfig.plugins = Array.from( - new Set([...(existingEsLintConfig.plugins ?? []), '@nrwl/nx']) - ); + if (!(existingEsLintConfig.plugins ?? []).includes('@nrwl/nx')) { + existingEsLintConfig.plugins = Array.from( + new Set([...(existingEsLintConfig.plugins ?? []), '@nx/nx']) + ); + } existingEsLintConfig.overrides?.forEach((override) => { if (!override.parserOptions?.project) { return; @@ -219,13 +224,13 @@ export function updateRootEsLintConfig( delete override.parserOptions.project; }); - // add the @nrwl/nx/enforce-module-boundaries rule + // add the @nx/nx/enforce-module-boundaries rule existingEsLintConfig.overrides = [ ...(existingEsLintConfig.overrides ?? []), { files: ['*.ts', '*.tsx', '*.js', '*.jsx'], rules: { - '@nrwl/nx/enforce-module-boundaries': [ + '@nx/nx/enforce-module-boundaries': [ 'error', { enforceBuildableLibDependency: true, diff --git a/packages/angular/src/generators/ngrx/__snapshots__/ngrx.spec.ts.snap b/packages/angular/src/generators/ngrx/__snapshots__/ngrx.spec.ts.snap index 226637647aef5..f53d0b6327e3a 100644 --- a/packages/angular/src/generators/ngrx/__snapshots__/ngrx.spec.ts.snap +++ b/packages/angular/src/generators/ngrx/__snapshots__/ngrx.spec.ts.snap @@ -48,7 +48,7 @@ exports[`ngrx NgModule Syntax generated unit tests should generate specs for the import { TestBed } from '@angular/core/testing'; import { EffectsModule } from '@ngrx/effects'; import { StoreModule, Store } from '@ngrx/store'; -import { readFirst } from '@nrwl/angular/testing'; +import { readFirst } from '@nx/angular/testing'; import * as SuperUsersActions from './super-users.actions'; import { SuperUsersEffects } from './super-users.effects'; diff --git a/packages/angular/src/generators/ngrx/files/base/__directory__/__fileName__.facade.spec.ts__tmpl__ b/packages/angular/src/generators/ngrx/files/base/__directory__/__fileName__.facade.spec.ts__tmpl__ index 1ee4b14a9f0c8..ccd1b5263a73b 100644 --- a/packages/angular/src/generators/ngrx/files/base/__directory__/__fileName__.facade.spec.ts__tmpl__ +++ b/packages/angular/src/generators/ngrx/files/base/__directory__/__fileName__.facade.spec.ts__tmpl__ @@ -2,7 +2,7 @@ import { NgModule } from '@angular/core'; import { TestBed } from '@angular/core/testing'; import { EffectsModule } from '@ngrx/effects'; import { StoreModule, Store } from '@ngrx/store'; -import { readFirst } from '@nrwl/angular/testing'; +import { readFirst } from '@nx/angular/testing'; import * as <%= className %>Actions from './<%= fileName %>.actions'; import { <%= className %>Effects } from './<%= fileName %>.effects'; diff --git a/packages/angular/src/generators/remote/__snapshots__/remote.spec.ts.snap b/packages/angular/src/generators/remote/__snapshots__/remote.spec.ts.snap index a733dd8747f57..f52c4a1d81b53 100644 --- a/packages/angular/src/generators/remote/__snapshots__/remote.spec.ts.snap +++ b/packages/angular/src/generators/remote/__snapshots__/remote.spec.ts.snap @@ -116,7 +116,7 @@ function run(): void { console.log(\`Node Express server listening on http://localhost:\${port}\`); /** - * DO NOT REMOVE IF USING @nrwl/angular:module-federation-dev-ssr executor + * DO NOT REMOVE IF USING @nx/angular:module-federation-dev-ssr executor * to serve your Host application with this Remote application. * This message allows Nx to determine when the Remote is ready to be * consumed by the Host. @@ -147,9 +147,7 @@ exports[`MF Remote App Generator --ssr should generate the correct files 6`] = ` `; exports[`MF Remote App Generator --ssr should generate the correct files 7`] = ` -"const { - withModuleFederationForSSR, -} = require('@nrwl/angular/module-federation'); +"const { withModuleFederationForSSR } = require('@nx/angular/module-federation'); const config = require('./module-federation.config'); module.exports = withModuleFederationForSSR(config); " @@ -205,7 +203,7 @@ exports[`MF Remote App Generator --ssr should generate the correct files 11`] = "dependsOn": [ "build", ], - "executor": "@nrwl/angular:webpack-server", + "executor": "@nx/angular:webpack-server", "options": { "customWebpackConfig": { "path": "apps/test/webpack.server.config.js", @@ -241,21 +239,21 @@ exports[`MF Remote App Generator --ssr should generate the correct files 13`] = `; exports[`MF Remote App Generator should generate a remote mf app with a host 1`] = ` -"const { withModuleFederation } = require('@nrwl/angular/module-federation'); +"const { withModuleFederation } = require('@nx/angular/module-federation'); const config = require('./module-federation.config'); module.exports = withModuleFederation(config); " `; exports[`MF Remote App Generator should generate a remote mf app with a host 2`] = ` -"const { withModuleFederation } = require('@nrwl/angular/module-federation'); +"const { withModuleFederation } = require('@nx/angular/module-federation'); const config = require('./module-federation.config'); module.exports = withModuleFederation(config); " `; exports[`MF Remote App Generator should generate a remote mf app with no host 1`] = ` -"const { withModuleFederation } = require('@nrwl/angular/module-federation'); +"const { withModuleFederation } = require('@nx/angular/module-federation'); const config = require('./module-federation.config'); module.exports = withModuleFederation(config); " diff --git a/packages/angular/src/generators/remote/files/src/main.server.ts__tmpl__ b/packages/angular/src/generators/remote/files/src/main.server.ts__tmpl__ index e5a6b3ae63d2a..650a60f280c8b 100644 --- a/packages/angular/src/generators/remote/files/src/main.server.ts__tmpl__ +++ b/packages/angular/src/generators/remote/files/src/main.server.ts__tmpl__ @@ -60,7 +60,7 @@ function run(): void { console.log(`Node Express server listening on http://localhost:${port}`); /** - * DO NOT REMOVE IF USING @nrwl/angular:module-federation-dev-ssr executor + * DO NOT REMOVE IF USING @nx/angular:module-federation-dev-ssr executor * to serve your Host application with this Remote application. * This message allows Nx to determine when the Remote is ready to be * consumed by the Host. diff --git a/packages/angular/src/generators/remote/files/webpack.server.config.js__tmpl__ b/packages/angular/src/generators/remote/files/webpack.server.config.js__tmpl__ index a859109e6d32d..a5f4e5c712117 100644 --- a/packages/angular/src/generators/remote/files/webpack.server.config.js__tmpl__ +++ b/packages/angular/src/generators/remote/files/webpack.server.config.js__tmpl__ @@ -1,3 +1,3 @@ -const { withModuleFederationForSSR } = require('@nrwl/angular/module-federation'); +const { withModuleFederationForSSR } = require('@nx/angular/module-federation'); const config = require('./module-federation.config'); -module.exports = withModuleFederationForSSR(config) \ No newline at end of file +module.exports = withModuleFederationForSSR(config) diff --git a/packages/angular/src/generators/remote/lib/add-ssr.ts b/packages/angular/src/generators/remote/lib/add-ssr.ts index 680b25ad5befc..2b7dd9ff3294b 100644 --- a/packages/angular/src/generators/remote/lib/add-ssr.ts +++ b/packages/angular/src/generators/remote/lib/add-ssr.ts @@ -43,7 +43,7 @@ export async function addSsr( // update project.json project = readProjectConfiguration(tree, appName); - project.targets.server.executor = '@nrwl/angular:webpack-server'; + project.targets.server.executor = '@nx/angular:webpack-server'; project.targets.server.options.customWebpackConfig = { path: joinPathFragments(project.root, 'webpack.server.config.js'), }; diff --git a/packages/angular/src/generators/setup-mf/__snapshots__/setup-mf.spec.ts.snap b/packages/angular/src/generators/setup-mf/__snapshots__/setup-mf.spec.ts.snap index 8825e9df18bdf..74d0e294b6171 100644 --- a/packages/angular/src/generators/setup-mf/__snapshots__/setup-mf.spec.ts.snap +++ b/packages/angular/src/generators/setup-mf/__snapshots__/setup-mf.spec.ts.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Init MF --federationType=dynamic should create a host with the correct configurations 1`] = ` -"import { setRemoteDefinitions } from '@nrwl/angular/mf'; +"import { setRemoteDefinitions } from '@nx/angular/mf'; fetch('/assets/module-federation.manifest.json') .then((res) => res.json()) @@ -52,7 +52,7 @@ exports[`Init MF should add a remote application and add it to a specified host exports[`Init MF should add a remote to dynamic host correctly 1`] = ` "import { NxWelcomeComponent } from './nx-welcome.component'; import { Route } from '@angular/router'; -import { loadRemoteModule } from '@nrwl/angular/mf'; +import { loadRemoteModule } from '@nx/angular/mf'; export const appRoutes: Route[] = [ { @@ -69,7 +69,7 @@ export const appRoutes: Route[] = [ `; exports[`Init MF should create webpack and mf configs correctly 1`] = ` -"const { withModuleFederation } = require('@nrwl/angular/module-federation'); +"const { withModuleFederation } = require('@nx/angular/module-federation'); const config = require('./module-federation.config'); module.exports = withModuleFederation(config); " @@ -84,7 +84,7 @@ exports[`Init MF should create webpack and mf configs correctly 2`] = ` `; exports[`Init MF should create webpack and mf configs correctly 3`] = ` -"const { withModuleFederation } = require('@nrwl/angular/module-federation'); +"const { withModuleFederation } = require('@nx/angular/module-federation'); const config = require('./module-federation.config'); module.exports = withModuleFederation(config); " diff --git a/packages/angular/src/generators/setup-mf/files/webpack/webpack.config.js__tmpl__ b/packages/angular/src/generators/setup-mf/files/webpack/webpack.config.js__tmpl__ index d101992f0152c..3471f03552774 100644 --- a/packages/angular/src/generators/setup-mf/files/webpack/webpack.config.js__tmpl__ +++ b/packages/angular/src/generators/setup-mf/files/webpack/webpack.config.js__tmpl__ @@ -1,3 +1,3 @@ -const { withModuleFederation } = require('@nrwl/angular/module-federation'); +const { withModuleFederation } = require('@nx/angular/module-federation'); const config = require('./module-federation.config'); -module.exports = withModuleFederation(config); \ No newline at end of file +module.exports = withModuleFederation(config); diff --git a/packages/angular/src/generators/setup-mf/files/webpack/webpack.prod.config.js__tmpl__ b/packages/angular/src/generators/setup-mf/files/webpack/webpack.prod.config.js__tmpl__ index 2640b51e8d8ed..c09f0fd535805 100644 --- a/packages/angular/src/generators/setup-mf/files/webpack/webpack.prod.config.js__tmpl__ +++ b/packages/angular/src/generators/setup-mf/files/webpack/webpack.prod.config.js__tmpl__ @@ -1,4 +1,4 @@ -const { withModuleFederation } = require('@nrwl/angular/module-federation'); +const { withModuleFederation } = require('@nx/angular/module-federation'); const config = require('./module-federation.config'); module.exports = withModuleFederation({ ...config, @@ -12,4 +12,4 @@ module.exports = withModuleFederation({ * ['app2', 'https://app2.example.com'], * ] */ -}); \ No newline at end of file +}); diff --git a/packages/angular/src/generators/setup-mf/lib/add-cypress-workaround.ts b/packages/angular/src/generators/setup-mf/lib/add-cypress-workaround.ts index db64e47b958f1..f3201fe91ea40 100644 --- a/packages/angular/src/generators/setup-mf/lib/add-cypress-workaround.ts +++ b/packages/angular/src/generators/setup-mf/lib/add-cypress-workaround.ts @@ -32,7 +32,7 @@ export function addCypressOnErrorWorkaround(tree: Tree, schema: Schema) { if ( e2eProject.targets.e2e.executor !== '@nx/cypress:cypress' && - e2eProject.targets.e2e.executor !== '@nrwl/cypress:cypress' + e2eProject.targets.e2e.executor !== '@nx/cypress:cypress' ) { // Not a cypress e2e project, skip return; diff --git a/packages/angular/src/generators/setup-mf/lib/add-remote-to-host.ts b/packages/angular/src/generators/setup-mf/lib/add-remote-to-host.ts index aef115cfa1f40..2b126dc6aee43 100644 --- a/packages/angular/src/generators/setup-mf/lib/add-remote-to-host.ts +++ b/packages/angular/src/generators/setup-mf/lib/add-remote-to-host.ts @@ -146,7 +146,7 @@ function addLazyLoadedRouteToHostAppModule( sourceFile, pathToHostRootRouting, 'loadRemoteModule', - '@nrwl/angular/mf' + '@nx/angular/mf' ); } diff --git a/packages/angular/src/generators/setup-mf/lib/change-build-target.ts b/packages/angular/src/generators/setup-mf/lib/change-build-target.ts index 821d5b5da010b..add11f0daeb73 100644 --- a/packages/angular/src/generators/setup-mf/lib/change-build-target.ts +++ b/packages/angular/src/generators/setup-mf/lib/change-build-target.ts @@ -9,7 +9,7 @@ import { export function changeBuildTarget(host: Tree, options: Schema) { const appConfig = readProjectConfiguration(host, options.appName); - appConfig.targets.build.executor = '@nrwl/angular:webpack-browser'; + appConfig.targets.build.executor = '@nx/angular:webpack-browser'; appConfig.targets.build.options = { ...appConfig.targets.build.options, customWebpackConfig: { diff --git a/packages/angular/src/generators/setup-mf/lib/fix-bootstrap.ts b/packages/angular/src/generators/setup-mf/lib/fix-bootstrap.ts index 78e4ff348b01e..384391dccc7f1 100644 --- a/packages/angular/src/generators/setup-mf/lib/fix-bootstrap.ts +++ b/packages/angular/src/generators/setup-mf/lib/fix-bootstrap.ts @@ -18,7 +18,7 @@ export function fixBootstrap(tree: Tree, appRoot: string, options: Schema) { const bootstrapImportCode = `import('./bootstrap').catch(err => console.error(err))`; - const fetchMFManifestCode = `import { setRemoteDefinitions } from '@nrwl/angular/mf'; + const fetchMFManifestCode = `import { setRemoteDefinitions } from '@nx/angular/mf'; fetch('/assets/module-federation.manifest.json') .then((res) => res.json()) diff --git a/packages/angular/src/generators/setup-mf/lib/setup-serve-target.ts b/packages/angular/src/generators/setup-mf/lib/setup-serve-target.ts index 8396bb50bd142..6b6c2cae14b63 100644 --- a/packages/angular/src/generators/setup-mf/lib/setup-serve-target.ts +++ b/packages/angular/src/generators/setup-mf/lib/setup-serve-target.ts @@ -12,8 +12,8 @@ export function setupServeTarget(host: Tree, options: Schema) { ...appConfig.targets['serve'], executor: options.mfType === 'host' - ? '@nrwl/angular:module-federation-dev-server' - : '@nrwl/angular:webpack-dev-server', + ? '@nx/angular:module-federation-dev-server' + : '@nx/angular:webpack-dev-server', options: { ...appConfig.targets['serve'].options, port: options.port ?? undefined, @@ -23,7 +23,7 @@ export function setupServeTarget(host: Tree, options: Schema) { if (options.mfType === 'remote') { appConfig.targets['serve-static'] = { - executor: '@nrwl/web:file-server', + executor: '@nx/web:file-server', defaultConfiguration: 'development', options: { buildTarget: `${options.appName}:build`, diff --git a/packages/angular/src/generators/setup-mf/setup-mf.spec.ts b/packages/angular/src/generators/setup-mf/setup-mf.spec.ts index efc7e8267dd47..0b18e76c3c066 100644 --- a/packages/angular/src/generators/setup-mf/setup-mf.spec.ts +++ b/packages/angular/src/generators/setup-mf/setup-mf.spec.ts @@ -125,10 +125,10 @@ describe('Init MF', () => { expect(serve.executor).toEqual( type === 'host' - ? '@nrwl/angular:module-federation-dev-server' - : '@nrwl/angular:webpack-dev-server' + ? '@nx/angular:module-federation-dev-server' + : '@nx/angular:webpack-dev-server' ); - expect(build.executor).toEqual('@nrwl/angular:webpack-browser'); + expect(build.executor).toEqual('@nx/angular:webpack-browser'); expect(build.options.customWebpackConfig.path).toEqual( `apps/${app}/webpack.config.js` ); diff --git a/packages/angular/src/generators/setup-mf/setup-mf.ts b/packages/angular/src/generators/setup-mf/setup-mf.ts index ef6aae7bb7e4a..ef5cdfe8cb4eb 100644 --- a/packages/angular/src/generators/setup-mf/setup-mf.ts +++ b/packages/angular/src/generators/setup-mf/setup-mf.ts @@ -49,7 +49,7 @@ export async function setupMf(tree: Tree, options: Schema) { installTask = addDependenciesToPackageJson( tree, {}, - { '@nrwl/web': nxVersion } + { '@nx/web': nxVersion } ); } diff --git a/packages/angular/src/generators/setup-tailwind/files/v2/tailwind.config.js__tmpl__ b/packages/angular/src/generators/setup-tailwind/files/v2/tailwind.config.js__tmpl__ index f7eedd5384a06..3feb87b6829a6 100644 --- a/packages/angular/src/generators/setup-tailwind/files/v2/tailwind.config.js__tmpl__ +++ b/packages/angular/src/generators/setup-tailwind/files/v2/tailwind.config.js__tmpl__ @@ -1,4 +1,4 @@ -const { createGlobPatternsForDependencies } = require('@nrwl/angular/tailwind'); +const { createGlobPatternsForDependencies } = require('@nx/angular/tailwind'); const { join } = require('path'); module.exports = { diff --git a/packages/angular/src/generators/setup-tailwind/files/v3/tailwind.config.js__tmpl__ b/packages/angular/src/generators/setup-tailwind/files/v3/tailwind.config.js__tmpl__ index 9f6b55d5166d6..0e32e3ee76e06 100644 --- a/packages/angular/src/generators/setup-tailwind/files/v3/tailwind.config.js__tmpl__ +++ b/packages/angular/src/generators/setup-tailwind/files/v3/tailwind.config.js__tmpl__ @@ -1,4 +1,4 @@ -const { createGlobPatternsForDependencies } = require('@nrwl/angular/tailwind'); +const { createGlobPatternsForDependencies } = require('@nx/angular/tailwind'); const { join } = require('path'); /** @type {import('tailwindcss').Config} */ diff --git a/packages/angular/src/generators/setup-tailwind/lib/add-tailwind-config-path-to-project.ts b/packages/angular/src/generators/setup-tailwind/lib/add-tailwind-config-path-to-project.ts index a7a05a284ed13..ee5bea696d7d7 100644 --- a/packages/angular/src/generators/setup-tailwind/lib/add-tailwind-config-path-to-project.ts +++ b/packages/angular/src/generators/setup-tailwind/lib/add-tailwind-config-path-to-project.ts @@ -23,6 +23,8 @@ export function addTailwindConfigPathToProject( } const supportedLibraryExecutors = [ + '@nx/angular:ng-packagr-lite', + '@nx/angular:package', '@nrwl/angular:ng-packagr-lite', '@nrwl/angular:package', ]; diff --git a/packages/angular/src/generators/setup-tailwind/setup-tailwind.application.spec.ts b/packages/angular/src/generators/setup-tailwind/setup-tailwind.application.spec.ts index 365e3a030191a..0c8fef7ffe173 100644 --- a/packages/angular/src/generators/setup-tailwind/setup-tailwind.application.spec.ts +++ b/packages/angular/src/generators/setup-tailwind/setup-tailwind.application.spec.ts @@ -99,7 +99,7 @@ describe('setupTailwind generator', () => { const projectConfig = readProjectConfiguration(tree, project); projectConfig.targets = { build: { - executor: '@nrwl/angular:webpack-browser', + executor: '@nx/angular:webpack-browser', options: {}, }, }; @@ -118,7 +118,7 @@ describe('setupTailwind generator', () => { const projectConfig = readProjectConfiguration(tree, project); projectConfig.targets = { build: { - executor: '@nrwl/angular:webpack-browser', + executor: '@nx/angular:webpack-browser', options: { styles: ['node_modules/awesome-ds/styles.css', stylesEntryPoint], }, @@ -138,7 +138,7 @@ describe('setupTailwind generator', () => { const projectConfig = readProjectConfiguration(tree, project); projectConfig.targets = { build: { - executor: '@nrwl/angular:webpack-browser', + executor: '@nx/angular:webpack-browser', options: { styles: ['node_modules/awesome-ds/styles.css'], }, @@ -160,7 +160,7 @@ describe('setupTailwind generator', () => { const projectConfig = readProjectConfiguration(tree, project); projectConfig.targets = { build: { - executor: '@nrwl/angular:webpack-browser', + executor: '@nx/angular:webpack-browser', options: { styles: [ 'node_modules/awesome-ds/styles.css', @@ -224,7 +224,7 @@ describe('setupTailwind generator', () => { const projectConfig = readProjectConfiguration(tree, project); projectConfig.targets = { build: { - executor: '@nrwl/angular:webpack-browser', + executor: '@nx/angular:webpack-browser', options: { styles: ['node_modules/awesome-ds/styles.css', stylesEntryPoint], }, @@ -252,7 +252,7 @@ describe('setupTailwind generator', () => { const projectConfig = readProjectConfiguration(tree, project); projectConfig.targets = { build: { - executor: '@nrwl/angular:webpack-browser', + executor: '@nx/angular:webpack-browser', options: { styles: [ 'node_modules/awesome-ds/styles.css', @@ -286,7 +286,7 @@ describe('setupTailwind generator', () => { const projectConfig = readProjectConfiguration(tree, project); projectConfig.targets = { build: { - executor: '@nrwl/angular:webpack-browser', + executor: '@nx/angular:webpack-browser', options: { styles: [ 'node_modules/awesome-ds/styles.css', @@ -335,7 +335,7 @@ describe('setupTailwind generator', () => { expect(tree.read(`apps/${project}/tailwind.config.js`, 'utf-8')) .toMatchInlineSnapshot(` - "const { createGlobPatternsForDependencies } = require('@nrwl/angular/tailwind'); + "const { createGlobPatternsForDependencies } = require('@nx/angular/tailwind'); const { join } = require('path'); /** @type {import('tailwindcss').Config} */ @@ -365,7 +365,7 @@ describe('setupTailwind generator', () => { expect(tree.read(`apps/${project}/tailwind.config.js`, 'utf-8')) .toMatchInlineSnapshot(` - "const { createGlobPatternsForDependencies } = require('@nrwl/angular/tailwind'); + "const { createGlobPatternsForDependencies } = require('@nx/angular/tailwind'); const { join } = require('path'); /** @type {import('tailwindcss').Config} */ @@ -395,7 +395,7 @@ describe('setupTailwind generator', () => { expect(tree.read(`apps/${project}/tailwind.config.js`, 'utf-8')) .toMatchInlineSnapshot(` - "const { createGlobPatternsForDependencies } = require('@nrwl/angular/tailwind'); + "const { createGlobPatternsForDependencies } = require('@nx/angular/tailwind'); const { join } = require('path'); module.exports = { @@ -523,7 +523,7 @@ describe('setupTailwind generator', () => { const projectConfig = readProjectConfiguration(tree, project); projectConfig.targets = { build: { - executor: '@nrwl/angular:webpack-browser', + executor: '@nx/angular:webpack-browser', options: {}, }, }; @@ -542,7 +542,7 @@ describe('setupTailwind generator', () => { const projectConfig = readProjectConfiguration(tree, project); projectConfig.targets = { build: { - executor: '@nrwl/angular:webpack-browser', + executor: '@nx/angular:webpack-browser', options: { styles: ['node_modules/awesome-ds/styles.css', stylesEntryPoint], }, @@ -562,7 +562,7 @@ describe('setupTailwind generator', () => { const projectConfig = readProjectConfiguration(tree, project); projectConfig.targets = { build: { - executor: '@nrwl/angular:webpack-browser', + executor: '@nx/angular:webpack-browser', options: { styles: ['node_modules/awesome-ds/styles.css'], }, @@ -584,7 +584,7 @@ describe('setupTailwind generator', () => { const projectConfig = readProjectConfiguration(tree, project); projectConfig.targets = { build: { - executor: '@nrwl/angular:webpack-browser', + executor: '@nx/angular:webpack-browser', options: { styles: [ 'node_modules/awesome-ds/styles.css', @@ -648,7 +648,7 @@ describe('setupTailwind generator', () => { const projectConfig = readProjectConfiguration(tree, project); projectConfig.targets = { build: { - executor: '@nrwl/angular:webpack-browser', + executor: '@nx/angular:webpack-browser', options: { styles: ['node_modules/awesome-ds/styles.css', stylesEntryPoint], }, @@ -676,7 +676,7 @@ describe('setupTailwind generator', () => { const projectConfig = readProjectConfiguration(tree, project); projectConfig.targets = { build: { - executor: '@nrwl/angular:webpack-browser', + executor: '@nx/angular:webpack-browser', options: { styles: [ 'node_modules/awesome-ds/styles.css', @@ -710,7 +710,7 @@ describe('setupTailwind generator', () => { const projectConfig = readProjectConfiguration(tree, project); projectConfig.targets = { build: { - executor: '@nrwl/angular:webpack-browser', + executor: '@nx/angular:webpack-browser', options: { styles: [ 'node_modules/awesome-ds/styles.css', @@ -759,7 +759,7 @@ describe('setupTailwind generator', () => { expect(tree.read(`apps/${project}/tailwind.config.js`, 'utf-8')) .toMatchInlineSnapshot(` - "const { createGlobPatternsForDependencies } = require('@nrwl/angular/tailwind'); + "const { createGlobPatternsForDependencies } = require('@nx/angular/tailwind'); const { join } = require('path'); /** @type {import('tailwindcss').Config} */ @@ -789,7 +789,7 @@ describe('setupTailwind generator', () => { expect(tree.read(`apps/${project}/tailwind.config.js`, 'utf-8')) .toMatchInlineSnapshot(` - "const { createGlobPatternsForDependencies } = require('@nrwl/angular/tailwind'); + "const { createGlobPatternsForDependencies } = require('@nx/angular/tailwind'); const { join } = require('path'); /** @type {import('tailwindcss').Config} */ @@ -819,7 +819,7 @@ describe('setupTailwind generator', () => { expect(tree.read(`apps/${project}/tailwind.config.js`, 'utf-8')) .toMatchInlineSnapshot(` - "const { createGlobPatternsForDependencies } = require('@nrwl/angular/tailwind'); + "const { createGlobPatternsForDependencies } = require('@nx/angular/tailwind'); const { join } = require('path'); module.exports = { diff --git a/packages/angular/src/generators/setup-tailwind/setup-tailwind.library.spec.ts b/packages/angular/src/generators/setup-tailwind/setup-tailwind.library.spec.ts index 2abdfe3612c5f..2cd30a6277085 100644 --- a/packages/angular/src/generators/setup-tailwind/setup-tailwind.library.spec.ts +++ b/packages/angular/src/generators/setup-tailwind/setup-tailwind.library.spec.ts @@ -109,7 +109,7 @@ describe('setupTailwind generator', () => { let projectConfig = readProjectConfiguration(tree, project); projectConfig.targets = { build: { - executor: '@nrwl/angular:package', + executor: '@nx/angular:package', options: { tailwindConfig }, }, }; @@ -128,7 +128,7 @@ describe('setupTailwind generator', () => { it('should add the tailwind config path to the "build" target by default when no build target is specified', async () => { let projectConfig = readProjectConfiguration(tree, project); projectConfig.targets = { - build: { executor: '@nrwl/angular:package', options: {} }, + build: { executor: '@nx/angular:package', options: {} }, }; updateProjectConfiguration(tree, project, projectConfig); @@ -144,7 +144,7 @@ describe('setupTailwind generator', () => { const buildTarget = 'custom-build'; let projectConfig = readProjectConfiguration(tree, project); projectConfig.targets = { - [buildTarget]: { executor: '@nrwl/angular:package', options: {} }, + [buildTarget]: { executor: '@nx/angular:package', options: {} }, }; updateProjectConfiguration(tree, project, projectConfig); @@ -156,7 +156,7 @@ describe('setupTailwind generator', () => { ); }); - it.each(['@nrwl/angular:ng-packagr-lite', '@nrwl/angular:package'])( + it.each(['@nx/angular:ng-packagr-lite', '@nx/angular:package'])( 'should add the tailwind config path when using the "%s" executor', async (executor) => { let projectConfig = readProjectConfiguration(tree, project); @@ -175,7 +175,7 @@ describe('setupTailwind generator', () => { it('should add required packages', async () => { const projectConfig = readProjectConfiguration(tree, project); projectConfig.targets = { - build: { executor: '@nrwl/angular:package', options: {} }, + build: { executor: '@nx/angular:package', options: {} }, }; updateProjectConfiguration(tree, project, projectConfig); @@ -190,7 +190,7 @@ describe('setupTailwind generator', () => { it('should generate the tailwind.config.js file in the project root for v3 by default', async () => { const projectConfig = readProjectConfiguration(tree, project); projectConfig.targets = { - build: { executor: '@nrwl/angular:package', options: {} }, + build: { executor: '@nx/angular:package', options: {} }, }; updateProjectConfiguration(tree, project, projectConfig); @@ -198,7 +198,7 @@ describe('setupTailwind generator', () => { expect(tree.read(`libs/${project}/tailwind.config.js`, 'utf-8')) .toMatchInlineSnapshot(` - "const { createGlobPatternsForDependencies } = require('@nrwl/angular/tailwind'); + "const { createGlobPatternsForDependencies } = require('@nx/angular/tailwind'); const { join } = require('path'); /** @type {import('tailwindcss').Config} */ @@ -219,7 +219,7 @@ describe('setupTailwind generator', () => { it('should generate the tailwind.config.js file in the project root with the config for v3 when a version greater than 3 is installed', async () => { const projectConfig = readProjectConfiguration(tree, project); projectConfig.targets = { - build: { executor: '@nrwl/angular:package', options: {} }, + build: { executor: '@nx/angular:package', options: {} }, }; updateProjectConfiguration(tree, project, projectConfig); tree.write( @@ -231,7 +231,7 @@ describe('setupTailwind generator', () => { expect(tree.read(`libs/${project}/tailwind.config.js`, 'utf-8')) .toMatchInlineSnapshot(` - "const { createGlobPatternsForDependencies } = require('@nrwl/angular/tailwind'); + "const { createGlobPatternsForDependencies } = require('@nx/angular/tailwind'); const { join } = require('path'); /** @type {import('tailwindcss').Config} */ @@ -252,7 +252,7 @@ describe('setupTailwind generator', () => { it('should generate the tailwind.config.js file in the project root with the config for v2 when a version greater than 2 and lower than 3 is installed', async () => { const projectConfig = readProjectConfiguration(tree, project); projectConfig.targets = { - build: { executor: '@nrwl/angular:package', options: {} }, + build: { executor: '@nx/angular:package', options: {} }, }; updateProjectConfiguration(tree, project, projectConfig); tree.write( @@ -264,7 +264,7 @@ describe('setupTailwind generator', () => { expect(tree.read(`libs/${project}/tailwind.config.js`, 'utf-8')) .toMatchInlineSnapshot(` - "const { createGlobPatternsForDependencies } = require('@nrwl/angular/tailwind'); + "const { createGlobPatternsForDependencies } = require('@nx/angular/tailwind'); const { join } = require('path'); module.exports = { @@ -289,7 +289,7 @@ describe('setupTailwind generator', () => { it('should format files', async () => { const projectConfig = readProjectConfiguration(tree, project); projectConfig.targets = { - build: { executor: '@nrwl/angular:package', options: {} }, + build: { executor: '@nx/angular:package', options: {} }, }; updateProjectConfiguration(tree, project, projectConfig); jest.spyOn(devkit, 'formatFiles'); @@ -302,7 +302,7 @@ describe('setupTailwind generator', () => { it('should not format files when "skipFormat: true"', async () => { const projectConfig = readProjectConfiguration(tree, project); projectConfig.targets = { - build: { executor: '@nrwl/angular:package', options: {} }, + build: { executor: '@nx/angular:package', options: {} }, }; updateProjectConfiguration(tree, project, projectConfig); jest.spyOn(devkit, 'formatFiles'); @@ -404,7 +404,7 @@ describe('setupTailwind generator', () => { let projectConfig = readProjectConfiguration(tree, project); projectConfig.targets = { build: { - executor: '@nrwl/angular:package', + executor: '@nx/angular:package', options: { tailwindConfig }, }, }; @@ -423,7 +423,7 @@ describe('setupTailwind generator', () => { it('should add the tailwind config path to the "build" target by default when no build target is specified', async () => { let projectConfig = readProjectConfiguration(tree, project); projectConfig.targets = { - build: { executor: '@nrwl/angular:package', options: {} }, + build: { executor: '@nx/angular:package', options: {} }, }; updateProjectConfiguration(tree, project, projectConfig); @@ -439,7 +439,7 @@ describe('setupTailwind generator', () => { const buildTarget = 'custom-build'; let projectConfig = readProjectConfiguration(tree, project); projectConfig.targets = { - [buildTarget]: { executor: '@nrwl/angular:package', options: {} }, + [buildTarget]: { executor: '@nx/angular:package', options: {} }, }; updateProjectConfiguration(tree, project, projectConfig); @@ -451,7 +451,7 @@ describe('setupTailwind generator', () => { ); }); - it.each(['@nrwl/angular:ng-packagr-lite', '@nrwl/angular:package'])( + it.each(['@nx/angular:ng-packagr-lite', '@nx/angular:package'])( 'should add the tailwind config path when using the "%s" executor', async (executor) => { let projectConfig = readProjectConfiguration(tree, project); @@ -470,7 +470,7 @@ describe('setupTailwind generator', () => { it('should add required packages', async () => { const projectConfig = readProjectConfiguration(tree, project); projectConfig.targets = { - build: { executor: '@nrwl/angular:package', options: {} }, + build: { executor: '@nx/angular:package', options: {} }, }; updateProjectConfiguration(tree, project, projectConfig); @@ -485,7 +485,7 @@ describe('setupTailwind generator', () => { it('should generate the tailwind.config.js file in the project root for v3 by default', async () => { const projectConfig = readProjectConfiguration(tree, project); projectConfig.targets = { - build: { executor: '@nrwl/angular:package', options: {} }, + build: { executor: '@nx/angular:package', options: {} }, }; updateProjectConfiguration(tree, project, projectConfig); @@ -493,7 +493,7 @@ describe('setupTailwind generator', () => { expect(tree.read(`libs/${project}/tailwind.config.js`, 'utf-8')) .toMatchInlineSnapshot(` - "const { createGlobPatternsForDependencies } = require('@nrwl/angular/tailwind'); + "const { createGlobPatternsForDependencies } = require('@nx/angular/tailwind'); const { join } = require('path'); /** @type {import('tailwindcss').Config} */ @@ -514,7 +514,7 @@ describe('setupTailwind generator', () => { it('should generate the tailwind.config.js file in the project root with the config for v3 when a version greater than 3 is installed', async () => { const projectConfig = readProjectConfiguration(tree, project); projectConfig.targets = { - build: { executor: '@nrwl/angular:package', options: {} }, + build: { executor: '@nx/angular:package', options: {} }, }; updateProjectConfiguration(tree, project, projectConfig); tree.write( @@ -526,7 +526,7 @@ describe('setupTailwind generator', () => { expect(tree.read(`libs/${project}/tailwind.config.js`, 'utf-8')) .toMatchInlineSnapshot(` - "const { createGlobPatternsForDependencies } = require('@nrwl/angular/tailwind'); + "const { createGlobPatternsForDependencies } = require('@nx/angular/tailwind'); const { join } = require('path'); /** @type {import('tailwindcss').Config} */ @@ -547,7 +547,7 @@ describe('setupTailwind generator', () => { it('should generate the tailwind.config.js file in the project root with the config for v2 when a version greater than 2 and lower than 3 is installed', async () => { const projectConfig = readProjectConfiguration(tree, project); projectConfig.targets = { - build: { executor: '@nrwl/angular:package', options: {} }, + build: { executor: '@nx/angular:package', options: {} }, }; updateProjectConfiguration(tree, project, projectConfig); tree.write( @@ -559,7 +559,7 @@ describe('setupTailwind generator', () => { expect(tree.read(`libs/${project}/tailwind.config.js`, 'utf-8')) .toMatchInlineSnapshot(` - "const { createGlobPatternsForDependencies } = require('@nrwl/angular/tailwind'); + "const { createGlobPatternsForDependencies } = require('@nx/angular/tailwind'); const { join } = require('path'); module.exports = { @@ -584,7 +584,7 @@ describe('setupTailwind generator', () => { it('should format files', async () => { const projectConfig = readProjectConfiguration(tree, project); projectConfig.targets = { - build: { executor: '@nrwl/angular:package', options: {} }, + build: { executor: '@nx/angular:package', options: {} }, }; updateProjectConfiguration(tree, project, projectConfig); jest.spyOn(devkit, 'formatFiles'); @@ -597,7 +597,7 @@ describe('setupTailwind generator', () => { it('should not format files when "skipFormat: true"', async () => { const projectConfig = readProjectConfiguration(tree, project); projectConfig.targets = { - build: { executor: '@nrwl/angular:package', options: {} }, + build: { executor: '@nx/angular:package', options: {} }, }; updateProjectConfiguration(tree, project, projectConfig); jest.spyOn(devkit, 'formatFiles'); diff --git a/packages/angular/src/generators/storybook-configuration/storybook-configuration.spec.ts b/packages/angular/src/generators/storybook-configuration/storybook-configuration.spec.ts index 2f7486fad6325..a172a14be2c87 100644 --- a/packages/angular/src/generators/storybook-configuration/storybook-configuration.spec.ts +++ b/packages/angular/src/generators/storybook-configuration/storybook-configuration.spec.ts @@ -1,7 +1,6 @@ import { installedCypressVersion } from '@nx/cypress/src/utils/cypress-version'; import type { Tree } from '@nx/devkit'; -import { joinPathFragments, writeJson } from '@nx/devkit'; -import { overrideCollectionResolutionForTesting } from '@nx/devkit/ngcli-adapter'; +import { writeJson } from '@nx/devkit'; import { Linter } from 'packages/linter/src/generators/utils/linter'; import { componentGenerator } from '../component/component'; import { librarySecondaryEntryPointGenerator } from '../library-secondary-entry-point/library-secondary-entry-point'; @@ -42,12 +41,6 @@ describe('StorybookConfiguration generator', () => { mockedInstalledCypressVersion.mockReturnValue(10); tree = await createStorybookTestWorkspaceForLib(libName); - overrideCollectionResolutionForTesting({ - '@nrwl/storybook': joinPathFragments( - __dirname, - '../../../../storybook/generators.json' - ), - }); jest.resetModules(); jest.doMock('@storybook/angular/package.json', () => ({ version: '7.0.2', diff --git a/packages/angular/src/generators/utils/storybook-ast/module-info.ts b/packages/angular/src/generators/utils/storybook-ast/module-info.ts index eb5d0acf4035c..650fd3f384ddd 100644 --- a/packages/angular/src/generators/utils/storybook-ast/module-info.ts +++ b/packages/angular/src/generators/utils/storybook-ast/module-info.ts @@ -191,7 +191,7 @@ function getDeclarationsArray( if (!declarationArray) { logger.warn( - stripIndents`No stories generated because the declarations in ${moduleFilePath} is not an array literal or the variable could not be found. Hint: you can always generate stories later with the 'nx generate @nrwl/angular:stories --name=${projectName}' command.` + stripIndents`No stories generated because the declarations in ${moduleFilePath} is not an array literal or the variable could not be found. Hint: you can always generate stories later with the 'nx generate @nx/angular:stories --name=${projectName}' command.` ); } @@ -358,7 +358,7 @@ function getNgModuleDeclarationsPropertyAssignment( if (!declarationsPropertyAssignment) { logger.warn( - stripIndents`No stories generated because there were no components declared in ${moduleFilePath}. Hint: you can always generate stories later with the 'nx generate @nrwl/angular:stories --name=${projectName}' command.` + stripIndents`No stories generated because there were no components declared in ${moduleFilePath}. Hint: you can always generate stories later with the 'nx generate @nx/angular:stories --name=${projectName}' command.` ); } diff --git a/packages/angular/src/utils/get-mf-projects.ts b/packages/angular/src/utils/get-mf-projects.ts index ca0f04daec219..09064e91a892c 100644 --- a/packages/angular/src/utils/get-mf-projects.ts +++ b/packages/angular/src/utils/get-mf-projects.ts @@ -1,11 +1,42 @@ import type { Tree } from '@nx/devkit'; import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils'; +function _getMfProjects( + tree: Tree, + CUSTOM_WEBPACK_OPTION: string, + MODULE_FEDERATION_IDENTIFIER: string, + projects: string[] +) { + return (opts, projectName) => { + const webpackPath = opts[CUSTOM_WEBPACK_OPTION]?.path; + if (!webpackPath || !tree.exists(webpackPath)) { + return; + } + const webpackConfig = tree.read(webpackPath, 'utf-8'); + const { tsquery } = require('@phenomnomnominal/tsquery'); + const ast = tsquery.ast(webpackConfig); + const moduleFederationWebpackConfig = tsquery( + ast, + MODULE_FEDERATION_IDENTIFIER, + { + visitAllChildren: true, + } + ); + if ( + !moduleFederationWebpackConfig || + moduleFederationWebpackConfig.length === 0 + ) { + return; + } + + projects.push(projectName); + }; +} + export function getMFProjects( tree: Tree, { legacy }: { legacy: boolean } = { legacy: false } ) { - const NRWL_WEBPACK_BROWSER_BUILDER = '@nrwl/angular:webpack-browser'; const CUSTOM_WEBPACK_OPTION = 'customWebpackConfig'; const MODULE_FEDERATION_IDENTIFIER = legacy ? 'Identifier[name=ModuleFederationPlugin]' @@ -14,31 +45,23 @@ export function getMFProjects( const projects: string[] = []; forEachExecutorOptions( tree, - NRWL_WEBPACK_BROWSER_BUILDER, - (opts, projectName) => { - const webpackPath = opts[CUSTOM_WEBPACK_OPTION]?.path; - if (!webpackPath || !tree.exists(webpackPath)) { - return; - } - const webpackConfig = tree.read(webpackPath, 'utf-8'); - const { tsquery } = require('@phenomnomnominal/tsquery'); - const ast = tsquery.ast(webpackConfig); - const moduleFederationWebpackConfig = tsquery( - ast, - MODULE_FEDERATION_IDENTIFIER, - { - visitAllChildren: true, - } - ); - if ( - !moduleFederationWebpackConfig || - moduleFederationWebpackConfig.length === 0 - ) { - return; - } - - projects.push(projectName); - } + '@nx/angular:webpack-browser', + _getMfProjects( + tree, + CUSTOM_WEBPACK_OPTION, + MODULE_FEDERATION_IDENTIFIER, + projects + ) + ); + forEachExecutorOptions( + tree, + '@nrwl/angular:webpack-browser', + _getMfProjects( + tree, + CUSTOM_WEBPACK_OPTION, + MODULE_FEDERATION_IDENTIFIER, + projects + ) ); return projects; diff --git a/packages/angular/src/utils/mf/utils.ts b/packages/angular/src/utils/mf/utils.ts index 513e536deef7b..5f9c06cd6ad40 100644 --- a/packages/angular/src/utils/mf/utils.ts +++ b/packages/angular/src/utils/mf/utils.ts @@ -29,7 +29,11 @@ export function applyDefaultEagerPackages( } } -export const DEFAULT_NPM_PACKAGES_TO_AVOID = ['zone.js', '@nrwl/angular/mf']; +export const DEFAULT_NPM_PACKAGES_TO_AVOID = [ + 'zone.js', + '@nx/angular/mf', + '@nrwl/angular/mf', +]; export const DEFAULT_ANGULAR_PACKAGES_TO_SHARE = [ '@angular/animations', '@angular/common',