Skip to content

chore: upgrade to Next.js 15, TypeScript 5, and converge the toolchain#217

Open
Carnage1999 wants to merge 15 commits intomtvpls:mainfrom
Carnage1999:chore/next15-typescript-toolchain
Open

chore: upgrade to Next.js 15, TypeScript 5, and converge the toolchain#217
Carnage1999 wants to merge 15 commits intomtvpls:mainfrom
Carnage1999:chore/next15-typescript-toolchain

Conversation

@Carnage1999
Copy link
Copy Markdown

@Carnage1999 Carnage1999 commented Mar 13, 2026

核心變更

  • 升級 Next.js 15、React 19、TypeScript 5,並修正 App Router 與型別相容性問題。
  • 將可安全遷移的執行腳本與設定檔持續從 JS 遷移到 TS。
  • 收斂 lint / build / test / Cloudflare 相關工具鏈,讓目前分支可完成 lint、typecheck、test、build。

謹慎合併

  • 這不是小型 PR,而是框架升級加工具鏈收斂的整合性變更。
  • 變更面涵蓋依賴版本、App Router handler、React 19 型別、ESLint 9 flat config,以及多個 config / runtime 檔案遷移。
  • 建議原作者合併前至少再檢查部署流程、Cloudflare 路徑、登入 / refresh token 流程,以及常用播放與搜尋頁面。

- migrate app router handlers and React 19 typing updates
- clean build, test, and config behavior for the new toolchain
- normalize Cloudflare and lockfile dependencies after the upgrade
- remove deprecated stub type packages now covered by runtime packages
- add explicit jest globals typing and move eslint to the supported 9.x line
- keep the current eslintrc setup via legacy mode until a flat-config migration
- replace the legacy eslintrc file with an eslint.config.js entrypoint
- remove ESLINT_USE_FLAT_CONFIG overrides from lint scripts
- keep the existing Next.js and TypeScript lint rules under ESLint 9
- replace the remaining safe JS config files with TypeScript equivalents
- keep next, jest, and eslint configs in JS where the current toolchain still expects them
- align package manager metadata with the current pnpm version
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on a significant modernization effort, bringing the project's core dependencies up to date with Next.js 15, React 19, and TypeScript 5. It also streamlines the development and deployment toolchain by migrating various configurations and server-side logic to TypeScript, ensuring a more robust and type-safe codebase. These changes aim to improve performance, developer experience, and future maintainability.

Highlights

  • Framework Upgrades: Upgraded Next.js to version 15, React to version 19, and TypeScript to version 5, including necessary compatibility fixes for App Router and typing.
  • Toolchain Modernization: Migrated various runtime scripts and configuration files from JavaScript to TypeScript, including ESLint configuration to the new flat config format (ESLint 9).
  • Build and Deployment Enhancements: Updated Dockerfile to use TypeScript entry points for custom server and start scripts, and added conditional PWA build support in next.config.js.
  • API Route Refinements: Implemented minor code style improvements, type annotations, and removed redundant checks across numerous API routes to enhance code quality and maintainability.
  • Watch Room Server Migration: Converted the Watch Room server logic, including Socket.IO handling, to TypeScript with comprehensive type annotations.
  • Data Migration Scripts Update: Migrated data migration and initialization scripts for SQLite and PostgreSQL to TypeScript, improving type safety and consistency.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • .eslintrc.js
    • Removed the old ESLint configuration file.
  • .github/ISSUE_TEMPLATE/bug.yaml
    • Performed minor formatting adjustments.
  • .github/ISSUE_TEMPLATE/question.yml
    • Performed minor formatting adjustments.
  • .github/ISSUE_TEMPLATE/功能请求.md
    • Performed minor formatting adjustments.
  • .prettierrc.js
    • Renamed to .prettierrc.ts and converted to TypeScript.
  • Dockerfile
    • Updated to use TypeScript entry points (start.ts, server.ts) with tsx.
  • README.md
    • Updated the TypeScript version badge to 5.x and performed minor formatting.
  • VERCEL_DEPLOYMENT.md
    • Performed minor formatting adjustments.
  • commitlint.config.js
    • Renamed to commitlint.config.ts, converted to TypeScript, and removed commented lines.
  • eslint.config.js
    • Added a new ESLint flat configuration file.
  • jest.config.js
    • Updated next/jest import, changed setupFilesAfterEnv to .ts, and added modulePathIgnorePatterns.
  • jest.setup.js
    • Renamed to jest.setup.ts, converted to TypeScript, and removed a comment.
  • next.config.js
    • Removed swcMinify and experimental.instrumentationHook, updated webpack SVG rules, and added conditional PWA loading.
  • package.json
    • Updated dependencies including Next.js, React, TypeScript, ESLint, Prettier, tsx, and workbox-build. Modified scripts to use tsx for various commands and added a build:pwa script.
  • postcss.config.js
    • Renamed to postcss.config.ts and converted to TypeScript.
  • proxy.worker.js
    • Renamed to proxy.worker.ts, converted to TypeScript, and added type annotations.
  • scripts/convert-changelog.js
    • Renamed to scripts/convert-changelog.ts, converted to TypeScript, and added interfaces and type annotations.
  • scripts/generate-manifest.js
    • Removed the JavaScript version of the manifest generation script.
  • scripts/generate-manifest.ts
    • Added a TypeScript version of the manifest generation script.
  • scripts/init-postgres.js
    • Renamed to scripts/init-postgres.ts, converted to TypeScript, and added type annotations.
  • scripts/init-sqlite.js
    • Renamed to scripts/init-sqlite.ts, converted to TypeScript, and added type annotations.
  • scripts/reset-sqlite.ts
    • Added a new script for resetting SQLite databases.
  • server.js
    • Renamed to server.ts, converted to TypeScript, and added type annotations for Socket.IO and WatchRoomServer.
  • server/watch-room-standalone-server.js
    • Removed the JavaScript version of the standalone Watch Room server.
  • server/watch-room-standalone-server.ts
    • Added a TypeScript version of the standalone Watch Room server.
  • src/app/api/acg/acgrip/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/acg/dmhy/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/acg/download/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/acg/mikan/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/ad-filter/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/admin/ai/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/admin/anime-subscription/[id]/check/route.ts
    • Updated API route to await params and added type annotations.
  • src/app/api/admin/anime-subscription/[id]/route.ts
    • Updated API route to await params and added type annotations.
  • src/app/api/admin/anime-subscription/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/admin/anime-subscription/toggle/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/admin/category/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/admin/config/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/admin/config_file/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/admin/config_subscription/fetch/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/admin/data_migration/export/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/admin/data_migration/import/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/admin/data_migration/progress/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/admin/email/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/admin/emby/export/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/admin/emby/import/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/admin/emby/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/admin/live/refresh/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/admin/live/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/admin/migrate-users/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/admin/music/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/admin/oidc-discover/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/admin/openlist/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/admin/reload/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/admin/reset/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/admin/site/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/admin/source/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/admin/source/validate/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/admin/theme/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/admin/user/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/admin/users/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/admin/web-live/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/admin/xiaoya/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/ai/chat/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/auth/oidc/callback/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/auth/oidc/complete-register/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/auth/oidc/login/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/auth/oidc/session-info/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/auth/refresh/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/change-password/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/cms-proxy/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/cron/[password]/route.ts
    • Updated API route to await params and added type annotations.
  • src/app/api/danmaku-filter/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/danmaku/comment/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/danmaku/episodes/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/danmaku/match/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/danmaku/search/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/detail/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/douban-comments/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/douban-recommendations/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/douban/categories/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/douban/detail/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/douban/recommends/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/douban/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/douban/search/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/duanju/recommends/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/duanju/sources/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/emby/cms-proxy/[token]/route.ts
    • Updated API route to await params and added type annotations.
  • src/app/api/emby/detail/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/emby/image/[token]/[itemId]/route.ts
    • Updated API route to await params and added type annotations.
  • src/app/api/emby/list/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/emby/play/[token]/[filename]/route.ts
    • Updated API route to await params and added type annotations.
  • src/app/api/emby/sources/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/emby/views/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/favorites/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/image-proxy/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/live/channels/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/live/epg/download/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/live/epg/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/live/precheck/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/live/sources/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/login/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/movie-requests/[id]/route.ts
    • Updated API route to await params and added type annotations.
  • src/app/api/movie-requests/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/music/audio-proxy/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/music/playlists/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/music/playlists/songs/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/music/playrecords/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/music/proxy/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/music/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/notifications/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/offline-download/local/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/offline-download/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/openlist/check/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/openlist/cms-proxy/[token]/route.ts
    • Updated API route to await params and added type annotations.
  • src/app/api/openlist/delete/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/openlist/detail/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/openlist/list/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/openlist/play/[token]/route.ts
    • Updated API route to await params and added type annotations.
  • src/app/api/openlist/play/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/openlist/refresh-video/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/openlist/refresh/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/openlist/scan-progress/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/pansou/search/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/playrecords/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/proxy-m3u8/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/proxy/key/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/proxy/logo/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/proxy/m3u8/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/proxy/segment/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/proxy/vod/key/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/proxy/vod/m3u8/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/proxy/vod/segment/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/register/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/search/one/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/search/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/search/suggestions/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/search/ws/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/searchhistory/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/server-config/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/skipconfigs/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/source-detail/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/source-search/categories/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/source-search/search/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/source-search/sources/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/source-search/videos/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/tmdb-details/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/tmdb-recommendations/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/tmdb/credits/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/tmdb/detail/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/tmdb/episodes/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/tmdb/search/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/tmdb/seasons/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/tmdb/trending/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/tmdb/upcoming/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/tvbox/config/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/tvbox/subscribe/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/user/email-settings/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/user/tvbox-token/reset/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/user/tvbox-token/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/video-proxy/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/web-live/proxy/[filename]/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/web-live/sources/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/web-live/stream/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/xiaoya/browse/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/xiaoya/play/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/api/xiaoya/search/route.ts
    • Updated API route with minor code style changes and type annotations.
  • src/app/douban/page.tsx
    • Updated page component with minor code style and type annotation changes.
  • src/app/globals.css
    • Updated global CSS with minor formatting changes.
  • src/app/layout.tsx
    • Updated root layout to load runtime configuration for Next.js 15 compatibility and added use client directive.
  • src/app/live/page.tsx
    • Updated live page component with Artplayer, Hls, flvjs imports, added type annotations, and minor logic adjustments for Anime4K and channel handling.
  • src/app/login/page.tsx
    • Updated login page component with OIDC provider icon logic, Turnstile integration, and general type annotations.
  • src/app/movie-request/page.tsx
    • Updated movie request page component with TMDB image processing, alert modal handling, and general type annotations.
  • src/app/oidc-register/page.tsx
    • Updated OIDC register page component with OIDC session handling and type annotations.
  • src/app/page.tsx
    • Updated home page component with runtime configuration loading, home module filtering, and general type annotations.
  • src/app/private-library/page.tsx
    • Updated private library page component with source parsing, Emby/Xiaoya logic, sorting, and general type annotations.
  • src/app/register/page.tsx
    • Updated register page component with Turnstile integration and general type annotations.
  • src/app/search/page.tsx
    • Updated search page component with search logic, filtering, sorting, EventSource handling, and general type annotations.
  • src/app/source-search/page.tsx
    • Updated source search page component with API calls and general type annotations.
Ignored Files
  • Ignored by pattern: .github/workflows/** (3)
    • .github/workflows/cloudflare-deploy.yml
    • .github/workflows/docker-image-dev.yml
    • .github/workflows/docker-image.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request successfully upgrades the project to Next.js 15, React 19, and TypeScript 5, and migrates a significant portion of the codebase from JavaScript to TypeScript. The toolchain convergence, including the move to ESLint's flat config, is well-executed. These changes greatly improve the project's maintainability and keep it up-to-date with the latest standards. I have one suggestion regarding the test script configuration to ensure the test suite remains effective.

"typecheck": "tsc --noEmit --incremental false",
"test:watch": "jest --watch",
"test": "jest",
"test": "jest --passWithNoTests",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The test script has been modified to include the --passWithNoTests flag. While this can be useful to unblock CI during large migrations, it effectively silences the test runner if no tests are found, which might hide broken test suites or a lack of tests. To ensure regressions aren't accidentally introduced, it's best to remove this flag and confirm that all tests are discovered and executed correctly.

Suggested change
"test": "jest --passWithNoTests",
"test": "jest",

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

這是一個規模較大但執行得很好的 PR,成功將專案升級至 Next.js 15、React 19 和 TypeScript 5。將各種設定檔和執行腳本從 JavaScript 遷移到 TypeScript,對於專案的可維護性和型別安全是一項重大的改進。同時,對 lint、建置和測試工具鏈的整合也是一個值得稱讚的增強。

我的審查意見主要集中在幾個次要問題上,主要是一些在合併前應移除的殘留調試程式碼。總體而言,這些變更很紮實,並與 PR 的目標一致。鑑於升級規模之大,作者提醒謹慎合併並在合併後進行徹底檢查的建議是非常恰當的。

// 构建 Emby 原始播放链接(强制获取直接URL,避免代理循环)
let embyStreamUrl = await client.getStreamUrl(itemId, true, true);
console.log(embyStreamUrl)
console.log(embyStreamUrl);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

這個 console.log 語句似乎是調試時遺留的。建議將其移除,以保持生產環境日誌的整潔。


export async function GET(request: NextRequest) {
console.log(request.url)
console.log(request.url);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

這個 console.log 語句看起來是出於調試目的。最好將其刪除,以避免在生產環境中產生不必要的輸出。

@Carnage1999 Carnage1999 force-pushed the chore/next15-typescript-toolchain branch 2 times, most recently from 6353c26 to 7f40bc9 Compare March 14, 2026 03:07
- Changed Jest router mock from 'next/router' to 'next/navigation'.
- Deleted old Next.js configuration file and created a new one with TypeScript support.
- Updated package.json to include new ESLint and Jest dependencies.
- Removed postcss.config.ts and replaced it with postcss.config.mjs.
- Added ESLint configuration file with custom rules and plugins.
- Updated TypeScript configuration to target ES2022 and changed module resolution to 'bundler'.
- Wrapped components in Suspense for better loading management in various pages.
- Adjusted Tailwind CSS configuration to include only necessary paths.
- crypto-js -> Node.js built-in crypto (EVP_BytesToKey compat)

- flv.js -> mpegts.js (same author, actively maintained)

- remark-gfm 3 -> 4
@Carnage1999 Carnage1999 deleted the chore/next15-typescript-toolchain branch March 15, 2026 02:47
@Carnage1999 Carnage1999 restored the chore/next15-typescript-toolchain branch March 15, 2026 02:49
@Carnage1999 Carnage1999 reopened this Mar 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant