git clone git@github.com:nostr-wot/nostr-wot-sdk.git
cd nostr-wot-sdk
npm install
npm run buildThis repo uses changesets for version management. Every PR that changes published code must include a changeset describing the bump.
After making your changes, run:
npx changesetYou'll be asked:
- Which packages bumped? Pick the affected ones —
@nostr-wot/data,@nostr-wot/relay,@nostr-wot/wot, and/ornostr-wot-sdk. - Major / minor / patch? Per package. Note: the four packages are
linkedin.changeset/config.json, so they all end up at the same version on release. Bumping any single one moves them all. - Summary. A short prose description that becomes the CHANGELOG entry. Markdown is fine.
A new file lands in .changeset/<name>.md. Commit it with the rest of your PR.
On push to main:
- If
.changeset/*.mdfiles exist, CI opens (or updates) a "chore: release" PR with bumped versions inpackage.jsons + CHANGELOG entries written. - When that PR merges, CI runs
npm run releasewhich publishes every package whosepackage.jsonversion doesn't yet exist on npm.
You don't manually npm publish. You don't manually edit package.json versions. Just write changesets.
If your PR is doc-only or non-publishing, run:
npx changeset --emptyThis adds a placeholder so CI doesn't complain that a changeset is missing, but no version bumps.
mkdir packages/<name>/src- Add
package.json(copypackages/data/package.jsonas a template; update name/description) - Add
tsconfig.jsonextendingtsconfig.base.json - Add
tsup.config.ts - Add to root
package.json'sworkspacesarray - Add to root
buildscript (in dependency order) - Add to
.changeset/config.json'slinkedgroup if it should version in lock-step npm install(resyncs workspaces)
- TypeScript strict mode in
tsconfig.base.json. Per-package overrides for legacy code if needed. - Two-space indent, single quotes, semicolons.
- Default to no comments. Comment only the why (a constraint, an invariant, a workaround). Don't comment the what.
npm test # all packages
npm run test -w @nostr-wot/data # one package