Don't error on missing re-exported declarations #332
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.
Hey 👋
Many thanks for creating this package. It's really useful! 👏👏👏
I've come across a situation where some packages re-export types but due to having the re-exported types dependency set as a dev dependency it isn't installed via npm and
dts-bundle-generatorerrors out.This error was quite confusing for me and solving it consisted of installing the missing package in my project. However I think it might make sense to offer the option to warn users that it's missing and allow execution to continue. Alternatively maybe it's enough to throw a more helpful error msg and force the user to install the missing package to make sure types are correctly bundled. I'm opening this PR as a starting point to discuss this further.
From my investigations without the re-exported package installed it seems typescript treats the missing re-exported packages as
anyand doesn't seem to surface any errors (at least none that I could find).Additionally whilst doing this I noticed there is no way to change the log level when using this packages API. Is that something you'd consider adding as an option?