Practical notes for contributors and maintainers of @lumera-protocol/sdk-js: how to set up your environment, run the toolchain, regenerate code, and validate changes before publishing.
- Node.js 18+ and
pnpm(the repo uses workspaces and lockfile checked in) - Buf CLI and Telescope (for protobuf codegen)
- Chrome + Keplr and an
snapibinary if you need to run the browser E2E harness
src/– SDK implementation (blockchain,cascade,wasm,wallets,internal/http)src/codegen/– Generated protobuf client code (CosmJS-compatible)examples/– Node and browser usage samplesdocs/api/– Typedoc HTML output (generated)docs/*.md– Internal notes (codegen fixes, Buf/Telescope guide, compatibility notes)tests/– Vitest unit/integration coveragescripts/– Helper scripts (post-codegen fixes, E2E harness entrypoint)
pnpm installIf you plan to touch codegen, also install Buf and Telescope (see docs/Step-by-Step Guide to Buf and Telescope.md).
- Lint:
pnpm lint - Tests:
pnpm test(orpnpm run coverage) - Build (ESM + CJS):
pnpm build - API docs:
pnpm run docs→ outputs HTML todocs/api - Browser E2E harness: follow
README.e2e-browser.mdand runmake e2e-browser
-
Update
telescope.jsonor proto references if needed. -
Download protos from Buf:
pnpm run proto:download
-
Generate and fix code:
pnpm run generate # alias for proto download + telescope + fixes # or: pnpm run codegen:full pnpm run codegen:fix # applies scripted cleanups; see docs/post-codegen-fixes.md
Generated files land in src/codegen/. Avoid hand-editing them.
docs/snapi-swagger.json pins the OpenAPI spec. To refresh types:
pnpm run gen:snapi # writes src/types/snapi.gen.tsIf the spec changes, replace docs/snapi-swagger.json before running the command.
- Unified entry:
createLumeraClient/LumeraClientinsrc/client.ts. - Blockchain features live under
src/blockchain/*and use CosmJS clients; new queries/tx helpers generally wrap generated types fromsrc/codegen. - Cascade storage uses
src/cascade/*(uploader, downloader, task manager) andsrc/wasm/*for LEP-1/RaptorQ helpers. - Wallet UX helpers are under
src/wallets/*(Keplr adapters, signature/tx prompters).
Prefer adding surface area behind the unified client so both Node and browser callers stay consistent.
pnpm lintpnpm test(add Vitest cases intests/when adding features)pnpm buildpnpm run docs(ensure public types stay well-documented)- For Cascade/signature flows that touch Keplr or sn-api, run
make e2e-browserwith a configurede2e.env.
- Bump version in
package.json. - Regenerate API docs (
pnpm run docs) sodocs/apistays in sync. - Ensure
dist/is fresh (pnpm build). - Sanity-check examples (
examples/node,examples/browser) still run. - Publish:
pnpm publish --access public(from a clean git state).
- Buf/Telescope issues: cross-check
docs/Step-by-Step Guide to Buf and Telescope.md. - Post-generation cleanup details:
docs/post-codegen-fixes.mdanddocs/generator-known-issues.md. - WASM compatibility notes (zstd/blake3):
docs/BLAKE3_BROWSER_COMPATIBILITY.md.