diff --git a/PUBLISHING.md b/PUBLISHING.md index f9a961b..cc35ae2 100644 --- a/PUBLISHING.md +++ b/PUBLISHING.md @@ -1,6 +1,22 @@ -After PR is merged: +# Publishing -1. Switch to latest `master`: +Publish the SDK before the wagmi connector. The connector has an exact peer dependency on the SDK +version, so the SDK package must exist in the npm registry first. + +Do not use a recursive workspace publish while the connector's peer dependency is intentionally +lockstep with the SDK version. Publish each package explicitly, in order. + +## Before Merging The Release PR + +Before publishing a new alpha version, update these values to the same exact version: + +- `package.json` `version` +- `packages/oms-wallet-wagmi-connector/package.json` `version` +- `packages/oms-wallet-wagmi-connector/package.json` `peerDependencies["@0xsequence/typescript-sdk"]` + +## After The Release PR Is Merged + +1. Switch to the latest `master`: ```bash git checkout master @@ -8,7 +24,14 @@ git pull pnpm install --frozen-lockfile ``` -2. Run release checks: +2. Capture the release version and verify package versions: + +```bash +VERSION=$(node -p "require('./package.json').version") +pnpm check:package-versions +``` + +3. Run release checks: ```bash pnpm exec tsc --noEmit @@ -16,30 +39,50 @@ pnpm test pnpm build pnpm build:node-example pnpm build:example +pnpm build:trails-actions-example +pnpm --filter @0xsequence/oms-wallet-wagmi-connector test +pnpm --filter @0xsequence/oms-wallet-wagmi-connector build +pnpm build:wagmi-example +``` + +4. Dry-run the SDK publish: + +```bash +pnpm publish --dry-run --no-git-checks --tag alpha --access public ``` -3. Dry-run publish: +5. Dry-run the wagmi connector publish: ```bash -pnpm publish --dry-run --no-git-checks +pnpm --filter @0xsequence/oms-wallet-wagmi-connector publish --dry-run --no-git-checks --tag alpha --access public ``` -4. Log in to npm if needed: +6. Log in to npm if needed: ```bash pnpm npm login +pnpm npm whoami ``` -5. Publish alpha: +7. Publish the SDK: ```bash pnpm publish --tag alpha --access public +pnpm view @0xsequence/typescript-sdk@$VERSION version +``` + +8. Publish the wagmi connector: + +```bash +pnpm --filter @0xsequence/oms-wallet-wagmi-connector publish --tag alpha --access public +pnpm view @0xsequence/oms-wallet-wagmi-connector@$VERSION version ``` -6. Verify package: +9. Verify the alpha dist tags: ```bash pnpm view @0xsequence/typescript-sdk@alpha version +pnpm view @0xsequence/oms-wallet-wagmi-connector@alpha version ``` -Optional: create a git tag / GitHub release for `v0.1.0-alpha.0`. +Optional: create a git tag and GitHub release for `v$VERSION`. diff --git a/README.md b/README.md index 52c2188..b9fd98b 100644 --- a/README.md +++ b/README.md @@ -527,38 +527,7 @@ See [API.md](./API.md) for the full method and type reference. ## Publishing -Publish the SDK before the wagmi connector. The connector has an exact peer dependency on the SDK -version, so the SDK package must exist in the npm registry first. - -Before publishing a new alpha version, update these values to the same exact version: - -- `package.json` `version` -- `packages/oms-wallet-wagmi-connector/package.json` `version` -- `packages/oms-wallet-wagmi-connector/package.json` `peerDependencies["@0xsequence/typescript-sdk"]` - -Then publish from the repository root with the alpha dist tag: - -```bash -npm whoami - -VERSION=$(node -p "require('./package.json').version") - -pnpm install --frozen-lockfile -pnpm check:package-versions -pnpm exec tsc --noEmit -pnpm test -pnpm --filter @0xsequence/oms-wallet-wagmi-connector test -pnpm --filter @0xsequence/oms-wallet-wagmi-connector build - -pnpm publish --access public --tag alpha -npm view @0xsequence/typescript-sdk@$VERSION version - -pnpm --filter @0xsequence/oms-wallet-wagmi-connector publish --access public --tag alpha -npm view @0xsequence/oms-wallet-wagmi-connector@$VERSION version -``` - -Do not use a recursive workspace publish for these packages while the connector's peer dependency is -intentionally lockstep with the SDK version. The publish order matters. +See [PUBLISHING.md](./PUBLISHING.md) for release and npm publishing steps. ## Contributing