From de77c9d54512d6478d47990c7769157da24056ed Mon Sep 17 00:00:00 2001 From: bohan Date: Tue, 28 Nov 2023 14:31:35 +0800 Subject: [PATCH] fix: not include everything for rspack --- package.json | 4 +- pnpm-lock.yaml | 401 ++++++++---------- src/rspack/index.ts | 62 ++- src/rspack/loaders/load.ts | 6 +- src/rspack/loaders/transform.ts | 16 +- src/types.ts | 6 + src/utils.ts | 30 ++ src/webpack/index.ts | 29 +- .../id-consistency/id-consistency.test.ts | 2 +- 9 files changed, 274 insertions(+), 282 deletions(-) diff --git a/package.json b/package.json index 09893416..b60f17a8 100644 --- a/package.json +++ b/package.json @@ -44,8 +44,8 @@ "@ampproject/remapping": "^2.2.1", "@antfu/eslint-config": "^1.0.0-beta.29", "@antfu/ni": "^0.21.8", - "@rspack/cli": "^0.3.8", - "@rspack/core": "^0.3.8", + "@rspack/cli": "0.4.0-canary-a9e7d87-20231127152134", + "@rspack/core": "0.4.0-canary-a9e7d87-20231127152134", "@types/fs-extra": "^11.0.3", "@types/node": "^20.8.9", "@types/webpack-sources": "^3.2.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e2c022df..be5fe5ac 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -29,11 +29,11 @@ devDependencies: specifier: ^0.21.8 version: 0.21.8 '@rspack/cli': - specifier: ^0.3.8 - version: 0.3.8(esbuild@0.19.5)(react-refresh@0.14.0)(webpack-cli@4.10.0) + specifier: 0.4.0-canary-a9e7d87-20231127152134 + version: 0.4.0-canary-a9e7d87-20231127152134(@rspack/core@0.4.0-canary-a9e7d87-20231127152134)(esbuild@0.19.5)(react-refresh@0.14.0)(webpack-cli@4.10.0) '@rspack/core': - specifier: ^0.3.8 - version: 0.3.8 + specifier: 0.4.0-canary-a9e7d87-20231127152134 + version: 0.4.0-canary-a9e7d87-20231127152134 '@types/fs-extra': specifier: ^11.0.3 version: 11.0.3 @@ -787,10 +787,10 @@ packages: dependencies: ansi-html-community: 0.0.8 common-path-prefix: 3.0.0 - core-js-pure: 3.30.2 + core-js-pure: 3.33.3 error-stack-parser: 2.1.4 find-up: 5.0.0 - html-entities: 2.3.3 + html-entities: 2.4.0 loader-utils: 2.0.4 react-refresh: 0.14.0 schema-utils: 3.3.0 @@ -799,8 +799,8 @@ packages: webpack-dev-server: 4.13.1(webpack-cli@4.10.0)(webpack@5.76.0) dev: true - /@polka/url@1.0.0-next.21: - resolution: {integrity: sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g==} + /@polka/url@1.0.0-next.23: + resolution: {integrity: sha512-C16M+IYz0rgRhWZdCmK+h58JMv8vijAA61gmz2rspCSwKwzBebpdcsiUmwrtJRdphuY30i6BSLEOP8ppbNLyLg==} dev: true /@rollup/rollup-android-arm-eabi@4.1.4: @@ -899,99 +899,56 @@ packages: dev: true optional: true - /@rspack/binding-darwin-arm64@0.3.8: - resolution: {integrity: sha512-qvxzkUaqAbVmwJuVW3p7o1XVT5z2MbwpC9VZQr1fAd7/vEdDfiMm8Vz1AcY/WKxrUjX6rwNs3Ix1SdSBveThKQ==} + /@rspack/binding-darwin-arm64@0.4.0-canary-a9e7d87-20231127152134: + resolution: {integrity: sha512-kt/40x8lmDf6I9W6Fx1dWuBTbNu+N9VeA6CO3Hgmi1iyg0WV4NiP6aAIXg2jTGthURnzzDOc4A+rFxMrqr/6Vw==} cpu: [arm64] os: [darwin] requiresBuild: true dev: true optional: true - /@rspack/binding-darwin-x64@0.3.8: - resolution: {integrity: sha512-Ae3cJiTcXuBTZdLv+vDtbjGcx5D0rizg7nuRmtFmDvtPjYgFE9y0F+VzajQVySqvtAO8kowryC8BYjqnJ7A2Rg==} + /@rspack/binding-darwin-x64@0.4.0-canary-a9e7d87-20231127152134: + resolution: {integrity: sha512-JvXnD2I7l9BQu207K8mLy0KzVUPItwtgpuo9j1m8Xc9OE9Htvsrpc20Kf2/C1j0RNsig+sxoh7jgz0RSTHZaBQ==} cpu: [x64] os: [darwin] requiresBuild: true dev: true optional: true - /@rspack/binding-linux-arm64-gnu@0.3.8: - resolution: {integrity: sha512-aZ/cbLq8j85t4TLA94Oj+urPMDlBb+FHce4YGatX6+0juzxNUY23rSRB6pvtQz6DkFxFHDayiOcLkk8loiNiUQ==} - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@rspack/binding-linux-arm64-musl@0.3.8: - resolution: {integrity: sha512-fcwnXl6BqnZ21LizWdcuFz1CNHHuMRoll1z5nfnWn5yzNo5eprXNqFgw0aC5R15Gri/GaiT7bZA7FXAU7eGR8g==} - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@rspack/binding-linux-x64-gnu@0.3.8: - resolution: {integrity: sha512-W7Kqf13GE/mT/HiQfnLMCkrNxekaJuk53sOYVehxBJ6J5NKvL/uzBvPa3m2EtbhUUkBnR0t87Yp04YS9JrnkeA==} + /@rspack/binding-linux-x64-gnu@0.4.0-canary-a9e7d87-20231127152134: + resolution: {integrity: sha512-a6Qo6wsuXxVsQpw9PcXvMESfNHLzEdUbrT19jZ0Lwt/bs/gzvzS6vJaixwiLHQOkmC+eXMFX3OzaOTbuJmgkLQ==} cpu: [x64] os: [linux] requiresBuild: true dev: true optional: true - /@rspack/binding-linux-x64-musl@0.3.8: - resolution: {integrity: sha512-KIRAj7WQ3JLaCENctA1aiREw9PPuLAFMxkXPGm2YeszfLhv+o3Suehc0OvsPcGeXg/laGKQzl0RV6dHyKfocQg==} + /@rspack/binding-win32-x64-msvc@0.4.0-canary-a9e7d87-20231127152134: + resolution: {integrity: sha512-6MS/vRdIurC7kMCS9nOi066GEsaqrDAo9fZMAEWZFXvUWiaGiZ0H+ZFXm6uM+fnh4Q3TRMS65hjyLMzDHmYp9g==} cpu: [x64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@rspack/binding-win32-arm64-msvc@0.3.8: - resolution: {integrity: sha512-PHlMQu0uiUBiJCpxR1ql6HJBeFpsombiPRquoN2d/a5WfkETDX04BnfN7XW8Fe9j164iCe5yU0Xwk0gaaJp3Uw==} - cpu: [arm64] - os: [win32] - requiresBuild: true - dev: true - optional: true - - /@rspack/binding-win32-ia32-msvc@0.3.8: - resolution: {integrity: sha512-ln3js9wOQLJi9E1MVNtLui56a3pXmSnEags9YJhZs5ZMT5SJGsofoa0zXNxeTMuRQ0Gx5w0tVSXZXgyVUm1OdA==} - cpu: [ia32] os: [win32] requiresBuild: true dev: true optional: true - /@rspack/binding-win32-x64-msvc@0.3.8: - resolution: {integrity: sha512-UK70L1vsp5St0qPATB1UdrFh9Ax/G1VpWx3Fp4W5iNzfcLBDKbCpEyCetxZhjHCcFVfbSE74X34NzgDiLDFrHA==} - cpu: [x64] - os: [win32] - requiresBuild: true + /@rspack/binding@0.4.0-canary-a9e7d87-20231127152134: + resolution: {integrity: sha512-gAcbpkfbWnYQBhJ+ADeZnGQaLzMtBvxNR5+7FWOK/d9+HT3m21yJCtuPU7ZAoAawCA5zF9f01aogjlaUjWPUAQ==} + optionalDependencies: + '@rspack/binding-darwin-arm64': 0.4.0-canary-a9e7d87-20231127152134 + '@rspack/binding-darwin-x64': 0.4.0-canary-a9e7d87-20231127152134 + '@rspack/binding-linux-x64-gnu': 0.4.0-canary-a9e7d87-20231127152134 + '@rspack/binding-win32-x64-msvc': 0.4.0-canary-a9e7d87-20231127152134 dev: true - optional: true - /@rspack/binding@0.3.8: - resolution: {integrity: sha512-urM1+I6BL1jv6hUZ44Nv2kYYWVIQxRIJoZFrlubo1XhTJqTFUPNF/7E/ritNC9J6gxxZMQLc0NLJz4jdUTaUbg==} - optionalDependencies: - '@rspack/binding-darwin-arm64': 0.3.8 - '@rspack/binding-darwin-x64': 0.3.8 - '@rspack/binding-linux-arm64-gnu': 0.3.8 - '@rspack/binding-linux-arm64-musl': 0.3.8 - '@rspack/binding-linux-x64-gnu': 0.3.8 - '@rspack/binding-linux-x64-musl': 0.3.8 - '@rspack/binding-win32-arm64-msvc': 0.3.8 - '@rspack/binding-win32-ia32-msvc': 0.3.8 - '@rspack/binding-win32-x64-msvc': 0.3.8 - dev: true - - /@rspack/cli@0.3.8(esbuild@0.19.5)(react-refresh@0.14.0)(webpack-cli@4.10.0): - resolution: {integrity: sha512-txMMgsB3QBqvXosN4eCkBoKpbyP0dxwREVhFajAVVY1mL+HxOiOBPR1lhHSQBI4mLxCvmtTMxK/9wAlmmtPyUg==} + /@rspack/cli@0.4.0-canary-a9e7d87-20231127152134(@rspack/core@0.4.0-canary-a9e7d87-20231127152134)(esbuild@0.19.5)(react-refresh@0.14.0)(webpack-cli@4.10.0): + resolution: {integrity: sha512-+Qz9kI2/VMmoHzP6jEFSuCyVaFN83hCVRk86UNClAonhsNw8Ge4wD35xGpsNSQL2aTwpX6/TkXUfZjBB6GuO4w==} hasBin: true + peerDependencies: + '@rspack/core': '>=0.4.0' dependencies: '@discoveryjs/json-ext': 0.5.7 - '@rspack/core': 0.3.8 - '@rspack/dev-server': 0.3.8(@rspack/core@0.3.8)(esbuild@0.19.5)(react-refresh@0.14.0)(webpack-cli@4.10.0) + '@rspack/core': 0.4.0-canary-a9e7d87-20231127152134 + '@rspack/dev-server': 0.4.0-canary-a9e7d87-20231127152134(@rspack/core@0.4.0-canary-a9e7d87-20231127152134)(esbuild@0.19.5)(react-refresh@0.14.0)(webpack-cli@4.10.0) colorette: 2.0.19 exit-hook: 3.2.0 interpret: 3.1.1 @@ -1017,38 +974,39 @@ packages: - webpack-plugin-serve dev: true - /@rspack/core@0.3.8: - resolution: {integrity: sha512-KUYYqm+PKVJBnnLuB+t0RCu0LhWm8mM3K3/VIGSATUi66Xgn7mxbSoab0IrCXWGekPUpUrmoA7hLg06wMtVJlQ==} + /@rspack/core@0.4.0-canary-a9e7d87-20231127152134: + resolution: {integrity: sha512-ZaB3Qzwt8s2zZkGbkk+GrCQDluUO+fpwx1Ug7S1yS6Ovf0BV5ojRMUsZ7xZgh97bnz78stCENMwcmKBF1Lf81w==} + engines: {node: '>=16.0.0'} dependencies: - '@rspack/binding': 0.3.8 + '@rspack/binding': 0.4.0-canary-a9e7d87-20231127152134 '@swc/helpers': 0.5.1 browserslist: 4.21.5 compare-versions: 6.0.0-rc.1 enhanced-resolve: 5.12.0 + fast-querystring: 1.1.2 graceful-fs: 4.2.10 + json-parse-even-better-errors: 3.0.0 neo-async: 2.6.2 react-refresh: 0.14.0 - schema-utils: 4.0.0 tapable: 2.2.1 terminal-link: 2.1.1 - util: 0.12.5 watchpack: 2.4.0 webpack-sources: 3.2.3 - zod: 3.21.4 - zod-validation-error: 1.2.0(zod@3.21.4) + zod: 3.22.4 + zod-validation-error: 1.3.1(zod@3.22.4) dev: true - /@rspack/dev-server@0.3.8(@rspack/core@0.3.8)(esbuild@0.19.5)(react-refresh@0.14.0)(webpack-cli@4.10.0): - resolution: {integrity: sha512-0k6SToHoB2yChaILX+w33h1hHh1EdeyIbH/bRxdQp/30axfDrbsDno/69HJs6lThX8EjbmSxWQiwA54S/hujLw==} + /@rspack/dev-server@0.4.0-canary-a9e7d87-20231127152134(@rspack/core@0.4.0-canary-a9e7d87-20231127152134)(esbuild@0.19.5)(react-refresh@0.14.0)(webpack-cli@4.10.0): + resolution: {integrity: sha512-1vAt2Jx1oEXD3jsHeFw6GlNQxqxQf9TXy3HDDdy3QZAFKtb96HD8mgbmWb6Raq2fZA2ih07JUqsZKpRwfw/35Q==} peerDependencies: '@rspack/core': '*' dependencies: - '@rspack/core': 0.3.8 - '@rspack/plugin-react-refresh': 0.3.8(react-refresh@0.14.0)(webpack-dev-server@4.13.1)(webpack@5.76.0) + '@rspack/core': 0.4.0-canary-a9e7d87-20231127152134 + '@rspack/plugin-react-refresh': 0.4.0-canary-a9e7d87-20231127152134(react-refresh@0.14.0)(webpack-dev-server@4.13.1)(webpack@5.76.0) chokidar: 3.5.3 connect-history-api-fallback: 2.0.0 express: 4.18.1 - http-proxy-middleware: 2.0.6(@types/express@4.17.17) + http-proxy-middleware: 2.0.6(@types/express@4.17.21) mime-types: 2.1.35 webpack: 5.76.0(esbuild@0.19.5)(webpack-cli@4.10.0) webpack-dev-middleware: 6.0.2(webpack@5.76.0) @@ -1072,8 +1030,8 @@ packages: - webpack-plugin-serve dev: true - /@rspack/plugin-react-refresh@0.3.8(react-refresh@0.14.0)(webpack-dev-server@4.13.1)(webpack@5.76.0): - resolution: {integrity: sha512-HF6liXhYJqXRYlQNRNTu1YpR4QykOAjh9/8bt6kYKsWZPj5D1zcPH+evpvF7QxcRpfSRXRujyHOXMIKBLTBqIQ==} + /@rspack/plugin-react-refresh@0.4.0-canary-a9e7d87-20231127152134(react-refresh@0.14.0)(webpack-dev-server@4.13.1)(webpack@5.76.0): + resolution: {integrity: sha512-PwAvc8R7lbGa+VYuq8hE0XCeBfUxMa/Lqzm5RdVTw4zwFiBDWpTJj6m8ve29rSyv+wf9PYqtjB6W3anclxQHzQ==} peerDependencies: react-refresh: '>=0.10.0 <1.0.0' peerDependenciesMeta: @@ -1082,7 +1040,6 @@ packages: dependencies: '@pmmmwh/react-refresh-webpack-plugin': 0.5.10(react-refresh@0.14.0)(webpack-dev-server@4.13.1)(webpack@5.76.0) react-refresh: 0.14.0 - schema-utils: 4.0.0 transitivePeerDependencies: - '@types/webpack' - sockjs-client @@ -1154,18 +1111,18 @@ packages: /@swc/helpers@0.5.1: resolution: {integrity: sha512-sJ902EfIzn1Fa+qYmjdQqh8tPsoxyBz+8yBKC2HKUxyezKJFwPGOn7pv4WY6QuQW//ySQi5lJjA/ZT9sNWWNTg==} dependencies: - tslib: 2.5.0 + tslib: 2.6.2 dev: true - /@types/body-parser@1.19.2: - resolution: {integrity: sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==} + /@types/body-parser@1.19.5: + resolution: {integrity: sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==} dependencies: - '@types/connect': 3.4.35 + '@types/connect': 3.4.38 '@types/node': 20.8.9 dev: true - /@types/bonjour@3.5.10: - resolution: {integrity: sha512-p7ienRMiS41Nu2/igbJxxLDWrSZ0WxM8UQgCeO9KhoVF7cOVFkrKsiDr1EsJIla8vV3oEEjGcz11jc5yimhzZw==} + /@types/bonjour@3.5.13: + resolution: {integrity: sha512-z9fJ5Im06zvUL548KvYNecEVlA7cVDkGUi6kZusb04mpyEFKCIZJvloCcmpmLaIahDpOQGHaHmG6imtPMmPXGQ==} dependencies: '@types/node': 20.8.9 dev: true @@ -1180,15 +1137,15 @@ packages: resolution: {integrity: sha512-mEo1sAde+UCE6b2hxn332f1g1E8WfYRu6p5SvTKr2ZKC1f7gFJXk4h5PyGP9Dt6gCaG8y8XhwnXWC6Iy2cmBng==} dev: true - /@types/connect-history-api-fallback@1.5.0: - resolution: {integrity: sha512-4x5FkPpLipqwthjPsF7ZRbOv3uoLUFkTA9G9v583qi4pACvq0uTELrB8OLUzPWUI4IJIyvM85vzkV1nyiI2Lig==} + /@types/connect-history-api-fallback@1.5.4: + resolution: {integrity: sha512-n6Cr2xS1h4uAulPRdlw6Jl6s1oG8KrVilPN2yUITEs+K48EzMJJ3W1xy8K5eWuFvjp3R74AOIGSmp2UfBJ8HFw==} dependencies: - '@types/express-serve-static-core': 4.17.33 + '@types/express-serve-static-core': 4.17.41 '@types/node': 20.8.9 dev: true - /@types/connect@3.4.35: - resolution: {integrity: sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==} + /@types/connect@3.4.38: + resolution: {integrity: sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==} dependencies: '@types/node': 20.8.9 dev: true @@ -1215,21 +1172,22 @@ packages: resolution: {integrity: sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==} dev: true - /@types/express-serve-static-core@4.17.33: - resolution: {integrity: sha512-TPBqmR/HRYI3eC2E5hmiivIzv+bidAfXofM+sbonAGvyDhySGw9/PQZFt2BLOrjUUR++4eJVpx6KnLQK1Fk9tA==} + /@types/express-serve-static-core@4.17.41: + resolution: {integrity: sha512-OaJ7XLaelTgrvlZD8/aa0vvvxZdUmlCn6MtWeB7TkiKW70BQLc9XEPpDLPdbo52ZhXUCrznlWdCHWxJWtdyajA==} dependencies: '@types/node': 20.8.9 - '@types/qs': 6.9.7 - '@types/range-parser': 1.2.4 + '@types/qs': 6.9.10 + '@types/range-parser': 1.2.7 + '@types/send': 0.17.4 dev: true - /@types/express@4.17.17: - resolution: {integrity: sha512-Q4FmmuLGBG58btUnfS1c1r/NQdlp3DMfGDGig8WhfpA2YRUtEkxAjkZb0yvplJGYdF1fsQ81iMDcH24sSCNC/Q==} + /@types/express@4.17.21: + resolution: {integrity: sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==} dependencies: - '@types/body-parser': 1.19.2 - '@types/express-serve-static-core': 4.17.33 - '@types/qs': 6.9.7 - '@types/serve-static': 1.13.10 + '@types/body-parser': 1.19.5 + '@types/express-serve-static-core': 4.17.41 + '@types/qs': 6.9.10 + '@types/serve-static': 1.15.5 dev: true /@types/fs-extra@11.0.3: @@ -1239,8 +1197,12 @@ packages: '@types/node': 20.8.9 dev: true - /@types/http-proxy@1.17.11: - resolution: {integrity: sha512-HC8G7c1WmaF2ekqpnFq626xd3Zz0uvaqFmBJNRZCGEZCXkvSdJoNFn/8Ygbd9fKNQj8UzLdCETaI0UWPAjK7IA==} + /@types/http-errors@2.0.4: + resolution: {integrity: sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==} + dev: true + + /@types/http-proxy@1.17.14: + resolution: {integrity: sha512-SSrD0c1OQzlFX7pGu1eXxSEjemej64aaNPRhhVYUGqXh0BtldAAx37MG8btcumvpgKyZp1F5Gn3JkktdxiFv6w==} dependencies: '@types/node': 20.8.9 dev: true @@ -1261,8 +1223,18 @@ packages: '@types/unist': 2.0.6 dev: true - /@types/mime@1.3.2: - resolution: {integrity: sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw==} + /@types/mime@1.3.5: + resolution: {integrity: sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==} + dev: true + + /@types/mime@3.0.4: + resolution: {integrity: sha512-iJt33IQnVRkqeqC7PzBHPTC6fDlRNRW8vjrgqtScAhrmMwe8c4Eo7+fUGTa+XdWrpEgpyKWMYmi2dIwMAYRzPw==} + dev: true + + /@types/node-forge@1.3.10: + resolution: {integrity: sha512-y6PJDYN4xYBxwd22l+OVH35N+1fCYWiuC3aiP2SlXVE6Lo7SS+rSx9r89hLxrP4pn6n1lBGhHJ12pj3F3Mpttw==} + dependencies: + '@types/node': 20.8.9 dev: true /@types/node@20.8.9: @@ -1275,12 +1247,12 @@ packages: resolution: {integrity: sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==} dev: true - /@types/qs@6.9.7: - resolution: {integrity: sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==} + /@types/qs@6.9.10: + resolution: {integrity: sha512-3Gnx08Ns1sEoCrWssEgTSJs/rsT2vhGP+Ja9cnnk9k4ALxinORlQneLXFeFKOTJMOeZUFD1s7w+w2AphTpvzZw==} dev: true - /@types/range-parser@1.2.4: - resolution: {integrity: sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==} + /@types/range-parser@1.2.7: + resolution: {integrity: sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==} dev: true /@types/retry@0.12.0: @@ -1291,21 +1263,29 @@ packages: resolution: {integrity: sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw==} dev: true - /@types/serve-index@1.9.1: - resolution: {integrity: sha512-d/Hs3nWDxNL2xAczmOVZNj92YZCS6RGxfBPjKzuu/XirCgXdpKEb88dYNbrYGint6IVWLNP+yonwVAuRC0T2Dg==} + /@types/send@0.17.4: + resolution: {integrity: sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==} + dependencies: + '@types/mime': 1.3.5 + '@types/node': 20.8.9 + dev: true + + /@types/serve-index@1.9.4: + resolution: {integrity: sha512-qLpGZ/c2fhSs5gnYsQxtDEq3Oy8SXPClIXkW5ghvAvsNuVSA8k+gCONcUCS/UjLEYvYps+e8uBtfgXgvhwfNug==} dependencies: - '@types/express': 4.17.17 + '@types/express': 4.17.21 dev: true - /@types/serve-static@1.13.10: - resolution: {integrity: sha512-nCkHGI4w7ZgAdNkrEu0bv+4xNV/XDqW+DydknebMOQwkpDGx8G+HTlj7R7ABI8i8nKxVw0wtKPi1D+lPOkh4YQ==} + /@types/serve-static@1.15.5: + resolution: {integrity: sha512-PDRk21MnK70hja/YF8AHfC7yIsiQHn1rcXx7ijCFBX/k+XQJhQT/gw3xekXKJvx+5SXaMMS8oqQy09Mzvz2TuQ==} dependencies: - '@types/mime': 1.3.2 + '@types/http-errors': 2.0.4 + '@types/mime': 3.0.4 '@types/node': 20.8.9 dev: true - /@types/sockjs@0.3.33: - resolution: {integrity: sha512-f0KEEe05NvUnat+boPTZ0dgaLZ4SfSouXUgv5noUiefG2ajgKjmETo9ZJyuqsl7dfl2aHlLJUiki6B4ZYldiiw==} + /@types/sockjs@0.3.36: + resolution: {integrity: sha512-MK9V6NzAS1+Ud7JV9lJLFqW85VbC9dq3LmwZCuBe4wBDgKC0Kj/jd8Xl+nSviU+Qc3+m7umHHyHg//2KSa0a0Q==} dependencies: '@types/node': 20.8.9 dev: true @@ -1326,8 +1306,8 @@ packages: source-map: 0.7.3 dev: true - /@types/ws@8.5.4: - resolution: {integrity: sha512-zdQDHKUgcX/zBc4GrwsE/7dVdAD8JR4EuiAXiiUhhfyIJXXb2+PrGshFyeXWQPMmmZ2XxgaqclgpIC7eTXc1mg==} + /@types/ws@8.5.10: + resolution: {integrity: sha512-vmQSUcfalpIq0R9q7uTo2lXs6eGIpt9wtnLdMv9LVpIjCA/+ufZRozlVoVelIYixx1ugCBKDhn89vnsEGOCx9A==} dependencies: '@types/node': 20.8.9 dev: true @@ -2543,8 +2523,8 @@ packages: engines: {node: '>= 0.6'} dev: true - /core-js-pure@3.30.2: - resolution: {integrity: sha512-p/npFUJXXBkCCTIlEGBdghofn00jWG6ZOtdoIXSJmAu2QBvN0IqpZXWweOytcwE6cfx8ZvVUy1vw8zxhe4Y2vg==} + /core-js-pure@3.33.3: + resolution: {integrity: sha512-taJ00IDOP+XYQEA2dAe4ESkmHt1fL8wzYDo3mRWQey8uO9UojlBFMneA65kMyxfYP7106c6LzWaq7/haDT6BCQ==} requiresBuild: true dev: true @@ -2690,8 +2670,8 @@ packages: resolution: {integrity: sha512-z+paD6YUQsk+AbGCEM4PrOXSss5gd66QfcVBFTKR/HpFL9jCqikS94HYwKww6fQyO7IxrIIyUu+g0Ka9tUS2Cg==} dev: true - /dns-packet@5.6.0: - resolution: {integrity: sha512-rza3UH1LwdHh9qyPXp8lkwpjSNk/AMD3dPytUoRoqnypDUhY0xvbdmVhWOfxO68frEfV9BU8V12Ez7ZsHGZpCQ==} + /dns-packet@5.6.1: + resolution: {integrity: sha512-l4gcSouhcgIKRvyy99RNVOgxXiicE+2jZoNmaNmZ6JXiGajBOJAesk1OBlJuM5k2c+eudGdLxDqXuPCKIj6kpw==} engines: {node: '>=6'} dependencies: '@leichtgewicht/ip-codec': 2.0.4 @@ -3428,6 +3408,10 @@ packages: - supports-color dev: true + /fast-decode-uri-component@1.0.1: + resolution: {integrity: sha512-WKgKWg5eUxvRZGwW8FvfbaH7AXSh2cL+3j5fMGzUMCxWBJ3dV3a7Wz8y2f/uQ0e3B6WmodD3oS54jTQ9HVTIIg==} + dev: true + /fast-deep-equal@3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} dev: true @@ -3451,6 +3435,12 @@ packages: resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} dev: true + /fast-querystring@1.1.2: + resolution: {integrity: sha512-g6KuKWmFXc0fID8WWH0jit4g0AGBoJhCkJMb1RmbsSEUNvQ+ZC8D6CUZ+GtF8nMzSPXnhiePyyqqipzNNEnHjg==} + dependencies: + fast-decode-uri-component: 1.0.1 + dev: true + /fastest-levenshtein@1.0.12: resolution: {integrity: sha512-On2N+BpYJ15xIC974QNVuYGMOlEVt4s0EOI3wwMqOmK1fdDY+FN/zltPV8vosq4ad4c/gJ1KHScUn/6AWIgiow==} dev: true @@ -3537,8 +3527,8 @@ packages: resolution: {integrity: sha512-8/sOawo8tJ4QOBX8YlQBMxL8+RLZfxMQOif9o0KUKTNTjMYElWPE0r/m5VNFxTRd0NSw8qSy8dajrwX4RYI1Hw==} dev: true - /follow-redirects@1.15.2: - resolution: {integrity: sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==} + /follow-redirects@1.15.3: + resolution: {integrity: sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==} engines: {node: '>=4.0'} peerDependencies: debug: '*' @@ -3579,8 +3569,8 @@ packages: minipass: 3.3.6 dev: true - /fs-monkey@1.0.3: - resolution: {integrity: sha512-cybjIfiiE+pTWicSCLFHSrXZ6EilF30oh91FDP9S2B051prEa7QWfrVTQm10/dDpswBDXZugPa1Ogu8Yh+HV0Q==} + /fs-monkey@1.0.5: + resolution: {integrity: sha512-8uMbBjrhzW76TYgEV27Y5E//W2f/lTFmx78P2w19FZSxarhI/798APGQyuGCwmkNxgwGRhrLfvWyLBvNtuOmew==} dev: true /fs.realpath@1.0.0: @@ -3881,8 +3871,8 @@ packages: wbuf: 1.7.3 dev: true - /html-entities@2.3.3: - resolution: {integrity: sha512-DV5Ln36z34NNTDgnz0EWGBLZENelNAtkiFA4kyNOG2tDI6Mz1uSWiq1wAKdyjnJwyDiDO7Fa2SO1CTxPXL8VxA==} + /html-entities@2.4.0: + resolution: {integrity: sha512-igBTJcNNNhvZFRtm8uA6xMY6xYleeDwn3PeBCkDz7tHttv4F2hsDI2aPgNERWzvRcNYHNT3ymRaQzllmXj4YsQ==} dev: true /http-deceiver@1.2.7: @@ -3914,7 +3904,7 @@ packages: resolution: {integrity: sha512-SGeBX54F94Wgu5RH3X5jsDtf4eHyRogWX1XGT3b4HuW3tQPM4AaBzoUji/4AAJNXCEOWZ5O0DgZmJw1947gD5Q==} dev: true - /http-proxy-middleware@2.0.6(@types/express@4.17.17): + /http-proxy-middleware@2.0.6(@types/express@4.17.21): resolution: {integrity: sha512-ya/UeJ6HVBYxrgYotAZo1KvPWlgB48kUJLDePFeneHsVujFaW5WNj2NgWCAE//B1Dl02BIfYlpNgBy8Kf8Rjmw==} engines: {node: '>=12.0.0'} peerDependencies: @@ -3923,8 +3913,8 @@ packages: '@types/express': optional: true dependencies: - '@types/express': 4.17.17 - '@types/http-proxy': 1.17.11 + '@types/express': 4.17.21 + '@types/http-proxy': 1.17.14 http-proxy: 1.18.1 is-glob: 4.0.3 is-plain-obj: 3.0.0 @@ -3938,7 +3928,7 @@ packages: engines: {node: '>=8.0.0'} dependencies: eventemitter3: 4.0.7 - follow-redirects: 1.15.2 + follow-redirects: 1.15.3 requires-port: 1.0.0 transitivePeerDependencies: - debug @@ -4042,8 +4032,8 @@ packages: engines: {node: '>= 0.10'} dev: true - /ipaddr.js@2.0.1: - resolution: {integrity: sha512-1qTgH9NG+IIJ4yfKs2e6Pp1bZg8wbDbKHT21HrLIeYBTRLgMYKnMTPAuI3Lcs61nfx5h1xlXnbJtH1kX5/d/ng==} + /ipaddr.js@2.1.0: + resolution: {integrity: sha512-LlbxQ7xKzfBusov6UMi4MFpEg0m+mAm9xyNGEduwXMEDuf4WfzB/RZwMVYEd7IKGvh4IUkEXYxtAVu9T3OelJQ==} engines: {node: '>= 10'} dev: true @@ -4058,14 +4048,6 @@ packages: is-decimal: 1.0.4 dev: true - /is-arguments@1.1.1: - resolution: {integrity: sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.2 - has-tostringtag: 1.0.0 - dev: true - /is-array-buffer@3.0.2: resolution: {integrity: sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==} dependencies: @@ -4147,13 +4129,6 @@ packages: engines: {node: '>=12'} dev: true - /is-generator-function@1.0.10: - resolution: {integrity: sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==} - engines: {node: '>= 0.4'} - dependencies: - has-tostringtag: 1.0.0 - dev: true - /is-glob@4.0.3: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} @@ -4247,17 +4222,6 @@ packages: text-extensions: 2.4.0 dev: true - /is-typed-array@1.1.10: - resolution: {integrity: sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A==} - engines: {node: '>= 0.4'} - dependencies: - available-typed-arrays: 1.0.5 - call-bind: 1.0.2 - for-each: 0.3.3 - gopd: 1.0.1 - has-tostringtag: 1.0.0 - dev: true - /is-typed-array@1.1.12: resolution: {integrity: sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==} engines: {node: '>= 0.4'} @@ -4419,8 +4383,8 @@ packages: engines: {node: '>=6'} dev: true - /launch-editor@2.6.0: - resolution: {integrity: sha512-JpDCcQnyAAzZZaZ7vEiSqL690w7dAEyLao+KC96zBplnYbJS7TYNjvM3M7y3dGz+v7aIsJk3hllWuc0kWAjyRQ==} + /launch-editor@2.6.1: + resolution: {integrity: sha512-eB/uXmFVpY4zezmGp5XtU21kwo7GBbKB+EQ+UZeWtGb9yAM5xt/Evk+lYH3eRNAtId+ej4u7TYPFZ07w4s7rRw==} dependencies: picocolors: 1.0.0 shell-quote: 1.8.1 @@ -4601,11 +4565,11 @@ packages: engines: {node: '>= 0.6'} dev: true - /memfs@3.5.1: - resolution: {integrity: sha512-UWbFJKvj5k+nETdteFndTpYxdeTMox/ULeqX5k/dpaQJCCFmj5EeKv3dBcyO2xmkRAx2vppRu5dVG7SOtsGOzA==} + /memfs@3.5.3: + resolution: {integrity: sha512-UERzLsxzllchadvbPs5aolHh65ISpKpM+ccLbOJ8/vvpBKmAWf+la7dXFy7Mr0ySHbdHrFv5kGFCUHHe6GFEmw==} engines: {node: '>= 4.0.0'} dependencies: - fs-monkey: 1.0.3 + fs-monkey: 1.0.5 dev: true /meow@12.1.1: @@ -4765,7 +4729,7 @@ packages: resolution: {integrity: sha512-2eznPJP8z2BFLX50tf0LuODrpINqP1RVIm/CObbTcBRITQgmC/TjcREF1NeTBzIcR5XO/ukWo+YHOjBbFwIupg==} hasBin: true dependencies: - dns-packet: 5.6.0 + dns-packet: 5.6.1 thunky: 1.1.0 dev: true @@ -5515,8 +5479,8 @@ packages: ajv-keywords: 3.5.2(ajv@6.12.6) dev: true - /schema-utils@4.0.0: - resolution: {integrity: sha512-1edyXKgh6XnJsJSQ8mKWXnN/BVaIbFMLpouRUrXgVq7WYne5kw3MW7UPhO44uRXQSIpTSXoJbmrR2X0w9kUTyg==} + /schema-utils@4.2.0: + resolution: {integrity: sha512-L0jRsrPpjdckP3oPug3/VxNKt2trR8TcabrM6FOAAlvC/9Phcmm+cuAgTlxBqdBR1WJx7Naj9WHw+aOmheSVbw==} engines: {node: '>= 12.13.0'} dependencies: '@types/json-schema': 7.0.12 @@ -5529,10 +5493,11 @@ packages: resolution: {integrity: sha512-mEugaLK+YfkijB4fx0e6kImuJdCIt2LxCRcbEYPqRGCs4F2ogyfZU5IAZRdjCP8JPq2AtdNoC/Dux63d9Kiryg==} dev: true - /selfsigned@2.1.1: - resolution: {integrity: sha512-GSL3aowiF7wa/WtSFwnUrludWFoNhftq8bUkH9pkzjpN2XSPOAYEgg6e0sS9s0rZwgJzJiQRPU18A6clnoW5wQ==} + /selfsigned@2.4.1: + resolution: {integrity: sha512-th5B4L2U+eGLq1TVh7zNRGBapioSORUeymIydxgFpwww9d2qyKvtuPU2jJuHvYAwwqi2Y596QBL3eEqcPEYL8Q==} engines: {node: '>=10'} dependencies: + '@types/node-forge': 1.3.10 node-forge: 1.3.1 dev: true @@ -5689,7 +5654,7 @@ packages: resolution: {integrity: sha512-JuLThK3TnZG1TAKDwNIqNq6QA2afLOCcm+iE8D1Kj3GA40pSPsxQjjJl0J8X3tsR7T+CP1GavpzLwYkgVLWrZQ==} engines: {node: '>= 10'} dependencies: - '@polka/url': 1.0.0-next.21 + '@polka/url': 1.0.0-next.23 mrmime: 1.0.1 totalist: 1.1.0 dev: true @@ -6154,8 +6119,8 @@ packages: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} dev: true - /tslib@2.5.0: - resolution: {integrity: sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==} + /tslib@2.6.2: + resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} dev: true /tsup@7.2.0(typescript@5.2.2): @@ -6359,16 +6324,6 @@ packages: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} dev: true - /util@0.12.5: - resolution: {integrity: sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==} - dependencies: - inherits: 2.0.4 - is-arguments: 1.1.1 - is-generator-function: 1.0.10 - is-typed-array: 1.1.10 - which-typed-array: 1.1.9 - dev: true - /utils-merge@1.0.1: resolution: {integrity: sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==} engines: {node: '>= 0.4.0'} @@ -6611,10 +6566,10 @@ packages: webpack: ^4.0.0 || ^5.0.0 dependencies: colorette: 2.0.20 - memfs: 3.5.1 + memfs: 3.5.3 mime-types: 2.1.35 range-parser: 1.2.1 - schema-utils: 4.0.0 + schema-utils: 4.2.0 webpack: 5.76.0(esbuild@0.19.5)(webpack-cli@4.10.0) dev: true @@ -6628,10 +6583,10 @@ packages: optional: true dependencies: colorette: 2.0.20 - memfs: 3.5.1 + memfs: 3.5.3 mime-types: 2.1.35 range-parser: 1.2.1 - schema-utils: 4.0.0 + schema-utils: 4.2.0 webpack: 5.76.0(esbuild@0.19.5)(webpack-cli@4.10.0) dev: true @@ -6648,13 +6603,13 @@ packages: webpack-cli: optional: true dependencies: - '@types/bonjour': 3.5.10 - '@types/connect-history-api-fallback': 1.5.0 - '@types/express': 4.17.17 - '@types/serve-index': 1.9.1 - '@types/serve-static': 1.13.10 - '@types/sockjs': 0.3.33 - '@types/ws': 8.5.4 + '@types/bonjour': 3.5.13 + '@types/connect-history-api-fallback': 1.5.4 + '@types/express': 4.17.21 + '@types/serve-index': 1.9.4 + '@types/serve-static': 1.15.5 + '@types/sockjs': 0.3.36 + '@types/ws': 8.5.10 ansi-html-community: 0.0.8 bonjour-service: 1.1.1 chokidar: 3.5.3 @@ -6664,22 +6619,22 @@ packages: default-gateway: 6.0.3 express: 4.18.1 graceful-fs: 4.2.10 - html-entities: 2.3.3 - http-proxy-middleware: 2.0.6(@types/express@4.17.17) - ipaddr.js: 2.0.1 - launch-editor: 2.6.0 + html-entities: 2.4.0 + http-proxy-middleware: 2.0.6(@types/express@4.17.21) + ipaddr.js: 2.1.0 + launch-editor: 2.6.1 open: 8.4.2 p-retry: 4.6.2 rimraf: 3.0.2 - schema-utils: 4.0.0 - selfsigned: 2.1.1 + schema-utils: 4.2.0 + selfsigned: 2.4.1 serve-index: 1.9.1 sockjs: 0.3.24 spdy: 4.0.2 webpack: 5.76.0(esbuild@0.19.5)(webpack-cli@4.10.0) webpack-cli: 4.10.0(webpack@5.89.0) webpack-dev-middleware: 5.3.3(webpack@5.76.0) - ws: 8.13.0 + ws: 8.14.2 transitivePeerDependencies: - bufferutil - debug @@ -6828,18 +6783,6 @@ packages: has-tostringtag: 1.0.0 dev: true - /which-typed-array@1.1.9: - resolution: {integrity: sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==} - engines: {node: '>= 0.4'} - dependencies: - available-typed-arrays: 1.0.5 - call-bind: 1.0.2 - for-each: 0.3.3 - gopd: 1.0.1 - has-tostringtag: 1.0.0 - is-typed-array: 1.1.10 - dev: true - /which@2.0.2: resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} engines: {node: '>= 8'} @@ -6900,8 +6843,8 @@ packages: optional: true dev: true - /ws@8.13.0: - resolution: {integrity: sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==} + /ws@8.14.2: + resolution: {integrity: sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==} engines: {node: '>=10.0.0'} peerDependencies: bufferutil: ^4.0.1 @@ -6987,15 +6930,15 @@ packages: engines: {node: '>=12.20'} dev: true - /zod-validation-error@1.2.0(zod@3.21.4): - resolution: {integrity: sha512-laJkD/ugwEh8CpuH+xXv5L9Z+RLz3lH8alNxolfaHZJck611OJj97R4Rb+ZqA7WNly2kNtTo4QwjdjXw9scpiw==} - engines: {node: ^14.17 || >=16.0.0} + /zod-validation-error@1.3.1(zod@3.22.4): + resolution: {integrity: sha512-cNEXpla+tREtNdAnNKY4xKY1SGOn2yzyuZMu4O0RQylX9apRpUjNcPkEc3uHIAr5Ct7LenjZt6RzjEH6+JsqVQ==} + engines: {node: '>=16.0.0'} peerDependencies: zod: ^3.18.0 dependencies: - zod: 3.21.4 + zod: 3.22.4 dev: true - /zod@3.21.4: - resolution: {integrity: sha512-m46AKbrzKVzOzs/DZgVnG5H55N1sv1M8qZU3A8RIKbs3mrACDNeIOeilDymVb2HdmP8uwshOCF4uJ8uM9rCqJw==} + /zod@3.22.4: + resolution: {integrity: sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==} dev: true diff --git a/src/rspack/index.ts b/src/rspack/index.ts index 0d211f1d..f84511af 100644 --- a/src/rspack/index.ts +++ b/src/rspack/index.ts @@ -1,7 +1,8 @@ import { resolve } from 'path' -import type { RspackPluginInstance, RuleSetUseItem } from '@rspack/core' -import { toArray } from '../utils' +import type { RspackPluginInstance } from '@rspack/core' +import { shouldLoad, toArray, transformUse } from '../utils' import type { + ResolvedUnpluginOptions, UnpluginContextMeta, UnpluginFactory, UnpluginInstance, @@ -10,20 +11,25 @@ import { createRspackContext } from './context' const TRANSFORM_LOADER = resolve( __dirname, - __DEV__ ? '../../dist/rspack/loaders/transform' : 'rspack/loaders/transform', + __DEV__ ? '../../dist/rspack/loaders/transform.js' : 'rspack/loaders/transform', ) const LOAD_LOADER = resolve( __dirname, - __DEV__ ? '../../dist/rspack/loaders/load' : 'rspack/loaders/load', + __DEV__ ? '../../dist/rspack/loaders/load.js' : 'rspack/loaders/load', ) +const VIRTUAL_MODULE_PREFIX = resolve(process.cwd(), '_virtual_') + export function getRspackPlugin>( factory: UnpluginFactory, ): UnpluginInstance['rspack'] { return (userOptions?: UserOptions): RspackPluginInstance => { return { apply(compiler) { + const injected = compiler.$unpluginContext || {} + compiler.$unpluginContext = injected + const meta: UnpluginContextMeta = { framework: 'rspack', rspack: { @@ -31,31 +37,51 @@ export function getRspackPlugin>( }, } const rawPlugins = toArray(factory(userOptions!, meta)) - for (const plugin of rawPlugins) { + for (const rawPlugin of rawPlugins) { + const plugin = Object.assign( + rawPlugin, + { + __unpluginMeta: meta, + __virtualModulePrefix: VIRTUAL_MODULE_PREFIX, + }, + ) as ResolvedUnpluginOptions + + // inject context object to share with loaders + injected[plugin.name] = plugin + + compiler.hooks.thisCompilation.tap(plugin.name, (compilation) => { + if (typeof compilation.hooks.childCompiler === 'undefined') + throw new Error('`compilation.hooks.childCompiler` only support by @rspack/core>=0.4.1') + compilation.hooks.childCompiler.tap(plugin.name, (childCompiler) => { + childCompiler.$unpluginContext = injected + }) + }) + + const externalModules = new Set() + // load hook if (plugin.load) { - const use: RuleSetUseItem = { - loader: LOAD_LOADER, - options: { plugin }, - } compiler.options.module.rules.unshift({ enforce: plugin.enforce, - include: /.*/, - use, + include(id) { + return shouldLoad(id, plugin, externalModules) + }, + use: [{ + loader: LOAD_LOADER, + options: { + unpluginName: plugin.name, + }, + }], }) } // transform hook if (plugin.transform) { - const use: RuleSetUseItem = { - loader: TRANSFORM_LOADER, - options: { plugin }, - } - compiler.options.module.rules.unshift({ enforce: plugin.enforce, - include: /.*/, - use, + use(data) { + return transformUse(data, plugin, TRANSFORM_LOADER) + }, }) } diff --git a/src/rspack/loaders/load.ts b/src/rspack/loaders/load.ts index 11066315..f4bd84cd 100644 --- a/src/rspack/loaders/load.ts +++ b/src/rspack/loaders/load.ts @@ -1,13 +1,13 @@ import type { LoaderContext } from '@rspack/core' -import type { UnpluginContext, UnpluginOptions } from '../../types' +import type { UnpluginContext } from '../../types' import { createRspackContext } from '../context' import { normalizeAbsolutePath } from '../../utils' export default async function load(this: LoaderContext, source: string, map: any) { const callback = this.async() - + const { unpluginName } = this.query as { unpluginName: string } + const plugin = this._compiler?.$unpluginContext[unpluginName] const id = this.resource - const { plugin } = this.getOptions() as { plugin: UnpluginOptions } if (!plugin?.load || !id) return callback(null, source, map) diff --git a/src/rspack/loaders/transform.ts b/src/rspack/loaders/transform.ts index 5f889237..7a2ad387 100644 --- a/src/rspack/loaders/transform.ts +++ b/src/rspack/loaders/transform.ts @@ -1,6 +1,6 @@ import type { LoaderContext } from '@rspack/core' import { createRspackContext } from '../context' -import type { UnpluginContext, UnpluginOptions } from '../../types' +import type { UnpluginContext } from '../../types' export default async function transform( this: LoaderContext, @@ -9,15 +9,21 @@ export default async function transform( ) { const callback = this.async() + let unpluginName: string + if (typeof this.query === 'string') { + const query = new URLSearchParams(this.query) + unpluginName = query.get('unpluginName')! + } + else { + unpluginName = (this.query as { unpluginName: string }).unpluginName + } + const id = this.resource - const { plugin } = this.getOptions() as { plugin: UnpluginOptions } + const plugin = this._compiler?.$unpluginContext[unpluginName] if (!plugin?.transform) return callback(null, source, map) - if (plugin.transformInclude && !plugin.transformInclude(id)) - return callback(null, source, map) - const context: UnpluginContext = { error: error => this.emitError(typeof error === 'string' ? new Error(error) : error), diff --git a/src/types.ts b/src/types.ts index 6d3a0621..54d72f13 100644 --- a/src/types.ts +++ b/src/types.ts @@ -132,3 +132,9 @@ declare module 'webpack' { $unpluginContext: Record } } + +declare module '@rspack/core' { + interface Compiler { + $unpluginContext: Record + } +} diff --git a/src/utils.ts b/src/utils.ts index f030bb0b..868e8ffc 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,4 +1,5 @@ import { isAbsolute, normalize } from 'path' +import type { ResolvedUnpluginOptions } from './types' /** * Normalizes a given path when it's absolute. Normalizing means returning a new path by converting @@ -33,3 +34,32 @@ export function toArray(array?: Nullable>): Array { return array return [array] } + +export function shouldLoad(id: string, plugin: ResolvedUnpluginOptions, externalModules: Set): boolean { + if (id.startsWith(plugin.__virtualModulePrefix)) + id = decodeURIComponent(id.slice(plugin.__virtualModulePrefix.length)) + + // load include filter + if (plugin.loadInclude && !plugin.loadInclude(id)) + return false + + // Don't run load hook for external modules + return !externalModules.has(id) +} + +export function transformUse( + data: { resource?: string; resourceQuery?: string }, + plugin: ResolvedUnpluginOptions, + transformLoader: string, +) { + if (data.resource == null) + return [] + + const id = normalizeAbsolutePath(data.resource + (data.resourceQuery || '')) + if (!plugin.transformInclude || plugin.transformInclude(id)) { + return [{ + loader: `${transformLoader}?unpluginName=${encodeURIComponent(plugin.name)}`, + }] + } + return [] +} diff --git a/src/webpack/index.ts b/src/webpack/index.ts index 5b8f98db..d4f6af0a 100644 --- a/src/webpack/index.ts +++ b/src/webpack/index.ts @@ -2,9 +2,9 @@ import fs from 'fs' import { resolve } from 'path' import process from 'process' import VirtualModulesPlugin from 'webpack-virtual-modules' -import type { ResolvePluginInstance, RuleSetUseItem } from 'webpack' +import type { ResolvePluginInstance } from 'webpack' import type { ResolvedUnpluginOptions, UnpluginContextMeta, UnpluginFactory, UnpluginInstance, WebpackCompiler } from '../types' -import { normalizeAbsolutePath, toArray } from '../utils' +import { normalizeAbsolutePath, shouldLoad, toArray, transformUse } from '../utils' import { createContext } from './context' const TRANSFORM_LOADER = resolve( @@ -136,15 +136,7 @@ export function getWebpackPlugin>( if (plugin.load) { compiler.options.module.rules.unshift({ include(id) { - if (id.startsWith(plugin.__virtualModulePrefix)) - id = decodeURIComponent(id.slice(plugin.__virtualModulePrefix.length)) - - // load include filter - if (plugin.loadInclude && !plugin.loadInclude(id)) - return false - - // Don't run load hook for external modules - return !externalModules.has(id) + return shouldLoad(id, plugin, externalModules) }, enforce: plugin.enforce, use: [{ @@ -158,21 +150,10 @@ export function getWebpackPlugin>( // transform hook if (plugin.transform) { - const useLoader: RuleSetUseItem[] = [{ - loader: `${TRANSFORM_LOADER}?unpluginName=${encodeURIComponent(plugin.name)}`, - }] - const useNone: RuleSetUseItem[] = [] compiler.options.module.rules.unshift({ enforce: plugin.enforce, - use: (data: { resource: string | null; resourceQuery: string }) => { - if (data.resource == null) - return useNone - - const id = normalizeAbsolutePath(data.resource + (data.resourceQuery || '')) - if (!plugin.transformInclude || plugin.transformInclude(id)) - return useLoader - - return useNone + use(data: { resource?: string; resourceQuery?: string }) { + return transformUse(data, plugin, TRANSFORM_LOADER) }, }) } diff --git a/test/unit-tests/id-consistency/id-consistency.test.ts b/test/unit-tests/id-consistency/id-consistency.test.ts index 05b4df77..50163fce 100644 --- a/test/unit-tests/id-consistency/id-consistency.test.ts +++ b/test/unit-tests/id-consistency/id-consistency.test.ts @@ -63,7 +63,7 @@ function checkHookCalls( }) } -describe('id parameter should be consistent accross hooks and plugins', () => { +describe('id parameter should be consistent across hooks and plugins', () => { afterEach(() => { vi.restoreAllMocks() })