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

Provide exports.types in package.json #293

Merged
merged 4 commits into from
Sep 7, 2023
Merged

Provide exports.types in package.json #293

merged 4 commits into from
Sep 7, 2023

Conversation

alex-grover
Copy link
Contributor

Related to #229, the package.json is not configured correctly. You can see the warning at https://publint.dev/[email protected] - when exports is specified, the top level types is ignored.

The workaround in that issue does work, but ConnectKit + TypeScript is broken with the default create-next-app template, so I think it's worth fixing.

By my understanding, there are a couple possible resolutions here:

  • Update the exports field in the package.json to identify both the js and types file (the approach in this PR)
  • Rename the generated files so that the .d.ts file matches the name of the js file (i.e. index.es.d.ts)

I'm not an expert in getting this stuff set up, but I did test by building locally and linking into an existing project. I believe this issue also exists in connectkit-next-siwe, and I'm happy to make the same fix there if desired!

@vercel
Copy link

vercel bot commented Aug 22, 2023

@alex-grover is attempting to deploy a commit to the LFE Team on Vercel.

A member of the Team first needs to authorize it.

@lochie
Copy link
Member

lochie commented Aug 29, 2023

Interesting, I really appreciate the PR! I'm going to look into this a bit more to make sure this config is correct before merging. Thanks 🙏

@alex-grover
Copy link
Contributor Author

of course, let me know if I can help!

@vercel
Copy link

vercel bot commented Aug 30, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
connectkit-cra ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 7, 2023 1:53am
connectkit-nextjs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 7, 2023 1:53am
connectkit-testbench ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 7, 2023 1:53am
connectkit-vite ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 7, 2023 1:53am

@stinkypablo
Copy link

Seeing Could not find a declaration file for module 'connectkit'using [email protected] and [email protected]. Believe it's related to this package.json config. Is there any update on this badboy?

Copy link
Member

@lochie lochie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to do the trick! Approving but just doing a bit more testing in the background to triple check things. Thanks again 🫡

@lochie lochie merged commit 7c99544 into family:main Sep 7, 2023
1 of 5 checks passed
@lochie
Copy link
Member

lochie commented Sep 7, 2023

This PR is now available in ConnectKit 1.5.3 🙌

Thanks @alex-grover 🙏

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.

3 participants