Skip to content

Commit

Permalink
fix(typescript): include extended tsconfigs in _TsConfigInfo
Browse files Browse the repository at this point in the history
Allows ts_project to work with extra tsconfig indirections

Fixes bazel-contrib#1754
  • Loading branch information
alexeagle committed Mar 29, 2020
1 parent 5479155 commit f89360b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/typescript/src/internal/ts_project.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def _ts_project_impl(ctx):
collect_default = True,
),
),
_TsConfigInfo(tsconfigs = depset([ctx.file.tsconfig], transitive = [
_TsConfigInfo(tsconfigs = depset([ctx.file.tsconfig] + ctx.files.extends, transitive = [
dep[_TsConfigInfo].tsconfigs
for dep in ctx.attr.deps
if _TsConfigInfo in dep
Expand Down
5 changes: 4 additions & 1 deletion packages/typescript/test/ts_project/a/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ load("@npm_bazel_typescript//:index.bzl", "ts_project")

ts_project(
composite = True,
extends = ["//packages/typescript/test/ts_project:tsconfig-base.json"],
extends = [
":tsconfig-extended.json",
"//packages/typescript/test/ts_project:tsconfig-base.json",
],
# Intentionally not syncing this option from tsconfig, to test validator suppression
# source_map = True,
validate = False,
Expand Down
4 changes: 4 additions & 0 deletions packages/typescript/test/ts_project/a/tsconfig-extended.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// This file is an extra hop of indirection, regression test for #1754
{
"extends": "../tsconfig-base"
}
2 changes: 1 addition & 1 deletion packages/typescript/test/ts_project/a/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../tsconfig-base.json",
"extends": "./tsconfig-extended.json",
"compilerOptions": {
"sourceMap": true,
// WORKAROUND https://github.com/microsoft/TypeScript/issues/37378
Expand Down

0 comments on commit f89360b

Please sign in to comment.