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

[FR]: Make ts_config emit a flat config #467

Open
surma opened this issue Oct 12, 2023 · 3 comments
Open

[FR]: Make ts_config emit a flat config #467

surma opened this issue Oct 12, 2023 · 3 comments
Labels
enhancement New feature or request more info needed More info needed to proceed further

Comments

@surma
Copy link

surma commented Oct 12, 2023

What is the current behavior?

The output of ts_config() is the same file as was passed in via the tsconfig prop. If said config file makes use of extends, the resulting npm_package contains an incomplete TS config file with dangling extends reference.

Describe the feature

tsc has a --showConfig option that can be used to “flatten” the config. It would be nice if the ts_config would offer to emit that file instead of the original one (although I am not sure how to deal with the file name conflict).

@surma surma added the enhancement New feature or request label Oct 12, 2023
@github-actions github-actions bot added the untriaged Requires traige label Oct 12, 2023
@alexeagle
Copy link
Member

Hi @surma! Sorry I never replied over here.

Can you help me understand the problem with a dangling extends reference? I don't see why an npm package would need to include any tsconfig.json content since downstream users wouldn't reference it when type-checking their apps.

@alexeagle alexeagle added more info needed More info needed to proceed further and removed untriaged Requires traige labels Jan 24, 2024
@surma
Copy link
Author

surma commented Jan 24, 2024

We ran into problems where other tools (that consumed the output of the Bazel build) were inspecting the tsconfig.json (e.g to figure out what transpilation target they were built for) and derived wrong assumptions because those options weren’t present in the tsconfig.json.

Definitely niche and we wrote our our tsconfig_flatten, but I thought I’d flag it with you all :)

@jbedard
Copy link
Member

jbedard commented Feb 27, 2024

@surma what does your tsconfig_flatten rule do? Collect all deps from ts_config targets and output a single JsInfo or filegroup? That seems out of scope for ts_config which is designed to be just that, config for ts, not for files to be shipped in an npm package...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request more info needed More info needed to proceed further
Projects
Status: No status
Development

No branches or pull requests

3 participants