From e4d183ea6dea1731b69e24d5d5471d876ff6ec3a Mon Sep 17 00:00:00 2001 From: Alexander Akait <4567934+alexander-akait@users.noreply.github.com> Date: Thu, 21 Mar 2024 14:49:17 +0300 Subject: [PATCH] fix(types): make types better (#1786) --- package-lock.json | 462 ++++++++++++++----------- src/index.js | 112 +++--- src/middleware.js | 22 +- src/utils/compatibleAPI.js | 5 +- src/utils/getFilenameFromUrl.js | 3 +- src/utils/getPaths.js | 2 +- src/utils/ready.js | 2 +- src/utils/setupHooks.js | 15 +- src/utils/setupOutputFileSystem.js | 3 +- src/utils/setupWriteToDisk.js | 2 +- types/index.d.ts | 54 ++- types/middleware.d.ts | 7 +- types/utils/compatibleAPI.d.ts | 6 +- types/utils/getFilenameFromUrl.d.ts | 6 +- types/utils/getPaths.d.ts | 4 +- types/utils/ready.d.ts | 4 +- types/utils/setupHooks.d.ts | 9 +- types/utils/setupOutputFileSystem.d.ts | 9 +- types/utils/setupWriteToDisk.d.ts | 9 +- 19 files changed, 420 insertions(+), 316 deletions(-) diff --git a/package-lock.json b/package-lock.json index 561fb815f..8674edc99 100644 --- a/package-lock.json +++ b/package-lock.json @@ -330,9 +330,9 @@ } }, "node_modules/@babel/helper-module-imports": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.24.1.tgz", - "integrity": "sha512-HfEWzysMyOa7xI5uQHc/OcZf67/jc+xe/RZlznWQHhbb8Pg1SkRdbK4yEi61aY8wxQA7PkSfoojtLQP/Kpe3og==", + "version": "7.24.3", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.24.3.tgz", + "integrity": "sha512-viKb0F9f2s0BCS22QSF308z/+1YWKV/76mwt61NBzS5izMzDPwdq1pTrzf+Li3npBWX9KdQbkeCt1jSAM7lZqg==", "dev": true, "dependencies": { "@babel/types": "^7.24.0" @@ -452,9 +452,9 @@ } }, "node_modules/@babel/helper-string-parser": { - "version": "7.23.4", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz", - "integrity": "sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.1.tgz", + "integrity": "sha512-2ofRCjnnA9y+wk8b9IAREroeUP02KHp431N2mhKniy2yKIDKpbrHv9eXwm8cBeWQYcJmzv5qKCu65P47eCF7CQ==", "dev": true, "engines": { "node": ">=6.9.0" @@ -723,12 +723,12 @@ } }, "node_modules/@babel/plugin-syntax-jsx": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.23.3.tgz", - "integrity": "sha512-EB2MELswq55OHUoRZLGg/zC7QWUKfNLpE57m/S2yr1uEneIgsTgrSzXP3NXEsMkVn76OlaVVnzN+ugObuYGwhg==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.24.1.tgz", + "integrity": "sha512-2eCtxZXf+kbkMIsXS4poTvT4Yu5rXiRa+9xGVT56raghjmBTKMpFNc9R4IDiB4emao9eO22Ox7CxuJG7BgExqA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-plugin-utils": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -840,12 +840,12 @@ } }, "node_modules/@babel/plugin-syntax-typescript": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.23.3.tgz", - "integrity": "sha512-9EiNjVJOMwCO+43TqoTrgQ8jMwcAd0sWyXi9RPfIsLTj4R2MADDDQXELhffaUx/uJv2AYcxBgPwH6j4TIA4ytQ==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.24.1.tgz", + "integrity": "sha512-Yhnmvy5HZEnHUty6i++gcfH1/l68AHnItFHnaCv6hn9dNh0hQvvQJsxpi4BMBFN5DLeHBuucT/0DgzXif/OyRw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-plugin-utils": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -3968,13 +3968,13 @@ } }, "node_modules/@jridgewell/source-map": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.5.tgz", - "integrity": "sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ==", + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz", + "integrity": "sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==", "dev": true, "dependencies": { - "@jridgewell/gen-mapping": "^0.3.0", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25" } }, "node_modules/@jridgewell/sourcemap-codec": { @@ -4129,9 +4129,9 @@ } }, "node_modules/@types/eslint": { - "version": "8.56.5", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.5.tgz", - "integrity": "sha512-u5/YPJHo1tvkSF2CE0USEkxon82Z5DBy2xR+qfyYNszpX9qcs4sT6uq2kBbj4BXY1+DBGDPnrhMZV3pKWGNukw==", + "version": "8.56.6", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.6.tgz", + "integrity": "sha512-ymwc+qb1XkjT/gfoQwxIeHZ6ixH23A+tCT2ADSA/DPVKzAjwYkTXBMCQ/f6fe4wEa85Lhp26VPeUxI7wMhAi7A==", "dev": true, "dependencies": { "@types/estree": "*", @@ -4271,9 +4271,9 @@ } }, "node_modules/@types/qs": { - "version": "6.9.12", - "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.12.tgz", - "integrity": "sha512-bZcOkJ6uWrL0Qb2NAWKa7TBU+mJHPzhx9jjLL1KHF+XpzEcR7EXHvjbHlGtR/IsP1vyPrehuS6XqkmaePy//mg==", + "version": "6.9.14", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.14.tgz", + "integrity": "sha512-5khscbd3SwWMhFqylJBLQ0zIu7c1K6Vz0uBIt915BI3zV0q1nfjRQD3RqSBcPaO6PHEF4ov/t9y89fSiyThlPA==", "dev": true }, "node_modules/@types/range-parser": { @@ -4331,9 +4331,9 @@ "dev": true }, "node_modules/@webassemblyjs/ast": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.6.tgz", - "integrity": "sha512-IN1xI7PwOvLPgjcf180gC1bqn3q/QaOCwYUahIOhbYUu8KA/3tw2RT/T0Gidi1l7Hhj5D/INhJxiICObqpMu4Q==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.12.1.tgz", + "integrity": "sha512-EKfMUOPRRUTy5UII4qJDGPpqfwjOmZ5jeGFwid9mnoqIFK+e0vqoi1qH56JpmZSzEL53jKnNzScdmftJyG5xWg==", "dev": true, "dependencies": { "@webassemblyjs/helper-numbers": "1.11.6", @@ -4353,9 +4353,9 @@ "dev": true }, "node_modules/@webassemblyjs/helper-buffer": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.6.tgz", - "integrity": "sha512-z3nFzdcp1mb8nEOFFk8DrYLpHvhKC3grJD2ardfKOzmbmJvEf/tPIqCY+sNcwZIY8ZD7IkB2l7/pqhUhqm7hLA==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.12.1.tgz", + "integrity": "sha512-nzJwQw99DNDKr9BVCOZcLuJJUlqkJh+kVzVl6Fmq/tI5ZtEyWT1KZMyOXltXLZJmDtvLCDgwsyrkohEtopTXCw==", "dev": true }, "node_modules/@webassemblyjs/helper-numbers": { @@ -4376,15 +4376,15 @@ "dev": true }, "node_modules/@webassemblyjs/helper-wasm-section": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.6.tgz", - "integrity": "sha512-LPpZbSOwTpEC2cgn4hTydySy1Ke+XEu+ETXuoyvuyezHO3Kjdu90KK95Sh9xTbmjrCsUwvWwCOQQNta37VrS9g==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.12.1.tgz", + "integrity": "sha512-Jif4vfB6FJlUlSbgEMHUyk1j234GTNG9dBJ4XJdOySoj518Xj0oGsNi59cUQF4RRMS9ouBUxDDdyBVfPTypa5g==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.6", - "@webassemblyjs/helper-buffer": "1.11.6", + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", "@webassemblyjs/helper-wasm-bytecode": "1.11.6", - "@webassemblyjs/wasm-gen": "1.11.6" + "@webassemblyjs/wasm-gen": "1.12.1" } }, "node_modules/@webassemblyjs/ieee754": { @@ -4412,28 +4412,28 @@ "dev": true }, "node_modules/@webassemblyjs/wasm-edit": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.6.tgz", - "integrity": "sha512-Ybn2I6fnfIGuCR+Faaz7YcvtBKxvoLV3Lebn1tM4o/IAJzmi9AWYIPWpyBfU8cC+JxAO57bk4+zdsTjJR+VTOw==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.12.1.tgz", + "integrity": "sha512-1DuwbVvADvS5mGnXbE+c9NfA8QRcZ6iKquqjjmR10k6o+zzsRVesil54DKexiowcFCPdr/Q0qaMgB01+SQ1u6g==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.6", - "@webassemblyjs/helper-buffer": "1.11.6", + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", "@webassemblyjs/helper-wasm-bytecode": "1.11.6", - "@webassemblyjs/helper-wasm-section": "1.11.6", - "@webassemblyjs/wasm-gen": "1.11.6", - "@webassemblyjs/wasm-opt": "1.11.6", - "@webassemblyjs/wasm-parser": "1.11.6", - "@webassemblyjs/wast-printer": "1.11.6" + "@webassemblyjs/helper-wasm-section": "1.12.1", + "@webassemblyjs/wasm-gen": "1.12.1", + "@webassemblyjs/wasm-opt": "1.12.1", + "@webassemblyjs/wasm-parser": "1.12.1", + "@webassemblyjs/wast-printer": "1.12.1" } }, "node_modules/@webassemblyjs/wasm-gen": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.6.tgz", - "integrity": "sha512-3XOqkZP/y6B4F0PBAXvI1/bky7GryoogUtfwExeP/v7Nzwo1QLcq5oQmpKlftZLbT+ERUOAZVQjuNVak6UXjPA==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.12.1.tgz", + "integrity": "sha512-TDq4Ojh9fcohAw6OIMXqiIcTq5KUXTGRkVxbSo1hQnSy6lAM5GSdfwWeSxpAo0YzgsgF182E/U0mDNhuA0tW7w==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/ast": "1.12.1", "@webassemblyjs/helper-wasm-bytecode": "1.11.6", "@webassemblyjs/ieee754": "1.11.6", "@webassemblyjs/leb128": "1.11.6", @@ -4441,24 +4441,24 @@ } }, "node_modules/@webassemblyjs/wasm-opt": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.6.tgz", - "integrity": "sha512-cOrKuLRE7PCe6AsOVl7WasYf3wbSo4CeOk6PkrjS7g57MFfVUF9u6ysQBBODX0LdgSvQqRiGz3CXvIDKcPNy4g==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.12.1.tgz", + "integrity": "sha512-Jg99j/2gG2iaz3hijw857AVYekZe2SAskcqlWIZXjji5WStnOpVoat3gQfT/Q5tb2djnCjBtMocY/Su1GfxPBg==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.6", - "@webassemblyjs/helper-buffer": "1.11.6", - "@webassemblyjs/wasm-gen": "1.11.6", - "@webassemblyjs/wasm-parser": "1.11.6" + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", + "@webassemblyjs/wasm-gen": "1.12.1", + "@webassemblyjs/wasm-parser": "1.12.1" } }, "node_modules/@webassemblyjs/wasm-parser": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.6.tgz", - "integrity": "sha512-6ZwPeGzMJM3Dqp3hCsLgESxBGtT/OeCvCZ4TA1JUPYgmhAx38tTPR9JaKy0S5H3evQpO/h2uWs2j6Yc/fjkpTQ==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.12.1.tgz", + "integrity": "sha512-xikIi7c2FHXysxXe3COrVUPSheuBtpcfhbpFj4gmu7KRLYOzANztwUU0IbsqvMqzuNK2+glRGWCEqZo1WCLyAQ==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/ast": "1.12.1", "@webassemblyjs/helper-api-error": "1.11.6", "@webassemblyjs/helper-wasm-bytecode": "1.11.6", "@webassemblyjs/ieee754": "1.11.6", @@ -4467,12 +4467,12 @@ } }, "node_modules/@webassemblyjs/wast-printer": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.6.tgz", - "integrity": "sha512-JM7AhRcE+yW2GWYaKeHL5vt4xqee5N2WcezptmgyhNS+ScggqcT1OtXykhAb13Sn5Yas0j2uv9tHgrjwvzAP4A==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.12.1.tgz", + "integrity": "sha512-+X4WAlOisVWQMikjbcvY2e0rwPsKQ9F688lksZhBcPycBBuii3O7m8FACbDMWDojpAqvjIncrG8J0XHKyQfVeA==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/ast": "1.12.1", "@xtuc/long": "4.2.2" } }, @@ -4691,15 +4691,16 @@ "dev": true }, "node_modules/array-includes": { - "version": "3.1.7", - "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.7.tgz", - "integrity": "sha512-dlcsNBIiWhPkHdOEEKnehA+RNUWDc4UqFtnIXU4uuYDPtA4LDkr7qip2p0VvFAEXNDr0yWZ9PJyIRiGjRLQzwQ==", + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.8.tgz", + "integrity": "sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "get-intrinsic": "^1.2.1", + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.4", "is-string": "^1.0.7" }, "engines": { @@ -4724,35 +4725,17 @@ "node": ">=8" } }, - "node_modules/array.prototype.filter": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/array.prototype.filter/-/array.prototype.filter-1.0.3.tgz", - "integrity": "sha512-VizNcj/RGJiUyQBgzwxzE5oHdeuXY5hSbbmKMlphj1cy1Vl7Pn2asCGbSrru6hSQjmCzqTBPVWAF/whmEOVHbw==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "es-array-method-boxes-properly": "^1.0.0", - "is-string": "^1.0.7" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/array.prototype.findlastindex": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.4.tgz", - "integrity": "sha512-hzvSHUshSpCflDR1QMUBLHGHP1VIEBegT4pix9H/Z92Xw3ySoy6c2qh7lJWTJnRJ8JCZ9bJNCgTyYaJGcJu6xQ==", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.5.tgz", + "integrity": "sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ==", "dev": true, "dependencies": { - "call-bind": "^1.0.5", + "call-bind": "^1.0.7", "define-properties": "^1.2.1", - "es-abstract": "^1.22.3", + "es-abstract": "^1.23.2", "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", "es-shim-unscopables": "^1.0.2" }, "engines": { @@ -5081,12 +5064,15 @@ } }, "node_modules/binary-extensions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", "dev": true, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/body-parser": { @@ -5261,9 +5247,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001596", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001596.tgz", - "integrity": "sha512-zpkZ+kEr6We7w63ORkoJ2pOfBwBkY/bJrG/UZ90qNb45Isblu8wzDgevEOrRL1r9dWayHjYiiyCMEXPn4DweGQ==", + "version": "1.0.30001599", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001599.tgz", + "integrity": "sha512-LRAQHZ4yT1+f9LemSMeqdMpMxZcc4RMWdj4tiFe3G8tNkWK+E58g+/tzotb5cU6TbcVJLr4fySiAW7XmxQvZQA==", "dev": true, "funding": [ { @@ -7423,6 +7409,57 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/data-view-buffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz", + "integrity": "sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz", + "integrity": "sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-offset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz", + "integrity": "sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/dateformat": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz", @@ -8219,9 +8256,9 @@ "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" }, "node_modules/electron-to-chromium": { - "version": "1.4.695", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.695.tgz", - "integrity": "sha512-eMijZmeqPtm774pCZIOrfUHMs/7ls++W1sLhxwqgu8KQ8E2WmMtzwyqOMt0XXUJ3HTIPfuwlfwF+I5cwnfItBA==", + "version": "1.4.713", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.713.tgz", + "integrity": "sha512-vDarADhwntXiULEdmWd77g2dV6FrNGa8ecAC29MZ4TwPut2fvosD0/5sJd1qWNNe8HcJFAC+F5Lf9jW1NPtWmw==", "dev": true }, "node_modules/emittery": { @@ -8261,9 +8298,9 @@ } }, "node_modules/enhanced-resolve": { - "version": "5.15.1", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.15.1.tgz", - "integrity": "sha512-3d3JRbwsCLJsYgvb6NuWEG44jjPSOMuS73L/6+7BZuoKm3W+qXnSoIYVHi8dG7Qcg4inAY4jbzkZ7MnskePeDg==", + "version": "5.16.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.16.0.tgz", + "integrity": "sha512-O+QWCviPNSSLAD9Ucn8Awv+poAkqn3T1XY5/N7kR7rQO9yfSGWkYZDwpJ+iKF7B8rxaQKWngSqACpgzeapSyoA==", "dev": true, "dependencies": { "graceful-fs": "^4.2.4", @@ -8292,17 +8329,21 @@ } }, "node_modules/es-abstract": { - "version": "1.22.5", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.5.tgz", - "integrity": "sha512-oW69R+4q2wG+Hc3KZePPZxOiisRIqfKBVo/HLx94QcJeWGU/8sZhCvc829rd1kS366vlJbzBfXf9yWwf0+Ko7w==", + "version": "1.23.2", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.2.tgz", + "integrity": "sha512-60s3Xv2T2p1ICykc7c+DNDPLDMm9t4QxCOUU0K9JxiLjM3C1zB9YVdN7tjxrFd4+AkZ8CdX1ovUga4P2+1e+/w==", "dev": true, "dependencies": { "array-buffer-byte-length": "^1.0.1", "arraybuffer.prototype.slice": "^1.0.3", "available-typed-arrays": "^1.0.7", "call-bind": "^1.0.7", + "data-view-buffer": "^1.0.1", + "data-view-byte-length": "^1.0.1", + "data-view-byte-offset": "^1.0.0", "es-define-property": "^1.0.0", "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", "es-set-tostringtag": "^2.0.3", "es-to-primitive": "^1.2.1", "function.prototype.name": "^1.1.6", @@ -8313,10 +8354,11 @@ "has-property-descriptors": "^1.0.2", "has-proto": "^1.0.3", "has-symbols": "^1.0.3", - "hasown": "^2.0.1", + "hasown": "^2.0.2", "internal-slot": "^1.0.7", "is-array-buffer": "^3.0.4", "is-callable": "^1.2.7", + "is-data-view": "^1.0.1", "is-negative-zero": "^2.0.3", "is-regex": "^1.1.4", "is-shared-array-buffer": "^1.0.3", @@ -8327,17 +8369,17 @@ "object-keys": "^1.1.1", "object.assign": "^4.1.5", "regexp.prototype.flags": "^1.5.2", - "safe-array-concat": "^1.1.0", + "safe-array-concat": "^1.1.2", "safe-regex-test": "^1.0.3", - "string.prototype.trim": "^1.2.8", - "string.prototype.trimend": "^1.0.7", + "string.prototype.trim": "^1.2.9", + "string.prototype.trimend": "^1.0.8", "string.prototype.trimstart": "^1.0.7", "typed-array-buffer": "^1.0.2", "typed-array-byte-length": "^1.0.1", "typed-array-byte-offset": "^1.0.2", "typed-array-length": "^1.0.5", "unbox-primitive": "^1.0.2", - "which-typed-array": "^1.1.14" + "which-typed-array": "^1.1.15" }, "engines": { "node": ">= 0.4" @@ -8346,12 +8388,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/es-array-method-boxes-properly": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz", - "integrity": "sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA==", - "dev": true - }, "node_modules/es-define-property": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", @@ -8374,11 +8410,23 @@ } }, "node_modules/es-module-lexer": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.4.1.tgz", - "integrity": "sha512-cXLGjP0c4T3flZJKQSuziYoq7MlT+rnvfZjfp7h+I7K9BNX54kP9nyWvdbwjQ4u1iWbOL4u96fgeZLToQlZC7w==", + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.4.2.tgz", + "integrity": "sha512-7nOqkomXZEaxUDJw21XZNtRk739QvrPSoZoRtbsEfcii00vdzZUh6zh1CQwHhrib8MdEtJfv5rJiGeb4KuV/vw==", "dev": true }, + "node_modules/es-object-atoms": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", + "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/es-set-tostringtag": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz", @@ -10363,9 +10411,9 @@ } }, "node_modules/hasown": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.1.tgz", - "integrity": "sha512-1/th4MHjnwncwXsIW6QMzlvYL9kG5e/CpVvLRZe4XPa8TOUNbCELqmvhDmnkNsAjwaG4+I8gJJL0JBvTTLO9qA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", "dev": true, "dependencies": { "function-bind": "^1.1.2" @@ -10674,6 +10722,21 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-data-view": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.1.tgz", + "integrity": "sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==", + "dev": true, + "dependencies": { + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-date-object": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", @@ -13807,14 +13870,15 @@ } }, "node_modules/object.fromentries": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.7.tgz", - "integrity": "sha512-UPbPHML6sL8PI/mOqPwsH4G6iyXcCGzLin8KvEPenOZN5lpCNBZZQ+V62vdjB1mQHrmqGQt5/OJzemUA+KJmEA==", + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.8.tgz", + "integrity": "sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0" }, "engines": { "node": ">= 0.4" @@ -13824,27 +13888,28 @@ } }, "node_modules/object.groupby": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.2.tgz", - "integrity": "sha512-bzBq58S+x+uo0VjurFT0UktpKHOZmv4/xePiOA1nbB9pMqpGK7rUPNgf+1YC+7mE+0HzhTMqNUuCqvKhj6FnBw==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.3.tgz", + "integrity": "sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==", "dev": true, "dependencies": { - "array.prototype.filter": "^1.0.3", - "call-bind": "^1.0.5", + "call-bind": "^1.0.7", "define-properties": "^1.2.1", - "es-abstract": "^1.22.3", - "es-errors": "^1.0.0" + "es-abstract": "^1.23.2" + }, + "engines": { + "node": ">= 0.4" } }, "node_modules/object.values": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.7.tgz", - "integrity": "sha512-aU6xnDFYT3x17e/f0IiiwlGPTy2jzMySGfUB4fq6z7CV8l85CWHDk5ErhyhpfDHhrOMwGFhSQkhMGHaIotA6Ng==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.2.0.tgz", + "integrity": "sha512-yBYjY9QX2hnRmZHAjG/f13MzmBzxzYgQhFrke06TTyKY5zSTEqkOeukBzIdVA3j3ulu8Qa3MbVFShV7T2RmGtQ==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" }, "engines": { "node": ">= 0.4" @@ -14294,9 +14359,9 @@ } }, "node_modules/pure-rand": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.0.4.tgz", - "integrity": "sha512-LA0Y9kxMYv47GIPJy6MI84fqTd2HmYZI83W/kM/SkKfDlajnZYfmXFTxkbY+xSBPkLJxltMa9hIkmdc29eguMA==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.1.0.tgz", + "integrity": "sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA==", "dev": true, "funding": [ { @@ -14788,13 +14853,13 @@ } }, "node_modules/safe-array-concat": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.0.tgz", - "integrity": "sha512-ZdQ0Jeb9Ofti4hbt5lX3T2JcAamT9hfzYU1MNB+z/jaEbB6wfFfPIR/zEORmZqobkCCJhSjodobH6WHNmJ97dg==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.2.tgz", + "integrity": "sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==", "dev": true, "dependencies": { - "call-bind": "^1.0.5", - "get-intrinsic": "^1.2.2", + "call-bind": "^1.0.7", + "get-intrinsic": "^1.2.4", "has-symbols": "^1.0.3", "isarray": "^2.0.5" }, @@ -14945,17 +15010,17 @@ } }, "node_modules/set-function-length": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.1.tgz", - "integrity": "sha512-j4t6ccc+VsKwYHso+kElc5neZpjtq9EnRICFZtWyBsLojhmeF/ZBd/elqm22WJh/BziDe/SBiOeAt0m2mfLD0g==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", "dev": true, "dependencies": { - "define-data-property": "^1.1.2", + "define-data-property": "^1.1.4", "es-errors": "^1.3.0", "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.3", + "get-intrinsic": "^1.2.4", "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.1" + "has-property-descriptors": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -15527,14 +15592,15 @@ } }, "node_modules/string.prototype.trim": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.8.tgz", - "integrity": "sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ==", + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz", + "integrity": "sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.0", + "es-object-atoms": "^1.0.0" }, "engines": { "node": ">= 0.4" @@ -15544,14 +15610,14 @@ } }, "node_modules/string.prototype.trimend": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.7.tgz", - "integrity": "sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.8.tgz", + "integrity": "sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -15745,9 +15811,9 @@ } }, "node_modules/terser": { - "version": "5.29.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.29.1.tgz", - "integrity": "sha512-lZQ/fyaIGxsbGxApKmoPTODIzELy3++mXhS5hOqaAWZjQtpq/hFHAc+rm29NND1rYRxRWKcjuARNwULNXa5RtQ==", + "version": "5.29.2", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.29.2.tgz", + "integrity": "sha512-ZiGkhUBIM+7LwkNjXYJq8svgkd+QK3UUr0wJqY4MieaezBSAIPgbSPZyIx0idM6XWK5CMzSWa8MJIzmRcB8Caw==", "dev": true, "dependencies": { "@jridgewell/source-map": "^0.3.3", @@ -16164,9 +16230,9 @@ } }, "node_modules/typescript": { - "version": "5.4.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.2.tgz", - "integrity": "sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==", + "version": "5.4.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.3.tgz", + "integrity": "sha512-KrPd3PKaCLr78MalgiwJnA25Nm8HAmdwN3mYUYZgG/wizIo9EainNVQI9/yDavtVFRN2h3k8uf3GLHuhDMgEHg==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -16394,9 +16460,9 @@ } }, "node_modules/watchpack": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz", - "integrity": "sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.1.tgz", + "integrity": "sha512-8wrBCMtVhqcXP2Sup1ctSkga6uc2Bx0IIvKyT7yTFier5AXHooSI+QyQQAtTb7+E0IUCCKyTFmXqdqgum2XWGg==", "dev": true, "dependencies": { "glob-to-regexp": "^0.4.1", @@ -16407,26 +16473,26 @@ } }, "node_modules/webpack": { - "version": "5.90.3", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.90.3.tgz", - "integrity": "sha512-h6uDYlWCctQRuXBs1oYpVe6sFcWedl0dpcVaTf/YF67J9bKvwJajFulMVSYKHrksMB3I/pIagRzDxwxkebuzKA==", + "version": "5.91.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.91.0.tgz", + "integrity": "sha512-rzVwlLeBWHJbmgTC/8TvAcu5vpJNII+MelQpylD4jNERPwpBJOE2lEcko1zJX3QJeLjTTAnQxn/OJ8bjDzVQaw==", "dev": true, "dependencies": { "@types/eslint-scope": "^3.7.3", "@types/estree": "^1.0.5", - "@webassemblyjs/ast": "^1.11.5", - "@webassemblyjs/wasm-edit": "^1.11.5", - "@webassemblyjs/wasm-parser": "^1.11.5", + "@webassemblyjs/ast": "^1.12.1", + "@webassemblyjs/wasm-edit": "^1.12.1", + "@webassemblyjs/wasm-parser": "^1.12.1", "acorn": "^8.7.1", "acorn-import-assertions": "^1.9.0", "browserslist": "^4.21.10", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.15.0", + "enhanced-resolve": "^5.16.0", "es-module-lexer": "^1.2.1", "eslint-scope": "5.1.1", "events": "^3.2.0", "glob-to-regexp": "^0.4.1", - "graceful-fs": "^4.2.9", + "graceful-fs": "^4.2.11", "json-parse-even-better-errors": "^2.3.1", "loader-runner": "^4.2.0", "mime-types": "^2.1.27", @@ -16434,7 +16500,7 @@ "schema-utils": "^3.2.0", "tapable": "^2.1.1", "terser-webpack-plugin": "^5.3.10", - "watchpack": "^2.4.0", + "watchpack": "^2.4.1", "webpack-sources": "^3.2.3" }, "bin": { @@ -16565,16 +16631,16 @@ } }, "node_modules/which-typed-array": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.14.tgz", - "integrity": "sha512-VnXFiIW8yNn9kIHN88xvZ4yOWchftKDsRJ8fEPacX/wl1lOvBrhsJ/OeJCXq7B0AaijRuqgzSKalJoPk+D8MPg==", + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz", + "integrity": "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==", "dev": true, "dependencies": { - "available-typed-arrays": "^1.0.6", - "call-bind": "^1.0.5", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", "for-each": "^0.3.3", "gopd": "^1.0.1", - "has-tostringtag": "^1.0.1" + "has-tostringtag": "^1.0.2" }, "engines": { "node": ">= 0.4" diff --git a/src/index.js b/src/index.js index a4c41b2dd..a141a7b4d 100644 --- a/src/index.js +++ b/src/index.js @@ -42,11 +42,12 @@ const noop = () => {}; */ /** - * @typedef {ReturnType} MultiWatching + * @typedef {ReturnType} MultiWatching */ +// TODO fix me after the next webpack release /** - * @typedef {Compiler["outputFileSystem"] & { createReadStream?: import("fs").createReadStream, statSync?: import("fs").statSync, lstat?: import("fs").lstat, readFileSync?: import("fs").readFileSync }} OutputFileSystem + * @typedef {Object & { createReadStream?: import("fs").createReadStream, statSync?: import("fs").statSync, lstat?: import("fs").lstat, readFileSync?: import("fs").readFileSync }} OutputFileSystem */ /** @typedef {ReturnType} Logger */ @@ -82,7 +83,7 @@ const noop = () => {}; * @property {Callback[]} callbacks * @property {Options} options * @property {Compiler | MultiCompiler} compiler - * @property {Watching | MultiWatching} watching + * @property {Watching | MultiWatching | undefined} watching * @property {Logger} logger * @property {OutputFileSystem} outputFileSystem */ @@ -90,7 +91,15 @@ const noop = () => {}; /** * @template {IncomingMessage} RequestInternal * @template {ServerResponse} ResponseInternal - * @typedef {Record | Array<{ key: string, value: number | string }> | ((req: RequestInternal, res: ResponseInternal, context: Context) => void | undefined | Record) | undefined} Headers + * @typedef {WithoutUndefined, "watching">} FilledContext + */ + +/** @typedef {Record | Array<{ key: string, value: number | string }>} NormalizedHeaders */ + +/** + * @template {IncomingMessage} RequestInternal + * @template {ServerResponse} ResponseInternal + * @typedef {NormalizedHeaders | ((req: RequestInternal, res: ResponseInternal, context: Context) => void | undefined | NormalizedHeaders) | undefined} Headers */ /** @@ -161,6 +170,18 @@ const noop = () => {}; * @typedef {Middleware & AdditionalMethods} API */ +/** + * @template T + * @template {keyof T} K + * @typedef {Omit & Partial} WithOptional + */ + +/** + * @template T + * @template {keyof T} K + * @typedef {T & { [P in K]: NonNullable }} WithoutUndefined + */ + /** * @template {IncomingMessage} RequestInternal * @template {ServerResponse} ResponseInternal @@ -186,7 +207,7 @@ function wdm(compiler, options = {}) { } /** - * @type {Context} + * @type {WithOptional, "watching" | "outputFileSystem">} */ const context = { state: false, @@ -195,13 +216,7 @@ function wdm(compiler, options = {}) { callbacks: [], options, compiler, - // @ts-ignore - // eslint-disable-next-line no-undefined - watching: undefined, logger: compiler.getInfrastructureLogger("webpack-dev-middleware"), - // @ts-ignore - // eslint-disable-next-line no-undefined - outputFileSystem: undefined, }; setupHooks(context); @@ -216,11 +231,6 @@ function wdm(compiler, options = {}) { if (/** @type {Compiler} */ (context.compiler).watching) { context.watching = /** @type {Compiler} */ (context.compiler).watching; } else { - /** - * @type {WatchOptions | WatchOptions[]} - */ - let watchOptions; - /** * @param {Error | null | undefined} error */ @@ -237,69 +247,47 @@ function wdm(compiler, options = {}) { if ( Array.isArray(/** @type {MultiCompiler} */ (context.compiler).compilers) ) { - watchOptions = - /** @type {MultiCompiler} */ - (context.compiler).compilers.map( - /** - * @param {Compiler} childCompiler - * @returns {WatchOptions} - */ - (childCompiler) => childCompiler.options.watchOptions || {}, - ); - - context.watching = - /** @type {MultiWatching} */ - ( - context.compiler.watch( - /** @type {WatchOptions}} */ - (watchOptions), - errorHandler, - ) - ); + const compiler = /** @type {MultiCompiler} */ (context.compiler); + const watchOptions = compiler.compilers.map( + (childCompiler) => childCompiler.options.watchOptions || {}, + ); + + context.watching = compiler.watch(watchOptions, errorHandler); } else { - watchOptions = - /** @type {Compiler} */ (context.compiler).options.watchOptions || {}; + const compiler = /** @type {Compiler} */ (context.compiler); + const watchOptions = compiler.options.watchOptions || {}; - context.watching = /** @type {Watching} */ ( - context.compiler.watch(watchOptions, errorHandler) - ); + context.watching = compiler.watch(watchOptions, errorHandler); } } + const filledContext = + /** @type {FilledContext} */ + (context); + const instance = /** @type {API} */ - (middleware(context)); + (middleware(filledContext)); // API - /** @type {API} */ - (instance).getFilenameFromUrl = (url, extra) => - getFilenameFromUrl(context, url, extra); + instance.getFilenameFromUrl = (url, extra) => + getFilenameFromUrl(filledContext, url, extra); - /** @type {API} */ - (instance).waitUntilValid = (callback = noop) => { - ready(context, callback); + instance.waitUntilValid = (callback = noop) => { + ready(filledContext, callback); }; - /** @type {API} */ - (instance).invalidate = (callback = noop) => { - ready(context, callback); + instance.invalidate = (callback = noop) => { + ready(filledContext, callback); - /** - * @type {NonNullable["watching"]>} - */ - (context.watching).invalidate(); + filledContext.watching.invalidate(); }; - /** @type {API} */ - (instance).close = (callback = noop) => { - /** - * @type {NonNullable["watching"]>} - */ - (context.watching).close(callback); + instance.close = (callback = noop) => { + filledContext.watching.close(callback); }; - /** @type {API} */ - (instance).context = context; + instance.context = filledContext; return instance; } diff --git a/src/middleware.js b/src/middleware.js index fa507f885..634ce77e3 100644 --- a/src/middleware.js +++ b/src/middleware.js @@ -16,6 +16,7 @@ const ready = require("./utils/ready"); /** @typedef {import("./index.js").NextFunction} NextFunction */ /** @typedef {import("./index.js").IncomingMessage} IncomingMessage */ /** @typedef {import("./index.js").ServerResponse} ServerResponse */ +/** @typedef {import("./index.js").NormalizedHeaders} NormalizedHeaders */ /** * @param {string} type @@ -32,7 +33,7 @@ const BYTES_RANGE_REGEXP = /^ *bytes/i; /** * @template {IncomingMessage} Request * @template {ServerResponse} Response - * @param {import("./index.js").Context} context + * @param {import("./index.js").FilledContext} context * @return {import("./index.js").Middleware} */ function wrapper(context) { @@ -101,8 +102,7 @@ function wrapper(context) { let { headers } = context.options; if (typeof headers === "function") { - // @ts-ignore - headers = headers(req, res, context); + headers = /** @type {NormalizedHeaders} */ (headers(req, res, context)); } /** @@ -114,21 +114,15 @@ function wrapper(context) { if (!Array.isArray(headers)) { // eslint-disable-next-line guard-for-in for (const name in headers) { - // @ts-ignore allHeaders.push({ key: name, value: headers[name] }); } headers = allHeaders; } - headers.forEach( - /** - * @param {{key: string, value: any}} header - */ - (header) => { - setHeaderForResponse(res, header.key, header.value); - }, - ); + headers.forEach((header) => { + setHeaderForResponse(res, header.key, header.value); + }); } if (!getHeaderFromResponse(res, "Content-Type")) { @@ -152,7 +146,9 @@ function wrapper(context) { setHeaderForResponse(res, "Accept-Ranges", "bytes"); } - const rangeHeader = getHeaderFromRequest(req, "range"); + const rangeHeader = + /** @type {string} */ + (getHeaderFromRequest(req, "range")); let len = /** @type {import("fs").Stats} */ (extra.stats).size; let offset = 0; diff --git a/src/utils/compatibleAPI.js b/src/utils/compatibleAPI.js index 4d2f81fdc..933572ec3 100644 --- a/src/utils/compatibleAPI.js +++ b/src/utils/compatibleAPI.js @@ -4,6 +4,7 @@ const escapeHtml = require("./escapeHtml"); /** @typedef {import("../index.js").IncomingMessage} IncomingMessage */ /** @typedef {import("../index.js").ServerResponse} ServerResponse */ +/** @typedef {import("fs").ReadStream} ReadStream */ /** * @typedef {Object} ExpectedRequest @@ -37,7 +38,7 @@ function getHeaderNames(res) { * @template {IncomingMessage} Request * @param {Request} req * @param {string} name - * @returns {string | undefined} + * @returns {string | string[] | undefined} */ function getHeaderFromRequest(req, name) { // Express API @@ -48,7 +49,6 @@ function getHeaderFromRequest(req, name) { } // Node.js API - // @ts-ignore return req.headers[name]; } @@ -256,6 +256,7 @@ async function send(req, res, filename, start, end, goNext, options) { const isFsSupportsStream = typeof options.outputFileSystem.createReadStream === "function"; + /** @type {string | Buffer | ReadStream} */ let bufferOrStream; let byteLength; diff --git a/src/utils/getFilenameFromUrl.js b/src/utils/getFilenameFromUrl.js index 4ebaa9a5f..0cb9c05a4 100644 --- a/src/utils/getFilenameFromUrl.js +++ b/src/utils/getFilenameFromUrl.js @@ -16,7 +16,6 @@ const cacheStore = new WeakMap(); * @param {(value: T) => T} callback * @returns {any} */ -// @ts-ignore const mem = (fn, { cache = new Map() } = {}, callback) => { /** * @param {any} arguments_ @@ -79,7 +78,7 @@ function decode(input) { /** * @template {IncomingMessage} Request * @template {ServerResponse} Response - * @param {import("../index.js").Context} context + * @param {import("../index.js").FilledContext} context * @param {string} url * @param {Extra=} extra * @returns {string | undefined} diff --git a/src/utils/getPaths.js b/src/utils/getPaths.js index 641a96a58..93dafa82f 100644 --- a/src/utils/getPaths.js +++ b/src/utils/getPaths.js @@ -7,7 +7,7 @@ /** * @template {IncomingMessage} Request * @template {ServerResponse} Response - * @param {import("../index.js").Context} context + * @param {import("../index.js").FilledContext} context */ function getPaths(context) { const { stats, options } = context; diff --git a/src/utils/ready.js b/src/utils/ready.js index 15d47d59c..741bcaa9e 100644 --- a/src/utils/ready.js +++ b/src/utils/ready.js @@ -4,7 +4,7 @@ /** * @template {IncomingMessage} Request * @template {ServerResponse} Response - * @param {import("../index.js").Context} context + * @param {import("../index.js").FilledContext} context * @param {(...args: any[]) => any} callback * @param {Request} [req] * @returns {void} diff --git a/src/utils/setupHooks.js b/src/utils/setupHooks.js index 2a6fe7592..7fe71435e 100644 --- a/src/utils/setupHooks.js +++ b/src/utils/setupHooks.js @@ -3,9 +3,9 @@ /** @typedef {import("webpack").MultiCompiler} MultiCompiler */ /** @typedef {import("webpack").Stats} Stats */ /** @typedef {import("webpack").MultiStats} MultiStats */ - /** @typedef {import("../index.js").IncomingMessage} IncomingMessage */ /** @typedef {import("../index.js").ServerResponse} ServerResponse */ + /** @typedef {Configuration["stats"]} StatsOptions */ /** @typedef {{ children: Configuration["stats"][] }} MultiStatsOptions */ /** @typedef {Exclude} StatsObjectOptions */ @@ -13,7 +13,7 @@ /** * @template {IncomingMessage} Request * @template {ServerResponse} Response - * @param {import("../index.js").Context} context + * @param {import("../index.js").WithOptional, "watching" | "outputFileSystem">} context */ function setupHooks(context) { function invalid() { @@ -155,9 +155,14 @@ function setupHooks(context) { }); } - context.compiler.hooks.watchRun.tap("webpack-dev-middleware", invalid); - context.compiler.hooks.invalid.tap("webpack-dev-middleware", invalid); - context.compiler.hooks.done.tap("webpack-dev-middleware", done); + // eslint-disable-next-line prefer-destructuring + const compiler = + /** @type {import("../index.js").Context} */ + (context).compiler; + + compiler.hooks.watchRun.tap("webpack-dev-middleware", invalid); + compiler.hooks.invalid.tap("webpack-dev-middleware", invalid); + compiler.hooks.done.tap("webpack-dev-middleware", done); } module.exports = setupHooks; diff --git a/src/utils/setupOutputFileSystem.js b/src/utils/setupOutputFileSystem.js index 9353537f9..9fb315b31 100644 --- a/src/utils/setupOutputFileSystem.js +++ b/src/utils/setupOutputFileSystem.js @@ -7,7 +7,7 @@ const memfs = require("memfs"); /** * @template {IncomingMessage} Request * @template {ServerResponse} Response - * @param {import("../index.js").Context} context + * @param {import("../index.js").WithOptional, "watching" | "outputFileSystem">} context */ function setupOutputFileSystem(context) { let outputFileSystem; @@ -48,6 +48,7 @@ function setupOutputFileSystem(context) { (context.compiler).compilers || [context.compiler]; for (const compiler of compilers) { + // @ts-ignore compiler.outputFileSystem = outputFileSystem; } diff --git a/src/utils/setupWriteToDisk.js b/src/utils/setupWriteToDisk.js index bcffddd5a..e70becffa 100644 --- a/src/utils/setupWriteToDisk.js +++ b/src/utils/setupWriteToDisk.js @@ -10,7 +10,7 @@ const path = require("path"); /** * @template {IncomingMessage} Request * @template {ServerResponse} Response - * @param {import("../index.js").Context} context + * @param {import("../index.js").WithOptional, "watching" | "outputFileSystem">} context */ function setupWriteToDisk(context) { /** diff --git a/types/index.d.ts b/types/index.d.ts index bbcf41e98..57cde10bc 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -26,10 +26,10 @@ export = wdm; * @typedef {Compiler["watching"]} Watching */ /** - * @typedef {ReturnType} MultiWatching + * @typedef {ReturnType} MultiWatching */ /** - * @typedef {Compiler["outputFileSystem"] & { createReadStream?: import("fs").createReadStream, statSync?: import("fs").statSync, lstat?: import("fs").lstat, readFileSync?: import("fs").readFileSync }} OutputFileSystem + * @typedef {Object & { createReadStream?: import("fs").createReadStream, statSync?: import("fs").statSync, lstat?: import("fs").lstat, readFileSync?: import("fs").readFileSync }} OutputFileSystem */ /** @typedef {ReturnType} Logger */ /** @@ -60,14 +60,20 @@ export = wdm; * @property {Callback[]} callbacks * @property {Options} options * @property {Compiler | MultiCompiler} compiler - * @property {Watching | MultiWatching} watching + * @property {Watching | MultiWatching | undefined} watching * @property {Logger} logger * @property {OutputFileSystem} outputFileSystem */ /** * @template {IncomingMessage} RequestInternal * @template {ServerResponse} ResponseInternal - * @typedef {Record | Array<{ key: string, value: number | string }> | ((req: RequestInternal, res: ResponseInternal, context: Context) => void | undefined | Record) | undefined} Headers + * @typedef {WithoutUndefined, "watching">} FilledContext + */ +/** @typedef {Record | Array<{ key: string, value: number | string }>} NormalizedHeaders */ +/** + * @template {IncomingMessage} RequestInternal + * @template {ServerResponse} ResponseInternal + * @typedef {NormalizedHeaders | ((req: RequestInternal, res: ResponseInternal, context: Context) => void | undefined | NormalizedHeaders) | undefined} Headers */ /** * @template {IncomingMessage} RequestInternal @@ -128,6 +134,16 @@ export = wdm; * @template {ServerResponse} ResponseInternal * @typedef {Middleware & AdditionalMethods} API */ +/** + * @template T + * @template {keyof T} K + * @typedef {Omit & Partial} WithOptional + */ +/** + * @template T + * @template {keyof T} K + * @typedef {T & { [P in K]: NonNullable }} WithoutUndefined + */ /** * @template {IncomingMessage} RequestInternal * @template {ServerResponse} ResponseInternal @@ -164,6 +180,8 @@ declare namespace wdm { ResponseData, ModifyResponseData, Context, + FilledContext, + NormalizedHeaders, Headers, Options, Middleware, @@ -174,6 +192,8 @@ declare namespace wdm { Close, AdditionalMethods, API, + WithOptional, + WithoutUndefined, }; } type Compiler = import("webpack").Compiler; @@ -206,8 +226,8 @@ type ServerResponse = import("http").ServerResponse & ExtendedServerResponse; type NextFunction = (err?: any) => void; type WatchOptions = NonNullable; type Watching = Compiler["watching"]; -type MultiWatching = ReturnType; -type OutputFileSystem = Compiler["outputFileSystem"] & { +type MultiWatching = ReturnType; +type OutputFileSystem = Object & { createReadStream?: typeof import("fs").createReadStream; statSync?: import("fs").StatSyncFn; lstat?: typeof import("fs").lstat; @@ -239,24 +259,30 @@ type Context< callbacks: Callback[]; options: Options; compiler: Compiler | MultiCompiler; - watching: Watching | MultiWatching; + watching: Watching | MultiWatching | undefined; logger: Logger; outputFileSystem: OutputFileSystem; }; -type Headers< +type FilledContext< RequestInternal extends import("http").IncomingMessage, ResponseInternal extends ServerResponse, -> = +> = WithoutUndefined, "watching">; +type NormalizedHeaders = | Record - | { + | Array<{ key: string; value: number | string; - }[] + }>; +type Headers< + RequestInternal extends import("http").IncomingMessage, + ResponseInternal extends ServerResponse, +> = + | NormalizedHeaders | (( req: RequestInternal, res: ResponseInternal, context: Context, - ) => void | undefined | Record) + ) => void | undefined | NormalizedHeaders) | undefined; type Options< RequestInternal extends import("http").IncomingMessage, @@ -306,3 +332,7 @@ type AdditionalMethods< close: Close; context: Context; }; +type WithOptional = Omit & Partial; +type WithoutUndefined = T & { + [P in K]: NonNullable; +}; diff --git a/types/middleware.d.ts b/types/middleware.d.ts index cbcd0e33f..c4cfd6789 100644 --- a/types/middleware.d.ts +++ b/types/middleware.d.ts @@ -3,18 +3,19 @@ export = wrapper; /** * @template {IncomingMessage} Request * @template {ServerResponse} Response - * @param {import("./index.js").Context} context + * @param {import("./index.js").FilledContext} context * @return {import("./index.js").Middleware} */ declare function wrapper< Request extends import("http").IncomingMessage, Response extends import("./index.js").ServerResponse, >( - context: import("./index.js").Context, + context: import("./index.js").FilledContext, ): import("./index.js").Middleware; declare namespace wrapper { - export { NextFunction, IncomingMessage, ServerResponse }; + export { NextFunction, IncomingMessage, ServerResponse, NormalizedHeaders }; } type NextFunction = import("./index.js").NextFunction; type IncomingMessage = import("./index.js").IncomingMessage; type ServerResponse = import("./index.js").ServerResponse; +type NormalizedHeaders = import("./index.js").NormalizedHeaders; diff --git a/types/utils/compatibleAPI.d.ts b/types/utils/compatibleAPI.d.ts index 2e3e404c1..f2af44ce3 100644 --- a/types/utils/compatibleAPI.d.ts +++ b/types/utils/compatibleAPI.d.ts @@ -1,6 +1,7 @@ /// export type IncomingMessage = import("../index.js").IncomingMessage; export type ServerResponse = import("../index.js").ServerResponse; +export type ReadStream = import("fs").ReadStream; export type ExpectedRequest = { get: (name: string) => string | undefined; }; @@ -34,6 +35,7 @@ export type SendOptions< }; /** @typedef {import("../index.js").IncomingMessage} IncomingMessage */ /** @typedef {import("../index.js").ServerResponse} ServerResponse */ +/** @typedef {import("fs").ReadStream} ReadStream */ /** * @typedef {Object} ExpectedRequest * @property {(name: string) => string | undefined} get @@ -57,11 +59,11 @@ export function getHeaderNames< * @template {IncomingMessage} Request * @param {Request} req * @param {string} name - * @returns {string | undefined} + * @returns {string | string[] | undefined} */ export function getHeaderFromRequest< Request extends import("http").IncomingMessage, ->(req: Request, name: string): string | undefined; +>(req: Request, name: string): string | string[] | undefined; /** * @template {ServerResponse} Response * @param {Response} res diff --git a/types/utils/getFilenameFromUrl.d.ts b/types/utils/getFilenameFromUrl.d.ts index 0ab19b393..b524d48e1 100644 --- a/types/utils/getFilenameFromUrl.d.ts +++ b/types/utils/getFilenameFromUrl.d.ts @@ -3,16 +3,16 @@ export = getFilenameFromUrl; /** * @template {IncomingMessage} Request * @template {ServerResponse} Response - * @param {import("../index.js").Context} context + * @param {import("../index.js").FilledContext} context * @param {string} url * @param {Extra=} extra * @returns {string | undefined} */ declare function getFilenameFromUrl< Request extends import("http").IncomingMessage, - Response extends import("./getPaths").ServerResponse, + Response extends import("../index.js").ServerResponse, >( - context: import("../index.js").Context, + context: import("../index.js").FilledContext, url: string, extra?: Extra | undefined, ): string | undefined; diff --git a/types/utils/getPaths.d.ts b/types/utils/getPaths.d.ts index 812aa3910..faac7e34a 100644 --- a/types/utils/getPaths.d.ts +++ b/types/utils/getPaths.d.ts @@ -8,13 +8,13 @@ export = getPaths; /** * @template {IncomingMessage} Request * @template {ServerResponse} Response - * @param {import("../index.js").Context} context + * @param {import("../index.js").FilledContext} context */ declare function getPaths< Request extends import("http").IncomingMessage, Response extends import("../index.js").ServerResponse, >( - context: import("../index.js").Context, + context: import("../index.js").FilledContext, ): { outputPath: string; publicPath: string; diff --git a/types/utils/ready.d.ts b/types/utils/ready.d.ts index 979745b2a..46e7f4886 100644 --- a/types/utils/ready.d.ts +++ b/types/utils/ready.d.ts @@ -5,7 +5,7 @@ export = ready; /** * @template {IncomingMessage} Request * @template {ServerResponse} Response - * @param {import("../index.js").Context} context + * @param {import("../index.js").FilledContext} context * @param {(...args: any[]) => any} callback * @param {Request} [req] * @returns {void} @@ -14,7 +14,7 @@ declare function ready< Request extends import("http").IncomingMessage, Response extends import("../index.js").ServerResponse, >( - context: import("../index.js").Context, + context: import("../index.js").FilledContext, callback: (...args: any[]) => any, req?: Request | undefined, ): void; diff --git a/types/utils/setupHooks.d.ts b/types/utils/setupHooks.d.ts index 699a34767..47b6f1cea 100644 --- a/types/utils/setupHooks.d.ts +++ b/types/utils/setupHooks.d.ts @@ -13,12 +13,17 @@ export = setupHooks; /** * @template {IncomingMessage} Request * @template {ServerResponse} Response - * @param {import("../index.js").Context} context + * @param {import("../index.js").WithOptional, "watching" | "outputFileSystem">} context */ declare function setupHooks< Request extends import("http").IncomingMessage, Response extends import("../index.js").ServerResponse, ->(context: import("../index.js").Context): void; +>( + context: import("../index.js").WithOptional< + import("../index.js").Context, + "watching" | "outputFileSystem" + >, +): void; declare namespace setupHooks { export { Configuration, diff --git a/types/utils/setupOutputFileSystem.d.ts b/types/utils/setupOutputFileSystem.d.ts index c19a0c443..94145b9bf 100644 --- a/types/utils/setupOutputFileSystem.d.ts +++ b/types/utils/setupOutputFileSystem.d.ts @@ -6,12 +6,17 @@ export = setupOutputFileSystem; /** * @template {IncomingMessage} Request * @template {ServerResponse} Response - * @param {import("../index.js").Context} context + * @param {import("../index.js").WithOptional, "watching" | "outputFileSystem">} context */ declare function setupOutputFileSystem< Request extends import("http").IncomingMessage, Response extends import("../index.js").ServerResponse, ->(context: import("../index.js").Context): void; +>( + context: import("../index.js").WithOptional< + import("../index.js").Context, + "watching" | "outputFileSystem" + >, +): void; declare namespace setupOutputFileSystem { export { MultiCompiler, IncomingMessage, ServerResponse }; } diff --git a/types/utils/setupWriteToDisk.d.ts b/types/utils/setupWriteToDisk.d.ts index 2ad61c0c7..89a656c94 100644 --- a/types/utils/setupWriteToDisk.d.ts +++ b/types/utils/setupWriteToDisk.d.ts @@ -8,12 +8,17 @@ export = setupWriteToDisk; /** * @template {IncomingMessage} Request * @template {ServerResponse} Response - * @param {import("../index.js").Context} context + * @param {import("../index.js").WithOptional, "watching" | "outputFileSystem">} context */ declare function setupWriteToDisk< Request extends import("http").IncomingMessage, Response extends import("../index.js").ServerResponse, ->(context: import("../index.js").Context): void; +>( + context: import("../index.js").WithOptional< + import("../index.js").Context, + "watching" | "outputFileSystem" + >, +): void; declare namespace setupWriteToDisk { export { Compiler,