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 types nodenext support #578

Closed
wants to merge 2 commits into from

Conversation

xiaoxiangmoe
Copy link
Contributor

@otakustay otakustay mentioned this pull request Dec 26, 2021
11 tasks
@motdotla
Copy link
Owner

this is great. thank you. will merge and be part of the next release soon.

@@ -4,7 +4,10 @@
"description": "Loads environment variables from .env file",
"main": "lib/main.js",
"exports": {
".": "./lib/main.js",
".": {
"default": "./lib/main.js",
Copy link
Owner

Choose a reason for hiding this comment

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

Before I merge this:

can you point me to the definition of using default rather than specifying both import and require? I cannot find the documentation on this.

Copy link
Owner

Choose a reason for hiding this comment

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

I also wonder if moving our type definition file under lib would solve a lot of these edge cases - from the past and going forward. That was the historical default and most editors I believe are set up to look there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

doc of default, import and require is here.
https://nodejs.org/api/packages.html#conditional-exports

I think it will be better if we moving our type definition file under lib. Should I create another PR to do this?

Copy link
Owner

Choose a reason for hiding this comment

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

I agree. Can you just roll it into this PR, please? Thank you for your help!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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

2 participants