|
1 | | -load("@build_bazel_rules_nodejs//:providers.bzl", "JSNamedModuleInfo") |
| 1 | +load("@build_bazel_rules_nodejs//:providers.bzl", "JSModuleInfo") |
2 | 2 |
|
3 | | -"""Implementation of the es5_named_output rule. |
| 3 | +"""Implementation of the es5_module_output rule. |
4 | 4 | Direct and transitive JavaScript files and sourcemaps are collected via ts_library |
5 | | -JSNamedModuleInfo provider. |
6 | | -https://github.com/bazelbuild/rules_nodejs/blob/a167311c025be2a77ba0d84e6a2ddcafe1c0564d/packages/typescript/src/internal/build_defs.bzl#L312 |
| 5 | +JSModuleInfo provider. |
| 6 | +https://github.com/bazelbuild/rules_nodejs/blob/stable/packages/typescript/internal/build_defs.bzl#L334-L337 |
7 | 7 | """ |
8 | 8 |
|
9 | | -def _es5_named_output_impl(ctx): |
| 9 | +def _es5_module_output_impl(ctx): |
10 | 10 | depsets = [] |
11 | 11 | for dep in ctx.attr.deps: |
12 | | - if JSNamedModuleInfo in dep: |
13 | | - depsets.append(dep[JSNamedModuleInfo].sources) |
| 12 | + if JSModuleInfo in dep: |
| 13 | + depsets.append(dep[JSModuleInfo].sources) |
14 | 14 | if hasattr(dep, "files"): |
15 | 15 | depsets.append(dep.files) |
16 | 16 | sources = depset(transitive = depsets) |
17 | 17 |
|
18 | 18 | return [DefaultInfo(files = sources)] |
19 | 19 |
|
20 | | -"""Rule that collects all ES5 named outputs from a list of deps. |
| 20 | +"""Rule that collects all ES5 module outputs from a list of deps. |
21 | 21 | It can be used as input for all those rules that require named JavaScript sources (such as |
22 | 22 | pkg_web). |
23 | 23 | We need this because ts_library and ng_module targets output only expose the type definition files |
24 | 24 | as outputs. |
25 | 25 | """ |
26 | | -es5_named_output = rule( |
27 | | - implementation = _es5_named_output_impl, |
| 26 | +es5_module_output = rule( |
| 27 | + implementation = _es5_module_output_impl, |
28 | 28 | attrs = { |
29 | 29 | "deps": attr.label_list( |
30 | 30 | allow_files = True, |
|
0 commit comments