-
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.
fix(typescript): produce .d.ts as default output rather than empty
This lets you type-check a ts_project(emit_declaration_only=True) just by building it (its default outputs) Fixes #2116
- Loading branch information
Alex Eagle
committed
Aug 16, 2020
1 parent
1864e0f
commit 34a5008
Showing
5 changed files
with
27 additions
and
4 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
13 changes: 13 additions & 0 deletions
13
packages/typescript/test/ts_project/declaration_only/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,13 @@ | ||
load("@build_bazel_rules_nodejs//:index.bzl", "generated_file_test") | ||
load("//packages/typescript:index.bzl", "ts_project") | ||
|
||
ts_project( | ||
declaration = True, | ||
emit_declaration_only = True, | ||
) | ||
|
||
generated_file_test( | ||
name = "test", | ||
src = "a.d.ts_", | ||
generated = ":tsconfig", | ||
) |
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 = ''; |
7 changes: 7 additions & 0 deletions
7
packages/typescript/test/ts_project/declaration_only/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,7 @@ | ||
{ | ||
"compilerOptions": { | ||
"declaration": true, | ||
"emitDeclarationOnly": true, | ||
"types": [] | ||
} | ||
} |