Add bundle analyzer configuration

Configure @next/bundle-analyzer for production bundle analysis:

**Changes:**
- Install @next/bundle-analyzer package
- Update next.config.mjs to wrap config with bundle analyzer
- Add npm script `build:analyze` to run build with ANALYZE=true
- Bundle analyzer only enabled when ANALYZE=true environment variable is set

**Usage:**
```bash
# Run build with bundle analysis
npm run build:analyze

# Opens interactive bundle visualization in browser
# Shows chunk sizes, module dependencies, and optimization opportunities
```

**Note:** Kept Mastodon feed as Client Component (not Server Component)
because formatRelativeTime() uses `new Date()` which requires dynamic
rendering. Converting to Server Component would prevent static generation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-20 22:00:02 +08:00
parent 0bb3ee40c6
commit ba60d49fc6
5 changed files with 324 additions and 133 deletions

View File

@@ -1,6 +1,5 @@
import { SiteHeader } from './site-header'; import { SiteHeader } from './site-header';
import { SiteFooter } from './site-footer'; import { SiteFooter } from './site-footer';
import { BackToTop } from './back-to-top'; import { BackToTop } from './back-to-top';
export function LayoutShell({ children }: { children: React.ReactNode }) { export function LayoutShell({ children }: { children: React.ReactNode }) {

View File

@@ -1,3 +1,6 @@
'use client';
import { useEffect, useState } from 'react';
import { FaMastodon } from 'react-icons/fa'; import { FaMastodon } from 'react-icons/fa';
import { FiArrowRight } from 'react-icons/fi'; import { FiArrowRight } from 'react-icons/fi';
import { siteConfig } from '@/lib/config'; import { siteConfig } from '@/lib/config';
@@ -6,95 +9,65 @@ import {
stripHtml, stripHtml,
truncateText, truncateText,
formatRelativeTime, formatRelativeTime,
fetchAccountId,
fetchStatuses,
type MastodonStatus type MastodonStatus
} from '@/lib/mastodon'; } from '@/lib/mastodon';
/** export function MastodonFeed() {
* Fetch user's Mastodon account ID from username with ISR const [statuses, setStatuses] = useState<MastodonStatus[]>([]);
*/ const [loading, setLoading] = useState(true);
async function fetchAccountId(instance: string, username: string): Promise<string | null> { const [error, setError] = useState(false);
try {
const response = await fetch( useEffect(() => {
`https://${instance}/api/v1/accounts/lookup?acct=${username}`, const loadStatuses = async () => {
{ const mastodonUrl = siteConfig.social.mastodon;
next: { revalidate: 1800 } // Revalidate every 30 minutes
if (!mastodonUrl) {
setLoading(false);
return;
} }
);
if (!response.ok) return null; try {
// Parse the Mastodon URL
const parsed = parseMastodonUrl(mastodonUrl);
if (!parsed) {
setError(true);
setLoading(false);
return;
}
const account = await response.json(); const { instance, username } = parsed;
return account.id;
} catch (error) {
console.error('Error fetching Mastodon account:', error);
return null;
}
}
/** // Fetch account ID
* Fetch user's recent statuses from Mastodon with ISR const accountId = await fetchAccountId(instance, username);
*/ if (!accountId) {
async function fetchStatuses( setError(true);
instance: string, setLoading(false);
accountId: string, return;
limit: number = 5 }
): Promise<MastodonStatus[]> {
try { // Fetch statuses (5 posts, exclude replies, include boosts)
const response = await fetch( const fetchedStatuses = await fetchStatuses(instance, accountId, 5);
`https://${instance}/api/v1/accounts/${accountId}/statuses?limit=${limit}&exclude_replies=true`, setStatuses(fetchedStatuses);
{ } catch (err) {
next: { revalidate: 1800 } // Revalidate every 30 minutes console.error('Error loading Mastodon feed:', err);
setError(true);
} finally {
setLoading(false);
} }
); };
if (!response.ok) return []; loadStatuses();
}, []);
const statuses = await response.json();
return statuses;
} catch (error) {
console.error('Error fetching Mastodon statuses:', error);
return [];
}
}
/**
* Server Component for Mastodon feed with ISR
*/
export async function MastodonFeed() {
const mastodonUrl = siteConfig.social.mastodon;
// Don't render if no Mastodon URL is configured // Don't render if no Mastodon URL is configured
if (!mastodonUrl) { if (!siteConfig.social.mastodon) {
return null; return null;
} }
let statuses: MastodonStatus[] = []; // Don't render if there's an error (fail silently)
if (error) {
try {
// Parse the Mastodon URL
const parsed = parseMastodonUrl(mastodonUrl);
if (!parsed) {
return null;
}
const { instance, username } = parsed;
// Fetch account ID
const accountId = await fetchAccountId(instance, username);
if (!accountId) {
return null;
}
// Fetch statuses (5 posts, exclude replies, include boosts)
statuses = await fetchStatuses(instance, accountId, 5);
} catch (err) {
console.error('Error loading Mastodon feed:', err);
// Fail silently - don't render component on error
return null;
}
// Don't render if no statuses
if (statuses.length === 0) {
return null; return null;
} }
@@ -107,66 +80,84 @@ export async function MastodonFeed() {
</div> </div>
{/* Content */} {/* Content */}
<div className="space-y-3"> {loading ? (
{statuses.map((status) => { <div className="space-y-3">
// Handle boosts (reblogs) {[...Array(3)].map((_, i) => (
const displayStatus = status.reblog || status; <div key={i} className="animate-pulse">
const content = stripHtml(displayStatus.content); <div className="h-3 w-3/4 rounded bg-slate-200 dark:bg-slate-800"></div>
const truncated = truncateText(content, 180); <div className="mt-2 h-3 w-full rounded bg-slate-200 dark:bg-slate-800"></div>
const relativeTime = formatRelativeTime(status.created_at); <div className="mt-2 h-2 w-1/3 rounded bg-slate-200 dark:bg-slate-800"></div>
const hasMedia = displayStatus.media_attachments.length > 0; </div>
))}
</div>
) : statuses.length === 0 ? (
<p className="type-small text-slate-400 dark:text-slate-500">
</p>
) : (
<div className="space-y-3">
{statuses.map((status) => {
// Handle boosts (reblogs)
const displayStatus = status.reblog || status;
const content = stripHtml(displayStatus.content);
const truncated = truncateText(content, 180);
const relativeTime = formatRelativeTime(status.created_at);
const hasMedia = displayStatus.media_attachments.length > 0;
return ( return (
<article key={status.id} className="group/post"> <article key={status.id} className="group/post">
<a <a
href={status.url} href={status.url}
target="_blank" target="_blank"
rel="noopener noreferrer" rel="noopener noreferrer"
className="block space-y-1.5 transition-opacity hover:opacity-70" className="block space-y-1.5 transition-opacity hover:opacity-70"
>
{/* Boost indicator */}
{status.reblog && (
<div className="type-small flex items-center gap-1 text-slate-400 dark:text-slate-500">
<FiArrowRight className="h-2.5 w-2.5 rotate-90" />
<span></span>
</div>
)}
{/* Content */}
<p className="text-sm leading-relaxed text-slate-700 dark:text-slate-200">
{truncated}
</p>
{/* Media indicator */}
{hasMedia && (
<div className="type-small text-slate-400 dark:text-slate-500">
📎 {displayStatus.media_attachments.length}
</div>
)}
{/* Timestamp */}
<time
className="type-small block text-slate-400 dark:text-slate-500"
dateTime={status.created_at}
> >
{relativeTime} {/* Boost indicator */}
</time> {status.reblog && (
</a> <div className="type-small flex items-center gap-1 text-slate-400 dark:text-slate-500">
</article> <FiArrowRight className="h-2.5 w-2.5 rotate-90" />
); <span></span>
})} </div>
</div> )}
{/* Content */}
<p className="text-sm leading-relaxed text-slate-700 dark:text-slate-200">
{truncated}
</p>
{/* Media indicator */}
{hasMedia && (
<div className="type-small text-slate-400 dark:text-slate-500">
📎 {displayStatus.media_attachments.length}
</div>
)}
{/* Timestamp */}
<time
className="type-small block text-slate-400 dark:text-slate-500"
dateTime={status.created_at}
>
{relativeTime}
</time>
</a>
</article>
);
})}
</div>
)}
{/* Footer link */} {/* Footer link */}
<a {!loading && statuses.length > 0 && (
href={siteConfig.social.mastodon} <a
target="_blank" href={siteConfig.social.mastodon}
rel="noopener noreferrer" target="_blank"
className="type-small mt-3 flex items-center justify-end gap-1.5 text-slate-500 transition-colors hover:text-accent-textLight dark:text-slate-400 dark:hover:text-accent-textDark" rel="noopener noreferrer"
> className="type-small mt-3 flex items-center justify-end gap-1.5 text-slate-500 transition-colors hover:text-accent-textLight dark:text-slate-400 dark:hover:text-accent-textDark"
>
<FiArrowRight className="h-3 w-3" />
</a> <FiArrowRight className="h-3 w-3" />
</a>
)}
</section> </section>
); );
} }

View File

@@ -1,3 +1,9 @@
import bundleAnalyzer from '@next/bundle-analyzer';
const withBundleAnalyzer = bundleAnalyzer({
enabled: process.env.ANALYZE === 'true',
});
/** @type {import('next').NextConfig} */ /** @type {import('next').NextConfig} */
const nextConfig = { const nextConfig = {
// Image optimization configuration // Image optimization configuration
@@ -35,4 +41,4 @@ const nextConfig = {
}, },
}; };
export default nextConfig; export default withBundleAnalyzer(nextConfig);

193
package-lock.json generated
View File

@@ -31,6 +31,7 @@
"unist-util-visit": "^5.0.0" "unist-util-visit": "^5.0.0"
}, },
"devDependencies": { "devDependencies": {
"@next/bundle-analyzer": "^16.0.3",
"@tailwindcss/typography": "^0.5.19", "@tailwindcss/typography": "^0.5.19",
"@types/node": "^24.10.1", "@types/node": "^24.10.1",
"@types/react": "^19.2.5", "@types/react": "^19.2.5",
@@ -448,6 +449,16 @@
} }
} }
}, },
"node_modules/@discoveryjs/json-ext": {
"version": "0.5.7",
"resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz",
"integrity": "sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=10.0.0"
}
},
"node_modules/@effect-ts/core": { "node_modules/@effect-ts/core": {
"version": "0.60.5", "version": "0.60.5",
"resolved": "https://registry.npmjs.org/@effect-ts/core/-/core-0.60.5.tgz", "resolved": "https://registry.npmjs.org/@effect-ts/core/-/core-0.60.5.tgz",
@@ -1945,6 +1956,16 @@
"@tybys/wasm-util": "^0.10.0" "@tybys/wasm-util": "^0.10.0"
} }
}, },
"node_modules/@next/bundle-analyzer": {
"version": "16.0.3",
"resolved": "https://registry.npmjs.org/@next/bundle-analyzer/-/bundle-analyzer-16.0.3.tgz",
"integrity": "sha512-6Xo8f8/ZXtASfTPa6TH1aUn+xDg9Pkyl1YHVxu+89cVdLH7MnYjxv3rPOfEJ9BwCZCU2q4Flyw5MwltfD2pGbA==",
"dev": true,
"license": "MIT",
"dependencies": {
"webpack-bundle-analyzer": "4.10.1"
}
},
"node_modules/@next/env": { "node_modules/@next/env": {
"version": "16.0.3", "version": "16.0.3",
"resolved": "https://registry.npmjs.org/@next/env/-/env-16.0.3.tgz", "resolved": "https://registry.npmjs.org/@next/env/-/env-16.0.3.tgz",
@@ -2526,6 +2547,13 @@
"node": ">=14" "node": ">=14"
} }
}, },
"node_modules/@polka/url": {
"version": "1.0.0-next.29",
"resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.29.tgz",
"integrity": "sha512-wwQAWhWSuHaag8c4q/KN/vCoeOJYshAIvMQwD4GpSb3OiZklFfvAgmj0VCBBImRpuF/aFgIRzllXlVX93Jevww==",
"dev": true,
"license": "MIT"
},
"node_modules/@protobufjs/aspromise": { "node_modules/@protobufjs/aspromise": {
"version": "1.1.2", "version": "1.1.2",
"resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz",
@@ -3401,6 +3429,19 @@
"acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0"
} }
}, },
"node_modules/acorn-walk": {
"version": "8.3.4",
"resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz",
"integrity": "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==",
"dev": true,
"license": "MIT",
"dependencies": {
"acorn": "^8.11.0"
},
"engines": {
"node": ">=0.4.0"
}
},
"node_modules/ajv": { "node_modules/ajv": {
"version": "6.12.6", "version": "6.12.6",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
@@ -4449,6 +4490,13 @@
"url": "https://github.com/sponsors/ljharb" "url": "https://github.com/sponsors/ljharb"
} }
}, },
"node_modules/debounce": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/debounce/-/debounce-1.2.1.tgz",
"integrity": "sha512-XRRe6Glud4rd/ZGQfiV1ruXSfbvfJedlV9Y6zOlP+2K04vBYiJEte6stfFkCP03aMnY5tsipamumUjL14fofug==",
"dev": true,
"license": "MIT"
},
"node_modules/debug": { "node_modules/debug": {
"version": "4.4.3", "version": "4.4.3",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
@@ -4596,6 +4644,13 @@
"node": ">= 0.4" "node": ">= 0.4"
} }
}, },
"node_modules/duplexer": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz",
"integrity": "sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==",
"dev": true,
"license": "MIT"
},
"node_modules/eastasianwidth": { "node_modules/eastasianwidth": {
"version": "0.2.0", "version": "0.2.0",
"resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz",
@@ -6013,6 +6068,22 @@
"js-yaml": "bin/js-yaml.js" "js-yaml": "bin/js-yaml.js"
} }
}, },
"node_modules/gzip-size": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/gzip-size/-/gzip-size-6.0.0.tgz",
"integrity": "sha512-ax7ZYomf6jqPTQ4+XCpUGyXKHk5WweS+e05MBO4/y3WJ5RkmPXNKvX+bx1behVILVwr6JSQvZAku021CHPXG3Q==",
"dev": true,
"license": "MIT",
"dependencies": {
"duplexer": "^0.1.2"
},
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/has-bigints": { "node_modules/has-bigints": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.1.0.tgz", "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.1.0.tgz",
@@ -6339,6 +6410,13 @@
"url": "https://github.com/sponsors/sindresorhus" "url": "https://github.com/sponsors/sindresorhus"
} }
}, },
"node_modules/html-escaper": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz",
"integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==",
"dev": true,
"license": "MIT"
},
"node_modules/html-void-elements": { "node_modules/html-void-elements": {
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/html-void-elements/-/html-void-elements-3.0.0.tgz", "resolved": "https://registry.npmjs.org/html-void-elements/-/html-void-elements-3.0.0.tgz",
@@ -6773,6 +6851,16 @@
"url": "https://github.com/sponsors/sindresorhus" "url": "https://github.com/sponsors/sindresorhus"
} }
}, },
"node_modules/is-plain-object": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz",
"integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/is-regex": { "node_modules/is-regex": {
"version": "1.2.1", "version": "1.2.1",
"resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz",
@@ -8464,6 +8552,16 @@
"node": ">=16 || 14 >=14.17" "node": ">=16 || 14 >=14.17"
} }
}, },
"node_modules/mrmime": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/mrmime/-/mrmime-2.0.1.tgz",
"integrity": "sha512-Y3wQdFg2Va6etvQ5I82yUhGdsKrcYox6p7FfL1LbK2J4V01F9TGlepTIhnK24t7koZibmg82KGglhA1XK5IsLQ==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=10"
}
},
"node_modules/ms": { "node_modules/ms": {
"version": "2.1.3", "version": "2.1.3",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
@@ -8824,6 +8922,16 @@
"node": ">= 14.17.0" "node": ">= 14.17.0"
} }
}, },
"node_modules/opener": {
"version": "1.5.2",
"resolved": "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz",
"integrity": "sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A==",
"dev": true,
"license": "(WTFPL OR MIT)",
"bin": {
"opener": "bin/opener-bin.js"
}
},
"node_modules/optionator": { "node_modules/optionator": {
"version": "0.9.4", "version": "0.9.4",
"resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz",
@@ -10221,6 +10329,21 @@
"url": "https://github.com/sponsors/isaacs" "url": "https://github.com/sponsors/isaacs"
} }
}, },
"node_modules/sirv": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/sirv/-/sirv-2.0.4.tgz",
"integrity": "sha512-94Bdh3cC2PKrbgSOUqTiGPWVZeSiXfKOVZNJniWoqrWrRkB1CJzBU3NEbiTsPcYy1lDsANA/THzS+9WBiy5nfQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"@polka/url": "^1.0.0-next.24",
"mrmime": "^2.0.0",
"totalist": "^3.0.0"
},
"engines": {
"node": ">= 10"
}
},
"node_modules/source-map": { "node_modules/source-map": {
"version": "0.7.6", "version": "0.7.6",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.6.tgz", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.6.tgz",
@@ -10844,6 +10967,16 @@
"integrity": "sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==", "integrity": "sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==",
"license": "MIT" "license": "MIT"
}, },
"node_modules/totalist": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/totalist/-/totalist-3.0.1.tgz",
"integrity": "sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=6"
}
},
"node_modules/tree-dump": { "node_modules/tree-dump": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/tree-dump/-/tree-dump-1.1.0.tgz", "resolved": "https://registry.npmjs.org/tree-dump/-/tree-dump-1.1.0.tgz",
@@ -11383,6 +11516,44 @@
"url": "https://github.com/sponsors/wooorm" "url": "https://github.com/sponsors/wooorm"
} }
}, },
"node_modules/webpack-bundle-analyzer": {
"version": "4.10.1",
"resolved": "https://registry.npmjs.org/webpack-bundle-analyzer/-/webpack-bundle-analyzer-4.10.1.tgz",
"integrity": "sha512-s3P7pgexgT/HTUSYgxJyn28A+99mmLq4HsJepMPzu0R8ImJc52QNqaFYW1Z2z2uIb1/J3eYgaAWVpaC+v/1aAQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"@discoveryjs/json-ext": "0.5.7",
"acorn": "^8.0.4",
"acorn-walk": "^8.0.0",
"commander": "^7.2.0",
"debounce": "^1.2.1",
"escape-string-regexp": "^4.0.0",
"gzip-size": "^6.0.0",
"html-escaper": "^2.0.2",
"is-plain-object": "^5.0.0",
"opener": "^1.5.2",
"picocolors": "^1.0.0",
"sirv": "^2.0.3",
"ws": "^7.3.1"
},
"bin": {
"webpack-bundle-analyzer": "lib/bin/analyzer.js"
},
"engines": {
"node": ">= 10.13.0"
}
},
"node_modules/webpack-bundle-analyzer/node_modules/commander": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz",
"integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">= 10"
}
},
"node_modules/which": { "node_modules/which": {
"version": "2.0.2", "version": "2.0.2",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
@@ -11593,6 +11764,28 @@
"url": "https://github.com/chalk/ansi-styles?sponsor=1" "url": "https://github.com/chalk/ansi-styles?sponsor=1"
} }
}, },
"node_modules/ws": {
"version": "7.5.10",
"resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz",
"integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=8.3.0"
},
"peerDependencies": {
"bufferutil": "^4.0.1",
"utf-8-validate": "^5.0.2"
},
"peerDependenciesMeta": {
"bufferutil": {
"optional": true
},
"utf-8-validate": {
"optional": true
}
}
},
"node_modules/y18n": { "node_modules/y18n": {
"version": "5.0.8", "version": "5.0.8",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",

View File

@@ -7,6 +7,7 @@
"dev": "concurrently \"contentlayer2 dev\" \"next dev --turbo\"", "dev": "concurrently \"contentlayer2 dev\" \"next dev --turbo\"",
"sync-assets": "node scripts/sync-assets.mjs", "sync-assets": "node scripts/sync-assets.mjs",
"build": "npm run sync-assets && contentlayer2 build && next build && npx pagefind --site .next && rm -rf public/_pagefind && cp -r .next/pagefind public/_pagefind", "build": "npm run sync-assets && contentlayer2 build && next build && npx pagefind --site .next && rm -rf public/_pagefind && cp -r .next/pagefind public/_pagefind",
"build:analyze": "ANALYZE=true npm run build",
"start": "next start", "start": "next start",
"lint": "next lint", "lint": "next lint",
"contentlayer": "contentlayer build" "contentlayer": "contentlayer build"
@@ -38,6 +39,7 @@
"unist-util-visit": "^5.0.0" "unist-util-visit": "^5.0.0"
}, },
"devDependencies": { "devDependencies": {
"@next/bundle-analyzer": "^16.0.3",
"@tailwindcss/typography": "^0.5.19", "@tailwindcss/typography": "^0.5.19",
"@types/node": "^24.10.1", "@types/node": "^24.10.1",
"@types/react": "^19.2.5", "@types/react": "^19.2.5",