-
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): add OutputGroupInfo to ts_project with type definit…
…ions fix #1978
- Loading branch information
Showing
5 changed files
with
32 additions
and
0 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
23 changes: 23 additions & 0 deletions
23
packages/typescript/test/ts_project/output_group/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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
load("@build_bazel_rules_nodejs//:index.bzl", "generated_file_test") | ||
load("//packages/typescript:index.bzl", "ts_project") | ||
|
||
# This uses defaults for all attributes. | ||
# It will find `index.ts` and produce `index.js` & `index.d.ts` | ||
ts_project( | ||
name = "tsconfig", | ||
srcs = ["index.ts"], | ||
declaration = True, | ||
) | ||
|
||
filegroup( | ||
name = "types", | ||
srcs = [":tsconfig"], | ||
output_group = "types", | ||
) | ||
|
||
generated_file_test( | ||
name = "test", | ||
src = "index.golden.d.ts", | ||
# Refers to the output from filegroup above | ||
generated = ":types", | ||
) |
1 change: 1 addition & 0 deletions
1
packages/typescript/test/ts_project/output_group/index.golden.d.ts
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 @@ | ||
export declare const a: string; |
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 @@ | ||
export const a: string = 'hello'; |
6 changes: 6 additions & 0 deletions
6
packages/typescript/test/ts_project/output_group/tsconfig.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 @@ | ||
{ | ||
"compilerOptions": { | ||
"types": [], | ||
"declaration": true | ||
} | ||
} |