-
Notifications
You must be signed in to change notification settings - Fork 519
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(builtin): add DeclarationInfo to js_library
Adds a declaration_info provider factory which simplifies ts_project. Also add a ts_project test to validate that js_library be a dep to ts_project. BREAKING CHANGE: Removed provide_declarations() factory function for DeclarationInfo. Use declaration_info() factory function instead.
- Loading branch information
1 parent
b120627
commit 2b89f32
Showing
9 changed files
with
76 additions
and
30 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
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
16 changes: 16 additions & 0 deletions
16
packages/typescript/test/ts_project/js_library/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,16 @@ | ||
load("@npm_bazel_typescript//:index.bzl", "ts_project") | ||
load("//internal/js_library:js_library.bzl", "js_library") | ||
|
||
js_library( | ||
name = "lib_a", | ||
srcs = [ | ||
"a.d.ts", | ||
"a.js", | ||
], | ||
) | ||
|
||
ts_project( | ||
name = "tsconfig", | ||
srcs = ["b.ts"], | ||
deps = ["lib_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 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,3 @@ | ||
'use strict'; | ||
exports.__esModule = true; | ||
exports.a = '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,2 @@ | ||
import {a} from './a'; | ||
console.log(a.toLowerCase()); |
15 changes: 15 additions & 0 deletions
15
packages/typescript/test/ts_project/js_library/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,15 @@ | ||
{ | ||
"files": ["b.ts"], | ||
"compilerOptions": { | ||
// Help TypeScript locate the a.d.ts file from dep. Needed when running in a sandbox or remote. | ||
"rootDirs": [ | ||
".", | ||
"../../../../../bazel-out/darwin-fastbuild/bin/packages/typescript/test/ts_project/js_library", | ||
"../../../../../bazel-out/k8-fastbuild/bin/packages/typescript/test/ts_project/js_library", | ||
"../../../../../bazel-out/x64_windows-fastbuild/bin/packages/typescript/test/ts_project/js_library", | ||
"../../../../../bazel-out/darwin-dbg/bin/packages/typescript/test/ts_project/js_library", | ||
"../../../../../bazel-out/k8-dbg/bin/packages/typescript/test/ts_project/js_library", | ||
"../../../../../bazel-out/x64_windows-dbg/bin/packages/typescript/test/ts_project/js_library", | ||
], | ||
} | ||
} |
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