From ff2f7206f376c439fd42751cb39248d3ed87e136 Mon Sep 17 00:00:00 2001 From: 17hz <0x149527@gmail.com> Date: Tue, 23 Sep 2025 16:59:26 +0800 Subject: [PATCH] bump nextjs to 15.5 and turbopack for development mode (#24346) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: crazywoola <427733928@qq.com> Co-authored-by: 非法操作 --- web/app/styles/globals.css | 14 ++-- web/next.config.js | 9 +++ web/package.json | 4 +- web/pnpm-lock.yaml | 161 +++++++++++++++++++++---------------- web/tsconfig.json | 3 + 5 files changed, 113 insertions(+), 78 deletions(-) diff --git a/web/app/styles/globals.css b/web/app/styles/globals.css index 353cfa2fff..c1078b6eb6 100644 --- a/web/app/styles/globals.css +++ b/web/app/styles/globals.css @@ -1,12 +1,18 @@ @import "preflight.css"; -@tailwind base; -@tailwind components; + @import '../../themes/light.css'; @import '../../themes/dark.css'; @import "../../themes/manual-light.css"; @import "../../themes/manual-dark.css"; +@import "../components/base/button/index.css"; +@import "../components/base/action-button/index.css"; +@import "../components/base/modal/index.css"; + +@tailwind base; +@tailwind components; + html { color-scheme: light; } @@ -680,10 +686,6 @@ button:focus-within { display: none; } -@import "../components/base/button/index.css"; -@import "../components/base/action-button/index.css"; -@import "../components/base/modal/index.css"; - @tailwind utilities; @layer utilities { diff --git a/web/next.config.js b/web/next.config.js index bbeb14c7c8..391a9a221b 100644 --- a/web/next.config.js +++ b/web/next.config.js @@ -91,6 +91,11 @@ const remoteImageURLs = [hasSetWebPrefix ? new URL(`${process.env.NEXT_PUBLIC_WE /** @type {import('next').NextConfig} */ const nextConfig = { basePath: process.env.NEXT_PUBLIC_BASE_PATH || '', + turbopack: { + rules: codeInspectorPlugin({ + bundler: 'turbopack' + }) + }, webpack: (config, { dev, isServer }) => { config.plugins.push(codeInspectorPlugin({ bundler: 'webpack' })) @@ -118,6 +123,10 @@ const nextConfig = { })), }, experimental: { + optimizePackageImports: [ + '@remixicon/react', + '@heroicons/react' + ], }, // fix all before production. Now it slow the develop speed. eslint: { diff --git a/web/package.json b/web/package.json index f4152940d8..08750f1f2b 100644 --- a/web/package.json +++ b/web/package.json @@ -19,7 +19,7 @@ "and_qq >= 14.9" ], "scripts": { - "dev": "cross-env NODE_OPTIONS='--inspect' next dev", + "dev": "cross-env NODE_OPTIONS='--inspect' next dev --turbopack", "build": "next build", "build:docker": "next build && node scripts/optimize-standalone.js", "start": "cp -r .next/static .next/standalone/.next/static && cp -r public .next/standalone/public && cross-env PORT=$npm_config_port HOSTNAME=$npm_config_host node .next/standalone/server.js", @@ -205,7 +205,7 @@ "autoprefixer": "^10.4.20", "babel-loader": "^10.0.0", "bing-translate-api": "^4.0.2", - "code-inspector-plugin": "^0.18.1", + "code-inspector-plugin": "1.2.9", "cross-env": "^7.0.3", "eslint": "^9.32.0", "eslint-config-next": "15.5.0", diff --git a/web/pnpm-lock.yaml b/web/pnpm-lock.yaml index 4e2e750030..9fda4c0a9e 100644 --- a/web/pnpm-lock.yaml +++ b/web/pnpm-lock.yaml @@ -525,8 +525,8 @@ importers: specifier: ^4.0.2 version: 4.1.0 code-inspector-plugin: - specifier: ^0.18.1 - version: 0.18.3 + specifier: 1.2.9 + version: 1.2.9 cross-env: specifier: ^7.0.3 version: 7.0.3 @@ -1378,6 +1378,24 @@ packages: '@clack/prompts@0.11.0': resolution: {integrity: sha512-pMN5FcrEw9hUkZA4f+zLlzivQSeQf5dRGJjSUbvVYDLvpKCdQx5OaknvKzgbtXOizhP+SJJJjqEbOe55uKKfAw==} + '@code-inspector/core@1.2.9': + resolution: {integrity: sha512-A1w+G73HlTB6S8X6sA6tT+ziWHTAcTyH+7FZ1Sgd3ZLXF/E/jT+hgRbKposjXMwxcbodRc6hBG6UyiV+VxwE6Q==} + + '@code-inspector/esbuild@1.2.9': + resolution: {integrity: sha512-DuyfxGupV43CN8YElIqynAniBtE86i037+3OVJYrm3jlJscXzbV98/kOzvu+VJQQvElcDgpgD6C/aGmPvFEiUg==} + + '@code-inspector/mako@1.2.9': + resolution: {integrity: sha512-8N+MHdr64AnthLB4v+YGe8/9bgog3BnkxIW/fqX5iVS0X06mF7X1pxfZOD2bABVtv1tW25lRtNs5AgvYJs0vpg==} + + '@code-inspector/turbopack@1.2.9': + resolution: {integrity: sha512-UVOUbqU6rpi5eOkrFamKrdeSWb0/OFFJQBaxbgs1RK5V5f4/iVwC5KjO2wkjv8cOGU4EppLfBVSBI1ysOo8S5A==} + + '@code-inspector/vite@1.2.9': + resolution: {integrity: sha512-saIokJ3o3SdrHEgTEg1fbbowbKfh7J4mYtu0i1mVfah1b1UfdCF/iFHTEJ6SADMiY47TeNZTg0TQWTlU1AWPww==} + + '@code-inspector/webpack@1.2.9': + resolution: {integrity: sha512-9YEykVrOIc0zMV7pyTyZhCprjScjn6gPPmxb4/OQXKCrP2fAm+NB188rg0s95e4sM7U3qRUpPA4NUH5F7Ogo+g==} + '@cspotcode/source-map-support@0.8.1': resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} engines: {node: '>=12'} @@ -4416,11 +4434,8 @@ packages: resolution: {integrity: sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==} engines: {iojs: '>= 1.0.0', node: '>= 0.12.0'} - code-inspector-core@0.18.3: - resolution: {integrity: sha512-60pT2cPoguMTUYdN1MMpjoPUnuF0ud/u7M2y+Vqit/bniLEit9dySEWAVxLU/Ukc5ILrDeLKEttc6fCMl9RUrA==} - - code-inspector-plugin@0.18.3: - resolution: {integrity: sha512-d9oJXZUsnvfTaQDwFmDNA2F+AR/TXIxWg1rr8KGcEskltR2prbZsfuu1z70EAn4khpx0smfi/PvIIwNJQ7FAMw==} + code-inspector-plugin@1.2.9: + resolution: {integrity: sha512-PGp/AQ03vaajimG9rn5+eQHGifrym5CSNLCViPtwzot7FM3MqEkGNqcvimH0FVuv3wDOcP5KvETAUSLf1BE3HA==} collapse-white-space@2.1.0: resolution: {integrity: sha512-loKTxY1zCOuG4j9f6EPnuyyYkf58RnhhWTvRoZEokgB+WbdXehfjFviyOVYkqzEWz1Q5kRiZdBYS5SwxbQYwzw==} @@ -5062,9 +5077,6 @@ packages: esast-util-from-js@2.0.1: resolution: {integrity: sha512-8Ja+rNJ0Lt56Pcf3TAmpBZjmx8ZcK5Ts4cAzIOjsjevg9oSXJnl6SUQ2EevU8tv3h6ZLWmoKL5H4fgWvdvfETw==} - esbuild-code-inspector-plugin@0.18.3: - resolution: {integrity: sha512-FaPt5eFMtW1oXMWqAcqfAJByNagP1V/R9dwDDLQO29JmryMF35+frskTqy+G53whmTaVi19+TCrFqhNbMZH5ZQ==} - esbuild-register@3.6.0: resolution: {integrity: sha512-H2/S7Pm8a9CL1uhp9OvjwrBh5Pvx0H8qVOxNu8Wed9Y7qv56MPtq+GGM8RJpq6glYJn9Wspr8uw7l55uyinNeg==} peerDependencies: @@ -6420,8 +6432,8 @@ packages: resolution: {integrity: sha512-MbjN408fEndfiQXbFQ1vnd+1NoLDsnQW41410oQBXiyXDMYH5z505juWa4KUE1LqxRC7DgOgZDbKLxHIwm27hA==} engines: {node: '>=0.10'} - launch-ide@1.0.1: - resolution: {integrity: sha512-U7qBxSNk774PxWq4XbmRe0ThiIstPoa4sMH/OGSYxrFVvg8x3biXcF1fsH6wasDpEmEXMdINUrQhBdwsSgKyMg==} + launch-ide@1.2.0: + resolution: {integrity: sha512-7nXSPQOt3b2JT52Ge8jp4miFcY+nrUEZxNLWBzrEfjmByDTb9b5ytqMSwGhsNwY6Cntwop+6n7rWIFN0+S8PTw==} layout-base@1.0.2: resolution: {integrity: sha512-8h2oVEZNktL4BH2JCOI90iD1yXwL6iNW7KcCKT2QZgQJR2vbqDsldCTPRU9NifTCqHZci57XvQQ15YTu+sTYPg==} @@ -8707,9 +8719,6 @@ packages: vfile@6.0.3: resolution: {integrity: sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==} - vite-code-inspector-plugin@0.18.3: - resolution: {integrity: sha512-178H73vbDUHE+JpvfAfioUHlUr7qXCYIEa2YNXtzenFQGOjtae59P1jjcxGfa6pPHEnOoaitb13K+0qxwhi/WA==} - vm-browserify@1.1.2: resolution: {integrity: sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==} @@ -8768,9 +8777,6 @@ packages: engines: {node: '>= 10.13.0'} hasBin: true - webpack-code-inspector-plugin@0.18.3: - resolution: {integrity: sha512-3782rsJhBnRiw0IpR6EqnyGDQoiSq0CcGeLJ52rZXlszYCe8igXtcujq7OhI0byaivWQ1LW7sXKyMEoVpBhq0w==} - webpack-dev-middleware@6.1.3: resolution: {integrity: sha512-A4ChP0Qj8oGociTs6UdlRUGANIGrCDL3y+pmQMc+dSsraXHCatFpmMey4mYELA+juqwUqwQsUgJJISXl1KWmiw==} engines: {node: '>= 14.15.0'} @@ -10023,6 +10029,48 @@ snapshots: picocolors: 1.1.1 sisteransi: 1.0.5 + '@code-inspector/core@1.2.9': + dependencies: + '@vue/compiler-dom': 3.5.17 + chalk: 4.1.2 + dotenv: 16.6.1 + launch-ide: 1.2.0 + portfinder: 1.0.37 + transitivePeerDependencies: + - supports-color + + '@code-inspector/esbuild@1.2.9': + dependencies: + '@code-inspector/core': 1.2.9 + transitivePeerDependencies: + - supports-color + + '@code-inspector/mako@1.2.9': + dependencies: + '@code-inspector/core': 1.2.9 + transitivePeerDependencies: + - supports-color + + '@code-inspector/turbopack@1.2.9': + dependencies: + '@code-inspector/core': 1.2.9 + '@code-inspector/webpack': 1.2.9 + transitivePeerDependencies: + - supports-color + + '@code-inspector/vite@1.2.9': + dependencies: + '@code-inspector/core': 1.2.9 + chalk: 4.1.1 + transitivePeerDependencies: + - supports-color + + '@code-inspector/webpack@1.2.9': + dependencies: + '@code-inspector/core': 1.2.9 + transitivePeerDependencies: + - supports-color + '@cspotcode/source-map-support@0.8.1': dependencies: '@jridgewell/trace-mapping': 0.3.9 @@ -10162,7 +10210,7 @@ snapshots: '@eslint-react/eff': 1.52.3 '@typescript-eslint/types': 8.37.0 '@typescript-eslint/typescript-estree': 8.37.0(typescript@5.8.3) - '@typescript-eslint/utils': 8.37.0(eslint@9.32.0(jiti@1.21.7))(typescript@5.8.3) + '@typescript-eslint/utils': 8.38.0(eslint@9.32.0(jiti@1.21.7))(typescript@5.8.3) string-ts: 2.2.1 ts-pattern: 5.7.1 transitivePeerDependencies: @@ -10180,7 +10228,7 @@ snapshots: '@typescript-eslint/scope-manager': 8.37.0 '@typescript-eslint/type-utils': 8.37.0(eslint@9.32.0(jiti@1.21.7))(typescript@5.8.3) '@typescript-eslint/types': 8.37.0 - '@typescript-eslint/utils': 8.37.0(eslint@9.32.0(jiti@1.21.7))(typescript@5.8.3) + '@typescript-eslint/utils': 8.38.0(eslint@9.32.0(jiti@1.21.7))(typescript@5.8.3) birecord: 0.1.1 ts-pattern: 5.7.1 transitivePeerDependencies: @@ -10241,7 +10289,7 @@ snapshots: '@eslint-react/eff': 1.52.3 '@typescript-eslint/scope-manager': 8.37.0 '@typescript-eslint/types': 8.37.0 - '@typescript-eslint/utils': 8.37.0(eslint@9.32.0(jiti@1.21.7))(typescript@5.8.3) + '@typescript-eslint/utils': 8.38.0(eslint@9.32.0(jiti@1.21.7))(typescript@5.8.3) string-ts: 2.2.1 ts-pattern: 5.7.1 transitivePeerDependencies: @@ -12518,7 +12566,7 @@ snapshots: '@typescript-eslint/typescript-estree': 8.38.0(typescript@5.8.3) '@typescript-eslint/visitor-keys': 8.38.0 debug: 4.4.0 - eslint: 9.35.0(jiti@1.21.7) + eslint: 9.32.0(jiti@1.21.7) typescript: 5.8.3 transitivePeerDependencies: - supports-color @@ -12563,9 +12611,9 @@ snapshots: dependencies: '@typescript-eslint/types': 8.37.0 '@typescript-eslint/typescript-estree': 8.37.0(typescript@5.8.3) - '@typescript-eslint/utils': 8.37.0(eslint@9.35.0(jiti@1.21.7))(typescript@5.8.3) + '@typescript-eslint/utils': 8.37.0(eslint@9.32.0(jiti@1.21.7))(typescript@5.8.3) debug: 4.4.0 - eslint: 9.35.0(jiti@1.21.7) + eslint: 9.32.0(jiti@1.21.7) ts-api-utils: 2.1.0(typescript@5.8.3) typescript: 5.8.3 transitivePeerDependencies: @@ -12575,9 +12623,9 @@ snapshots: dependencies: '@typescript-eslint/types': 8.38.0 '@typescript-eslint/typescript-estree': 8.38.0(typescript@5.8.3) - '@typescript-eslint/utils': 8.38.0(eslint@9.35.0(jiti@1.21.7))(typescript@5.8.3) + '@typescript-eslint/utils': 8.38.0(eslint@9.32.0(jiti@1.21.7))(typescript@5.8.3) debug: 4.4.0 - eslint: 9.35.0(jiti@1.21.7) + eslint: 9.32.0(jiti@1.21.7) ts-api-utils: 2.1.0(typescript@5.8.3) typescript: 5.8.3 transitivePeerDependencies: @@ -12755,7 +12803,7 @@ snapshots: '@vue/compiler-core@3.5.17': dependencies: - '@babel/parser': 7.28.0 + '@babel/parser': 7.28.4 '@vue/shared': 3.5.17 entities: 4.5.0 estree-walker: 2.0.2 @@ -13459,24 +13507,15 @@ snapshots: co@4.6.0: {} - code-inspector-core@0.18.3: + code-inspector-plugin@1.2.9: dependencies: - '@vue/compiler-dom': 3.5.17 + '@code-inspector/core': 1.2.9 + '@code-inspector/esbuild': 1.2.9 + '@code-inspector/mako': 1.2.9 + '@code-inspector/turbopack': 1.2.9 + '@code-inspector/vite': 1.2.9 + '@code-inspector/webpack': 1.2.9 chalk: 4.1.1 - dotenv: 16.6.1 - launch-ide: 1.0.1 - portfinder: 1.0.37 - transitivePeerDependencies: - - supports-color - - code-inspector-plugin@0.18.3: - dependencies: - chalk: 4.1.1 - code-inspector-core: 0.18.3 - dotenv: 16.6.1 - esbuild-code-inspector-plugin: 0.18.3 - vite-code-inspector-plugin: 0.18.3 - webpack-code-inspector-plugin: 0.18.3 transitivePeerDependencies: - supports-color @@ -14134,12 +14173,6 @@ snapshots: esast-util-from-estree: 2.0.0 vfile-message: 4.0.2 - esbuild-code-inspector-plugin@0.18.3: - dependencies: - code-inspector-core: 0.18.3 - transitivePeerDependencies: - - supports-color - esbuild-register@3.6.0(esbuild@0.25.0): dependencies: debug: 4.4.0 @@ -14236,7 +14269,7 @@ snapshots: dependencies: '@nolyfill/is-core-module': 1.0.39 debug: 4.4.0 - eslint: 9.35.0(jiti@1.21.7) + eslint: 9.32.0(jiti@1.21.7) get-tsconfig: 4.10.1 is-bun-module: 2.0.0 stable-hash: 0.0.5 @@ -14279,7 +14312,7 @@ snapshots: eslint-plugin-es-x@7.8.0(eslint@9.32.0(jiti@1.21.7)): dependencies: - '@eslint-community/eslint-utils': 4.9.0(eslint@9.35.0(jiti@1.21.7)) + '@eslint-community/eslint-utils': 4.7.0(eslint@9.32.0(jiti@1.21.7)) '@eslint-community/regexpp': 4.12.1 eslint: 9.32.0(jiti@1.21.7) eslint-compat-utils: 0.5.1(eslint@9.32.0(jiti@1.21.7)) @@ -14372,10 +14405,10 @@ snapshots: eslint-plugin-n@17.21.0(eslint@9.32.0(jiti@1.21.7))(typescript@5.8.3): dependencies: - '@eslint-community/eslint-utils': 4.9.0(eslint@9.35.0(jiti@1.21.7)) + '@eslint-community/eslint-utils': 4.7.0(eslint@9.32.0(jiti@1.21.7)) enhanced-resolve: 5.18.1 - eslint: 9.35.0(jiti@1.21.7) - eslint-plugin-es-x: 7.8.0(eslint@9.35.0(jiti@1.21.7)) + eslint: 9.32.0(jiti@1.21.7) + eslint-plugin-es-x: 7.8.0(eslint@9.32.0(jiti@1.21.7)) get-tsconfig: 4.10.1 globals: 15.15.0 ignore: 5.3.2 @@ -14607,8 +14640,8 @@ snapshots: eslint-plugin-toml@0.12.0(eslint@9.32.0(jiti@1.21.7)): dependencies: debug: 4.4.0 - eslint: 9.35.0(jiti@1.21.7) - eslint-compat-utils: 0.6.5(eslint@9.35.0(jiti@1.21.7)) + eslint: 9.32.0(jiti@1.21.7) + eslint-compat-utils: 0.6.5(eslint@9.32.0(jiti@1.21.7)) lodash: 4.17.21 toml-eslint-parser: 0.10.0 transitivePeerDependencies: @@ -15994,7 +16027,7 @@ snapshots: dependencies: language-subtag-registry: 0.3.23 - launch-ide@1.0.1: + launch-ide@1.2.0: dependencies: chalk: 4.1.1 dotenv: 16.6.1 @@ -18769,12 +18802,6 @@ snapshots: '@types/unist': 3.0.3 vfile-message: 4.0.2 - vite-code-inspector-plugin@0.18.3: - dependencies: - code-inspector-core: 0.18.3 - transitivePeerDependencies: - - supports-color - vm-browserify@1.1.2: {} void-elements@3.1.0: {} @@ -18799,7 +18826,7 @@ snapshots: vue-eslint-parser@10.2.0(eslint@9.32.0(jiti@1.21.7)): dependencies: debug: 4.4.0 - eslint: 9.35.0(jiti@1.21.7) + eslint: 9.32.0(jiti@1.21.7) eslint-scope: 8.4.0 eslint-visitor-keys: 4.2.1 espree: 10.4.0 @@ -18845,12 +18872,6 @@ snapshots: - bufferutil - utf-8-validate - webpack-code-inspector-plugin@0.18.3: - dependencies: - code-inspector-core: 0.18.3 - transitivePeerDependencies: - - supports-color - webpack-dev-middleware@6.1.3(webpack@5.100.2(esbuild@0.25.0)(uglify-js@3.19.3)): dependencies: colorette: 2.0.20 diff --git a/web/tsconfig.json b/web/tsconfig.json index c3e0bca665..3b022e4708 100644 --- a/web/tsconfig.json +++ b/web/tsconfig.json @@ -26,6 +26,9 @@ "paths": { "@/*": [ "./*" + ], + "~@/*": [ + "./*" ] } },