aspect-build/aspect-cli

[FR]: Have gazelle js language pick up `tsconfig` targets from parent directories

Closed this issue · 1 comments

What is the current behavior?

Currently, the js gazelle language does not automatically discover tsconfig files and those generates targets like:

ts_project(
  name = "xyz"
)

If you do not have a ts_config target in that package, then the rule fails.

Describe the feature

Our standard repository layout is all React apps where we use a single tsconfig.json file at the root of the repository for the project and tests:

typescript/react_app1
  tsconfig.json
  src/
    pages/
   components/
typescript/react_app1
  tsconfig.json
  src/
    ...
typescript/react_app1
  tsconfig.json
  src/
   ...

For all of the ts_project targets generated under src/ (or any subdirectory of react_appX), it would be helpful if the generated ts_project would point to the tsconfig in the root of the application directory. It would be fine if this was discovered via a setting that set a convention or if you had to specify the tsconfig.json to use via directive at the root of each application.

At currrent, the workaround is to use map_kind to map ts_project to a macro where we manually override the value.

An initial version has been added, see 4374292