diff --git a/bin/cli-flags.js b/bin/cli-flags.js index 30142b510b..8f5695e416 100644 --- a/bin/cli-flags.js +++ b/bin/cli-flags.js @@ -46,13 +46,13 @@ module.exports = { multiple: false, description: "Allows to broadcasts dev server via ZeroConf networking on start.", + negatedDescription: + "Disallows to broadcasts dev server via ZeroConf networking on start.", path: "bonjour", }, ], description: "Allows to broadcasts dev server via ZeroConf networking on start.", - negatedDescription: - "Disallows to broadcasts dev server via ZeroConf networking on start.", simpleType: "boolean", multiple: false, }, @@ -93,13 +93,13 @@ module.exports = { multiple: false, description: "Enables a full-screen overlay in the browser when there are compiler errors or warnings.", + negatedDescription: + "Disables a full-screen overlay in the browser when there are compiler errors or warnings.", path: "client.overlay", }, ], description: "Enables a full-screen overlay in the browser when there are compiler errors or warnings.", - negatedDescription: - "Disables a full-screen overlay in the browser when there are compiler errors or warnings.", simpleType: "boolean", multiple: false, }, @@ -140,12 +140,12 @@ module.exports = { multiple: false, description: "Prints compilation progress in percentage in the browser.", + negatedDescription: + "Does not print compilation progress in percentage in the browser.", path: "client.progress", }, ], description: "Prints compilation progress in percentage in the browser.", - negatedDescription: - "Does not print compilation progress in percentage in the browser.", simpleType: "boolean", multiple: false, }, @@ -156,6 +156,8 @@ module.exports = { multiple: false, description: "Tells dev-server the number of times it should try to reconnect the client.", + negatedDescription: + "Tells dev-server to not to try to connect the client.", path: "client.reconnect", }, { @@ -163,12 +165,13 @@ module.exports = { multiple: false, description: "Tells dev-server the number of times it should try to reconnect the client.", + negatedDescription: + "Tells dev-server to not to try to connect the client.", path: "client.reconnect", }, ], description: "Tells dev-server the number of times it should try to reconnect the client.", - negatedDescription: "Tells dev-server to not to try to connect the client.", simpleType: "string", multiple: false, }, @@ -321,11 +324,11 @@ module.exports = { type: "boolean", multiple: false, description: "Enables gzip compression for everything served.", + negatedDescription: "Disables gzip compression for everything served.", path: "compress", }, ], description: "Enables gzip compression for everything served.", - negatedDescription: "Disables gzip compression for everything served.", simpleType: "boolean", multiple: false, }, @@ -370,6 +373,7 @@ module.exports = { type: "boolean", multiple: false, description: "Enables Hot Module Replacement.", + negatedDescription: "Disables Hot Module Replacement.", path: "hot", }, { @@ -377,11 +381,11 @@ module.exports = { values: ["only"], multiple: false, description: "Enables Hot Module Replacement.", + negatedDescription: "Disables Hot Module Replacement.", path: "hot", }, ], description: "Enables Hot Module Replacement.", - negatedDescription: "Disables Hot Module Replacement.", simpleType: "string", multiple: false, }, @@ -392,12 +396,12 @@ module.exports = { multiple: false, description: "Allows to serve over HTTP/2 using SPDY. Deprecated, use the `server` option.", + negatedDescription: "Does not serve over HTTP/2 using SPDY.", path: "http2", }, ], description: "Allows to serve over HTTP/2 using SPDY. Deprecated, use the `server` option.", - negatedDescription: "Does not serve over HTTP/2 using SPDY.", simpleType: "boolean", multiple: false, }, @@ -408,13 +412,13 @@ module.exports = { multiple: false, description: "Allows to configure the server's listening socket for TLS (by default, dev server will be served over HTTP). Deprecated, use the `server` option.", + negatedDescription: + "Disallows to configure the server's listening socket for TLS (by default, dev server will be served over HTTP).", path: "https", }, ], description: "Allows to configure the server's listening socket for TLS (by default, dev server will be served over HTTP). Deprecated, use the `server` option.", - negatedDescription: - "Disallows to configure the server's listening socket for TLS (by default, dev server will be served over HTTP).", simpleType: "boolean", multiple: false, }, @@ -620,12 +624,12 @@ module.exports = { multiple: false, description: "Request for an SSL certificate. Deprecated, use the `server.options.requestCert` option.", + negatedDescription: "Does not request for an SSL certificate.", path: "https.requestCert", }, ], description: "Request for an SSL certificate. Deprecated, use the `server.options.requestCert` option.", - negatedDescription: "Does not request for an SSL certificate.", simpleType: "boolean", multiple: false, }, @@ -656,13 +660,13 @@ module.exports = { multiple: false, description: "Enables reload/refresh the page(s) when file changes are detected (enabled by default).", + negatedDescription: + "Disables reload/refresh the page(s) when file changes are detected (enabled by default).", path: "liveReload", }, ], description: "Enables reload/refresh the page(s) when file changes are detected (enabled by default).", - negatedDescription: - "Disables reload/refresh the page(s) when file changes are detected (enabled by default)", simpleType: "boolean", multiple: false, }, @@ -673,13 +677,13 @@ module.exports = { multiple: false, description: "Tells dev-server whether to enable magic HTML routes (routes corresponding to your webpack output, for example '/main' for 'main.js').", + negatedDescription: + "Disables magic HTML routes (routes corresponding to your webpack output, for example '/main' for 'main.js').", path: "magicHtml", }, ], description: "Tells dev-server whether to enable magic HTML routes (routes corresponding to your webpack output, for example '/main' for 'main.js').", - negatedDescription: - "Disables magic HTML routes (routes corresponding to your webpack output, for example '/main' for 'main.js').", simpleType: "boolean", multiple: false, }, @@ -697,12 +701,12 @@ module.exports = { multiple: false, description: "Allows to configure dev server to open the browser(s) and page(s) after server had been started (set it to true to open your default browser).", + negatedDescription: "Does not open the default browser.", path: "open", }, ], description: "Allows to configure dev server to open the browser(s) and page(s) after server had been started (set it to true to open your default browser).", - negatedDescription: "Does not open the default browser.", simpleType: "string", multiple: true, }, @@ -786,7 +790,6 @@ module.exports = { }, ], description: "Opens specified page in browser.", - negatedDescription: "Does not open specified page in browser.", simpleType: "string", multiple: true, }, @@ -1140,12 +1143,12 @@ module.exports = { multiple: true, description: "Tells dev server to use serveIndex middleware when enabled.", + negatedDescription: + "Does not tell dev server to use serveIndex middleware.", path: "static[].serveIndex", }, ], description: "Tells dev server to use serveIndex middleware when enabled.", - negatedDescription: - "Does not tell dev server to use serveIndex middleware.", simpleType: "boolean", multiple: true, }, @@ -1155,11 +1158,12 @@ module.exports = { type: "boolean", multiple: true, description: "Watches for files in static content directory.", + negatedDescription: + "Does not watch for files in static content directory.", path: "static[].watch", }, ], description: "Watches for files in static content directory.", - negatedDescription: "Does not watch for files in static content directory.", simpleType: "boolean", multiple: true, }, diff --git a/lib/options.json b/lib/options.json index fa1dbb42a5..9e4c845c51 100644 --- a/lib/options.json +++ b/lib/options.json @@ -37,7 +37,10 @@ } ], "description": "Allows to broadcasts dev server via ZeroConf networking on start.", - "link": " https://webpack.js.org/configuration/dev-server/#devserverbonjour" + "link": " https://webpack.js.org/configuration/dev-server/#devserverbonjour", + "cli": { + "negatedDescription": "Disallows to broadcasts dev server via ZeroConf networking on start." + } }, "Client": { "description": "Allows to specify options for client script in the browser or disable client script.", @@ -82,7 +85,10 @@ { "description": "Enables a full-screen overlay in the browser when there are compiler errors or warnings.", "link": "https://webpack.js.org/configuration/dev-server/#overlay", - "type": "boolean" + "type": "boolean", + "cli": { + "negatedDescription": "Disables a full-screen overlay in the browser when there are compiler errors or warnings." + } }, { "type": "object", @@ -103,7 +109,10 @@ "ClientProgress": { "description": "Prints compilation progress in percentage in the browser.", "link": "https://webpack.js.org/configuration/dev-server/#progress", - "type": "boolean" + "type": "boolean", + "cli": { + "negatedDescription": "Does not print compilation progress in percentage in the browser." + } }, "ClientReconnect": { "description": "Tells dev-server the number of times it should try to reconnect the client.", @@ -116,7 +125,10 @@ "type": "number", "minimum": 0 } - ] + ], + "cli": { + "negatedDescription": "Tells dev-server to not to try to connect the client." + } }, "ClientWebSocketTransport": { "anyOf": [ @@ -197,7 +209,10 @@ "Compress": { "type": "boolean", "description": "Enables gzip compression for everything served.", - "link": "https://webpack.js.org/configuration/dev-server/#devservercompress" + "link": "https://webpack.js.org/configuration/dev-server/#devservercompress", + "cli": { + "negatedDescription": "Disables gzip compression for everything served." + } }, "DevMiddleware": { "description": "Provide options to 'webpack-dev-middleware' which handles webpack assets.", @@ -208,12 +223,18 @@ "HTTP2": { "type": "boolean", "description": "Allows to serve over HTTP/2 using SPDY. Deprecated, use the `server` option.", - "link": "https://webpack.js.org/configuration/dev-server/#devserverhttp2" + "link": "https://webpack.js.org/configuration/dev-server/#devserverhttp2", + "cli": { + "negatedDescription": "Does not serve over HTTP/2 using SPDY." + } }, "HTTPS": { "anyOf": [ { - "type": "boolean" + "type": "boolean", + "cli": { + "negatedDescription": "Disallows to configure the server's listening socket for TLS (by default, dev server will be served over HTTP)." + } }, { "type": "object", @@ -225,7 +246,10 @@ }, "requestCert": { "type": "boolean", - "description": "Request for an SSL certificate. Deprecated, use the `server.options.requestCert` option." + "description": "Request for an SSL certificate. Deprecated, use the `server.options.requestCert` option.", + "cli": { + "negatedDescription": "Does not request for an SSL certificate." + } }, "ca": { "anyOf": [ @@ -458,7 +482,10 @@ } ], "description": "Enables Hot Module Replacement.", - "link": "https://webpack.js.org/configuration/dev-server/#devserverhot" + "link": "https://webpack.js.org/configuration/dev-server/#devserverhot", + "cli": { + "negatedDescription": "Disables Hot Module Replacement." + } }, "IPC": { "anyOf": [ @@ -477,11 +504,17 @@ "LiveReload": { "type": "boolean", "description": "Enables reload/refresh the page(s) when file changes are detected (enabled by default).", + "cli": { + "negatedDescription": "Disables reload/refresh the page(s) when file changes are detected (enabled by default)." + }, "link": "https://webpack.js.org/configuration/dev-server/#devserverlivereload" }, "MagicHTML": { "type": "boolean", "description": "Tells dev-server whether to enable magic HTML routes (routes corresponding to your webpack output, for example '/main' for 'main.js').", + "cli": { + "negatedDescription": "Disables magic HTML routes (routes corresponding to your webpack output, for example '/main' for 'main.js')." + }, "link": "https://webpack.js.org/configuration/dev-server/#devservermagichtml" }, "OnAfterSetupMiddleware": { @@ -528,7 +561,10 @@ "link": "https://webpack.js.org/configuration/dev-server/#devserveropen" }, "OpenBoolean": { - "type": "boolean" + "type": "boolean", + "cli": { + "negatedDescription": "Does not open the default browser." + } }, "OpenObject": { "type": "object", @@ -934,6 +970,9 @@ } ], "description": "Tells dev server to use serveIndex middleware when enabled.", + "cli": { + "negatedDescription": "Does not tell dev server to use serveIndex middleware." + }, "link": "https://webpack.js.org/configuration/dev-server/#serveindex" }, "watch": { @@ -948,6 +987,9 @@ } ], "description": "Watches for files in static content directory.", + "cli": { + "negatedDescription": "Does not watch for files in static content directory." + }, "link": "https://webpack.js.org/configuration/dev-server/#watch" } } diff --git a/test/cli/__snapshots__/basic.test.js.snap.webpack4 b/test/cli/__snapshots__/basic.test.js.snap.webpack4 index 5c22e36f1e..3ff6fc34af 100644 --- a/test/cli/__snapshots__/basic.test.js.snap.webpack4 +++ b/test/cli/__snapshots__/basic.test.js.snap.webpack4 @@ -106,7 +106,7 @@ Options: --no-https-request-cert Does not request for an SSL certificate. --ipc [value] Listen to a unix socket. --live-reload Enables reload/refresh the page(s) when file changes are detected (enabled by default). - --no-live-reload Disables reload/refresh the page(s) when file changes are detected (enabled by default) + --no-live-reload Disables reload/refresh the page(s) when file changes are detected (enabled by default). --magic-html Tells dev-server whether to enable magic HTML routes (routes corresponding to your webpack output, for example '/main' for 'main.js'). --no-magic-html Disables magic HTML routes (routes corresponding to your webpack output, for example '/main' for 'main.js'). --open [value...] Allows to configure dev server to open the browser(s) and page(s) after server had been started (set it to true to open your default browser). diff --git a/test/cli/__snapshots__/basic.test.js.snap.webpack5 b/test/cli/__snapshots__/basic.test.js.snap.webpack5 index 17de303235..de98c270c8 100644 --- a/test/cli/__snapshots__/basic.test.js.snap.webpack5 +++ b/test/cli/__snapshots__/basic.test.js.snap.webpack5 @@ -58,19 +58,19 @@ Options: --allowed-hosts Allows to enumerate the hosts from which access to the dev server are allowed (useful when you are proxying dev server, by default is 'auto'). --allowed-hosts-reset Clear all items provided in 'allowedHosts' configuration. Allows to enumerate the hosts from which access to the dev server are allowed (useful when you are proxying dev server, by default is 'auto'). --bonjour Allows to broadcasts dev server via ZeroConf networking on start. - --no-bonjour Negative 'bonjour' option. + --no-bonjour Disallows to broadcasts dev server via ZeroConf networking on start. --no-client Negative 'client' option. --client-logging Allows to set log level in the browser. --client-overlay Enables a full-screen overlay in the browser when there are compiler errors or warnings. - --no-client-overlay Negative 'client-overlay' option. + --no-client-overlay Disables a full-screen overlay in the browser when there are compiler errors or warnings. --client-overlay-errors Enables a full-screen overlay in the browser when there are compiler errors. --no-client-overlay-errors Negative 'client-overlay-errors' option. --client-overlay-warnings Enables a full-screen overlay in the browser when there are compiler warnings. --no-client-overlay-warnings Negative 'client-overlay-warnings' option. --client-progress Prints compilation progress in percentage in the browser. - --no-client-progress Negative 'client-progress' option. + --no-client-progress Does not print compilation progress in percentage in the browser. --client-reconnect [value] Tells dev-server the number of times it should try to reconnect the client. - --no-client-reconnect Negative 'client-reconnect' option. + --no-client-reconnect Tells dev-server to not to try to connect the client. --client-web-socket-transport Allows to set custom web socket transport to communicate with dev server. --client-web-socket-url Allows to specify URL to web socket server (useful when you're proxying dev server and client script does not always know where to connect to). --client-web-socket-url-hostname Tells clients connected to devServer to use the provided hostname. @@ -80,19 +80,19 @@ Options: --client-web-socket-url-protocol Tells clients connected to devServer to use the provided protocol. --client-web-socket-url-username Tells clients connected to devServer to use the provided username to authenticate. --compress Enables gzip compression for everything served. - --no-compress Negative 'compress' option. + --no-compress Disables gzip compression for everything served. --history-api-fallback Allows to proxy requests through a specified index page (by default 'index.html'), useful for Single Page Applications that utilise the HTML5 History API. --no-history-api-fallback Negative 'history-api-fallback' option. --host Allows to specify a hostname to use. --hot [value] Enables Hot Module Replacement. - --no-hot Negative 'hot' option. + --no-hot Disables Hot Module Replacement. --http2 Allows to serve over HTTP/2 using SPDY. Deprecated, use the \`server\` option. - --no-http2 Negative 'http2' option. + --no-http2 Does not serve over HTTP/2 using SPDY. --https Allows to configure the server's listening socket for TLS (by default, dev server will be served over HTTP). Deprecated, use the \`server\` option. - --no-https Negative 'https' option. + --no-https Disallows to configure the server's listening socket for TLS (by default, dev server will be served over HTTP). --https-passphrase Passphrase for a pfx file. Deprecated, use the \`server.options.passphrase\` option. --https-request-cert Request for an SSL certificate. Deprecated, use the \`server.options.requestCert\` option. - --no-https-request-cert Negative 'https-request-cert' option. + --no-https-request-cert Does not request for an SSL certificate. --https-ca Path to an SSL CA certificate or content of an SSL CA certificate. Deprecated, use the \`server.options.ca\` option. --https-ca-reset Clear all items provided in 'https.ca' configuration. Path to an SSL CA certificate or content of an SSL CA certificate. Deprecated, use the \`server.options.ca\` option. --https-cacert Path to an SSL CA certificate or content of an SSL CA certificate. Deprecated, use the \`server.options.ca\` option. @@ -107,11 +107,11 @@ Options: --https-pfx-reset Clear all items provided in 'https.pfx' configuration. Path to an SSL pfx file or content of an SSL pfx file. Deprecated, use the \`server.options.pfx\` option. --ipc [value] Listen to a unix socket. --live-reload Enables reload/refresh the page(s) when file changes are detected (enabled by default). - --no-live-reload Negative 'live-reload' option. + --no-live-reload Disables reload/refresh the page(s) when file changes are detected (enabled by default). --magic-html Tells dev-server whether to enable magic HTML routes (routes corresponding to your webpack output, for example '/main' for 'main.js'). - --no-magic-html Negative 'magic-html' option. + --no-magic-html Disables magic HTML routes (routes corresponding to your webpack output, for example '/main' for 'main.js'). --open [value...] Allows to configure dev server to open the browser(s) and page(s) after server had been started (set it to true to open your default browser). - --no-open Negative 'open' option. + --no-open Does not open the default browser. --open-target Opens specified page in browser. --open-app-name Open specified browser. --open-app Open specified browser. Deprecated: please use '--open-app-name'. @@ -140,9 +140,9 @@ Options: --static-directory Directory for static contents. --static-public-path The static files will be available in the browser under this public path. --static-serve-index Tells dev server to use serveIndex middleware when enabled. - --no-static-serve-index Negative 'static-serve-index' option. + --no-static-serve-index Does not tell dev server to use serveIndex middleware. --static-watch Watches for files in static content directory. - --no-static-watch Negative 'static-watch' option. + --no-static-watch Does not watch for files in static content directory. --static-reset Clear all items provided in 'static' configuration. Allows to configure options for serving static files from directory (by default 'public' directory). --static-public-path-reset Clear all items provided in 'static.publicPath' configuration. The static files will be available in the browser under this public path. --watch-files Allows to configure list of globs/directories/files to watch for file changes. diff --git a/test/cli/basic.test.js b/test/cli/basic.test.js index f501f0ef6a..2e0d635aba 100644 --- a/test/cli/basic.test.js +++ b/test/cli/basic.test.js @@ -21,10 +21,6 @@ describe("basic", () => { const normalizedCliOptions = {}; for (const [name, options] of Object.entries(cliOptions)) { - // Only webpack-cli supports it - // TODO send PR to webpack - delete options.negatedDescription; - normalizedCliOptions[name] = options; } diff --git a/types/bin/cli-flags.d.ts b/types/bin/cli-flags.d.ts index b87ad93353..fe6566cffc 100644 --- a/types/bin/cli-flags.d.ts +++ b/types/bin/cli-flags.d.ts @@ -35,10 +35,10 @@ declare const _exports: { type: string; multiple: boolean; description: string; + negatedDescription: string; path: string; }[]; description: string; - negatedDescription: string; simpleType: string; multiple: boolean; }; @@ -71,10 +71,10 @@ declare const _exports: { type: string; multiple: boolean; description: string; + negatedDescription: string; path: string; }[]; description: string; - negatedDescription: string; simpleType: string; multiple: boolean; }; @@ -105,10 +105,10 @@ declare const _exports: { type: string; multiple: boolean; description: string; + negatedDescription: string; path: string; }[]; description: string; - negatedDescription: string; simpleType: string; multiple: boolean; }; @@ -117,10 +117,10 @@ declare const _exports: { type: string; multiple: boolean; description: string; + negatedDescription: string; path: string; }[]; description: string; - negatedDescription: string; simpleType: string; multiple: boolean; }; @@ -235,10 +235,10 @@ declare const _exports: { type: string; multiple: boolean; description: string; + negatedDescription: string; path: string; }[]; description: string; - negatedDescription: string; simpleType: string; multiple: boolean; }; @@ -279,6 +279,7 @@ declare const _exports: { type: string; multiple: boolean; description: string; + negatedDescription: string; path: string; } | { @@ -286,11 +287,11 @@ declare const _exports: { values: string[]; multiple: boolean; description: string; + negatedDescription: string; path: string; } )[]; description: string; - negatedDescription: string; simpleType: string; multiple: boolean; }; @@ -299,10 +300,10 @@ declare const _exports: { type: string; multiple: boolean; description: string; + negatedDescription: string; path: string; }[]; description: string; - negatedDescription: string; simpleType: string; multiple: boolean; }; @@ -311,10 +312,10 @@ declare const _exports: { type: string; multiple: boolean; description: string; + negatedDescription: string; path: string; }[]; description: string; - negatedDescription: string; simpleType: string; multiple: boolean; }; @@ -466,10 +467,10 @@ declare const _exports: { type: string; multiple: boolean; description: string; + negatedDescription: string; path: string; }[]; description: string; - negatedDescription: string; simpleType: string; multiple: boolean; }; @@ -498,10 +499,10 @@ declare const _exports: { type: string; multiple: boolean; description: string; + negatedDescription: string; path: string; }[]; description: string; - negatedDescription: string; simpleType: string; multiple: boolean; }; @@ -510,22 +511,30 @@ declare const _exports: { type: string; multiple: boolean; description: string; + negatedDescription: string; path: string; }[]; description: string; - negatedDescription: string; simpleType: string; multiple: boolean; }; open: { - configs: { - type: string; - multiple: boolean; - description: string; - path: string; - }[]; + configs: ( + | { + type: string; + multiple: boolean; + description: string; + path: string; + } + | { + type: string; + multiple: boolean; + description: string; + negatedDescription: string; + path: string; + } + )[]; description: string; - negatedDescription: string; simpleType: string; multiple: boolean; }; @@ -581,7 +590,6 @@ declare const _exports: { path: string; }[]; description: string; - negatedDescription: string; simpleType: string; multiple: boolean; }; @@ -842,10 +850,10 @@ declare const _exports: { type: string; multiple: boolean; description: string; + negatedDescription: string; path: string; }[]; description: string; - negatedDescription: string; simpleType: string; multiple: boolean; }; @@ -854,10 +862,10 @@ declare const _exports: { type: string; multiple: boolean; description: string; + negatedDescription: string; path: string; }[]; description: string; - negatedDescription: string; simpleType: string; multiple: boolean; }; diff --git a/types/lib/Server.d.ts b/types/lib/Server.d.ts index cfaa0013b7..e8943e2e14 100644 --- a/types/lib/Server.d.ts +++ b/types/lib/Server.d.ts @@ -200,10 +200,10 @@ declare class Server { type: string; multiple: boolean; description: string; + negatedDescription: string; path: string; }[]; description: string; - negatedDescription: string; simpleType: string; multiple: boolean; }; @@ -211,160 +211,20 @@ declare class Server { configs: { description: string; multiple: boolean; - path: string; + path: string /** @typedef {import("http").IncomingMessage} IncomingMessage */; type: string; values: boolean[]; }[]; - description: string; - multiple: boolean; - simpleType: string; - }; - "client-logging": { - configs: { - type: string; - values: string[]; - /** - * @template Request, Response - * @typedef {import("webpack-dev-middleware").Options} DevMiddlewareOptions - */ - /** - * @template Request, Response - * @typedef {import("webpack-dev-middleware").Context} DevMiddlewareContext - */ - /** - * @typedef {"local-ip" | "local-ipv4" | "local-ipv6" | string} Host - */ - /** - * @typedef {number | string | "auto"} Port - */ - /** - * @typedef {Object} WatchFiles - * @property {string | string[]} paths - * @property {WatchOptions & { aggregateTimeout?: number, ignored?: AnymatchMatcher | string[], poll?: number | boolean }} [options] - */ - /** - * @typedef {Object} Static - * @property {string} [directory] - * @property {string | string[]} [publicPath] - * @property {boolean | ServeIndexOptions} [serveIndex] - * @property {ServeStaticOptions} [staticOptions] - * @property {boolean | WatchOptions & { aggregateTimeout?: number, ignored?: AnymatchMatcher | string[], poll?: number | boolean }} [watch] - */ - /** - * @typedef {Object} NormalizedStatic - * @property {string} directory - * @property {string[]} publicPath - * @property {false | ServeIndexOptions} serveIndex - * @property {ServeStaticOptions} staticOptions - * @property {false | WatchOptions} watch - */ - /** - * @typedef {Object} ServerConfiguration - * @property {"http" | "https" | "spdy" | string} [type] - * @property {ServerOptions} [options] - */ - /** - * @typedef {Object} WebSocketServerConfiguration - * @property {"sockjs" | "ws" | string | Function} [type] - * @property {Record} [options] - */ - /** - * @typedef {(import("ws").WebSocket | import("sockjs").Connection & { send: import("ws").WebSocket["send"], terminate: import("ws").WebSocket["terminate"], ping: import("ws").WebSocket["ping"] }) & { isAlive?: boolean }} ClientConnection - */ - /** - * @typedef {import("ws").WebSocketServer | import("sockjs").Server & { close: import("ws").WebSocketServer["close"] }} WebSocketServer - */ - /** - * @typedef {{ implementation: WebSocketServer, clients: ClientConnection[] }} WebSocketServerImplementation - */ - /** - * @callback ByPass - * @param {Request} req - * @param {Response} res - * @param {ProxyConfigArrayItem} proxyConfig - */ - /** - * @typedef {{ path?: HttpProxyMiddlewareOptionsFilter | undefined, context?: HttpProxyMiddlewareOptionsFilter | undefined } & { bypass?: ByPass } & HttpProxyMiddlewareOptions } ProxyConfigArrayItem - */ - /** - * @typedef {(ProxyConfigArrayItem | ((req?: Request | undefined, res?: Response | undefined, next?: NextFunction | undefined) => ProxyConfigArrayItem))[]} ProxyConfigArray - */ - /** - * @typedef {{ [url: string]: string | ProxyConfigArrayItem }} ProxyConfigMap - */ - /** - * @typedef {Object} OpenApp - * @property {string} [name] - * @property {string[]} [arguments] - */ - /** - * @typedef {Object} Open - * @property {string | string[] | OpenApp} [app] - * @property {string | string[]} [target] - */ - /** - * @typedef {Object} NormalizedOpen - * @property {string} target - * @property {import("open").Options} options - */ - /** - * @typedef {Object} WebSocketURL - * @property {string} [hostname] - * @property {string} [password] - * @property {string} [pathname] - * @property {number | string} [port] - * @property {string} [protocol] - * @property {string} [username] - */ - /** - * @typedef {Object} ClientConfiguration - * @property {"log" | "info" | "warn" | "error" | "none" | "verbose"} [logging] - * @property {boolean | { warnings?: boolean, errors?: boolean }} [overlay] - * @property {boolean} [progress] - * @property {boolean | number} [reconnect] - * @property {"ws" | "sockjs" | string} [webSocketTransport] - * @property {string | WebSocketURL} [webSocketURL] - */ - /** - * @typedef {Array<{ key: string; value: string }> | Record} Headers - */ - /** - * @typedef {{ name?: string, path?: string, middleware: ExpressRequestHandler | ExpressErrorRequestHandler } | ExpressRequestHandler | ExpressErrorRequestHandler} Middleware - */ - /** - * @typedef {Object} Configuration - * @property {boolean | string} [ipc] - * @property {Host} [host] - * @property {Port} [port] - * @property {boolean | "only"} [hot] - * @property {boolean} [liveReload] - * @property {DevMiddlewareOptions} [devMiddleware] - * @property {boolean} [compress] - * @property {boolean} [magicHtml] - * @property {"auto" | "all" | string | string[]} [allowedHosts] - * @property {boolean | ConnectHistoryApiFallbackOptions} [historyApiFallback] - * @property {boolean} [setupExitSignals] - * @property {boolean | BonjourOptions} [bonjour] - * @property {string | string[] | WatchFiles | Array} [watchFiles] - * @property {boolean | string | Static | Array} [static] - * @property {boolean | ServerOptions} [https] - * @property {boolean} [http2] - * @property {"http" | "https" | "spdy" | string | ServerConfiguration} [server] - * @property {boolean | "sockjs" | "ws" | string | WebSocketServerConfiguration} [webSocketServer] - * @property {ProxyConfigMap | ProxyConfigArrayItem | ProxyConfigArray} [proxy] - * @property {boolean | string | Open | Array} [open] - * @property {boolean} [setupExitSignals] - * @property {boolean | ClientConfiguration} [client] - * @property {Headers | ((req: Request, res: Response, context: DevMiddlewareContext) => Headers)} [headers] - * @property {(devServer: Server) => void} [onAfterSetupMiddleware] - * @property {(devServer: Server) => void} [onBeforeSetupMiddleware] - * @property {(devServer: Server) => void} [onListening] - * @property {(middlewares: Middleware[], devServer: Server) => Middleware[]} [setupMiddlewares] - */ - multiple: boolean; - description: string; - path: string; - }[]; + /** @typedef {import("open").Options} OpenOptions */ + /** @typedef {import("https").ServerOptions & { spdy?: { plain?: boolean | undefined, ssl?: boolean | undefined, 'x-forwarded-for'?: string | undefined, protocol?: string | undefined, protocols?: string[] | undefined }}} ServerOptions */ + /** + * @template Request, Response + * @typedef {import("webpack-dev-middleware").Options} DevMiddlewareOptions + */ + /** + * @template Request, Response + * @typedef {import("webpack-dev-middleware").Context} DevMiddlewareContext + */ /** * @typedef {"local-ip" | "local-ipv4" | "local-ipv6" | string} Host */ @@ -496,62 +356,68 @@ declare class Server { * @property {(middlewares: Middleware[], devServer: Server) => Middleware[]} [setupMiddlewares] */ description: string; + multiple: boolean; + simpleType: string; + }; + "client-logging": { + configs: { + type: string; + values: string[]; + multiple: boolean; + description: string; + path: string; + }[]; + description: string; simpleType: string; multiple: boolean; }; "client-overlay": { - /** - * @typedef {"local-ip" | "local-ipv4" | "local-ipv6" | string} Host - */ - /** - * @typedef {number | string | "auto"} Port - */ - /** - * @typedef {Object} WatchFiles - * @property {string | string[]} paths - * @property {WatchOptions & { aggregateTimeout?: number, ignored?: AnymatchMatcher | string[], poll?: number | boolean }} [options] - */ - /** - * @typedef {Object} Static - * @property {string} [directory] - * @property {string | string[]} [publicPath] - * @property {boolean | ServeIndexOptions} [serveIndex] - * @property {ServeStaticOptions} [staticOptions] - * @property {boolean | WatchOptions & { aggregateTimeout?: number, ignored?: AnymatchMatcher | string[], poll?: number | boolean }} [watch] - */ - /** - * @typedef {Object} NormalizedStatic - * @property {string} directory - * @property {string[]} publicPath - * @property {false | ServeIndexOptions} serveIndex - * @property {ServeStaticOptions} staticOptions - * @property {false | WatchOptions} watch - */ - /** - * @typedef {Object} ServerConfiguration - * @property {"http" | "https" | "spdy" | string} [type] - * @property {ServerOptions} [options] - */ - /** - * @typedef {Object} WebSocketServerConfiguration - * @property {"sockjs" | "ws" | string | Function} [type] - * @property {Record} [options] - */ - /** - * @typedef {(import("ws").WebSocket | import("sockjs").Connection & { send: import("ws").WebSocket["send"], terminate: import("ws").WebSocket["terminate"], ping: import("ws").WebSocket["ping"] }) & { isAlive?: boolean }} ClientConnection - */ - /** - * @typedef {import("ws").WebSocketServer | import("sockjs").Server & { close: import("ws").WebSocketServer["close"] }} WebSocketServer - */ - /** - * @typedef {{ implementation: WebSocketServer, clients: ClientConnection[] }} WebSocketServerImplementation - */ - /** - * @callback ByPass - * @param {Request} req - * @param {Response} res - * @param {ProxyConfigArrayItem} proxyConfig - */ + configs: { + type: string; + multiple: boolean; + description: string; + negatedDescription: string; + path: string; + }[]; + description: string; + simpleType: string; + multiple: boolean; + }; + "client-overlay-errors": { + configs: { + type: string; + multiple: boolean; + description: string; + path: string; + }[]; + description: string; + simpleType: string; + multiple: boolean; + }; + "client-overlay-warnings": { + configs: { + type: string; + multiple: boolean; + description: string; + path: string; + }[]; + description: string; + simpleType: string; + multiple: boolean; + }; + "client-progress": { + configs: { + type: string; + multiple: boolean; + description: string; + negatedDescription: string; + path: string; + }[]; + description: string; + simpleType: string; + multiple: boolean; + }; + "client-reconnect": { /** * @typedef {{ path?: HttpProxyMiddlewareOptionsFilter | undefined, context?: HttpProxyMiddlewareOptionsFilter | undefined } & { bypass?: ByPass } & HttpProxyMiddlewareOptions } ProxyConfigArrayItem */ @@ -634,134 +500,10 @@ declare class Server { type: string; multiple: boolean; description: string; + negatedDescription: string; path: string; }[]; description: string; - negatedDescription: string; - simpleType: string; - multiple: boolean; - }; - "client-overlay-errors": { - configs: { - type: string; - multiple: boolean; - description: string; - path: string; - }[]; - description: string; - simpleType: string; - multiple: boolean; - }; - "client-overlay-warnings": { - configs: { - type: string; - multiple: boolean; - description: string; - path: string; - }[]; - description: string; - simpleType: string; - multiple: boolean; - }; - "client-progress": { - configs: { - type: string; - multiple: boolean; - description: string; - path: string; - }[]; - description: string; - negatedDescription: string; - simpleType: string; - multiple: boolean; - }; - "client-reconnect": { - configs: { - /** - * @typedef {{ path?: HttpProxyMiddlewareOptionsFilter | undefined, context?: HttpProxyMiddlewareOptionsFilter | undefined } & { bypass?: ByPass } & HttpProxyMiddlewareOptions } ProxyConfigArrayItem - */ - /** - * @typedef {(ProxyConfigArrayItem | ((req?: Request | undefined, res?: Response | undefined, next?: NextFunction | undefined) => ProxyConfigArrayItem))[]} ProxyConfigArray - */ - /** - * @typedef {{ [url: string]: string | ProxyConfigArrayItem }} ProxyConfigMap - */ - /** - * @typedef {Object} OpenApp - * @property {string} [name] - * @property {string[]} [arguments] - */ - /** - * @typedef {Object} Open - * @property {string | string[] | OpenApp} [app] - * @property {string | string[]} [target] - */ - /** - * @typedef {Object} NormalizedOpen - * @property {string} target - * @property {import("open").Options} options - */ - /** - * @typedef {Object} WebSocketURL - * @property {string} [hostname] - * @property {string} [password] - * @property {string} [pathname] - * @property {number | string} [port] - * @property {string} [protocol] - * @property {string} [username] - */ - /** - * @typedef {Object} ClientConfiguration - * @property {"log" | "info" | "warn" | "error" | "none" | "verbose"} [logging] - * @property {boolean | { warnings?: boolean, errors?: boolean }} [overlay] - * @property {boolean} [progress] - * @property {boolean | number} [reconnect] - * @property {"ws" | "sockjs" | string} [webSocketTransport] - * @property {string | WebSocketURL} [webSocketURL] - */ - /** - * @typedef {Array<{ key: string; value: string }> | Record} Headers - */ - /** - * @typedef {{ name?: string, path?: string, middleware: ExpressRequestHandler | ExpressErrorRequestHandler } | ExpressRequestHandler | ExpressErrorRequestHandler} Middleware - */ - /** - * @typedef {Object} Configuration - * @property {boolean | string} [ipc] - * @property {Host} [host] - * @property {Port} [port] - * @property {boolean | "only"} [hot] - * @property {boolean} [liveReload] - * @property {DevMiddlewareOptions} [devMiddleware] - * @property {boolean} [compress] - * @property {boolean} [magicHtml] - * @property {"auto" | "all" | string | string[]} [allowedHosts] - * @property {boolean | ConnectHistoryApiFallbackOptions} [historyApiFallback] - * @property {boolean} [setupExitSignals] - * @property {boolean | BonjourOptions} [bonjour] - * @property {string | string[] | WatchFiles | Array} [watchFiles] - * @property {boolean | string | Static | Array} [static] - * @property {boolean | ServerOptions} [https] - * @property {boolean} [http2] - * @property {"http" | "https" | "spdy" | string | ServerConfiguration} [server] - * @property {boolean | "sockjs" | "ws" | string | WebSocketServerConfiguration} [webSocketServer] - * @property {ProxyConfigMap | ProxyConfigArrayItem | ProxyConfigArray} [proxy] - * @property {boolean | string | Open | Array} [open] - * @property {boolean} [setupExitSignals] - * @property {boolean | ClientConfiguration} [client] - * @property {Headers | ((req: Request, res: Response, context: DevMiddlewareContext) => Headers)} [headers] - * @property {(devServer: Server) => void} [onAfterSetupMiddleware] - * @property {(devServer: Server) => void} [onBeforeSetupMiddleware] - * @property {(devServer: Server) => void} [onListening] - * @property {(middlewares: Middleware[], devServer: Server) => Middleware[]} [setupMiddlewares] - */ - type: string; - multiple: boolean; - description: string; - path: string; - }[]; - description: string; - negatedDescription: string; simpleType: string; multiple: boolean; }; @@ -875,14 +617,11 @@ declare class Server { configs: { type: string; multiple: boolean; - /** - * @type {Socket[]} - */ description: string; + negatedDescription: string; path: string; }[]; description: string; - negatedDescription: string; simpleType: string; multiple: boolean; }; @@ -923,6 +662,7 @@ declare class Server { type: string; multiple: boolean; description: string; + negatedDescription: string; path: string; } | { @@ -930,12 +670,16 @@ declare class Server { values: string[]; multiple: boolean; description: string; + negatedDescription: string; path: string; } )[]; description: string; - negatedDescription: string; simpleType: string; + /** + * @param {"v4" | "v6"} family + * @returns {string | undefined} + */ multiple: boolean; }; http2: { @@ -943,10 +687,10 @@ declare class Server { type: string; multiple: boolean; description: string; + negatedDescription: string; path: string; }[]; description: string; - negatedDescription: string; simpleType: string; multiple: boolean; }; @@ -955,10 +699,10 @@ declare class Server { type: string; multiple: boolean; description: string; + negatedDescription: string; path: string; }[]; description: string; - negatedDescription: string; simpleType: string; multiple: boolean; }; @@ -978,9 +722,6 @@ declare class Server { description: string; multiple: boolean; path: string; - /** - * @type {string | undefined} - */ type: string; }[]; description: string; @@ -1007,14 +748,14 @@ declare class Server { }[]; description: string; multiple: boolean; - simpleType: string; + simpleType: string /** @type {WebSocketURL} */; }; "https-cert": { configs: { type: string; multiple: boolean; description: string; - path: string /** @type {ClientConfiguration} */; + path: string; }[]; description: string; simpleType: string; @@ -1056,7 +797,7 @@ declare class Server { "https-key": { configs: { type: string; - /** @type {number | string} */ multiple: boolean; + multiple: boolean; description: string; path: string; }[]; @@ -1113,10 +854,10 @@ declare class Server { type: string; multiple: boolean; description: string; + negatedDescription: string; path: string; }[]; description: string; - negatedDescription: string; simpleType: string; multiple: boolean; }; @@ -1145,11 +886,10 @@ declare class Server { type: string; multiple: boolean; description: string; + negatedDescription: string; path: string; }[]; - /** @type {Object} */ description: string; - negatedDescription: string; simpleType: string; multiple: boolean; }; @@ -1158,22 +898,30 @@ declare class Server { type: string; multiple: boolean; description: string; + negatedDescription: string; path: string; }[]; description: string; - negatedDescription: string; simpleType: string; - multiple: boolean /** @type {string} */; + multiple: boolean; }; open: { - configs: { - type: string; - multiple: boolean; - description: string; - path: string; - }[]; + configs: ( + | { + type: string; + multiple: boolean; + description: string; + path: string; + } + | { + type: string; + multiple: boolean; + description: string; + negatedDescription: string; + path: string; + } + )[]; description: string; - negatedDescription: string; simpleType: string; multiple: boolean; }; @@ -1202,6 +950,10 @@ declare class Server { "open-app-name-reset": { configs: { type: string; + /** + * @param {WatchOptions & { aggregateTimeout?: number, ignored?: AnymatchMatcher | string[], poll?: number | boolean }} watchOptions + * @returns {WatchOptions} + */ multiple: boolean; description: string; path: string; @@ -1229,7 +981,6 @@ declare class Server { path: string; }[]; description: string; - negatedDescription: string; simpleType: string; multiple: boolean; }; @@ -1240,6 +991,10 @@ declare class Server { description: string; path: string; }[]; + /** + * @param {string | Static | undefined} [optionsForStatic] + * @returns {NormalizedStatic} + */ description: string; simpleType: string; multiple: boolean; @@ -1411,7 +1166,7 @@ declare class Server { configs: { description: string; multiple: boolean; - /** @type {ServerConfiguration} */ path: string; + path: string; type: string; }[]; description: string; @@ -1435,7 +1190,7 @@ declare class Server { type: string; multiple: boolean; description: string; - /** @type {ServerOptions} */ path: string; + path: string; }[]; description: string; simpleType: string; @@ -1490,10 +1245,10 @@ declare class Server { type: string; multiple: boolean; description: string; + negatedDescription: string; path: string; }[]; description: string; - negatedDescription: string; simpleType: string; multiple: boolean; }; @@ -1502,10 +1257,10 @@ declare class Server { type: string; multiple: boolean; description: string; + negatedDescription: string; path: string; }[]; description: string; - negatedDescription: string; simpleType: string; multiple: boolean; }; @@ -1562,7 +1317,7 @@ declare class Server { configs: ( | { description: string; - multiple: boolean; + /** @type {ServerOptions & { cacert?: ServerOptions["ca"] }} */ multiple: boolean; path: string; type: string; values: string[]; @@ -1576,6 +1331,7 @@ declare class Server { )[]; description: string; simpleType: string; + /** @type {ServerOptions & { cacert?: ServerOptions["ca"] }} */ multiple: boolean; }; }; @@ -1644,6 +1400,9 @@ declare class Server { )[]; description: string; link: string; + cli: { + negatedDescription: string; + }; }; Client: { description: string; @@ -1659,14 +1418,21 @@ declare class Server { type: string; additionalProperties: boolean; properties: { - /** @typedef {import("bonjour").BonjourOptions} BonjourOptions */ - /** @typedef {import("http-proxy-middleware").RequestHandler} RequestHandler */ - /** @typedef {import("http-proxy-middleware").Options} HttpProxyMiddlewareOptions */ - /** @typedef {import("http-proxy-middleware").Filter} HttpProxyMiddlewareOptionsFilter */ - /** @typedef {import("serve-index").Options} ServeIndexOptions */ - /** @typedef {import("serve-static").ServeStaticOptions} ServeStaticOptions */ - /** @typedef {import("ipaddr.js").IPv4} IPv4 */ - /** @typedef {import("ipaddr.js").IPv6} IPv6 */ + logging: { + $ref: string; + }; + overlay: { + $ref: string; + }; + progress: { + $ref: string; + }; + reconnect: { + $ref: string; + }; + webSocketTransport: { + $ref: string; + }; /** @typedef {import("net").Socket} Socket */ /** @typedef {import("http").IncomingMessage} IncomingMessage */ /** @typedef {import("open").Options} OpenOptions */ @@ -1809,314 +1575,7 @@ declare class Server { * @property {(devServer: Server) => void} [onListening] * @property {(middlewares: Middleware[], devServer: Server) => Middleware[]} [setupMiddlewares] */ - logging: { - $ref: string; - }; - overlay: { - /** @typedef {import("http-proxy-middleware").RequestHandler} RequestHandler */ - /** @typedef {import("http-proxy-middleware").Options} HttpProxyMiddlewareOptions */ - /** @typedef {import("http-proxy-middleware").Filter} HttpProxyMiddlewareOptionsFilter */ - /** @typedef {import("serve-index").Options} ServeIndexOptions */ - /** @typedef {import("serve-static").ServeStaticOptions} ServeStaticOptions */ - /** @typedef {import("ipaddr.js").IPv4} IPv4 */ - /** @typedef {import("ipaddr.js").IPv6} IPv6 */ - /** @typedef {import("net").Socket} Socket */ - /** @typedef {import("http").IncomingMessage} IncomingMessage */ - /** @typedef {import("open").Options} OpenOptions */ - /** @typedef {import("https").ServerOptions & { spdy?: { plain?: boolean | undefined, ssl?: boolean | undefined, 'x-forwarded-for'?: string | undefined, protocol?: string | undefined, protocols?: string[] | undefined }}} ServerOptions */ - /** - * @template Request, Response - * @typedef {import("webpack-dev-middleware").Options} DevMiddlewareOptions - */ - /** - * @template Request, Response - * @typedef {import("webpack-dev-middleware").Context} DevMiddlewareContext - */ - /** - * @typedef {"local-ip" | "local-ipv4" | "local-ipv6" | string} Host - */ - /** - * @typedef {number | string | "auto"} Port - */ - /** - * @typedef {Object} WatchFiles - * @property {string | string[]} paths - * @property {WatchOptions & { aggregateTimeout?: number, ignored?: AnymatchMatcher | string[], poll?: number | boolean }} [options] - */ - /** - * @typedef {Object} Static - * @property {string} [directory] - * @property {string | string[]} [publicPath] - * @property {boolean | ServeIndexOptions} [serveIndex] - * @property {ServeStaticOptions} [staticOptions] - * @property {boolean | WatchOptions & { aggregateTimeout?: number, ignored?: AnymatchMatcher | string[], poll?: number | boolean }} [watch] - */ - /** - * @typedef {Object} NormalizedStatic - * @property {string} directory - * @property {string[]} publicPath - * @property {false | ServeIndexOptions} serveIndex - * @property {ServeStaticOptions} staticOptions - * @property {false | WatchOptions} watch - */ - /** - * @typedef {Object} ServerConfiguration - * @property {"http" | "https" | "spdy" | string} [type] - * @property {ServerOptions} [options] - */ - /** - * @typedef {Object} WebSocketServerConfiguration - * @property {"sockjs" | "ws" | string | Function} [type] - * @property {Record} [options] - */ - /** - * @typedef {(import("ws").WebSocket | import("sockjs").Connection & { send: import("ws").WebSocket["send"], terminate: import("ws").WebSocket["terminate"], ping: import("ws").WebSocket["ping"] }) & { isAlive?: boolean }} ClientConnection - */ - /** - * @typedef {import("ws").WebSocketServer | import("sockjs").Server & { close: import("ws").WebSocketServer["close"] }} WebSocketServer - */ - /** - * @typedef {{ implementation: WebSocketServer, clients: ClientConnection[] }} WebSocketServerImplementation - */ - /** - * @callback ByPass - * @param {Request} req - * @param {Response} res - * @param {ProxyConfigArrayItem} proxyConfig - */ - /** - * @typedef {{ path?: HttpProxyMiddlewareOptionsFilter | undefined, context?: HttpProxyMiddlewareOptionsFilter | undefined } & { bypass?: ByPass } & HttpProxyMiddlewareOptions } ProxyConfigArrayItem - */ - /** - * @typedef {(ProxyConfigArrayItem | ((req?: Request | undefined, res?: Response | undefined, next?: NextFunction | undefined) => ProxyConfigArrayItem))[]} ProxyConfigArray - */ - /** - * @typedef {{ [url: string]: string | ProxyConfigArrayItem }} ProxyConfigMap - */ - /** - * @typedef {Object} OpenApp - * @property {string} [name] - * @property {string[]} [arguments] - */ - /** - * @typedef {Object} Open - * @property {string | string[] | OpenApp} [app] - * @property {string | string[]} [target] - */ - /** - * @typedef {Object} NormalizedOpen - * @property {string} target - * @property {import("open").Options} options - */ - /** - * @typedef {Object} WebSocketURL - * @property {string} [hostname] - * @property {string} [password] - * @property {string} [pathname] - * @property {number | string} [port] - * @property {string} [protocol] - * @property {string} [username] - */ - /** - * @typedef {Object} ClientConfiguration - * @property {"log" | "info" | "warn" | "error" | "none" | "verbose"} [logging] - * @property {boolean | { warnings?: boolean, errors?: boolean }} [overlay] - * @property {boolean} [progress] - * @property {boolean | number} [reconnect] - * @property {"ws" | "sockjs" | string} [webSocketTransport] - * @property {string | WebSocketURL} [webSocketURL] - */ - /** - * @typedef {Array<{ key: string; value: string }> | Record} Headers - */ - /** - * @typedef {{ name?: string, path?: string, middleware: ExpressRequestHandler | ExpressErrorRequestHandler } | ExpressRequestHandler | ExpressErrorRequestHandler} Middleware - */ - /** - * @typedef {Object} Configuration - * @property {boolean | string} [ipc] - * @property {Host} [host] - * @property {Port} [port] - * @property {boolean | "only"} [hot] - * @property {boolean} [liveReload] - * @property {DevMiddlewareOptions} [devMiddleware] - * @property {boolean} [compress] - * @property {boolean} [magicHtml] - * @property {"auto" | "all" | string | string[]} [allowedHosts] - * @property {boolean | ConnectHistoryApiFallbackOptions} [historyApiFallback] - * @property {boolean} [setupExitSignals] - * @property {boolean | BonjourOptions} [bonjour] - * @property {string | string[] | WatchFiles | Array} [watchFiles] - * @property {boolean | string | Static | Array} [static] - * @property {boolean | ServerOptions} [https] - * @property {boolean} [http2] - * @property {"http" | "https" | "spdy" | string | ServerConfiguration} [server] - * @property {boolean | "sockjs" | "ws" | string | WebSocketServerConfiguration} [webSocketServer] - * @property {ProxyConfigMap | ProxyConfigArrayItem | ProxyConfigArray} [proxy] - * @property {boolean | string | Open | Array} [open] - * @property {boolean} [setupExitSignals] - * @property {boolean | ClientConfiguration} [client] - * @property {Headers | ((req: Request, res: Response, context: DevMiddlewareContext) => Headers)} [headers] - * @property {(devServer: Server) => void} [onAfterSetupMiddleware] - * @property {(devServer: Server) => void} [onBeforeSetupMiddleware] - * @property {(devServer: Server) => void} [onListening] - * @property {(middlewares: Middleware[], devServer: Server) => Middleware[]} [setupMiddlewares] - */ - $ref: string; - }; - progress: { - $ref: string; - }; - reconnect: { - $ref: string; - } /** @typedef {import("serve-index").Options} ServeIndexOptions */; - webSocketTransport: { - $ref: string; - }; webSocketURL: { - /** @typedef {import("ipaddr.js").IPv6} IPv6 */ - /** @typedef {import("net").Socket} Socket */ - /** @typedef {import("http").IncomingMessage} IncomingMessage */ - /** @typedef {import("open").Options} OpenOptions */ - /** @typedef {import("https").ServerOptions & { spdy?: { plain?: boolean | undefined, ssl?: boolean | undefined, 'x-forwarded-for'?: string | undefined, protocol?: string | undefined, protocols?: string[] | undefined }}} ServerOptions */ - /** - * @template Request, Response - * @typedef {import("webpack-dev-middleware").Options} DevMiddlewareOptions - */ - /** - * @template Request, Response - * @typedef {import("webpack-dev-middleware").Context} DevMiddlewareContext - */ - /** - * @typedef {"local-ip" | "local-ipv4" | "local-ipv6" | string} Host - */ - /** - * @typedef {number | string | "auto"} Port - */ - /** - * @typedef {Object} WatchFiles - * @property {string | string[]} paths - * @property {WatchOptions & { aggregateTimeout?: number, ignored?: AnymatchMatcher | string[], poll?: number | boolean }} [options] - */ - /** - * @typedef {Object} Static - * @property {string} [directory] - * @property {string | string[]} [publicPath] - * @property {boolean | ServeIndexOptions} [serveIndex] - * @property {ServeStaticOptions} [staticOptions] - * @property {boolean | WatchOptions & { aggregateTimeout?: number, ignored?: AnymatchMatcher | string[], poll?: number | boolean }} [watch] - */ - /** - * @typedef {Object} NormalizedStatic - * @property {string} directory - * @property {string[]} publicPath - * @property {false | ServeIndexOptions} serveIndex - * @property {ServeStaticOptions} staticOptions - * @property {false | WatchOptions} watch - */ - /** - * @typedef {Object} ServerConfiguration - * @property {"http" | "https" | "spdy" | string} [type] - * @property {ServerOptions} [options] - */ - /** - * @typedef {Object} WebSocketServerConfiguration - * @property {"sockjs" | "ws" | string | Function} [type] - * @property {Record} [options] - */ - /** - * @typedef {(import("ws").WebSocket | import("sockjs").Connection & { send: import("ws").WebSocket["send"], terminate: import("ws").WebSocket["terminate"], ping: import("ws").WebSocket["ping"] }) & { isAlive?: boolean }} ClientConnection - */ - /** - * @typedef {import("ws").WebSocketServer | import("sockjs").Server & { close: import("ws").WebSocketServer["close"] }} WebSocketServer - */ - /** - * @typedef {{ implementation: WebSocketServer, clients: ClientConnection[] }} WebSocketServerImplementation - */ - /** - * @callback ByPass - * @param {Request} req - * @param {Response} res - * @param {ProxyConfigArrayItem} proxyConfig - */ - /** - * @typedef {{ path?: HttpProxyMiddlewareOptionsFilter | undefined, context?: HttpProxyMiddlewareOptionsFilter | undefined } & { bypass?: ByPass } & HttpProxyMiddlewareOptions } ProxyConfigArrayItem - */ - /** - * @typedef {(ProxyConfigArrayItem | ((req?: Request | undefined, res?: Response | undefined, next?: NextFunction | undefined) => ProxyConfigArrayItem))[]} ProxyConfigArray - */ - /** - * @typedef {{ [url: string]: string | ProxyConfigArrayItem }} ProxyConfigMap - */ - /** - * @typedef {Object} OpenApp - * @property {string} [name] - * @property {string[]} [arguments] - */ - /** - * @typedef {Object} Open - * @property {string | string[] | OpenApp} [app] - * @property {string | string[]} [target] - */ - /** - * @typedef {Object} NormalizedOpen - * @property {string} target - * @property {import("open").Options} options - */ - /** - * @typedef {Object} WebSocketURL - * @property {string} [hostname] - * @property {string} [password] - * @property {string} [pathname] - * @property {number | string} [port] - * @property {string} [protocol] - * @property {string} [username] - */ - /** - * @typedef {Object} ClientConfiguration - * @property {"log" | "info" | "warn" | "error" | "none" | "verbose"} [logging] - * @property {boolean | { warnings?: boolean, errors?: boolean }} [overlay] - * @property {boolean} [progress] - * @property {boolean | number} [reconnect] - * @property {"ws" | "sockjs" | string} [webSocketTransport] - * @property {string | WebSocketURL} [webSocketURL] - */ - /** - * @typedef {Array<{ key: string; value: string }> | Record} Headers - */ - /** - * @typedef {{ name?: string, path?: string, middleware: ExpressRequestHandler | ExpressErrorRequestHandler } | ExpressRequestHandler | ExpressErrorRequestHandler} Middleware - */ - /** - * @typedef {Object} Configuration - * @property {boolean | string} [ipc] - * @property {Host} [host] - * @property {Port} [port] - * @property {boolean | "only"} [hot] - * @property {boolean} [liveReload] - * @property {DevMiddlewareOptions} [devMiddleware] - * @property {boolean} [compress] - * @property {boolean} [magicHtml] - * @property {"auto" | "all" | string | string[]} [allowedHosts] - * @property {boolean | ConnectHistoryApiFallbackOptions} [historyApiFallback] - * @property {boolean} [setupExitSignals] - * @property {boolean | BonjourOptions} [bonjour] - * @property {string | string[] | WatchFiles | Array} [watchFiles] - * @property {boolean | string | Static | Array} [static] - * @property {boolean | ServerOptions} [https] - * @property {boolean} [http2] - * @property {"http" | "https" | "spdy" | string | ServerConfiguration} [server] - * @property {boolean | "sockjs" | "ws" | string | WebSocketServerConfiguration} [webSocketServer] - * @property {ProxyConfigMap | ProxyConfigArrayItem | ProxyConfigArray} [proxy] - * @property {boolean | string | Open | Array} [open] - * @property {boolean} [setupExitSignals] - * @property {boolean | ClientConfiguration} [client] - * @property {Headers | ((req: Request, res: Response, context: DevMiddlewareContext) => Headers)} [headers] - * @property {(devServer: Server) => void} [onAfterSetupMiddleware] - * @property {(devServer: Server) => void} [onBeforeSetupMiddleware] - * @property {(devServer: Server) => void} [onListening] - * @property {(middlewares: Middleware[], devServer: Server) => Middleware[]} [setupMiddlewares] - */ $ref: string; }; }; @@ -2126,15 +1585,152 @@ declare class Server { }; ClientLogging: { enum: string[]; - description: string /** @typedef {import("https").ServerOptions & { spdy?: { plain?: boolean | undefined, ssl?: boolean | undefined, 'x-forwarded-for'?: string | undefined, protocol?: string | undefined, protocols?: string[] | undefined }}} ServerOptions */; + description: string; link: string; }; ClientOverlay: { anyOf: ( | { description: string; + /** + * @template Request, Response + * @typedef {import("webpack-dev-middleware").Context} DevMiddlewareContext + */ + /** + * @typedef {"local-ip" | "local-ipv4" | "local-ipv6" | string} Host + */ + /** + * @typedef {number | string | "auto"} Port + */ + /** + * @typedef {Object} WatchFiles + * @property {string | string[]} paths + * @property {WatchOptions & { aggregateTimeout?: number, ignored?: AnymatchMatcher | string[], poll?: number | boolean }} [options] + */ + /** + * @typedef {Object} Static + * @property {string} [directory] + * @property {string | string[]} [publicPath] + * @property {boolean | ServeIndexOptions} [serveIndex] + * @property {ServeStaticOptions} [staticOptions] + * @property {boolean | WatchOptions & { aggregateTimeout?: number, ignored?: AnymatchMatcher | string[], poll?: number | boolean }} [watch] + */ + /** + * @typedef {Object} NormalizedStatic + * @property {string} directory + * @property {string[]} publicPath + * @property {false | ServeIndexOptions} serveIndex + * @property {ServeStaticOptions} staticOptions + * @property {false | WatchOptions} watch + */ + /** + * @typedef {Object} ServerConfiguration + * @property {"http" | "https" | "spdy" | string} [type] + * @property {ServerOptions} [options] + */ + /** + * @typedef {Object} WebSocketServerConfiguration + * @property {"sockjs" | "ws" | string | Function} [type] + * @property {Record} [options] + */ + /** + * @typedef {(import("ws").WebSocket | import("sockjs").Connection & { send: import("ws").WebSocket["send"], terminate: import("ws").WebSocket["terminate"], ping: import("ws").WebSocket["ping"] }) & { isAlive?: boolean }} ClientConnection + */ + /** + * @typedef {import("ws").WebSocketServer | import("sockjs").Server & { close: import("ws").WebSocketServer["close"] }} WebSocketServer + */ + /** + * @typedef {{ implementation: WebSocketServer, clients: ClientConnection[] }} WebSocketServerImplementation + */ + /** + * @callback ByPass + * @param {Request} req + * @param {Response} res + * @param {ProxyConfigArrayItem} proxyConfig + */ + /** + * @typedef {{ path?: HttpProxyMiddlewareOptionsFilter | undefined, context?: HttpProxyMiddlewareOptionsFilter | undefined } & { bypass?: ByPass } & HttpProxyMiddlewareOptions } ProxyConfigArrayItem + */ + /** + * @typedef {(ProxyConfigArrayItem | ((req?: Request | undefined, res?: Response | undefined, next?: NextFunction | undefined) => ProxyConfigArrayItem))[]} ProxyConfigArray + */ + /** + * @typedef {{ [url: string]: string | ProxyConfigArrayItem }} ProxyConfigMap + */ + /** + * @typedef {Object} OpenApp + * @property {string} [name] + * @property {string[]} [arguments] + */ + /** + * @typedef {Object} Open + * @property {string | string[] | OpenApp} [app] + * @property {string | string[]} [target] + */ + /** + * @typedef {Object} NormalizedOpen + * @property {string} target + * @property {import("open").Options} options + */ + /** + * @typedef {Object} WebSocketURL + * @property {string} [hostname] + * @property {string} [password] + * @property {string} [pathname] + * @property {number | string} [port] + * @property {string} [protocol] + * @property {string} [username] + */ + /** + * @typedef {Object} ClientConfiguration + * @property {"log" | "info" | "warn" | "error" | "none" | "verbose"} [logging] + * @property {boolean | { warnings?: boolean, errors?: boolean }} [overlay] + * @property {boolean} [progress] + * @property {boolean | number} [reconnect] + * @property {"ws" | "sockjs" | string} [webSocketTransport] + * @property {string | WebSocketURL} [webSocketURL] + */ + /** + * @typedef {Array<{ key: string; value: string }> | Record} Headers + */ + /** + * @typedef {{ name?: string, path?: string, middleware: ExpressRequestHandler | ExpressErrorRequestHandler } | ExpressRequestHandler | ExpressErrorRequestHandler} Middleware + */ + /** + * @typedef {Object} Configuration + * @property {boolean | string} [ipc] + * @property {Host} [host] + * @property {Port} [port] + * @property {boolean | "only"} [hot] + * @property {boolean} [liveReload] + * @property {DevMiddlewareOptions} [devMiddleware] + * @property {boolean} [compress] + * @property {boolean} [magicHtml] + * @property {"auto" | "all" | string | string[]} [allowedHosts] + * @property {boolean | ConnectHistoryApiFallbackOptions} [historyApiFallback] + * @property {boolean} [setupExitSignals] + * @property {boolean | BonjourOptions} [bonjour] + * @property {string | string[] | WatchFiles | Array} [watchFiles] + * @property {boolean | string | Static | Array} [static] + * @property {boolean | ServerOptions} [https] + * @property {boolean} [http2] + * @property {"http" | "https" | "spdy" | string | ServerConfiguration} [server] + * @property {boolean | "sockjs" | "ws" | string | WebSocketServerConfiguration} [webSocketServer] + * @property {ProxyConfigMap | ProxyConfigArrayItem | ProxyConfigArray} [proxy] + * @property {boolean | string | Open | Array} [open] + * @property {boolean} [setupExitSignals] + * @property {boolean | ClientConfiguration} [client] + * @property {Headers | ((req: Request, res: Response, context: DevMiddlewareContext) => Headers)} [headers] + * @property {(devServer: Server) => void} [onAfterSetupMiddleware] + * @property {(devServer: Server) => void} [onBeforeSetupMiddleware] + * @property {(devServer: Server) => void} [onListening] + * @property {(middlewares: Middleware[], devServer: Server) => Middleware[]} [setupMiddlewares] + */ link: string; type: string; + cli: { + negatedDescription: string; + }; additionalProperties?: undefined; properties?: undefined; } @@ -2153,6 +1749,7 @@ declare class Server { }; description?: undefined; link?: undefined; + cli?: undefined; } )[]; }; @@ -2160,6 +1757,9 @@ declare class Server { description: string; link: string; type: string; + cli: { + negatedDescription: string; + }; }; ClientReconnect: { description: string; @@ -2174,6 +1774,9 @@ declare class Server { minimum: number; } )[]; + cli: { + negatedDescription: string; + }; }; ClientWebSocketTransport: { anyOf: { @@ -2253,43 +1856,13 @@ declare class Server { } )[]; }; - /** - * @typedef {{ name?: string, path?: string, middleware: ExpressRequestHandler | ExpressErrorRequestHandler } | ExpressRequestHandler | ExpressErrorRequestHandler} Middleware - */ - /** - * @typedef {Object} Configuration - * @property {boolean | string} [ipc] - * @property {Host} [host] - * @property {Port} [port] - * @property {boolean | "only"} [hot] - * @property {boolean} [liveReload] - * @property {DevMiddlewareOptions} [devMiddleware] - * @property {boolean} [compress] - * @property {boolean} [magicHtml] - * @property {"auto" | "all" | string | string[]} [allowedHosts] - * @property {boolean | ConnectHistoryApiFallbackOptions} [historyApiFallback] - * @property {boolean} [setupExitSignals] - * @property {boolean | BonjourOptions} [bonjour] - * @property {string | string[] | WatchFiles | Array} [watchFiles] - * @property {boolean | string | Static | Array} [static] - * @property {boolean | ServerOptions} [https] - * @property {boolean} [http2] - * @property {"http" | "https" | "spdy" | string | ServerConfiguration} [server] - * @property {boolean | "sockjs" | "ws" | string | WebSocketServerConfiguration} [webSocketServer] - * @property {ProxyConfigMap | ProxyConfigArrayItem | ProxyConfigArray} [proxy] - * @property {boolean | string | Open | Array} [open] - * @property {boolean} [setupExitSignals] - * @property {boolean | ClientConfiguration} [client] - * @property {Headers | ((req: Request, res: Response, context: DevMiddlewareContext) => Headers)} [headers] - * @property {(devServer: Server) => void} [onAfterSetupMiddleware] - * @property {(devServer: Server) => void} [onBeforeSetupMiddleware] - * @property {(devServer: Server) => void} [onListening] - * @property {(middlewares: Middleware[], devServer: Server) => Middleware[]} [setupMiddlewares] - */ Compress: { type: string; description: string; link: string; + cli: { + negatedDescription: string; + }; }; DevMiddleware: { description: string; @@ -2301,11 +1874,17 @@ declare class Server { type: string; description: string; link: string; + cli: { + negatedDescription: string; + }; }; HTTPS: { anyOf: ( | { type: string; + cli: { + negatedDescription: string; + }; additionalProperties?: undefined; properties?: undefined; } @@ -2320,6 +1899,9 @@ declare class Server { requestCert: { type: string; description: string; + cli: { + negatedDescription: string; + }; }; ca: { anyOf: ( @@ -2352,6 +1934,9 @@ declare class Server { )[]; description: string; }; + /** + * @type {FSWatcher[]} + */ cacert: { anyOf: ( | { @@ -2522,9 +2107,13 @@ declare class Server { description: string; }; }; + cli?: undefined; } )[]; description: string; + /** + * @type {string | undefined} + */ link: string; }; HeaderObject: { @@ -2570,6 +2159,9 @@ declare class Server { description: string; link: string; }; + /** + * @type {string[]} + */ HistoryApiFallback: { anyOf: ( | { @@ -2615,12 +2207,15 @@ declare class Server { )[]; description: string; link: string; + cli: { + negatedDescription: string; + }; }; IPC: { anyOf: ( | { type: string; - minLength: number; + /** @type {ServerConfiguration} */ minLength: number; enum?: undefined; } | { @@ -2635,11 +2230,17 @@ declare class Server { LiveReload: { type: string; description: string; + cli: { + negatedDescription: string; + }; link: string; }; MagicHTML: { type: string; description: string; + cli: { + negatedDescription: string; + }; link: string; }; OnAfterSetupMiddleware: { @@ -2679,6 +2280,9 @@ declare class Server { }; OpenBoolean: { type: string; + cli: { + negatedDescription: string; + }; }; OpenObject: { type: string; @@ -2812,6 +2416,10 @@ declare class Server { }[]; link: string; description: string; + /** + * @private + * @returns {Compiler["options"]} + */ }; ServerType: { enum: string[]; @@ -2826,8 +2434,8 @@ declare class Server { type: string; minLength: number; cli: { - exclude: boolean; - }; + exclude: boolean /** @type {MultiCompiler} */; + } /** @type {MultiCompiler} */; }; ServerObject: { type: string; @@ -2845,13 +2453,11 @@ declare class Server { }; ServerOptions: { type: string; - additionalProperties: boolean; + /** @type {MultiCompiler} */ additionalProperties: boolean; properties: { - /** @type {any} */ passphrase: { type: string; - /** @type {any} */ - description: string /** @type {any} */; + description: string; }; requestCert: { type: string; @@ -2873,7 +2479,7 @@ declare class Server { } )[]; }; - /** @type {string} */ instanceof?: undefined; + instanceof?: undefined; } | { type: string; @@ -2904,7 +2510,7 @@ declare class Server { } )[]; }; - /** @type {MultiCompiler} */ instanceof?: undefined; + instanceof?: undefined; } | { type: string; @@ -3142,6 +2748,9 @@ declare class Server { } )[]; description: string; + cli: { + negatedDescription: string; + }; link: string; }; watch: { @@ -3158,6 +2767,9 @@ declare class Server { } )[]; description: string; + cli: { + negatedDescription: string; + }; link: string; }; }; @@ -3244,6 +2856,7 @@ declare class Server { enum?: undefined; } )[]; + /** @type {ServerOptions} */ cli: { description: string; }; @@ -3325,16 +2938,14 @@ declare class Server { $ref: string; }; onListening: { - $ref: string /** @type {ServerOptions} */; + $ref: string; }; - /** @type {ServerOptions} */ open: { $ref: string; }; port: { - $ref: string /** @type {ServerOptions} */; + $ref: string; }; - /** @type {ServerOptions} */ proxy: { $ref: string; };