Open jackw opened 1 week ago
However I think it might make sense to offer the option to warn users that it's missing and allow execution to continue
I'm not sure I agree with this.
This error was quite confusing for me and solving it consisted of installing the missing package in my project
This feels like the only correct solution in a given situation, and the reason for this is because if a package is marked as "dev dependency" how come you're able to import it (even via transitive files)? It feels like some sort of misconfiguration. Can you share an example what packages generate such situation?
From my investigations without the re-exported package installed it seems typescript treats the missing re-exported packages as any and doesn't seem to surface any errors (at least none that I could find).
Do you have skipLibCheck
option on by any chance?
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?
Never thought about it tbh, I'm open for suggestions tho.
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-generator
errors 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
any
and 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?