Skip to content

Commit 6ecba9e

Browse files
committed
claude
1 parent 8ff988e commit 6ecba9e

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ package-lock.json
1616
frontend/package.json
1717
# npm pack output
1818
*.tgz
19+
.claude

CLAUDE.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Claude Development Notes
2+
3+
## Codegen Command
4+
After making changes to component functions, run codegen with:
5+
```bash
6+
cd example/ && npm run dev -- --once
7+
```
8+
9+
## Adding New Component Functions Pattern
10+
11+
When adding new functions to this Convex component:
12+
13+
1. **Client function** (`src/client/index.ts`):
14+
- Add method to `PushNotifications` class that calls `ctx.runMutation(this.component.public.functionName, { ...args, logLevel: this.config.logLevel })`
15+
- Follow existing patterns for argument types and return types
16+
17+
2. **Component function** (`src/component/public.ts`):
18+
- Define args schema using `v.object()`
19+
- Export mutation/query with proper return type
20+
- Call `ensureCoordinator(ctx)` after processing for coordination
21+
22+
3. **Batch functions**:
23+
- Use existing handler functions (like `sendPushNotificationHandler`) in loops
24+
- Call `ensureCoordinator` once after all processing
25+
- Return array of results matching individual function return types
26+
27+
4. **Always run codegen** after changes to regenerate types

0 commit comments

Comments
 (0)