Skip to content
Myr

README.md

This file

Path

examples/burrow/README.md

41 lines · 2.4 KiB · Markdown

Last changed by

Merge build/maintainer-wording into mainoscabrielbefore adoption4c1a571

History of this file

Take it

Show the source

README.md

burrow

The services behind burrow's shop: six small TypeScript packages in one Bun workspace, sharing one HTTP kit.

burrow, its shop and the people named here are fictional, made up as an example project; no real person, company or host is meant.

PackageWhat it does
@burrow/kitThe HTTP helpers every service uses: http.get, and legacyFetch, which it replaces
@burrow/authSessions, and who is on which team
@burrow/billingExchange rates and invoices
@burrow/catalogProducts and categories
@burrow/notifyMessage templates
@burrow/searchSearch, and "search again"

Working on it

bun install
bun run lint         # oxlint: Ultracite's core and anti-slop presets, and our own rule
bun run typecheck
bun test
bun run lint:rules   # our lint rule's fixture test (oxlint's RuleTester, under Node)
bun run debt         # escape directives, against debt.baseline.json

lefthook.yml runs the lint and the typecheck before each commit and the tests before each push, once you run lefthook install.

How we keep it tidy

  • No state in modules. Our one lint rule, no-module-level-mutable-state (in tools/oxlint/burrow), flags a let or var at the top of a package's src/: the services are long-lived processes, so that binding is shared by every request they serve. Six are left, one per package. The rule warns until they are gone, and their count may only fall; then it becomes an error. A fix is usually a factory, a parameter, or a cache the caller owns.
  • Escapes say why. A comment that switches a check off (oxlint-disable, @ts-expect-error) carries its reason after --, and bun run debt keeps their number at or under debt.baseline.json.
  • legacyFetch is on its way out. It throws on any failed request; http.get hands the failure back as a value. bun scripts/count-callers.ts legacyFetch shows who still calls it, by package (--json for a script).

Contributing

Work is offered as asks, each with a check that says when it is done. The project's process lives in .myr/: project.ts (maintainers, ask kinds, the module-state ratchet), vouched.td (who may claim), and the open asks in asks/. okafor and lin-h decide for every path.

License

MIT, see LICENSE. tools/oxlint/burrow/rules/no-module-level-mutable-state.ts is MIT too, under its authors' notice in tools/oxlint/burrow/LICENSE-rat-stack.txt.