Skip to content

Commit

Permalink
refactor: remote deprecated package_json attribute from npm_translate…
Browse files Browse the repository at this point in the history
…_lock (#1569)
  • Loading branch information
gregmagolan committed May 7, 2024
1 parent a21fbe2 commit 29640c4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
3 changes: 1 addition & 2 deletions docs/npm_translate_lock.md

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

14 changes: 0 additions & 14 deletions npm/private/npm_translate_lock.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,6 @@ def npm_translate_lock(
register_tar_toolchains = True,
npm_package_target_name = "{dirname}",
use_starlark_yaml_parser = False,
# TODO(2.0): remove package_json
package_json = None,
**kwargs):
"""Repository macro to generate starlark code from a lock file.
Expand Down Expand Up @@ -520,10 +518,6 @@ def npm_translate_lock(
register_tar_toolchains: if True, `@aspect_bazel_lib//lib:repositories.bzl` `register_tar_toolchains()` is called if the toolchain is not already registered
package_json: Deprecated.
Add all `package.json` files that are part of the workspace to `data` instead.
npm_package_target_name: The name of linked `npm_package` targets. When `npm_package` targets are linked as pnpm workspace
packages, the name of the target must align with this value.
Expand Down Expand Up @@ -595,14 +589,6 @@ def npm_translate_lock(
if npm_package_lock:
data = data + [npm_package_lock]

if package_json:
data = data + [package_json]

# buildifier: disable=print
print("""
WARNING: `package_json` attribute in `npm_translate_lock(name = "{name}")` is deprecated. Add all package.json files to the `data` attribute instead.
""".format(name = name))

# convert bins to a string_list_dict to satisfy attr type in repository rule
bins_string_list_dict = {}
if type(bins) != "dict":
Expand Down

0 comments on commit 29640c4

Please sign in to comment.