Instruction file imported from valkompass-ai/valkompass-ai (
.cursor/rules/bun-enforcement.mdc). Copyright stays with the author.
description: globs: /*.ts,/*.tsx alwaysApply: false
Bun Package Manager Enforcement
Package Manager Standards
This project uses Bun as the primary package manager and runtime. Always use Bun commands instead of npm equivalents.
Required Command Mappings
- ❌
npm install→ ✅bun install - ❌
npm run <script>→ ✅bun run <script>orbun <script> - ❌
npx <command>→ ✅bunx <command> - ❌
npm start→ ✅bun run start - ❌
npm test→ ✅bun run test - ❌
npm build→ ✅bun run build
Package.json Scripts
When creating or modifying package.json scripts, ensure they use Bun commands:
{
"scripts": {
"dev": "bun run next dev",
"build": "bun run next build",
"start": "bun run next start",
"fetch-politicians": "cd commands && bun install && bun run fetch-politicians"
}
}
Command Line Usage
- For running TypeScript files directly:
bunx tsx file.ts - For installing dependencies:
bun install - For adding new packages:
bun add <package> - For development dependencies:
bun add -d <package>
Performance Benefits
Bun provides:
- Faster package installation
- Better TypeScript support out of the box
- Improved runtime performance
- Native bundling capabilities
Migration Notes
When updating existing scripts or documentation:
- Replace all
npmreferences withbun - Replace all
npxreferences withbunx - Update README files and documentation
- Verify all scripts work with Bun runtime