From 0853be8bc596e6031ade0919e4640f8c850339f9 Mon Sep 17 00:00:00 2001 From: alexander-akait <4567934+alexander-akait@users.noreply.github.com> Date: Fri, 9 Oct 2026 14:49:18 +0000 Subject: [PATCH] refactor: settle the hot option names before release Remove `hot.server` (use `attach` or `handleUpgrade`), `hot.client.token` (filled in from `hot.token`) and the six legacy `hot.client` keys, which the entry query still reads. Rename `hot.client.path` to `hot.client.url` (the query reads both) and `hot.client.urlPrefix` to `pageParamPrefix`. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01UjuMAuk9o6UazjHzcAQCTA --- .changeset/hot-client-apply-and-connect.md | 2 +- .changeset/hot-client-options.md | 2 +- README.md | 49 +++++------ client-src/index.js | 27 ++++--- src/hot.js | 20 +---- src/options.check.js | 2 +- src/options.json | 45 ++--------- src/utils.js | 32 ++------ .../validation-options.test.js.snap.webpack5 | 18 ++--- test/e2e/client.test.js | 2 +- test/e2e/inject.test.js | 2 +- test/e2e/live-reload.test.js | 4 +- test/e2e/transport.test.js | 2 +- test/inject-client.test.js | 81 ++++++++++--------- types/client/index.d.ts | 2 +- types/hot.d.ts | 42 ++-------- 16 files changed, 114 insertions(+), 218 deletions(-) diff --git a/.changeset/hot-client-apply-and-connect.md b/.changeset/hot-client-apply-and-connect.md index dd730e7bf..7b9c68adb 100644 --- a/.changeset/hot-client-apply-and-connect.md +++ b/.changeset/hot-client-apply-and-connect.md @@ -4,4 +4,4 @@ pr: #2458 -`hot.client.apply` (`"hmr"`, `"hmr-only"`, `"reload"` or `"nothing"`) says what a build does to the page, so a project without HMR still reloads on a change; a single page can choose its own mode with `?webpack-dev-middleware-apply=`, and publishing `{ action: "reload" }` reloads every page. `hot.client.connect` (`false`, or `{ retries, timeout }`) controls connecting and reconnecting, with `retries` honoured on both transports. The `hot`, `liveReload`, `reload`, `autoConnect`, `reconnect` and `timeout` options they replace still work with a deprecation warning until the next major release. +`hot.client.apply` (`"hmr"`, `"hmr-only"`, `"reload"` or `"nothing"`) says what a build does to the page, so a project without HMR still reloads on a change; a single page can choose its own mode with `?webpack-dev-middleware-apply=`, and publishing `{ action: "reload" }` reloads every page. `hot.client.connect` (`false`, or `{ retries, timeout }`) controls connecting and reconnecting, with `retries` honoured on both transports. The `hot`, `liveReload`, `reload`, `autoConnect`, `reconnect` and `timeout` query parameters they replace are still read until the next major release, with a deprecation warning for this package's own three. diff --git a/.changeset/hot-client-options.md b/.changeset/hot-client-options.md index a7f6da3ac..76fb9046d 100644 --- a/.changeset/hot-client-options.md +++ b/.changeset/hot-client-options.md @@ -4,4 +4,4 @@ pr: #2436 -Added `hot.client`, which sets the browser runtime's options on the middleware under the same names the entry query takes, so a configuration no longer needs a hand-written query string. `path` accepts a url or its parts (`{ port: 8080 }`) and resolves the rest in the page, and `logging` accepts `{ level, name }` so an embedding package can label the console with its own name. +Added `hot.client`, which sets the browser runtime's options on the middleware under the same names the entry query takes, so a configuration no longer needs a hand-written query string. `url` accepts a url or its parts (`{ port: 8080 }`) and resolves the rest in the page, `pageParamPrefix` renames the per-page `?webpack-dev-middleware-apply=` parameter, and `logging` accepts `{ level, name }` so an embedding package can label the console with its own name. diff --git a/README.md b/README.md index 09658e6e1..e784c949d 100644 --- a/README.md +++ b/README.md @@ -366,7 +366,6 @@ The object form accepts these options: | **[`transport`](#hottransport)** | `string \| function` | `'sse'` | How events reach the clients. | | **[`path`](#hotpath)** | `string` | `'/__webpack_hmr'` | Path the endpoint is served at. | | **[`heartbeat`](#hotheartbeat)** | `number` | `10000` | Interval (in milliseconds) between keep-alive frames. | -| **[`server`](#hotserver)** | `object` | `undefined` | HTTP server the `'ws'` transport answers upgrades on. | | **[`progress`](#hotprogress)** | `boolean` | `false` | Publish compilation progress events to the clients. | | **[`cors`](#hotcors)** | `boolean \| string \| string[] \| RegExp \| function \| object` | see below | Which origins may reach the endpoint from a page on another one, over either transport. | | **[`token`](#hottoken)** | `boolean \| string` | see below | A secret the injected client carries and the endpoint requires, over either transport. | @@ -382,7 +381,7 @@ How events reach the clients. `'sse'` serves them as [Server-Sent Events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events) from the middleware itself, which needs nothing else. -`'ws'` serves them over a WebSocket. It needs the optional [`ws`](https://www.npmjs.com/package/ws) package (`npm install ws`), and an HTTP server to answer upgrades on — a handshake is an upgrade the server answers, which the middleware never sees. Give it [`hot.server`](#hotserver), or hand the server over later with the middleware's [`attach`](#attachserver) method: +`'ws'` serves them over a WebSocket. It needs the optional [`ws`](https://www.npmjs.com/package/ws) package (`npm install ws`), and an HTTP server to answer upgrades on — a handshake is an upgrade the server answers, which the middleware never sees. Hand the server over with the middleware's [`attach`](#attachserver) method, or answer upgrades yourself through [`handleUpgrade`](#handleupgradereq-socket-head): ```js const server = http.createServer(instance); @@ -471,13 +470,6 @@ Default: `10000` Heartbeat interval (in milliseconds) used to keep the connection alive when no compilation events are produced: keep-alive frames for `'sse'`, pings for `'ws'`. Must be `1` or greater. -#### `hot.server` - -Type: `Object` -Default: `undefined` - -HTTP server the [`'ws'`](#hottransport) transport answers upgrades on, when it already exists where the middleware is built. Otherwise hand it over later with the middleware's [`attach`](#attachserver) method. Ignored by `'sse'`, which is answered by the middleware itself. - #### `hot.ws` Type: `Object` @@ -485,7 +477,7 @@ Default: `undefined` Options for the [`ws`](https://github.com/websockets/ws/blob/master/doc/ws.md#new-websocketserveroptions-callback) server behind the [`'ws'`](#hottransport) transport — compression (`perMessageDeflate`), `maxPayload`, `handleProtocols`, `verifyClient`, and so on. Ignored by `'sse'`. -A `port` (with an optional `host`) or a `server` gives the endpoint a server of its own to listen on, rather than the upgrades it is handed through [`hot.server`](#hotserver), [`attach`](#attachserver) or [`handleUpgrade`](#handleupgradereq-socket-head) — which then answer nothing: +A `port` (with an optional `host`) or a `server` gives the endpoint a server of its own to listen on, rather than the upgrades it is handed through [`attach`](#attachserver) or [`handleUpgrade`](#handleupgradereq-socket-head) — which then answer nothing: ```js app.use( @@ -767,7 +759,7 @@ app.use( ``` Every option below can be set either way, and they are the same options: what -`hot.client` takes is what the query carries. `transport`, `path` and `name` +`hot.client` takes is what the query carries. `transport`, `url` and `name` differ only in having a value the middleware already knows — the resolved [`hot.transport`](#hottransport), the resolved [`hot.path`](#hotpath) and the compilation's own name — so setting one replaces that default rather than @@ -777,7 +769,7 @@ another origin needs: ```js app.use( middleware(compiler, { - hot: { client: { path: "wss://dev.example.com/__webpack_hmr" } }, + hot: { client: { url: "wss://dev.example.com/__webpack_hmr" } }, }), ); ``` @@ -842,9 +834,12 @@ as well. Each of these is set either on the middleware as `hot.client.` or on the entry's query as `=`, with the same effect and the same spelling in -both. The last six are the names `apply` and `connect` replaced; they still -work, folded into those two, and go away in the next major release. -`transport`, `path` and `name` default to what the middleware resolved rather +both — except `url`, which the query also reads as `path`, the name it had +there first. The query also still reads the six names `apply` and `connect` +replaced (`hot`, `liveReload`, `reload`, `autoConnect`, `reconnect`, +`timeout`), folded into those two, until the next major release; `hot.client` +does not take them. +`transport`, `url` and `name` default to what the middleware resolved rather than to the value in the table, which is what they are when nothing else is serving them. @@ -855,34 +850,28 @@ narrow the mode in force. | Name | Type | Default | Description | | :-----------------: | :--------------------------------------: | :------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `transport` | `string` | `"sse"` | How the events are carried: `"sse"` or `"ws"`. Defaults to the server [`hot.transport`](#hottransport); override it only together with `path`, since a client asking this endpoint for a protocol it does not serve never connects — the middleware warns when it sees that. Any other string is a module exporting [a client of your own](#a-client-of-your-own). | -| `path` | `string\|Object` | `/__webpack_hmr` | Where the runtime connects. Defaults to the server [`hot.path`](#hotpath); set it to an absolute url (`wss://dev.example.com/__webpack_hmr`) for an endpoint on another origin or behind a proxy, or to an object saying only the parts that differ — see [a path in parts](#a-path-in-parts). | +| `transport` | `string` | `"sse"` | How the events are carried: `"sse"` or `"ws"`. Defaults to the server [`hot.transport`](#hottransport); override it only together with `url`, since a client asking this endpoint for a protocol it does not serve never connects — the middleware warns when it sees that. Any other string is a module exporting [a client of your own](#a-client-of-your-own). | +| `url` | `string\|Object` | `/__webpack_hmr` | Where the runtime connects. Defaults to the server [`hot.path`](#hotpath); set it to an absolute url (`wss://dev.example.com/__webpack_hmr`) for an endpoint on another origin or behind a proxy, or to an object saying only the parts that differ — see [a url in parts](#a-url-in-parts). | | `apply` | `"hmr"\|"hmr-only"\|"reload"\|"nothing"` | `"hmr"` | What a build does to the page. `"hmr"` applies the update and loads the page again if it cannot be applied; `"hmr-only"` applies it and stops with a message if it cannot; `"reload"` skips HMR and loads the page again on any build that changed something; `"nothing"` leaves the page alone until you reload it. One option rather than three booleans, since only four of their eight combinations differed. | | `connect` | `boolean\|{ retries, timeout }` | `true` | Whether to connect when the entry runs, and how the connection is held open. `false` does not connect — call `setOptionsAndConnect()` yourself. `retries` is how many times to reconnect before giving up, and `Infinity` never does; unset, `"sse"` keeps trying for as long as the page is open while `"ws"` gives up after `10`. `timeout` is how long silence is tolerated before reconnecting, in milliseconds, and the interval between reconnections — `"sse"` only, since a `"ws"` heartbeat is a protocol ping the browser answers without telling JavaScript. | | `overlay` | `boolean\|Object` | `true` | In-page overlay for problems: a boolean, or a JSON object — see [overlay options](#client-overlay-options). Same value shape as webpack-dev-server's [`client.overlay`](https://webpack.js.org/configuration/dev-server/#overlay), plus a few webpack-dev-middleware extensions. | -| `urlPrefix` | `string` | `"webpack-dev-middleware"` | Names the page-url parameter (`-apply`) that overrides [`apply`](#client-options) for a single page — see [opting one page out](#opting-one-page-out). Change it if you are building a server of your own and want parameters named after it. | +| `pageParamPrefix` | `string` | `"webpack-dev-middleware"` | Names the page-url parameter (`-apply`) that overrides [`apply`](#client-options) for a single page — see [opting one page out](#opting-one-page-out). Change it if you are building a server of your own and want parameters named after it. | | `logging` | `string\|Object` | `"info"` | Logger level — one of `"none"`, `"error"`, `"warn"`, `"info"`, `"log"`, `"verbose"`. Uses webpack's runtime logger. An object takes the same value as `level` plus a `name`, which is what every message is labelled with in the console: a package embedding this runtime is the one a developer installed and would report a problem to, so it can say its own name — `{ level: "warn", name: "my-dev-server" }` logs `[my-dev-server] …`. | | `name` | `string` | `""` | Restrict updates to a specific compilation name (useful with multi-compiler). In `apply: "reload"` a successful build of any other compilation still loads the page, since a page cannot tell which of the bundles it depends on. | | `progress` | `boolean` | `true` | Show a small badge in the page while a rebuild is in progress (with the compilation percentage when the server enables `hot.progress`). Set to `false` to disable. | -| `dynamicPublicPath` | `boolean` | `false` | Prefix `path` with `__webpack_public_path__` at runtime. The leading slash of `path` is stripped and no other normalization is applied, so the public path should end with `/`. | -| `hot` | `boolean` | `true` | Apply a build through Hot Module Replacement. Set to `false` for a project without `HotModuleReplacementPlugin`, and the page is reloaded instead — see `liveReload`. **Deprecated**, removed in the next major release — use [`apply`](#client-options). | -| `liveReload` | `boolean` | `true` | Reload the page on a build that changed something, when `hot` is off. A build that changed nothing is left alone. Set both this and `hot` to `false` and a build reaches the page only when you reload it yourself. **Deprecated**, removed in the next major release — use [`apply`](#client-options). | -| `reload` | `boolean` | `true` | Fall back to a full page reload when an update cannot be applied through HMR (e.g. recovering from a broken build). Enabled by default, unlike webpack-hot-middleware; set to `false` to keep HMR-only. Unrelated to `liveReload`: this one is about an update that was tried. **Deprecated**, removed in the next major release — use [`apply`](#client-options). | -| `autoConnect` | `boolean` | `true` | Connect on load; set to `false` and call `setOptionsAndConnect()` manually. **Deprecated**, removed in the next major release — use [`connect`](#client-options). | -| `reconnect` | `number` | `Infinity` / `10` | How many times to reconnect before giving up. Unset, `"sse"` keeps trying for as long as the page is open — a dev server is expected to come back — while `"ws"` gives up after `10`. Setting it applies to both. **Deprecated**, removed in the next major release — use [`connect`](#client-options). | -| `timeout` | `number` | `20000` | How long silence is tolerated before reconnecting, in milliseconds, and the interval between reconnections. `"sse"` only: its heartbeat arrives as data the client can see, while a `"ws"` heartbeat is a protocol ping the browser answers without telling JavaScript — a half-open socket there is terminated by the server instead. **Deprecated**, removed in the next major release — use [`connect`](#client-options). | +| `dynamicPublicPath` | `boolean` | `false` | Prefix `url` with `__webpack_public_path__` at runtime. The leading slash of `url` is stripped and no other normalization is applied, so the public path should end with `/`. | -#### A path in parts +#### A url in parts An absolute url says everything, which is more than is usually known: the host a page will be opened on, and the scheme it will be served over, are the -browser's to report. So `path` also takes the parts that differ and leaves the +browser's to report. So `url` also takes the parts that differ and leaves the rest to be resolved in the page: ```js app.use( middleware(compiler, { - hot: { client: { path: { port: 8080 } } }, + hot: { client: { url: { port: 8080 } } }, }), ); ``` @@ -1142,7 +1131,7 @@ http://localhost:3000/?webpack-dev-middleware-apply=false `false` is taken as `nothing`, which is what this parameter meant before `apply` replaced the three booleans it covers. -The `webpack-dev-middleware` part is the client's [`urlPrefix`](#client-options), so a server built on this middleware can set `hot.client.urlPrefix` and name the parameter after itself. What follows it is the option, spelled the one way the option is spelled. The name is matched whole and case-insensitively, and a value that is not one of the modes is left alone — a parameter that merely contains the words, or a value such as `nothingness`, changes nothing. +The `webpack-dev-middleware` part is the client's [`pageParamPrefix`](#client-options), so a server built on this middleware can set `hot.client.pageParamPrefix` and name the parameter after itself. What follows it is the option, spelled the one way the option is spelled. The name is matched whole and case-insensitively, and a value that is not one of the modes is left alone — a parameter that merely contains the words, or a value such as `nothingness`, changes nothing. The two parameters `apply` replaced still work, and narrow whatever mode is in force instead of replacing it — `?webpack-dev-middleware-hot=false` takes hot module replacement away and leaves the reload, `?webpack-dev-middleware-live-reload=false` takes the reload away and leaves hot module replacement, and both together do nothing. `apply` in the same url wins over them. They are kept for pages and bookmarks that already use them, and will be removed in the next major release. @@ -1190,7 +1179,7 @@ interact with the middleware at runtime: ### `attach(server)` -Gives the [`hot.transport: "ws"`](#hottransport) endpoint the HTTP server to answer WebSocket upgrades on. A handshake is an upgrade the server answers, which the middleware never sees, so it cannot find the server on its own. Use this when the server is built after the middleware; when it already exists, [`hot.server`](#hotserver) does the same thing. +Gives the [`hot.transport: "ws"`](#hottransport) endpoint the HTTP server to answer WebSocket upgrades on. A handshake is an upgrade the server answers, which the middleware never sees, so it cannot find the server on its own. To decide yourself which upgrades reach the endpoint, use [`handleUpgrade`](#handleupgradereq-socket-head) instead. Does nothing when `hot` is disabled or the transport is Server-Sent Events, which the middleware answers itself. diff --git a/client-src/index.js b/client-src/index.js index 1d3945f59..22de6ba05 100644 --- a/client-src/index.js +++ b/client-src/index.js @@ -62,7 +62,7 @@ import withToken from "./utils/with-token.js"; * @property {ApplyMode} apply what a build does to the page * @property {boolean | ConnectOptions} connect whether to connect when the entry runs, and how the connection is held open * @property {boolean | OverlayOptions} overlay enable the in-page error overlay (same value shape as webpack-dev-server's `client.overlay`) - * @property {string} urlPrefix prefix of the page-url parameters that override `apply` for one page + * @property {string} pageParamPrefix prefix of the page-url parameters that override `apply` for one page * @property {LogLevel} logging logger level * @property {string=} loggerName what to label messages with in the console * @property {string} name limit updates to this compilation name @@ -87,7 +87,7 @@ const options = { apply: "hmr", connect: true, overlay: true, - urlPrefix: "webpack-dev-middleware", + pageParamPrefix: "webpack-dev-middleware", logging: "info", loggerName: "", name: "", @@ -301,8 +301,8 @@ function readApplyMode(value) { * tab opts out of what the rest of the project is configured for — * `?webpack-dev-middleware-apply=nothing` to stop a page reloading under you * while you work in it, for instance, or `=false` for the same thing. - * `urlPrefix` names them, so a server built on this middleware can name them - * after itself. + * `pageParamPrefix` names them, so a server built on this middleware can name + * them after itself. * * The parameter is the option, spelled the one way the option is spelled. * @param {string} setting which option the page may have something to say about @@ -311,9 +311,9 @@ function readApplyMode(value) { function urlOverride(setting) { // Parsed rather than searched for as text: `?note=…-apply=false` carries // the words without being the parameter. The name is compared - // case-insensitively on both sides, so a `urlPrefix` with capitals in it - // works as written. - const wanted = `${options.urlPrefix}-${setting}`.toLowerCase(); + // case-insensitively on both sides, so a `pageParamPrefix` with capitals in + // it works as written. + const wanted = `${options.pageParamPrefix}-${setting}`.toLowerCase(); // Nowhere this runs is without a url, but nothing here needs one either: an // empty query asks for nothing. const search = @@ -417,11 +417,16 @@ function setOverrides(overrides) { // differ and leaves the rest to be resolved against the page, which is the // only place the rest is known — behind a proxy, on another host, or on a // socket listening on a port of its own. + // `url` is what the option is called in node, and wins; `path` is what this + // query called it first, and still reads. + if (overrides.url) { + overrides.path = overrides.url; + } // The parts of the url as parameters of their own, the way // webpack-dev-server's query has always carried them — so an entry written // by hand for that server still connects where it says. Read as a path in - // parts, which resolves what they leave out against the page; a `path` given - // as well says it all and wins. + // parts, which resolves what they leave out against the page; a `url` or + // `path` given as well says it all and wins. if (!overrides.path) { /** @type {Record} */ const parts = {}; @@ -514,7 +519,9 @@ function setOverrides(overrides) { options.apply = mode; } } - if (overrides.urlPrefix) options.urlPrefix = overrides.urlPrefix; + if (overrides.pageParamPrefix) { + options.pageParamPrefix = overrides.pageParamPrefix; + } if (overrides.name) { options.name = overrides.name; } diff --git a/src/hot.js b/src/hot.js index 0b5829ec9..3fbaa9d20 100644 --- a/src/hot.js +++ b/src/hot.js @@ -35,27 +35,20 @@ * here and the injected entry carries it, or write it on the query of a client * entry of your own. * - * `transport`, `path` and `name` are the exception only in having a default + * `transport`, `url` and `name` are the exception only in having a default * the middleware knows — the resolved `hot.transport`, the resolved `hot.path` * and the compilation's name. Setting one here replaces that, which is what a * page reaching the endpoint through a proxy or another origin needs. * @typedef {object} HotClientOptions * @property {("sse" | "ws" | string)=} transport which transport the runtime speaks, `hot.transport` by default; any other string is a module exporting a client class of your own, used in place of the built-in one - * @property {(string | PathSpec)=} path where the runtime connects, `hot.path` by default; may be an absolute url for an endpoint on another origin, or the parts that differ with the rest resolved in the page + * @property {(string | PathSpec)=} url where the runtime connects, `hot.path` by default: a path, an absolute url for an endpoint on another origin, or the parts that differ with the rest resolved in the page * @property {string=} name limit the runtime to one compilation's builds, the compilation's own name by default - * @property {string=} token the secret the runtime puts on its connection url, `hot.token` by default * @property {(boolean | Record)=} overlay show build problems and uncaught runtime errors in an overlay * @property {(boolean | "circular" | "linear")=} progress show an indicator while a rebuild is in progress - * @property {boolean=} hot deprecated, removed in the next major release — use `apply` - * @property {boolean=} liveReload deprecated, removed in the next major release — use `apply` - * @property {boolean=} reload deprecated, removed in the next major release — use `apply` * @property {("hmr" | "hmr-only" | "reload" | "nothing")=} apply what a build does to the page — apply the update and reload if it cannot be applied, apply it and stop with a message if it cannot, load the page again on any build that changed something, or leave the page alone * @property {(boolean | { retries?: number, timeout?: number })=} connect whether to connect when the entry runs, and how the connection is held open - * @property {string=} urlPrefix prefix of the page-url parameter that overrides `apply` for a single page + * @property {string=} pageParamPrefix prefix of the page-url parameters that override `apply` for a single page * @property {(LogLevel | { level?: LogLevel, name?: string })=} logging how much the runtime logs to the browser console, and the name every message is labelled with - * @property {number=} reconnect how many times to reconnect before giving up; unset, Server-Sent Events keep trying for as long as the page is open while a WebSocket gives up after 10 - * @property {number=} timeout how long the runtime tolerates silence before reconnecting, in milliseconds — Server-Sent Events only, since a WebSocket's heartbeat is a protocol ping JavaScript cannot see - * @property {boolean=} autoConnect connect as soon as the entry runs * @property {boolean=} dynamicPublicPath prefix the path with the bundle's public path at runtime */ @@ -64,7 +57,6 @@ * @property {("sse" | "ws" | ClientStreamFactory)=} transport how events reach the clients, Server-Sent Events by default * @property {string=} path the path the endpoint is served at * @property {number=} heartbeat heartbeat interval in milliseconds - * @property {HttpServer=} server HTTP server the `"ws"` transport answers upgrades on, when it is already built * @property {Record=} ws options for the `ws` server behind the `"ws"` transport — compression, payload limits, `verifyClient`, or a `port` or a `server` of its own to listen on; `path`, `noServer` and `clientTracking` are the middleware's * @property {StatsOptions=} statsOptions deprecated, removed in the next major release — webpack stats options used when serializing compilation results * @property {boolean=} progress publish compilation progress events to the clients @@ -578,12 +570,6 @@ function createHot(compiler, userOptions, statsOption) { } }); - // A WebSocket is upgraded by the HTTP server rather than answered by the - // middleware, so the transport needs the server itself. - if (options.server && eventStream.attach) { - eventStream.attach(options.server); - } - // TODO in the next major release remove `progress` and this warning if (options.progress) { logger.warn( diff --git a/src/options.check.js b/src/options.check.js index 41f62d9a6..2591119ba 100644 --- a/src/options.check.js +++ b/src/options.check.js @@ -2,4 +2,4 @@ // DO NOT MODIFY BY HAND. Run `npm run fix:schema-check` to update. /* eslint-disable */ // @ts-nocheck -"use strict";module.exports = validate10;module.exports.default = validate10;const schema11 = {"definitions":{"HotClient":{"description":"Options handed to the browser runtime through its entry query.","type":"object","additionalProperties":false,"properties":{"transport":{"description":"Which transport the runtime speaks: `sse` or `ws`, or a module that exports a client class of your own, which is used in place of the built-in one. Defaults to the resolved `hot.transport`.","anyOf":[{"enum":["sse","ws"]},{"type":"string","minLength":1}]},"path":{"description":"Where the runtime connects. Defaults to the resolved `hot.path`; a string may be an absolute url for an endpoint reached on another origin or through a proxy, and an object says only the parts that differ and leaves the rest to be resolved in the page, which is the only place the rest is known.","anyOf":[{"type":"string","minLength":1},{"type":"object","additionalProperties":false,"properties":{"protocol":{"description":"The scheme the runtime connects over. Unset, or `auto`, follows the page — and a page served over TLS then gets a secure connection, because a browser refuses a plaintext one from it. Set explicitly, it is honoured as given; the one exception is a `hostname` naming every interface, which is resolved to the page's host and takes the page's scheme with it. Only whether the scheme is the secure one carries over, since the two transports do not share one.","anyOf":[{"enum":["auto"]},{"type":"string","minLength":1}]},"hostname":{"description":"The host the runtime connects to. An address a server listens on to mean every interface (`0.0.0.0`, `::`) is not somewhere a page can connect, so it resolves to the page's own host.","type":"string","minLength":1},"port":{"description":"The port the runtime connects to. `0` means a port the server picked, which resolves to the page's own.","anyOf":[{"type":"number"},{"type":"string","minLength":1}]},"pathname":{"description":"The path the runtime connects to. Defaults to the resolved `hot.path`.","type":"string"},"username":{"description":"The username the runtime authenticates with.","type":"string"},"password":{"description":"The password the runtime authenticates with. Sent only alongside a username, since basic authentication has no empty one.","type":"string"}}}]},"name":{"description":"Limit the runtime to one compilation's builds. Defaults to the compilation's own name.","type":"string"},"token":{"description":"The secret the runtime puts on its connection url. The middleware sets this to whatever 'hot.token' resolved to, so it only needs setting for a client pointed at another endpoint that requires a different one.","type":"string"},"overlay":{"description":"Show build problems and uncaught runtime errors in an overlay.","anyOf":[{"type":"boolean"},{"type":"object"}]},"progress":{"description":"Show an indicator while a rebuild is in progress.","anyOf":[{"type":"boolean"},{"enum":["circular","linear"]}]},"apply":{"description":"What a build does to the page: `hmr` applies the update and reloads if it cannot be applied, `hmr-only` applies it and stops with a message if it cannot, `reload` loads the page again on a build that changed something, and `nothing` leaves the page alone until you reload it.","enum":["hmr","hmr-only","reload","nothing"]},"connect":{"description":"Whether to connect when the entry runs, and how the connection is held open. `false` does not connect; an object sets `retries` and `timeout`.","anyOf":[{"type":"boolean"},{"type":"object","additionalProperties":false,"properties":{"retries":{"description":"How many times to reconnect before giving up. Server-Sent Events keep trying for as long as the page is open unless this is set, since a dev server is expected to come back.","type":"number","minimum":0},"timeout":{"description":"How long silence is tolerated before reconnecting, in milliseconds. Server-Sent Events only: their heartbeat arrives as data the client can see, whereas a WebSocket's is a protocol ping the browser answers without telling JavaScript.","type":"number","minimum":1}}}]},"urlPrefix":{"description":"Prefix of the page-url parameter that overrides `apply` for a single page.","type":"string","minLength":1},"logging":{"description":"Logger level in the browser, or an object carrying the level and the name every message is labelled with in the console — a package embedding this runtime is the one a developer would report a problem to, so it can say its own name.","anyOf":[{"enum":["none","error","warn","info","log","verbose"]},{"type":"object","additionalProperties":false,"properties":{"level":{"enum":["none","error","warn","info","log","verbose"]},"name":{"description":"What every message is labelled with in the console. Defaults to this package's name.","type":"string","minLength":1}}}]},"dynamicPublicPath":{"description":"Prefix the endpoint path with the bundle's public path at runtime.","type":"boolean"},"hot":{"description":"Apply a build through Hot Module Replacement. Deprecated, and removed in the next major release: use `apply`.","type":"boolean"},"liveReload":{"description":"Reload the page on a build that changed something, when `hot` is off. Deprecated, and removed in the next major release: use `apply`.","type":"boolean"},"reload":{"description":"Reload the page when an update cannot be applied. Deprecated, and removed in the next major release: use `apply`.","type":"boolean"},"autoConnect":{"description":"Connect as soon as the entry runs. Deprecated, and removed in the next major release: use `connect`.","type":"boolean"},"reconnect":{"description":"How many times to reconnect before giving up. Unset, Server-Sent Events keep trying for as long as the page is open — a dev server is expected to come back — while a WebSocket gives up after 10. Setting it applies to both. Deprecated, and removed in the next major release: use `connect`.","type":"number","minimum":0},"timeout":{"description":"How long the runtime tolerates silence before reconnecting, in milliseconds. Server-Sent Events only: their heartbeat arrives as data the client can see, whereas a WebSocket's is a protocol ping the browser answers without telling JavaScript — a half-open socket there is terminated by the server instead. Deprecated, and removed in the next major release: use `connect`.","type":"number","exclusiveMinimum":0}}},"CorsOrigin":{"description":"An origin, written as a browser sends it (scheme, host and port, no trailing slash), several of them, a pattern, or a function asked about each.","anyOf":[{"type":"string","minLength":1},{"instanceof":"RegExp"},{"type":"array","items":{"anyOf":[{"type":"string","minLength":1},{"instanceof":"RegExp"}]},"minItems":1},{"instanceof":"Function"}]}},"type":"object","properties":{"cache":{"description":"How responses are cached.","link":"https://github.com/webpack/webpack-dev-middleware#cache","type":"object","additionalProperties":false,"properties":{"etag":{"description":"Enable or disable etag generation.","enum":["weak","strong"]},"lastModified":{"description":"Enable or disable `Last-Modified` header. Uses the file system's last modified value.","type":"boolean"},"control":{"description":"Enable or disable setting `Cache-Control` response header.","anyOf":[{"type":"boolean"},{"type":"number"},{"type":"string","minLength":1},{"type":"object","properties":{"maxAge":{"type":"number"},"immutable":{"type":"boolean"}},"additionalProperties":false}]},"immutable":{"description":"Enable or disable setting `Cache-Control: public, max-age=31536000, immutable` response header for immutable assets (i.e. asset with a hash in file name like `image.a4c12bde.jpg`).","type":"boolean"}}},"mime":{"description":"How a file's media type is decided.","link":"https://github.com/webpack/webpack-dev-middleware#mime","type":"object","additionalProperties":false,"properties":{"types":{"description":"Allows a user to register custom mime types or extension mappings.","type":"object"},"default":{"description":"Allows a user to register a default mime type when we can't determine the content type.","type":"string"}}},"mimeTypes":{"description":"Allows a user to register custom mime types or extension mappings.","link":"https://github.com/webpack/webpack-dev-middleware#mimetypes","type":"object"},"mimeTypeDefault":{"description":"Allows a user to register a default mime type when we can't determine the content type.","link":"https://github.com/webpack/webpack-dev-middleware#mimetypedefault","type":"string"},"writeToDisk":{"description":"Allows to write generated files on disk.","link":"https://github.com/webpack/webpack-dev-middleware#writetodisk","anyOf":[{"type":"boolean"},{"instanceof":"Function"}]},"methods":{"description":"Allows to pass the list of HTTP request methods accepted by the middleware.","link":"https://github.com/webpack/webpack-dev-middleware#methods","type":"array","items":{"type":"string","minLength":1}},"headers":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"key":{"description":"key of header.","type":"string"},"value":{"description":"value of header.","type":"string"}}},"minItems":1},{"type":"object"},{"instanceof":"Function"}],"description":"Allows to pass custom HTTP headers on each request","link":"https://github.com/webpack/webpack-dev-middleware#headers"},"publicPath":{"description":"The `publicPath` specifies the public URL address of the output files when referenced in a browser.","link":"https://github.com/webpack/webpack-dev-middleware#publicpath","anyOf":[{"enum":["auto"]},{"type":"string"},{"instanceof":"Function"}]},"stats":{"description":"Stats options object or preset name.","link":"https://github.com/webpack/webpack-dev-middleware#stats","anyOf":[{"enum":["none","summary","errors-only","errors-warnings","minimal","normal","detailed","verbose"]},{"type":"boolean"},{"type":"object","additionalProperties":true}]},"serverSideRender":{"description":"Instructs the module to enable or disable the server-side rendering mode.","link":"https://github.com/webpack/webpack-dev-middleware#serversiderender","type":"boolean"},"outputFileSystem":{"description":"Set the default file system which will be used by webpack as primary destination of generated files.","link":"https://github.com/webpack/webpack-dev-middleware#outputfilesystem","type":"object"},"index":{"description":"Allows to serve an index of the directory.","link":"https://github.com/webpack/webpack-dev-middleware#index","anyOf":[{"type":"boolean"},{"type":"string","minLength":1}]},"modifyResponseData":{"description":"Allows to set up a callback to change the response data.","link":"https://github.com/webpack/webpack-dev-middleware#modifyresponsedata","instanceof":"Function"},"etag":{"description":"Enable or disable etag generation.","link":"https://github.com/webpack/webpack-dev-middleware#etag","enum":["weak","strong"]},"lastModified":{"description":"Enable or disable `Last-Modified` header. Uses the file system's last modified value.","link":"https://github.com/webpack/webpack-dev-middleware#lastmodified","type":"boolean"},"cacheControl":{"description":"Enable or disable setting `Cache-Control` response header.","link":"https://github.com/webpack/webpack-dev-middleware#cachecontrol","anyOf":[{"type":"boolean"},{"type":"number"},{"type":"string","minLength":1},{"type":"object","properties":{"maxAge":{"type":"number"},"immutable":{"type":"boolean"}},"additionalProperties":false}]},"cacheImmutable":{"description":"Enable or disable setting `Cache-Control: public, max-age=31536000, immutable` response header for immutable assets (i.e. asset with a hash in file name like `image.a4c12bde.jpg`).","link":"https://github.com/webpack/webpack-dev-middleware#cacheimmutable","type":"boolean"},"forwardError":{"description":"Enable or disable forwarding errors to next middleware.","link":"https://github.com/webpack/webpack-dev-middleware#forwarderrors","type":"boolean"},"hot":{"description":"Enable hot module replacement over a Server-Sent Events or WebSocket endpoint.","link":"https://github.com/webpack/webpack-dev-middleware#hot","anyOf":[{"type":"boolean"},{"type":"object","additionalProperties":false,"properties":{"transport":{"description":"How events reach the clients: `sse`, `ws` (needs the optional `ws` dependency and an HTTP server to answer upgrades on, given as `server` or through the middleware's `attach` method), or a function building a transport of your own.","anyOf":[{"enum":["sse","ws"]},{"instanceof":"Function"}]},"path":{"description":"The path the endpoint is served at. Must start with a slash and carry no query string or fragment.","type":"string","pattern":"^/[^?#]*$"},"heartbeat":{"description":"Heartbeat interval (in milliseconds) used to keep the connection alive.","type":"number","minimum":1},"server":{"description":"HTTP server the `ws` transport answers upgrades on, when it is already built. Otherwise hand it over later with the middleware's `attach` method.","type":"object","additionalProperties":true},"ws":{"description":"Options for the `ws` server behind the `ws` transport: compression, payload limits, `verifyClient`, or a `port` or a `server` of its own to listen on instead of answering the upgrades it is handed. `path`, `noServer` and `clientTracking` are the middleware's and are ignored here.","link":"https://github.com/webpack/webpack-dev-middleware#hot","type":"object","additionalProperties":true},"progress":{"description":"Publish compilation progress events to the clients.","type":"boolean"},"token":{"description":"A secret the injected client carries and the endpoint requires, so reaching the stream takes something a page has to have been given rather than a header the browser may not send. `true` mints one per run, a string uses that one — for a client of your own that has to build the url itself — and `false` requires none. Defaults to `false`, because requiring one would refuse a client this middleware did not inject; `true` in the next major release.","link":"https://github.com/webpack/webpack-dev-middleware#hottoken","anyOf":[{"type":"boolean"},{"type":"string","minLength":1}]},"cors":{"description":"Which origins may read the Server-Sent Events endpoint from a page on another one. Local origins only by default. `true` grants every origin, which lets any site the developer has open read the build's errors, including the source frames webpack puts in them.","link":"https://github.com/webpack/webpack-dev-middleware#hotcors","anyOf":[{"type":"boolean"},{"$ref":"#/definitions/CorsOrigin"},{"type":"object","additionalProperties":false,"properties":{"origin":{"description":"Which origins may read it, as Vite and `expressjs/cors` are configured.","anyOf":[{"type":"boolean"},{"$ref":"#/definitions/CorsOrigin"}]}}}]},"statsOptions":{"description":"Deprecated, do not use, will be removed in the next major release. Use the `stats` option instead, which decides whether a payload carries errors and warnings.","type":"object","additionalProperties":true},"inject":{"description":"Add the hot client entry and HotModuleReplacementPlugin to the compilation. Turn it off to wire them yourself.","link":"https://github.com/webpack/webpack-dev-middleware#hot","type":"boolean"},"client":{"description":"Options handed to the browser runtime through its entry query. `false` adds no runtime to the page while still applying `HotModuleReplacementPlugin`, for a page that wires a client of its own.","link":"https://github.com/webpack/webpack-dev-middleware#hot","anyOf":[{"enum":[false]},{"$ref":"#/definitions/HotClient"}]}}}]}},"additionalProperties":false};const schema12 = {"description":"An origin, written as a browser sends it (scheme, host and port, no trailing slash), several of them, a pattern, or a function asked about each.","anyOf":[{"type":"string","minLength":1},{"instanceof":"RegExp"},{"type":"array","items":{"anyOf":[{"type":"string","minLength":1},{"instanceof":"RegExp"}]},"minItems":1},{"instanceof":"Function"}]};const schema14 = {"description":"Options handed to the browser runtime through its entry query.","type":"object","additionalProperties":false,"properties":{"transport":{"description":"Which transport the runtime speaks: `sse` or `ws`, or a module that exports a client class of your own, which is used in place of the built-in one. Defaults to the resolved `hot.transport`.","anyOf":[{"enum":["sse","ws"]},{"type":"string","minLength":1}]},"path":{"description":"Where the runtime connects. Defaults to the resolved `hot.path`; a string may be an absolute url for an endpoint reached on another origin or through a proxy, and an object says only the parts that differ and leaves the rest to be resolved in the page, which is the only place the rest is known.","anyOf":[{"type":"string","minLength":1},{"type":"object","additionalProperties":false,"properties":{"protocol":{"description":"The scheme the runtime connects over. Unset, or `auto`, follows the page — and a page served over TLS then gets a secure connection, because a browser refuses a plaintext one from it. Set explicitly, it is honoured as given; the one exception is a `hostname` naming every interface, which is resolved to the page's host and takes the page's scheme with it. Only whether the scheme is the secure one carries over, since the two transports do not share one.","anyOf":[{"enum":["auto"]},{"type":"string","minLength":1}]},"hostname":{"description":"The host the runtime connects to. An address a server listens on to mean every interface (`0.0.0.0`, `::`) is not somewhere a page can connect, so it resolves to the page's own host.","type":"string","minLength":1},"port":{"description":"The port the runtime connects to. `0` means a port the server picked, which resolves to the page's own.","anyOf":[{"type":"number"},{"type":"string","minLength":1}]},"pathname":{"description":"The path the runtime connects to. Defaults to the resolved `hot.path`.","type":"string"},"username":{"description":"The username the runtime authenticates with.","type":"string"},"password":{"description":"The password the runtime authenticates with. Sent only alongside a username, since basic authentication has no empty one.","type":"string"}}}]},"name":{"description":"Limit the runtime to one compilation's builds. Defaults to the compilation's own name.","type":"string"},"token":{"description":"The secret the runtime puts on its connection url. The middleware sets this to whatever 'hot.token' resolved to, so it only needs setting for a client pointed at another endpoint that requires a different one.","type":"string"},"overlay":{"description":"Show build problems and uncaught runtime errors in an overlay.","anyOf":[{"type":"boolean"},{"type":"object"}]},"progress":{"description":"Show an indicator while a rebuild is in progress.","anyOf":[{"type":"boolean"},{"enum":["circular","linear"]}]},"apply":{"description":"What a build does to the page: `hmr` applies the update and reloads if it cannot be applied, `hmr-only` applies it and stops with a message if it cannot, `reload` loads the page again on a build that changed something, and `nothing` leaves the page alone until you reload it.","enum":["hmr","hmr-only","reload","nothing"]},"connect":{"description":"Whether to connect when the entry runs, and how the connection is held open. `false` does not connect; an object sets `retries` and `timeout`.","anyOf":[{"type":"boolean"},{"type":"object","additionalProperties":false,"properties":{"retries":{"description":"How many times to reconnect before giving up. Server-Sent Events keep trying for as long as the page is open unless this is set, since a dev server is expected to come back.","type":"number","minimum":0},"timeout":{"description":"How long silence is tolerated before reconnecting, in milliseconds. Server-Sent Events only: their heartbeat arrives as data the client can see, whereas a WebSocket's is a protocol ping the browser answers without telling JavaScript.","type":"number","minimum":1}}}]},"urlPrefix":{"description":"Prefix of the page-url parameter that overrides `apply` for a single page.","type":"string","minLength":1},"logging":{"description":"Logger level in the browser, or an object carrying the level and the name every message is labelled with in the console — a package embedding this runtime is the one a developer would report a problem to, so it can say its own name.","anyOf":[{"enum":["none","error","warn","info","log","verbose"]},{"type":"object","additionalProperties":false,"properties":{"level":{"enum":["none","error","warn","info","log","verbose"]},"name":{"description":"What every message is labelled with in the console. Defaults to this package's name.","type":"string","minLength":1}}}]},"dynamicPublicPath":{"description":"Prefix the endpoint path with the bundle's public path at runtime.","type":"boolean"},"hot":{"description":"Apply a build through Hot Module Replacement. Deprecated, and removed in the next major release: use `apply`.","type":"boolean"},"liveReload":{"description":"Reload the page on a build that changed something, when `hot` is off. Deprecated, and removed in the next major release: use `apply`.","type":"boolean"},"reload":{"description":"Reload the page when an update cannot be applied. Deprecated, and removed in the next major release: use `apply`.","type":"boolean"},"autoConnect":{"description":"Connect as soon as the entry runs. Deprecated, and removed in the next major release: use `connect`.","type":"boolean"},"reconnect":{"description":"How many times to reconnect before giving up. Unset, Server-Sent Events keep trying for as long as the page is open — a dev server is expected to come back — while a WebSocket gives up after 10. Setting it applies to both. Deprecated, and removed in the next major release: use `connect`.","type":"number","minimum":0},"timeout":{"description":"How long the runtime tolerates silence before reconnecting, in milliseconds. Server-Sent Events only: their heartbeat arrives as data the client can see, whereas a WebSocket's is a protocol ping the browser answers without telling JavaScript — a half-open socket there is terminated by the server instead. Deprecated, and removed in the next major release: use `connect`.","type":"number","exclusiveMinimum":0}}};const func2 = Object.prototype.hasOwnProperty;const pattern0 = new RegExp("^/[^?#]*$", "u");function validate10(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(errors === 0){if(data && typeof data == "object" && !Array.isArray(data)){const _errs1 = errors;for(const key0 in data){if(!(func2.call(schema11.properties, key0))){validate10.errors = [{instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"}];return false;break;}}if(_errs1 === errors){if(data.cache !== undefined){let data0 = data.cache;const _errs2 = errors;if(errors === _errs2){if(data0 && typeof data0 == "object" && !Array.isArray(data0)){const _errs5 = errors;for(const key1 in data0){if(!((((key1 === "etag") || (key1 === "lastModified")) || (key1 === "control")) || (key1 === "immutable"))){validate10.errors = [{instancePath:instancePath+"/cache",schemaPath:"#/properties/cache/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"}];return false;break;}}if(_errs5 === errors){if(data0.etag !== undefined){let data1 = data0.etag;const _errs6 = errors;if(!((data1 === "weak") || (data1 === "strong"))){validate10.errors = [{instancePath:instancePath+"/cache/etag",schemaPath:"#/properties/cache/properties/etag/enum",keyword:"enum",params:{allowedValues: schema11.properties.cache.properties.etag.enum},message:"must be equal to one of the allowed values"}];return false;}var valid1 = _errs6 === errors;}else {var valid1 = true;}if(valid1){if(data0.lastModified !== undefined){const _errs7 = errors;if(typeof data0.lastModified !== "boolean"){validate10.errors = [{instancePath:instancePath+"/cache/lastModified",schemaPath:"#/properties/cache/properties/lastModified/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];return false;}var valid1 = _errs7 === errors;}else {var valid1 = true;}if(valid1){if(data0.control !== undefined){let data3 = data0.control;const _errs9 = errors;const _errs10 = errors;let valid2 = false;const _errs11 = errors;if(typeof data3 !== "boolean"){const err0 = {instancePath:instancePath+"/cache/control",schemaPath:"#/properties/cache/properties/control/anyOf/0/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}var _valid0 = _errs11 === errors;valid2 = valid2 || _valid0;if(!valid2){const _errs13 = errors;if(!(typeof data3 == "number")){const err1 = {instancePath:instancePath+"/cache/control",schemaPath:"#/properties/cache/properties/control/anyOf/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}var _valid0 = _errs13 === errors;valid2 = valid2 || _valid0;if(!valid2){const _errs15 = errors;if(errors === _errs15){if(typeof data3 === "string"){if(data3.length < 1){const err2 = {instancePath:instancePath+"/cache/control",schemaPath:"#/properties/cache/properties/control/anyOf/2/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}else {const err3 = {instancePath:instancePath+"/cache/control",schemaPath:"#/properties/cache/properties/control/anyOf/2/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}var _valid0 = _errs15 === errors;valid2 = valid2 || _valid0;if(!valid2){const _errs17 = errors;if(errors === _errs17){if(data3 && typeof data3 == "object" && !Array.isArray(data3)){const _errs19 = errors;for(const key2 in data3){if(!((key2 === "maxAge") || (key2 === "immutable"))){const err4 = {instancePath:instancePath+"/cache/control",schemaPath:"#/properties/cache/properties/control/anyOf/3/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key2},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;break;}}if(_errs19 === errors){if(data3.maxAge !== undefined){const _errs20 = errors;if(!(typeof data3.maxAge == "number")){const err5 = {instancePath:instancePath+"/cache/control/maxAge",schemaPath:"#/properties/cache/properties/control/anyOf/3/properties/maxAge/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}var valid3 = _errs20 === errors;}else {var valid3 = true;}if(valid3){if(data3.immutable !== undefined){const _errs22 = errors;if(typeof data3.immutable !== "boolean"){const err6 = {instancePath:instancePath+"/cache/control/immutable",schemaPath:"#/properties/cache/properties/control/anyOf/3/properties/immutable/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}var valid3 = _errs22 === errors;}else {var valid3 = true;}}}}else {const err7 = {instancePath:instancePath+"/cache/control",schemaPath:"#/properties/cache/properties/control/anyOf/3/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}var _valid0 = _errs17 === errors;valid2 = valid2 || _valid0;}}}if(!valid2){const err8 = {instancePath:instancePath+"/cache/control",schemaPath:"#/properties/cache/properties/control/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;validate10.errors = vErrors;return false;}else {errors = _errs10;if(vErrors !== null){if(_errs10){vErrors.length = _errs10;}else {vErrors = null;}}}var valid1 = _errs9 === errors;}else {var valid1 = true;}if(valid1){if(data0.immutable !== undefined){const _errs24 = errors;if(typeof data0.immutable !== "boolean"){validate10.errors = [{instancePath:instancePath+"/cache/immutable",schemaPath:"#/properties/cache/properties/immutable/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];return false;}var valid1 = _errs24 === errors;}else {var valid1 = true;}}}}}}else {validate10.errors = [{instancePath:instancePath+"/cache",schemaPath:"#/properties/cache/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid0 = _errs2 === errors;}else {var valid0 = true;}if(valid0){if(data.mime !== undefined){let data7 = data.mime;const _errs26 = errors;if(errors === _errs26){if(data7 && typeof data7 == "object" && !Array.isArray(data7)){const _errs29 = errors;for(const key3 in data7){if(!((key3 === "types") || (key3 === "default"))){validate10.errors = [{instancePath:instancePath+"/mime",schemaPath:"#/properties/mime/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key3},message:"must NOT have additional properties"}];return false;break;}}if(_errs29 === errors){if(data7.types !== undefined){let data8 = data7.types;const _errs30 = errors;if(!(data8 && typeof data8 == "object" && !Array.isArray(data8))){validate10.errors = [{instancePath:instancePath+"/mime/types",schemaPath:"#/properties/mime/properties/types/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}var valid4 = _errs30 === errors;}else {var valid4 = true;}if(valid4){if(data7.default !== undefined){const _errs32 = errors;if(typeof data7.default !== "string"){validate10.errors = [{instancePath:instancePath+"/mime/default",schemaPath:"#/properties/mime/properties/default/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid4 = _errs32 === errors;}else {var valid4 = true;}}}}else {validate10.errors = [{instancePath:instancePath+"/mime",schemaPath:"#/properties/mime/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid0 = _errs26 === errors;}else {var valid0 = true;}if(valid0){if(data.mimeTypes !== undefined){let data10 = data.mimeTypes;const _errs34 = errors;if(!(data10 && typeof data10 == "object" && !Array.isArray(data10))){validate10.errors = [{instancePath:instancePath+"/mimeTypes",schemaPath:"#/properties/mimeTypes/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}var valid0 = _errs34 === errors;}else {var valid0 = true;}if(valid0){if(data.mimeTypeDefault !== undefined){const _errs37 = errors;if(typeof data.mimeTypeDefault !== "string"){validate10.errors = [{instancePath:instancePath+"/mimeTypeDefault",schemaPath:"#/properties/mimeTypeDefault/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid0 = _errs37 === errors;}else {var valid0 = true;}if(valid0){if(data.writeToDisk !== undefined){let data12 = data.writeToDisk;const _errs40 = errors;const _errs41 = errors;let valid5 = false;const _errs42 = errors;if(typeof data12 !== "boolean"){const err9 = {instancePath:instancePath+"/writeToDisk",schemaPath:"#/properties/writeToDisk/anyOf/0/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}var _valid1 = _errs42 === errors;valid5 = valid5 || _valid1;if(!valid5){const _errs44 = errors;if(!(data12 instanceof Function)){const err10 = {instancePath:instancePath+"/writeToDisk",schemaPath:"#/properties/writeToDisk/anyOf/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}var _valid1 = _errs44 === errors;valid5 = valid5 || _valid1;}if(!valid5){const err11 = {instancePath:instancePath+"/writeToDisk",schemaPath:"#/properties/writeToDisk/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;validate10.errors = vErrors;return false;}else {errors = _errs41;if(vErrors !== null){if(_errs41){vErrors.length = _errs41;}else {vErrors = null;}}}var valid0 = _errs40 === errors;}else {var valid0 = true;}if(valid0){if(data.methods !== undefined){let data13 = data.methods;const _errs46 = errors;if(errors === _errs46){if(Array.isArray(data13)){var valid6 = true;const len0 = data13.length;for(let i0=0; i0=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err49];}else {vErrors.push(err49);}errors++;}}else {const err50 = {instancePath:instancePath+"/hot/heartbeat",schemaPath:"#/properties/hot/anyOf/1/properties/heartbeat/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err50];}else {vErrors.push(err50);}errors++;}}var valid16 = _errs137 === errors;}else {var valid16 = true;}if(valid16){if(data32.server !== undefined){let data36 = data32.server;const _errs139 = errors;if(errors === _errs139){if(data36 && typeof data36 == "object" && !Array.isArray(data36)){}else {const err51 = {instancePath:instancePath+"/hot/server",schemaPath:"#/properties/hot/anyOf/1/properties/server/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err51];}else {vErrors.push(err51);}errors++;}}var valid16 = _errs139 === errors;}else {var valid16 = true;}if(valid16){if(data32.ws !== undefined){let data37 = data32.ws;const _errs142 = errors;if(errors === _errs142){if(data37 && typeof data37 == "object" && !Array.isArray(data37)){}else {const err52 = {instancePath:instancePath+"/hot/ws",schemaPath:"#/properties/hot/anyOf/1/properties/ws/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err52];}else {vErrors.push(err52);}errors++;}}var valid16 = _errs142 === errors;}else {var valid16 = true;}if(valid16){if(data32.progress !== undefined){const _errs146 = errors;if(typeof data32.progress !== "boolean"){const err53 = {instancePath:instancePath+"/hot/progress",schemaPath:"#/properties/hot/anyOf/1/properties/progress/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err53];}else {vErrors.push(err53);}errors++;}var valid16 = _errs146 === errors;}else {var valid16 = true;}if(valid16){if(data32.token !== undefined){let data39 = data32.token;const _errs148 = errors;const _errs149 = errors;let valid18 = false;const _errs150 = errors;if(typeof data39 !== "boolean"){const err54 = {instancePath:instancePath+"/hot/token",schemaPath:"#/properties/hot/anyOf/1/properties/token/anyOf/0/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err54];}else {vErrors.push(err54);}errors++;}var _valid9 = _errs150 === errors;valid18 = valid18 || _valid9;if(!valid18){const _errs152 = errors;if(errors === _errs152){if(typeof data39 === "string"){if(data39.length < 1){const err55 = {instancePath:instancePath+"/hot/token",schemaPath:"#/properties/hot/anyOf/1/properties/token/anyOf/1/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err55];}else {vErrors.push(err55);}errors++;}}else {const err56 = {instancePath:instancePath+"/hot/token",schemaPath:"#/properties/hot/anyOf/1/properties/token/anyOf/1/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err56];}else {vErrors.push(err56);}errors++;}}var _valid9 = _errs152 === errors;valid18 = valid18 || _valid9;}if(!valid18){const err57 = {instancePath:instancePath+"/hot/token",schemaPath:"#/properties/hot/anyOf/1/properties/token/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err57];}else {vErrors.push(err57);}errors++;}else {errors = _errs149;if(vErrors !== null){if(_errs149){vErrors.length = _errs149;}else {vErrors = null;}}}var valid16 = _errs148 === errors;}else {var valid16 = true;}if(valid16){if(data32.cors !== undefined){let data40 = data32.cors;const _errs155 = errors;const _errs156 = errors;let valid19 = false;const _errs157 = errors;if(typeof data40 !== "boolean"){const err58 = {instancePath:instancePath+"/hot/cors",schemaPath:"#/properties/hot/anyOf/1/properties/cors/anyOf/0/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err58];}else {vErrors.push(err58);}errors++;}var _valid10 = _errs157 === errors;valid19 = valid19 || _valid10;if(!valid19){const _errs159 = errors;const _errs161 = errors;let valid21 = false;const _errs162 = errors;if(errors === _errs162){if(typeof data40 === "string"){if(data40.length < 1){const err59 = {instancePath:instancePath+"/hot/cors",schemaPath:"#/definitions/CorsOrigin/anyOf/0/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err59];}else {vErrors.push(err59);}errors++;}}else {const err60 = {instancePath:instancePath+"/hot/cors",schemaPath:"#/definitions/CorsOrigin/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err60];}else {vErrors.push(err60);}errors++;}}var _valid11 = _errs162 === errors;valid21 = valid21 || _valid11;if(!valid21){const _errs164 = errors;if(!(data40 instanceof RegExp)){const err61 = {instancePath:instancePath+"/hot/cors",schemaPath:"#/definitions/CorsOrigin/anyOf/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err61];}else {vErrors.push(err61);}errors++;}var _valid11 = _errs164 === errors;valid21 = valid21 || _valid11;if(!valid21){const _errs165 = errors;if(errors === _errs165){if(Array.isArray(data40)){if(data40.length < 1){const err62 = {instancePath:instancePath+"/hot/cors",schemaPath:"#/definitions/CorsOrigin/anyOf/2/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err62];}else {vErrors.push(err62);}errors++;}else {var valid22 = true;const len2 = data40.length;for(let i2=0; i2=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err123];}else {vErrors.push(err123);}errors++;}}else {const err124 = {instancePath:instancePath+"/hot/client/connect/retries",schemaPath:"#/definitions/HotClient/properties/connect/anyOf/1/properties/retries/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err124];}else {vErrors.push(err124);}errors++;}}var valid41 = _errs262 === errors;}else {var valid41 = true;}if(valid41){if(data60.timeout !== undefined){let data62 = data60.timeout;const _errs264 = errors;if(errors === _errs264){if(typeof data62 == "number"){if(data62 < 1 || isNaN(data62)){const err125 = {instancePath:instancePath+"/hot/client/connect/timeout",schemaPath:"#/definitions/HotClient/properties/connect/anyOf/1/properties/timeout/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err125];}else {vErrors.push(err125);}errors++;}}else {const err126 = {instancePath:instancePath+"/hot/client/connect/timeout",schemaPath:"#/definitions/HotClient/properties/connect/anyOf/1/properties/timeout/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err126];}else {vErrors.push(err126);}errors++;}}var valid41 = _errs264 === errors;}else {var valid41 = true;}}}}else {const err127 = {instancePath:instancePath+"/hot/client/connect",schemaPath:"#/definitions/HotClient/properties/connect/anyOf/1/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err127];}else {vErrors.push(err127);}errors++;}}var _valid23 = _errs259 === errors;valid40 = valid40 || _valid23;}if(!valid40){const err128 = {instancePath:instancePath+"/hot/client/connect",schemaPath:"#/definitions/HotClient/properties/connect/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err128];}else {vErrors.push(err128);}errors++;}else {errors = _errs256;if(vErrors !== null){if(_errs256){vErrors.length = _errs256;}else {vErrors = null;}}}var valid32 = _errs255 === errors;}else {var valid32 = true;}if(valid32){if(data46.urlPrefix !== undefined){let data63 = data46.urlPrefix;const _errs266 = errors;if(errors === _errs266){if(typeof data63 === "string"){if(data63.length < 1){const err129 = {instancePath:instancePath+"/hot/client/urlPrefix",schemaPath:"#/definitions/HotClient/properties/urlPrefix/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err129];}else {vErrors.push(err129);}errors++;}}else {const err130 = {instancePath:instancePath+"/hot/client/urlPrefix",schemaPath:"#/definitions/HotClient/properties/urlPrefix/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err130];}else {vErrors.push(err130);}errors++;}}var valid32 = _errs266 === errors;}else {var valid32 = true;}if(valid32){if(data46.logging !== undefined){let data64 = data46.logging;const _errs268 = errors;const _errs269 = errors;let valid42 = false;const _errs270 = errors;if(!((((((data64 === "none") || (data64 === "error")) || (data64 === "warn")) || (data64 === "info")) || (data64 === "log")) || (data64 === "verbose"))){const err131 = {instancePath:instancePath+"/hot/client/logging",schemaPath:"#/definitions/HotClient/properties/logging/anyOf/0/enum",keyword:"enum",params:{allowedValues: schema14.properties.logging.anyOf[0].enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err131];}else {vErrors.push(err131);}errors++;}var _valid24 = _errs270 === errors;valid42 = valid42 || _valid24;if(!valid42){const _errs271 = errors;if(errors === _errs271){if(data64 && typeof data64 == "object" && !Array.isArray(data64)){const _errs273 = errors;for(const key11 in data64){if(!((key11 === "level") || (key11 === "name"))){const err132 = {instancePath:instancePath+"/hot/client/logging",schemaPath:"#/definitions/HotClient/properties/logging/anyOf/1/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key11},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err132];}else {vErrors.push(err132);}errors++;break;}}if(_errs273 === errors){if(data64.level !== undefined){let data65 = data64.level;const _errs274 = errors;if(!((((((data65 === "none") || (data65 === "error")) || (data65 === "warn")) || (data65 === "info")) || (data65 === "log")) || (data65 === "verbose"))){const err133 = {instancePath:instancePath+"/hot/client/logging/level",schemaPath:"#/definitions/HotClient/properties/logging/anyOf/1/properties/level/enum",keyword:"enum",params:{allowedValues: schema14.properties.logging.anyOf[1].properties.level.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err133];}else {vErrors.push(err133);}errors++;}var valid43 = _errs274 === errors;}else {var valid43 = true;}if(valid43){if(data64.name !== undefined){let data66 = data64.name;const _errs275 = errors;if(errors === _errs275){if(typeof data66 === "string"){if(data66.length < 1){const err134 = {instancePath:instancePath+"/hot/client/logging/name",schemaPath:"#/definitions/HotClient/properties/logging/anyOf/1/properties/name/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err134];}else {vErrors.push(err134);}errors++;}}else {const err135 = {instancePath:instancePath+"/hot/client/logging/name",schemaPath:"#/definitions/HotClient/properties/logging/anyOf/1/properties/name/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err135];}else {vErrors.push(err135);}errors++;}}var valid43 = _errs275 === errors;}else {var valid43 = true;}}}}else {const err136 = {instancePath:instancePath+"/hot/client/logging",schemaPath:"#/definitions/HotClient/properties/logging/anyOf/1/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err136];}else {vErrors.push(err136);}errors++;}}var _valid24 = _errs271 === errors;valid42 = valid42 || _valid24;}if(!valid42){const err137 = {instancePath:instancePath+"/hot/client/logging",schemaPath:"#/definitions/HotClient/properties/logging/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err137];}else {vErrors.push(err137);}errors++;}else {errors = _errs269;if(vErrors !== null){if(_errs269){vErrors.length = _errs269;}else {vErrors = null;}}}var valid32 = _errs268 === errors;}else {var valid32 = true;}if(valid32){if(data46.dynamicPublicPath !== undefined){const _errs277 = errors;if(typeof data46.dynamicPublicPath !== "boolean"){const err138 = {instancePath:instancePath+"/hot/client/dynamicPublicPath",schemaPath:"#/definitions/HotClient/properties/dynamicPublicPath/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err138];}else {vErrors.push(err138);}errors++;}var valid32 = _errs277 === errors;}else {var valid32 = true;}if(valid32){if(data46.hot !== undefined){const _errs279 = errors;if(typeof data46.hot !== "boolean"){const err139 = {instancePath:instancePath+"/hot/client/hot",schemaPath:"#/definitions/HotClient/properties/hot/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err139];}else {vErrors.push(err139);}errors++;}var valid32 = _errs279 === errors;}else {var valid32 = true;}if(valid32){if(data46.liveReload !== undefined){const _errs281 = errors;if(typeof data46.liveReload !== "boolean"){const err140 = {instancePath:instancePath+"/hot/client/liveReload",schemaPath:"#/definitions/HotClient/properties/liveReload/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err140];}else {vErrors.push(err140);}errors++;}var valid32 = _errs281 === errors;}else {var valid32 = true;}if(valid32){if(data46.reload !== undefined){const _errs283 = errors;if(typeof data46.reload !== "boolean"){const err141 = {instancePath:instancePath+"/hot/client/reload",schemaPath:"#/definitions/HotClient/properties/reload/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err141];}else {vErrors.push(err141);}errors++;}var valid32 = _errs283 === errors;}else {var valid32 = true;}if(valid32){if(data46.autoConnect !== undefined){const _errs285 = errors;if(typeof data46.autoConnect !== "boolean"){const err142 = {instancePath:instancePath+"/hot/client/autoConnect",schemaPath:"#/definitions/HotClient/properties/autoConnect/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err142];}else {vErrors.push(err142);}errors++;}var valid32 = _errs285 === errors;}else {var valid32 = true;}if(valid32){if(data46.reconnect !== undefined){let data72 = data46.reconnect;const _errs287 = errors;if(errors === _errs287){if(typeof data72 == "number"){if(data72 < 0 || isNaN(data72)){const err143 = {instancePath:instancePath+"/hot/client/reconnect",schemaPath:"#/definitions/HotClient/properties/reconnect/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err143];}else {vErrors.push(err143);}errors++;}}else {const err144 = {instancePath:instancePath+"/hot/client/reconnect",schemaPath:"#/definitions/HotClient/properties/reconnect/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err144];}else {vErrors.push(err144);}errors++;}}var valid32 = _errs287 === errors;}else {var valid32 = true;}if(valid32){if(data46.timeout !== undefined){let data73 = data46.timeout;const _errs289 = errors;if(errors === _errs289){if(typeof data73 == "number"){if(data73 <= 0 || isNaN(data73)){const err145 = {instancePath:instancePath+"/hot/client/timeout",schemaPath:"#/definitions/HotClient/properties/timeout/exclusiveMinimum",keyword:"exclusiveMinimum",params:{comparison: ">", limit: 0},message:"must be > 0"};if(vErrors === null){vErrors = [err145];}else {vErrors.push(err145);}errors++;}}else {const err146 = {instancePath:instancePath+"/hot/client/timeout",schemaPath:"#/definitions/HotClient/properties/timeout/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err146];}else {vErrors.push(err146);}errors++;}}var valid32 = _errs289 === errors;}else {var valid32 = true;}}}}}}}}}}}}}}}}}}}else {const err147 = {instancePath:instancePath+"/hot/client",schemaPath:"#/definitions/HotClient/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err147];}else {vErrors.push(err147);}errors++;}}var _valid16 = _errs204 === errors;valid30 = valid30 || _valid16;}if(!valid30){const err148 = {instancePath:instancePath+"/hot/client",schemaPath:"#/properties/hot/anyOf/1/properties/client/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err148];}else {vErrors.push(err148);}errors++;}else {errors = _errs202;if(vErrors !== null){if(_errs202){vErrors.length = _errs202;}else {vErrors = null;}}}var valid16 = _errs201 === errors;}else {var valid16 = true;}}}}}}}}}}}}}else {const err149 = {instancePath:instancePath+"/hot",schemaPath:"#/properties/hot/anyOf/1/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err149];}else {vErrors.push(err149);}errors++;}}var _valid7 = _errs128 === errors;valid15 = valid15 || _valid7;}if(!valid15){const err150 = {instancePath:instancePath+"/hot",schemaPath:"#/properties/hot/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err150];}else {vErrors.push(err150);}errors++;validate10.errors = vErrors;return false;}else {errors = _errs125;if(vErrors !== null){if(_errs125){vErrors.length = _errs125;}else {vErrors = null;}}}var valid0 = _errs124 === errors;}else {var valid0 = true;}}}}}}}}}}}}}}}}}}}}}else {validate10.errors = [{instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}validate10.errors = vErrors;return errors === 0;} \ No newline at end of file +"use strict";module.exports = validate10;module.exports.default = validate10;const schema11 = {"definitions":{"HotClient":{"description":"Options handed to the browser runtime through its entry query.","type":"object","additionalProperties":false,"properties":{"transport":{"description":"Which transport the runtime speaks: `sse` or `ws`, or a module that exports a client class of your own, which is used in place of the built-in one. Defaults to the resolved `hot.transport`.","anyOf":[{"enum":["sse","ws"]},{"type":"string","minLength":1}]},"url":{"description":"Where the runtime connects: a path, an absolute url for an endpoint reached on another origin or through a proxy, or the parts of one that differ, with the rest resolved in the page, which is the only place the rest is known. Defaults to the resolved `hot.path`.","anyOf":[{"type":"string","minLength":1},{"type":"object","additionalProperties":false,"properties":{"protocol":{"description":"The scheme the runtime connects over. Unset, or `auto`, follows the page — and a page served over TLS then gets a secure connection, because a browser refuses a plaintext one from it. Set explicitly, it is honoured as given; the one exception is a `hostname` naming every interface, which is resolved to the page's host and takes the page's scheme with it. Only whether the scheme is the secure one carries over, since the two transports do not share one.","anyOf":[{"enum":["auto"]},{"type":"string","minLength":1}]},"hostname":{"description":"The host the runtime connects to. An address a server listens on to mean every interface (`0.0.0.0`, `::`) is not somewhere a page can connect, so it resolves to the page's own host.","type":"string","minLength":1},"port":{"description":"The port the runtime connects to. `0` means a port the server picked, which resolves to the page's own.","anyOf":[{"type":"number"},{"type":"string","minLength":1}]},"pathname":{"description":"The path the runtime connects to. Defaults to the resolved `hot.path`.","type":"string"},"username":{"description":"The username the runtime authenticates with.","type":"string"},"password":{"description":"The password the runtime authenticates with. Sent only alongside a username, since basic authentication has no empty one.","type":"string"}}}]},"name":{"description":"Limit the runtime to one compilation's builds. Defaults to the compilation's own name.","type":"string"},"overlay":{"description":"Show build problems and uncaught runtime errors in an overlay.","anyOf":[{"type":"boolean"},{"type":"object"}]},"progress":{"description":"Show an indicator while a rebuild is in progress.","anyOf":[{"type":"boolean"},{"enum":["circular","linear"]}]},"apply":{"description":"What a build does to the page: `hmr` applies the update and reloads if it cannot be applied, `hmr-only` applies it and stops with a message if it cannot, `reload` loads the page again on a build that changed something, and `nothing` leaves the page alone until you reload it.","enum":["hmr","hmr-only","reload","nothing"]},"connect":{"description":"Whether to connect when the entry runs, and how the connection is held open. `false` does not connect; an object sets `retries` and `timeout`.","anyOf":[{"type":"boolean"},{"type":"object","additionalProperties":false,"properties":{"retries":{"description":"How many times to reconnect before giving up. Server-Sent Events keep trying for as long as the page is open unless this is set, since a dev server is expected to come back.","type":"number","minimum":0},"timeout":{"description":"How long silence is tolerated before reconnecting, in milliseconds. Server-Sent Events only: their heartbeat arrives as data the client can see, whereas a WebSocket's is a protocol ping the browser answers without telling JavaScript.","type":"number","minimum":1}}}]},"pageParamPrefix":{"description":"Prefix of the page-url parameters that override `apply` for a single page, as in `?webpack-dev-middleware-hot=false`.","type":"string","minLength":1},"logging":{"description":"Logger level in the browser, or an object carrying the level and the name every message is labelled with in the console — a package embedding this runtime is the one a developer would report a problem to, so it can say its own name.","anyOf":[{"enum":["none","error","warn","info","log","verbose"]},{"type":"object","additionalProperties":false,"properties":{"level":{"enum":["none","error","warn","info","log","verbose"]},"name":{"description":"What every message is labelled with in the console. Defaults to this package's name.","type":"string","minLength":1}}}]},"dynamicPublicPath":{"description":"Prefix the endpoint path with the bundle's public path at runtime.","type":"boolean"}}},"CorsOrigin":{"description":"An origin, written as a browser sends it (scheme, host and port, no trailing slash), several of them, a pattern, or a function asked about each.","anyOf":[{"type":"string","minLength":1},{"instanceof":"RegExp"},{"type":"array","items":{"anyOf":[{"type":"string","minLength":1},{"instanceof":"RegExp"}]},"minItems":1},{"instanceof":"Function"}]}},"type":"object","properties":{"cache":{"description":"How responses are cached.","link":"https://github.com/webpack/webpack-dev-middleware#cache","type":"object","additionalProperties":false,"properties":{"etag":{"description":"Enable or disable etag generation.","enum":["weak","strong"]},"lastModified":{"description":"Enable or disable `Last-Modified` header. Uses the file system's last modified value.","type":"boolean"},"control":{"description":"Enable or disable setting `Cache-Control` response header.","anyOf":[{"type":"boolean"},{"type":"number"},{"type":"string","minLength":1},{"type":"object","properties":{"maxAge":{"type":"number"},"immutable":{"type":"boolean"}},"additionalProperties":false}]},"immutable":{"description":"Enable or disable setting `Cache-Control: public, max-age=31536000, immutable` response header for immutable assets (i.e. asset with a hash in file name like `image.a4c12bde.jpg`).","type":"boolean"}}},"mime":{"description":"How a file's media type is decided.","link":"https://github.com/webpack/webpack-dev-middleware#mime","type":"object","additionalProperties":false,"properties":{"types":{"description":"Allows a user to register custom mime types or extension mappings.","type":"object"},"default":{"description":"Allows a user to register a default mime type when we can't determine the content type.","type":"string"}}},"mimeTypes":{"description":"Allows a user to register custom mime types or extension mappings.","link":"https://github.com/webpack/webpack-dev-middleware#mimetypes","type":"object"},"mimeTypeDefault":{"description":"Allows a user to register a default mime type when we can't determine the content type.","link":"https://github.com/webpack/webpack-dev-middleware#mimetypedefault","type":"string"},"writeToDisk":{"description":"Allows to write generated files on disk.","link":"https://github.com/webpack/webpack-dev-middleware#writetodisk","anyOf":[{"type":"boolean"},{"instanceof":"Function"}]},"methods":{"description":"Allows to pass the list of HTTP request methods accepted by the middleware.","link":"https://github.com/webpack/webpack-dev-middleware#methods","type":"array","items":{"type":"string","minLength":1}},"headers":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"key":{"description":"key of header.","type":"string"},"value":{"description":"value of header.","type":"string"}}},"minItems":1},{"type":"object"},{"instanceof":"Function"}],"description":"Allows to pass custom HTTP headers on each request","link":"https://github.com/webpack/webpack-dev-middleware#headers"},"publicPath":{"description":"The `publicPath` specifies the public URL address of the output files when referenced in a browser.","link":"https://github.com/webpack/webpack-dev-middleware#publicpath","anyOf":[{"enum":["auto"]},{"type":"string"},{"instanceof":"Function"}]},"stats":{"description":"Stats options object or preset name.","link":"https://github.com/webpack/webpack-dev-middleware#stats","anyOf":[{"enum":["none","summary","errors-only","errors-warnings","minimal","normal","detailed","verbose"]},{"type":"boolean"},{"type":"object","additionalProperties":true}]},"serverSideRender":{"description":"Instructs the module to enable or disable the server-side rendering mode.","link":"https://github.com/webpack/webpack-dev-middleware#serversiderender","type":"boolean"},"outputFileSystem":{"description":"Set the default file system which will be used by webpack as primary destination of generated files.","link":"https://github.com/webpack/webpack-dev-middleware#outputfilesystem","type":"object"},"index":{"description":"Allows to serve an index of the directory.","link":"https://github.com/webpack/webpack-dev-middleware#index","anyOf":[{"type":"boolean"},{"type":"string","minLength":1}]},"modifyResponseData":{"description":"Allows to set up a callback to change the response data.","link":"https://github.com/webpack/webpack-dev-middleware#modifyresponsedata","instanceof":"Function"},"etag":{"description":"Enable or disable etag generation.","link":"https://github.com/webpack/webpack-dev-middleware#etag","enum":["weak","strong"]},"lastModified":{"description":"Enable or disable `Last-Modified` header. Uses the file system's last modified value.","link":"https://github.com/webpack/webpack-dev-middleware#lastmodified","type":"boolean"},"cacheControl":{"description":"Enable or disable setting `Cache-Control` response header.","link":"https://github.com/webpack/webpack-dev-middleware#cachecontrol","anyOf":[{"type":"boolean"},{"type":"number"},{"type":"string","minLength":1},{"type":"object","properties":{"maxAge":{"type":"number"},"immutable":{"type":"boolean"}},"additionalProperties":false}]},"cacheImmutable":{"description":"Enable or disable setting `Cache-Control: public, max-age=31536000, immutable` response header for immutable assets (i.e. asset with a hash in file name like `image.a4c12bde.jpg`).","link":"https://github.com/webpack/webpack-dev-middleware#cacheimmutable","type":"boolean"},"forwardError":{"description":"Enable or disable forwarding errors to next middleware.","link":"https://github.com/webpack/webpack-dev-middleware#forwarderrors","type":"boolean"},"hot":{"description":"Enable hot module replacement over a Server-Sent Events or WebSocket endpoint.","link":"https://github.com/webpack/webpack-dev-middleware#hot","anyOf":[{"type":"boolean"},{"type":"object","additionalProperties":false,"properties":{"transport":{"description":"How events reach the clients: `sse`, `ws` (needs the optional `ws` dependency and an HTTP server to answer upgrades on, handed over through the middleware's `attach` or `handleUpgrade` method), or a function building a transport of your own.","anyOf":[{"enum":["sse","ws"]},{"instanceof":"Function"}]},"path":{"description":"The path the endpoint is served at. Must start with a slash and carry no query string or fragment.","type":"string","pattern":"^/[^?#]*$"},"heartbeat":{"description":"Heartbeat interval (in milliseconds) used to keep the connection alive.","type":"number","minimum":1},"ws":{"description":"Options for the `ws` server behind the `ws` transport: compression, payload limits, `verifyClient`, or a `port` or a `server` of its own to listen on instead of answering the upgrades it is handed. `path`, `noServer` and `clientTracking` are the middleware's and are ignored here.","link":"https://github.com/webpack/webpack-dev-middleware#hot","type":"object","additionalProperties":true},"progress":{"description":"Publish compilation progress events to the clients.","type":"boolean"},"token":{"description":"A secret the injected client carries and the endpoint requires, so reaching the stream takes something a page has to have been given rather than a header the browser may not send. `true` mints one per run, a string uses that one — for a client of your own that has to build the url itself — and `false` requires none. Defaults to `false`, because requiring one would refuse a client this middleware did not inject; `true` in the next major release.","link":"https://github.com/webpack/webpack-dev-middleware#hottoken","anyOf":[{"type":"boolean"},{"type":"string","minLength":1}]},"cors":{"description":"Which origins may read the Server-Sent Events endpoint from a page on another one. Local origins only by default. `true` grants every origin, which lets any site the developer has open read the build's errors, including the source frames webpack puts in them.","link":"https://github.com/webpack/webpack-dev-middleware#hotcors","anyOf":[{"type":"boolean"},{"$ref":"#/definitions/CorsOrigin"},{"type":"object","additionalProperties":false,"properties":{"origin":{"description":"Which origins may read it, as Vite and `expressjs/cors` are configured.","anyOf":[{"type":"boolean"},{"$ref":"#/definitions/CorsOrigin"}]}}}]},"statsOptions":{"description":"Deprecated, do not use, will be removed in the next major release. Use the `stats` option instead, which decides whether a payload carries errors and warnings.","type":"object","additionalProperties":true},"inject":{"description":"Add the hot client entry and HotModuleReplacementPlugin to the compilation. Turn it off to wire them yourself.","link":"https://github.com/webpack/webpack-dev-middleware#hot","type":"boolean"},"client":{"description":"Options handed to the browser runtime through its entry query. `false` adds no runtime to the page while still applying `HotModuleReplacementPlugin`, for a page that wires a client of its own.","link":"https://github.com/webpack/webpack-dev-middleware#hot","anyOf":[{"enum":[false]},{"$ref":"#/definitions/HotClient"}]}}}]}},"additionalProperties":false};const schema12 = {"description":"An origin, written as a browser sends it (scheme, host and port, no trailing slash), several of them, a pattern, or a function asked about each.","anyOf":[{"type":"string","minLength":1},{"instanceof":"RegExp"},{"type":"array","items":{"anyOf":[{"type":"string","minLength":1},{"instanceof":"RegExp"}]},"minItems":1},{"instanceof":"Function"}]};const schema14 = {"description":"Options handed to the browser runtime through its entry query.","type":"object","additionalProperties":false,"properties":{"transport":{"description":"Which transport the runtime speaks: `sse` or `ws`, or a module that exports a client class of your own, which is used in place of the built-in one. Defaults to the resolved `hot.transport`.","anyOf":[{"enum":["sse","ws"]},{"type":"string","minLength":1}]},"url":{"description":"Where the runtime connects: a path, an absolute url for an endpoint reached on another origin or through a proxy, or the parts of one that differ, with the rest resolved in the page, which is the only place the rest is known. Defaults to the resolved `hot.path`.","anyOf":[{"type":"string","minLength":1},{"type":"object","additionalProperties":false,"properties":{"protocol":{"description":"The scheme the runtime connects over. Unset, or `auto`, follows the page — and a page served over TLS then gets a secure connection, because a browser refuses a plaintext one from it. Set explicitly, it is honoured as given; the one exception is a `hostname` naming every interface, which is resolved to the page's host and takes the page's scheme with it. Only whether the scheme is the secure one carries over, since the two transports do not share one.","anyOf":[{"enum":["auto"]},{"type":"string","minLength":1}]},"hostname":{"description":"The host the runtime connects to. An address a server listens on to mean every interface (`0.0.0.0`, `::`) is not somewhere a page can connect, so it resolves to the page's own host.","type":"string","minLength":1},"port":{"description":"The port the runtime connects to. `0` means a port the server picked, which resolves to the page's own.","anyOf":[{"type":"number"},{"type":"string","minLength":1}]},"pathname":{"description":"The path the runtime connects to. Defaults to the resolved `hot.path`.","type":"string"},"username":{"description":"The username the runtime authenticates with.","type":"string"},"password":{"description":"The password the runtime authenticates with. Sent only alongside a username, since basic authentication has no empty one.","type":"string"}}}]},"name":{"description":"Limit the runtime to one compilation's builds. Defaults to the compilation's own name.","type":"string"},"overlay":{"description":"Show build problems and uncaught runtime errors in an overlay.","anyOf":[{"type":"boolean"},{"type":"object"}]},"progress":{"description":"Show an indicator while a rebuild is in progress.","anyOf":[{"type":"boolean"},{"enum":["circular","linear"]}]},"apply":{"description":"What a build does to the page: `hmr` applies the update and reloads if it cannot be applied, `hmr-only` applies it and stops with a message if it cannot, `reload` loads the page again on a build that changed something, and `nothing` leaves the page alone until you reload it.","enum":["hmr","hmr-only","reload","nothing"]},"connect":{"description":"Whether to connect when the entry runs, and how the connection is held open. `false` does not connect; an object sets `retries` and `timeout`.","anyOf":[{"type":"boolean"},{"type":"object","additionalProperties":false,"properties":{"retries":{"description":"How many times to reconnect before giving up. Server-Sent Events keep trying for as long as the page is open unless this is set, since a dev server is expected to come back.","type":"number","minimum":0},"timeout":{"description":"How long silence is tolerated before reconnecting, in milliseconds. Server-Sent Events only: their heartbeat arrives as data the client can see, whereas a WebSocket's is a protocol ping the browser answers without telling JavaScript.","type":"number","minimum":1}}}]},"pageParamPrefix":{"description":"Prefix of the page-url parameters that override `apply` for a single page, as in `?webpack-dev-middleware-hot=false`.","type":"string","minLength":1},"logging":{"description":"Logger level in the browser, or an object carrying the level and the name every message is labelled with in the console — a package embedding this runtime is the one a developer would report a problem to, so it can say its own name.","anyOf":[{"enum":["none","error","warn","info","log","verbose"]},{"type":"object","additionalProperties":false,"properties":{"level":{"enum":["none","error","warn","info","log","verbose"]},"name":{"description":"What every message is labelled with in the console. Defaults to this package's name.","type":"string","minLength":1}}}]},"dynamicPublicPath":{"description":"Prefix the endpoint path with the bundle's public path at runtime.","type":"boolean"}}};const func2 = Object.prototype.hasOwnProperty;const pattern0 = new RegExp("^/[^?#]*$", "u");function validate10(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(errors === 0){if(data && typeof data == "object" && !Array.isArray(data)){const _errs1 = errors;for(const key0 in data){if(!(func2.call(schema11.properties, key0))){validate10.errors = [{instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"}];return false;break;}}if(_errs1 === errors){if(data.cache !== undefined){let data0 = data.cache;const _errs2 = errors;if(errors === _errs2){if(data0 && typeof data0 == "object" && !Array.isArray(data0)){const _errs5 = errors;for(const key1 in data0){if(!((((key1 === "etag") || (key1 === "lastModified")) || (key1 === "control")) || (key1 === "immutable"))){validate10.errors = [{instancePath:instancePath+"/cache",schemaPath:"#/properties/cache/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"}];return false;break;}}if(_errs5 === errors){if(data0.etag !== undefined){let data1 = data0.etag;const _errs6 = errors;if(!((data1 === "weak") || (data1 === "strong"))){validate10.errors = [{instancePath:instancePath+"/cache/etag",schemaPath:"#/properties/cache/properties/etag/enum",keyword:"enum",params:{allowedValues: schema11.properties.cache.properties.etag.enum},message:"must be equal to one of the allowed values"}];return false;}var valid1 = _errs6 === errors;}else {var valid1 = true;}if(valid1){if(data0.lastModified !== undefined){const _errs7 = errors;if(typeof data0.lastModified !== "boolean"){validate10.errors = [{instancePath:instancePath+"/cache/lastModified",schemaPath:"#/properties/cache/properties/lastModified/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];return false;}var valid1 = _errs7 === errors;}else {var valid1 = true;}if(valid1){if(data0.control !== undefined){let data3 = data0.control;const _errs9 = errors;const _errs10 = errors;let valid2 = false;const _errs11 = errors;if(typeof data3 !== "boolean"){const err0 = {instancePath:instancePath+"/cache/control",schemaPath:"#/properties/cache/properties/control/anyOf/0/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}var _valid0 = _errs11 === errors;valid2 = valid2 || _valid0;if(!valid2){const _errs13 = errors;if(!(typeof data3 == "number")){const err1 = {instancePath:instancePath+"/cache/control",schemaPath:"#/properties/cache/properties/control/anyOf/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}var _valid0 = _errs13 === errors;valid2 = valid2 || _valid0;if(!valid2){const _errs15 = errors;if(errors === _errs15){if(typeof data3 === "string"){if(data3.length < 1){const err2 = {instancePath:instancePath+"/cache/control",schemaPath:"#/properties/cache/properties/control/anyOf/2/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}else {const err3 = {instancePath:instancePath+"/cache/control",schemaPath:"#/properties/cache/properties/control/anyOf/2/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}var _valid0 = _errs15 === errors;valid2 = valid2 || _valid0;if(!valid2){const _errs17 = errors;if(errors === _errs17){if(data3 && typeof data3 == "object" && !Array.isArray(data3)){const _errs19 = errors;for(const key2 in data3){if(!((key2 === "maxAge") || (key2 === "immutable"))){const err4 = {instancePath:instancePath+"/cache/control",schemaPath:"#/properties/cache/properties/control/anyOf/3/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key2},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;break;}}if(_errs19 === errors){if(data3.maxAge !== undefined){const _errs20 = errors;if(!(typeof data3.maxAge == "number")){const err5 = {instancePath:instancePath+"/cache/control/maxAge",schemaPath:"#/properties/cache/properties/control/anyOf/3/properties/maxAge/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}var valid3 = _errs20 === errors;}else {var valid3 = true;}if(valid3){if(data3.immutable !== undefined){const _errs22 = errors;if(typeof data3.immutable !== "boolean"){const err6 = {instancePath:instancePath+"/cache/control/immutable",schemaPath:"#/properties/cache/properties/control/anyOf/3/properties/immutable/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}var valid3 = _errs22 === errors;}else {var valid3 = true;}}}}else {const err7 = {instancePath:instancePath+"/cache/control",schemaPath:"#/properties/cache/properties/control/anyOf/3/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}var _valid0 = _errs17 === errors;valid2 = valid2 || _valid0;}}}if(!valid2){const err8 = {instancePath:instancePath+"/cache/control",schemaPath:"#/properties/cache/properties/control/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;validate10.errors = vErrors;return false;}else {errors = _errs10;if(vErrors !== null){if(_errs10){vErrors.length = _errs10;}else {vErrors = null;}}}var valid1 = _errs9 === errors;}else {var valid1 = true;}if(valid1){if(data0.immutable !== undefined){const _errs24 = errors;if(typeof data0.immutable !== "boolean"){validate10.errors = [{instancePath:instancePath+"/cache/immutable",schemaPath:"#/properties/cache/properties/immutable/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];return false;}var valid1 = _errs24 === errors;}else {var valid1 = true;}}}}}}else {validate10.errors = [{instancePath:instancePath+"/cache",schemaPath:"#/properties/cache/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid0 = _errs2 === errors;}else {var valid0 = true;}if(valid0){if(data.mime !== undefined){let data7 = data.mime;const _errs26 = errors;if(errors === _errs26){if(data7 && typeof data7 == "object" && !Array.isArray(data7)){const _errs29 = errors;for(const key3 in data7){if(!((key3 === "types") || (key3 === "default"))){validate10.errors = [{instancePath:instancePath+"/mime",schemaPath:"#/properties/mime/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key3},message:"must NOT have additional properties"}];return false;break;}}if(_errs29 === errors){if(data7.types !== undefined){let data8 = data7.types;const _errs30 = errors;if(!(data8 && typeof data8 == "object" && !Array.isArray(data8))){validate10.errors = [{instancePath:instancePath+"/mime/types",schemaPath:"#/properties/mime/properties/types/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}var valid4 = _errs30 === errors;}else {var valid4 = true;}if(valid4){if(data7.default !== undefined){const _errs32 = errors;if(typeof data7.default !== "string"){validate10.errors = [{instancePath:instancePath+"/mime/default",schemaPath:"#/properties/mime/properties/default/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid4 = _errs32 === errors;}else {var valid4 = true;}}}}else {validate10.errors = [{instancePath:instancePath+"/mime",schemaPath:"#/properties/mime/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid0 = _errs26 === errors;}else {var valid0 = true;}if(valid0){if(data.mimeTypes !== undefined){let data10 = data.mimeTypes;const _errs34 = errors;if(!(data10 && typeof data10 == "object" && !Array.isArray(data10))){validate10.errors = [{instancePath:instancePath+"/mimeTypes",schemaPath:"#/properties/mimeTypes/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}var valid0 = _errs34 === errors;}else {var valid0 = true;}if(valid0){if(data.mimeTypeDefault !== undefined){const _errs37 = errors;if(typeof data.mimeTypeDefault !== "string"){validate10.errors = [{instancePath:instancePath+"/mimeTypeDefault",schemaPath:"#/properties/mimeTypeDefault/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid0 = _errs37 === errors;}else {var valid0 = true;}if(valid0){if(data.writeToDisk !== undefined){let data12 = data.writeToDisk;const _errs40 = errors;const _errs41 = errors;let valid5 = false;const _errs42 = errors;if(typeof data12 !== "boolean"){const err9 = {instancePath:instancePath+"/writeToDisk",schemaPath:"#/properties/writeToDisk/anyOf/0/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}var _valid1 = _errs42 === errors;valid5 = valid5 || _valid1;if(!valid5){const _errs44 = errors;if(!(data12 instanceof Function)){const err10 = {instancePath:instancePath+"/writeToDisk",schemaPath:"#/properties/writeToDisk/anyOf/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}var _valid1 = _errs44 === errors;valid5 = valid5 || _valid1;}if(!valid5){const err11 = {instancePath:instancePath+"/writeToDisk",schemaPath:"#/properties/writeToDisk/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;validate10.errors = vErrors;return false;}else {errors = _errs41;if(vErrors !== null){if(_errs41){vErrors.length = _errs41;}else {vErrors = null;}}}var valid0 = _errs40 === errors;}else {var valid0 = true;}if(valid0){if(data.methods !== undefined){let data13 = data.methods;const _errs46 = errors;if(errors === _errs46){if(Array.isArray(data13)){var valid6 = true;const len0 = data13.length;for(let i0=0; i0=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err49];}else {vErrors.push(err49);}errors++;}}else {const err50 = {instancePath:instancePath+"/hot/heartbeat",schemaPath:"#/properties/hot/anyOf/1/properties/heartbeat/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err50];}else {vErrors.push(err50);}errors++;}}var valid16 = _errs137 === errors;}else {var valid16 = true;}if(valid16){if(data32.ws !== undefined){let data36 = data32.ws;const _errs139 = errors;if(errors === _errs139){if(data36 && typeof data36 == "object" && !Array.isArray(data36)){}else {const err51 = {instancePath:instancePath+"/hot/ws",schemaPath:"#/properties/hot/anyOf/1/properties/ws/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err51];}else {vErrors.push(err51);}errors++;}}var valid16 = _errs139 === errors;}else {var valid16 = true;}if(valid16){if(data32.progress !== undefined){const _errs143 = errors;if(typeof data32.progress !== "boolean"){const err52 = {instancePath:instancePath+"/hot/progress",schemaPath:"#/properties/hot/anyOf/1/properties/progress/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err52];}else {vErrors.push(err52);}errors++;}var valid16 = _errs143 === errors;}else {var valid16 = true;}if(valid16){if(data32.token !== undefined){let data38 = data32.token;const _errs145 = errors;const _errs146 = errors;let valid18 = false;const _errs147 = errors;if(typeof data38 !== "boolean"){const err53 = {instancePath:instancePath+"/hot/token",schemaPath:"#/properties/hot/anyOf/1/properties/token/anyOf/0/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err53];}else {vErrors.push(err53);}errors++;}var _valid9 = _errs147 === errors;valid18 = valid18 || _valid9;if(!valid18){const _errs149 = errors;if(errors === _errs149){if(typeof data38 === "string"){if(data38.length < 1){const err54 = {instancePath:instancePath+"/hot/token",schemaPath:"#/properties/hot/anyOf/1/properties/token/anyOf/1/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err54];}else {vErrors.push(err54);}errors++;}}else {const err55 = {instancePath:instancePath+"/hot/token",schemaPath:"#/properties/hot/anyOf/1/properties/token/anyOf/1/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err55];}else {vErrors.push(err55);}errors++;}}var _valid9 = _errs149 === errors;valid18 = valid18 || _valid9;}if(!valid18){const err56 = {instancePath:instancePath+"/hot/token",schemaPath:"#/properties/hot/anyOf/1/properties/token/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err56];}else {vErrors.push(err56);}errors++;}else {errors = _errs146;if(vErrors !== null){if(_errs146){vErrors.length = _errs146;}else {vErrors = null;}}}var valid16 = _errs145 === errors;}else {var valid16 = true;}if(valid16){if(data32.cors !== undefined){let data39 = data32.cors;const _errs152 = errors;const _errs153 = errors;let valid19 = false;const _errs154 = errors;if(typeof data39 !== "boolean"){const err57 = {instancePath:instancePath+"/hot/cors",schemaPath:"#/properties/hot/anyOf/1/properties/cors/anyOf/0/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err57];}else {vErrors.push(err57);}errors++;}var _valid10 = _errs154 === errors;valid19 = valid19 || _valid10;if(!valid19){const _errs156 = errors;const _errs158 = errors;let valid21 = false;const _errs159 = errors;if(errors === _errs159){if(typeof data39 === "string"){if(data39.length < 1){const err58 = {instancePath:instancePath+"/hot/cors",schemaPath:"#/definitions/CorsOrigin/anyOf/0/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err58];}else {vErrors.push(err58);}errors++;}}else {const err59 = {instancePath:instancePath+"/hot/cors",schemaPath:"#/definitions/CorsOrigin/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err59];}else {vErrors.push(err59);}errors++;}}var _valid11 = _errs159 === errors;valid21 = valid21 || _valid11;if(!valid21){const _errs161 = errors;if(!(data39 instanceof RegExp)){const err60 = {instancePath:instancePath+"/hot/cors",schemaPath:"#/definitions/CorsOrigin/anyOf/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err60];}else {vErrors.push(err60);}errors++;}var _valid11 = _errs161 === errors;valid21 = valid21 || _valid11;if(!valid21){const _errs162 = errors;if(errors === _errs162){if(Array.isArray(data39)){if(data39.length < 1){const err61 = {instancePath:instancePath+"/hot/cors",schemaPath:"#/definitions/CorsOrigin/anyOf/2/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err61];}else {vErrors.push(err61);}errors++;}else {var valid22 = true;const len2 = data39.length;for(let i2=0; i2=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err121];}else {vErrors.push(err121);}errors++;}}else {const err122 = {instancePath:instancePath+"/hot/client/connect/retries",schemaPath:"#/definitions/HotClient/properties/connect/anyOf/1/properties/retries/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err122];}else {vErrors.push(err122);}errors++;}}var valid41 = _errs257 === errors;}else {var valid41 = true;}if(valid41){if(data58.timeout !== undefined){let data60 = data58.timeout;const _errs259 = errors;if(errors === _errs259){if(typeof data60 == "number"){if(data60 < 1 || isNaN(data60)){const err123 = {instancePath:instancePath+"/hot/client/connect/timeout",schemaPath:"#/definitions/HotClient/properties/connect/anyOf/1/properties/timeout/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err123];}else {vErrors.push(err123);}errors++;}}else {const err124 = {instancePath:instancePath+"/hot/client/connect/timeout",schemaPath:"#/definitions/HotClient/properties/connect/anyOf/1/properties/timeout/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err124];}else {vErrors.push(err124);}errors++;}}var valid41 = _errs259 === errors;}else {var valid41 = true;}}}}else {const err125 = {instancePath:instancePath+"/hot/client/connect",schemaPath:"#/definitions/HotClient/properties/connect/anyOf/1/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err125];}else {vErrors.push(err125);}errors++;}}var _valid23 = _errs254 === errors;valid40 = valid40 || _valid23;}if(!valid40){const err126 = {instancePath:instancePath+"/hot/client/connect",schemaPath:"#/definitions/HotClient/properties/connect/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err126];}else {vErrors.push(err126);}errors++;}else {errors = _errs251;if(vErrors !== null){if(_errs251){vErrors.length = _errs251;}else {vErrors = null;}}}var valid32 = _errs250 === errors;}else {var valid32 = true;}if(valid32){if(data45.pageParamPrefix !== undefined){let data61 = data45.pageParamPrefix;const _errs261 = errors;if(errors === _errs261){if(typeof data61 === "string"){if(data61.length < 1){const err127 = {instancePath:instancePath+"/hot/client/pageParamPrefix",schemaPath:"#/definitions/HotClient/properties/pageParamPrefix/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err127];}else {vErrors.push(err127);}errors++;}}else {const err128 = {instancePath:instancePath+"/hot/client/pageParamPrefix",schemaPath:"#/definitions/HotClient/properties/pageParamPrefix/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err128];}else {vErrors.push(err128);}errors++;}}var valid32 = _errs261 === errors;}else {var valid32 = true;}if(valid32){if(data45.logging !== undefined){let data62 = data45.logging;const _errs263 = errors;const _errs264 = errors;let valid42 = false;const _errs265 = errors;if(!((((((data62 === "none") || (data62 === "error")) || (data62 === "warn")) || (data62 === "info")) || (data62 === "log")) || (data62 === "verbose"))){const err129 = {instancePath:instancePath+"/hot/client/logging",schemaPath:"#/definitions/HotClient/properties/logging/anyOf/0/enum",keyword:"enum",params:{allowedValues: schema14.properties.logging.anyOf[0].enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err129];}else {vErrors.push(err129);}errors++;}var _valid24 = _errs265 === errors;valid42 = valid42 || _valid24;if(!valid42){const _errs266 = errors;if(errors === _errs266){if(data62 && typeof data62 == "object" && !Array.isArray(data62)){const _errs268 = errors;for(const key11 in data62){if(!((key11 === "level") || (key11 === "name"))){const err130 = {instancePath:instancePath+"/hot/client/logging",schemaPath:"#/definitions/HotClient/properties/logging/anyOf/1/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key11},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err130];}else {vErrors.push(err130);}errors++;break;}}if(_errs268 === errors){if(data62.level !== undefined){let data63 = data62.level;const _errs269 = errors;if(!((((((data63 === "none") || (data63 === "error")) || (data63 === "warn")) || (data63 === "info")) || (data63 === "log")) || (data63 === "verbose"))){const err131 = {instancePath:instancePath+"/hot/client/logging/level",schemaPath:"#/definitions/HotClient/properties/logging/anyOf/1/properties/level/enum",keyword:"enum",params:{allowedValues: schema14.properties.logging.anyOf[1].properties.level.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err131];}else {vErrors.push(err131);}errors++;}var valid43 = _errs269 === errors;}else {var valid43 = true;}if(valid43){if(data62.name !== undefined){let data64 = data62.name;const _errs270 = errors;if(errors === _errs270){if(typeof data64 === "string"){if(data64.length < 1){const err132 = {instancePath:instancePath+"/hot/client/logging/name",schemaPath:"#/definitions/HotClient/properties/logging/anyOf/1/properties/name/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err132];}else {vErrors.push(err132);}errors++;}}else {const err133 = {instancePath:instancePath+"/hot/client/logging/name",schemaPath:"#/definitions/HotClient/properties/logging/anyOf/1/properties/name/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err133];}else {vErrors.push(err133);}errors++;}}var valid43 = _errs270 === errors;}else {var valid43 = true;}}}}else {const err134 = {instancePath:instancePath+"/hot/client/logging",schemaPath:"#/definitions/HotClient/properties/logging/anyOf/1/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err134];}else {vErrors.push(err134);}errors++;}}var _valid24 = _errs266 === errors;valid42 = valid42 || _valid24;}if(!valid42){const err135 = {instancePath:instancePath+"/hot/client/logging",schemaPath:"#/definitions/HotClient/properties/logging/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err135];}else {vErrors.push(err135);}errors++;}else {errors = _errs264;if(vErrors !== null){if(_errs264){vErrors.length = _errs264;}else {vErrors = null;}}}var valid32 = _errs263 === errors;}else {var valid32 = true;}if(valid32){if(data45.dynamicPublicPath !== undefined){const _errs272 = errors;if(typeof data45.dynamicPublicPath !== "boolean"){const err136 = {instancePath:instancePath+"/hot/client/dynamicPublicPath",schemaPath:"#/definitions/HotClient/properties/dynamicPublicPath/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err136];}else {vErrors.push(err136);}errors++;}var valid32 = _errs272 === errors;}else {var valid32 = true;}}}}}}}}}}}}else {const err137 = {instancePath:instancePath+"/hot/client",schemaPath:"#/definitions/HotClient/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err137];}else {vErrors.push(err137);}errors++;}}var _valid16 = _errs201 === errors;valid30 = valid30 || _valid16;}if(!valid30){const err138 = {instancePath:instancePath+"/hot/client",schemaPath:"#/properties/hot/anyOf/1/properties/client/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err138];}else {vErrors.push(err138);}errors++;}else {errors = _errs199;if(vErrors !== null){if(_errs199){vErrors.length = _errs199;}else {vErrors = null;}}}var valid16 = _errs198 === errors;}else {var valid16 = true;}}}}}}}}}}}}else {const err139 = {instancePath:instancePath+"/hot",schemaPath:"#/properties/hot/anyOf/1/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err139];}else {vErrors.push(err139);}errors++;}}var _valid7 = _errs128 === errors;valid15 = valid15 || _valid7;}if(!valid15){const err140 = {instancePath:instancePath+"/hot",schemaPath:"#/properties/hot/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err140];}else {vErrors.push(err140);}errors++;validate10.errors = vErrors;return false;}else {errors = _errs125;if(vErrors !== null){if(_errs125){vErrors.length = _errs125;}else {vErrors = null;}}}var valid0 = _errs124 === errors;}else {var valid0 = true;}}}}}}}}}}}}}}}}}}}}}else {validate10.errors = [{instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}validate10.errors = vErrors;return errors === 0;} \ No newline at end of file diff --git a/src/options.json b/src/options.json index 889673290..d16ef779f 100644 --- a/src/options.json +++ b/src/options.json @@ -17,8 +17,8 @@ } ] }, - "path": { - "description": "Where the runtime connects. Defaults to the resolved `hot.path`; a string may be an absolute url for an endpoint reached on another origin or through a proxy, and an object says only the parts that differ and leaves the rest to be resolved in the page, which is the only place the rest is known.", + "url": { + "description": "Where the runtime connects: a path, an absolute url for an endpoint reached on another origin or through a proxy, or the parts of one that differ, with the rest resolved in the page, which is the only place the rest is known. Defaults to the resolved `hot.path`.", "anyOf": [ { "type": "string", @@ -77,10 +77,6 @@ "description": "Limit the runtime to one compilation's builds. Defaults to the compilation's own name.", "type": "string" }, - "token": { - "description": "The secret the runtime puts on its connection url. The middleware sets this to whatever 'hot.token' resolved to, so it only needs setting for a client pointed at another endpoint that requires a different one.", - "type": "string" - }, "overlay": { "description": "Show build problems and uncaught runtime errors in an overlay.", "anyOf": [ @@ -131,8 +127,8 @@ } ] }, - "urlPrefix": { - "description": "Prefix of the page-url parameter that overrides `apply` for a single page.", + "pageParamPrefix": { + "description": "Prefix of the page-url parameters that override `apply` for a single page, as in `?webpack-dev-middleware-hot=false`.", "type": "string", "minLength": 1 }, @@ -161,32 +157,6 @@ "dynamicPublicPath": { "description": "Prefix the endpoint path with the bundle's public path at runtime.", "type": "boolean" - }, - "hot": { - "description": "Apply a build through Hot Module Replacement. Deprecated, and removed in the next major release: use `apply`.", - "type": "boolean" - }, - "liveReload": { - "description": "Reload the page on a build that changed something, when `hot` is off. Deprecated, and removed in the next major release: use `apply`.", - "type": "boolean" - }, - "reload": { - "description": "Reload the page when an update cannot be applied. Deprecated, and removed in the next major release: use `apply`.", - "type": "boolean" - }, - "autoConnect": { - "description": "Connect as soon as the entry runs. Deprecated, and removed in the next major release: use `connect`.", - "type": "boolean" - }, - "reconnect": { - "description": "How many times to reconnect before giving up. Unset, Server-Sent Events keep trying for as long as the page is open — a dev server is expected to come back — while a WebSocket gives up after 10. Setting it applies to both. Deprecated, and removed in the next major release: use `connect`.", - "type": "number", - "minimum": 0 - }, - "timeout": { - "description": "How long the runtime tolerates silence before reconnecting, in milliseconds. Server-Sent Events only: their heartbeat arrives as data the client can see, whereas a WebSocket's is a protocol ping the browser answers without telling JavaScript — a half-open socket there is terminated by the server instead. Deprecated, and removed in the next major release: use `connect`.", - "type": "number", - "exclusiveMinimum": 0 } } }, @@ -475,7 +445,7 @@ "additionalProperties": false, "properties": { "transport": { - "description": "How events reach the clients: `sse`, `ws` (needs the optional `ws` dependency and an HTTP server to answer upgrades on, given as `server` or through the middleware's `attach` method), or a function building a transport of your own.", + "description": "How events reach the clients: `sse`, `ws` (needs the optional `ws` dependency and an HTTP server to answer upgrades on, handed over through the middleware's `attach` or `handleUpgrade` method), or a function building a transport of your own.", "anyOf": [ { "enum": ["sse", "ws"] @@ -495,11 +465,6 @@ "type": "number", "minimum": 1 }, - "server": { - "description": "HTTP server the `ws` transport answers upgrades on, when it is already built. Otherwise hand it over later with the middleware's `attach` method.", - "type": "object", - "additionalProperties": true - }, "ws": { "description": "Options for the `ws` server behind the `ws` transport: compression, payload limits, `verifyClient`, or a `port` or a `server` of its own to listen on instead of answering the upgrades it is handed. `path`, `noServer` and `clientTracking` are the middleware's and are ignored here.", "link": "https://github.com/webpack/webpack-dev-middleware#hot", diff --git a/src/utils.js b/src/utils.js index 298d32696..2fd168038 100644 --- a/src/utils.js +++ b/src/utils.js @@ -1457,17 +1457,6 @@ function filterSource(option, filter) { ); } -// The six browser options `apply` and `connect` replaced. Accepted and folded -// in by the client until the next major release. -const LEGACY_CLIENT_OPTIONS = [ - "hot", - "liveReload", - "reload", - "autoConnect", - "reconnect", - "timeout", -]; - /** * The browser options, as the client reads them from its resource query. * @param {EXPECTED_ANY} client the `hot.client` option @@ -1483,12 +1472,12 @@ function clientQuery(client, resolvedPath) { } for (let [key, value] of Object.entries(client)) { - // A path given in parts replaces the resolved path in the query outright, + // A url given in parts replaces the resolved path in the query outright, // so the part it leaves out has to be carried over rather than left to the // client's own default — which is the same path only until someone sets // `hot.path`, and then quietly is not. if ( - key === "path" && + key === "url" && resolvedPath && typeof value === "object" && value !== null && @@ -1602,17 +1591,6 @@ function injectHotClient(compilers, options, logger) { /** @type {HotClientOptions | undefined} */ const clientOptions = options.client || undefined; - // TODO in the next major release remove this warning and `LEGACY_CLIENT_OPTIONS` - const deprecated = LEGACY_CLIENT_OPTIONS.filter((name) => - Object.hasOwn(clientOptions || {}, name), - ); - - if (deprecated.length > 0) { - logger.warn( - `${deprecated.map((name) => `'hot.client.${name}'`).join(", ")} ${deprecated.length === 1 ? "is" : "are"} deprecated and will be removed in the next major release. 'hot.client.apply' replaces 'hot', 'liveReload' and 'reload'; 'hot.client.connect' replaces 'autoConnect', 'reconnect' and 'timeout'. Until then these still apply, and the option that replaced them wins when both are set.`, - ); - } - let warned = false; // A token only reaches the browser on the entry added below, so a required // one with nothing added would refuse every client. @@ -1660,10 +1638,10 @@ function injectHotClient(compilers, options, logger) { !customClientTransport && client.transport && client.transport !== options.transport && - !client.path + !client.url ) { logger.warn( - `'hot.client.transport' is '${client.transport}' while the endpoint serves '${options.transport}', so the client will not connect. Set them to the same thing, or give 'hot.client.path' the endpoint that does speak '${client.transport}'.`, + `'hot.client.transport' is '${client.transport}' while the endpoint serves '${options.transport}', so the client will not connect. Set them to the same thing, or give 'hot.client.url' the endpoint that does speak '${client.transport}'.`, ); } @@ -1703,7 +1681,7 @@ function injectHotClient(compilers, options, logger) { // carries the same options and is spread over them. const { name: compilation } = compiler.options; /** @type {Record} */ - const query = { path: options.path, transport }; + const query = { url: options.path, transport }; if (options.token) { query.token = options.token; diff --git a/test/__snapshots__/validation-options.test.js.snap.webpack5 b/test/__snapshots__/validation-options.test.js.snap.webpack5 index 8c1dc3b3f..4469135e5 100644 --- a/test/__snapshots__/validation-options.test.js.snap.webpack5 +++ b/test/__snapshots__/validation-options.test.js.snap.webpack5 @@ -128,13 +128,13 @@ exports[`validation should throw an error on the "hot" option with "{"statsOptio exports[`validation should throw an error on the "hot" option with "{"transport":"websocket"}" value 1`] = ` "Invalid options object. Dev Middleware has been initialized using an options object that does not match the API schema. - options.hot should be one of these: - boolean | object { transport?, path?, heartbeat?, server?, ws?, progress?, token?, cors?, statsOptions?, inject?, client? } + boolean | object { transport?, path?, heartbeat?, ws?, progress?, token?, cors?, statsOptions?, inject?, client? } -> Enable hot module replacement over a Server-Sent Events or WebSocket endpoint. -> Read more at https://github.com/webpack/webpack-dev-middleware#hot Details: * options.hot.transport should be one of these: "sse" | "ws" | function - -> How events reach the clients: \`sse\`, \`ws\` (needs the optional \`ws\` dependency and an HTTP server to answer upgrades on, given as \`server\` or through the middleware's \`attach\` method), or a function building a transport of your own. + -> How events reach the clients: \`sse\`, \`ws\` (needs the optional \`ws\` dependency and an HTTP server to answer upgrades on, handed over through the middleware's \`attach\` or \`handleUpgrade\` method), or a function building a transport of your own. Details: * options.hot.transport should be one of these: "sse" | "ws" @@ -144,13 +144,13 @@ exports[`validation should throw an error on the "hot" option with "{"transport" exports[`validation should throw an error on the "hot" option with "{"transport":true}" value 1`] = ` "Invalid options object. Dev Middleware has been initialized using an options object that does not match the API schema. - options.hot should be one of these: - boolean | object { transport?, path?, heartbeat?, server?, ws?, progress?, token?, cors?, statsOptions?, inject?, client? } + boolean | object { transport?, path?, heartbeat?, ws?, progress?, token?, cors?, statsOptions?, inject?, client? } -> Enable hot module replacement over a Server-Sent Events or WebSocket endpoint. -> Read more at https://github.com/webpack/webpack-dev-middleware#hot Details: * options.hot.transport should be one of these: "sse" | "ws" | function - -> How events reach the clients: \`sse\`, \`ws\` (needs the optional \`ws\` dependency and an HTTP server to answer upgrades on, given as \`server\` or through the middleware's \`attach\` method), or a function building a transport of your own. + -> How events reach the clients: \`sse\`, \`ws\` (needs the optional \`ws\` dependency and an HTTP server to answer upgrades on, handed over through the middleware's \`attach\` or \`handleUpgrade\` method), or a function building a transport of your own. Details: * options.hot.transport should be one of these: "sse" | "ws" @@ -160,31 +160,31 @@ exports[`validation should throw an error on the "hot" option with "{"transport" exports[`validation should throw an error on the "hot" option with "{"unknown":true}" value 1`] = ` "Invalid options object. Dev Middleware has been initialized using an options object that does not match the API schema. - options.hot has an unknown property 'unknown'. These properties are valid: - object { transport?, path?, heartbeat?, server?, ws?, progress?, token?, cors?, statsOptions?, inject?, client? }" + object { transport?, path?, heartbeat?, ws?, progress?, token?, cors?, statsOptions?, inject?, client? }" `; exports[`validation should throw an error on the "hot" option with "0" value 1`] = ` "Invalid options object. Dev Middleware has been initialized using an options object that does not match the API schema. - options.hot should be one of these: - boolean | object { transport?, path?, heartbeat?, server?, ws?, progress?, token?, cors?, statsOptions?, inject?, client? } + boolean | object { transport?, path?, heartbeat?, ws?, progress?, token?, cors?, statsOptions?, inject?, client? } -> Enable hot module replacement over a Server-Sent Events or WebSocket endpoint. -> Read more at https://github.com/webpack/webpack-dev-middleware#hot Details: * options.hot should be a boolean. * options.hot should be an object: - object { transport?, path?, heartbeat?, server?, ws?, progress?, token?, cors?, statsOptions?, inject?, client? }" + object { transport?, path?, heartbeat?, ws?, progress?, token?, cors?, statsOptions?, inject?, client? }" `; exports[`validation should throw an error on the "hot" option with "foo" value 1`] = ` "Invalid options object. Dev Middleware has been initialized using an options object that does not match the API schema. - options.hot should be one of these: - boolean | object { transport?, path?, heartbeat?, server?, ws?, progress?, token?, cors?, statsOptions?, inject?, client? } + boolean | object { transport?, path?, heartbeat?, ws?, progress?, token?, cors?, statsOptions?, inject?, client? } -> Enable hot module replacement over a Server-Sent Events or WebSocket endpoint. -> Read more at https://github.com/webpack/webpack-dev-middleware#hot Details: * options.hot should be a boolean. * options.hot should be an object: - object { transport?, path?, heartbeat?, server?, ws?, progress?, token?, cors?, statsOptions?, inject?, client? }" + object { transport?, path?, heartbeat?, ws?, progress?, token?, cors?, statsOptions?, inject?, client? }" `; exports[`validation should throw an error on the "index" option with "{}" value 1`] = ` diff --git a/test/e2e/client.test.js b/test/e2e/client.test.js index f1d00f68a..08258bf7b 100644 --- a/test/e2e/client.test.js +++ b/test/e2e/client.test.js @@ -663,7 +663,7 @@ describe("hot client (browser)", () => { publicPath: "/assets/", hot: { path: "/assets/__webpack_hmr", - client: { path: { hostname: "0.0.0.0" }, dynamicPublicPath: true }, + client: { url: { hostname: "0.0.0.0" }, dynamicPublicPath: true }, }, bare: true, code: acceptedApp("v1"), diff --git a/test/e2e/inject.test.js b/test/e2e/inject.test.js index bff22c48b..6cc80e8c3 100644 --- a/test/e2e/inject.test.js +++ b/test/e2e/inject.test.js @@ -200,7 +200,7 @@ describe("hot with nothing but the middleware (browser)", () => { code: acceptedApp("v1"), // What a server built on this middleware sets so the parameters its own // users know keep working. - hot: { client: { urlPrefix: "my-server" } }, + hot: { client: { pageParamPrefix: "my-server" } }, }); ({ page, browser } = await runBrowser()); diff --git a/test/e2e/live-reload.test.js b/test/e2e/live-reload.test.js index d27ba7ea6..9946a0ec5 100644 --- a/test/e2e/live-reload.test.js +++ b/test/e2e/live-reload.test.js @@ -317,7 +317,7 @@ describe("live reload (browser)", () => { it("matches a prefix with capitals in it", async () => { app = await createHotApp({ - query: "?apply=reload&urlPrefix=MyServer", + query: "?apply=reload&pageParamPrefix=MyServer", hmrPlugin: false, code: acceptedApp("v1"), }); @@ -352,7 +352,7 @@ describe("live reload (browser)", () => { it("names those url parameters after whoever is serving", async () => { app = await createHotApp({ - query: "?apply=reload&urlPrefix=my-server", + query: "?apply=reload&pageParamPrefix=my-server", hmrPlugin: false, code: acceptedApp("v1"), }); diff --git a/test/e2e/transport.test.js b/test/e2e/transport.test.js index 7503078f4..07fb81fc6 100644 --- a/test/e2e/transport.test.js +++ b/test/e2e/transport.test.js @@ -147,7 +147,7 @@ for (const transport of ["sse", "ws"]) { // Padded on purpose: the spec reaches the client as json in a query, // and a check on its first character would miss one with a space in // front of it — the object would then be used as the path itself. - client: { path: { hostname: "0.0.0.0" } }, + client: { url: { hostname: "0.0.0.0" } }, }, code: acceptedApp("v1"), }); diff --git a/test/inject-client.test.js b/test/inject-client.test.js index 8031cf639..432ccbdb2 100644 --- a/test/inject-client.test.js +++ b/test/inject-client.test.js @@ -614,15 +614,15 @@ describe("serializing an overlay filter", () => { // `overlay` as an object whose filters travel as source. describe("the browser options as a query", () => { it("passes a plain option through as text", () => { - expect(clientQuery({ logging: "warn", reconnect: 5 })).toStrictEqual({ + expect(clientQuery({ logging: "warn", name: "admin" })).toStrictEqual({ logging: "warn", - reconnect: "5", + name: "admin", }); }); it("leaves out what was not set", () => { - expect(clientQuery({ logging: undefined, reload: false })).toStrictEqual({ - reload: "false", + expect(clientQuery({ logging: undefined, connect: false })).toStrictEqual({ + connect: "false", }); }); @@ -675,8 +675,8 @@ describe("the browser options as a query", () => { // leaves out has to be carried over. The client's own fallback is the same // path only until someone sets `hot.path`, and then quietly is not. it("carries the resolved path into a spec that names no pathname", () => { - expect(clientQuery({ path: { port: 8080 } }, "/custom-hmr")).toStrictEqual({ - path: '{"port":8080,"pathname":"/custom-hmr"}', + expect(clientQuery({ url: { port: 8080 } }, "/custom-hmr")).toStrictEqual({ + url: '{"port":8080,"pathname":"/custom-hmr"}', }); }); @@ -685,14 +685,14 @@ describe("the browser options as a query", () => { // this server's — the same silent mismatch an absent one would cause. it("carries the resolved path into a spec whose pathname is empty", () => { expect( - clientQuery({ path: { port: 8080, pathname: "" } }, "/custom-hmr"), - ).toStrictEqual({ path: '{"port":8080,"pathname":"/custom-hmr"}' }); + clientQuery({ url: { port: 8080, pathname: "" } }, "/custom-hmr"), + ).toStrictEqual({ url: '{"port":8080,"pathname":"/custom-hmr"}' }); }); it("leaves a pathname the spec named alone", () => { expect( - clientQuery({ path: { port: 8080, pathname: "/mine" } }, "/custom-hmr"), - ).toStrictEqual({ path: '{"port":8080,"pathname":"/mine"}' }); + clientQuery({ url: { port: 8080, pathname: "/mine" } }, "/custom-hmr"), + ).toStrictEqual({ url: '{"port":8080,"pathname":"/mine"}' }); }); // The client decides which shape it was handed by what the json parses to, @@ -700,17 +700,17 @@ describe("the browser options as a query", () => { // bare number or boolean is not mistaken for one. Serialization is what // this file covers; the browser end is in `test/e2e/transport.test.js`. it("serializes a spec as json a parser can find", () => { - const query = clientQuery({ path: { port: 8080 } }, "/hmr"); + const query = clientQuery({ url: { port: 8080 } }, "/hmr"); - expect(JSON.parse(query.path)).toStrictEqual({ + expect(JSON.parse(query.url)).toStrictEqual({ port: 8080, pathname: "/hmr", }); }); it("does not reach into a path given as a string", () => { - expect(clientQuery({ path: "/plain" }, "/custom-hmr")).toStrictEqual({ - path: "/plain", + expect(clientQuery({ url: "/plain" }, "/custom-hmr")).toStrictEqual({ + url: "/plain", }); }); @@ -928,7 +928,7 @@ describe("the entry query the client is given", () => { it("carries the endpoint and the transport the middleware resolved", () => { expect(queries({ path: "/__hmr", transport: "ws" })).toStrictEqual([ - { path: "/__hmr", transport: "ws" }, + { url: "/__hmr", transport: "ws" }, ]); }); @@ -936,7 +936,7 @@ describe("the entry query the client is given", () => { expect( queries({ path: "/__webpack_hmr", transport: "sse" }, { name: "admin" }), ).toStrictEqual([ - { path: "/__webpack_hmr", transport: "sse", name: "admin" }, + { url: "/__webpack_hmr", transport: "sse", name: "admin" }, ]); }); @@ -945,14 +945,10 @@ describe("the entry query the client is given", () => { path: "/__webpack_hmr", transport: "sse", client: { - hot: false, - liveReload: false, - urlPrefix: "my-server", - reload: false, + apply: "reload", + connect: false, + pageParamPrefix: "my-server", logging: "warn", - reconnect: 3, - timeout: 5000, - autoConnect: false, dynamicPublicPath: true, progress: "linear", overlay: false, @@ -960,16 +956,12 @@ describe("the entry query the client is given", () => { }); expect(query).toStrictEqual({ - path: "/__webpack_hmr", + url: "/__webpack_hmr", transport: "sse", - hot: "false", - liveReload: "false", - urlPrefix: "my-server", - reload: "false", + apply: "reload", + connect: "false", + pageParamPrefix: "my-server", logging: "warn", - reconnect: "3", - timeout: "5000", - autoConnect: "false", dynamicPublicPath: "true", progress: "linear", overlay: "false", @@ -985,14 +977,14 @@ describe("the entry query the client is given", () => { { name: "admin" }, ); - expect(query).toMatchObject({ path: "/__webpack_hmr", name: "admin" }); + expect(query).toMatchObject({ url: "/__webpack_hmr", name: "admin" }); const [overridden] = queries( { path: "/__webpack_hmr", transport: "sse", client: { - path: "wss://dev.example.com/__hmr", + url: "wss://dev.example.com/__hmr", transport: "ws", name: "", }, @@ -1001,7 +993,7 @@ describe("the entry query the client is given", () => { ); expect(overridden).toStrictEqual({ - path: "wss://dev.example.com/__hmr", + url: "wss://dev.example.com/__hmr", transport: "ws", name: "", }); @@ -1023,7 +1015,7 @@ describe("the entry query the client is given", () => { transport, client: { transport: "sse" }, }), - ).toStrictEqual([{ path: "/__webpack_hmr", transport: "sse" }]); + ).toStrictEqual([{ url: "/__webpack_hmr", transport: "sse" }]); expect(warnings).toStrictEqual([]); }); @@ -1160,7 +1152,7 @@ describe("a client transport of someone else's", () => { }); expect(queries).toStrictEqual([ - { path: "/__webpack_hmr", transport: "sse" }, + { url: "/__webpack_hmr", transport: "sse" }, ]); }); @@ -1188,7 +1180,7 @@ describe("a client transport of someone else's", () => { client: { transport: CUSTOM }, }); - expect(queries).toStrictEqual([{ path: "/ws", transport: "ws" }]); + expect(queries).toStrictEqual([{ url: "/ws", transport: "ws" }]); expect(provided).toHaveLength(1); expect(warnings).toStrictEqual([]); }); @@ -1288,7 +1280,7 @@ describe("a client transport that disagrees with the endpoint", () => { it("says nothing when the client has an endpoint of its own", () => { expect( - inject({ transport: "ws", path: "wss://dev.example.com/__hmr" }), + inject({ transport: "ws", url: "wss://dev.example.com/__hmr" }), ).toStrictEqual([]); }); @@ -1345,8 +1337,19 @@ describe("node and the query take the same names", () => { expect(legacy).toHaveLength(6); }); + // The names only the query has: `path`, which is what it called `url` first; + // `token`, which the middleware fills in from `hot.token`; and the released + // spellings `apply` and `connect` replaced, which an entry written by hand + // may still carry. + const queryOnly = ["path", "token", ...legacy]; + it("is one set of names, with nothing on one side only", () => { - expect(readByClient.toSorted()).toStrictEqual(takenInNode.toSorted()); + expect( + readByClient.filter((name) => !queryOnly.includes(name)).toSorted(), + ).toStrictEqual(takenInNode.toSorted()); + expect( + takenInNode.filter((name) => queryOnly.includes(name)), + ).toStrictEqual([]); }); // The third place, and the one that is easiest to forget: the typedef the diff --git a/types/client/index.d.ts b/types/client/index.d.ts index c01004316..dff0ce7cb 100644 --- a/types/client/index.d.ts +++ b/types/client/index.d.ts @@ -122,7 +122,7 @@ export type ClientOptions = { /** * prefix of the page-url parameters that override `apply` for one page */ - urlPrefix: string; + pageParamPrefix: string; /** * logger level */ diff --git a/types/hot.d.ts b/types/hot.d.ts index 7316d4577..7a2b30685 100644 --- a/types/hot.d.ts +++ b/types/hot.d.ts @@ -205,7 +205,7 @@ type PathSpec = { * here and the injected entry carries it, or write it on the query of a client * entry of your own. * - * `transport`, `path` and `name` are the exception only in having a default + * `transport`, `url` and `name` are the exception only in having a default * the middleware knows — the resolved `hot.transport`, the resolved `hot.path` * and the compilation's name. Setting one here replaces that, which is what a * page reaching the endpoint through a proxy or another origin needs. @@ -216,17 +216,13 @@ type HotClientOptions = { */ transport?: ("sse" | "ws" | string) | undefined; /** - * where the runtime connects, `hot.path` by default; may be an absolute url for an endpoint on another origin, or the parts that differ with the rest resolved in the page + * where the runtime connects, `hot.path` by default: a path, an absolute url for an endpoint on another origin, or the parts that differ with the rest resolved in the page */ - path?: (string | PathSpec) | undefined; + url?: (string | PathSpec) | undefined; /** * limit the runtime to one compilation's builds, the compilation's own name by default */ name?: string | undefined; - /** - * the secret the runtime puts on its connection url, `hot.token` by default - */ - token?: string | undefined; /** * show build problems and uncaught runtime errors in an overlay */ @@ -235,18 +231,6 @@ type HotClientOptions = { * show an indicator while a rebuild is in progress */ progress?: (boolean | "circular" | "linear") | undefined; - /** - * deprecated, removed in the next major release — use `apply` - */ - hot?: boolean | undefined; - /** - * deprecated, removed in the next major release — use `apply` - */ - liveReload?: boolean | undefined; - /** - * deprecated, removed in the next major release — use `apply` - */ - reload?: boolean | undefined; /** * what a build does to the page — apply the update and reload if it cannot be applied, apply it and stop with a message if it cannot, load the page again on any build that changed something, or leave the page alone */ @@ -264,9 +248,9 @@ type HotClientOptions = { ) | undefined; /** - * prefix of the page-url parameter that overrides `apply` for a single page + * prefix of the page-url parameters that override `apply` for a single page */ - urlPrefix?: string | undefined; + pageParamPrefix?: string | undefined; /** * how much the runtime logs to the browser console, and the name every message is labelled with */ @@ -279,18 +263,6 @@ type HotClientOptions = { } ) | undefined; - /** - * how many times to reconnect before giving up; unset, Server-Sent Events keep trying for as long as the page is open while a WebSocket gives up after 10 - */ - reconnect?: number | undefined; - /** - * how long the runtime tolerates silence before reconnecting, in milliseconds — Server-Sent Events only, since a WebSocket's heartbeat is a protocol ping JavaScript cannot see - */ - timeout?: number | undefined; - /** - * connect as soon as the entry runs - */ - autoConnect?: boolean | undefined; /** * prefix the path with the bundle's public path at runtime */ @@ -309,10 +281,6 @@ type HotOptions = { * heartbeat interval in milliseconds */ heartbeat?: number | undefined; - /** - * HTTP server the `"ws"` transport answers upgrades on, when it is already built - */ - server?: HttpServer | undefined; /** * options for the `ws` server behind the `"ws"` transport — compression, payload limits, `verifyClient`, or a `port` or a `server` of its own to listen on; `path`, `noServer` and `clientTracking` are the middleware's */