Skip to content

Commit

Permalink
refactor: inline check_for_conflicting_public_links (#1720)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbedard authored May 14, 2024
1 parent 5746c56 commit 97d489e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 0 additions & 3 deletions npm/private/npm_translate_lock_generate.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,6 @@ def npm_link_all_packages(name = "node_modules", imported_links = []):
),
]

# check all links and fail if there are duplicates which can happen with public hoisting
helpers.check_for_conflicting_public_links(npm_imports, rctx.attr.public_hoist_packages)

stores_bzl = []
links_bzl = {}
links_targets_bzl = {}
Expand Down
4 changes: 3 additions & 1 deletion npm/private/npm_translate_lock_helpers.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,9 @@ Either remove this patch file if it is no longer needed or change its key to mat
)
fail(msg)

# check all links and fail if there are duplicates which can happen with public hoisting
_check_for_conflicting_public_links(result, attr.public_hoist_packages)

return result

################################################################################
Expand Down Expand Up @@ -596,7 +599,6 @@ To disable this check, remove the `verify_patches` attribute from `npm_translate
""".format(patches_list = state.label_store.relative_path("verify_patches"), missing_patches = missing_patches_formatted))

helpers = struct(
check_for_conflicting_public_links = _check_for_conflicting_public_links,
gather_values_from_matching_names = _gather_values_from_matching_names,
get_npm_auth = _get_npm_auth,
get_npm_imports = _get_npm_imports,
Expand Down

0 comments on commit 97d489e

Please sign in to comment.