-
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): ts_project is linkable
This doesn't copy a package.json file, so it has to be resolvable with just index.ts
- Loading branch information
Alex Eagle
committed
May 28, 2020
1 parent
8e7c574
commit 4888a4a
Showing
8 changed files
with
44 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
load("//packages/typescript:index.bzl", "ts_project") | ||
|
||
ts_project( | ||
# This causes the linker to symlink the output directory into our execroot | ||
# execroot/node_modules/@bazel/ts_project_lib -> | ||
# bazel-out/[arch]/bin/packages/typescript/test/ts_project/linkable_lib | ||
deps = ["//packages/typescript/test/ts_project/linkable/lib: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,4 @@ | ||
import {a} from '@bazel/ts_project_lib'; | ||
import {b} from '@bazel/ts_project_lib/other'; | ||
|
||
console.error(`got ${a} ${b}`); |
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 @@ | ||
{} |
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,8 @@ | ||
load("//packages/typescript:index.bzl", "ts_project") | ||
|
||
# This directory will be linked into downstream rules in node_modules/@bazel/ts_project_lib | ||
ts_project( | ||
package_name = "@bazel/ts_project_lib", | ||
declaration = True, | ||
visibility = ["//packages/typescript/test:__subpackages__"], | ||
) |
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: number = 1; |
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 b: string = 'b'; |
5 changes: 5 additions & 0 deletions
5
packages/typescript/test/ts_project/linkable/lib/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,5 @@ | ||
{ | ||
"compilerOptions": { | ||
"declaration": true | ||
} | ||
} |