-
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.
refactor: convert from_source example to ts_project
We no longer recommend ts_library so we shouldn't use it in examples
- Loading branch information
Showing
4 changed files
with
14 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,24 @@ | ||
"""Example package for generating stardoc from rules_nodejs at source""" | ||
|
||
load("@build_bazel_rules_nodejs//packages/typescript:index.bzl", "ts_library") | ||
load("@build_bazel_rules_nodejs//packages/typescript:index.bzl", "ts_project") | ||
|
||
def custom_ts_library(name, deps = [], **kwargs): | ||
def custom_ts_project(name, deps = [], **kwargs): | ||
""" | ||
Helper wrapper around ts_library adding default attributes and dependencies | ||
Helper wrapper around ts_project adding default attributes and dependencies | ||
Args: | ||
name: The name that should be given the this rule | ||
deps: A list of dependencies for this rule | ||
kwargs: All other attrs are passed to ts_library | ||
kwargs: All other attrs are passed to ts_project | ||
""" | ||
|
||
ts_library( | ||
ts_project( | ||
name = name, | ||
tsconfig = "tsconfig.json", | ||
deps = [ | ||
"@npm//tsutils", | ||
"@npm//@types/node", | ||
] + deps, | ||
validate = False, | ||
**kwargs | ||
) |
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,7 +1,8 @@ | ||
{ | ||
"compilerOptions": { | ||
"lib": [ | ||
"ES2017" | ||
"ES2017", | ||
"dom" | ||
], | ||
"types": [] | ||
} | ||
|