chore: upgrade to Next.js 15, TypeScript 5, and converge the toolchain#217
chore: upgrade to Next.js 15, TypeScript 5, and converge the toolchain#217Carnage1999 wants to merge 15 commits intomtvpls:mainfrom
Conversation
- 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
Summary of ChangesHello, 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
🧠 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
Ignored Files
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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.
| "test": "jest --passWithNoTests", | |
| "test": "jest", |
There was a problem hiding this comment.
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); |
|
|
||
| export async function GET(request: NextRequest) { | ||
| console.log(request.url) | ||
| console.log(request.url); |
6353c26 to
7f40bc9
Compare
- 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
核心變更
謹慎合併