Skip to content

Commit

Permalink
perf: only emit aspect_rules_js_metadata when required (#1420)
Browse files Browse the repository at this point in the history
  • Loading branch information
dzbarsky authored Jan 6, 2024
1 parent 6e2437a commit 42b751a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion js/private/test/image/structure/digests.sum
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
9546c440ffbbe36177f305a1aec4bf89fa08eea5926fe828c8e9edd8e08a16a7
d26b897f8c3e3c3464f5acfd50ad56793f82f1f362e2bc2a78bc6a77204561cc
ea187b7d895f6fecc13eb08ff07bc9a1765a39cd082d4cfbb65739d0e66dcf95
1 change: 0 additions & 1 deletion js/private/test/image/structure/node_modules_structure.mf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ app/js/private/test/image/structure/bin.runfiles/aspect_rules_js/node_modules/.a
app/js/private/test/image/structure/bin.runfiles/aspect_rules_js/node_modules/.aspect_rules_js/[email protected]/node_modules/acorn/CHANGELOG.md
app/js/private/test/image/structure/bin.runfiles/aspect_rules_js/node_modules/.aspect_rules_js/[email protected]/node_modules/acorn/LICENSE
app/js/private/test/image/structure/bin.runfiles/aspect_rules_js/node_modules/.aspect_rules_js/[email protected]/node_modules/acorn/README.md
app/js/private/test/image/structure/bin.runfiles/aspect_rules_js/node_modules/.aspect_rules_js/[email protected]/node_modules/acorn/aspect_rules_js_metadata.json
app/js/private/test/image/structure/bin.runfiles/aspect_rules_js/node_modules/.aspect_rules_js/[email protected]/node_modules/acorn/bin
app/js/private/test/image/structure/bin.runfiles/aspect_rules_js/node_modules/.aspect_rules_js/[email protected]/node_modules/acorn/bin/acorn
app/js/private/test/image/structure/bin.runfiles/aspect_rules_js/node_modules/.aspect_rules_js/[email protected]/node_modules/acorn/dist
Expand Down
6 changes: 4 additions & 2 deletions npm/private/npm_import.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -598,8 +598,10 @@ bin = bin_factory("node_modules")
if rctx.attr.custom_postinstall:
rules_js_metadata["scripts"] = {}
rules_js_metadata["scripts"]["custom_postinstall"] = rctx.attr.custom_postinstall
rules_js_json_path = paths.join(_EXTRACT_TO_DIRNAME, "aspect_rules_js_metadata.json")
rctx.file(rules_js_json_path, json.encode_indent(rules_js_metadata, indent = " "))

if rules_js_metadata:
rules_js_json_path = paths.join(_EXTRACT_TO_DIRNAME, "aspect_rules_js_metadata.json")
rctx.file(rules_js_json_path, json.encode_indent(rules_js_metadata, indent = " "))

for filename, contents in rctx_files.items():
rctx.file(filename, "\n".join(contents))
Expand Down

0 comments on commit 42b751a

Please sign in to comment.