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
{{ message }}
Repository navigation
Validate that types field is on a TypeScript entrypoint (behind a flag) #259
Ok, seems like .d.ts is actually generated - but because of the issue mentioned here I was thinking that I was looking at another directory (the root entry).
I feel however that maybe it should be validated that "types" got used and throw an error on that (in favor of those type files that are auto-generated). This should ofc happen only for TS projects - adding "types" manually should be supported for packages shipping .d.ts without them actually being written in TS.
I feel however that maybe it should be validated that "types" got used and throw an error on that (in favor of those type files that are auto-generated). This should ofc happen only for TS projects - adding "types" manually should be supported for packages shipping .d.ts without them actually being written in TS.
changed the title [-]Additional entries don't have "types" generated[/-][+]Validate that types field isn't on a TypeScript entrypoint[/+]on Jul 12, 2020
changed the title [-]Validate that types field isn't on a TypeScript entrypoint[/-][+]Validate that types field is on a TypeScript entrypoint (behind a flag)[/+]on Jan 20, 2021
Activity
Andarist commentedon Feb 17, 2020
Ok, seems like
.d.tsis actually generated - but because of the issue mentioned here I was thinking that I was looking at another directory (the root entry).I feel however that maybe it should be validated that "types" got used and throw an error on that (in favor of those type files that are auto-generated). This should ofc happen only for TS projects - adding "types" manually should be supported for packages shipping
.d.tswithout them actually being written in TS.emmatown commentedon Feb 17, 2020
Agreed
[-]Additional entries don't have "types" generated[/-][+]Validate that types field isn't on a TypeScript entrypoint[/+]hasparus commentedon Jan 4, 2021
Hey folks, what's the status of
"types"field in package.json with Preconstruct? (BTW Preconstruct is blazing fast. Wow.)TypeScript docs advise to add
"types"key to package.json. Shouldpreconstruct fixadd it to point to the generated.cjs.d.tsfile?emmatown commentedon Jan 5, 2021
There's no real need since TypeScript can already resolve it. Is there are a particular reason you want to add it to the package.json?
Andarist commentedon Jan 5, 2021
Even to make it easier for other tools. For example, npm marks packages with TS types with a special badge. Compare:
hasparus commentedon Jan 5, 2021
What Andarist said, and I vaguely remember PRing/patching niche libraries I wanted to use, because old TS couldn't resolve it.
[-]Validate that types field isn't on a TypeScript entrypoint[/-][+]Validate that types field is on a TypeScript entrypoint (behind a flag)[/+]emmatown commentedon Jan 20, 2021
Okay, sounds good. Happy to accept a PR adding this(behind a flag for now because it would be a breaking change otherwise)