XCOMMONS-3464: Migrate to pnpm #1487
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Jira URL
https://jira.xwiki.org/browse/XCOMMONS-3464
Changes
npmis replaced bypnpminwebjar-node.This allows us to have all the
webjar-nodeas a pnpm workspace (see https://github.com/xwiki/xwiki-platform/pull/4721/files#diff-18ae0a0fab29a7db7aded913fd05f30a2c8f6c104fadae86c9d217091709794cR1-R4).This also allows us to use pnpm catalogs which is a recent mechanism to centralize dependency versions instead of duplicating them in all packages.
We experienced it in Cristal first and proved successful and greatly simplify npm dependencies upgrades.
This is also well supported by renovate.
An additional benefit is that the lock file is now unique at the root of the repository instead of one for each module.
As a consequence of having all the packages in in the pnpm workspace, I stopped moving the javascript sources to
targetbefore starting the build.This is important because when the sources are moved, they are not part of the workspace anymore (or with a duplicated package id), and this is breaking dependencies resolution.
The main cons I'd like to highlight is that since the javascript build is now done "inplace", a
distand anode_modulesare created during the build (they are git ignore, but are still there).Screenshots & Video
N/A
Executed Tests
Expected merging strategy