generated from bazel-contrib/rules-template
-
-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: rename declaration_only example (#208)
makes it easier to find in the examples folder when the name matches the typescript option
- Loading branch information
Showing
6 changed files
with
25 additions
and
19 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,22 @@ | ||
"""Show usage of https://www.typescriptlang.org/tsconfig/#emitDeclarationOnly | ||
This can be useful to type-check code as part of a `bazel build` even though `tsc` doesn't | ||
transpile to JavaScript, such as when TypeScript can be natively understood by the runtime. | ||
Note, to use an alternative transpiler, see the `transpiler` attribute instead. | ||
""" | ||
|
||
load("@aspect_bazel_lib//lib:testing.bzl", "assert_contains") | ||
load("@aspect_rules_ts//ts:defs.bzl", "ts_project") | ||
|
||
ts_project( | ||
name = "declaration_only", | ||
declaration = True, | ||
emit_declaration_only = True, | ||
) | ||
|
||
assert_contains( | ||
name = "test", | ||
actual = "a.d.ts", | ||
expected = "export declare const a", | ||
) |
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 = '' |
4 changes: 2 additions & 2 deletions
4
examples/declaration_only/tsconfig.json → examples/emit_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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"compilerOptions": { | ||
"declaration": true, | ||
"emitDeclarationOnly": true, | ||
"emitDeclarationOnly": true | ||
} | ||
} | ||
} |