-
Notifications
You must be signed in to change notification settings - Fork 343
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(package.json): Provide correct types for moduleResolution: node, node10, and node16 #16
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
f8534a1
fix: remove unnecessary exports overriding
manudeli ab2f0a3
Merge branch 'main' into fix/exports/remove-overriding
manudeli faf60b4
Merge branch 'main' into fix/exports/remove-overriding
manudeli 3281a7a
Revert "fix: remove unnecessary exports overriding"
manudeli 4948f2e
chore(package.json): add types field in publishConfig.exports
manudeli a14bcb1
build: Support moduleResolution: node10 and node16 (nodenext)
raon0211 8d96b0e
build: Support moduleResolution: node10 and node16 (nodenext)
raon0211 a00ed8d
build: Support moduleResolution: node10 and node16 (nodenext)
raon0211 c2b2a47
fix delay
raon0211 7974c90
Update .gitignore
raon0211 4987ef9
Update .scripts/postbuild.sh
raon0211 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,4 +15,6 @@ coverage | |
dist | ||
esm | ||
.junit | ||
out | ||
out | ||
*.d.ts | ||
*.tgz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
echo "export * from './dist/array';" > array.d.ts | ||
echo "export * from './dist/function';" > function.d.ts | ||
echo "export * from './dist/math';" > math.d.ts | ||
echo "export * from './dist/object';" > object.d.ts | ||
echo "export * from './dist/predicate';" > predicate.d.ts | ||
echo "export * from './dist/promise';" > promise.d.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my opnion, this may fix our errors. I learned this way fixing from maintaining @suspensive/react to support cjs, esm for all environments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually it doesn't, because in order to be a "ESM" declaration,
.mts
(and TypeScript's cli does not support changing extensions of declarations)./esm/index.d.mts
), we have to specify extensions in its type.However this is notoriously difficult in current TypeScript environments unless we introduce some good libraries like tshy. Meanwhile tshy does not support Yarn PnP.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
then How about using tsup? I think tsup support this quite easily!
https://github.com/suspensive/react/blob/main/packages/react/package.json#L28-L36
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@raon0211 Fast merging to fix TypeScript error and next Pull Request for tsup is also good for me. If you agree tsup way, I'll make new Pull Request for this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually tsup does not support our usecase neither.
In order to be tree-shaken well, it is necessary for us to use code splitting. However I find that tsup (and its internal implemenation, esbuild) does not support code splitting properly as rollup's
preserveModules
.For example, while rollup completely splits our JavaScript files like this:
esbuild's
splitting
option only makes some chunks and does not split our project files completely.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we might try just using tsup's declaration generation...