Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Update paths to type declaration files in package.json #559

Merged
merged 1 commit into from
Jul 19, 2024

Conversation

Miodec
Copy link
Contributor

@Miodec Miodec commented Jul 19, 2024

I was battling my monorepo setup and almost got everything to work except importing slim-select. I was getting an error:

Could not find a declaration file for module 'slim-select'. '/Users/jack/Code/monkeytype/node_modules/slim-select/dist/slimselect.js' implicitly has an 'any' type.
  There are types at '/Users/jack/Code/monkeytype/node_modules/slim-select/dist/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'slim-select' library may need to update its package.json or typings.ts(7016)

which said there are type definitions but could not be resolved due to the exports property. I decided to have a look and the types key was defined incorrectly (im pretty sure the * syntax cannot be used inside the "." key). I updated the path to ./dist/index.d.ts and everything works great.

I also added a ./* export which allows you to import any of the other types like so:

image

Fully resolves #462

@brianvoe
Copy link
Owner

Sounds good to me. I dont think this would negatively effect anyone else. Ill try to get this in I have a couple of other prs im trying to get in and one more update so hopefully i can get this in soon.

@brianvoe brianvoe changed the base branch from master to develop July 19, 2024 15:36
@brianvoe brianvoe merged commit 417a3a1 into brianvoe:develop Jul 19, 2024
@Miodec Miodec deleted the package branch July 21, 2024 09:39
@Miodec
Copy link
Contributor Author

Miodec commented Aug 9, 2024

Hey, any update on this release? We would love to delete all our @ts-expect-error :)
image

Thanks for you work!

@brianvoe
Copy link
Owner

brianvoe commented Aug 9, 2024

Sorry im working on it when i can. ill be able to put some time into it tonight after work.

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

Successfully merging this pull request may close these issues.

Incomplete "exports" field in packgae.json (missing types)
2 participants