Skip to content

Latest commit

 

History

History
101 lines (76 loc) · 3.49 KB

CONTRIBUTING.md

File metadata and controls

101 lines (76 loc) · 3.49 KB

Contributing

Thanks for your interest in contributing to zarrita.js!

Prerequisites

  • pnpm (v9+) — package manager
  • uv — only needed if regenerating test fixtures

Getting started

pnpm install   # install dependencies
pnpm build     # build all packages
pnpm test      # run tests

Commands

Command Description
pnpm build Build all packages with TypeScript
pnpm test Run tests with Vitest
pnpm lint Check formatting & lint rules (Biome)
pnpm fix Auto-fix lint issues
pnpm format Format code
pnpm publint Check each package is publish-ready
pnpm run update-fixtures Regenerate v2/v3 test fixtures (requires uv)
pnpm clean Remove all dist/ folders

Project structure

packages/
  zarrita/            # main package — core Zarr implementation
  @zarrita-storage/   # storage backends (fetch, fs, zip, ref)
  @zarrita-ndarray/   # optional scijs/ndarray integration
fixtures/
  v2/                 # Zarr v2 test data (generated by Python)
  v3/                 # Zarr v3 test data (generated by Python)
scripts/
  generate-v2.py      # generate v2 fixtures with zarr (Python)
  generate-v3.py      # generate v3 fixtures with zarr (Python)
  zip-fixtures.sh     # zip fixture directories for ZipStore tests
  sync-jsr.mjs        # sync jsr.json configs from package.json
docs/                  # VitePress documentation site

Testing in the browser

After building, you can try zarrita in a browser:

uv run python -m http.server .
# navigate to localhost:8000/demo.html

Edit demo.html and refresh the page.

Changesets

This project uses changesets to manage versioning and changelogs.

Not every PR needs a changeset. Changesets are for user-facing changes — bug fixes, new features, breaking changes — things that affect the published packages. Internal refactors, test updates, CI changes, and documentation fixes don't need one.

If your PR does include user-facing changes, add a changeset:

pnpm changeset

This will prompt you to select the affected package(s) and the semver bump type (patch, minor, or major), then create a markdown file in .changeset/. Commit that file with your PR.

When a release PR is merged, changesets automatically publishes to npm and updates changelogs.

Dual publishing (npm + JSR)

Every package is published to both npm and JSR. The npm side is handled by changesets. The JSR side is handled by a separate GitHub Actions workflow (.github/workflows/jsr.yml) that runs deno publish on every push to main.

Each package has a jsr.json alongside its package.json. These are generated — don't edit them directly. The sync script derives each jsr.json from its corresponding package.json, translating npm dependencies to npm: specifiers and workspace dependencies to jsr: specifiers:

node scripts/sync-jsr.mjs

This runs automatically as part of pnpm version, so jsr.json files stay in sync with package.json after every version bump.