nx/docs/generated/packages/react/generators/federate-module.json
Colum Ferry aefafc55ba
feat(module-federation): alias host and remote generators to consumer and producer (#29190)
## Current Behavior
Our Module Federation support across Angular and React contains Host and
Remote generators.
The module-federation.io docs have started to shift towards Consumer and
Producer terminology for better translation of meanings across
languages.


## Expected Behavior
To stay consistent with official terminology, add aliases for the host
and remote generators to allow for the new terminology. i.e. host ->
consumer, remote -> producer.

Therefore the following are all valid

```shell
nx g host shell --remotes=remote1
nx g host shell --producers=producer1
nx g consumer shell --remotes=remote1
nx g consumer shell --producers=remote1

nx g remote remote1 --host=shell
nx g remote remote1 --consumer=shell
nx g producer producer1 --host=shell
nx g producer producer1 --consumer=shell
```
2024-12-04 16:45:27 +00:00

99 lines
3.6 KiB
JSON

{
"name": "federate-module",
"factory": "./src/generators/federate-module/federate-module#federateModuleGenerator",
"schema": {
"$schema": "https://json-schema.org/schema",
"cli": "nx",
"$id": "NxReactFederateModule",
"title": "Federate Module",
"description": "Create a federated module, which can be loaded by a Consumer (host) via a Producer (remote).",
"examples": [
{
"command": "nx g federate-module MyModule --path=./src/component/my-cmp.ts --remote=myRemote --remoteDirectory=apps/myRemote",
"description": "Create a federated module from myRemote, 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",
"properties": {
"path": {
"type": "string",
"$default": { "$source": "argv", "index": 0 },
"description": "The path to locate the federated module. This path should be relative to the workspace root and the file should exist.",
"x-prompt": "What is the path to the module to be federated?"
},
"name": {
"description": "The name of the module.",
"type": "string",
"x-prompt": "What name would you like to use for the module?",
"pattern": "^[a-zA-Z][^:]*$",
"x-priority": "important"
},
"remote": {
"type": "string",
"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 Producer (remote) application if one needs to be created.",
"type": "string",
"alias": "producerDirectory"
},
"style": {
"description": "The file extension to be used for style files.",
"type": "string",
"default": "none",
"alias": "s"
},
"linter": {
"description": "The tool to use for running lint checks.",
"type": "string",
"enum": ["eslint"],
"default": "eslint"
},
"skipFormat": {
"description": "Skip formatting files.",
"type": "boolean",
"default": false,
"x-priority": "internal"
},
"unitTestRunner": {
"type": "string",
"enum": ["jest", "none"],
"description": "Test runner to use for unit tests.",
"default": "jest"
},
"e2eTestRunner": {
"type": "string",
"enum": ["cypress", "playwright", "none"],
"description": "Test runner to use for end to end (E2E) tests.",
"x-prompt": "Which E2E test runner would you like to use?",
"default": "cypress"
},
"host": {
"type": "string",
"description": "The Consumer (host) application for this Producer (remote)."
},
"bundler": {
"description": "The bundler to use.",
"type": "string",
"enum": ["rspack", "webpack"],
"default": "rspack"
}
},
"required": ["name", "path", "remote"],
"additionalProperties": false,
"presets": []
},
"description": "Federate a module.",
"hidden": false,
"implementation": "/packages/react/src/generators/federate-module/federate-module#federateModuleGenerator.ts",
"aliases": [],
"path": "/packages/react/src/generators/federate-module/schema.json",
"type": "generator"
}