-
-
Notifications
You must be signed in to change notification settings - Fork 370
Replace Yarn Berry by PNPM #2932
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📊 Packages dist files size differenceThanks for the PR! Here is the difference in size of the packages dist files between the base branch and the PR.
|
- name: Replace local "workspace:*" occurrences | ||
run: | | ||
yarn workspaces foreach -pA exec "sed -i 's/\"workspace:\*\"/\"${{ env.VERSION }}\"/g' package.json" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is automatically done when running pnpm publish
, see https://pnpm.io/workspaces#publishing-workspace-packages
1eef72b
to
548ae06
Compare
"@testing-library/dom": "^10.4.0", | ||
"@testing-library/jest-dom": "^6.6.3", | ||
"@testing-library/user-event": "^14.6.1", | ||
"@testing-library/dom": "catalog:", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Catalogs are like an alias to a constraint version.
When defining the catalog version for @testing-library/dom
, then it will always install the exact same version when installing the same package in different places (if we use the same catalog ofc)
"@testing-library/dom": "catalog:", | ||
"@testing-library/jest-dom": "catalog:", | ||
"@testing-library/user-event": "catalog:", | ||
"jsdom": "catalog:", | ||
"tom-select": "^2.2.2", | ||
"tslib": "catalog:", | ||
"tsx": "catalog:", | ||
"typescript": "catalog:", | ||
"vitest": "catalog:", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding the (dev) dependencies used by the package instead of relying of packages installed from parents directories (that "magically" works with Yarn) is a good practice.
By using catalog:
, we will have the same exact version of the dependency installed everywhere (consistency).
@@ -7,6 +7,8 @@ | |||
* file that was distributed with this source code. | |||
*/ | |||
|
|||
/// <reference types="@types/webpack-env" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise __WebpackModuleApi
was not found
@@ -7,6 +7,8 @@ | |||
* file that was distributed with this source code. | |||
*/ | |||
|
|||
/// <reference types="google.maps" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise google
type was not found
548ae06
to
d25f4cb
Compare
d25f4cb
to
17a4bb7
Compare
YARN_ENABLE_HARDENED_MODE: 0 | ||
YARN_ENABLE_IMMUTABLE_INSTALLS: 0 | ||
- working-directory: test_apps/encore-app | ||
run: pnpm install --ignore-workspace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--ignore-workspace
allows to ignore the pnpm-workspace.yaml
from parent folders, and install dependencies from test_apps/encore-app
only (test_apps/encore-app
is not a workspace on purpose)
What does it mean for the contributors? |
Nice job and i’m all in to leave legacy yarn :) |
pnpm will be automatically installed when running |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good arguments for this change!
Purely internal, this PR replaces Yarn by PNPM for the following reasons:
For developers working on UX, pnpm can be installed with Corepack
Note: the ~26k lines changed are mainly about lock files