diff --git a/package.json b/package.json index e90381c..004032e 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ }, "peerDependencies": { "@swc/core": "^1.0.0", - "vite": "^5.0.0 || ^6.0.0 || ^7.0.0" + "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" }, "peerDependenciesMeta": { "@swc/core": { @@ -89,7 +89,7 @@ "tslib": "^2.8.1", "typescript": "^5.9.3", "typescript-eslint": "^8.57.2", - "vite": "^7.1.10" + "vite": "^8.0.3" }, "dependencies": { "@babel/core": "^7.29.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 948b547..b2488f6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -88,8 +88,8 @@ importers: specifier: ^8.57.2 version: 8.57.2(eslint@10.1.0)(typescript@5.9.3) vite: - specifier: ^7.1.10 - version: 7.1.10(@types/node@22.19.15)(yaml@2.8.3) + specifier: ^8.0.3 + version: 8.0.3(@emnapi/core@1.9.1)(@emnapi/runtime@1.9.1)(@types/node@22.19.15)(esbuild@0.25.11)(yaml@2.8.3) packages: @@ -183,6 +183,15 @@ packages: resolution: {integrity: sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==} engines: {node: '>=6.9.0'} + '@emnapi/core@1.9.1': + resolution: {integrity: sha512-mukuNALVsoix/w1BJwFzwXBN/dHeejQtuVzcDsfOEsdpCumXb/E9j8w11h5S54tT1xhifGfbbSm/ICrObRb3KA==} + + '@emnapi/runtime@1.9.1': + resolution: {integrity: sha512-VYi5+ZVLhpgK4hQ0TAjiQiZ6ol0oe4mBx7mVv7IflsiEp0OWoVsp/+f9Vc1hOhE0TtkORVrI1GvzyreqpgWtkA==} + + '@emnapi/wasi-threads@1.2.0': + resolution: {integrity: sha512-N10dEJNSsUx41Z6pZsXU8FjPjpBEplgH24sfkmITrBED1/U2Esum9F3lfLrMjKHHjmi557zQn7kR9R+XWXu5Rg==} + '@esbuild/aix-ppc64@0.25.11': resolution: {integrity: sha512-Xt1dOL13m8u0WE8iplx9Ibbm+hFAO0GsU2P34UNoDGvZYkY8ifSiy6Zuc1lYxfG7svWE2fzqCUmFp5HCn51gJg==} engines: {node: '>=18'} @@ -410,10 +419,111 @@ packages: '@jridgewell/trace-mapping@0.3.31': resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==} + '@napi-rs/wasm-runtime@1.1.2': + resolution: {integrity: sha512-sNXv5oLJ7ob93xkZ1XnxisYhGYXfaG9f65/ZgYuAu3qt7b3NadcOEhLvx28hv31PgX8SZJRYrAIPQilQmFpLVw==} + peerDependencies: + '@emnapi/core': ^1.7.1 + '@emnapi/runtime': ^1.7.1 + + '@oxc-project/types@0.122.0': + resolution: {integrity: sha512-oLAl5kBpV4w69UtFZ9xqcmTi+GENWOcPF7FCrczTiBbmC0ibXxCwyvZGbO39rCVEuLGAZM84DH0pUIyyv/YJzA==} + '@pkgr/core@0.2.9': resolution: {integrity: sha512-QNqXyfVS2wm9hweSYD2O7F0G06uurj9kZ96TRQE5Y9hU7+tgdZwIkbAKc5Ocy1HxEY2kuDQa6cQ1WRs/O5LFKA==} engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} + '@rolldown/binding-android-arm64@1.0.0-rc.12': + resolution: {integrity: sha512-pv1y2Fv0JybcykuiiD3qBOBdz6RteYojRFY1d+b95WVuzx211CRh+ytI/+9iVyWQ6koTh5dawe4S/yRfOFjgaA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@rolldown/binding-darwin-arm64@1.0.0-rc.12': + resolution: {integrity: sha512-cFYr6zTG/3PXXF3pUO+umXxt1wkRK/0AYT8lDwuqvRC+LuKYWSAQAQZjCWDQpAH172ZV6ieYrNnFzVVcnSflAg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [darwin] + + '@rolldown/binding-darwin-x64@1.0.0-rc.12': + resolution: {integrity: sha512-ZCsYknnHzeXYps0lGBz8JrF37GpE9bFVefrlmDrAQhOEi4IOIlcoU1+FwHEtyXGx2VkYAvhu7dyBf75EJQffBw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [darwin] + + '@rolldown/binding-freebsd-x64@1.0.0-rc.12': + resolution: {integrity: sha512-dMLeprcVsyJsKolRXyoTH3NL6qtsT0Y2xeuEA8WQJquWFXkEC4bcu1rLZZSnZRMtAqwtrF/Ib9Ddtpa/Gkge9Q==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@rolldown/binding-linux-arm-gnueabihf@1.0.0-rc.12': + resolution: {integrity: sha512-YqWjAgGC/9M1lz3GR1r1rP79nMgo3mQiiA+Hfo+pvKFK1fAJ1bCi0ZQVh8noOqNacuY1qIcfyVfP6HoyBRZ85Q==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@rolldown/binding-linux-arm64-gnu@1.0.0-rc.12': + resolution: {integrity: sha512-/I5AS4cIroLpslsmzXfwbe5OmWvSsrFuEw3mwvbQ1kDxJ822hFHIx+vsN/TAzNVyepI/j/GSzrtCIwQPeKCLIg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + + '@rolldown/binding-linux-arm64-musl@1.0.0-rc.12': + resolution: {integrity: sha512-V6/wZztnBqlx5hJQqNWwFdxIKN0m38p8Jas+VoSfgH54HSj9tKTt1dZvG6JRHcjh6D7TvrJPWFGaY9UBVOaWPw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + + '@rolldown/binding-linux-ppc64-gnu@1.0.0-rc.12': + resolution: {integrity: sha512-AP3E9BpcUYliZCxa3w5Kwj9OtEVDYK6sVoUzy4vTOJsjPOgdaJZKFmN4oOlX0Wp0RPV2ETfmIra9x1xuayFB7g==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ppc64] + os: [linux] + + '@rolldown/binding-linux-s390x-gnu@1.0.0-rc.12': + resolution: {integrity: sha512-nWwpvUSPkoFmZo0kQazZYOrT7J5DGOJ/+QHHzjvNlooDZED8oH82Yg67HvehPPLAg5fUff7TfWFHQS8IV1n3og==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [s390x] + os: [linux] + + '@rolldown/binding-linux-x64-gnu@1.0.0-rc.12': + resolution: {integrity: sha512-RNrafz5bcwRy+O9e6P8Z/OCAJW/A+qtBczIqVYwTs14pf4iV1/+eKEjdOUta93q2TsT/FI0XYDP3TCky38LMAg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + + '@rolldown/binding-linux-x64-musl@1.0.0-rc.12': + resolution: {integrity: sha512-Jpw/0iwoKWx3LJ2rc1yjFrj+T7iHZn2JDg1Yny1ma0luviFS4mhAIcd1LFNxK3EYu3DHWCps0ydXQ5i/rrJ2ig==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + + '@rolldown/binding-openharmony-arm64@1.0.0-rc.12': + resolution: {integrity: sha512-vRugONE4yMfVn0+7lUKdKvN4D5YusEiPilaoO2sgUWpCvrncvWgPMzK00ZFFJuiPgLwgFNP5eSiUlv2tfc+lpA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@rolldown/binding-wasm32-wasi@1.0.0-rc.12': + resolution: {integrity: sha512-ykGiLr/6kkiHc0XnBfmFJuCjr5ZYKKofkx+chJWDjitX+KsJuAmrzWhwyOMSHzPhzOHOy7u9HlFoa5MoAOJ/Zg==} + engines: {node: '>=14.0.0'} + cpu: [wasm32] + + '@rolldown/binding-win32-arm64-msvc@1.0.0-rc.12': + resolution: {integrity: sha512-5eOND4duWkwx1AzCxadcOrNeighiLwMInEADT0YM7xeEOOFcovWZCq8dadXgcRHSf3Ulh1kFo/qvzoFiCLOL1Q==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [win32] + + '@rolldown/binding-win32-x64-msvc@1.0.0-rc.12': + resolution: {integrity: sha512-PyqoipaswDLAZtot351MLhrlrh6lcZPo2LSYE+VDxbVk24LVKAGOuE4hb8xZQmrPAuEtTZW8E6D2zc5EUZX4Lw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [win32] + + '@rolldown/pluginutils@1.0.0-rc.12': + resolution: {integrity: sha512-HHMwmarRKvoFsJorqYlFeFRzXZqCt2ETQlEDOb9aqssrnVBB1/+xgTGtuTrIk5vzLNX1MjMtTf7W9z3tsSbrxw==} + '@rollup/plugin-json@6.1.0': resolution: {integrity: sha512-EGI2te5ENk1coGeADSIwZ7G2Q8CJS2sF120T7jLw4xFw9n7wIOXHo+kIYRAoVpJAN+kmqZSoO3Fp4JtoNF4ReA==} engines: {node: '>=14.0.0'} @@ -666,6 +776,9 @@ packages: '@swc/types@0.1.25': resolution: {integrity: sha512-iAoY/qRhNH8a/hBvm3zKj9qQ4oc2+3w1unPJa2XvTK3XjeLXtzcCingVPw/9e5mn1+0yPqxcBGp9Jf0pkfMb1g==} + '@tybys/wasm-util@0.10.1': + resolution: {integrity: sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==} + '@types/babel__core@7.20.5': resolution: {integrity: sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==} @@ -840,6 +953,10 @@ packages: resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} engines: {node: '>=0.10.0'} + detect-libc@2.1.2: + resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==} + engines: {node: '>=8'} + electron-to-chromium@1.5.328: resolution: {integrity: sha512-QNQ5l45DzYytThO21403XN3FvK0hOkWDG8viNf6jqS42msJ8I4tGDSpBCgvDRRPnkffafiwAym2X2eHeGD2V0w==} @@ -1058,6 +1175,76 @@ packages: resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} engines: {node: '>= 0.8.0'} + lightningcss-android-arm64@1.32.0: + resolution: {integrity: sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [android] + + lightningcss-darwin-arm64@1.32.0: + resolution: {integrity: sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [darwin] + + lightningcss-darwin-x64@1.32.0: + resolution: {integrity: sha512-U+QsBp2m/s2wqpUYT/6wnlagdZbtZdndSmut/NJqlCcMLTWp5muCrID+K5UJ6jqD2BFshejCYXniPDbNh73V8w==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [darwin] + + lightningcss-freebsd-x64@1.32.0: + resolution: {integrity: sha512-JCTigedEksZk3tHTTthnMdVfGf61Fky8Ji2E4YjUTEQX14xiy/lTzXnu1vwiZe3bYe0q+SpsSH/CTeDXK6WHig==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [freebsd] + + lightningcss-linux-arm-gnueabihf@1.32.0: + resolution: {integrity: sha512-x6rnnpRa2GL0zQOkt6rts3YDPzduLpWvwAF6EMhXFVZXD4tPrBkEFqzGowzCsIWsPjqSK+tyNEODUBXeeVHSkw==} + engines: {node: '>= 12.0.0'} + cpu: [arm] + os: [linux] + + lightningcss-linux-arm64-gnu@1.32.0: + resolution: {integrity: sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [linux] + + lightningcss-linux-arm64-musl@1.32.0: + resolution: {integrity: sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [linux] + + lightningcss-linux-x64-gnu@1.32.0: + resolution: {integrity: sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [linux] + + lightningcss-linux-x64-musl@1.32.0: + resolution: {integrity: sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [linux] + + lightningcss-win32-arm64-msvc@1.32.0: + resolution: {integrity: sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [win32] + + lightningcss-win32-x64-msvc@1.32.0: + resolution: {integrity: sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [win32] + + lightningcss@1.32.0: + resolution: {integrity: sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ==} + engines: {node: '>= 12.0.0'} + lint-staged@16.4.0: resolution: {integrity: sha512-lBWt8hujh/Cjysw5GYVmZpFHXDCgZzhrOm8vbcUdobADZNOK/bRshr2kM3DfgrrtR1DQhfupW9gnIXOfiFi+bw==} engines: {node: '>=20.17'} @@ -1141,8 +1328,8 @@ packages: resolution: {integrity: sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==} engines: {node: '>=12'} - postcss@8.5.6: - resolution: {integrity: sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==} + postcss@8.5.8: + resolution: {integrity: sha512-OW/rX8O/jXnm82Ey1k44pObPtdblfiuWnrd8X7GJ7emImCOstunGbXUpp7HdBrFQX6rJzn3sPT397Wp5aCwCHg==} engines: {node: ^10 || ^12 || >=14} prelude-ls@1.2.1: @@ -1174,6 +1361,11 @@ packages: rfdc@1.4.1: resolution: {integrity: sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==} + rolldown@1.0.0-rc.12: + resolution: {integrity: sha512-yP4USLIMYrwpPHEFB5JGH1uxhcslv6/hL0OyvTuY+3qlOSJvZ7ntYnoWpehBxufkgN0cvXxppuTu5hHa/zPh+A==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + rollup-plugin-dts@6.4.1: resolution: {integrity: sha512-l//F3Zf7ID5GoOfLfD8kroBjQKEKpy1qfhtAdnpibFZMffPaylrg1CoDC2vGkPeTeyxUe4bVFCln2EFuL7IGGg==} engines: {node: '>=20'} @@ -1297,15 +1489,16 @@ packages: uri-js@4.4.1: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} - vite@7.1.10: - resolution: {integrity: sha512-CmuvUBzVJ/e3HGxhg6cYk88NGgTnBoOo7ogtfJJ0fefUWAxN/WDSUa50o+oVBxuIhO8FoEZW0j2eW7sfjs5EtA==} + vite@8.0.3: + resolution: {integrity: sha512-B9ifbFudT1TFhfltfaIPgjo9Z3mDynBTJSUYxTjOQruf/zHH+ezCQKcoqO+h7a9Pw9Nm/OtlXAiGT1axBgwqrQ==} engines: {node: ^20.19.0 || >=22.12.0} hasBin: true peerDependencies: '@types/node': ^20.19.0 || >=22.12.0 + '@vitejs/devtools': ^0.1.0 + esbuild: ^0.27.0 jiti: '>=1.21.0' less: ^4.0.0 - lightningcss: ^1.21.0 sass: ^1.70.0 sass-embedded: ^1.70.0 stylus: '>=0.54.8' @@ -1316,12 +1509,14 @@ packages: peerDependenciesMeta: '@types/node': optional: true + '@vitejs/devtools': + optional: true + esbuild: + optional: true jiti: optional: true less: optional: true - lightningcss: - optional: true sass: optional: true sass-embedded: @@ -1482,6 +1677,22 @@ snapshots: '@babel/helper-string-parser': 7.27.1 '@babel/helper-validator-identifier': 7.28.5 + '@emnapi/core@1.9.1': + dependencies: + '@emnapi/wasi-threads': 1.2.0 + tslib: 2.8.1 + optional: true + + '@emnapi/runtime@1.9.1': + dependencies: + tslib: 2.8.1 + optional: true + + '@emnapi/wasi-threads@1.2.0': + dependencies: + tslib: 2.8.1 + optional: true + '@esbuild/aix-ppc64@0.25.11': optional: true @@ -1624,8 +1835,69 @@ snapshots: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.5.5 + '@napi-rs/wasm-runtime@1.1.2(@emnapi/core@1.9.1)(@emnapi/runtime@1.9.1)': + dependencies: + '@emnapi/core': 1.9.1 + '@emnapi/runtime': 1.9.1 + '@tybys/wasm-util': 0.10.1 + optional: true + + '@oxc-project/types@0.122.0': {} + '@pkgr/core@0.2.9': {} + '@rolldown/binding-android-arm64@1.0.0-rc.12': + optional: true + + '@rolldown/binding-darwin-arm64@1.0.0-rc.12': + optional: true + + '@rolldown/binding-darwin-x64@1.0.0-rc.12': + optional: true + + '@rolldown/binding-freebsd-x64@1.0.0-rc.12': + optional: true + + '@rolldown/binding-linux-arm-gnueabihf@1.0.0-rc.12': + optional: true + + '@rolldown/binding-linux-arm64-gnu@1.0.0-rc.12': + optional: true + + '@rolldown/binding-linux-arm64-musl@1.0.0-rc.12': + optional: true + + '@rolldown/binding-linux-ppc64-gnu@1.0.0-rc.12': + optional: true + + '@rolldown/binding-linux-s390x-gnu@1.0.0-rc.12': + optional: true + + '@rolldown/binding-linux-x64-gnu@1.0.0-rc.12': + optional: true + + '@rolldown/binding-linux-x64-musl@1.0.0-rc.12': + optional: true + + '@rolldown/binding-openharmony-arm64@1.0.0-rc.12': + optional: true + + '@rolldown/binding-wasm32-wasi@1.0.0-rc.12(@emnapi/core@1.9.1)(@emnapi/runtime@1.9.1)': + dependencies: + '@napi-rs/wasm-runtime': 1.1.2(@emnapi/core@1.9.1)(@emnapi/runtime@1.9.1) + transitivePeerDependencies: + - '@emnapi/core' + - '@emnapi/runtime' + optional: true + + '@rolldown/binding-win32-arm64-msvc@1.0.0-rc.12': + optional: true + + '@rolldown/binding-win32-x64-msvc@1.0.0-rc.12': + optional: true + + '@rolldown/pluginutils@1.0.0-rc.12': {} + '@rollup/plugin-json@6.1.0(rollup@4.60.0)': dependencies: '@rollup/pluginutils': 5.3.0(rollup@4.60.0) @@ -1794,6 +2066,11 @@ snapshots: dependencies: '@swc/counter': 0.1.3 + '@tybys/wasm-util@0.10.1': + dependencies: + tslib: 2.8.1 + optional: true + '@types/babel__core@7.20.5': dependencies: '@babel/parser': 7.28.4 @@ -1988,6 +2265,8 @@ snapshots: deepmerge@4.3.1: {} + detect-libc@2.1.2: {} + electron-to-chromium@1.5.328: {} emoji-regex@10.6.0: {} @@ -2200,6 +2479,55 @@ snapshots: prelude-ls: 1.2.1 type-check: 0.4.0 + lightningcss-android-arm64@1.32.0: + optional: true + + lightningcss-darwin-arm64@1.32.0: + optional: true + + lightningcss-darwin-x64@1.32.0: + optional: true + + lightningcss-freebsd-x64@1.32.0: + optional: true + + lightningcss-linux-arm-gnueabihf@1.32.0: + optional: true + + lightningcss-linux-arm64-gnu@1.32.0: + optional: true + + lightningcss-linux-arm64-musl@1.32.0: + optional: true + + lightningcss-linux-x64-gnu@1.32.0: + optional: true + + lightningcss-linux-x64-musl@1.32.0: + optional: true + + lightningcss-win32-arm64-msvc@1.32.0: + optional: true + + lightningcss-win32-x64-msvc@1.32.0: + optional: true + + lightningcss@1.32.0: + dependencies: + detect-libc: 2.1.2 + optionalDependencies: + lightningcss-android-arm64: 1.32.0 + lightningcss-darwin-arm64: 1.32.0 + lightningcss-darwin-x64: 1.32.0 + lightningcss-freebsd-x64: 1.32.0 + lightningcss-linux-arm-gnueabihf: 1.32.0 + lightningcss-linux-arm64-gnu: 1.32.0 + lightningcss-linux-arm64-musl: 1.32.0 + lightningcss-linux-x64-gnu: 1.32.0 + lightningcss-linux-x64-musl: 1.32.0 + lightningcss-win32-arm64-msvc: 1.32.0 + lightningcss-win32-x64-msvc: 1.32.0 + lint-staged@16.4.0: dependencies: commander: 14.0.3 @@ -2285,7 +2613,7 @@ snapshots: picomatch@4.0.4: {} - postcss@8.5.6: + postcss@8.5.8: dependencies: nanoid: 3.3.11 picocolors: 1.1.1 @@ -2314,6 +2642,30 @@ snapshots: rfdc@1.4.1: {} + rolldown@1.0.0-rc.12(@emnapi/core@1.9.1)(@emnapi/runtime@1.9.1): + dependencies: + '@oxc-project/types': 0.122.0 + '@rolldown/pluginutils': 1.0.0-rc.12 + optionalDependencies: + '@rolldown/binding-android-arm64': 1.0.0-rc.12 + '@rolldown/binding-darwin-arm64': 1.0.0-rc.12 + '@rolldown/binding-darwin-x64': 1.0.0-rc.12 + '@rolldown/binding-freebsd-x64': 1.0.0-rc.12 + '@rolldown/binding-linux-arm-gnueabihf': 1.0.0-rc.12 + '@rolldown/binding-linux-arm64-gnu': 1.0.0-rc.12 + '@rolldown/binding-linux-arm64-musl': 1.0.0-rc.12 + '@rolldown/binding-linux-ppc64-gnu': 1.0.0-rc.12 + '@rolldown/binding-linux-s390x-gnu': 1.0.0-rc.12 + '@rolldown/binding-linux-x64-gnu': 1.0.0-rc.12 + '@rolldown/binding-linux-x64-musl': 1.0.0-rc.12 + '@rolldown/binding-openharmony-arm64': 1.0.0-rc.12 + '@rolldown/binding-wasm32-wasi': 1.0.0-rc.12(@emnapi/core@1.9.1)(@emnapi/runtime@1.9.1) + '@rolldown/binding-win32-arm64-msvc': 1.0.0-rc.12 + '@rolldown/binding-win32-x64-msvc': 1.0.0-rc.12 + transitivePeerDependencies: + - '@emnapi/core' + - '@emnapi/runtime' + rollup-plugin-dts@6.4.1(rollup@4.60.0)(typescript@5.9.3): dependencies: '@jridgewell/remapping': 2.3.5 @@ -2451,18 +2803,21 @@ snapshots: dependencies: punycode: 2.3.1 - vite@7.1.10(@types/node@22.19.15)(yaml@2.8.3): + vite@8.0.3(@emnapi/core@1.9.1)(@emnapi/runtime@1.9.1)(@types/node@22.19.15)(esbuild@0.25.11)(yaml@2.8.3): dependencies: - esbuild: 0.25.11 - fdir: 6.5.0(picomatch@4.0.3) - picomatch: 4.0.3 - postcss: 8.5.6 - rollup: 4.60.0 + lightningcss: 1.32.0 + picomatch: 4.0.4 + postcss: 8.5.8 + rolldown: 1.0.0-rc.12(@emnapi/core@1.9.1)(@emnapi/runtime@1.9.1) tinyglobby: 0.2.15 optionalDependencies: '@types/node': 22.19.15 + esbuild: 0.25.11 fsevents: 2.3.3 yaml: 2.8.3 + transitivePeerDependencies: + - '@emnapi/core' + - '@emnapi/runtime' which@2.0.2: dependencies: diff --git a/rollup.config.ts b/rollup.config.ts index 4fd95cc..594769c 100644 --- a/rollup.config.ts +++ b/rollup.config.ts @@ -35,6 +35,7 @@ export default defineConfig([ }, { input: 'dist/types/index.d.ts', + external: ['vite'], output: [{ file: pkg.types, format: 'es' }], plugins: [dts(), rm('dist/types', 'buildEnd')] } diff --git a/src/plugins/buildReporter.ts b/src/plugins/buildReporter.ts deleted file mode 100644 index c9696c4..0000000 --- a/src/plugins/buildReporter.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { type Plugin } from 'vite' - -type BuildReporterApi = { - getWatchFiles: () => string[] -} - -export default function buildReporterPlugin(): Plugin { - const moduleIds: string[] = [] - return { - name: 'vite:build-reporter', - - buildEnd() { - const allModuleIds = Array.from(this.getModuleIds()) - const sourceFiles = allModuleIds.filter(id => { - if (id.includes('node_modules')) { - return false - } - const info = this.getModuleInfo(id) - return info && !info.isExternal - }) - moduleIds.push(...sourceFiles) - }, - - api: { - getWatchFiles() { - return moduleIds - } - } - } -} diff --git a/src/plugins/bytecode.ts b/src/plugins/bytecode.ts index 21c680b..5ef80f2 100644 --- a/src/plugins/bytecode.ts +++ b/src/plugins/bytecode.ts @@ -2,10 +2,9 @@ import path from 'node:path' import { spawn } from 'node:child_process' import { createRequire } from 'node:module' import colors from 'picocolors' -import { type Plugin, type Logger, type LibraryOptions, normalizePath } from 'vite' +import { type Plugin, type Logger, type LibraryOptions, type Rolldown, normalizePath } from 'vite' import * as babel from '@babel/core' import MagicString from 'magic-string' -import type { SourceMapInput, OutputChunk, OutputOptions } from 'rollup' import { getElectronPath } from '../electron' import { toRelativePath } from '../utils' @@ -179,7 +178,10 @@ export function bytecodePlugin(options: BytecodeOptions = {}): Plugin | null { const shouldTransformBytecodeChunk = plugins.length !== 0 - const _transform = (code: string, sourceMaps: boolean = false): { code: string; map?: SourceMapInput } | null => { + const _transform = ( + code: string, + sourceMaps: boolean = false + ): { code: string; map?: Rolldown.SourceMapInput } | null => { const re = babel.transform(code, { plugins, sourceMaps }) return re ? { code: re.code || '', map: re.map } : null } @@ -220,7 +222,7 @@ export function bytecodePlugin(options: BytecodeOptions = {}): Plugin | null { supported = output.format === 'cjs' && !useInRenderer } }, - renderChunk(code, chunk, { sourcemap }): { code: string; map?: SourceMapInput } | null { + renderChunk(code, chunk, { sourcemap }): { code: string; map?: Rolldown.SourceMapInput } | null { if (supported && isBytecodeChunk(chunk.name) && shouldTransformBytecodeChunk) { return _transform(code, !!sourcemap) } @@ -231,7 +233,9 @@ export function bytecodePlugin(options: BytecodeOptions = {}): Plugin | null { return } const _chunks = Object.values(output) - const chunks = _chunks.filter(chunk => chunk.type === 'chunk' && isBytecodeChunk(chunk.name)) as OutputChunk[] + const chunks = _chunks.filter( + chunk => chunk.type === 'chunk' && isBytecodeChunk(chunk.name) + ) as Rolldown.OutputChunk[] if (chunks.length === 0) { return @@ -304,7 +308,7 @@ export function bytecodePlugin(options: BytecodeOptions = {}): Plugin | null { break } const moduleInfo = this.getModuleInfo(moduleId) - if (moduleInfo && !moduleInfo.isExternal) { + if (moduleInfo) { const { importers, dynamicImporters } = moduleInfo for (const importerId of importers) idsToHandle.add(importerId) for (const importerId of dynamicImporters) idsToHandle.add(importerId) @@ -342,9 +346,9 @@ export function bytecodePlugin(options: BytecodeOptions = {}): Plugin | null { } function resolveBuildOutputs( - outputs: OutputOptions | OutputOptions[] | undefined, + outputs: Rolldown.OutputOptions | Rolldown.OutputOptions[] | undefined, libOptions: LibraryOptions | false -): OutputOptions | OutputOptions[] | undefined { +): Rolldown.OutputOptions | Rolldown.OutputOptions[] | undefined { if (libOptions && !Array.isArray(outputs)) { const libFormats = libOptions.formats || [] return libFormats.map(format => ({ ...outputs, format })) diff --git a/src/plugins/electron.ts b/src/plugins/electron.ts index 2f2a340..6d455ea 100644 --- a/src/plugins/electron.ts +++ b/src/plugins/electron.ts @@ -2,8 +2,7 @@ import path from 'node:path' import fs from 'node:fs' import { builtinModules } from 'node:module' import colors from 'picocolors' -import { type Plugin, type LibraryOptions, mergeConfig, normalizePath } from 'vite' -import type { OutputOptions } from 'rollup' +import { type Plugin, type LibraryOptions, type Rolldown, mergeConfig, normalizePath } from 'vite' import { getElectronNodeTarget, getElectronChromeTarget, supportESM } from '../electron' import { loadPackageData } from '../utils' @@ -40,9 +39,9 @@ function processEnvDefine(): Record { } function resolveBuildOutputs( - outputs: OutputOptions | OutputOptions[] | undefined, + outputs: Rolldown.OutputOptions | Rolldown.OutputOptions[] | undefined, libOptions: LibraryOptions | false -): OutputOptions | OutputOptions[] | undefined { +): Rolldown.OutputOptions | Rolldown.OutputOptions[] | undefined { if (libOptions && !Array.isArray(outputs)) { const libFormats = libOptions.formats || [] return libFormats.map(format => ({ ...outputs, format })) @@ -122,6 +121,7 @@ export function electronMainConfigPresetPlugin(options?: ElectronPluginOptions): // enable ssr build config.build.ssr = true config.build.ssrEmitAssets = true + config.build.rolldownOptions = config.build.rollupOptions config.ssr = { ...config.ssr, ...{ noExternal: true } } } } @@ -270,6 +270,7 @@ export function electronPreloadConfigPresetPlugin(options?: ElectronPluginOption // enable ssr build config.build.ssr = true config.build.ssrEmitAssets = true + config.build.rolldownOptions = config.build.rollupOptions config.ssr = mergeConfig(defaultConfig.ssr, config.ssr || {}) config.ssr.noExternal = true } diff --git a/src/plugins/importMeta.ts b/src/plugins/importMeta.ts index 395aca1..296854c 100644 --- a/src/plugins/importMeta.ts +++ b/src/plugins/importMeta.ts @@ -1,6 +1,19 @@ -import type { Plugin } from 'vite' +/* eslint-disable @typescript-eslint/no-explicit-any */ +import { type Plugin, version } from 'vite' -export default function importMetaPlugin(): Plugin { +/** + * @deprecated Vite 8 (Rolldown) now provides native support for these + * `import.meta` properties. These properties are polyfilled when the output + * format is CJS. + * + * @see https://rolldown.rs/in-depth/non-esm-output-formats#well-known-import-meta-properties + */ +export default function importMetaPlugin(): Plugin | null { + const currentVersion = version.split('.') + const major = parseInt(currentVersion[0], 10) + if (major >= 8) { + return null + } return { name: 'vite:import-meta', apply: 'build', @@ -17,5 +30,5 @@ export default function importMetaPlugin(): Plugin { } return null } - } + } as any } diff --git a/src/plugins/isolateEntries.ts b/src/plugins/isolateEntries.ts index e812286..4a9fd82 100644 --- a/src/plugins/isolateEntries.ts +++ b/src/plugins/isolateEntries.ts @@ -1,9 +1,16 @@ /* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-function-type */ import path from 'node:path' -import { type InlineConfig, type Plugin, type Logger, type LogLevel, build as viteBuild, mergeConfig } from 'vite' -import type { InputOptions, RollupOutput } from 'rollup' +import { + type InlineConfig, + type Plugin, + type Logger, + type LogLevel, + type Rolldown, + build as viteBuild, + mergeConfig +} from 'vite' import colors from 'picocolors' -import buildReporterPlugin from './buildReporter' +import { cleanUrl } from '../utils' const VIRTUAL_ENTRY_ID = '\0virtual:isolate-entries' @@ -31,7 +38,7 @@ export default function isolateEntriesPlugin(userConfig: InlineConfig): Plugin { logger = config.logger }, - options(opts): InputOptions | void { + options(opts): Rolldown.InputOptions | void { const { input } = opts if (input && typeof input === 'object') { if ((Array.isArray(input) && input.length > 0) || Object.keys(input).length > 1) { @@ -57,12 +64,11 @@ export default function isolateEntriesPlugin(userConfig: InlineConfig): Plugin { async load(id): Promise { if (id === VIRTUAL_ENTRY_ID) { const shouldLog = LogLevels[userConfig.logLevel || 'info'] >= LogLevels.info - const shouldWatch = this.meta.watchMode const watchFiles = new Set() for (const entry of entries) { - const re = await bundleEntryFile(entry, userConfig, shouldWatch, shouldLog, transformedCount) + const re = await bundleEntryFile(entry, userConfig, shouldLog, transformedCount) const outputChunks = re.bundles.output for (const chunk of outputChunks) { @@ -77,8 +83,20 @@ export default function isolateEntriesPlugin(userConfig: InlineConfig): Plugin { assetCache.add(chunk.fileName) } - for (const id of re.watchFiles) { - watchFiles.add(id) + if (this.meta.watchMode) { + const moduleIds = new Set() + for (const chunk of re.bundles.output) { + if (chunk.type === 'chunk') { + for (const id of chunk.moduleIds) { + if (!id.startsWith('\0')) { + moduleIds.add(cleanUrl(id)) + } + } + } + } + for (const id of moduleIds) { + this.addWatchFile(id) + } } transformedCount += re.transformedCount @@ -112,19 +130,17 @@ export default function isolateEntriesPlugin(userConfig: InlineConfig): Plugin { async function bundleEntryFile( input: string | Record, config: InlineConfig, - watch: boolean, shouldLog: boolean, preTransformedCount: number -): Promise<{ bundles: RollupOutput; watchFiles: string[]; transformedCount: number }> { +): Promise<{ bundles: Rolldown.RolldownOutput; transformedCount: number }> { const transformReporter = transformReporterPlugin(preTransformedCount, shouldLog) - const buildReporter = watch ? buildReporterPlugin() : undefined const viteConfig = mergeConfig(config, { build: { write: false, watch: false }, - plugins: [transformReporter, buildReporter], + plugins: [transformReporter], logLevel: 'warn', configFile: false }) as InlineConfig @@ -132,11 +148,10 @@ async function bundleEntryFile( // rewrite the input instead of merging viteConfig.build!.rollupOptions!.input = input - const bundles = await viteBuild(viteConfig) + const bundles = (await viteBuild(viteConfig)) as Rolldown.RolldownOutput return { - bundles: bundles as RollupOutput, - watchFiles: buildReporter?.api?.getWatchFiles() || [], + bundles: bundles, transformedCount: transformReporter?.api?.getTransformedCount() || 0 } } diff --git a/src/plugins/modulePath.ts b/src/plugins/modulePath.ts index 5159993..21359d5 100644 --- a/src/plugins/modulePath.ts +++ b/src/plugins/modulePath.ts @@ -1,8 +1,6 @@ import path from 'node:path' -import { type Plugin, type InlineConfig, build as viteBuild, mergeConfig } from 'vite' -import type { SourceMapInput, RollupOutput, OutputOptions } from 'rollup' +import { type Plugin, type InlineConfig, type Rolldown, build as viteBuild, mergeConfig } from 'vite' import MagicString from 'magic-string' -import buildReporterPlugin from './buildReporter' import { cleanUrl, toRelativePath } from '../utils' import { supportImportMetaPaths } from '../electron' @@ -24,8 +22,8 @@ export default function modulePathPlugin(config: InlineConfig): Plugin { async load(id): Promise { if (id.endsWith('?modulePath')) { // id resolved by Vite resolve plugin - const re = await bundleEntryFile(cleanUrl(id), config, this.meta.watchMode) - const [outputChunk, ...outputChunks] = re.bundles.output + const bundles = await bundleEntryFile(cleanUrl(id), config) + const [outputChunk, ...outputChunks] = bundles.output const hash = this.emitFile({ type: 'asset', fileName: outputChunk.fileName, @@ -42,8 +40,20 @@ export default function modulePathPlugin(config: InlineConfig): Plugin { }) assetCache.add(chunk.fileName) } - for (const id of re.watchFiles) { - this.addWatchFile(id) + if (this.meta.watchMode) { + const moduleIds = new Set() + for (const chunk of bundles.output) { + if (chunk.type === 'chunk') { + for (const id of chunk.moduleIds) { + if (!id.startsWith('\0')) { + moduleIds.add(cleanUrl(id)) + } + } + } + } + for (const id of moduleIds) { + this.addWatchFile(id) + } } const refId = `__VITE_MODULE_PATH__${hash}__` const dirnameExpr = isImportMetaPathSupported ? 'import.meta.dirname' : '__dirname' @@ -52,7 +62,7 @@ export default function modulePathPlugin(config: InlineConfig): Plugin { export default join(${dirnameExpr}, ${refId})` } }, - renderChunk(code, chunk, { sourcemap }): { code: string; map: SourceMapInput } | null { + renderChunk(code, chunk, { sourcemap }): { code: string; map: Rolldown.SourceMapInput } | null { let match: RegExpExecArray | null let s: MagicString | undefined @@ -80,12 +90,7 @@ export default function modulePathPlugin(config: InlineConfig): Plugin { } } -async function bundleEntryFile( - input: string, - config: InlineConfig, - watch: boolean -): Promise<{ bundles: RollupOutput; watchFiles: string[] }> { - const reporter = watch ? buildReporterPlugin() : undefined +async function bundleEntryFile(input: string, config: InlineConfig): Promise { const viteConfig = mergeConfig(config, { build: { write: false, @@ -94,15 +99,14 @@ async function bundleEntryFile( plugins: [ { name: 'vite:entry-file-name', - outputOptions(output): OutputOptions { + outputOptions(output): Rolldown.OutputOptions { if (typeof output.entryFileNames !== 'function' && output.entryFileNames) { output.entryFileNames = '[name]-[hash]' + path.extname(output.entryFileNames) } return output } - }, - reporter - ], + } + ] as Plugin[], logLevel: 'warn', configFile: false }) as InlineConfig @@ -116,8 +120,5 @@ async function bundleEntryFile( const bundles = await viteBuild(viteConfig) - return { - bundles: bundles as RollupOutput, - watchFiles: reporter?.api?.getWatchFiles() || [] - } + return bundles as Rolldown.RolldownOutput } diff --git a/src/plugins/swc.ts b/src/plugins/swc.ts index 9d1013c..369f874 100644 --- a/src/plugins/swc.ts +++ b/src/plugins/swc.ts @@ -79,7 +79,7 @@ export type SwcOptions = { export function swcPlugin(options: SwcOptions = {}): Plugin { const filter = createFilter(options.include || /\.(m?ts|[jt]sx)$/, options.exclude || /\.js$/) let sourcemap: boolean | 'inline' = false - let minify: boolean | 'esbuild' | 'terser' = false + let minify: boolean | 'esbuild' | 'oxc' | 'terser' = false return { name: 'vite:swc', config(): UserConfig {