-
Notifications
You must be signed in to change notification settings - Fork 911
feat(doctor): detect wrong dependencies #1983
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
feat(doctor): detect wrong dependencies #1983
Conversation
@adamTrz @cortinico , mind taking a look? |
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.
Please adds some tests inside src/tools/healthchecks/__tests__/
ce0ae4c
to
a7ee439
Compare
@cortinico, I've added a few unit 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.
Code looks good to me, let's wait for someone else from the CLI team to review this one 👍
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.
Thank you! 🎉 I left few small comments.
Hey @tarunrajput, sorry that I'm writing this right now, but might you adding check for internal
cc. @cortinico |
Hi @szymonrybczak, Thanks for the suggestion! Could you please guide me on how to check if the CLI version is compatible with the React Native version, considering they have independent release cycles? 😅 |
See here, every CLI release corresponds to relevant React Native version - that is the source of truth. |
770f0c6
to
d308daa
Compare
LGTM ! For CLI review cc: @szymonrybczak |
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.
Thank you for doing this! Left few small nits 🙌
d308daa
to
26f59e5
Compare
@szymonrybczak, Thanks! Just updated the PR with the changes. |
@thymikee mind giving final review on this PR? |
packages/cli-doctor/src/tools/healthchecks/__tests__/dependencies.test.ts
Outdated
Show resolved
Hide resolved
` - ${chalk.red( | ||
'error', | ||
)} ${pkg}: "${packageVersion}" is not compatible with react-native: "${reactNativeVersion}"`, | ||
); |
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.
could we use logger.error
(and logger.warn
where applicable) instead? They handle coloring the warn/error/info words, so we don't have to reimplement it
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.
thanks for the suggestion! I chose not to use logger in this case because it would print the error/warning immediately outside of the issue category like this
⠸ Running diagnostics...
warn @react-native-community/cli comes included with React Native and should not be listed as a dependency in your package.json
Common
● Dependencies - There are some issues with your project dependencies
26f59e5
to
8571afa
Compare
8571afa
to
1f6940e
Compare
There hasn't been any activity on this pull request in the past 3 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days. |
Summary:
Detect wrong/incompatible dependencies/devDependencies inside package.json
Resolves: #1848
Test Plan:
Failure:
Success: