Skip to content

Commit

Permalink
Merge branch 'master' into fix/28349-polyglot-workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
KerickHowlett authored Dec 6, 2024
2 parents bcb92f7 + cc14411 commit 756614e
Show file tree
Hide file tree
Showing 150 changed files with 4,612 additions and 3,054 deletions.
10 changes: 9 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,17 @@
"rules": {
"@nx/workspace/ensure-pnpm-lock-version": [
"error",
{ "version": "9.0" }
{
"version": "9.0"
}
]
}
},
{
"files": ["*.ts"],
"rules": {
"@angular-eslint/prefer-standalone": "off"
}
}
]
}
29 changes: 18 additions & 11 deletions docs/generated/packages/angular/generators/federate-module.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@
"cli": "nx",
"$id": "NxReactFederateModule",
"title": "Federate Module",
"description": "Create a federated module, which is exposed by a remote and can be subsequently loaded by a host.",
"description": "Create a federated module, which is exposed by a Producer (remote) and can be subsequently loaded by a Consumer (host).",
"examples": [
{
"command": "nx g federate-module MyModule --path=./src/component/my-cmp.ts --remote=my-remote-app --remoteDirectory=apps/my-remote-app",
"command": "nx g federate-module MyModule --path=./src/component/my-cmp.ts --remote=myRemoteApp --remoteDirectory=apps/myRemoteApp",
"description": "Create a federated module from my-remote-app, that exposes my-cmp from ./src/component/my-cmp.ts as MyModule."
},
{
"command": "nx g federate-module MyModule --path=./src/component/my-cmp.ts --producer=myProducer --producerDirectory=apps/myProducer",
"description": "Create a federated module from myProducer, that exposes my-cmp from ./src/component/my-cmp.ts as MyModule."
}
],
"type": "object",
Expand All @@ -30,15 +34,17 @@
},
"remote": {
"type": "string",
"description": "The name of the remote.",
"x-prompt": "What is/should the remote be named?"
"description": "The name of the Producer (remote).",
"x-prompt": "What is/should the Producer (remote) be named?",
"alias": "producer"
},
"remoteDirectory": {
"description": "The directory of the new remote application if one needs to be created.",
"type": "string"
"description": "The directory of the new Producer (remote) application if one needs to be created.",
"type": "string",
"alias": "producerDirectory"
},
"style": {
"description": "The file extension to be used for style files for the remote if one needs to be created.",
"description": "The file extension to be used for style files for the Producer (remote) if one needs to be created.",
"type": "string",
"default": "css",
"enum": ["css", "scss", "sass", "less"]
Expand All @@ -52,24 +58,25 @@
"unitTestRunner": {
"type": "string",
"enum": ["jest", "vitest", "none"],
"description": "Test runner to use for unit tests of the remote if it needs to be created.",
"description": "Test runner to use for unit tests of the Producer (remote) if it needs to be created.",
"x-prompt": "Which unit test runner would you like to use?",
"default": "jest"
},
"e2eTestRunner": {
"type": "string",
"enum": ["cypress", "none"],
"description": "Test runner to use for end to end (e2e) tests of the remote if it needs to be created.",
"description": "Test runner to use for end to end (e2e) tests of the Producer (remote) if it needs to be created.",
"default": "cypress"
},
"standalone": {
"description": "Whether to generate the remote application with standalone components if it needs to be created.",
"description": "Whether to generate the Producer (remote) application with standalone components if it needs to be created.",
"type": "boolean",
"default": true
},
"host": {
"type": "string",
"description": "The host / shell application for this remote."
"description": "The Consumer (host) application for this Producer (remote).",
"alias": "consumer"
}
},
"required": ["name", "path", "remote"],
Expand Down
23 changes: 14 additions & 9 deletions docs/generated/packages/angular/generators/host.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@
"$schema": "https://json-schema.org/schema",
"$id": "NxMFHost",
"cli": "nx",
"title": "Nx Module Federation Host Application",
"description": "Create an Angular Host Module Federation Application.",
"title": "Nx Module Federation Consumer (Host) Application",
"description": "Create an Angular Consumer (Host) Module Federation Application.",
"type": "object",
"examples": [
{
"command": "nx g @nx/angular:host appName --remotes=remote1",
"description": "Create an Angular application with configuration in place for Module Federation. If the `remotes` option is provided, attach the remote application to this application's configuration"
"description": "Create an Angular application with configuration in place for Module Federation. If the `remotes` option is provided, attach the Producer (remote) application to this application's configuration"
},
{
"command": "nx g @nx/angular:consumer appName --producers=remote1",
"description": "Create an Angular application with configuration in place for Module Federation. If the `producers` option is provided, attach the Producer (remote) application to this application's configuration"
}
],
"properties": {
Expand All @@ -23,14 +27,15 @@
},
"name": {
"type": "string",
"description": "The name to give to the host Angular application.",
"description": "The name to give to the Consumer (host) Angular application.",
"pattern": "^[a-zA-Z][^:]*$",
"x-priority": "important"
},
"remotes": {
"type": "array",
"description": "The names of the remote applications to add to the host.",
"x-priority": "important"
"description": "The names of the Producers (remote) applications to add to the Consumer (host).",
"x-priority": "important",
"alias": "producers"
},
"dynamic": {
"type": "boolean",
Expand Down Expand Up @@ -160,11 +165,11 @@
},
"standalone": {
"type": "boolean",
"description": "Whether to generate a host application that uses standalone components.",
"description": "Whether to generate a Consumer (host) application that uses standalone components.",
"default": true
},
"ssr": {
"description": "Whether to configure SSR for the host application",
"description": "Whether to configure SSR for the Consumer (host) application",
"type": "boolean",
"default": false,
"x-priority": "important"
Expand All @@ -185,8 +190,8 @@
},
"x-type": "application",
"description": "Generate a Host Angular Module Federation Application.",
"aliases": ["consumer"],
"implementation": "/packages/angular/src/generators/host/host.ts",
"aliases": [],
"hidden": false,
"path": "/packages/angular/src/generators/host/schema.json",
"type": "generator"
Expand Down
23 changes: 14 additions & 9 deletions docs/generated/packages/angular/generators/remote.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@
"$schema": "https://json-schema.org/schema",
"$id": "NxMFRemote",
"cli": "nx",
"title": "Nx Module Federation Remote App",
"description": "Create an Angular Remote Module Federation Application.",
"title": "Nx Module Federation Producer (Remote) App",
"description": "Create an Angular Producer (Remote) Module Federation Application.",
"type": "object",
"examples": [
{
"command": "nx g @nx/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."
"description": "Create an Angular app with configuration in place for Module Federation. If Consumer (host) is provided, attach this Producer (remote) app to Consumer (host) app's configuration."
},
{
"command": "nx g @nx/angular:producer appName --consumer=host --port=4201",
"description": "Create an Angular app with configuration in place for Module Federation. If Consumer (host) is provided, attach this Producer (remote) app to Consumer (host) app's configuration."
}
],
"properties": {
Expand All @@ -23,15 +27,16 @@
},
"name": {
"type": "string",
"description": "The name to give to the remote Angular app.",
"description": "The name to give to the Producer (remote) Angular app.",
"pattern": "^[a-zA-Z_$][a-zA-Z_$0-9]*$",
"x-priority": "important"
},
"host": {
"type": "string",
"description": "The name of the host app to attach this remote app to.",
"description": "The name of the Consumer (host) app to attach this Producer (remote) app to.",
"x-dropdown": "projects",
"x-priority": "important"
"x-priority": "important",
"alias": "consumer"
},
"port": {
"type": "number",
Expand Down Expand Up @@ -153,12 +158,12 @@
"x-priority": "internal"
},
"standalone": {
"description": "Whether to generate a remote application with standalone components.",
"description": "Whether to generate a Producer (remote) application with standalone components.",
"type": "boolean",
"default": true
},
"ssr": {
"description": "Whether to configure SSR for the remote application to be consumed by a host application using SSR.",
"description": "Whether to configure SSR for the Producer (remote) application to be consumed by a Consumer (host) application using SSR.",
"type": "boolean",
"default": false
},
Expand All @@ -178,8 +183,8 @@
},
"x-type": "application",
"description": "Generate a Remote Angular Module Federation Application.",
"aliases": ["producer"],
"implementation": "/packages/angular/src/generators/remote/remote.ts",
"aliases": [],
"hidden": false,
"path": "/packages/angular/src/generators/remote/schema.json",
"type": "generator"
Expand Down
8 changes: 5 additions & 3 deletions docs/generated/packages/angular/generators/setup-mf.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,17 @@
},
"remotes": {
"type": "array",
"description": "A list of remote application names that the host application should consume."
"description": "A list of remote application names that the Consumer (host) application should consume.",
"alias": "producers"
},
"host": {
"type": "string",
"description": "The name of the host application that the remote application will be consumed by."
"description": "The name of the host application that the remote application will be consumed by.",
"alias": "consumer"
},
"routing": {
"type": "boolean",
"description": "Generate a routing setup to allow a host application to route to the remote application.",
"description": "Generate a routing setup to allow a Consumer (host) application to route to the Producer (remote) application.",
"x-priority": "important"
},
"skipFormat": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,16 @@
}
]
},
"description": "List of remote applications to run in development mode (i.e. using serve target).",
"x-priority": "important"
"description": "List of Producer (remote) applications to run in development mode (i.e. using serve target).",
"x-priority": "important",
"alias": "devProducers"
},
"skipRemotes": {
"type": "array",
"items": { "type": "string" },
"description": "List of remote applications to not automatically serve, either statically or in development mode. This will not remove the remotes from the `module-federation.config` file, and therefore the application may still try to fetch these remotes.\nThis option is useful if you have other means for serving the `remote` application(s).\n**NOTE:** Remotes that are not in the workspace will be skipped automatically.",
"x-priority": "important"
"description": "List of Producer (remote) applications to not automatically serve, either statically or in development mode. This will not remove the Producers (remotes) from the `module-federation.config` file, and therefore the application may still try to fetch these Producers (remotes).\nThis option is useful if you have other means for serving the Producer (remote) application(s).\n**NOTE:** Producers (remotes) that are not in the workspace will be skipped automatically.",
"x-priority": "important",
"alias": "skipProducers"
},
"buildTarget": {
"type": "string",
Expand Down Expand Up @@ -106,25 +108,27 @@
},
"static": {
"type": "boolean",
"description": "Whether to use a static file server instead of the webpack-dev-server. This should be used for remote applications that are also host applications."
"description": "Whether to use a static file server instead of the webpack-dev-server. This should be used for Producer (remote) applications that are also Consumer (host) applications."
},
"isInitialHost": {
"type": "boolean",
"description": "Whether the host that is running this executor is the first in the project tree to do so.",
"description": "Whether the Consumer (host) that is running this executor is the first in the project tree to do so.",
"default": true,
"x-priority": "internal"
"x-priority": "internal",
"alias": "isInitialConsumer"
},
"parallel": {
"type": "number",
"description": "Max number of parallel processes for building static remotes"
"description": "Max number of parallel processes for building static Producers (remotes)"
},
"staticRemotesPort": {
"type": "number",
"description": "The port at which to serve the file-server for the static remotes."
"description": "The port at which to serve the file-server for the static Producers (remotes).",
"alias": "staticProducersPort"
},
"pathToManifestFile": {
"type": "string",
"description": "Path to a Module Federation manifest file (e.g. `my/path/to/module-federation.manifest.json`) containing the dynamic remote applications relative to the workspace root."
"description": "Path to a Module Federation manifest file (e.g. `my/path/to/module-federation.manifest.json`) containing the dynamic Producer (remote) applications relative to the workspace root."
}
},
"examplesFile": "## Examples\n\n{% tabs %}\n\n{% tab label=\"Basic Usage\" %}\nThe Module Federation Dev Server will serve a host application and find the remote applications associated with the host and serve them statically also. \nSee an example set up of it below:\n\n```json\n{\n \"serve\": {\n \"executor\": \"@nx/react:module-federation-dev-server\",\n \"configurations\": {\n \"production\": {\n \"buildTarget\": \"host:build:production\"\n },\n \"development\": {\n \"buildTarget\": \"host:build:development\"\n }\n },\n \"defaultConfiguration\": \"development\",\n \"options\": {\n \"port\": 4200,\n \"publicHost\": \"http://localhost:4200\"\n }\n }\n}\n```\n\n{% /tab %}\n\n{% tab label=\"Serve host with remotes that can be live reloaded\" %}\nThe Module Federation Dev Server will serve a host application and find the remote applications associated with the host and serve a set selection with live reloading enabled also. \nSee an example set up of it below:\n\n```json\n{\n \"serve-with-hmr-remotes\": {\n \"executor\": \"@nx/react:module-federation-dev-server\",\n \"configurations\": {\n \"production\": {\n \"buildTarget\": \"host:build:production\"\n },\n \"development\": {\n \"buildTarget\": \"host:build:development\"\n }\n },\n \"defaultConfiguration\": \"development\",\n \"options\": {\n \"port\": 4200,\n \"publicHost\": \"http://localhost:4200\",\n \"devRemotes\": [\n \"remote1\",\n {\n \"remoteName\": \"remote2\",\n \"configuration\": \"development\"\n }\n ]\n }\n }\n}\n```\n\n{% /tab %}\n\n{% /tabs %}\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"version": 2,
"outputCapture": "direct-nodejs",
"title": "Module Federation SSR Dev Server",
"description": "Serve a SSR host application along with its known remotes.",
"description": "Serve a SSR Consumer (host) application along with its known Producers (remotes).",
"cli": "nx",
"type": "object",
"properties": {
Expand All @@ -28,14 +28,16 @@
"devRemotes": {
"type": "array",
"items": { "type": "string" },
"description": "List of remote applications to run in development mode (i.e. using serve target).",
"x-priority": "important"
"description": "List of Producer (remote) applications to run in development mode (i.e. using serve target).",
"x-priority": "important",
"alias": "devProducers"
},
"skipRemotes": {
"type": "array",
"items": { "type": "string" },
"description": "List of remote applications to not automatically serve, either statically or in development mode.",
"x-priority": "important"
"description": "List of Producer (remote) applications to not automatically serve, either statically or in development mode.",
"x-priority": "important",
"alias": "skipProducers"
},
"host": {
"type": "string",
Expand All @@ -44,11 +46,12 @@
},
"staticRemotesPort": {
"type": "number",
"description": "The port at which to serve the file-server for the static remotes."
"description": "The port at which to serve the file-server for the static Producers (remotes).",
"alias": "staticProducersPort"
},
"pathToManifestFile": {
"type": "string",
"description": "Path to a Module Federation manifest file (e.g. `my/path/to/module-federation.manifest.json`) containing the dynamic remote applications relative to the workspace root."
"description": "Path to a Module Federation manifest file (e.g. `my/path/to/module-federation.manifest.json`) containing the dynamic Producer (remote) applications relative to the workspace root."
},
"ssl": {
"type": "boolean",
Expand All @@ -65,9 +68,10 @@
},
"isInitialHost": {
"type": "boolean",
"description": "Whether the host that is running this executor is the first in the project tree to do so.",
"description": "Whether the Consumer (host) that is running this executor is the first in the project tree to do so.",
"default": true,
"x-priority": "internal"
"x-priority": "internal",
"alias": "isInitialConsumer"
}
},
"required": ["browserTarget", "serverTarget"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"version": 2,
"outputCapture": "direct-nodejs",
"title": "Module Federation Static Dev Server",
"description": "Serve a host application statically along with it's remotes.",
"description": "Serve a Consumer (host) application statically along with its Producers (remotes).",
"cli": "nx",
"type": "object",
"properties": { "serveTarget": { "type": "string" } },
Expand Down
Loading

0 comments on commit 756614e

Please sign in to comment.