Skip to content

Commit

Permalink
Move from yarn to pnpm
Browse files Browse the repository at this point in the history
  • Loading branch information
ai committed Dec 30, 2021
1 parent a5ba59d commit 28289de
Show file tree
Hide file tree
Showing 6 changed files with 3,596 additions and 3,452 deletions.
32 changes: 22 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
name: Test
"on":
push: null
pull_request: null
env:
FORCE_COLOR: 2
on:
push:
pull_request:
jobs:
full:
name: Node.js 16 Full
name: Node.js 17 Full
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v2
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: latest
- name: Install Node.js
uses: actions/setup-node@v2
with:
node-version: 17
cache: pnpm
- name: Install dependencies
uses: bahmutov/npm-install@v1
run: pnpm install --frozen-lockfile --ignore-scripts
- name: Run tests
run: yarn test
run: pnpm test
env:
FORCE_COLOR: 2
short:
runs-on: ubuntu-latest
strategy:
Expand All @@ -31,11 +36,18 @@ jobs:
steps:
- name: Checkout the repository
uses: actions/checkout@v2
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: latest
- name: Install Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: pnpm
- name: Install dependencies
uses: bahmutov/npm-install@v1
run: pnpm install --frozen-lockfile --ignore-scripts
- name: Run unit tests
run: npx jest
run: pnpm unit
env:
FORCE_COLOR: 2
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
node_modules/
yarn-error.log

coverage/
coverage/
5 changes: 2 additions & 3 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
yarn-error.log
yarn.lock
pnpm-lock.yaml

*.test.js
coverage/
.github/
.github/
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"nested"
],
"scripts": {
"unit": "jest",
"test": "jest --coverage && eslint ."
},
"author": "Andrey Sitnik <andrey@sitnik.ru>",
Expand Down
Loading

5 comments on commit 28289de

@simPod
Copy link

@simPod simPod commented on 28289de Oct 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you share the motivation for the migration to pnpm? I'm curious. Thanks!

@ai
Copy link
Member Author

@ai ai commented on 28289de Oct 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Yarn 1 is dead but pnpm has new useful DX feature every month.
  2. Yarn 1 has unfixed bugs with git dependencies which nobody will fix
  3. pnpm re-use cache between all your projects and free a few GBs on my laptop
  4. pnpm CLI output is better
  5. pnpm has many unique and very useful features like nested dependencies update in one command

@simPod
Copy link

@simPod simPod commented on 28289de Oct 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, thanks for reply! Have you also considered Yarn 3/4 with PnP? I guess it solves 1. and 2. but ofc not sure about 3. or 4. or 5.

@ai
Copy link
Member Author

@ai ai commented on 28289de Oct 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried Yarn 3. It fixed 1 and 2, but reduced performance and made DX even worse

@simPod
Copy link

@simPod simPod commented on 28289de Oct 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for discussion, appreciated. I'm using Yarn 4 at the moment but will take a look at pnpm based on this.

Please sign in to comment.