Skip to content

Commit

Permalink
chore: rename declaration_only example (#208)
Browse files Browse the repository at this point in the history
makes it easier to find in the examples folder when the name matches the typescript option
  • Loading branch information
alexeagle authored Oct 31, 2022
1 parent 028a2b5 commit ca39e49
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 19 deletions.
15 changes: 0 additions & 15 deletions examples/declaration_only/BUILD.bazel

This file was deleted.

1 change: 0 additions & 1 deletion examples/declaration_only/a.d.ts_

This file was deleted.

1 change: 0 additions & 1 deletion examples/declaration_only/a.ts

This file was deleted.

22 changes: 22 additions & 0 deletions examples/emit_declaration_only/BUILD.bazel
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",
)
1 change: 1 addition & 0 deletions examples/emit_declaration_only/a.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const a: string = ''
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"declaration": true,
"emitDeclarationOnly": true,
"emitDeclarationOnly": true
}
}
}

0 comments on commit ca39e49

Please sign in to comment.