-
Notifications
You must be signed in to change notification settings - Fork 393
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
fix(build): undeclared dependencies #1391
fix(build): undeclared dependencies #1391
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
size-limit report 📦
|
Codecov ReportBase: 82.60% // Head: 82.66% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #1391 +/- ##
==========================================
+ Coverage 82.60% 82.66% +0.05%
==========================================
Files 56 66 +10
Lines 1799 1759 -40
Branches 506 487 -19
==========================================
- Hits 1486 1454 -32
+ Misses 183 177 -6
+ Partials 130 128 -2
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. |
@thekip so, according to the article we just need to declare |
Yes, we need to hoist all peerDeps of direct deps. I will do that in this PR |
Well, let's merge these evident changes for now, because the problem with peer deps is not that simple as it looks like. The solution with hoisting peer deps to the host package proposed by the article fills so unnatural. We should keep track of all peer dependencies all the way up and down. If the It not only brings unnecessary bloat to the package.json files, but also extremely unmaintainable. It's absolutely not obvious why one package declaring what peer deps. You need to manually scan all direct dependencies used. And when some of the child packages add something new, we again need to recheck the whole package graph. To be honest, I've never seen anyone do that. |
Description
This is a partial fix for undeclared dependencies. #1385
@messageformat/parser
is used inpackages/cli/src/api/formats/po-gettext.ts
but was not declared for@lingui/cli
@babel/types
used in macro but was not declared.But:
Yarn complaining about few other dependencies as well. These are peer dependencies of a transitive dependencies and i didn't find an explainer what should we do in this case.
Take for example
@lingui/loader
The package actually not depending on
typescript
nor@babel/core
directly. But it has@lingui/conf
and@lingui/cli
as direct deps. And@lingui/cli
has a peer dep for@babel/core
which is not directly satisfied in the@lingui/loader
package. The same with typescript.@lingui/loader -> @lingui/cli -> @babel/core (peer)
@lingui/loader -> @lingui/conf -> cosmiconfig-typescript-loader -> typescript (peer)
Generally speaking, i don't know how to fix it properly. Should we replicate all this peer dependencies in parent package?
I would be very grateful if some one point me to article with explanation.
Also thinking how to automate testing for such issues.
Types of changes
Checklist