-
-
Notifications
You must be signed in to change notification settings - Fork 80
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
🚀 Feature: Rethinking building: entry points, bundle: false, and tsup issues #1910
Comments
My general approach to packaging (which has largely been informed by projects with multiple entry points (think MUI, or a similar multiple component library that exposes 10s of entry points, each with their own set of symbols)), while also dual bundling and supporting maximum module resolution compatibility, has been to use rollup and to bundle each entry point, with one set of That kind of complexity can be overkill for simple one or two entry point package with a handful of files. But I think the model of having the end package exactly reflect the project's source structure can have a bit of a scaling problem. With bundling and export conditions you can be very strategic about the structure of your package big or small. Additionally, as long as we're not minifying / tersering the output, then having something in a single bundle vs exploded out shouldn't really change how debuggable it is, in my opinion. Consumers of the package don't know what the original project structure was to begin with, so maintaining that structure for them doesn't feel like it buys us anything. You know what I mean? |
With all that said, |
Bug Report Checklist
main
branch of the repository.Overview
Coming over and recapping from JoshuaKGoldberg/eslint-fix-utils#7 -> JoshuaKGoldberg/eslint-fix-utils#13: CTA right now uses tsup for production builds. tsup is a pretty darn good wrapper around esbuild. It was originally added to CTA in #623 -> #640 to avoid transpiling test files such as
*.test.*
.tsup is configured at the moment with a couple opinionated settings:
bundle: false
: I prefer having outputlib/
files match the structure insrc/
for a few reasons:node_modules/
contents when the structure matchesentry: ["src/**/*.ts", "!src/**/*.test.*"]
: since there isn't bundling, the full list of files to build needs to be told to tsupdata.fakes.ts
, still get pushed...We've also started to see some issues with tsup falling out of maintenance a bit (💔 - sustained open source maintenance is hard and taxing!):
I think there are two root issues here:
Therefore, I think it would make sense to think critically about how CTA packages build
lib/
output. Is there a tool that can satisfy all the desired needs?*.test.*
.d.ts
output (read: not being limited to just what's supported inisolatedDeclarations
)If not, I shudder to think I might have to build one. 😬
Additional Info
The fact that tsup exists & works at all is awesome. I don't mean to file this issue judgementally. https://xkcd.com/2347, https://nolanlawson.com/2017/03/05/what-it-feels-like-to-be-an-open-source-maintainer etc. etc. This is a pragmatic issue: tsup isn't completely able to do what CTA needs right now and so we need to evaluate what's best for the project.
Edit: see also https://bsky.app/profile/joshuakgoldberg.com/post/3lhgppvnyjc2e for links to other projects
🎁
The text was updated successfully, but these errors were encountered: