You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure I fully understand the problem that happens (we publish TS type declarations and they seem to work fine) - do you have a reproduction repo to highlight the behavior that regressed?
we publish TS type declarations and they seem to work fine
Yes it works with pnpify.
With pnpify, tsc still performs the same resolution and reverse resolution logic, so the output is of course the same.
If you wanted tsc to support PnP using pnpapi, you would soon find that it requires "reverse resolution" to synthesize type import() statements in declaration files.
I'm going to close this issue since I don't understand how to reproduce the problem (microsoft/TypeScript#28289 seemed to work just fine and was using the API directly).
If you get the chance to make a standalone repo I can clone and run a command in to see what should work and what doesn't, feel free to reopen!
I'm not 100% sure what the right answer is, but there is a strong intersection here of pnp and TS expertise that should be able to arrive at it.
Describe the user story
AFAIK, pnp cannot (fully) support the TypeScript compiler needs in creating declaration files.
a/thing module
b module
The TypeScript compiler produce the following typed declaration file for the b module:
The TypeScript compiler applies some heuristics to obtain this; sometimes a portable path is not possible and it produces an error.
Describe the solution you'd like
I think this requires a
reverseResolve
function or something similar.Describe the drawbacks of your solution
Describe alternatives you've considered
Don't support inferred imports for TypeScript declaration files.
Additional context
Also my remarks in the TypeScript project: microsoft/TypeScript#28289 (comment)
The text was updated successfully, but these errors were encountered: