Skip to content

Commit fb9cb05

Browse files
authored
chore: migrate yarn 1 + lerna to pnpm (#321)
1 parent 3c50f06 commit fb9cb05

File tree

10 files changed

+5049
-7078
lines changed

10 files changed

+5049
-7078
lines changed

.github/.dependabot.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
version: 2
22
updates:
3-
- package-ecosystem: "yarn"
3+
- package-ecosystem: "pnpm"
44
allow:
55
- dependency-type: "production"
66
commit-message:

.github/workflows/test_and_release.yml

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,22 @@ jobs:
1919
node: [22]
2020
steps:
2121
- uses: actions/checkout@v2
22+
- name: Install pnpm before setup node
23+
shell: bash
24+
run: npm install -g pnpm
2225
- uses: actions/setup-node@v2-beta
2326
with:
2427
node-version: ${{matrix.node}}
25-
- run: yarn install
26-
- run: yarn build
28+
- run: pnpm install
29+
- run: pnpm build
2730
- name: Lint
28-
run: yarn lint
31+
run: pnpm lint
2932
- name: Check Types
30-
run: yarn run check-types
33+
run: pnpm run check-types
3134
- name: Unit tests
32-
run: yarn test:unit
35+
run: pnpm test:unit
3336
- name: E2e tests
34-
run: yarn test:e2e
37+
run: pnpm test:e2e
3538

3639
maybe-release:
3740
name: release
@@ -49,20 +52,24 @@ jobs:
4952

5053
- uses: actions/checkout@v3
5154
if: ${{ steps.release.outputs.releases_created }}
52-
55+
56+
- name: Install pnpm before setup node
57+
shell: bash
58+
run: npm install -g pnpm
59+
5360
- uses: actions/setup-node@v3
5461
with:
5562
node-version: 22
5663
registry-url: 'https://registry.npmjs.org'
5764
if: ${{ steps.release.outputs.releases_created }}
5865

59-
- run: yarn install
66+
- run: pnpm install
6067
if: ${{ steps.release.outputs.releases_created }}
6168

62-
- run: yarn build
69+
- run: pnpm build
6370
if: ${{ steps.release.outputs.releases_created }}
6471

65-
- run: yarn run publish
72+
- run: pnpm run publish
6673
env:
6774
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
6875
if: ${{ steps.release.outputs.releases_created }}

.gitignore

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
logs
33
*.log
44
npm-debug.log*
5-
yarn-debug.log*
6-
yarn-error.log*
5+
pnpm-debug.log
76

87
# Runtime data
98
pids
@@ -51,15 +50,12 @@ typings/
5150
# Output of 'npm pack'
5251
*.tgz
5352

54-
# Output of `yarn build`
53+
# Output of `pnpm build`
5554
lib
5655

5756
# IDEA folder
5857
.idea
5958

60-
# Yarn Integrity file
61-
.yarn-integrity
62-
6359
# dotenv environment variables file
6460
.env
6561

lerna.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

package.json

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
"packages/*"
99
],
1010
"scripts": {
11-
"check-types": "lerna run check-types",
12-
"build": "lerna run build",
13-
"lint": "lerna run lint",
14-
"prepublishOnly": "yarn build",
15-
"publish": "lerna publish from-package --yes --no-verify-access",
16-
"test": "lerna run test",
17-
"test:unit": "lerna run test:unit",
18-
"test:e2e": "lerna run test:e2e"
11+
"check-types": "pnpm -r check-types",
12+
"build": "pnpm -r build",
13+
"lint": "pnpm -r lint",
14+
"prepublishOnly": "pnpm build",
15+
"publish": "pnpm publish -r --access public --no-git-check",
16+
"test": "pnpm -r test",
17+
"test:unit": "pnpm -r test:unit",
18+
"test:e2e": "pnpm -r test:e2e"
1919
},
2020
"pre-push": [
2121
"lint"
@@ -34,12 +34,11 @@
3434
"eslint": "^8.17.0",
3535
"eslint-plugin-prettier": "^4.0.0",
3636
"karma": "^4.3.0",
37-
"lerna": "^7.4.2",
3837
"mocha": "^10.0.0",
3938
"nyc": "^14.1.1",
4039
"prettier": "^2.6.2",
4140
"ts-node": "^10.8.1",
4241
"typescript": "^4.7.3"
4342
},
44-
"packageManager": "[email protected]+sha256.c17d3797fb9a9115bf375e31bfd30058cac6bc9c3b8807a3d8cb2094794b51ca"
43+
"packageManager": "[email protected]"
4544
}

packages/discv5/package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@
3939
"scripts": {
4040
"check-types": "tsc --noEmit",
4141
"build": "tsc -p tsconfig.build.json",
42-
"prepublishOnly": "yarn build",
42+
"prepublishOnly": "pnpm build",
4343
"lint": "eslint --color --ext .ts src/ test/",
44-
"test": "yarn test:unit && yarn test:e2e",
44+
"test": "pnpm test:unit && pnpm test:e2e",
4545
"test:unit": "mocha 'test/unit/**/*.test.ts'",
4646
"test:e2e": "mocha 'test/e2e/**/*.test.ts'"
4747
},
@@ -66,14 +66,16 @@
6666
"homepage": "https://github.com/ChainSafe/discv5#readme",
6767
"devDependencies": {},
6868
"dependencies": {
69-
"@chainsafe/enr": "^5.0.1",
69+
"@chainsafe/enr": "workspace:^",
7070
"@ethereumjs/rlp": "^5.0.2",
7171
"@libp2p/crypto": "^5.0.1",
7272
"@libp2p/interface": "^2.0.1",
73+
"@libp2p/peer-id": "^5.0.1",
7374
"@multiformats/multiaddr": "^12.1.10",
7475
"@noble/hashes": "^1.7.0",
7576
"@noble/secp256k1": "^2.2.2",
7677
"debug": "^4.3.1",
78+
"ethereum-cryptography": "^2.2.0",
7779
"lru-cache": "^10.1.0",
7880
"strict-event-emitter-types": "^2.0.0"
7981
}

packages/enr/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
"scripts": {
2525
"check-types": "tsc --noEmit",
2626
"build": "tsc -p tsconfig.build.json",
27-
"prepublishOnly": "yarn build",
27+
"prepublishOnly": "pnpm build",
2828
"lint": "eslint --color --ext .ts src/ test/",
29-
"test": "yarn test:unit && yarn test:e2e",
29+
"test": "pnpm test:unit && pnpm test:e2e",
3030
"test:perf": "NODE_OPTIONS='--max-old-space-size=4096 --loader=ts-node/esm' benchmark 'bench/**/*.bench.ts' --config .bench.yaml",
3131
"test:unit": "mocha 'test/unit/**/*.test.ts'"
3232
},

0 commit comments

Comments
 (0)