Build rules generated by npm_translate_lock

These are loaded from the external repository created by npm_translate_lock based on the name provided.

For example, if you run npm_translate_lock(name = "npm") then these rules can be loaded with

load("@npm//:defs.bzl", "npm_link_targets", "npm_link_all_packages")

npm_link_all_packages

Generated list of npm_link_package() target generators and first-party linked packages corresponding to the packages in {pnpm_lock_label}

If you use manually-written npm_import you can link these as well, for example,

load("@npm//:defs.bzl", "npm_link_all_packages")
load("@npm_meaning-of-life__links//:defs.bzl", npm_link_meaning_of_life = "npm_link_imported_package")

npm_link_all_packages(
    name = "node_modules",
    imported_links = [
        npm_link_meaning_of_life,
    ],
)

PARAMETERS

NameDescriptionDefault Value
namename of catch all target to generate for all packages linked"node_modules"
imported_linksoptional list link functions from manually imported packages that were fetched with npm_import rules.[]

npm_link_targets

Generated list of target names that are linked by npm_link_all_packages()

PARAMETERS

NameDescriptionDefault Value
namename of catch all target to generate for all packages linked"node_modules"
packageBazel package to generate targets names for.

Set to an empty string "" to specify the root package.

If unspecified, the current package (native.package_name()) is used.
None

RETURNS

A list of target names that are linked by npm_link_all_packages()