Skip to content

Maintenance

Simon Warta edited this page Jun 13, 2023 · 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 yarn npm login --publish

For every release

  1. Update CHANGELOG.md and ensure it is properly formatted (see fc676968ee). We will commit this in step 5.
  2. export NEW_COSMJS_VERSION="0.26.0-alpha.1"
  3. Run git clean -xdf ./packages && yarn install && yarn build
  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 publish-next or stable release yarn publish-latest
  7. git push && git push --tags

On a x86_64 machine

  1. export NEW_COSMJS_VERSION="0.26.0-alpha.1"
  2. git fetch --all && git checkout "v$NEW_COSMJS_VERSION"
  3. Build, test and publish docker image:
    docker build --pull --platform linux/amd64 -t "confio/faucet:$NEW_COSMJS_VERSION" -f packages/faucet/Dockerfile . \
      && docker run --rm "confio/faucet:$NEW_COSMJS_VERSION" version \
      && docker run --rm "confio/faucet:$NEW_COSMJS_VERSION" generate \
      && docker push "confio/faucet:$NEW_COSMJS_VERSION"
    

Yarn

Upgrade yarn

yarn set version latest

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)