Cursor rule
.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdcUse Bun instead of Node.js, npm, pnpm, or vite.
Cursor rules
Quality
73/100
Scores the file, not the repository.Length
312 words
2 headings · 4 code blocksRepository
10
— · pushed 396 days agoLast changed
3 days ago
First indexed 3 days ago.1234567Default to using Bun instead of Node.js.89- Use `bun <file>` instead of `node <file>` or `ts-node <file>`10- Use `bun test` instead of `jest` or `vitest`11- Use `bun build <file.html|file.ts|file.css>` instead of `webpack` or `esbuild`12- Use `bun install` instead of `npm install` or `yarn install` or `pnpm install`13- Use `bun run <script>` instead of `npm run <script>` or `yarn run <script>` or `pnpm run <script>`14- Bun automatically loads .env, so don't use dotenv.1516## APIs1718- `Bun.serve()` supports WebSockets, HTTPS, and routes. Don't use `express`.19- `bun:sqlite` for SQLite. Don't use `better-sqlite3`.20- `Bun.redis` for Redis. Don't use `ioredis`.21- `Bun.sql` for Postgres. Don't use `pg` or `postgres.js`.22- `WebSocket` is built-in. Don't use `ws`.23- Prefer `Bun.file` over `node:fs`'s readFile/writeFile24- Bun.$`ls` instead of execa.2526## Frontend2728Use HTML imports with `Bun.serve()`. Don't use `vite`. HTML imports fully support React, CSS, Tailwind.2930Server:3132```ts#index.ts33import index from "./index.html"3435Bun.serve({36 routes: {37 "/": index,38 "/api/users/:id": {39 GET: (req) => {40 return new Response(JSON.stringify({ id: req.params.id }));41 },42 },43 },44 // optional websocket support45 websocket: {46 open: (ws) => {47 ws.send("Hello, world!");48 },49 message: (ws, message) => {50 ws.send(message);51 },52 close: (ws) => {53 // handle close54 }55 },56 development: {57 hmr: true,58 console: true,59 }60})61```6263HTML files can import .tsx, .jsx or .js files directly and Bun's bundler will transpile & bundle automatically. `<link>` tags can point to stylesheets and Bun's CSS bundler will bundle.6465```html#index.html66<html>67 <body>68 <h1>Hello, world!</h1>69 <script type="module" src="./frontend.tsx"></script>70 </body>71</html>72```7374With the following `frontend.tsx`:7576```tsx#frontend.tsx77import React from "react";7879// import .css files directly and it works80import './index.css';8182import { createRoot } from "react-dom/client";8384const root = createRoot(document.body);8586export default function Frontend() {87 return <h1>Hello, world!</h1>;88}8990root.render(<Frontend />);91```9293Then, run index.ts9495```sh96bun --hot ./index.ts97```9899For more information, read the Bun API docs in `node_modules/bun-types/docs/**.md`.100
Also in pylarco/diff-apply
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| pylarco/diff-apply.cursor/rules/dry.strict.mdc · 10 | Cursor rules | styledo-not | 50/100 | 3 days ago | |
| pylarco/diff-apply.cursor/rules/elysia.rule.mdc · 10 | Cursor rules | no sections | 16/100 | 3 days ago | |
| pylarco/diff-apply.cursor/rules/integration.task.mdc · 10 | Cursor rules | no sections | 16/100 | 3 days ago | |
| pylarco/diff-apply.cursor/rules/motion.mdc · 10 | Cursor rules | no sections | 16/100 | 3 days ago | |
| pylarco/diff-apply.cursor/rules/test.mdc · 10 | Cursor rules | testing-strategydo-not | 31/100 | 3 days ago |
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126 | Cursor rules | setupbuildtestlint-format+6 | 100/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 45 | Cursor rules | testlint-formatstylearch+5 | 100/100 | 3 days ago | |
| markstev/mark-starter.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+6 | 99/100 | 3 days ago | |
| Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| langflow-ai/langflow.cursor/rules/docs_development.mdc · 153k | Cursor rules | setupbuildtestlint-format+7 | 97/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 45 | Cursor rules | teststyletesting-strategysecurity+3 | 97/100 | 3 days ago |
