Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

Commit f9d6edb

Browse files
devversionalexeagle
authored andcommitted
fix: do not return empty struct if there is no compile action
Currently if there is no action for a `ts_library` that just declares `.d.ts` files, the `replay_params` will be set to an empty struct. Design-wise this does not make any sense because there is nothing to be "replayed". This fixes an issue where the Angular Bazel rules throw an exception if there are "replay_params", but are referring to a struct that does not include the "outputs" property. ``` target.typescript.replay_params.outputs struct' object has no attribute 'outputs' ``` Closes #326 PiperOrigin-RevId: 223888797
1 parent 37259c3 commit f9d6edb

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

internal/build_defs.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def _compile_action(ctx, inputs, outputs, tsconfig_file, node_opts, description
9494
# A ts_library that has only .d.ts inputs will have no outputs,
9595
# therefore there are no actions to execute
9696
if not action_outputs:
97-
return struct()
97+
return None
9898

9999
action_inputs.extend(_filter_ts_inputs(ctx.files.node_modules))
100100

package.bzl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
2424
# It will be automatically synced via the npm "version" script
2525
# that is run when running `npm version` during the release
2626
# process. See `Releasing` section in README.md.
27-
VERSION = "0.20.3"
27+
VERSION = "0.21.0"
2828

2929
def rules_typescript_dependencies():
3030
"""
@@ -38,8 +38,8 @@ def rules_typescript_dependencies():
3838
_maybe(
3939
http_archive,
4040
name = "build_bazel_rules_nodejs",
41-
urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.16.0.zip"],
42-
strip_prefix = "rules_nodejs-0.16.0",
41+
urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.16.1.zip"],
42+
strip_prefix = "rules_nodejs-0.16.1",
4343
)
4444

4545
# ts_web_test depends on the web testing rules to provision browsers.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"description": "Monorepo for TypeScript Bazel support. Published packages are in subdirectories under internal/",
33
"private": true,
4-
"version": "0.20.3",
4+
"version": "0.21.0",
55
"dependencies": {
66
"jasmine-core": "2.8.0",
77
"karma": "alexeagle/karma#fa1a84ac881485b5657cb669e9b4e5da77b79f0a",

0 commit comments

Comments
 (0)