aspect-build / rules_ts

Bazel rules for the `tsc` compiler from http://typescriptlang.org
https://docs.aspect.build/rules/aspect_rules_ts
Apache License 2.0
94 stars 53 forks source link

[Bug]: aspect configure doesn't pick up tsconfig.json files #507

Open bgdnvk opened 6 months ago

bgdnvk commented 6 months ago

What happened?

I'm using aspect configure to make my build files, it picks up dependencies fine but doesn't include a ts_config anywhere.

My project is fairly complex: a monorepo with several frontends with microfrontends (React and Webpack) and backend services in Go. Go build works fine with Gazelle.

Version

Development (host) and target OS/architectures: Ubuntu 22.04 LTS

Output of bazel --version: 7.0.0

Version of the Aspect rules, or other relevant rules from your WORKSPACE or MODULE.bazel file: Module

Language(s) and/or frameworks involved: TS, React, Webpack, Monorepo and Microfrontends

How to reproduce

No response

Any other information?

I've tried to check different examples, blog posts and there wasn't no luck in slack.

No response

alexeagle commented 6 months ago

Can you provide more detail on how to reproduce, and how the generated BUILD file differs from what you expect? As I pointed out on slack, we have a bunch of test coverage for tsconfig handling.

bgdnvk commented 6 months ago

I will try to give more examples later but the BUILD file doesn't add the ts_config rules (maybe I worded my question wrong), another answer from slack providing: # gazelle:js_tsconfig enabled generated it for some files. The build fails if you don't have a ts_config rule with a tsconfig path so I was wondering if this is a bug because adding it manually to every file doesn't seem like the right approach.

alexeagle commented 5 months ago

Sorry, this is still not enough detail on how to reproduce, what you see and what you expect.

jbedard commented 4 months ago

@bgdnvk is it the generation of ts_config rules or ts_project(tsconfig) attributes that you are not getting? Note that anything tsconfig related is still in an initial trial and will be enhanced more in the future. I believe today it only discovers tsconfig.json (no other filenames like tsconfig.tests.json etc).

The ts_project(tsconfig) attribute will now be generated though, within the supported use cases at least. See https://github.com/aspect-build/aspect-cli/issues/633