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

108 lines
3.0 KiB
JSON

{
"version": 2,
"continuous": true,
"outputCapture": "direct-nodejs",
"title": "File Server",
"description": "Serve a web application from a folder. This executor is a wrapper around the [http-server](https://www.npmjs.com/package/http-server) package.",
"type": "object",
"cli": "nx",
"properties": {
"buildTarget": {
"type": "string",
"description": "Target which builds the application."
},
"parallel": {
"type": "boolean",
"description": "Build the target in parallel.",
"default": true
},
"maxParallel": {
"type": "number",
"description": "Max number of parallel jobs."
},
"port": {
"type": "number",
"description": "Port to listen on.",
"default": 4200
},
"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`."
},
"proxyUrl": {
"type": "string",
"description": "URL to proxy unhandled requests to. _Note: If the 'spa' flag is set to true, manually setting this value will override the catch-all redirect functionality from http-server which may lead to unexpected behavior._"
},
"proxyOptions": {
"type": "object",
"description": "Options for the proxy used by `http-server`.",
"default": {},
"properties": {
"secure": {
"type": "boolean",
"default": false
}
},
"additionalProperties": true
},
"watch": {
"type": "boolean",
"description": "Watch for file changes.",
"default": true
},
"spa": {
"type": "boolean",
"description": "Redirect 404 errors to index.html (useful for SPA's)",
"default": false,
"x-priority": "important"
},
"staticFilePath": {
"type": "string",
"description": "Path where the build artifacts are located. If not provided then it will be infered from the buildTarget executor options as outputPath"
},
"cors": {
"oneOf": [
{
"type": "boolean"
},
{
"type": "string"
}
],
"description": "Enable CORS",
"default": true
},
"gzip": {
"type": "boolean",
"description": "Enable gzip compression",
"default": false
},
"brotli": {
"type": "boolean",
"description": "Enable brotli compression",
"default": false
},
"cacheSeconds": {
"type": "number",
"description": "Set cache time (in seconds) for cache-control max-age header. To disable caching, use -1. Caching defaults to disabled.",
"default": -1
}
},
"additionalProperties": true,
"examplesFile": "../../../docs/file-server-examples.md"
}