Upgrade to Next.js 16 with Turbopack and Contentlayer2

- Upgraded Next.js to v16, React to v19
- Migrated from contentlayer to contentlayer2
- Migrated to Turbopack by decoupling Contentlayer from webpack
- Updated all page components to handle async params (Next.js 15+ breaking change)
- Changed package.json to type: module and renamed config files to .cjs
- Updated README with current tech stack and article creation instructions
- Fixed tag encoding issue (removed double encoding)
- All security vulnerabilities resolved (npm audit: 0 vulnerabilities)
This commit is contained in:
2025-11-19 22:43:14 +08:00
parent 4c08413936
commit a4db9688b6
11 changed files with 1435 additions and 427 deletions

View File

@@ -4,9 +4,9 @@
"description": "",
"main": "index.js",
"scripts": {
"dev": "next dev",
"dev": "concurrently \"contentlayer2 dev\" \"next dev\"",
"sync-assets": "node scripts/sync-assets.mjs",
"build": "npm run sync-assets && next build",
"build": "npm run sync-assets && contentlayer2 build && next build",
"start": "next start",
"lint": "next lint",
"contentlayer": "contentlayer build"
@@ -14,8 +14,10 @@
"keywords": [],
"author": "",
"license": "ISC",
"type": "commonjs",
"type": "module",
"dependencies": {
"@emotion/is-prop-valid": "^1.4.0",
"@fortawesome/fontawesome-svg-core": "^7.1.0",
"@fortawesome/free-brands-svg-icons": "^7.1.0",
"@fortawesome/free-solid-svg-icons": "^7.1.0",
"@fortawesome/react-fontawesome": "^3.1.0",
@@ -24,11 +26,11 @@
"framer-motion": "^12.23.24",
"gray-matter": "^4.0.3",
"markdown-wasm": "^1.2.0",
"next": "^13.5.11",
"next": "^16.0.3",
"next-contentlayer2": "^0.5.8",
"next-themes": "^0.4.6",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "^19.2.0",
"react-dom": "^19.2.0",
"rehype-autolink-headings": "^7.1.0",
"rehype-slug": "^6.0.0",
"remark-gfm": "^4.0.1",
@@ -40,10 +42,11 @@
"@types/node": "^24.10.1",
"@types/react": "^19.2.5",
"autoprefixer": "^10.4.22",
"concurrently": "^9.2.1",
"eslint": "^8.57.1",
"eslint-config-next": "^13.5.11",
"eslint-config-next": "^16.0.3",
"postcss": "^8.5.6",
"tailwindcss": "^3.4.18",
"typescript": "^5.9.3"
}
}
}