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: types entrypoint #140

Closed
wants to merge 2 commits into from
Closed

Conversation

weswigham
Copy link

@weswigham weswigham commented Feb 10, 2022

For other entrypoints, an export map would probably be appropriate. The current structure causes issues like microsoft/TypeScript#47332 where TS users can't actually accurately check the package.

This PR contains a:

  • bugfix
  • new feature
  • code refactor
  • test update
  • typo fix
  • metadata update

Motivation / Use-Case

Breaking Changes

Additional Info

For other entrypoints, an export map would probably be appropriate. The current structure causes issues like microsoft/TypeScript#47332 where TS users can't actually accurately check the package.
@alexander-akait
Copy link
Member

We should remove CJS wrapper (and use require/module.exports), we use babel and transform code to CommonJS, so real code in common js, but types generated for ESM (no options to set it because we use jsdocs with types)

@weswigham
Copy link
Author

Hah, the generated types are accurate, despite the apparent esm syntax, there's no problem there; the package.json file just points to the wrong file, since main doesn't point at index.js.

@ricardogobbosouza ricardogobbosouza changed the title The types entrypoint should point at the cjs main's types fix: types entrypoint Feb 24, 2022
@codecov
Copy link

codecov bot commented Feb 24, 2022

Codecov Report

Merging #140 (5ec1dfa) into master (f4a09da) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #140   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            8         8           
  Lines          252       252           
  Branches        73        73           
=========================================
  Hits           252       252           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f4a09da...5ec1dfa. Read the comment docs.

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