Skip to content
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

fix typescript typing reference in package.json #98

Closed
wants to merge 1 commit into from

Conversation

Goobles
Copy link

@Goobles Goobles commented Feb 5, 2024

it seems that the types property was removed from the package.json here:
3afdfaf#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519L23

@fregante
Copy link
Collaborator

fregante commented Feb 5, 2024

What is this for? Types already work without it. What config are you using that's causing issues?

@sindresorhus
Copy link
Owner

This is a problem with your tsconfig, not this package.

https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c#how-can-i-make-my-typescript-project-output-esm

@Goobles
Copy link
Author

Goobles commented Feb 6, 2024

@sindresorhus In that case I will not be able to import this package into an non-pure-ESM angular library project. I've switched over to the commonjs compatible moize instead.

Pure ESM is just not always an option, since all downstream dependencies then need to be patched as well, all imports refactored to include a '.js' extension, kind of sad how this causes a schism in the package ecosystem.

@paul-vd
Copy link

paul-vd commented Mar 5, 2024

This is a problem with your tsconfig, not this package.

https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c#how-can-i-make-my-typescript-project-output-esm

@sindresorhus Why does npm not detect types?

image

@paul-vd paul-vd mentioned this pull request Mar 5, 2024
@fregante
Copy link
Collaborator

fregante commented Mar 5, 2024

Why does npm not detect types?

That's a question you can ask npm. exports.types is what Node suggests here: https://nodejs.org/api/packages.html#community-conditions-definitions

@perry-mitchell
Copy link

Sure, but why avoid the defacto root types property? What would it cost to support it?

Not sure what moral ground is gained by dismissing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants