Skip to content

Commit 648e405

Browse files
roninjin10Will Cory
and
Will Cory
authored
feat: migrate from yarn to pnpm (#6120)
* feat: Upgrade from yarn to pnpm * fix: update eslint and eslint parser to fix contracts-bedrock linter fix: update all eslint packages Revert "fix: update all eslint packages" This reverts commit ba4febe. ok updating all of the eslint was over aggro upgrade eslint core too --------- Co-authored-by: Will Cory <willcory@Wills-MacBook-Pro.local>
1 parent add32f6 commit 648e405

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+20002
-17459
lines changed

.circleci/config.yml

+139-78
Large diffs are not rendered by default.

.github/workflows/publish-canary.yml

+5-16
Original file line numberDiff line numberDiff line change
@@ -35,39 +35,28 @@ jobs:
3535
uses: actions/setup-node@master
3636
with:
3737
node-version: 16.x
38-
39-
- name: Get yarn cache directory path
40-
id: yarn-cache-dir-path
41-
run: echo "::set-output name=dir::$(yarn cache dir)"
42-
43-
- uses: actions/cache@v2
44-
id: yarn-cache
45-
with:
46-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
47-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
48-
restore-keys: |
49-
${{ runner.os }}-yarn-
38+
cache: pnpm
5039

5140
- name: Install Dependencies
52-
run: yarn --frozen-lockfile
41+
run: pnpm --frozen-lockfile
5342

5443
- name: Install Foundry
5544
uses: foundry-rs/foundry-toolchain@v1
5645
with:
5746
version: nightly
5847

5948
- name: Build
60-
run: yarn build
49+
run: pnpm build
6150

6251
- name: Setup Canary Snapshot
63-
run: yarn changeset version --snapshot
52+
run: pnpm changeset version --snapshot
6453

6554
- name: Publish To NPM
6655
uses: changesets/action@v1
6756
id: changesets
6857
with:
6958
createGithubReleases: false
70-
publish: yarn changeset publish --tag canary
59+
publish: pnpm changeset publish --tag canary
7160
env:
7261
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7362
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/release.yml

+3-14
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,10 @@ jobs:
3333
uses: actions/setup-node@master
3434
with:
3535
node-version: 16.x
36-
37-
- name: Get yarn cache directory path
38-
id: yarn-cache-dir-path
39-
run: echo "::set-output name=dir::$(yarn cache dir)"
40-
41-
- uses: actions/cache@v2
42-
id: yarn-cache
43-
with:
44-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
45-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
46-
restore-keys: |
47-
${{ runner.os }}-yarn-
36+
cache: pnpm
4837

4938
- name: Install Dependencies
50-
run: yarn --frozen-lockfile
39+
run: pnpm install --frozen-lockfile
5140

5241
- name: Install Foundry
5342
uses: foundry-rs/foundry-toolchain@v1
@@ -62,7 +51,7 @@ jobs:
6251
id: changesets
6352
with:
6453
createGithubReleases: false
65-
publish: yarn release
54+
publish: pnpm release
6655
env:
6756
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6857
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.husky/pre-commit

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4-
yarn nx affected --target=pre-commit
4+
pnpm nx affected --target=pre-commit
5+

.npmrc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# run prefoo scripts
2+
# npm and yarn support this as a default pnpm defaults to false
3+
enable-pre-post-scripts=true
4+
lockfile=true
5+
prefer-workspace-packages=true

.prettierrc.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module.exports = {
22
$schema: 'http://json.schemastore.org/prettierrc',
3+
plugins: ['prettier-plugin-solidity'],
34
trailingComma: 'es5',
45
tabWidth: 2,
56
semi: false,

CONTRIBUTING.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ You *must* include a `changeset` file in your PR when making a change that would
4343
Adding a `changeset` file is easy:
4444

4545
1. Navigate to the root of the monorepo.
46-
2. Run `yarn changeset`. You'll be prompted to select packages to include in the changeset. Use the arrow keys to move the cursor up and down, hit the `spacebar` to select a package, and hit `enter` to confirm your selection. Select *all* packages that require a new release as a result of your PR.
46+
2. Run `pnpm changeset`. You'll be prompted to select packages to include in the changeset. Use the arrow keys to move the cursor up and down, hit the `spacebar` to select a package, and hit `enter` to confirm your selection. Select *all* packages that require a new release as a result of your PR.
4747
3. Once you hit `enter` you'll be prompted to decide whether your selected packages need a `major`, `minor`, or `patch` release. We follow the [Semantic Versioning](https://semver.org/) scheme. Please avoid using `major` releases for any packages that are still in version `0.y.z`.
4848
4. Commit your changeset and push it into your PR. The changeset bot will notice your changeset file and leave a little comment to this effect on GitHub.
4949
5. Voilà, c'est fini!
@@ -63,7 +63,7 @@ You'll need the following:
6363
* [Git](https://git-scm.com/downloads)
6464
* [NodeJS](https://nodejs.org/en/download/)
6565
* [Node Version Manager](https://github.com/nvm-sh/nvm)
66-
* [Yarn](https://classic.yarnpkg.com/en/docs/install)
66+
* [pnpm](https://pnpm.io/installation)
6767
* [Docker](https://docs.docker.com/get-docker/)
6868
* [Docker Compose](https://docs.docker.com/compose/install/)
6969
* [Go](https://go.dev/dl/)
@@ -86,10 +86,10 @@ Install node v16.16.0 with [nvm](https://github.com/nvm-sh/nvm)
8686
nvm use
8787
```
8888

89-
### Install node modules with Yarn
89+
### Install node modules with pnpm
9090

9191
```bash
92-
yarn install
92+
pnpm i
9393
```
9494

9595
### Building the TypeScript packages
@@ -101,8 +101,8 @@ and compile the smart contracts. Install foundry [here](https://getfoundry.sh/).
101101
To build all of the [TypeScript packages](./packages), run:
102102

103103
```bash
104-
yarn clean
105-
yarn build
104+
pnpm clean
105+
pnpm build
106106
```
107107

108108
Packages compiled when on one branch may not be compatible with packages on a different branch.
@@ -136,8 +136,8 @@ Finally, **if you're running into weird problems and nothing seems to be working
136136

137137
```bash
138138
cd optimism
139-
yarn clean
140-
yarn build
139+
pnpm clean
140+
pnpm build
141141
cd ops
142142
docker-compose down -v
143143
docker-compose build
@@ -162,14 +162,14 @@ Before running tests: **follow the above instructions to get everything built.**
162162
Run unit tests for all packages in parallel via:
163163

164164
```bash
165-
yarn test
165+
pnpm test
166166
```
167167

168168
To run unit tests for a specific package:
169169

170170
```bash
171171
cd packages/package-to-test
172-
yarn test
172+
pnpm test
173173
```
174174

175175
#### Running contract static analysis
@@ -181,5 +181,5 @@ To run `slither` locally, do:
181181
```bash
182182
cd packages/contracts
183183
pip3 install slither-analyzer
184-
yarn test:slither
184+
pnpm test:slither
185185
```

Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ build-ts: submodules
1212
if [ -n "$$NVM_DIR" ]; then \
1313
. $$NVM_DIR/nvm.sh && nvm use; \
1414
fi
15-
yarn install
16-
yarn build
15+
pnpm install
16+
pnpm build
1717
.PHONY: build-ts
1818

1919
submodules:
@@ -102,7 +102,7 @@ test-unit:
102102
make -C ./op-proposer test
103103
make -C ./op-batcher test
104104
make -C ./op-e2e test
105-
yarn test
105+
pnpm test
106106
.PHONY: test-unit
107107

108108
test-integration:

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ See table in the **Active Branches** section above to find the right branch to t
138138
We use [changesets](https://github.com/changesets/changesets) to mark packages for new releases.
139139
When merging commits to the `develop` branch you MUST include a changeset file if your change would require that a new version of a package be released.
140140

141-
To add a changeset, run the command `yarn changeset` in the root of this monorepo.
141+
To add a changeset, run the command `pnpm changeset` in the root of this monorepo.
142142
You will be presented with a small prompt to select the packages to be released, the scope of the release (major, minor, or patch), and the reason for the release.
143143
Comments within changeset files will be automatically included in the changelog of the package.
144144

lerna.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"npmClient": "yarn",
2+
"npmClient": "pnpm",
33
"useWorkspaces": true,
4+
"version": "independent",
45
"packages": [
56
"packages/*"
6-
],
7-
"version": "independent"
7+
]
88
}

op-bindings/Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ version:
1111

1212
compile:
1313
cd $(contracts-dir) && \
14-
yarn build
14+
pnpm build
1515

1616
bindings: compile bindings-build
1717

@@ -28,7 +28,7 @@ mkdir:
2828

2929
clean-contracts:
3030
cd $(contracts-dir) && \
31-
yarn clean
31+
pnpm clean
3232

3333
clean:
3434
rm -rf $(pkg)

op-bindings/bindings/faultdisputegame_more.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

op-bindings/bindings/l2outputoracle_more.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)