-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG: Incorrect commonjs types #18
Comments
@typhonrt : Could you take a look at this? Btw, our CI is breaking; is there anything you can do to fix the @typhonjs-typedoc/typedoc-pkg dependency issues? |
I'll take a look and get back to this issue on Thursday. I'm pretty sure I have an example of an ESM / CJS package ( Re: @typhonjs-typedoc/typedoc-pkg there is a new version and the |
Hi @CloudNStoyan. Admittedly, I do spend my time in the ESM or TS generating ESM world. From my general research and I think this is in line with what you reported that the declaration files between
This is the same thing I saw that at least with rudimentary testing including your It's more of a Typescript / TSC complaining / requiring explicit When I tested types for my If this is the case and my general understanding is that it's just an explicit resolution aspect / "quirk even" for TS and that the declaration file can be duplicated and simply renamed For @brettz9. I do believe I pointed out that the Without the |
Go ahead and add in the types packages as dependencies... I can prepare a PR of course, if that's all that will be necessary... |
I think it's reasonable to add the |
Got the PR and it has detailed notes on changes. For CI concerns Node 16.x was dropped and |
Fixed in #19 . Released as v0.50.0. |
Reproduction repo:
https://github.com/CloudNStoyan/jsdoccomment-incorrect-types-demo
The project doesn't export the correct commonjs types and this generates the following error when used in a commonjs typescript project:
Forking the repo and running
npx @arethetypeswrong/cli --pack
found this problem:https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/FalseESM.md
And running
npx check-export-map
found problems in the"exports"
property in thepackage.json
When I fixed those problems by copying
index.d.ts
toindex.d.cts
and replace the"exports"
property with the following exports:The error was gone, but I am not sure if the index.d.ts types are the correct ones for commonjs as I see they are generated using
@typhonjs-build-test/esm-d-ts
.The text was updated successfully, but these errors were encountered: