This document is the single source of truth for how we install dependencies, run quality gates, and evolve the stack. It matches what CI and Husky run.
- Package manager and runner: Bun only (
bun install,bun add,bun run,bunx). Do not introduce npm / yarn / pnpm for app workflows. - Workspaces: Root
package.json+packages/*; lockfile isbun.lock. - CI: GitHub Actions use
.github/actions/setup-bunandbun install --frozen-lockfile. - Engines: Respect
package.jsonengines(Node + Bun minimums) for local and deploy images.
- Own versions at the root for shared dev tools: ESLint, Prettier, TypeScript, Stylelint,
@typescript-eslint/*,lint-staged, Jest (jest,babel-jest,jest-environment-jsdom,@types/jest,@babel/preset-typescript), etc. - Library Jest: each package that needs unit tests keeps a local
jest.config.cjs(Jest deps stay at repo root only). Extract a shared preset when two or more packages would otherwise duplicate the same Jest block (see.cursor/rules/monorepo-jest.mdc). - Do not bump those independently in leaf packages unless a package truly needs a different major (rare); prefer one PR that updates root + lockfile and re-runs
bun run check:full. - Workspace packages may list
eslint/typescriptfor editor resolution; keep ranges aligned with root.
| Script | What it runs |
|---|---|
check:lint |
ESLint repo root (eslint .) |
check:format |
Prettier check |
check:types |
tsc --noEmit in webapp, admin-dashboard, hocuspocus |
check |
check:lint + check:format + check:types |
lint:styles |
Stylelint on packages/**/*.{css,scss} |
check:static |
check:lint + check:format + lint:styles (no tsc) |
check:full |
check + lint:styles (matches pre-push final gate) |
Local before a PR: bun run check:full (same bar as git pre-push after conditional builds).
CI: Lint job runs check:static; typecheck job runs extension builds then check:types (unchanged).
Pre-commit: lint-staged (staged files only). Commands resolve eslint / prettier / stylelint from the repo root node_modules when you run via bun run lint:staged.
- Prefer Bun to run TS:
bun scripts/doctor.ts,bun scripts/pre-push.ts, backend scripts where Bun is the runtime. - Hocuspocus:
bun testfor server unit tests (reference pattern). - Webapp unit tests: Jest + Cypress today; migrating to
bun testis a separate project (RTL, mocks, NYC/coverage). Not required for toolchain health.
- Today: Three explicit projects — Next apps (
moduleResolution: bundler) and Bun backend differ enough that we use per-packagetsc --noEmitchained fromtypecheck, not a single roottsc -bsolution. - Extensions: CI builds extension packages before typecheck so webapp path/types to
distresolve. - Future: Revisit root
tsconfig.json/ project references when Next + TS composite story is clearly safe for this repo.
Useful things to request or watch from Bun for this monorepo shape:
- Workspace filters: Documented, reliable patterns for “run script X in every workspace that defines it” (avoid empty
*filters). - Monorepo recipes: Next.js + shared
packages/*+ root typecheck / lint. - Testing: Guidance or tooling for Jest →
bun testmigration with coverage for React codebases.
- Root
package.json— scripts above packages/eslint-config— shared ESLint config.lintstagedrc.js— pre-commit staged rulesscripts/hooks/pre-commit.sh,scripts/hooks/pre-push.sh— Husky entrypoints.github/workflows/*.yml— CI gates