File tree Expand file tree Collapse file tree 2 files changed +27
-3
lines changed Expand file tree Collapse file tree 2 files changed +27
-3
lines changed Original file line number Diff line number Diff line change 66- ` npm run typecheck ` : Type checking
77- ` npm run lint ` : Linting
88- ` npm run format ` : Prettier formatting
9+ - ` npm run test:component ` : Run component tests with browser environment
10+ - ` npm run test:unit ` : Run all unit tests
11+ - ` npm run test:unit -- tests-ui/tests/example.test.ts ` : Run single test file
912
1013## Development Workflow
1114
@@ -48,3 +51,11 @@ When referencing Comfy-Org repos:
48511 . Check for local copy
49522 . Use GitHub API for branches/PRs/metadata
50533 . Curl GitHub website if needed
54+
55+ ## Common Pitfalls
56+
57+ - NEVER use ` any ` type - use proper TypeScript types
58+ - NEVER use ` as any ` type assertions - fix the underlying type issue
59+ - NEVER use ` --no-verify ` flag when committing
60+ - NEVER delete or disable tests to make them pass
61+ - NEVER circumvent quality checks
Original file line number Diff line number Diff line change 66
77- Use ` api.apiURL() ` for backend endpoints
88- Use ` api.fileURL() ` for static files
9- - Examples:
10- - Backend: ` api.apiURL('/prompt') `
11- - Static: ` api.fileURL('/templates/default.json') `
9+
10+ #### ✅ Correct Usage
11+ ``` typescript
12+ // Backend API call
13+ const response = await api .get (api .apiURL (' /prompt' ))
14+
15+ // Static file
16+ const template = await fetch (api .fileURL (' /templates/default.json' ))
17+ ```
18+
19+ #### ❌ Incorrect Usage
20+ ``` typescript
21+ // WRONG - Direct URL construction
22+ const response = await fetch (' /api/prompt' )
23+ const template = await fetch (' /templates/default.json' )
24+ ```
1225
1326### Error Handling
1427
You can’t perform that action at this time.
0 commit comments