-
Notifications
You must be signed in to change notification settings - Fork 507
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
Improve internal configs generation #389
Comments
i'm open to this idea (i prefer shadowing rather than ejecting) but also the user can modify the rollup config via tsdx.config.js. What do you think is the tipping point between modifying via config and total ejection? |
@sw-yx I also prefer to deal with merge approach instead of full ejecting configs but.. it will be good to extend |
alright. im not as strongly opinionated on seeing full configs but this is really something Jared will have to decide. |
So ejection is not gonna happen. My goal with TSDX is to eviscerate boilerplate from typescript by providing a single abstraction with solid defaults that’s infinitely customizable. To make this strategy a reality, we always need to ensure that that the correct escape hatches exist. That is mission critical to the project’s continued success. I believe we should address each specific use case and decide to adapt or document a solution. Lastly, and maybe we should also document this, I have found that patch-package is a wayyyyy better approach to modifying create-react-app instead of ejecting. Most of the time I only need to tweak 10-15 lines of webpack, and am not interested in foregoing the rest of the updates. If tsdx.config.js isn’t sufficient, patch-package is my suggested final escape hatch. As for understanding the various configs, I agree it could perhaps be restructured internally to use deep merge instead of just functions. However, I’m not 100% sure if it’s going to make that big of difference. Since we are outputting up to 3 formats for n entries, we are going to have functions regardless. We could technically augment tsdx config to have a deep merge mode like storybook does. Personally, I don’t care for this, because I like being able to log everything. It also gets weird with dev/prod and different formats....something that storybook doesn’t need to think about. So in conclusion, no to an eject command. Yes, to documenting patch-package as ultimate escape hatch and yes to fixing or documenting each issue and solution. |
@jaredpalmer so.. let say NO for ejecting :) and many many tanks for the |
Since I've changed a bunch of the internal build logic in #367 and would like to refactor some internals once it's merged, I do think there are some other ways to make pieces of TSDX easier to extend:
"Stuff can break" is also a noteworthy factor around I'll PR a disclaimer/warning for that in the docs, but that's another reason why I think splitting pieces of TSDX into plugins would be useful -- together they make up the private, internal API, but individually each exposes its own public API. Breaking changes in plugins would not necessarily translate to breaking changes in TSDX Also, for posterity's sake, #110 and #183, that introduced |
@agilgur5 +1 for |
Current Behavior
As mentioned in README: TSDX is a zero-config CLI that helps you develop, test, and publish modern TypeScript packages with ease
but there are a lot of issues that need to fix / patch / extend configs for ts / babel / jest / rollup / rollup plugins / plugins for rollup plugins etc. see #379
Desired Behavior
ability to easy deal with all kind of configs
Suggested Solution
need to discuss
EDIT: per below suggestions: use
patch-package
Describe alternatives you've considered
possible simplest solution (as CRA):
tsdx eject
Maintainer/agilgur5 edit: lightly reverted some edits for posterity because this was one of the first places
tsdx eject
was mentioned and rejected. I got confused myself when I re-read this after it was edited out tooThe text was updated successfully, but these errors were encountered: