FactoryWager Wiki

Import Boundaries

This repository enforces package import boundaries with:

The goal is to keep package type-check scope predictable and avoid accidental coupling to unrelated modules.

Not the same as the wire/type boundary. For parse-once / unknown / decodeUnknown* rules, see WIRE_BOUNDARY.md.

Allowed Roots

Rules are currently enforced for package src/ imports:

Only relative imports are validated by the guard script.

CI Enforcement

imports:verify runs in .github/workflows/typescript-checks.yml before type-check jobs.

Local Usage

Run manually:

bun run imports:verify

Extending Rules

When a package needs a new dependency root:

  1. Update RULES in scripts/verify-package-import-boundaries.ts.
  2. Keep the rule narrow (smallest required root).
  3. Run bun run imports:verify and bun run type-check:full.

Optional Pre-commit Hook

An optional hook is provided at .githooks/pre-commit.

To enable local hooks:

git config core.hooksPath .githooks