end runtime imports of other packages for types #9076
Merged
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.
closes: #6512
Description
@dckc proposed another trick : making a file that's picked up by tsconfig's glob but not ever imported itself. Whatever ambient types that file imports get picked up by the type checker. This only works for the particular tsconfig, but I thought it was worth seeing how it would help with #6512.
Turns out that since that was filed the repo has improved such that we don't need any ambient imports of other packages. (Found by
agoric/.*types
regexp in.js
files) There's one case with a test relying on@agoric/vats/src/core/utils.js
not getting the types that entails, but simply having that module import the types solves that problem.Security Considerations
none
Scaling Considerations
none
Documentation Considerations
none
Testing Considerations
Make sure there's no reduction in type coverage. I ran
update-type-coverage.sh
before the changes and committed that. After all the changes I ran again and nothing change.Upgrade Considerations
none