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(pkg): add default fallback and types export #673

Merged
merged 4 commits into from
Apr 9, 2024
Merged

Conversation

wolfy1339
Copy link
Member

@wolfy1339 wolfy1339 commented Apr 8, 2024

Resolves #667
Resolves #665
Partly reverts #662


Before the change?

  • Some consumers of this package could not resolve it properly (ex: jest, ts-node, tsx)
  • CJS consumers would be getting errors even though the package is ESM
  • Consumers cannot import paths from the package like in CJS

After the change?

  • Clients should be able to import the module without any errors with the fallback
  • CJS consumers will generate a better error with the new fallback
  • Consumers are able to import types from the dist-types/types.d.ts file in the package

Pull request checklist

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)

Does this introduce a breaking change?

Please see our docs on breaking changes to help!

  • Yes
  • No

Many people are importing from `dist-types/types.d.ts`, and the switch to ESM prevents them from using any of the types defined in that file.
@wolfy1339 wolfy1339 added the Type: Bug Something isn't working as documented label Apr 8, 2024
Copy link
Contributor

github-actions bot commented Apr 8, 2024

👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

@wolfy1339
Copy link
Member Author

I have tested this locally with eslint, and the problem seems to be fixed

@wolfy1339 wolfy1339 merged commit af3d390 into main Apr 9, 2024
7 checks passed
@wolfy1339 wolfy1339 deleted the fix-esm-exports branch April 9, 2024 21:12
Copy link
Contributor

github-actions bot commented Apr 9, 2024

🎉 This PR is included in version 6.1.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@marekdedic
Copy link

Hi,
thanks, but I am running into the same error in dependencies, namely in my case:

  • @octokit/request
  • @octokit/endpoint
  • @octokit/request-error
  • @octokit/graphql
  • @octokit/auth-token
  • @octokit/plugin-rest-endpoint-methods

I can open PRs for all of these, but I don't know if this isn't something you'd rather solve for the whole org...

@wolfy1339
Copy link
Member Author

wolfy1339 commented Apr 15, 2024

Yes, that is expected, as they haven't received the same update yet.

Yes, I would love PRs!

@marekdedic
Copy link

Sorry, you got to it faster than I could :) Thanks!

@wolfy1339
Copy link
Member Author

No worries 🙂

Copy link

@davidaucoin7377 davidaucoin7377 left a comment

Choose a reason for hiding this comment

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

[SPAM]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released Type: Bug Something isn't working as documented
Projects
Archived in project
4 participants