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:
@@ -6,7 +6,7 @@ import { GET } from '../projects/route';
|
||||
import { getProjects } from '@/lib/fs-utils';
|
||||
|
||||
jest.mock('@/lib/fs-utils');
|
||||
jest.mock('@/lib/utils', () => ({
|
||||
jest.mock('@/lib/project-utils', () => ({
|
||||
getProjectDisplayName: jest.fn((name) => name === 'FT' ? '外放构建' : name),
|
||||
}));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user