Skip to content

Commit

Permalink
Switch from yarn to npm
Browse files Browse the repository at this point in the history
We recently had problems with bugs in Yarn 1 regarding package aliases.
The developers of Yarn 1 will not accept bug fixes for Yarn 1 anymore
as they want users to upgrade to Yarn 4.

Since Yarn was created, the features that motivated its use have been
added to npm. The only exception being parallel execution but npm has
added other features that make it very fast anyway.

Here's some perfomance testing results:
https://p.datadoghq.eu/sb/d2wdprp9uki7gfks-c562c42f4dfd0ade4885690fa719c818

Yarn introduced lockfiles to ensure that every install results in
the exact same file structure in node_modules across all machines.
This approach was quickly adopted by npm in npm 5.

https://engineering.fb.com/2016/10/11/web/yarn-a-new-package-manager-for-javascript/
https://blog.npmjs.org/post/161081169345/v500.html

Yarn introduced Workspaces as an optimization for monorepositories.
After a few years, npm adopted that in npm 7.

https://classic.yarnpkg.com/blog/2017/08/02/introducing-workspaces/
https://docs.npmjs.com/cli/v7/using-npm/changelog

I generated package-lock.json by just running npm install.
That command supports and understands yarn.lock.
  • Loading branch information
WULCAN committed Jul 5, 2024
1 parent 6fdd1bf commit ab8f1cb
Show file tree
Hide file tree
Showing 7 changed files with 11,774 additions and 5,295 deletions.
2 changes: 1 addition & 1 deletion .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/sh
yarn lint:formatting && yarn lint:eslint
npm run lint:formatting && npm run lint:eslint
12 changes: 6 additions & 6 deletions .github/workflows/test-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: ^18.17
cache: "yarn"
- run: yarn
- run: yarn workspaces run build
- run: yarn workspaces run test
- run: yarn workspaces run lint:formatting
- run: yarn workspaces run lint:eslint
cache: 'npm'
- run: npm install
- run: npm run --workspaces build
- run: npm run --workspaces test
- run: npm run --workspaces lint:formatting
- run: npm run --workspaces lint:eslint
Loading

0 comments on commit ab8f1cb

Please sign in to comment.