feat(cli): validate yarn.lock in 'start' and 'build' commands and add 'deduplicate' command #668
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.
Closes https://jira.dhis2.org/browse/LIBS-213
yarn.lock
instart
andbuild
commands (warning instart
but error inbuild
) by ensuring that there is only one version of@dhis2/app-runtime
,@dhis2/d2-i18n
,@dhis2/ui
,react
andstyled-jsx
deduplicate
command (which runs yarn-deduplicate)Implementation notes
i18next
as a sensitive singleton dependency,i18next-scanner
declares the version of itsi18next
dependency as"*"
. This results in two different major versions ofi18next
(@dhis2/d2-i18n
depends on^10.3
, but latest major version is 21), whichyarn-deduplicate
does not attempt to fix. Therefore, addingi18next
would result inyarn build
failing for all app-platform apps unlessyarn.lock
s are manually edited.yarn-deduplicate
's code is included in this PR directly instead of being added as an npm dependency due to modifications required forlistDuplicates
andgetDuplicatedPackages
to work for our use case.