fix(deps): upgrade @dhis2/cli-app-scripts for peer deps fixes [LIBS-578] #624
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.
Fixes LIBS-578
Fixes peer dependency conflicts that were causing infinite loops when using
npm
v7+ to install the d2 cli. Can be tested using the latestalpha
version of@dhis2/cli
:Note: this constitutes a breaking change, since the minimum Node version will now be 16Update: this change did not introduce the Node 14 incompatibility; it was actually present previously with
cli-app-scripts
. For that reason... I think a major version bump isn't necessary, but it's a bit awkward that a breaking change has happened outside of our control.A quick summary: When running
d2 app scripts init
on Node 14, this error breaks the installation:What's happening: A broken version of
workbox-webpack-plugin
("wwp
" for short, from here on) was released as a feature (v6.6.0/v6.6.1) that breaks Node 14 compatibility.@dhis2/cli-app-scripts
depends onreact-scripts
which depends onwwp@^6.4.1
, so when@dhis2/cli-app-scripts
gets installed, thewwp
version resolves to the broken 6.6.1 and causes a failed installation on Node 14.This affects
@dhis2/cli-app-scripts
down to v7.6.0, due its ownworkbox
dependency, but nowreact-scripts
also has that dependency since@dhis2/cli-app-scripts v10
, and that dependency of a dependency is now a bit out ofcli-app-scripts
's control to fix as far as I can tell.A workaround for consuming apps of
@dhis2/cli-app-scripts
is to add aresolution
field on"workbox-webpack-plugin": "6.5.4"
exactly.To patch
d2 app scripts init
, the createdpackage.json
in the bootstrapped app could come with thatresolution
field already.However,
...since we're moving to Vite soon, Vite will already increase the minimum supported Node version to 18+, so maybe this issue with
workbox
isn't worth fussing over.