Skip to content

Commit

Permalink
refactor: rename include_npm_linked_packages to include_npm_sources &…
Browse files Browse the repository at this point in the history
…& JsInfo npm_linked_packages to npm_sources (aspect-build#1623)
  • Loading branch information
gregmagolan authored and jbedard committed May 16, 2024
1 parent 9b92e5b commit a9b32b2
Show file tree
Hide file tree
Showing 15 changed files with 86 additions and 51 deletions.
12 changes: 6 additions & 6 deletions docs/js_binary.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/js_info_files.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions docs/js_run_binary.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions js/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,43 @@ load(
_js_image_layer = "js_image_layer",
)

# buildifier: disable=function-docstring
def js_binary(**kwargs):
include_npm_sources = kwargs.pop("include_npm_sources", True)

# For backward compat
# TODO(3.0): remove backward compat handling
include_npm_linked_packages = kwargs.pop("include_npm_linked_packages", None)
if include_npm_linked_packages != None:
# buildifier: disable=print
print("""
WARNING: js_binary 'include_npm_linked_packages' is deprecated. Use 'include_npm_sources' instead.""")
include_npm_sources = include_npm_linked_packages

_js_binary(
include_npm_sources = include_npm_sources,
enable_runfiles = select({
Label("@aspect_bazel_lib//lib:enable_runfiles"): True,
"//conditions:default": False,
}),
**kwargs
)

# buildifier: disable=function-docstring
def js_test(**kwargs):
include_npm_sources = kwargs.pop("include_npm_sources", True)

# For backward compat
# TODO(3.0): remove backward compat handling
include_npm_linked_packages = kwargs.pop("include_npm_linked_packages", None)
if include_npm_linked_packages != None:
# buildifier: disable=print
print("""
WARNING: js_test 'include_npm_linked_packages' is deprecated. Use 'include_npm_sources' instead.""")
include_npm_sources = include_npm_linked_packages

_js_test(
include_npm_sources = include_npm_sources,
enable_runfiles = select({
Label("@aspect_bazel_lib//lib:enable_runfiles"): True,
"//conditions:default": False,
Expand Down
Loading

0 comments on commit a9b32b2

Please sign in to comment.