Skip to content

Commit

Permalink
chore(contracts): switch from yarn to pnpm (#33)
Browse files Browse the repository at this point in the history
Switch from yarn to pnpm for node package management.

#### Motivation

[pnpm](https://pnpm.io/) is becoming industry standard for managing node
packages. It's lightweight, and removes a lot of bloat from node_modules
- using symlinks and ensuring package versions are only installed to
disk once. Installations are much quicker. And it has better support for
monorepos (pnpm workspaces) should we decide to manage multiple pnpm
projects in our monorepo (as [optimism
does](https://github.com/ethereum-optimism/optimism/blob/develop/pnpm-workspace.yaml),
for example)

I've avoided using it in the past alongside foundry because foundry has
allegedly had [issues with handling pnpm
symlinks](foundry-rs/foundry#2714), but I've
tried it in our playground repo and imports work well, for both building
& IDE ls integrations.

task: none
  • Loading branch information
kevinhalliday authored Jan 5, 2024
1 parent 49905eb commit f9cca5c
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 935 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ repos:
rev: v4.5.0
hooks:
- id: trailing-whitespace # trims trailing whitespace
exclude: "(testdata|.yarn)"
exclude: "testdata"
- id: end-of-file-fixer # ensures that a file is either empty, or ends with one newline
exclude_types: ["proto"]
exclude: "testdata"
Expand Down
9 changes: 0 additions & 9 deletions contracts/.gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
.yarn/*
!.yarn/cache
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

node_modules
yarn-error.log

out
cache
893 changes: 0 additions & 893 deletions contracts/.yarn/releases/yarn-4.0.2.cjs

This file was deleted.

2 changes: 0 additions & 2 deletions contracts/.yarnrc.yml

This file was deleted.

2 changes: 1 addition & 1 deletion contracts/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"packageManager": "yarn@4.0.2",
"packageManager": "pnpm@8.14.0",
"dependencies": {
"ds-test": "https://github.com/dapphub/ds-test",
"forge-std": "https://github.com/foundry-rs/forge-std"
Expand Down
27 changes: 27 additions & 0 deletions contracts/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 0 additions & 29 deletions contracts/yarn.lock

This file was deleted.

0 comments on commit f9cca5c

Please sign in to comment.