feat(angular): remove mfe-remote alias in favour of remote (#9832)
This commit is contained in:
parent
40403fa58b
commit
73d8967a2b
@ -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",
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
"karma-project",
|
||||
"library",
|
||||
"library-secondary-entry-point",
|
||||
"mfe-remote",
|
||||
"remote",
|
||||
"move",
|
||||
"convert-to-with-mf",
|
||||
"mfe-host",
|
||||
|
||||
@ -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",
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -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",
|
||||
|
||||
@ -1,4 +0,0 @@
|
||||
import { convertNxGenerator } from '@nrwl/devkit';
|
||||
import mfeRemote from './mfe-remote';
|
||||
|
||||
export default convertNxGenerator(mfeRemote);
|
||||
4
packages/angular/src/generators/remote/remote.compat.ts
Normal file
4
packages/angular/src/generators/remote/remote.compat.ts
Normal file
@ -0,0 +1,4 @@
|
||||
import { convertNxGenerator } from '@nrwl/devkit';
|
||||
import remote from './remote';
|
||||
|
||||
export default convertNxGenerator(remote);
|
||||
@ -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',
|
||||
});
|
||||
|
||||
@ -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(
|
||||
@ -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": {
|
||||
Loading…
x
Reference in New Issue
Block a user