-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
[cli] Add dependency exclusion to npx expo install
#22736
Conversation
expo install --check|fix
npx expo install
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.
looks good, let's also add some documentation in this same PR. we can add a note along with it that this field is only supported in sdk 49+
another suggestion - maybe we should link to the docs in the validation message? so if someone has an "invalid" dep version and want to have that one be ignored, the information on how they do that is available directly in the message. |
Co-authored-by: Brent Vatne <brentvatne@gmail.com>
Co-authored-by: Brent Vatne <brentvatne@gmail.com>
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 fixing the callout issue!
Why
Fulfills https://linear.app/expo/issue/ENG-8564/add-dependency-exclusion-to-npx-expo-install. Developers will be able to suppress warnings from
npx expo install --check
via a package.json config, and thus suppress doctor warnings when they intentionally choose to install a different version, especially when using dev builds and not needing to stick to the Expo Go- bundled version.How
npx expo install --check|fix
reads fromexpo.install.exclude
if it's available, and, if one of the packages it thinks it should fix is in that list, it will skip asking/ fixing it. If you runEXPO_DEBUG=1 npx expo install --check
, the packages whose checks were actually skipped will be listed in debug output; otherwise there are no warnings or messages about the excluded packages.The package.json configuration verbiage is intended to be similar to the autolinking config.
It also seemed appropriate thatnpx expo install
should behave differently if you try to install an excluded package, so someone doesn't come along and write over a version that another developer determined was good and thus applied the override for. Currently, it aborts if any of the packages are in the exclusion list. I could see doing a warning and skipping the affected packages instead, but the command outright failing is pretty hard to miss.npx expo install
now installs excluded packages with the latest version, just like a package without a specified native version. It will add a note describing what it's doing and why.Test Plan
expo.install.exclude
(works the same)expo install --fix|check
when excluding an actual dependency (skips it)EXPO_DEBUG=1
(lists excluded packages)expo install [package]
with exclusions (installs latest with notes)expo install [package]
without exclusions (proceeds as it normally does)Output
npx expo install --check
, showing note that it is skipping checking packages in the exclude list:Additional debug output for
EXPO_DEBUG=1 npx expo install --check
:expo install <package>
with exclusions:Checklist
npx expo prebuild
& EAS Build (eg: updated a module plugin).