Skip to content

Commit

Permalink
feat(angular): remove mfe-remote alias in favour of remote (#9832)
Browse files Browse the repository at this point in the history
  • Loading branch information
Coly010 committed Apr 14, 2022
1 parent 40403fa commit 73d8967
Show file tree
Hide file tree
Showing 12 changed files with 48 additions and 50 deletions.
32 changes: 16 additions & 16 deletions docs/generated/packages/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion docs/packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"karma-project",
"library",
"library-secondary-entry-point",
"mfe-remote",
"remote",
"move",
"convert-to-with-mf",
"mfe-host",
Expand Down
18 changes: 8 additions & 10 deletions packages/angular/generators.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/angular/generators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
10 changes: 5 additions & 5 deletions packages/angular/src/generators/application/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down

This file was deleted.

4 changes: 4 additions & 0 deletions packages/angular/src/generators/remote/remote.compat.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { convertNxGenerator } from '@nrwl/devkit';
import remote from './remote';

export default convertNxGenerator(remote);
Original file line number Diff line number Diff line change
@@ -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';

Expand All @@ -9,7 +9,7 @@ describe('MFE Remote App Generator', () => {
const tree = createTreeWithEmptyWorkspace(2);

// ACT
await mfeRemote(tree, {
await remote(tree, {
name: 'test',
port: 4201,
});
Expand All @@ -30,7 +30,7 @@ describe('MFE Remote App Generator', () => {
});

// ACT
await mfeRemote(tree, {
await remote(tree, {
name: 'test',
host: 'host',
port: 4201,
Expand All @@ -47,7 +47,7 @@ describe('MFE Remote App Generator', () => {

// ACT
try {
await mfeRemote(tree, {
await remote(tree, {
name: 'test',
host: 'host',
port: 4201,
Expand All @@ -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',
});

Expand All @@ -83,7 +83,7 @@ describe('MFE Remote App Generator', () => {
const tree = createTreeWithEmptyWorkspace(2);

// ACT
await mfeRemote(tree, {
await remote(tree, {
name: 'test',
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down

1 comment on commit 73d8967

@vercel
Copy link

@vercel vercel bot commented on 73d8967 Apr 14, 2022

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

nx-dev – ./

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

Please sign in to comment.