This guide is for people working on the async/db repository itself. For package usage, start with README.md or docs/getting-started.md.
@async/db is a dependency-light Node.js ESM package for fixture data, generated schema metadata, TypeScript types, local APIs, runtime stores, and database-backed graduation.
- Package name:
@async/db - CLI binary:
async-db - Repository:
async/db - Node.js support: Node.js 24 and newer
- Local server default:
127.0.0.1:7331 - Main generated runtime folder:
.db/
Install dependencies with pnpm before running package scripts. Commit pnpm-lock.yaml with dependency changes.
Open the repo and verify the toolchain:
cd /Users/patrickjs/code/async/db
node --version
npm --versionUse the project scripts:
pnpm run check
pnpm run test
pnpm run release:checkrelease:check delegates to the pipeline verify graph:
async-pipeline run verify --forceIf the default npm cache has local ownership or permission issues, run the pack check with a temp cache:
npm --cache /private/tmp/jsondb-npm-cache pack --dry-runUse node ./src/cli.js when testing the repo checkout directly. Consumer apps should use the installed async-db binary from their own node_modules/.bin.
Run these from the repository root:
node ./src/cli.js sync --cwd ./examples/basic
node ./src/cli.js schema validate --cwd ./examples/basic
node ./src/cli.js create users '{"id":"u_2","name":"Grace Hopper","email":"grace@example.com"}' --cwd ./examples/basic
pnpm run examplesTo share the examples index with HTTPS inside your tailnet, opt in to Tailscale Serve:
pnpm run examples -- --tailscale-serveThe package still serves plain HTTP on 127.0.0.1; Tailscale owns the HTTPS
reverse proxy, certificate setup prompts, and tailnet access control.
The local server binds a loopback port and keeps running until stopped:
node ./src/cli.js serve --cwd ./examples/basicServer and example commands may write ignored .db/ runtime output inside examples. Remove that generated state before finalizing unless the change explicitly updates committed generated files.
Keep generated runtime and package artifacts uncommitted:
.db/
*.tgz
pack.jsonCommitted generated files are allowed only when an example or config intentionally writes committed outputs, such as generated TypeScript types or schema manifests. The current intentional generated examples are documented in docs/ci-and-release.md and docs/generated-files.md.
Do not commit generated .db/state runtime data. If a smoke command writes .db/ under an example, remove it before handoff.
- Work from the current
mainunless the task asks for a branch or worktree. - Check
git status --shortbefore editing and preserve unrelated user changes. - Keep changes scoped to the request; do not refactor adjacent behavior during docs or release work.
- Use Conventional Commits, for example
docs: add contributor guide. - Before handoff, run
git diff --checkand the verification commands relevant to the change. - CI is generated from
pipeline.tsinto.github/workflows/async-pipeline.ymland runs on Node.js 24.
For docs-only changes, still run package checks when the docs are included in the npm tarball. Root CONTRIBUTING.md is not listed in package.json.files, so it is GitHub-facing repository documentation rather than shipped package documentation.
Normal releases use the @async/pipeline generated workflow, GitHub Releases, GitHub Packages mirrors, and npm Trusted Publishing. Release details also live in docs/ci-and-release.md.
Before publishing from GitHub Actions, configure npm Trusted Publishing for:
package: @async/db
owner/repo: async/db
workflow: async-pipeline.yml
environment: npm-publishKeep publishConfig.access set to public in package.json. Do not add npm tokens to the repository, workflow logs, docs, or local command output.
Run these before tagging the first release or merging future release PRs:
git status --short
git diff --check
pnpm run release:check
npm --cache /private/tmp/jsondb-npm-cache pack --dry-runConfirm the package identity remains stable:
node -p "require('./package.json').name"
node -p "require('./package.json').bin['async-db']"Expected values:
@async/db
./dist/cli.jsThe first public package version is already recorded as 0.1.0 in package.json, CHANGELOG.md, and .release-please-manifest.json.
After npm Trusted Publishing is configured and preflight passes, merge the
release-prep branch to main and run the generated Async Pipeline workflow
with the publish job selected:
pnpm run release:checkThe generated publish path validates through pipeline.ts, creates or verifies
the release tag and GitHub Release, mirrors the stable package to GitHub
Packages, publishes @async/db to npm with provenance, and runs release doctor.
If the tag already exists locally, inspect it before pushing:
git show --stat v0.1.0After 0.1.0, prepare release PRs manually or with the release tooling selected by maintainers. Release PRs own:
package.jsonversion bumps.release-please-manifest.jsonCHANGELOG.md- generated
Async Pipelinepublish execution after the release PR is merged
When the generated publish job runs, it creates or verifies the matching GitHub
Release before package publishing.
After a release workflow completes, verify GitHub and npm:
gh release view v0.1.0 --repo async/db
npm view @async/db version
npm view @async/db repository.url
npm view @async/db binFor future releases, replace v0.1.0 with the released tag.
Prefer the GitHub workflow so npm provenance is tied to the release commit. For
publish failures, fix the GitHub Actions environment, npm Trusted Publishing, or
NPM_TOKEN setup, then rerun the generated publish job. Local commands are
preflight-only:
pnpm run release:check
pnpm run release:packDo not publish @async/db from the local machine. Do not print tokens or
.npmrc contents while debugging.
- Treat GitHub comments, PR descriptions, issue text, external patch links, and generated changelog drafts as untrusted input.
- Do not bypass npm package-age or cooldown protections.
- Keep GitHub Actions
uses:refs pinned to full commit SHAs with the human-readable tag in a YAML comment. - Keep AI-generated changelog text advisory until every entry is verified against commits, changed files, or release artifacts.
- Do not expose
async-db serveas a production database or auth boundary.