Skip to content

build: migrate JS tooling from yarn to pnpm#204

Merged
naddison36 merged 5 commits intomainfrom
clement/migrate-to-pnpm
Apr 7, 2026
Merged

build: migrate JS tooling from yarn to pnpm#204
naddison36 merged 5 commits intomainfrom
clement/migrate-to-pnpm

Conversation

@clement-ux
Copy link
Copy Markdown
Contributor

@clement-ux clement-ux commented Apr 7, 2026

Summary

Migrates the JavaScript dependency manager from yarn (classic v1) to pnpm for faster installs, smaller node_modules via the content-addressable store, and stricter dependency hoisting.

Changes

pnpm migration

  • Makefileyarn installpnpm install; clean-all now removes pnpm-lock.yaml
  • package.json — added "packageManager": "pnpm@9.15.0" so Corepack picks the right version automatically
  • .github/actions/setup/action.yml — replaced manual yarn cache step with the standard pnpm CI pattern: pnpm/action-setup@v4 + actions/setup-node@v4 (Node 20, cache: 'pnpm'); renamed input install-yarninstall-pnpm. The action reads the pnpm version directly from package.json#packageManager
  • .github/workflows/main.yml — 4 jobs updated to install-pnpm: 'true'
  • CLAUDE.md / .claude/CLAUDE.md — doc references updated
  • Lockfileyarn.lock deleted, pnpm-lock.yaml committed

Test fixes (unrelated pre-existing CI failures, fixed here to get the PR green)

  • Smoke test — cherry-picked 13fb74d from Reduced the Ethena ARM DELAY_REQUEST from 3 hours to 30 minutes #203: updates morphoMarket reference and adjusts the WETH allocation in test_allocate_to_lending_market to account for outstanding withdrawals, so the assertion holds against current mainnet state.
  • Fork test (FlyTrade) — when the upstream FlyTrade API returns Cloudflare error 525 (origin SSL handshake failure), the flyTradeQuote hardhat task now emits a sentinel hex (0xc10ad11ae525) and exits 0 instead of crashing. Helpers.getFlyTradeQuote detects that sentinel from vm.ffi output and calls vm.skip(true), so transient upstream outages mark the test as skipped rather than failing CI. Only 525 triggers the skip — every other failure mode still surfaces as a real test failure.

Notes

  • pnpm is stricter than yarn classic about phantom dependencies. Local install + lint + rollup all pass cleanly, so nothing was relying on undeclared transitive deps.
  • dependencies/@pendle-sy-1.0.0-1.0.0/yarn.lock is left untouched (it belongs to a vendored Soldeer dep).
  • pnpm 9 requires Node ≥ 18.12. The CI setup action pins Node 20.

Test plan

  • pnpm install succeeds and produces pnpm-lock.yaml
  • pnpm lint passes
  • pnpm prettier:check passes
  • pnpm rollup -c src/js/actions/rollup.config.cjs bundles all Defender Actions
  • CI: build, unit-tests, fork-tests, smoke-tests jobs install pnpm and pass

- Replace yarn with pnpm in Makefile install/clean targets
- Pin pnpm via packageManager field in package.json
- Update CI setup action to use pnpm/action-setup + setup-node cache
- Rename install-yarn input to install-pnpm in workflows
- Regenerate lockfile (yarn.lock -> pnpm-lock.yaml)
- Update doc references in CLAUDE.md files
Specifying both `version: 9` in the action and `packageManager: pnpm@9.15.0`
in package.json triggers ERR_PNPM_BAD_PM_VERSION. Drop the explicit input
so the action picks up the pinned version from package.json.
The flyTradeQuote hardhat task now catches axios errors with status 525
(Cloudflare SSL handshake failure with origin) and emits a sentinel hex
to stdout instead of throwing. Helpers.sol detects that sentinel from
vm.ffi output and calls vm.skip(true), so transient upstream outages
mark the test as skipped instead of failing CI.
@clement-ux clement-ux changed the title chore: migrate from yarn to pnpm build: migrate JS tooling from yarn to pnpm Apr 7, 2026
@notion-workspace
Copy link
Copy Markdown

naddison36
naddison36 previously approved these changes Apr 7, 2026
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@naddison36 naddison36 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested my common Hardhat tasks and they are working.

@naddison36 naddison36 merged commit 92ed4b1 into main Apr 7, 2026
8 checks passed
@naddison36 naddison36 deleted the clement/migrate-to-pnpm branch April 7, 2026 22:42
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.

2 participants