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(*): migrate rollup to tsup, support esm correctly, remove *.spec.* for dist #21

Merged
merged 5 commits into from
Jun 4, 2024

Conversation

manudeli
Copy link
Member

@manudeli manudeli commented Jun 3, 2024

close #19 close #20

@raon0211 In my opinion, This change is fit for your requirement. Review strictly please!

Copy link

vercel bot commented Jun 3, 2024

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

Name Status Preview Comments Updated (UTC)
es-toolkit ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 4, 2024 0:54am

@manudeli manudeli self-assigned this Jun 3, 2024
@manudeli manudeli requested a review from raon0211 June 3, 2024 16:44
Copy link
Member Author

@manudeli manudeli left a comment

Choose a reason for hiding this comment

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

Comments to share intention

package.json Outdated
Comment on lines 20 to 22
"dist/**/*",
"esm/**/*",
"*.d.ts"
Copy link
Member Author

Choose a reason for hiding this comment

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

tsup's default use only dist

],
"publishConfig": {
"access": "public",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
Copy link
Member Author

Choose a reason for hiding this comment

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

"import": "./esm/index.mjs",
"require": "./dist/index.js"
"import": {
"types": "./dist/index.d.mts",
Copy link
Member Author

Choose a reason for hiding this comment

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

*.d.mts is generated by tsup default

#16 (comment)


export default defineConfig({
format: ['cjs', 'esm'],
entry: ['src/*.ts', 'src/*/*.ts', '!**/*.{spec,test,test-d}.*'],
Copy link
Member Author

@manudeli manudeli Jun 3, 2024

Choose a reason for hiding this comment

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

#19 !**/*.{spec,test,test-d}.*: This prevent that dist contain test files

package.json Outdated
"typescript": "^5.4.5",
"vitest": "^1.5.2"
},
"sideEffects": false,
"scripts": {
"prepack": "yarn build",
"build": "rm -rf dist esm && tsc -p tsconfig.json --declaration --emitDeclarationOnly --declarationDir dist && rollup -c rollup.config.js && ./.scripts/postbuild.sh",
"build": "tsup",
Copy link
Member Author

Choose a reason for hiding this comment

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

So simple

@manudeli manudeli marked this pull request as ready for review June 3, 2024 16:58
@raon0211
Copy link
Collaborator

raon0211 commented Jun 4, 2024

image

Fixed the Node10 resolution in the commit in 755b938.

.scripts/postbuild.sh Outdated Show resolved Hide resolved
raon0211
raon0211 previously approved these changes Jun 4, 2024
Copy link
Collaborator

@raon0211 raon0211 left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution! I wish we had time to better configure the settings to generate declaration maps and make the chunk names reflect their actual names. (rather than chunk-*.mjs files..)

package.json Outdated Show resolved Hide resolved
Co-authored-by: Jonghyeon Ko <jonghyeon@toss.im>
@raon0211 raon0211 merged commit 9bde10a into main Jun 4, 2024
7 checks passed
@raon0211 raon0211 deleted the fix/rollup-to-tsup branch June 4, 2024 00:56
@manudeli
Copy link
Member Author

manudeli commented Jun 4, 2024

Thanks for your contribution! I wish we had time to better configure the settings to generate declaration maps and make the chunk names reflect their actual names. (rather than chunk-*.mjs files..)

Cool! I didn't think about these topics you suggest. Let's try it gradually

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants