mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-04 23:20:07 +00:00
- Remove pnpm-specific files (pnpm-lock.yaml, pnpm-workspace.yaml) - Update package.json scripts to use npm instead of pnpm - Add npm workspaces configuration - Update all GitHub workflow files to use npm - Update documentation to reference npm commands - Generate package-lock.json for npm dependency management
2.9 KiB
2.9 KiB
ComfyUI Frontend Project Guidelines
Repository Setup
For first-time setup, use the Claude command:
/setup_repo
This bootstraps the monorepo with dependencies, builds, tests, and dev server verification.
Prerequisites: Node.js >= 24, Git repository, available ports (5173, 6006)
Quick Commands
npm run: See all available commandsnpm run dev: Start development server (port 5173, via nx)npm run typecheck: Type checkingnpm run build: Build for production (via nx)npm run lint: Linting (via nx)npm run format: Prettier formattingnpm run test:component: Run component tests with browser environmentnpm run test:unit: Run all unit testsnpm run test:browser: Run E2E tests via Playwrightnpm run test:unit -- tests-ui/tests/example.test.ts: Run single test filenpm run storybook: Start Storybook development server (port 6006)npm run knip: Detect unused code and dependencies
Monorepo Architecture
The project now uses Nx for build orchestration and task management:
- Task Orchestration: Commands like
dev,build,lint, andtest:browserrun via Nx - Caching: Nx provides intelligent caching for faster rebuilds
- Configuration: Managed through
nx.jsonwith plugins for ESLint, Storybook, Vite, and Playwright - Dependencies: Nx handles dependency graph analysis and parallel execution
Key Nx features:
- Build target caching and incremental builds
- Parallel task execution across the monorepo
- Plugin-based architecture for different tools
Development Workflow
- First-time setup: Run
/setup_repoClaude command - Make code changes
- Run tests (see subdirectory CLAUDE.md files)
- Run typecheck, lint, format
- Check README updates
- Consider docs.comfy.org updates
Git Conventions
- Use [prefix] format: [feat], [bugfix], [docs]
- Add "Fixes #n" to PR descriptions
- Never mention Claude/AI in commits
External Resources
- PrimeVue docs: https://primevue.org
- ComfyUI docs: https://docs.comfy.org
- Electron: https://www.electronjs.org/docs/latest/
- Wiki: https://deepwiki.com/Comfy-Org/ComfyUI_frontend/1-overview
Project Philosophy
- Clean, stable public APIs
- Domain-driven design
- Thousands of users and extensions
- Prioritize clean interfaces that restrict extension access
Repository Navigation
- Check README files in key folders (tests-ui, browser_tests, composables, etc.)
- Prefer running single tests for performance
- Use --help for unfamiliar CLI tools
GitHub Integration
When referencing Comfy-Org repos:
- Check for local copy
- Use GitHub API for branches/PRs/metadata
- Curl GitHub website if needed
Common Pitfalls
- NEVER use
anytype - use proper TypeScript types - NEVER use
as anytype assertions - fix the underlying type issue - NEVER use
--no-verifyflag when committing - NEVER delete or disable tests to make them pass
- NEVER circumvent quality checks