nx/docs/generated/packages/react/executors/module-federation-dev-server.json
Jason Jean 4254c4bcce
feat(core): allow executors to specify if they are continuous (#30821)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

The only way to set if a task is continuous is either directly in
`project.json` or via Project Graph Plugins.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Executors know if they are definitely continuous or not. Plenty of
existing continuous tasks are using executors. Executors are now able to
define if they are continuous in their `schema.json` files. Thus,
existing tasks configured with certain executors will automatically
become continuous.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-24 16:41:17 -04:00

144 lines
6.8 KiB
JSON

{
"name": "module-federation-dev-server",
"implementation": "/packages/react/src/executors/module-federation-dev-server/module-federation-dev-server.impl.ts",
"schema": {
"version": 2,
"continuous": true,
"outputCapture": "direct-nodejs",
"title": "Module Federation Dev Server",
"description": "Serve a web application.",
"cli": "nx",
"type": "object",
"properties": {
"devRemotes": {
"type": "array",
"items": {
"oneOf": [
{ "type": "string" },
{
"type": "object",
"properties": {
"remoteName": { "type": "string" },
"configuration": { "type": "string" }
},
"required": ["remoteName"],
"additionalProperties": false
}
]
},
"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 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",
"description": "Target which builds the application.",
"x-priority": "important"
},
"port": {
"type": "number",
"description": "Port to listen on.",
"default": 4200,
"x-priority": "important"
},
"host": {
"type": "string",
"description": "Host to listen on.",
"default": "localhost"
},
"ssl": {
"type": "boolean",
"description": "Serve using `HTTPS`.",
"default": false
},
"sslKey": {
"type": "string",
"description": "SSL key to use for serving `HTTPS`."
},
"sslCert": {
"type": "string",
"description": "SSL certificate to use for serving `HTTPS`."
},
"watch": {
"type": "boolean",
"description": "Watches for changes and rebuilds application.",
"default": true
},
"liveReload": {
"type": "boolean",
"description": "Whether to reload the page on change, using live-reload.",
"default": true
},
"hmr": {
"type": "boolean",
"description": "Enable hot module replacement.",
"default": false
},
"publicHost": {
"type": "string",
"description": "Public URL where the application will be served."
},
"open": {
"type": "boolean",
"description": "Open the application in the browser.",
"default": false,
"x-priority": "important"
},
"allowedHosts": {
"type": "string",
"description": "This option allows you to whitelist services that are allowed to access the dev server."
},
"memoryLimit": {
"type": "number",
"description": "Memory limit for type checking service process in `MB`."
},
"maxWorkers": {
"type": "number",
"description": "Number of workers to use for type checking."
},
"baseHref": {
"type": "string",
"description": "Base url for the application being built."
},
"static": {
"type": "boolean",
"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 Consumer (host) that is running this executor is the first in the project tree to do so.",
"default": true,
"x-priority": "internal",
"alias": "isInitialConsumer"
},
"parallel": {
"type": "number",
"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 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 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",
"presets": []
},
"description": "Serve a host or remote application.",
"aliases": [],
"hidden": false,
"path": "/packages/react/src/executors/module-federation-dev-server/schema.json",
"type": "executor"
}