New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[design-system]: update to 1.3.0 #14925
Conversation
@@ -40,7 +41,7 @@ const aliasExactMatch = [ | |||
// See https://webpack.js.org/configuration/resolve/ | |||
module.exports = { | |||
...aliasExactMatch.reduce((acc, moduleName) => { | |||
acc[`${moduleName}$`] = path.dirname(require.resolve(`${moduleName}/package.json`)); | |||
acc[`${moduleName}$`] = findRoot(require.resolve(moduleName)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the alias change i talk about in the PR description.
Codecov ReportBase: 59.62% // Head: 59.62% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## main #14925 +/- ##
=======================================
Coverage 59.62% 59.62%
=======================================
Files 1339 1339
Lines 32566 32566
Branches 6207 6207
=======================================
Hits 19418 19418
Misses 11289 11289
Partials 1859 1859
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works well for me ✨
I think something may have happened after this merge. When a plugin is importing icons or any of the design-system/v2 items (such as Pagination), build errors are generated. In the prior version (4.5.1), imports were fine. More info here: https://discord.com/channels/811989166782021633/1048343064143478794 |
What does it do?
find-root
package to find the roots ofnode_modules
in the alias (see next paragraph for why)Why is it needed?
Originally we applied the fix of
require.resolve(${moduleName}/package.json)
which implicitly uses the node resolution methods therefore using theexports
property of a package.json. Therefore where someone has used a conditional submodule:the resolution will fail because the file may not be there therefore I've opted to use
findRoot
where you can just pass the defacto CJS export of any module and it will find the root.Note
If you're going to locally test it you'll want to run something like
yarn lerna clean && rm -rf node_modules && yarn setup
to clean the entire repo and start from scratch to avoid any deps caches.