diff --git a/docs/generated/packages/angular.json b/docs/generated/packages/angular.json index bc715a77e5cf4..6169a7f98e73b 100644 --- a/docs/generated/packages/angular.json +++ b/docs/generated/packages/angular.json @@ -186,21 +186,21 @@ "description": "Generate a Module Federation configuration for the application", "type": "boolean", "default": false, - "x-deprecated": "Use the `mfe-host` or `mfe-remote` generators instead. Support for generating MFE applications using the application generator will be removed in an upcoming version." + "x-deprecated": "Use the `mfe-host` or `remote` generators instead. Support for generating MFE applications using the application generator will be removed in an upcoming version." }, "mfeType": { "type": "string", "enum": ["host", "remote"], "description": "Type of application to generate the Module Federation configuration for.", "default": "remote", - "x-deprecated": "Use the `mfe-host` or `mfe-remote` generators instead. Support for generating MFE applications using the application generator will be removed in an upcoming version." + "x-deprecated": "Use the `mfe-host` or `remote` generators instead. Support for generating MFE applications using the application generator will be removed in an upcoming version." }, "federationType": { "type": "string", "enum": ["static", "dynamic"], "description": "Use either Static or Dynamic Module Federation pattern for the application.", "default": "static", - "x-deprecated": "Use the `mfe-host` or `mfe-remote` generators instead. Support for generating MFE applications using the application generator will be removed in an upcoming version." + "x-deprecated": "Use the `mfe-host` or `remote` generators instead. Support for generating MFE applications using the application generator will be removed in an upcoming version." }, "port": { "type": "number", @@ -209,12 +209,12 @@ "remotes": { "type": "array", "description": "A list of remote application names that the host application should consume.", - "x-deprecated": "Use the `mfe-host` or `mfe-remote` generators instead. Support for generating MFE applications using the application generator will be removed in an upcoming version." + "x-deprecated": "Use the `mfe-host` or `remote` generators instead. Support for generating MFE applications using the application generator will be removed in an upcoming version." }, "host": { "type": "string", "description": "The name of the host application that the remote application will be consumed by.", - "x-deprecated": "Use the `mfe-host` or `mfe-remote` generators instead. Support for generating MFE applications using the application generator will be removed in an upcoming version." + "x-deprecated": "Use the `mfe-host` or `remote` generators instead. Support for generating MFE applications using the application generator will be removed in an upcoming version." }, "setParserOptionsProject": { "type": "boolean", @@ -877,19 +877,19 @@ "path": "/packages/angular/src/generators/library-secondary-entry-point/schema.json" }, { - "name": "mfe-remote", - "factory": "./src/generators/mfe-remote/mfe-remote", + "name": "remote", + "factory": "./src/generators/remote/remote", "schema": { "$schema": "http://json-schema.org/schema", - "$id": "NxMFERemote", + "$id": "NxMFRemote", "cli": "nx", - "title": "Nx MFE Remote App", - "description": "Create an Angular Remote Micro Frontend Application.", + "title": "Nx Module Federation Remote App", + "description": "Create an Angular Remote Module Federation Application.", "type": "object", "examples": [ { - "command": "nx g @nrwl/angular:mfe-remote appName --host=host --port=4201", - "description": "Create an Angular app with configuration in place for MFE. If host is provided, attach this remote app to host app's configuration." + "command": "nx g @nrwl/angular:remote appName --host=host --port=4201", + "description": "Create an Angular app with configuration in place for Module Federation. If host is provided, attach this remote app to host app's configuration." } ], "properties": { @@ -1024,11 +1024,11 @@ "required": ["name"], "presets": [] }, - "aliases": ["remote"], - "description": "Generate a Remote Angular Micro-Frontend Application.", - "implementation": "/packages/angular/src/generators/mfe-remote/mfe-remote.ts", + "description": "Generate a Remote Angular Module Federation Application.", + "implementation": "/packages/angular/src/generators/remote/remote.ts", + "aliases": [], "hidden": false, - "path": "/packages/angular/src/generators/mfe-remote/schema.json" + "path": "/packages/angular/src/generators/remote/schema.json" }, { "name": "move", diff --git a/docs/packages.json b/docs/packages.json index 696e35fdeba7f..27d37b7510791 100644 --- a/docs/packages.json +++ b/docs/packages.json @@ -28,7 +28,7 @@ "karma-project", "library", "library-secondary-entry-point", - "mfe-remote", + "remote", "move", "convert-to-with-mf", "mfe-host", diff --git a/packages/angular/generators.json b/packages/angular/generators.json index 9efdae5565e8b..754bee0c5d24c 100644 --- a/packages/angular/generators.json +++ b/packages/angular/generators.json @@ -71,11 +71,10 @@ "aliases": ["secondary-entry-point", "entry-point"], "description": "Creates a secondary entry point for an Angular publishable library." }, - "mfe-remote": { - "factory": "./src/generators/mfe-remote/mfe-remote.compat", - "schema": "./src/generators/mfe-remote/schema.json", - "aliases": ["remote"], - "description": "Generate a Remote Angular Micro-Frontend Application." + "remote": { + "factory": "./src/generators/remote/remote.compat", + "schema": "./src/generators/remote/schema.json", + "description": "Generate a Remote Angular Module Federation Application." }, "move": { "factory": "./src/generators/move/move#angularMoveSchematic", @@ -220,11 +219,10 @@ "aliases": ["secondary-entry-point", "entry-point"], "description": "Creates a secondary entry point for an Angular publishable library." }, - "mfe-remote": { - "factory": "./src/generators/mfe-remote/mfe-remote", - "schema": "./src/generators/mfe-remote/schema.json", - "aliases": ["remote"], - "description": "Generate a Remote Angular Micro-Frontend Application." + "remote": { + "factory": "./src/generators/remote/remote", + "schema": "./src/generators/remote/schema.json", + "description": "Generate a Remote Angular Module Federation Application." }, "move": { "factory": "./src/generators/move/move#angularMoveGenerator", diff --git a/packages/angular/generators.ts b/packages/angular/generators.ts index f0a51b657d0f1..df885f1da5b41 100644 --- a/packages/angular/generators.ts +++ b/packages/angular/generators.ts @@ -21,4 +21,4 @@ export * from './src/generators/add-linting/add-linting'; export * from './src/generators/component-cypress-spec/component-cypress-spec'; export * from './src/generators/component-story/component-story'; export * from './src/generators/web-worker/web-worker'; -export * from './src/generators/mfe-remote/mfe-remote'; +export * from './src/generators/remote/remote'; diff --git a/packages/angular/src/generators/application/schema.json b/packages/angular/src/generators/application/schema.json index 8e6170d071279..677e7c0946a92 100644 --- a/packages/angular/src/generators/application/schema.json +++ b/packages/angular/src/generators/application/schema.json @@ -132,21 +132,21 @@ "description": "Generate a Module Federation configuration for the application", "type": "boolean", "default": false, - "x-deprecated": "Use the `mfe-host` or `mfe-remote` generators instead. Support for generating MFE applications using the application generator will be removed in an upcoming version." + "x-deprecated": "Use the `mfe-host` or `remote` generators instead. Support for generating MFE applications using the application generator will be removed in an upcoming version." }, "mfeType": { "type": "string", "enum": ["host", "remote"], "description": "Type of application to generate the Module Federation configuration for.", "default": "remote", - "x-deprecated": "Use the `mfe-host` or `mfe-remote` generators instead. Support for generating MFE applications using the application generator will be removed in an upcoming version." + "x-deprecated": "Use the `mfe-host` or `remote` generators instead. Support for generating MFE applications using the application generator will be removed in an upcoming version." }, "federationType": { "type": "string", "enum": ["static", "dynamic"], "description": "Use either Static or Dynamic Module Federation pattern for the application.", "default": "static", - "x-deprecated": "Use the `mfe-host` or `mfe-remote` generators instead. Support for generating MFE applications using the application generator will be removed in an upcoming version." + "x-deprecated": "Use the `mfe-host` or `remote` generators instead. Support for generating MFE applications using the application generator will be removed in an upcoming version." }, "port": { "type": "number", @@ -155,12 +155,12 @@ "remotes": { "type": "array", "description": "A list of remote application names that the host application should consume.", - "x-deprecated": "Use the `mfe-host` or `mfe-remote` generators instead. Support for generating MFE applications using the application generator will be removed in an upcoming version." + "x-deprecated": "Use the `mfe-host` or `remote` generators instead. Support for generating MFE applications using the application generator will be removed in an upcoming version." }, "host": { "type": "string", "description": "The name of the host application that the remote application will be consumed by.", - "x-deprecated": "Use the `mfe-host` or `mfe-remote` generators instead. Support for generating MFE applications using the application generator will be removed in an upcoming version." + "x-deprecated": "Use the `mfe-host` or `remote` generators instead. Support for generating MFE applications using the application generator will be removed in an upcoming version." }, "setParserOptionsProject": { "type": "boolean", diff --git a/packages/angular/src/generators/mfe-remote/mfe-remote.compat.ts b/packages/angular/src/generators/mfe-remote/mfe-remote.compat.ts deleted file mode 100644 index 1eaea63f5b31c..0000000000000 --- a/packages/angular/src/generators/mfe-remote/mfe-remote.compat.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { convertNxGenerator } from '@nrwl/devkit'; -import mfeRemote from './mfe-remote'; - -export default convertNxGenerator(mfeRemote); diff --git a/packages/angular/src/generators/mfe-remote/__snapshots__/mfe-remote.spec.ts.snap b/packages/angular/src/generators/remote/__snapshots__/remote.spec.ts.snap similarity index 100% rename from packages/angular/src/generators/mfe-remote/__snapshots__/mfe-remote.spec.ts.snap rename to packages/angular/src/generators/remote/__snapshots__/remote.spec.ts.snap diff --git a/packages/angular/src/generators/remote/remote.compat.ts b/packages/angular/src/generators/remote/remote.compat.ts new file mode 100644 index 0000000000000..4bc9f1fc8c0c1 --- /dev/null +++ b/packages/angular/src/generators/remote/remote.compat.ts @@ -0,0 +1,4 @@ +import { convertNxGenerator } from '@nrwl/devkit'; +import remote from './remote'; + +export default convertNxGenerator(remote); diff --git a/packages/angular/src/generators/mfe-remote/mfe-remote.spec.ts b/packages/angular/src/generators/remote/remote.spec.ts similarity index 91% rename from packages/angular/src/generators/mfe-remote/mfe-remote.spec.ts rename to packages/angular/src/generators/remote/remote.spec.ts index 0a07820bdf970..bd6c7307aabb5 100644 --- a/packages/angular/src/generators/mfe-remote/mfe-remote.spec.ts +++ b/packages/angular/src/generators/remote/remote.spec.ts @@ -1,5 +1,5 @@ import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; -import mfeRemote from './mfe-remote'; +import remote from './remote'; import applicationGenerator from '../application/application'; import { readProjectConfiguration } from '@nrwl/devkit'; @@ -9,7 +9,7 @@ describe('MFE Remote App Generator', () => { const tree = createTreeWithEmptyWorkspace(2); // ACT - await mfeRemote(tree, { + await remote(tree, { name: 'test', port: 4201, }); @@ -30,7 +30,7 @@ describe('MFE Remote App Generator', () => { }); // ACT - await mfeRemote(tree, { + await remote(tree, { name: 'test', host: 'host', port: 4201, @@ -47,7 +47,7 @@ describe('MFE Remote App Generator', () => { // ACT try { - await mfeRemote(tree, { + await remote(tree, { name: 'test', host: 'host', port: 4201, @@ -63,13 +63,13 @@ describe('MFE Remote App Generator', () => { it('should generate a remote mfe app and automatically find the next port available', async () => { // ARRANGE const tree = createTreeWithEmptyWorkspace(2); - await mfeRemote(tree, { + await remote(tree, { name: 'existing', port: 4201, }); // ACT - await mfeRemote(tree, { + await remote(tree, { name: 'test', }); @@ -83,7 +83,7 @@ describe('MFE Remote App Generator', () => { const tree = createTreeWithEmptyWorkspace(2); // ACT - await mfeRemote(tree, { + await remote(tree, { name: 'test', }); diff --git a/packages/angular/src/generators/mfe-remote/mfe-remote.ts b/packages/angular/src/generators/remote/remote.ts similarity index 94% rename from packages/angular/src/generators/mfe-remote/mfe-remote.ts rename to packages/angular/src/generators/remote/remote.ts index de32454f68c8b..0131ea4863f88 100644 --- a/packages/angular/src/generators/mfe-remote/mfe-remote.ts +++ b/packages/angular/src/generators/remote/remote.ts @@ -19,7 +19,7 @@ function findNextAvailablePort(tree: Tree) { return nextAvailablePort; } -export default async function mfeRemote(tree: Tree, options: Schema) { +export default async function remote(tree: Tree, options: Schema) { const projects = getProjects(tree); if (options.host && !projects.has(options.host)) { throw new Error( diff --git a/packages/angular/src/generators/mfe-remote/schema.d.ts b/packages/angular/src/generators/remote/schema.d.ts similarity index 100% rename from packages/angular/src/generators/mfe-remote/schema.d.ts rename to packages/angular/src/generators/remote/schema.d.ts diff --git a/packages/angular/src/generators/mfe-remote/schema.json b/packages/angular/src/generators/remote/schema.json similarity index 92% rename from packages/angular/src/generators/mfe-remote/schema.json rename to packages/angular/src/generators/remote/schema.json index fe2a38542058f..ab4c80d458719 100644 --- a/packages/angular/src/generators/mfe-remote/schema.json +++ b/packages/angular/src/generators/remote/schema.json @@ -1,14 +1,14 @@ { "$schema": "http://json-schema.org/schema", - "$id": "NxMFERemote", + "$id": "NxMFRemote", "cli": "nx", - "title": "Nx MFE Remote App", - "description": "Create an Angular Remote Micro Frontend Application.", + "title": "Nx Module Federation Remote App", + "description": "Create an Angular Remote Module Federation Application.", "type": "object", "examples": [ { - "command": "nx g @nrwl/angular:mfe-remote appName --host=host --port=4201", - "description": "Create an Angular app with configuration in place for MFE. If host is provided, attach this remote app to host app's configuration." + "command": "nx g @nrwl/angular:remote appName --host=host --port=4201", + "description": "Create an Angular app with configuration in place for Module Federation. If host is provided, attach this remote app to host app's configuration." } ], "properties": {