From 97d489e46d5ee71c18bfa5978ef4e09a8d1088ad Mon Sep 17 00:00:00 2001 From: Jason Bedard Date: Tue, 14 May 2024 00:14:48 -0700 Subject: [PATCH] refactor: inline check_for_conflicting_public_links (#1720) --- npm/private/npm_translate_lock_generate.bzl | 3 --- npm/private/npm_translate_lock_helpers.bzl | 4 +++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/npm/private/npm_translate_lock_generate.bzl b/npm/private/npm_translate_lock_generate.bzl index d785e07ee..7f39b9675 100644 --- a/npm/private/npm_translate_lock_generate.bzl +++ b/npm/private/npm_translate_lock_generate.bzl @@ -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 = {} diff --git a/npm/private/npm_translate_lock_helpers.bzl b/npm/private/npm_translate_lock_helpers.bzl index 85a665aa2..2e3e55ee7 100644 --- a/npm/private/npm_translate_lock_helpers.bzl +++ b/npm/private/npm_translate_lock_helpers.bzl @@ -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 ################################################################################ @@ -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,