Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(angular): remove mfe-remote alias in favour of remote #9832

Merged
merged 1 commit into from
Apr 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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