forked from bazel-contrib/rules_nodejs
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(typescript): fail the build when ts_project produces zero outputs
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
- Loading branch information
Alex Eagle
committed
Dec 1, 2020
1 parent
68b18d8
commit 7c06dcf
Showing
4 changed files
with
54 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 7 additions & 1 deletion
8
packages/typescript/test/ts_project/empty_intermediate/BUILD.bazel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,24 @@ | ||
load("//packages/typescript:index.bzl", "ts_project") | ||
# Use the ts_project rule directly, not the wrapper macro. We don't want checking for empty outs. | ||
load("//packages/typescript/internal:ts_project.bzl", "ts_project") | ||
|
||
ts_project( | ||
name = "tsconfig-a", | ||
srcs = ["a.d.ts"], | ||
tsconfig = ":tsconfig-a.json", | ||
) | ||
|
||
# Just verify that the a.d.ts file is transitively propagated | ||
ts_project( | ||
name = "tsconfig-b", | ||
srcs = [], | ||
tsconfig = ":tsconfig-b.json", | ||
deps = ["tsconfig-a"], | ||
) | ||
|
||
ts_project( | ||
name = "tsconfig-c", | ||
srcs = ["c.ts"], | ||
js_outs = ["c.js"], | ||
tsconfig = ":tsconfig-c.json", | ||
deps = ["tsconfig-b"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters