1.4 KiB
1.4 KiB
Package manager
Default: pnpm (fast, disk-efficient, single lockfile).
Preferred alternative: Yarn is supported; use it if you prefer.
Setup
-
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.yamlso CI and others use the same dependency tree.
- Ensure Corepack is enabled:
-
Yarn (alternative)
- Use existing
.yarnrc.ymland Yarn 3.2.1. - Install:
yarn install - Scripts:
yarn build,yarn start,yarn test, etc. - Root
packageManageris set to pnpm; if you use Yarn only, runyarn installand ignorepnpm-lock.yaml.
- Use existing
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.jsonare 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.yamloryarn.lock, not both, to avoid drift.