diff --git a/client-src/index.ts b/client-src/index.ts index 41960a5..68d4286 100644 --- a/client-src/index.ts +++ b/client-src/index.ts @@ -9,10 +9,10 @@ */ // @ts-expect-error: No type definitions available for '@rspack/core/hot/emitter.js' -import hotEmitter from '@rspack/core/hot/emitter.js'; +import { emitter as hotEmitter } from '@rspack/core/hot/emitter.js'; /* Rspack dev server runtime client */ // @ts-expect-error: No type definitions available for '@rspack/core/hot/log.js' -import webpackHotLog from '@rspack/core/hot/log.js'; +import { log as webpackHotLog } from '@rspack/core/hot/log.js'; import { createOverlay, formatProblem } from './overlay.js'; import socket from './socket.js'; import { defineProgressElement, isProgressSupported } from './progress.js'; diff --git a/package.json b/package.json index b2b0008..b70bb68 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "devDependencies": { "@biomejs/biome": "^1.8.3", "@hono/node-server": "^1.13.3", - "@rspack/core": "1.7.1", + "@rspack/core": "2.0.0-beta.2", "@rspack/plugin-react-refresh": "1.0.0", "@rstest/core": "^0.8.5", "@types/compression": "^1.7.2", @@ -92,7 +92,7 @@ "style-loader": "^4.0.0", "supertest": "^6.1.3", "tcp-port-used": "^1.0.2", - "typescript": "5.0.2", + "typescript": "^5.9.3", "wait-for-expect": "^3.0.2", "webpack": "^5.94.0", "webpack-dev-middleware": "^7.4.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8436080..e64cc36 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -100,8 +100,8 @@ importers: specifier: ^1.13.3 version: 1.13.8(hono@4.10.3) '@rspack/core': - specifier: 1.7.1 - version: 1.7.1(@swc/helpers@0.5.18) + specifier: 2.0.0-beta.2 + version: 2.0.0-beta.2(@swc/helpers@0.5.18) '@rspack/plugin-react-refresh': specifier: 1.0.0 version: 1.0.0(react-refresh@0.14.0) @@ -137,7 +137,7 @@ importers: version: 7.0.3 css-loader: specifier: ^7.1.2 - version: 7.1.2(@rspack/core@1.7.1(@swc/helpers@0.5.18))(webpack@5.94.0) + version: 7.1.2(@rspack/core@2.0.0-beta.2(@swc/helpers@0.5.18))(webpack@5.94.0) hono: specifier: ^4.6.8 version: 4.10.3 @@ -152,7 +152,7 @@ importers: version: 3.2.5 puppeteer: specifier: ^24.34.0 - version: 24.34.0(typescript@5.0.2) + version: 24.34.0(typescript@5.9.3) react-refresh: specifier: 0.14.0 version: 0.14.0 @@ -175,8 +175,8 @@ importers: specifier: ^1.0.2 version: 1.0.2 typescript: - specifier: 5.0.2 - version: 5.0.2 + specifier: ^5.9.3 + version: 5.9.3 wait-for-expect: specifier: ^3.0.2 version: 3.0.2 @@ -342,19 +342,14 @@ packages: engines: {node: '>=18.12.0'} hasBin: true - '@rspack/binding-darwin-arm64@1.7.1': - resolution: {integrity: sha512-3C0w0kfCHfgOH+AP/Dx1bm/b3AR/or5CmU22Abevek0m95ndU3iT902eLcm9JNiMQnDQLBQbolfj5P591t0oPg==} - cpu: [arm64] - os: [darwin] - '@rspack/binding-darwin-arm64@1.7.6': resolution: {integrity: sha512-NZ9AWtB1COLUX1tA9HQQvWpTy07NSFfKBU8A6ylWd5KH8AePZztpNgLLAVPTuNO4CZXYpwcoclf8jG/luJcQdQ==} cpu: [arm64] os: [darwin] - '@rspack/binding-darwin-x64@1.7.1': - resolution: {integrity: sha512-HTrBpdw2gWwcpJ3c8h4JF8B1YRNvrFT+K620ycttrlu/HvI4/U770BBJ/ej36R/hdh59JvMCGe+w49FyXv6rzg==} - cpu: [x64] + '@rspack/binding-darwin-arm64@2.0.0-beta.2': + resolution: {integrity: sha512-foDz1asp37tHhjhiqh7CfyBc7jRpK0y4mfyJtpL25SsXwI21Lm/NgjD1XKofFrHu849WEXBkV6vpCpkGXxT7zQ==} + cpu: [arm64] os: [darwin] '@rspack/binding-darwin-x64@1.7.6': @@ -362,18 +357,18 @@ packages: cpu: [x64] os: [darwin] - '@rspack/binding-linux-arm64-gnu@1.7.1': - resolution: {integrity: sha512-BX9yAPCO0WBFyOzKl9bSXT/cH27nnOJp02smIQMxfv7RNfwGkJg5GgakYcuYG+9U1HEFitBSzmwS2+dxDcAxlg==} - cpu: [arm64] - os: [linux] + '@rspack/binding-darwin-x64@2.0.0-beta.2': + resolution: {integrity: sha512-kTB066qqIqbhzrYRy4vTEnREAh6+Dev8L5haHG7pybnq8KoLJGwzOMNi6oKQdWthGrH20klV644/Wu0uraAscQ==} + cpu: [x64] + os: [darwin] '@rspack/binding-linux-arm64-gnu@1.7.6': resolution: {integrity: sha512-eQfcsaxhFrv5FmtaA7+O1F9/2yFDNIoPZzV/ZvqvFz5bBXVc4FAm/1fVpBg8Po/kX1h0chBc7Xkpry3cabFW8w==} cpu: [arm64] os: [linux] - '@rspack/binding-linux-arm64-musl@1.7.1': - resolution: {integrity: sha512-maBX19XyiVkxzh/NA79ALetCobc4zUyoWkWLeCGyW5xKzhPVFatJp+qCiHqHkqUZcgRo+1i5ihoZ2bXmelIeZg==} + '@rspack/binding-linux-arm64-gnu@2.0.0-beta.2': + resolution: {integrity: sha512-kIXEDznt/r0Fyy7ZnFFiv2YfxxlXr+YMlvHELwW5sqHsdgk3wS7jhNF6J2m/aTXT2/K58qSY63BibBX1B+s7pA==} cpu: [arm64] os: [linux] @@ -382,9 +377,9 @@ packages: cpu: [arm64] os: [linux] - '@rspack/binding-linux-x64-gnu@1.7.1': - resolution: {integrity: sha512-8KJAeBLiWcN7zEc9aaS7LRJPZVtZuQU8mCsn+fRhdQDSc+a9FcTN8b6Lw29z8cejwbU6Gxr/8wk5XGexMWFaZA==} - cpu: [x64] + '@rspack/binding-linux-arm64-musl@2.0.0-beta.2': + resolution: {integrity: sha512-FpLD3SmI7P/By7jECqjfMuDU+YTLKMaQX9P6B0MuN/zwXJ8SFQ1TV7W478a64NuezytOhmbO4lkuF7XqZHe/Bg==} + cpu: [arm64] os: [linux] '@rspack/binding-linux-x64-gnu@1.7.6': @@ -392,8 +387,8 @@ packages: cpu: [x64] os: [linux] - '@rspack/binding-linux-x64-musl@1.7.1': - resolution: {integrity: sha512-Gn9x5vhKRELvSoZ3ZjquY8eWtCXur0OsYnZ2/ump8mofM6IDaL7Qqu3Hf4Kud31PDH0tfz0jWf9piX32HHPmgg==} + '@rspack/binding-linux-x64-gnu@2.0.0-beta.2': + resolution: {integrity: sha512-MAS5P8c0sUQ6I6JvvGcyF4sOhsdb7G6+3BSdoERdACDrqTqtSVT6Txil8rKGrNdR/eVG/2jl/tFLWUKtyEn50A==} cpu: [x64] os: [linux] @@ -402,27 +397,27 @@ packages: cpu: [x64] os: [linux] - '@rspack/binding-wasm32-wasi@1.7.1': - resolution: {integrity: sha512-2r9M5iVchmsFkp3sz7A5YnMm2TfpkB71LK3AoaRWKMfvf5oFky0GSGISYd2TCBASO+X2Qskaq+B24Szo8zH5FA==} - cpu: [wasm32] + '@rspack/binding-linux-x64-musl@2.0.0-beta.2': + resolution: {integrity: sha512-NNJ4ah2B2HbjH+hnFX5HC8JPN5VbrV3A4CL/v5o9Elm01UxF3zeQr1gBc02MH6vdBo4rM0yrrH1b8lgC/z8r4w==} + cpu: [x64] + os: [linux] '@rspack/binding-wasm32-wasi@1.7.6': resolution: {integrity: sha512-YupOrz0daSG+YBbCIgpDgzfMM38YpChv+afZpaxx5Ml7xPeAZIIdgWmLHnQ2rts73N2M1NspAiBwV00Xx0N4Vg==} cpu: [wasm32] - '@rspack/binding-win32-arm64-msvc@1.7.1': - resolution: {integrity: sha512-/WIHp982yqqqAuiz2WLtf1ofo9d1lHDGZJ7flxFllb1iMgnUeSRyX6stxEi11K3Rg6pQa7FdCZGKX/engyj2bw==} - cpu: [arm64] - os: [win32] + '@rspack/binding-wasm32-wasi@2.0.0-beta.2': + resolution: {integrity: sha512-rn2phtFxeDN+Wbf8JEZT2d731Vzl4wFRapW5rGS8wxLaz8PkR6o+5VbB8fBy+OWti7uEFxXEsrB7Hv0aVks/uw==} + cpu: [wasm32] '@rspack/binding-win32-arm64-msvc@1.7.6': resolution: {integrity: sha512-INj7aVXjBvlZ84kEhSK4kJ484ub0i+BzgnjDWOWM1K+eFYDZjLdAsQSS3fGGXwVc3qKbPIssFfnftATDMTEJHQ==} cpu: [arm64] os: [win32] - '@rspack/binding-win32-ia32-msvc@1.7.1': - resolution: {integrity: sha512-Kpela29n+kDGGsss6q/3qTd6n9VW7TOQaiA7t1YLdCCl8qqcdKlz/vWjFMd2MqgcSGC/16PvChE4sgpUvryfCQ==} - cpu: [ia32] + '@rspack/binding-win32-arm64-msvc@2.0.0-beta.2': + resolution: {integrity: sha512-1m6Vt5kNGQXJBj5lxR9ztQCZz1O6ydO5dDw1fNOXSNidK7BD4iqes9odRNkaC8gual6NybfaI6mIdC/iM+6xWA==} + cpu: [arm64] os: [win32] '@rspack/binding-win32-ia32-msvc@1.7.6': @@ -430,9 +425,9 @@ packages: cpu: [ia32] os: [win32] - '@rspack/binding-win32-x64-msvc@1.7.1': - resolution: {integrity: sha512-B/y4MWqP2Xeto1/HV0qtZNOMPSLrEVOqi2b7JSIXG/bhlf+3IAkDzEEoHs+ZikLR4C8hMaS0pVJsDGKFmGzC9A==} - cpu: [x64] + '@rspack/binding-win32-ia32-msvc@2.0.0-beta.2': + resolution: {integrity: sha512-EtUwWTP27wEv5C52ZiinA6AXtQkKQJZhML9cHbTwdeZjtD1EYpqpgfL9SF/FsTgwXG1Qiz02NjccvP5HdLlthg==} + cpu: [ia32] os: [win32] '@rspack/binding-win32-x64-msvc@1.7.6': @@ -440,14 +435,19 @@ packages: cpu: [x64] os: [win32] - '@rspack/binding@1.7.1': - resolution: {integrity: sha512-qVTV1/UWpMSZktvK5A8+HolgR1Qf0nYR3Gg4Vax5x3/BcHDpwGZ0fbdFRUirGVWH/XwxZ81zoI6F2SZq7xbX+w==} + '@rspack/binding-win32-x64-msvc@2.0.0-beta.2': + resolution: {integrity: sha512-CPQDH64D+xz8v1jdv5+0PIIHZ15NJLm8xN8ThlEgWARAJjt+1NXLq8rtuk86j4oxmaVFPle6qmq6QSwAP5PVCQ==} + cpu: [x64] + os: [win32] '@rspack/binding@1.7.6': resolution: {integrity: sha512-/NrEcfo8Gx22hLGysanrV6gHMuqZSxToSci/3M4kzEQtF5cPjfOv5pqeLK/+B6cr56ul/OmE96cCdWcXeVnFjQ==} - '@rspack/core@1.7.1': - resolution: {integrity: sha512-kRxfY8RRa6nU3/viDvAIP6CRpx+0rfXFRonPL0pHBx8u6HhV7m9rLEyaN6MWsLgNIAWkleFGb7tdo4ux2ljRJQ==} + '@rspack/binding@2.0.0-beta.2': + resolution: {integrity: sha512-02V7uH82c9CqPifH9k4r10DM0gQyaW9aUUOCqwQdV8bjhdP+cta7qbz2iGOWGcJiprQqme635gVmfhsY26Sv0Q==} + + '@rspack/core@1.7.6': + resolution: {integrity: sha512-Iax6UhrfZqJajA778c1d5DBFbSIqPOSrI34kpNIiNpWd8Jq7mFIa+Z60SQb5ZQDZuUxcCZikjz5BxinFjTkg7Q==} engines: {node: '>=18.12.0'} peerDependencies: '@swc/helpers': '>=0.5.1' @@ -455,12 +455,15 @@ packages: '@swc/helpers': optional: true - '@rspack/core@1.7.6': - resolution: {integrity: sha512-Iax6UhrfZqJajA778c1d5DBFbSIqPOSrI34kpNIiNpWd8Jq7mFIa+Z60SQb5ZQDZuUxcCZikjz5BxinFjTkg7Q==} - engines: {node: '>=18.12.0'} + '@rspack/core@2.0.0-beta.2': + resolution: {integrity: sha512-UD/LxAi9BCYGWKUMW82gwqYxWF46P5+P2jVSHC3rpv6IJ2EdPfRL1wqxbMGbkslD3YTB56vM18uwo1d5ThqrjA==} + engines: {node: ^20.19.0 || >=22.12.0} peerDependencies: + '@module-federation/runtime-tools': ^0.24.1 || ^2.0.0 '@swc/helpers': '>=0.5.1' peerDependenciesMeta: + '@module-federation/runtime-tools': + optional: true '@swc/helpers': optional: true @@ -2110,9 +2113,9 @@ packages: typed-query-selector@2.12.0: resolution: {integrity: sha512-SbklCd1F0EiZOyPiW192rrHZzZ5sBijB6xM+cpmrwDqObvdtunOHHIk9fCGsoK5JVIYXoyEp4iEdE3upFH3PAg==} - typescript@5.0.2: - resolution: {integrity: sha512-wVORMBGO/FAs/++blGNeAVdbNKtIh1rbBL2EyQ1+J9lClJ93KiiKe8PmFIVdXhHcyv44SL9oglmfeSsndo0jRw==} - engines: {node: '>=12.20'} + typescript@5.9.3: + resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==} + engines: {node: '>=14.17'} hasBin: true undici-types@7.16.0: @@ -2423,45 +2426,40 @@ snapshots: core-js: 3.47.0 jiti: 2.6.1 - '@rspack/binding-darwin-arm64@1.7.1': - optional: true - '@rspack/binding-darwin-arm64@1.7.6': optional: true - '@rspack/binding-darwin-x64@1.7.1': + '@rspack/binding-darwin-arm64@2.0.0-beta.2': optional: true '@rspack/binding-darwin-x64@1.7.6': optional: true - '@rspack/binding-linux-arm64-gnu@1.7.1': + '@rspack/binding-darwin-x64@2.0.0-beta.2': optional: true '@rspack/binding-linux-arm64-gnu@1.7.6': optional: true - '@rspack/binding-linux-arm64-musl@1.7.1': + '@rspack/binding-linux-arm64-gnu@2.0.0-beta.2': optional: true '@rspack/binding-linux-arm64-musl@1.7.6': optional: true - '@rspack/binding-linux-x64-gnu@1.7.1': + '@rspack/binding-linux-arm64-musl@2.0.0-beta.2': optional: true '@rspack/binding-linux-x64-gnu@1.7.6': optional: true - '@rspack/binding-linux-x64-musl@1.7.1': + '@rspack/binding-linux-x64-gnu@2.0.0-beta.2': optional: true '@rspack/binding-linux-x64-musl@1.7.6': optional: true - '@rspack/binding-wasm32-wasi@1.7.1': - dependencies: - '@napi-rs/wasm-runtime': 1.0.7 + '@rspack/binding-linux-x64-musl@2.0.0-beta.2': optional: true '@rspack/binding-wasm32-wasi@1.7.6': @@ -2469,36 +2467,28 @@ snapshots: '@napi-rs/wasm-runtime': 1.0.7 optional: true - '@rspack/binding-win32-arm64-msvc@1.7.1': + '@rspack/binding-wasm32-wasi@2.0.0-beta.2': + dependencies: + '@napi-rs/wasm-runtime': 1.0.7 optional: true '@rspack/binding-win32-arm64-msvc@1.7.6': optional: true - '@rspack/binding-win32-ia32-msvc@1.7.1': + '@rspack/binding-win32-arm64-msvc@2.0.0-beta.2': optional: true '@rspack/binding-win32-ia32-msvc@1.7.6': optional: true - '@rspack/binding-win32-x64-msvc@1.7.1': + '@rspack/binding-win32-ia32-msvc@2.0.0-beta.2': optional: true '@rspack/binding-win32-x64-msvc@1.7.6': optional: true - '@rspack/binding@1.7.1': - optionalDependencies: - '@rspack/binding-darwin-arm64': 1.7.1 - '@rspack/binding-darwin-x64': 1.7.1 - '@rspack/binding-linux-arm64-gnu': 1.7.1 - '@rspack/binding-linux-arm64-musl': 1.7.1 - '@rspack/binding-linux-x64-gnu': 1.7.1 - '@rspack/binding-linux-x64-musl': 1.7.1 - '@rspack/binding-wasm32-wasi': 1.7.1 - '@rspack/binding-win32-arm64-msvc': 1.7.1 - '@rspack/binding-win32-ia32-msvc': 1.7.1 - '@rspack/binding-win32-x64-msvc': 1.7.1 + '@rspack/binding-win32-x64-msvc@2.0.0-beta.2': + optional: true '@rspack/binding@1.7.6': optionalDependencies: @@ -2513,13 +2503,18 @@ snapshots: '@rspack/binding-win32-ia32-msvc': 1.7.6 '@rspack/binding-win32-x64-msvc': 1.7.6 - '@rspack/core@1.7.1(@swc/helpers@0.5.18)': - dependencies: - '@module-federation/runtime-tools': 0.22.0 - '@rspack/binding': 1.7.1 - '@rspack/lite-tapable': 1.1.0 + '@rspack/binding@2.0.0-beta.2': optionalDependencies: - '@swc/helpers': 0.5.18 + '@rspack/binding-darwin-arm64': 2.0.0-beta.2 + '@rspack/binding-darwin-x64': 2.0.0-beta.2 + '@rspack/binding-linux-arm64-gnu': 2.0.0-beta.2 + '@rspack/binding-linux-arm64-musl': 2.0.0-beta.2 + '@rspack/binding-linux-x64-gnu': 2.0.0-beta.2 + '@rspack/binding-linux-x64-musl': 2.0.0-beta.2 + '@rspack/binding-wasm32-wasi': 2.0.0-beta.2 + '@rspack/binding-win32-arm64-msvc': 2.0.0-beta.2 + '@rspack/binding-win32-ia32-msvc': 2.0.0-beta.2 + '@rspack/binding-win32-x64-msvc': 2.0.0-beta.2 '@rspack/core@1.7.6(@swc/helpers@0.5.18)': dependencies: @@ -2529,6 +2524,12 @@ snapshots: optionalDependencies: '@swc/helpers': 0.5.18 + '@rspack/core@2.0.0-beta.2(@swc/helpers@0.5.18)': + dependencies: + '@rspack/binding': 2.0.0-beta.2 + optionalDependencies: + '@swc/helpers': 0.5.18 + '@rspack/lite-tapable@1.1.0': {} '@rspack/plugin-react-refresh@1.0.0(react-refresh@0.14.0)': @@ -3029,14 +3030,14 @@ snapshots: core-util-is@1.0.3: {} - cosmiconfig@9.0.0(typescript@5.0.2): + cosmiconfig@9.0.0(typescript@5.9.3): dependencies: env-paths: 2.2.1 import-fresh: 3.3.0 js-yaml: 4.1.0 parse-json: 5.2.0 optionalDependencies: - typescript: 5.0.2 + typescript: 5.9.3 cross-env@7.0.3: dependencies: @@ -3048,7 +3049,7 @@ snapshots: shebang-command: 2.0.0 which: 2.0.2 - css-loader@7.1.2(@rspack/core@1.7.1(@swc/helpers@0.5.18))(webpack@5.94.0): + css-loader@7.1.2(@rspack/core@2.0.0-beta.2(@swc/helpers@0.5.18))(webpack@5.94.0): dependencies: icss-utils: 5.1.0(postcss@8.4.47) postcss: 8.4.47 @@ -3059,7 +3060,7 @@ snapshots: postcss-value-parser: 4.2.0 semver: 7.6.3 optionalDependencies: - '@rspack/core': 1.7.1(@swc/helpers@0.5.18) + '@rspack/core': 2.0.0-beta.2(@swc/helpers@0.5.18) webpack: 5.94.0 cssesc@3.0.0: {} @@ -3843,11 +3844,11 @@ snapshots: - supports-color - utf-8-validate - puppeteer@24.34.0(typescript@5.0.2): + puppeteer@24.34.0(typescript@5.9.3): dependencies: '@puppeteer/browsers': 2.11.0 chromium-bidi: 12.0.1(devtools-protocol@0.0.1534754) - cosmiconfig: 9.0.0(typescript@5.0.2) + cosmiconfig: 9.0.0(typescript@5.9.3) devtools-protocol: 0.0.1534754 puppeteer-core: 24.34.0 typed-query-selector: 2.12.0 @@ -4268,7 +4269,7 @@ snapshots: typed-query-selector@2.12.0: {} - typescript@5.0.2: {} + typescript@5.9.3: {} undici-types@7.16.0: {} diff --git a/src/server.ts b/src/server.ts index bf2f129..56b3dfd 100644 --- a/src/server.ts +++ b/src/server.ts @@ -965,7 +965,6 @@ class Server< } }; - // @ts-expect-error too complex serverOptions[property] = ( Array.isArray(value) ? value.map((item) => readFile(item as string)) diff --git a/tsconfig.client.json b/tsconfig.client.json index 58d70f4..f1ed1fe 100644 --- a/tsconfig.client.json +++ b/tsconfig.client.json @@ -2,6 +2,7 @@ "extends": "./tsconfig.json", "compilerOptions": { "module": "ES2020", + "moduleResolution": "bundler", "target": "ES5", "outDir": "client", "rootDir": "client-src", diff --git a/tsconfig.json b/tsconfig.json index 9480542..509464d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -18,8 +18,5 @@ "outDir": "dist", "rootDir": "src" }, - "ts-node": { - "transpileOnly": true - }, "include": ["src/**/*", "src/options.json"] }