-
Notifications
You must be signed in to change notification settings - Fork 407
fix: resolve yarn install warnings and synchronize dependencies #2262
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
base: main
Are you sure you want to change the base?
Conversation
- Add missing peer dependencies (@babel/core, eslint) - Update eslint plugins to versions compatible with eslint 9 - Replace @swc-node/register with tsx for better compatibility - Add detect-locale package to Jest web configuration - Fix getCookie return type and early return handling - Add sherif monorepo linting to CI workflow - Update Jest snapshot for fromUrl error test Resolves yarn install warnings and improves monorepo consistency.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
size-limit report 📦
|
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.
There is a better way to sync incosistent version of dependencies across the packages in monorepo. The previous constraints were defined with a caret symbol ^
means minor/patch is allowed. That mean that real versions installed for the project local development is specified in the lock file.
Instead of changing the constraints which was OK, you need to update versions in the lockfile. You can use yarn up -r
command to update a specific dependencies or it's transitive dependnecies.
"@babel/core": "^7.21.0", | ||
"@babel/runtime": "^7.21.0", | ||
"@babel/types": "^7.21.2", |
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.
The dependency constraint should not be bumped for a package if no incompatible changes was applied in the sourcecode of the package.
In other words, if babel-plugin-lingui-macro
works perfectly with bael@7.21.0
why we need artificitially bump a version and narrow the constraint (possible bringing incompatibility) for a consumers
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.
I understand your concerns, but first I want to explain my intentions. I was trying to do something that yarn will add in the next major version: sync constraints in a monorepo.
More details here (first thing I found):
https://blog.datamole.ai/yarn-constraints-have-your-monorepo-under-control-12937a720f63
What yarn up -R
does is sync installed versions, but it doesn't sync constraints.
So I want to ask if this PR should be finished somehow or closed?
packages/cli/package.json
Outdated
@@ -79,7 +79,7 @@ | |||
"pathe": "^1.1.0", | |||
"pkg-up": "^3.1.0", | |||
"pofile": "^1.1.4", | |||
"pseudolocale": "^2.0.0", | |||
"pseudolocale": "2.0.0", |
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.
Why changing the constraint?
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.
A new version was installed, which resulted in changes in pseudo-localization tests (new symbols), so I decided to fix the version instead of fixing a lot of tests.
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.
That's not a valid approach for the opensource library. Previously this package was with a wider constraint and consumers might already have a newer version of this installed which is satisfying constraint. This will restrict consumers to only this version even if the other version (with potential fixes) may work
Description
This PR resolves all
yarn install
warnings in the js-lingui monorepo and improves dependency management consistency across packages.The main issues addressed:
Types of changes
Fixes yarn install warnings and improves developer experience
Changes Made
🔧 Dependency Management
@babel/core
to resolve babel preset warningseslint-plugin-react
:^7.32.2
→^7.37.5
eslint-plugin-react-hooks
:^4.6.0
→^5.2.0
🚀 TypeScript Execution Modernization
verdaccio:release
script to usetsx
directly🔍 Monorepo Consistency
npx sherif
to align versions across all packages🐛 Type Safety Improvements
string
tostring | undefined
🧪 Test Configuration
🔧 ESLint Configuration Cleanup
Why tsx over @swc-node/register?
Why sherif?
Sherif is a monorepo dependency linter that ensures:
Testing
yarn install
runs without warningsyarn lint:all
passessherif
reports no issuesChecklist