@@ -82,9 +82,9 @@ _PACKAGE_JSON_BZL_FILENAME = "package_json.bzl"
8282_RESOLVED_JSON_FILENAME = "resolved.json"
8383
8484# buildifier: disable=function-docstring
85- def generate_repository_files (rctx , pnpm_lock_label , importers , packages , patched_dependencies , only_built_dependencies , root_package , default_registry , npm_registries , npm_auth , link_workspace ):
85+ def generate_repository_files (rctx , importers , packages , patched_dependencies , only_built_dependencies , root_package , default_registry , npm_registries , npm_auth , link_workspace ):
8686 # empty line after bzl docstring since buildifier expects this if this file is vendored in
87- generated_by_prefix = "\" \" \" @generated by npm_translate_lock(name = \" {}\" , pnpm_lock = \" {}\" )\" \" \" \n " .format (helpers .to_apparent_repo_name (rctx .name ), str (pnpm_lock_label ))
87+ generated_by_prefix = "\" \" \" @generated by npm_translate_lock(name = \" {}\" , pnpm_lock = \" {}\" )\" \" \" \n " .format (helpers .to_apparent_repo_name (rctx .name ), str (rctx . attr . pnpm_lock ))
8888
8989 npm_imports = helpers .get_npm_imports (importers , packages , patched_dependencies , only_built_dependencies , root_package , rctx .name , rctx .attr , rctx .attr .lifecycle_hooks , rctx .attr .lifecycle_hooks_execution_requirements , rctx .attr .lifecycle_hooks_use_default_shell_env , npm_registries , default_registry , npm_auth )
9090
@@ -290,7 +290,7 @@ def npm_link_all_packages(name = "node_modules", imported_links = [], prod = Tru
290290 defs_bzl_file = "@{}//:{}" .format (rctx .name , rctx .attr .defs_bzl_filename ),
291291 link_packages_comma_separated = "\" '\" + \" ', '\" .join(_LINK_PACKAGES) + \" '\" " if len (link_packages ) else "\" \" " ,
292292 root_package = root_package ,
293- pnpm_lock_label = pnpm_lock_label ,
293+ pnpm_lock_label = rctx . attr . pnpm_lock ,
294294 validation_call = validation_call ,
295295 ),
296296 ]
@@ -632,21 +632,20 @@ def npm_link_all_packages(name = "node_modules", imported_links = [], prod = Tru
632632 rctx_files [rctx .attr .repositories_bzl_filename ] = _generate_repositories (
633633 rctx ,
634634 npm_imports ,
635- pnpm_lock_label ,
636635 link_workspace ,
637636 )
638637
639638 for filename , contents in rctx_files .items ():
640639 rctx .file (filename , generated_by_prefix + "\n " + "\n " .join (contents ))
641640
642- def _generate_repositories (rctx , npm_imports , pnpm_lock_label , link_workspace ):
641+ def _generate_repositories (rctx , npm_imports , link_workspace ):
643642 repositories_bzl = []
644643
645644 if len (npm_imports ) > 0 :
646645 repositories_bzl .append ("""load("@aspect_rules_js//npm:repositories.bzl", "npm_import")""" )
647646 repositories_bzl .append ("" )
648647
649- repositories_bzl .append ("# Generated npm_import repository rules corresponding to npm packages in {}" .format (str (pnpm_lock_label )))
648+ repositories_bzl .append ("# Generated npm_import repository rules corresponding to npm packages in {}" .format (str (rctx . attr . pnpm_lock )))
650649 repositories_bzl .append ("# buildifier: disable=function-docstring" )
651650 repositories_bzl .append ("def npm_repositories():" )
652651 if len (npm_imports ) == 0 :
0 commit comments