fix: separate client and server utilities to fix build error

Split lib/utils.ts into:
- lib/utils.ts: Client-safe utilities only (no Node.js imports)
- lib/project-utils.ts: Server-only utilities with Node.js imports

This fixes the Next.js build error where client components were importing
modules that contained Node.js dependencies (fs, path).

All tests pass and build succeeds.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-04 21:43:38 +08:00
parent 08f9015101
commit edc4cb770f
6 changed files with 66 additions and 63 deletions

View File

@@ -1,7 +1,7 @@
// app/api/projects/route.ts
import { NextResponse } from 'next/server';
import { getProjects } from '@/lib/fs-utils';
import { getProjectDisplayName } from '@/lib/utils';
import { getProjectDisplayName } from '@/lib/project-utils';
export async function GET() {
try {