Skip to content

Commit

Permalink
Add LinkablePackageInfo provider to tsc target
Browse files Browse the repository at this point in the history
  • Loading branch information
aherrmann committed Apr 17, 2020
1 parent b45c385 commit 7ca4c4e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions defs_1_1.bzl
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
load(
"@build_bazel_rules_nodejs//:providers.bzl",
"LinkablePackageInfo",
)
load("@npm//typescript:index.bzl", "tsc")

def _paths_join(*paths):
return "/".join([p for p in paths if p])

def _my_ts_library_impl(ctx):
tsc = ctx.attr.tsc
return [
tsc[DefaultInfo],
LinkablePackageInfo(
package_name = ctx.attr.module_name,
path = _paths_join(
ctx.bin_dir.path,
ctx.label.workspace_root,
ctx.label.package,
),
),
]

_my_ts_library = rule(
Expand Down

0 comments on commit 7ca4c4e

Please sign in to comment.