rules_ts icon indicating copy to clipboard operation
rules_ts copied to clipboard

[FR]: Add a `data` section to ts_config rule.

Open antspy opened this issue 11 months ago • 1 comments

What is the current behavior?

Hi,

ts_config rule at the moment does not allow to specify data dependencies.

Describe the feature

My tsconfig.json sets the following options:

"types": ["node", "./types/typings"]

and I have a file types/typings.d.ts which adds some extra types for my ts project. How do I ensure that when building the ts_config rule, the types/typings.d.ts file is present in the output directory?

Usually one might create a filegroup and add it as a data dependency, but ts_config has no data dependency. Adding the filegroup as a deps does not result in the file being present in the output folder.

So what is the intended solution here? How do I make sure that the when building the ts_config target, both the tsconfig.json and the types/typings.d.ts file are present the bazel-bin output directory?

antspy avatar Jan 31 '25 08:01 antspy

I think you'd normally want a js_library containing the types/typings.d.ts, it should be treated as js/ts source and not generic "data".

Can you give that a shot?

jbedard avatar Feb 02 '25 19:02 jbedard