Repository navigation
fix: declare runtime dependencies imported by published packages - #717
Merged
Merged
Conversation
A clean install of @expo/entity 0.70.0 fails on import with ERR_MODULE_NOT_FOUND for @expo/nullthrows. Five source files in the package import it, but it is only listed as a devDependency of the two secondary cache packages, so it resolves inside the monorepo and nowhere else. Three other packages have the same problem: - entity-testing-utils imports invariant and uuid - entity-database-adapter-knex-testing-utils imports @expo/entity-testing-utils - entity-database-adapter-knex imports @expo/results, which only resolves because @expo/entity depends on it and npm hoists it Each is now listed under dependencies of the package that imports it. Signed-off-by: vatsalpatel <vatsalpatel.me@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #717 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 110 110
Lines 18523 18523
Branches 1602 1602
=========================================
Hits 18523 18523
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
wschurman
approved these changes
Oct 9, 2026
wschurman
left a comment
Member
There was a problem hiding this comment.
Thanks for the contribution! Good catch!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
A clean install of
@expo/entity0.70.0 fails on import:Five source files in
packages/entityimport@expo/nullthrows, but the package does not list it as a dependency. It is a devDependency of the two secondary cache packages, so inside this repo it gets hoisted and everything resolves. It looks like this came in with #517.I checked the other published packages for the same thing and found three more:
@expo/entity-testing-utilsimportsinvariantanduuid. A clean install fails withCannot find package 'uuid'.@expo/entity-database-adapter-knex-testing-utilsimports@expo/entity-testing-utils. A clean install fails the same way.@expo/entity-database-adapter-kneximports@expo/results. This one works under npm because@expo/entitydepends on it and it gets hoisted. I did not reproduce a failure for it, but it would not resolve under an installer that does not hoist.How
Added each missing package to
dependenciesof the package that imports it, with the same ranges the repo already uses for those packages, and ranyarn installto update the lockfile. No source changes.Test Plan
Before, against the published packages, in an empty directory:
This fails with the error above. The two testing-utils packages fail the same way on
uuidand@expo/entity-testing-utilsonce@expo/nullthrowsis installed by hand.After, on this branch:
Installing that tarball in an empty directory and importing
@expo/entityworks with nothing installed by hand. I did the same for the other three packages and checked that every import resolves.yarn lintandyarn testpass. I did not run the integration tests locally.