[discovery] fix: treat @openedx/frontend-build as an optional peerDep to avoid direct dep in consuming MFEs #790
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.
Related discussions:
Corresponding PR:
Description:
Demonstrates treating
@openedx/frontend-build
as an optional peer dependency within@edx/frontend-platform
, such that consuming MFEs no longer considers@openedx/frontend-build
as a direct dependency, via:From @brian-smith-tcril here:
This indeed does pose a problem for consuming MFEs as
@openedx/frontend-build
should not be considered as a directdependencies
when the MFE itself installs@openedx/frontend-build
as adevDependencies
.Why might this optional peer dependency might work?
Testing the optional peer dependency approach with frontend-app-communications (PR),
@openedx/frontend-build
is no longer treated a direct dependency, but instead receivesdevOptional: true
inpackage-lock.json
(source).While
npm ci --omit=dev
doesn't omit@openedx/frontend-build
from being installed for the MFE,npm ci --omit=dev --omit=optional
would.Merge checklist:
frontend-platform
. This can be done by runningnpm start
and opening http://localhost:8080.module.config.js
file infrontend-build
.fix
,feat
) and is appropriate for your code change. Consider whether your code is a breaking change, and modify your commit accordingly.Post merge: