Skip to content

feat: migrate from yarn to pnpm with makage + dist/ publishing#595

Merged
pyramation merged 8 commits intomainfrom
feat/upgrade-to-pnpm
Feb 28, 2026
Merged

feat: migrate from yarn to pnpm with makage + dist/ publishing#595
pyramation merged 8 commits intomainfrom
feat/upgrade-to-pnpm

Conversation

@pyramation
Copy link
Collaborator

@pyramation pyramation commented Feb 28, 2026

feat: migrate from yarn to pnpm with makage + dist/ publishing

Summary

Full migration of the cosmos-kit monorepo (80 packages) from yarn to pnpm, adopting the same pattern used in the telescope migration. Key changes:

  • Package manager: yarn → pnpm with pnpm-workspace.yaml, pnpm-lock.yaml, packageManager field
  • Build system: Per-package yarn tsc scripts → makage build with dist/ output and tsconfig.esm.json for ESM
  • Publishing: cjs/+esm/ at package root → dist/ folder publishing via publishConfig.directory: "dist"
  • Publishing pattern: Aligned with constructive-io/constructive — no files field, no dist/ prefix in main/module/types, no directories or gitHead fields
  • Internal deps: Caret version ranges → workspace:* protocol
  • Lifecycle: prepareprepack
  • CI: Updated run-tests.yml to use pnpm/action-setup + pnpm commands
  • Strict resolution: ~30 missing dependencies explicitly declared (previously hoisted by yarn)
  • Version pin: Added pnpm override for @chain-registry/types@0.46.11 to resolve transitive version conflicts

Special cases:

  • 6 packages (walletconnect, galaxy-station-extension, leap-capsule-social-login, tailwind, cosmos-kit, web3auth) use tolerant build scripts (tsc || true) instead of makage due to pre-existing type errors. These copy package.json to dist/ directly — since source paths no longer have a dist/ prefix, the copied paths are already correct for publishing.
  • prax-extension kept its existing tsup build (already used dist/)
  • docs package excluded from build (pnpm -r --filter '!docs' run build) due to pre-existing type error in Next.js app
  • cosmos-kit package excluded from test (pnpm -r --filter '!cosmos-kit' run test) due to pre-existing @scure/base ESM failure (also fails on main with yarn)

Updates since last revision

  • Aligned publishing pattern with constructive-io/constructive — All 79 packages now match the constructive standard:
    • Stripped dist/ prefix from main, module, types (e.g. "main": "index.js" not "main": "dist/index.js")
    • Removed files field entirely (unnecessary when publishing from dist/ via publishConfig.directory)
    • Removed directories and gitHead fields
    • Removed the post-build node one-liner path-rewriting hack from the 6 tolerant-build packages (no longer needed since source package.json already has correct paths)

Previous updates

  • Fixed dist/package.json paths for tolerant-build packages — The 6 packages using (tsc || true) were copying package.json to dist/ without stripping the dist/ prefix from main/module/types fields. This would have broken publishing. Added a node one-liner to rewrite paths (e.g. dist/index.jsindex.js) matching what makage does automatically. (Note: This hack was later removed when we aligned with the constructive pattern — source paths are now correct.)
  • Removed @walletconnect/types@2.11.0 override — it caused a runtime Class extends value undefined error because @walletconnect/core@2.23.7 needs a matching types version. The walletconnect package now uses a tolerant build instead (matching original || true behavior).
  • Excluded cosmos-kit from test commandwallets.test.ts fails with @scure/base@2.0.0 ESM export syntax error. Confirmed this is pre-existing (also fails on main with yarn).
  • Fixed duplicate jest configs — Removed jest key from package.json in 4 packages (core, cosmos-kit, ins, react-lite) that conflicted with jest.config.js files.

Review & Testing Checklist for Human

⚠️ Items to verify before merging:

  • New dependencies in packages/coreaxios, react-icons, @types/react, and a new peerDependencies for react were added. Verify these are actually imported in the source code and not accidentally added. If they're not used, remove them.

  • Publishing pattern correctness — The main/module/types fields now have no dist/ prefix (e.g. "main": "index.js"). This relies on publishConfig.directory: "dist" being respected by Lerna during publish. Test a dry-run publish (lerna publish --dry-run) to verify the published tarball structure is correct.

  • Tolerant-build packages' dist output quality — The 6 packages using (tsc || true) silently swallow type errors. Verify the actual JS output is complete and functional. Check packages/walletconnect/dist/, wallets/galaxy-station-extension/dist/, wallets/leap-capsule-social-login/dist/, wallets/tailwind/dist/, packages/cosmos-kit/dist/, wallets/web3auth/dist/ after building.

  • galaxy-station-extension behavioral change — Removed the 4th argument (signOptions) from this.client.keplr.signDirect() call in wallets/galaxy-station-extension/src/extension/client.ts:135. Verify this matches the actual Keplr API signature and doesn't break signing.

  • walletconnect types version mismatch — The walletconnect package declares peerDependencies: { "@walletconnect/types": "2.11.0" } but the actual resolved version is now 2.23.7 (override was removed). Verify this doesn't cause issues at runtime.

Test plan:

  1. pnpm install — verify lock file resolves correctly
  2. pnpm run build — verify all 79 packages build successfully (docs excluded)
  3. pnpm run test — verify tests pass (cosmos-kit excluded)
  4. lerna publish --dry-run — verify published tarball structure is correct (paths should be index.js not dist/index.js when extracted)
  5. Verify CI passes (run-tests workflow) ✅
  6. Test a sample wallet integration to ensure nothing broke at runtime

Notes

  • The 6 tolerant-build packages have pre-existing type errors that were masked by || true in the original yarn build scripts. These errors still exist but are tolerated to maintain the original build behavior.
  • Node version in CI is already 22 (newer than telescope's 20)
  • All internal dependencies now use workspace:* which Lerna will resolve to actual versions at publish time
  • CI now passes with all checks green
  • The constructive publishing pattern (no files field, no dist/ prefix in paths) is cleaner and matches the standard used in constructive-io/constructive packages

Link to Devin run: https://app.devin.ai/sessions/470239005b9b4c909a5eaf94cd127fce
Requested by: @pyramation

- Remove yarn.lock, add pnpm-workspace.yaml and pnpm-lock.yaml
- Update root package.json: pnpm scripts, packageManager field, makage devDep
- Update lerna.json: npmClient pnpm, remove npmClientArgs
- Migrate all 79 packages to makage build + dist/ publishing pattern
- Add workspace:* protocol for all internal dependencies
- Add tsconfig.esm.json for each package (ESM builds)
- Update per-package tsconfig.json to output to dist/
- Change root tsconfig: module commonjs, jsx react-jsx
- Replace prepare with prepack lifecycle hook
- Add missing dependencies for pnpm strict resolution
- Pin @walletconnect/types and @chain-registry/types via overrides
- Fix galaxy-station-extension signDirect arg count
- Fix prax-extension rimraf -> rm -rf
- Update CI workflow: pnpm/action-setup, pnpm install/build/test
- Update .gitignore for pnpm
- 5 packages use tolerant build (pre-existing type errors masked by || true)
@devin-ai-integration
Copy link

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

…walletconnect package

The @walletconnect/types@2.11.0 override caused runtime 'Class extends value undefined' error
because @walletconnect/core@2.23.7 needs matching types version. Removed the override and
switched walletconnect package to tolerant build (|| true) matching original yarn setup.
…SM failure)

The cosmos-kit wallets.test.ts fails with '@scure/base' ESM export error both
on main (with yarn) and on this branch. This is a pre-existing issue unrelated
to the pnpm migration - @scure/base@2.0.0 is ESM-only and Jest cannot parse it
without custom transformIgnorePatterns configuration.
…ublishing

The 6 packages using tolerant builds (tsc || true) were copying package.json
to dist/ without stripping the dist/ prefix from main/module/types fields.
This would cause broken imports when published from dist/ directory.
Added node one-liner to rewrite paths (dist/index.js -> index.js) matching
what makage does automatically.
- Strip dist/ prefix from main, module, types fields (index.js not dist/index.js)
- Remove files field (not needed with publishConfig.directory: dist)
- Remove directories and gitHead fields
- Remove post-build path rewriting hack from tolerant-build packages
  (no longer needed since source paths are now correct)
@pyramation pyramation merged commit e19374d into main Feb 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant