Skip to content

Maintenance

Simon Warta edited this page Aug 4, 2021 · 27 revisions

This page is for maintainers of CosmJS only.

How to publish to npm (Yarn 2; CosmJS 0.26+)

One-time setup

  1. Login using npm login

For every release

  1. Update CHANGELOG.md (see https://github.com/cosmos/cosmjs/commit/fc676968ee295d764e213dac52cc46dd5bc6299c).
  2. Run git clean -xdf ./packages && yarn install && yarn build
  3. export NEW_COSMJS_VERSION="0.26.0-alpha1"
  4. yarn workspaces foreach exec yarn version --immediate "$NEW_COSMJS_VERSION"
  5. git add . && git commit -m "Set version $NEW_COSMJS_VERSION" && git tag "v$NEW_COSMJS_VERSION"
  6. Either pre-release yarn workspaces foreach --no-private exec yarn npm publish --tag next or stable release yarn workspaces foreach --no-private exec yarn npm publish

How to publish to npm

One-time setup

  1. Login using npm login

For every release

  1. Update CHANGELOG.md (see https://github.com/cosmos/cosmjs/commit/fc676968ee295d764e213dac52cc46dd5bc6299c).
  2. Run git clean -xdf && yarn install && yarn build
  3. Run ./scripts/add_nonces.sh && git add packages/ && git commit -m "Add nonces"
  4. Run ./node_modules/.bin/lerna publish or for pre-releases run ./node_modules/.bin/lerna publish --dist-tag next and select a pre-release version

Copy "next" version to "latest" for newly added packages

for p in [package1] [package2] [...];
  do npm dist-tag add @cosmjs/$p@$(npm view @cosmjs/$p@next version) latest;
done

Remove npm tag

When no current pre-release exists, the next tag should be deleted:

$ ./node_modules/.bin/lerna exec --no-private -- npm dist-tag rm "\$LERNA_PACKAGE_NAME" next

Upgrade yarn

  1. yarn set version latest
  2. Check: yarn --version
  3. Ensure lockfile is up-to-date: yarn install

Update ts-proto

  1. Install the new version of ts-proto using yarn
  2. Download proto files
    for p in cosmwasm-stargate stargate proto-signing; do
      (cd "packages/$p" && yarn get-proto);
    done
    
  3. Regenerate TS files
    for p in cosmwasm-stargate stargate proto-signing; do
      (cd "packages/$p" && yarn define-proto);
    done
    
  4. Revert path issues (see https://github.com/cosmos/cosmjs/issues/656)
Clone this wiki locally