[BUILD] Support dependency hoisting #7891
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.
Summary
This PR enables dependency hoisting on root level via
nmHoistingLimits: none
in the.yarnrc.yml
.This ensures that the
/docusaurus-theme
and/website
packages resolve shared dependencies properly.To not break the existing build of the
/eui
package, this package is excluded from the hoisting by setting"hoistingLimits": "workspaces"
in it'spackage.json
which ensures its dependencies are not hoisted beyond its workspace scope.Note
This update fixes the issue we encountered with Docusaurus ejected components for EUI+ that were relying on a specific context and were incorrectly using a different instance of the expected provider, resulting in errors like:
Hook useNavbarMobileSidebar is called outside the <NavbarMobileSidebarProvider>.
QA
gh pr checkout 7891
and ensure the usual scripts workyarn start
yarn storybook
yarn build-storybook
yarn build-docs
yarn build
yarn build-pack
yarn test-ci