Skip to content

Commit 937b61c

Browse files
committed
fix: Inconsistent use of package managers, added extra CLAUDE.md rules, updated vercel builds to use bun
1 parent d903b29 commit 937b61c

File tree

4 files changed

+60
-12285
lines changed

4 files changed

+60
-12285
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ yarn-debug.log*
3030
yarn-error.log*
3131
.pnpm-debug.log*
3232

33+
# project uses bun
34+
package-lock.json
35+
3336
# env files (can opt-in for committing if needed)
3437
.env*
3538

CLAUDE.md

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,4 +118,56 @@ Component aliases (from `components.json`):
118118

119119
5. **WhatsApp Contact**: Primary contact method is WhatsApp (`https://wa.me/6281388577873`).
120120

121-
5. Project uses **bun**, not node/npm/npx.
121+
6. **Package Manager - BUN ONLY**:
122+
- This project **EXCLUSIVELY** uses [Bun](https://bun.sh) as the package manager and runtime
123+
- **NEVER** use `npm`, `yarn`, `pnpm`, `node`, or `npx` commands
124+
- **NEVER** create or modify `package-lock.json`, `yarn.lock`, or `pnpm-lock.yaml`
125+
- Only `bun.lock` should exist for dependency locking
126+
127+
**For Claude Code**:
128+
- Always use `bun` instead of `npm`/`yarn`/`pnpm`
129+
- Use `bunx` instead of `npx`
130+
- Example: `bunx shadcn add button` NOT `npx shadcn add button`
131+
132+
**For Contributors without Bun**:
133+
If you don't have Bun installed, install it first:
134+
```bash
135+
# macOS/Linux
136+
curl -fsSL https://bun.sh/install | bash
137+
138+
# Windows (PowerShell)
139+
powershell -c "irm bun.sh/install.ps1 | iex"
140+
141+
# Or via npm (one-time only to install Bun)
142+
npm install -g bun
143+
```
144+
145+
Then use these Bun commands:
146+
```bash
147+
bun install # Instead of: npm install
148+
bun add <package> # Instead of: npm install <package>
149+
bun remove <package> # Instead of: npm uninstall <package>
150+
bun run dev # Instead of: npm run dev
151+
bunx <command> # Instead of: npx <command>
152+
```
153+
154+
7. **Linting**:
155+
- Run `bun run lint` after making any code changes
156+
- Fix all linting errors before considering the task complete
157+
- Do not finish work with linting errors
158+
- If lint errors occur, fix them immediately and re-run `bun run lint` to verify
159+
160+
8. **React Best Practices - Avoid useEffect**:
161+
- Most `useEffect` usage can be replaced with better patterns:
162+
- **Event handlers**: For user interactions (clicks, form submissions)
163+
- **Server Components**: For data fetching (when not using static export)
164+
- **Props/State**: For derived state (calculate during render)
165+
- **useMemo/useCallback**: For expensive computations
166+
- **React Query/SWR**: For data fetching and caching
167+
- **Framer Motion callbacks**: For animation-related side effects
168+
- Only use `useEffect` as a last resort for:
169+
- Syncing with external systems (non-React libraries)
170+
- Browser APIs (localStorage, window listeners) - but prefer event handlers
171+
- Truly unavoidable imperative operations
172+
- If you must use `useEffect`, document why it's necessary in a comment
173+
- Reference: [You Might Not Need an Effect](https://react.dev/learn/you-might-not-need-an-effect)

0 commit comments

Comments
 (0)