-
Notifications
You must be signed in to change notification settings - Fork 522
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(typescript): accept TsConfigInfo in extends
- Loading branch information
Alex Eagle
committed
Aug 27, 2020
1 parent
9d34089
commit 18f0f1c
Showing
5 changed files
with
75 additions
and
25 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
39 changes: 35 additions & 4 deletions
39
packages/typescript/test/ts_project/generated_tsconfig/extends/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,19 +1,50 @@ | ||
load("@build_bazel_rules_nodejs//:index.bzl", "generated_file_test") | ||
load("//packages/typescript:index.bzl", "ts_project") | ||
load("//packages/typescript:index.bzl", "ts_config", "ts_project") | ||
|
||
# Case one: extend from a single tsconfig | ||
ts_project( | ||
extends = ["//packages/typescript/test/ts_project:tsconfig-base.json"], | ||
name = "case_one", | ||
extends = "//packages/typescript/test/ts_project:tsconfig-base.json", | ||
tsconfig = { | ||
"compilerOptions": { | ||
"declaration": True, | ||
"outDir": "case_one", | ||
"types": [], | ||
}, | ||
}, | ||
) | ||
|
||
ts_config( | ||
name = "tsconfig_chain", | ||
src = "tsconfig-extended.json", | ||
deps = [ | ||
"//packages/typescript/test/ts_project:tsconfig", | ||
], | ||
) | ||
|
||
# Case two: extend from a chain of tsconfig | ||
ts_project( | ||
name = "case_two", | ||
extends = ":tsconfig_chain", | ||
tsconfig = { | ||
"compilerOptions": { | ||
"declaration": True, | ||
"outDir": "case_two", | ||
"types": [], | ||
}, | ||
}, | ||
) | ||
|
||
generated_file_test( | ||
name = "test_one", | ||
# test the default output of the ts_project | ||
src = "expected.js_", | ||
generated = "case_one/a.js", | ||
) | ||
|
||
generated_file_test( | ||
name = "test", | ||
name = "test_two", | ||
# test the default output of the ts_project | ||
src = "expected.js_", | ||
generated = "a.js", | ||
generated = "case_two/a.js", | ||
) |
6 changes: 6 additions & 0 deletions
6
packages/typescript/test/ts_project/generated_tsconfig/extends/tsconfig-extended.json
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"extends": "../../tsconfig-base", | ||
"compilerOptions": { | ||
"declaration": true | ||
}, | ||
} |
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