Skip to content

Latest commit

 

History

History
43 lines (26 loc) · 2.86 KB

DEVELOP.md

File metadata and controls

43 lines (26 loc) · 2.86 KB

Notes for maintainers

The directory packages/sdk/src/client_api is generated from the SpacetimeDB client-api-messages. This is not automated. Whenever the client-api-messages crate changes, you'll have to manually re-generate the definitions. See that crate's DEVELOP.md for how to do this.

The generated files must be manually modified to fix their imports from the rest of the SDK.

Within each generated file:

  • Change the import from "@clockworklabs/spacetimedb-sdk" to "../index".

On a mac, you can do that by running this in the directory: find . -type f -exec sed -i '' 's/"@clockworklabs\/spacetimedb-sdk"/"..\/index"/g' {} \;.

Releases and publishing

Every Pull Request with a public-facing change (Bug fix, perf, feature etc) must be accompanied by a changeset. Any person working on a patch or feature needs to run pnpm -w changeset command, which will prompt them to select packages changed. Choose @clockworklabs/spacetimedb-sdk

image

Next it will ask whether you'd like to add a Major tag to it. Hit enter to go to minor tag. If its a minor change(In our case, minor is major until v1 comes out, as in every minor can have breaking changes). If its a patch change(Or minor for prerelease time), then again hit enter

After selecting the correct tag, it will ask you for a message

image image image

Once that is done, hit enter. It will generate a .md file which you can then push to github. This all has to be done in the PR with the feature/fix in it.

We can merge it instantly to do a release, or we can merge PRs with their own Changesets. E.g. Any new feature or patch we work on for 1.0 now, should have a Changeset in it. All of these will accumulate in the "Version Packages" PR. Once all these are satisfactorily done, we merge this PR, which will

  • Release the package on npm
  • Release on Github tags
  • Update CHANGELOG.md

NOTE: It is very important that no one manually runs npm publish. We have provenance enabled on this package, means each version will be signed by github and traceable to the very commit associated to it

Publishing manually will breach the provenance contract, and alert security servcies like Snyk into investigating the package or issuing a warning. npm install of our package will also warn them of potential compromise to the package

image image