Skip to content

feat: migrate from Vite to Next.js 15 (App Router) - #28

Merged
kanare-dev merged 8 commits into
mainfrom
feat/nextjs-migration
Apr 3, 2026
Merged

feat: migrate from Vite to Next.js 15 (App Router)#28
kanare-dev merged 8 commits into
mainfrom
feat/nextjs-migration

Conversation

@kanare-dev

@kanare-dev kanare-dev commented Apr 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • ViteからNext.js 15 (App Router)へ移行
  • app/layout.jsx(Server Component)でメタデータ・OGP・構造化データを管理
  • virtual:badges ViteプラグインをNext.js API Route(/api/badges)に置き換え
  • ThemeContextSectionContextuseMediaQuery をSSR対応に修正
  • ProfileImage のローカル画像importを.srcアクセスに修正
  • sitemap.xml 自動生成・robots.txt を追加
  • Vite関連ファイル(vite.config.js, index.html, src/main.jsx)を削除

Test plan

  • npm run dev でローカル起動 → 全セクション表示・ナビ動作確認
  • ダーク/ライトモード切替の動作確認
  • プロフィール写真の表示確認
  • スキルセクションのバッジ表示確認(/api/badges
  • npm run build がエラーなく完了すること
  • /sitemap.xml/robots.txt にアクセスできること
  • CI (GitHub Actions) がパスすること
  • Vercel プレビューデプロイの動作確認

🤖 Generated with Claude Code

kanare-dev and others added 3 commits April 3, 2026 21:17
- Replace Vite build with Next.js 15 App Router
- Add app/layout.jsx (Server Component) with metadata, OGP, structured data
- Add app/page.jsx and app/providers.jsx (Client Components)
- Replace virtual:badges Vite plugin with /api/badges API Route
- Fix SSR issues in ThemeContext, SectionContext, useMediaQuery
- Fix ProfileImage to use .src from Next.js static image imports
- Add sitemap.xml auto-generation and robots.txt
- Update README to reflect Next.js stack

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace Vite build output (dist/) with Next.js (.next/, out/).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove plugins/ (vite-plugin-badges.js)
- Remove scripts/ (badge-fetcher.js, fetch-badge-data.js)
- Remove dist/ build artifact

Badge fetching is now handled by app/api/badges/route.js.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented Apr 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
kodera-kanare Ready Ready Preview, Comment Apr 3, 2026 0:42am

Fixes Vercel build failure caused by old Vite project settings
that looked for the "dist" output directory.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
writeCache failures (e.g. read-only filesystem on Vercel) no longer
cause the entire request to fail. Badge data is now returned even when
caching is unavailable.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add scripts/fetch-badges.js to generate src/data/badges.json
- Commit fetched badge data as src/data/badges.json
- Import badges directly in Skills.jsx (no runtime fetch needed)
- Remove app/api/badges route (no longer needed)
- All pages are now fully static (no server-rendered routes)

To update badges: run `node scripts/fetch-badges.js` and commit the result.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace outdated API Route description with new static JSON approach.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@kanare-dev
kanare-dev merged commit bbfc43c into main Apr 3, 2026
3 checks passed
@kanare-dev
kanare-dev deleted the feat/nextjs-migration branch April 3, 2026 12:44
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.

サイトの内容をクローラーが拾えるようにする(Next.jsに移行し、SSRによるSEO対策に対応する)

1 participant