Contributing to lofi-node
Prerequisites
- Deno 2.9+ (the only global runtime requirement for the TS side)
- Rust stable (only when touching
native/;iroh-js/ deno task nativebuilds the addon)
The gate
deno task check && deno task test
check runs fmt --check, lint, and typecheck. test runs the full fixture suite; iroh/jazz
integration tests auto-skip (with a visible marker) when the native addon isn't built, so the fast
path never needs Rust.
Branches & PRs
Prefix branches by intent (fix/, feat/, docs/, chore/), keep a PR to one concern, and state
the evidence for behavior claims (test name or command output) in the description.
Hard boundaries
- Vendoring contract: everything under
native/exceptiroh-js/ src/is upstream code. Never edit vendored files beyondlofi_ext.rs /marked lines; follow the update procedure in/ lofi-node: native/.iroh-js/ UPSTREAM.md deno fmt/lintexclude the directory — keep it that way. - Version pins are decisions:
jazz-tools/jazz-napiare pinned to the exact alpha the lofi framework pins. Bumps are coordinated changes with the full suite as evidence, never drive-by. - No silent degradation: a missing capability (native addon, platform) must surface as a typed
reason in
status(), never as quietly reduced behavior. - Secrets: nothing under
lofi-node-data/,data/, or generatedconfig.jsonfiles may be committed; test secrets are obviously-fake fixed strings. - Never call the upstream watch APIs from the TS layer — at iroh-ffi v1.1.0 they abort the process under Deno (see UPSTREAM.md known issues).
Releasing
Published to JSR as @nzip/. The package ships TypeScript only; native addons are
GitHub-release assets that the loader downloads and sha256-verifies against digests committed in
src/ (regenerate with deno task release:artifacts — CI fails if stale).
Procedure (tags on main, no dev branch):
- Bump
versionindeno.json; rundeno task release:artifacts. deno task check && deno task test, then inspect the artifact:deno task publish:dry.- Commit, push, wait for ci green.
git tag v<version> && git push origin v<version>— publish.yml verifies the tag matchesdeno.json, publishes to JSR via OIDC, compiles the release binaries (darwin-arm64 and linux-x64; linux-arm64 is withheld until jazz-napi publishes a linux-arm64-gnu package), creates the GitHub release with binaries + raw addon assets +SHA256SUMS, smokes the fresh publish from the registry, and builds, smokes, and pushes the container image toghcr.io/(felinestatemachine/ lofi-node <version>andlatesttags).- JSR versions are immutable — mistakes fix forward as the next patch version.