Skip to content

Development

Joseph Shenton edited this page Sep 22, 2026 · 1 revision

Development

Prerequisites

bun >=1.2.0, rclone only if RUN_MOUNT=true, Docker optional.

git clone https://github.com/moderniselife/SchroDrive.git
cd SchroDrive
bun install
bun run build

Tests

bun test                          # all
bun test tests/unit               # fast
bun test tests/e2e                # boots real Express on scratch ports 18283+
bun test tests/regressions        # per-bug
bun run impact:changed             # changed-file dependents (or "No changed files")
  • E2E must isolate SQLite: config.dbPath = path.join(mkdtemp(), 'test.db'); closeDb(); before startArrBridge(), tracked is now Map<port,Server>-aware. See CONTRIBUTING.md for the pattern.
  • Regression tests: one folder per issue, e.g. 57-arr-bridge-wildcard-route.

Type & Lint

bun run typecheck  # tsc --noEmit, strict

Pre-commit hook (.githooks/pre-commit) runs typecheck + test after bun install.

Adding a Provider

See src/providers/README.md — interface DebridProvider in src/providers/index.ts, then import in index.ts. Checklist in CONTRIBUTING.md §8.

Shared Helpers

Check src/core/utils.ts first: sanitiseName, splitCsv, asBool, asNumber, sleep, base32ToHex:94. Do not duplicate.

Express 5 uses /{*splat} not /* — see webdavBridge.ts and arrBridge.ts.

Release

Bump package.json version, add CHANGELOG.md entry, update CONTRIBUTORS.md if needed. release.yml tags v$version on push to main — now idempotent (skips if tag exists). Fresh clones need nothing; stale clones after history rewrites run bun run fix:history.

See CONTRIBUTING.md for branch style, PR flow, and the one-time fix:history note.

Clone this wiki locally