-
Notifications
You must be signed in to change notification settings - Fork 522
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
ts_project does not work with labels in srcs #2301
Comments
Also, I think it would be better if the rule/macro would fail if it encounters an input in |
This is a limitation of Even a simple example fails, doesn't need to involve code generation:
->
The indirection through I like your idea of improving the error messaging. However there's also a feature of |
Already thought this is not really a bug but rather by design. At the moment, one is able to compile |
If you want to take an opaque directory of |
Also fix a violation of this constraint in our tests. That in turn exposed a subtle bug where the `files` block in the generated tsconfig.json would reference non-.ts inputs BREAKING CHANGE: any ts_project rule that produces no outputs must be fixed or removed Fixes bazel-contrib#2301
Also fix a violation of this constraint in our tests. That in turn exposed a subtle bug where the `files` block in the generated tsconfig.json would reference non-.ts inputs BREAKING CHANGE: any ts_project rule that produces no outputs must be fixed or removed Fixes #2301
fixed by 3ca6cac |
I'm not sure if this is the issue I'm running into or not, but it seems my ts_project(
name = "client",
srcs = [
"generated.ts",
],
deps = [
"//frontend/utils",
"@npm//google-protobuf",
],
)
genrule(
name = "codegen",
outs = [
"generated.ts",
],
cmd = ("$(location //blah:generate_typescript) " +
"--output_dir $(RULEDIR)"),
exec_tools = ["//blah:generate_typescript"],
) Is the above expected to fail? If so, it's quite surprising. In most bazel rules, using an explicit src file and a generated file works the same way. |
With rules_nodejs ts_project this can be an issue because typescript isn't aware of the output tree (where the generated ts file lives) unless you add the appropriate rootDirs to your tsconfig. You also can't mixed generated sources with actual sources in ts_project from rules_nodejs. At its core, the issue is that Bazel puts outputs in a separate tree while typescript is used to node ecosystem tooling which typically puts generated files in the same tree as sources but .gitignored. These issues have both been resolved in ts_project based on rules_js. |
Thanks. Is rules_js ready for use by angular Typescript apps that use gRPC?
…On Tue, Oct 11, 2022, 8:43 AM Greg Magolan ***@***.***> wrote:
With rules_nodejs ts_project this is an issue because typescript isn't
aware of the output tree (where the generated ts file lives) unless you add
the appropriate rootDirs to your tsconfig. You also can't mixed generated
sources with actual sources in ts_project from rules_nodejs. At its core,
the issue is that Bazel puts outputs in a separate tree while typescript is
used to the node ecosystem tooling which typically puts generated files in
the same tree as sources but .gitignored.
These issues have both been resolved in ts_project
<https://github.com/aspect-build/rules_ts> based on rules_js
<https://github.com/aspect-build/rules_js>.
—
Reply to this email directly, view it on GitHub
<#2301 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AZHJ6YUFDGR6YJP6CKPPATLWCWDKFANCNFSM4T7PACHA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
🐞 bug report
Affected Rule
ts_project
Is this a regression?
No
Description
I have a rule that generates .ts files. I want ts_project to compile these .ts files. But it wont recognize them at all.
Anything else relevant?
https://github.com/bazelbuild/rules_nodejs/blob/681c6683dac742f1e375a401c0399ec7783ac8fd/packages/typescript/internal/ts_project.bzl#L314-L320
Above is the code that is used to define the outputs for the
ts_project
rule in thets_proto_macro
.In my case, this will just result in an empty list and thus nothing will build.
The text was updated successfully, but these errors were encountered: