Files
metamask-integration/chain138-snap/PACKAGE_MANAGER.md
2026-02-15 21:44:57 -08:00

1.4 KiB

Package manager

Default: pnpm (fast, disk-efficient, single lockfile).

Preferred alternative: Yarn is supported; use it if you prefer.

Setup

  1. pnpm (default)

    • Ensure Corepack is enabled: corepack enable
    • Install: pnpm install
    • Scripts: pnpm run build, pnpm run start, pnpm run test, etc.
    • Commit pnpm-lock.yaml so CI and others use the same dependency tree.
  2. Yarn (alternative)

    • Use existing .yarnrc.yml and Yarn 3.2.1.
    • Install: yarn install
    • Scripts: yarn build, yarn start, yarn test, etc.
    • Root packageManager is set to pnpm; if you use Yarn only, run yarn install and ignore pnpm-lock.yaml.

CI

GitHub Actions use pnpm by default: corepack prepare pnpm@9.15.0 --activate then pnpm install --frozen-lockfile and pnpm run build / pnpm run lint / pnpm --filter chain138-snap run test. Before the first CI run (or after adding dependencies), run pnpm install locally and commit pnpm-lock.yaml so CI has a lockfile.

Recommendations

  • Use pnpm for consistency with CI and docs.
  • Use Yarn if your tooling or team already standardizes on it; scripts in package.json are written for pnpm but Yarn can run the same targets (yarn build, etc.) from the root.
  • Do not mix lockfiles in the same branch: use either pnpm-lock.yaml or yarn.lock, not both, to avoid drift.