Commit 748d9f3
build(frontend): Next.js 16アップグレード後のビルド修復と依存整理 (#249)
## Why
依存アップグレード(Next.js 16 / React 19 / ESLint 9 フラットコンフィグ等)で `yarn build` /
`yarn lint` / CI インストールが壊れていたので、ビルドチェーンを再び通るようにする。併せて調査中に判明した Tailwind /
shadcn スタック一式や、役目を終えた依存の残骸も掃除する。
## What
### Next.js 16 / ESLint 9 アップグレード対応
- `next lint` 廃止に伴う ESLint フラットコンフィグ移行(`eslint.config.mjs`)
- Next.js 16 の purity lint / set-state-in-effect ルールに合わせた
`GameTyping.tsx` / `RankingTabs.tsx` / `game/page.tsx` の修正
- `tsconfig.json` を Next.js の自動補正(`jsx: react-jsx` /
`.next/dev/types/**` の include 追加)に追従
### Tailwind / shadcn スタック撤去
実態として `@tailwind` ディレクティブも Tailwind
ユーティリティクラスも使われていないため、関連パッケージ・設定ファイルを一式削除:
- **dependencies** 削除: `clsx`, `tailwind-merge`, `tailwindcss-animate`,
`@radix-ui/react-slot`, `@radix-ui/react-toast`,
`class-variance-authority`, `lucide-react`
- **devDependencies** 削除: `tailwindcss`, `@tailwindcss/postcss`,
`postcss`, `autoprefixer`
- **ファイル削除**: `tailwind.config.ts`, `postcss.config.js`,
`src/libs/shadcn/`
- autoprefixing は Next.js 組み込みの PostCSS パイプライン(`postcss-preset-env`)に委譲
### 依存整備
- `@testing-library/react` の peer 要件である `@testing-library/dom` を明示追加
- `prettier` を `dependencies` → `devDependencies` に分類修正
- `@types/node` / `eslint` / `prettier` / `tsx` の patch / minor 追従
- `@next/codemod` が自動挿入した `@types/react` / `@types/react-dom` の
`resolutions` ブロックを削除(React 19 エコシステム成熟により不要、むしろ古い `19.0.1` / `19.0.2`
に固定される副作用が出ていた)
- `openapi-typescript` v6 → v7 bump に合わせて `v1.d.ts` を v7 format で再生成
- `RankingTabs.tsx` の未使用 `useCallback` import 削除
- Yarn 4(Corepack)で `yarn.lock` をクリーン再生成
## How
- `tsconfig.json` の差分(`jsx` 変更・include 追加)は Next.js 16 が `next build`
時に自動で書き戻すもので、手動の設計変更ではない。ログ上も `jsx was set to react-jsx (next.js uses
the React automatic runtime)` として明示される。
- `postcss.config.js` を削除することで Next.js 組み込みの PostCSS
デフォルトにフォールバックする構成。最終出力 CSS(ベンダープレフィックス等)は従前と同じ。
- ESLint は `^9.39.4` 固定(v10 非対応): `eslint-plugin-react` が ESLint v10
で削除されたレガシー API(`context.getFilename()`)に依存しているため、上流修正
([jsx-eslint/eslint-plugin-react#3979](jsx-eslint/eslint-plugin-react#3979))
が公開されるまで v9 に留める。参考:
[vercel/next.js#89764](vercel/next.js#89764)
- lint は 0 errors(既存の `<img>` 6 件と 1 件の `react-hooks/exhaustive-deps`
警告のみ残る。いずれも今回のスコープ外)
## Validation
- `corepack yarn install --immutable`
- `corepack yarn format:ci`
- `corepack yarn lint`
- `corepack yarn build`
- `corepack yarn test --runInBand`
## References
- [Next.js 16 upgrade
guide](https://nextjs.org/docs/app/guides/upgrading/version-16)
- [Next.js ESLint migration / flat
config](https://nextjs.org/docs/app/api-reference/config/eslint)
- [Next.js
codemods](https://nextjs.org/docs/app/guides/upgrading/codemods)
- [Tailwind CSS v4 upgrade
guide](https://tailwindcss.com/docs/upgrade-guide)
- [vercel/next.js#89764 — ESLint v10
incompatibility](vercel/next.js#89764)
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 0605784 commit 748d9f3
File tree
12 files changed
+2449
-3034
lines changed- typing-app
- src
- app/game
- components
- organism
- templates
- libs
- api
- shadcn
12 files changed
+2449
-3034
lines changedThis file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
27 | 21 | | |
28 | | - | |
29 | | - | |
30 | | - | |
| 22 | + | |
31 | 23 | | |
32 | 24 | | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
51 | 42 | | |
52 | 43 | | |
53 | 44 | | |
54 | 45 | | |
55 | 46 | | |
56 | 47 | | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | 48 | | |
62 | 49 | | |
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
6 | 11 | | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
66 | 71 | | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
| 72 | + | |
76 | 73 | | |
77 | | - | |
78 | | - | |
79 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
80 | 92 | | |
81 | 93 | | |
82 | 94 | | |
| |||
118 | 130 | | |
119 | 131 | | |
120 | 132 | | |
121 | | - | |
| 133 | + | |
122 | 134 | | |
123 | 135 | | |
124 | 136 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
0 commit comments