From 0fc7846fbc98d1c5e6b86da191b84608843ac450 Mon Sep 17 00:00:00 2001 From: Greg Magolan Date: Thu, 9 Jun 2022 15:21:27 -0700 Subject: [PATCH] feat: support 'npm:' style package.json aliased npm deps BREAKING CHANGES See https://github.com/aspect-build/rules_js/pull/171 --- BUILD.bazel | 52 +- docs/npm_import.md | 25 +- docs/npm_link_package.md | 71 +- e2e/bzlmod/BUILD.bazel | 11 +- e2e/rules_foo/npm_repositories.bzl | 14 +- examples/assert_lockfile_up_to_date/BUILD | 25 +- examples/lib/index.js | 3 +- examples/lib/package.json | 8 +- npm/defs.bzl | 2 - npm/npm_import.bzl | 37 +- npm/private/npm_import.bzl | 430 ++++++---- npm/private/npm_link_package.bzl | 219 +++-- npm/private/npm_translate_lock.bzl | 208 +++-- npm/private/test/BUILD.bazel | 2 + npm/private/test/defs_checked.bzl | 810 +++++++++--------- npm/private/test/package.json | 2 + npm/private/test/package_json_checked.bzl | 40 +- .../test/package_json_with_dashes_checked.bzl | 40 +- npm/private/test/repositories_checked.bzl | 420 +++++---- npm/private/utils.bzl | 6 +- pnpm-lock.yaml | 23 +- pnpm-workspace.yaml | 2 +- 22 files changed, 1388 insertions(+), 1062 deletions(-) diff --git a/BUILD.bazel b/BUILD.bazel index 5bed576f5..f80a57b93 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -1,35 +1,41 @@ +load("@acorn__8.4.0__links//:defs.bzl", npm_link_acorn = "npm_link_imported_package") load("@bazel_gazelle//:def.bzl", "gazelle", "gazelle_binary") load("@npm//:defs.bzl", "npm_link_all_packages") -load("@acorn__8.4.0__links//:defs.bzl", npm_link_acorn = "npm_link_package") -load("//npm:defs.bzl", "npm_link_package", "npm_link_package_dep") +load("@pnpm__links//:defs.bzl", npm_link_pnpm = "npm_link_imported_package") +load("//npm:defs.bzl", "npm_link_package") -load("@pnpm__links//:defs.bzl", npm_link_pnpm = "npm_link_package") -npm_link_pnpm(name = "node_modules/pnpm") - -# Link all packages from the /WORKSPACE npm_translate_lock in /package.json to -# bazel-bin/node_modules as well as the virtual store bazel-bin/node_modules/.aspect_rules_js -# since /package.json is the root of the pnpm workspace -npm_link_all_packages(name = "node_modules") - -# Link the acorn package, which was fetched separately with npm_import from /WORKSPACE, to the -# virtual store in bazel-bin/node_modules/.aspect_rules_js and as a direct link to -# bazel-bin/node_modules/acorn -npm_link_acorn(name = "node_modules/acorn") +# Link all packages from the /WORKSPACE npm_translate_lock(name = "npm") and also packages from +# manual /WORKSPACE npm_import rules to bazel-bin/node_modules as well as the virtual store +# bazel-bin/node_modules/.aspect_rules_js since /pnpm-lock.yaml is the root of the pnpm workspace +npm_link_all_packages( + name = "node_modules", + imported_links = [ + npm_link_acorn, + npm_link_pnpm, + ], +) # Linking a first-party dependency to the virtual store in bazel-bin/node_modules/.aspect_rules_js and # as a direct link to bazel-bin/node_modules/@mycorp/mylib npm_link_package( name = "node_modules/@mycorp/mylib", src = "//examples/lib", - deps = [ - # For a 3rd party deps fetched with an npm_import or via a npm_translate_lock repository rule, - # you must specify both the name and version to qualify the dependency. These should match the - # `package` and `version` attributes of the corresponding `npm_import`. - npm_link_package_dep( - "acorn", - version = "8.4.0", - ), - ], + # We dep on the virtual store link targets which are layed out in the root package, typically + # the package where the pnpm-lock.yaml file is located. + deps = { + # Package store link targets names for 3rd party packages that come from + # npm_translate_package lock start with the name passed to npm_link_all_packages macro + # (typically 'node_modules') followed by `//store/` where `package` is the + # package name (including @scope segment if any) and `version` is the specific version of + # the package that comes from the pnpm-lock.yaml file. + "//:node_modules/uuid/store/8.3.2": "", + # Package store link targets names for 3rd party package that come directly from an + # npm_import start with the name passed to the `npm_import`'s `npm_link_imported_package` + # macro (typically 'node_modules') followed by `//store/` where `package` + # matches the `package` attribute in the npm_import of the package and `version` matches the + # `version` attribute. + "//:node_modules/acorn/store/8.4.0": "", + }, ) gazelle_binary( diff --git a/docs/npm_import.md b/docs/npm_import.md index d71fba19a..32fdbf3e7 100644 --- a/docs/npm_import.md +++ b/docs/npm_import.md @@ -188,9 +188,9 @@ To consume the downloaded package in rules, it must be "linked" into the link pa package's `BUILD.bazel` file: ``` -load("@npm__at_types_node__15.12.2__links//:defs.bzl", link_types_node = "npm_link_package") +load("@npm__at_types_node__15.12.2__links//:defs.bzl", npm_link_types_node = "npm_link_imported_package") -link_types_node(name = "node_modules/@types/node") +npm_link_types_node(name = "node_modules") ``` This links `@types/node` into the `node_modules` of this package with the target name `:node_modules/@types/node`. @@ -213,6 +213,25 @@ This creates `:node_modules/name` and `:node_modules/@scope/name` targets for al It also creates `:node_modules/name/dir` and `:node_modules/@scope/name/dir` filegroup targets that provide the the directory artifacts of their npm packages. These target can be used to create entry points for binary target or to access files within the npm package. +If you have a mix of `npm_link_all_packages` and `npm_link_imported_package` functions to call you can pass the +`npm_link_imported_package` link functions to the `imported_links` attribute of `npm_link_all_packages` to link +them all in one call. For example, + +``` +load("@npm//:defs.bzl", "npm_link_all_packages") +load("@npm__at_types_node__15.12.2__links//:defs.bzl", npm_link_types_node = "npm_link_imported_package") + +npm_link_all_packages( + name = "node_modules", + imported_links = [ + npm_link_types_node, + ] +) +``` + +This has the added benefit of adding the `imported_links` to the convienence `:node_modules` target which +includes all direct dependencies in that package. + NB: You can pass an name to npm_link_all_packages and this will change the targets generated to "{name}/@scope/name" and "{name}/name". We recommend using "node_modules" as the convention for readability. @@ -242,7 +261,7 @@ common --experimental_downloader_config=.bazel_downloader_config | transitive_closure | A dict all npm packages this one depends on directly or transitively where the key is the package name and value is a list of version(s) depended on in the closure. | {} | | root_package | The root package where the node_modules virtual store is linked to. Typically this is the package that the pnpm-lock.yaml file is located when using npm_translate_lock. | "" | | link_workspace | The workspace name where links will be created for this package. Typically this is the workspace that the pnpm-lock.yaml file is located when using npm_translate_lock. Can be left unspecified if the link workspace is the user workspace. | "" | -| link_packages | List of paths where direct links may be created at for this package. Defaults to [] which indicates that direct links may be created in any package as specified by the direct attribute of the generated npm_link_package. These paths are relative to the root package with "." being the node_modules at the root package. | [] | +| link_packages | Dict of paths where direct links may be created at for this package to a list of link aliases to link as in each package. If aliases are an empty list this indicates to link as the package name.

Defaults to {} which indicates that direct links may be created in any package as specified by the direct attribute of the generated npm_link_package. | {} | | run_lifecycle_hooks | If true, runs preinstall, install and postinstall lifecycle hooks declared in this package. | False | | integrity | Expected checksum of the file downloaded, in Subresource Integrity format. This must match the checksum of the file downloaded.

This is the same as appears in the pnpm-lock.yaml, yarn.lock or package-lock.json file.

It is a security risk to omit the checksum as remote files can change.

At best omitting this field will make your build non-hermetic.

It is optional to make development easier but should be set before shipping. | "" | | url | Optional url for this package. If unset, a default npm registry url is generated from the package name and version. | "" | diff --git a/docs/npm_link_package.md b/docs/npm_link_package.md index 3b3ab73bd..318851adb 100644 --- a/docs/npm_link_package.md +++ b/docs/npm_link_package.md @@ -7,7 +7,7 @@ npm_link_package rule ## npm_link_package_direct
-npm_link_package_direct(name, src)
+npm_link_package_direct(name, package, src)
 
Defines a node package that is linked into a node_modules tree as a direct dependency. @@ -31,6 +31,7 @@ https://github.com/npm/rfcs/blob/main/accepted/0042-isolated-mode.md. | Name | Description | Type | Mandatory | Default | | :------------- | :------------- | :------------- | :------------- | :------------- | | name | A unique name for this target. | Name | required | | +| package | The package name to link to.

If unset, the package name of the src npm_link_package_store is used. If set, takes precendance over the package name in the src npm_link_package_store. | String | optional | "" | | src | The npm_link_package target to link as a direct dependency. | Label | required | | @@ -62,7 +63,7 @@ https://github.com/npm/rfcs/blob/main/accepted/0042-isolated-mode.md. | Name | Description | Type | Mandatory | Default | | :------------- | :------------- | :------------- | :------------- | :------------- | | name | A unique name for this target. | Name | required | | -| deps | Other node packages this one depends on.

This should include *all* modules the program may need at runtime.

> In typical usage, a node.js program sometimes requires modules which were > never declared as dependencies. > This pattern is typically used when the program has conditional behavior > that is enabled when the module is found (like a plugin) but the program > also runs without the dependency. > > This is possible because node.js doesn't enforce the dependencies are sound. > All files under node_modules are available to any program. > In contrast, Bazel makes it possible to make builds hermetic, which means that > all dependencies of a program must be declared when running in Bazel's sandbox. | List of labels | optional | [] | +| deps | Other node packages store link targets one depends on mapped to the name to link them under in this packages deps.

This should include *all* modules the program may need at runtime.

You can find all the package store link targets in your repository with

         bazel query ... | grep /store/ | grep -v /dir | grep -v /pkg | grep -v /ref         


1st party deps will typically be versioned 0.0.0 (unless set to another version explicitly in npm_link_package). For example,

         //:node_modules/@mycorp/mylib/store/0.0.0         


3rd party package store link targets will include the version. For example,

         //:node_modules/cliui/store/7.0.4         


If imported via npm_translate_lock, the version may include peer dep(s),

         //:node_modules/debug/store/4.3.4_supports-color@8.1.1         


It could be also be a github.com url based version,

         //:node_modules/debug/store/github.com/ngokevin/debug/9742c5f383a6f8046241920156236ade8ec30d53         


In general, package store link targets names for 3rd party packages that come from npm_translate_lock start with the name passed to the npm_link_all_packages macro (typically 'node_modules') followed by /<package>/store/<version> where package is the package name (including @scope segment if any) and version is the specific version of the package that comes from the pnpm-lock.yaml file.

Package store link targets names for 3rd party package that come directly from an npm_import start with the name passed to the npm_import's npm_link_imported_package macro (typically 'node_modules') followed by /<package>/store/<version> where package matches the package attribute in the npm_import of the package and version matches the version attribute.

> In typical usage, a node.js program sometimes requires modules which were > never declared as dependencies. > This pattern is typically used when the program has conditional behavior > that is enabled when the module is found (like a plugin) but the program > also runs without the dependency. > > This is possible because node.js doesn't enforce the dependencies are sound. > All files under node_modules are available to any program. > In contrast, Bazel makes it possible to make builds hermetic, which means that > all dependencies of a program must be declared when running in Bazel's sandbox. | Dictionary: Label -> String | optional | {} | | package | The package name to link to.

If unset, the package name in the NpmPackageInfo src must be set. If set, takes precendance over the package name in the NpmPackageInfo src. | String | optional | "" | | src | A npm_package target or or any other target that provides a NpmPackageInfo. | Label | required | | | version | The package version being linked.

If unset, the package version in the NpmPackageInfo src must be set. If set, takes precendance over the package version in the NpmPackageInfo src. | String | optional | "" | @@ -73,8 +74,8 @@ https://github.com/npm/rfcs/blob/main/accepted/0042-isolated-mode.md. ## npm_link_package
-npm_link_package(name, root_package, direct, src, deps, fail_if_no_link, auto_manual, visibility,
-                 kwargs)
+npm_link_package(name, version, root_package, direct, src, deps, fail_if_no_link, auto_manual,
+                 visibility, kwargs)
 
"Links an npm package to the virtual store if in the root package and directly to node_modules if direct is True. @@ -93,11 +94,12 @@ the package directory for creating entry points or accessing files in the packag | Name | Description | Default Value | | :------------- | :------------- | :------------- | -| name | The name of the direct alias target to create if linked directly. For first-party deps linked across a workspace, the name must match in all packages being linked as it is used to derive the virtual store link target name. | none | +| name | The name of the direct link target to create (if linked directly). For first-party deps linked across a workspace, the name must match in all packages being linked as it is used to derive the virtual store link target name. | none | +| version | version used to identify the package in the virtual store | "0.0.0" | | root_package | the root package where the node_modules virtual store is linked to | "" | | direct | whether or not to link a direct dependency in this package For 3rd party deps fetched with an npm_import, direct may not be specified if link_packages is set on the npm_import. | True | | src | the npm_package target to link; may only to be specified when linking in the root package | None | -| deps | list of npm_link_package_store; may only to be specified when linking in the root package | [] | +| deps | list of npm_link_package_store; may only to be specified when linking in the root package | {} | | fail_if_no_link | whether or not to fail if this is called in a package that is not the root package and with direct false | True | | auto_manual | whether or not to automatically add a manual tag to the generated targets Links tagged "manual" dy default is desirable so that they are not built by bazel build ... if they are unused downstream. For 3rd party deps, this is particularly important so that 3rd party deps are not fetched at all unless they are used. | True | | visibility | the visibility of the generated targets | ["//visibility:public"] | @@ -108,63 +110,6 @@ the package directory for creating entry points or accessing files in the packag Label of the npm_link_package_direct if created, else None - - -## npm_link_package_dep - -
-npm_link_package_dep(name, version, root_package)
-
- -Returns the label to the npm_link_package store for a package. - -This can be used to generate virtual store target names for the deps list -of a npm_link_package. - -Example root BUILD.file where the virtual store is linked by default, - -``` -load("@npm//:defs.bzl", "npm_link_all_packages") -load("@aspect_rules_js//:defs.bzl", "npm_link_package") - -# Links all packages from the `npm_translate_lock(name = "npm", pnpm_lock = "//:pnpm-lock.yaml")` -# repository rule. -npm_link_all_packages(name = "node_modules") - -# Link a first party `@lib/foo` defined by the `npm_package` `//lib/foo:foo` target. -npm_link_package( - name = "node_modules/@lib/foo", - src = "//lib/foo", -) - -# Link a first party `@lib/bar` defined by the `npm_package` `//lib/bar:bar` target -# that depends on `@lib/foo` and on `acorn` specified in `package.json` and fetched -# with `npm_translate_lock` -npm_link_package( - name = "link_lib_bar", - src = "//lib/bar", - deps = [ - npm_link_package_dep("node_modules/@lib/foo"), - npm_link_package_dep("acorn", version = "8.4.0"), - ], -) -``` - - -**PARAMETERS** - - -| Name | Description | Default Value | -| :------------- | :------------- | :------------- | -| name | The name of the link target. For first-party packages, this must match the name passed to npm_link_package for the package in the root package when not linking at the root package.

For 3rd party deps fetched with an npm_import or via a npm_translate_lock repository rule, the name must match the package attribute of the corresponding npm_import. This is typically the npm package name. | none | -| version | The version of the package This should be left unset for first-party packages linked manually with npm_link_package.

For 3rd party deps fetched with an npm_import or via a npm_translate_lock repository rule, the package version is required to qualify the dependency. It must the version attribute of the corresponding npm_import. | None | -| root_package | The bazel package of the virtual store. Defaults to the current package | "" | - -**RETURNS** - -The label of the direct link for the given package at the given link package, - - ## npm_link_package_direct_lib.implementation diff --git a/e2e/bzlmod/BUILD.bazel b/e2e/bzlmod/BUILD.bazel index d308867b4..be4c78035 100644 --- a/e2e/bzlmod/BUILD.bazel +++ b/e2e/bzlmod/BUILD.bazel @@ -1,10 +1,13 @@ load("@aspect_rules_js//js:defs.bzl", "js_test") load("@npm//:defs.bzl", "npm_link_all_packages") -load("@npm_meaning-of-life__links//:defs.bzl", npm_link_meaning_of_life = "npm_link_package") +load("@npm_meaning-of-life__links//:defs.bzl", npm_link_meaning_of_life = "npm_link_imported_package") -npm_link_all_packages(name = "node_modules") - -npm_link_meaning_of_life(name = "node_modules/meaning-of-life") +npm_link_all_packages( + name = "node_modules", + imported_links = [ + npm_link_meaning_of_life, + ], +) js_test( name = "test", diff --git a/e2e/rules_foo/npm_repositories.bzl b/e2e/rules_foo/npm_repositories.bzl index ade1d5ec9..d755f1105 100644 --- a/e2e/rules_foo/npm_repositories.bzl +++ b/e2e/rules_foo/npm_repositories.bzl @@ -8,7 +8,9 @@ def npm_repositories(): name = "rules_foo_npm__at_aspect-test_a__5.0.0", root_package = "foo", link_workspace = "rules_foo", - link_packages = ["foo"], + link_packages = { + "foo": ["@aspect-test/a"], + }, package = "@aspect-test/a", version = "5.0.0", integrity = "sha512-t/lwpVXG/jmxTotGEsmjwuihC2Lvz/Iqt63o78SI3O5XallxtFp5j2WM2M6HwkFiii9I42KdlAF8B3plZMz0Fw==", @@ -29,7 +31,7 @@ def npm_repositories(): name = "rules_foo_npm__at_aspect-test_b__5.0.0", root_package = "foo", link_workspace = "rules_foo", - link_packages = [], + link_packages = {}, package = "@aspect-test/b", version = "5.0.0", integrity = "sha512-MyIW6gHL3ds0BmDTOktorHLJUya5eZLGZlOxsKN2M9c3DWp+p1pBrA6KLQX1iq9BciryhpKwl82IAxP4jG52kw==", @@ -50,7 +52,7 @@ def npm_repositories(): name = "rules_foo_npm__at_aspect-test_c__1.0.0", root_package = "foo", link_workspace = "rules_foo", - link_packages = [], + link_packages = {}, package = "@aspect-test/c", version = "1.0.0", integrity = "sha512-UorLD4TFr9CWFeYbUd5etaxSo201fYEFR+rSxXytfzefX41EWCBabsXhdhvXjK6v/HRuo1y1I1NiW2P3/bKJeA==", @@ -64,7 +66,7 @@ def npm_repositories(): name = "rules_foo_npm__at_aspect-test_c__2.0.0", root_package = "foo", link_workspace = "rules_foo", - link_packages = [], + link_packages = {}, package = "@aspect-test/c", version = "2.0.0", integrity = "sha512-vRuHi/8zxZ+IRGdgdX4VoMNFZrR9UqO87yQx61IGIkjgV7QcKUeu5jfvIE3Mr0WNQeMdO1JpyTx1UUpsE73iug==", @@ -78,7 +80,7 @@ def npm_repositories(): name = "rules_foo_npm__at_aspect-test_d__2.0.0__at_aspect-test_c_1.0.0", root_package = "foo", link_workspace = "rules_foo", - link_packages = [], + link_packages = {}, package = "@aspect-test/d", version = "2.0.0_@aspect-test+c@1.0.0", integrity = "sha512-jndwr8pLUfn795uApTcXG/yZ5hV2At1aS/wo5BVLxqlVVgLoOETF/Dp4QOjMHE/SXkXFowz6Hao+WpmzVvAO0A==", @@ -95,7 +97,7 @@ def npm_repositories(): name = "rules_foo_npm__at_aspect-test_d__2.0.0__at_aspect-test_c_2.0.0", root_package = "foo", link_workspace = "rules_foo", - link_packages = [], + link_packages = {}, package = "@aspect-test/d", version = "2.0.0_@aspect-test+c@2.0.0", integrity = "sha512-jndwr8pLUfn795uApTcXG/yZ5hV2At1aS/wo5BVLxqlVVgLoOETF/Dp4QOjMHE/SXkXFowz6Hao+WpmzVvAO0A==", diff --git a/examples/assert_lockfile_up_to_date/BUILD b/examples/assert_lockfile_up_to_date/BUILD index f576792c9..cc8b85ec6 100644 --- a/examples/assert_lockfile_up_to_date/BUILD +++ b/examples/assert_lockfile_up_to_date/BUILD @@ -1,17 +1,17 @@ -load("@aspect_rules_js//js:defs.bzl", "js_run_binary", "js_binary", "js_test") +load("@aspect_rules_js//js:defs.bzl", "js_binary", "js_run_binary", "js_test") +load("@pnpm__links//:defs.bzl", npm_link_pnpm = "npm_link_imported_package") -load("@pnpm__links//:defs.bzl", npm_link_pnpm = "npm_link_package") -npm_link_pnpm(name = "node_modules/pnpm") +npm_link_pnpm(name = "node_modules") js_test( name = "assert_lockfile_up_to_date", - entry_point = "assert_lockfile_frozen.js", + chdir = package_name(), data = [ - ":pnpm-lock.yaml", - ":package.json", ":node_modules/pnpm", + ":package.json", + ":pnpm-lock.yaml", ], - chdir = package_name(), + entry_point = "assert_lockfile_frozen.js", ) js_binary( @@ -23,8 +23,8 @@ js_binary( js_run_binary( name = "generate_lockfile", srcs = [ - ":pnpm-lock.yaml", ":package.json", + ":pnpm-lock.yaml", ], outs = [ "output-pnpm-lock.yaml", @@ -53,13 +53,12 @@ sh_binary( # This ensures that future updates to pnpm don't break our detection logic. js_test( name = "test_assert_lockfile_frozen", - entry_point = "assert_lockfile_frozen.js", + chdir = package_name() + "/testdata", data = [ - ":testdata/pnpm-lock.yaml", - ":testdata/package.json", ":node_modules/pnpm", + ":testdata/package.json", + ":testdata/pnpm-lock.yaml", ], - chdir = package_name() + "/testdata", + entry_point = "assert_lockfile_frozen.js", expected_exit_code = 1, ) - diff --git a/examples/lib/index.js b/examples/lib/index.js index a24aa65d9..4769342f6 100644 --- a/examples/lib/index.js +++ b/examples/lib/index.js @@ -2,6 +2,7 @@ * @fileoverview minimal test program that requires a third-party package from npm */ const acorn = require('acorn') +const { v4: uuid } = require('uuid') function toAst(program) { return JSON.stringify(acorn.parse(program, { ecmaVersion: 2020 })) + '\n' @@ -11,4 +12,4 @@ function getAcornVersion() { return acorn.version } -module.exports = { toAst, getAcornVersion } +module.exports = { toAst, getAcornVersion, uuid } diff --git a/examples/lib/package.json b/examples/lib/package.json index 608ca57a2..066cbc13b 100644 --- a/examples/lib/package.json +++ b/examples/lib/package.json @@ -1,4 +1,10 @@ { "name": "@mycorp/mylib", - "private": true + "private": true, + "dependencies": { + "uuid": "8.3.2" + }, + "optionalDependencies": { + "acorn": "*" + } } diff --git a/npm/defs.bzl b/npm/defs.bzl index 23106ec3c..ecff70545 100644 --- a/npm/defs.bzl +++ b/npm/defs.bzl @@ -10,14 +10,12 @@ load( load( "//npm/private:npm_link_package.bzl", _npm_link_package = "npm_link_package", - _npm_link_package_dep = "npm_link_package_dep", ) npm_package = _npm_package NpmPackageInfo = _NpmPackageInfo npm_link_package = _npm_link_package -npm_link_package_dep = _npm_link_package_dep # export the starlark libraries as a public API npm_package_lib = _npm_package_lib diff --git a/npm/npm_import.bzl b/npm/npm_import.bzl index 342893a08..2cca27047 100644 --- a/npm/npm_import.bzl +++ b/npm/npm_import.bzl @@ -53,7 +53,7 @@ def npm_import( transitive_closure = {}, root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, run_lifecycle_hooks = False, integrity = "", url = "", @@ -94,9 +94,9 @@ def npm_import( package's `BUILD.bazel` file: ``` - load("@npm__at_types_node__15.12.2__links//:defs.bzl", link_types_node = "npm_link_package") + load("@npm__at_types_node__15.12.2__links//:defs.bzl", npm_link_types_node = "npm_link_imported_package") - link_types_node(name = "node_modules/@types/node") + npm_link_types_node(name = "node_modules") ``` This links `@types/node` into the `node_modules` of this package with the target name `:node_modules/@types/node`. @@ -119,6 +119,25 @@ def npm_import( It also creates `:node_modules/name/dir` and `:node_modules/@scope/name/dir` filegroup targets that provide the the directory artifacts of their npm packages. These target can be used to create entry points for binary target or to access files within the npm package. + If you have a mix of `npm_link_all_packages` and `npm_link_imported_package` functions to call you can pass the + `npm_link_imported_package` link functions to the `imported_links` attribute of `npm_link_all_packages` to link + them all in one call. For example, + + ``` + load("@npm//:defs.bzl", "npm_link_all_packages") + load("@npm__at_types_node__15.12.2__links//:defs.bzl", npm_link_types_node = "npm_link_imported_package") + + npm_link_all_packages( + name = "node_modules", + imported_links = [ + npm_link_types_node, + ] + ) + ``` + + This has the added benefit of adding the `imported_links` to the convienence `:node_modules` target which + includes all direct dependencies in that package. + NB: You can pass an name to npm_link_all_packages and this will change the targets generated to "{name}/@scope/name" and "{name}/name". We recommend using "node_modules" as the convention for readability. @@ -147,10 +166,12 @@ def npm_import( link_workspace: The workspace name where links will be created for this package. Typically this is the workspace that the pnpm-lock.yaml file is located when using `npm_translate_lock`. Can be left unspecified if the link workspace is the user workspace. - link_packages: List of paths where direct links may be created at for this package. - Defaults to [] which indicates that direct links may be created in any package as specified by + link_packages: Dict of paths where direct links may be created at for this package to + a list of link aliases to link as in each package. If aliases are an + empty list this indicates to link as the package name. + + Defaults to {} which indicates that direct links may be created in any package as specified by the `direct` attribute of the generated npm_link_package. - These paths are relative to the root package with "." being the node_modules at the root package. run_lifecycle_hooks: If true, runs `preinstall`, `install` and `postinstall` lifecycle hooks declared in this package. integrity: Expected checksum of the file downloaded, in Subresource Integrity format. @@ -189,10 +210,10 @@ def npm_import( run_lifecycle_hooks = run_lifecycle_hooks, ) - # By convention, the `{name}{utils.links_suffix}` repository contains the generated + # By convention, the `{name}{utils.links_repo_suffix}` repository contains the generated # code to link this npm package into one or more node_modules trees _npm_import_links( - name = "{}{}".format(name, _utils.links_suffix), + name = "{}{}".format(name, _utils.links_repo_suffix), package = package, version = version, root_package = root_package, diff --git a/npm/private/npm_import.bzl b/npm/private/npm_import.bzl index 65f498e60..57f6c7d6c 100644 --- a/npm/private/npm_import.bzl +++ b/npm/private/npm_import.bzl @@ -10,162 +10,225 @@ _LINK_JS_PACKAGE_TMPL = """load("@aspect_rules_js//npm:defs.bzl", _npm_package = load("@aspect_rules_js//js:defs.bzl", _js_run_binary = "js_run_binary") load("@aspect_rules_js//npm/private:npm_link_package_store_internal.bzl", _npm_link_package_store = "npm_link_package_store_internal") load("@aspect_rules_js//npm/private:npm_link_package.bzl", _npm_link_package_direct = "npm_link_package_direct") +load("@aspect_rules_js//npm/private:utils.bzl", _utils = "utils") load("@bazel_skylib//lib:paths.bzl", _paths = "paths") -# buildifier: disable=unnamed-macro -def npm_link_package( +def npm_link_imported_package_store( name, - direct = {direct_default}, - fail_if_no_link = True, visibility = ["//visibility:public"]): - "Generated npm_link_package_store and npm_link_package_direct targets for npm package {package}@{version}" + "Generated npm_link_package_store targets for npm package {package}@{version}" root_package = "{root_package}" - - link_packages = {link_packages} - - if link_packages and direct != None: - fail("direct attribute cannot be specified when link_packages are set") - is_root = native.package_name() == root_package - is_direct = (direct == True) or (direct == None and native.package_name() in link_packages) - - if fail_if_no_link and not is_root and not is_direct: - msg = "Nothing to link in bazel package '%s' for npm package npm package {package}@{version}. This is neither the root package nor a link package of this package." % native.package_name() + if not is_root: + msg = "No store links in bazel package '%s' for npm package npm package {package}@{version}. This is neither the root package nor a link package of this package." % native.package_name() fail(msg) + if not name.endswith("/{package}"): + msg = "name must end with one of '/{package}' when linking the store in package '{package}'; recommended value is 'node_modules/{package}'" + fail(msg) + link_root_name = name[:-len("/{package}")] - if is_root: - # link the virtual store when linking at the root + deps = {deps} + lc_deps = {lc_deps} + ref_deps = {ref_deps} + + lifecycle_build_target = {lifecycle_build_target} + store_target_name = "{{}}/{package}/store/{version}".format(link_root_name) - lifecycle_build_target = {lifecycle_build_target} + # reference target used to avoid circular deps + _npm_link_package_store( + name = "{{}}/ref".format(store_target_name), + package = "{package}", + version = "{version}", + tags = ["manual"], + ) - deps = {deps} + # post-lifecycle target with reference deps for use in terminal target with transitive closure + _npm_link_package_store( + name = "{{}}/pkg".format(store_target_name), + src = "{{}}/pkg_lc".format(store_target_name) if lifecycle_build_target else "{npm_package_target}", + package = "{package}", + version = "{version}", + deps = ref_deps, + tags = ["manual"], + ) - lc_deps = {lc_deps} + # virtual store target with transitive closure of all node package dependencies + _npm_link_package_store( + name = store_target_name, + src = None if {transitive_closure_pattern} else "{npm_package_target}", + package = "{package}", + version = "{version}", + deps = deps, + visibility = visibility, + tags = ["manual"], + ) - ref_deps = {ref_deps} + # filegroup target that provides a single file which is + # package directory for use in $(execpath) and $(rootpath) + native.filegroup( + name = "{{}}/dir".format(store_target_name), + srcs = [":{{}}".format(store_target_name)], + output_group = _utils.package_directory_output_group, + visibility = visibility, + tags = ["manual"], + ) - # reference target used to avoid circular deps + if lifecycle_build_target: + # pre-lifecycle target with reference deps for use terminal pre-lifecycle target _npm_link_package_store( - name = "{store_link_prefix}{bazel_name}__ref", + name = "{{}}/pkg_pre_lc_lite".format(store_target_name), package = "{package}", version = "{version}", + deps = ref_deps, tags = ["manual"], ) - # post-lifecycle target with reference deps for use in terminal target with transitive closure + # terminal pre-lifecycle target for use in lifecycle build target below _npm_link_package_store( - name = "{store_link_prefix}{bazel_name}__pkg", - src = "{store_link_prefix}{bazel_name}__pkg_lc" if lifecycle_build_target else "{npm_package_target}", + name = "{{}}/pkg_pre_lc".format(store_target_name), package = "{package}", version = "{version}", - deps = ref_deps, + deps = lc_deps, tags = ["manual"], ) - # virtual store target with transitive closure of all node package dependencies - _npm_link_package_store( - name = "{store_link_prefix}{bazel_name}", - src = None if {transitive_closure_pattern} else "{npm_package_target}", - package = "{package}", - version = "{version}", - deps = deps, - visibility = visibility, + # lifecycle build action + _js_run_binary( + name = "{lifecycle_target_name}", + srcs = [ + "{npm_package_target_lc}", + ":{{}}/pkg_pre_lc".format(store_target_name) + ], + # js_run_binary runs in the output dir; must add "../../../" because paths are relative to the exec root + args = [ + "{package}", + "../../../$(execpath {npm_package_target_lc})", + "../../../$(@D)", + ], + copy_srcs_to_bin = False, + tool = "@aspect_rules_js//npm/private/lifecycle:lifecycle-hooks", + output_dir = True, tags = ["manual"], ) - # filegroup target that provides a single file which is - # package directory for use in $(execpath) and $(rootpath) - native.filegroup( - name = "{store_link_prefix}{bazel_name}{dir_suffix}", - srcs = [":{store_link_prefix}{bazel_name}"], - output_group = "{package_directory_output_group}", - visibility = visibility, + # post-lifecycle npm_package + _npm_package( + name = "{{}}/pkg_lc".format(store_target_name), + src = ":{lifecycle_target_name}", + package = "{package}", + version = "{version}", tags = ["manual"], ) - if lifecycle_build_target: - # pre-lifecycle target with reference deps for use terminal pre-lifecycle target - _npm_link_package_store( - name = "{store_link_prefix}{bazel_name}__pkg_pre_lc_lite", - package = "{package}", - version = "{version}", - deps = ref_deps, - tags = ["manual"], - ) +def npm_link_imported_package_direct( + name, + visibility = ["//visibility:public"]): + "Generated npm_link_package_store and npm_link_package_direct targets for npm package {package}@{version}" - # terminal pre-lifecycle target for use in lifecycle build target below - _npm_link_package_store( - name = "{store_link_prefix}{bazel_name}__pkg_pre_lc", - package = "{package}", - version = "{version}", - deps = lc_deps, - tags = ["manual"], - ) + link_packages = {link_packages} + if native.package_name() in link_packages: + link_aliases = link_packages[native.package_name()] + else: + link_aliases = ["{package}"] + + link_alias = None + for _link_alias in link_aliases: + if name.endswith("/{{}}".format(_link_alias)): + # longest match wins + if not link_alias or len(_link_alias) > len(link_alias): + link_alias = _link_alias + if not link_alias: + msg = "name must end with one of '/{{{{ {{link_aliases_comma_separated}} }}}}' when called from package '{package}'; recommended value(s) are 'node_modules/{{{{ {{link_aliases_comma_separated}} }}}}'".format(link_aliases_comma_separated = ", ".join(link_aliases)) + fail(msg) - # lifecycle build action - _js_run_binary( - name = "{lifecycle_target_name}", - srcs = [ - "{npm_package_target_lc}", - ":{store_link_prefix}{bazel_name}__pkg_pre_lc" - ], - # js_run_binary runs in the output dir; must add "../../../" because paths are relative to the exec root - args = [ - "{package}", - "../../../$(execpath {npm_package_target_lc})", - "../../../$(@D)", - ], - copy_srcs_to_bin = False, - tool = "@aspect_rules_js//npm/private/lifecycle:lifecycle-hooks", - output_dir = True, - tags = ["manual"], - ) + link_root_name = name[:-len("/{{}}".format(link_alias))] + store_target_name = "{{}}/{package}/store/{version}".format(link_root_name) - # post-lifecycle npm_package - _npm_package( - name = "{store_link_prefix}{bazel_name}__pkg_lc", - src = ":{lifecycle_target_name}", - package = "{package}", - version = "{version}", - tags = ["manual"], - ) + # terminal target for direct dependencies + _npm_link_package_direct( + name = name, + package = link_alias, + src = "//{root_package}:{{}}".format(store_target_name), + visibility = visibility, + tags = ["manual"], + ) + + # filegroup target that provides a single file which is + # package directory for use in $(execpath) and $(rootpath) + native.filegroup( + name = "{{}}/dir".format(name), + srcs = [":{{}}".format(name)], + output_group = _utils.package_directory_output_group, + visibility = visibility, + tags = ["manual"], + ) + + return ":{{}}".format(name) + +def npm_link_imported_package( + name = "node_modules", + direct = {direct_default}, + fail_if_no_link = True, + visibility = ["//visibility:public"]): + "Generated npm_link_package_store and npm_link_package_direct targets for npm package {package}@{version}" + + root_package = "{root_package}" + link_packages = {link_packages} + + if link_packages and direct != None: + fail("direct attribute cannot be specified when link_packages are set") + + is_direct = (direct == True) or (direct == None and native.package_name() in link_packages) + is_root = native.package_name() == root_package + + if fail_if_no_link and not is_root and not is_direct: + msg = "Nothing to link in bazel package '%s' for npm package npm package {package}@{version}. This is neither the root package nor a link package of this package." % native.package_name() + fail(msg) + + direct_targets = [] + scoped_targets = {{}} - direct_target = None if is_direct: - # terminal target for direct dependencies - _npm_link_package_direct( - name = name, - src = "//{root_package}:{store_link_prefix}{bazel_name}", - visibility = visibility, - tags = ["manual"], - ) - direct_target = ":{{}}".format(name) - - # filegroup target that provides a single file which is - # package directory for use in $(execpath) and $(rootpath) - native.filegroup( - name = "{{}}/dir".format(name), - srcs = [direct_target], - output_group = "{package_directory_output_group}", + link_aliases = [] + if native.package_name() in link_packages: + link_aliases = link_packages[native.package_name()] + if not link_aliases: + link_aliases = ["{package}"] + for link_alias in link_aliases: + direct_target_name = "{{}}/{{}}".format(name, link_alias) + npm_link_imported_package_direct( + name = direct_target_name, + visibility = visibility, + ) + direct_targets.append(":{{}}".format(direct_target_name)) + if len(link_alias.split("/", 1)) > 1: + link_scope = link_alias.split("/", 1)[0] + if link_scope not in scoped_targets: + scoped_targets[link_scope] = [] + scoped_targets[link_scope].append(direct_target_name) + + if is_root: + npm_link_imported_package_store( + "{{}}/{package}".format(name), visibility = visibility, - tags = ["manual"], ) - return direct_target + return (direct_targets, scoped_targets) """ _BIN_MACRO_TMPL = """ -def {bin_name}(name, **kwargs): +def _{bin_name}_internal(name, link_root_name, **kwargs): + store_target_name = "{{}}/{package}/store/{version}".format(link_root_name) _directory_path( name = "%s__entry_point" % name, - directory = "@{link_workspace}//{root_package}:{store_link_prefix}{bazel_name}{dir_suffix}", + directory = "@{link_workspace}//{root_package}:{{}}/dir".format(store_target_name), path = "{bin_path}", ) _js_binary( name = "%s__js_binary" % name, entry_point = ":%s__entry_point" % name, - data = ["@{link_workspace}//{root_package}:{store_link_prefix}{bazel_name}"], + data = ["@{link_workspace}//{root_package}:{{}}".format(store_target_name)], ) _js_run_binary( name = name, @@ -173,31 +236,42 @@ def {bin_name}(name, **kwargs): **kwargs ) -def {bin_name}_test(name, **kwargs): +def _{bin_name}_test_internal(name, link_root_name, **kwargs): + store_target_name = "{{}}/{package}/store/{version}".format(link_root_name) _directory_path( name = "%s__entry_point" % name, - directory = "@{link_workspace}//{root_package}:{store_link_prefix}{bazel_name}{dir_suffix}", + directory = "@{link_workspace}//{root_package}:{{}}/dir".format(store_target_name), path = "{bin_path}", ) _js_test( name = name, entry_point = ":%s__entry_point" % name, - data = kwargs.pop("data", []) + ["@{link_workspace}//{root_package}:{store_link_prefix}{bazel_name}"], + data = kwargs.pop("data", []) + ["@{link_workspace}//{root_package}:{{}}".format(store_target_name)], **kwargs ) -def {bin_name}_binary(name, **kwargs): +def _{bin_name}_binary_internal(name, link_root_name, **kwargs): + store_target_name = "{{}}/{package}/store/{version}".format(link_root_name) _directory_path( name = "%s__entry_point" % name, - directory = "@{link_workspace}//{root_package}:{store_link_prefix}{bazel_name}{dir_suffix}", + directory = "@{link_workspace}//{root_package}:{{}}/dir".format(store_target_name), path = "{bin_path}", ) _js_binary( name = name, entry_point = ":%s__entry_point" % name, - data = kwargs.pop("data", []) + ["@{link_workspace}//{root_package}:{store_link_prefix}{bazel_name}"], + data = kwargs.pop("data", []) + ["@{link_workspace}//{root_package}:{{}}".format(store_target_name)], **kwargs ) + +def {bin_name}(name, **kwargs): + _{bin_name}_internal(name, "node_modules", **kwargs) + +def {bin_name}_test(name, **kwargs): + _{bin_name}_test_internal(name, "node_modules", **kwargs) + +def {bin_name}_binary(name, **kwargs): + _{bin_name}_binary_internal(name, "node_modules", **kwargs) """ _JS_PACKAGE_TMPL = """ @@ -286,7 +360,7 @@ def _impl(rctx): root_package_json_bzl = False if bins: - for link_package in rctx.attr.link_packages: + for link_package in rctx.attr.link_packages.keys(): bin_bzl = generated_by_lines + [ """load("@aspect_bazel_lib//lib:directory_path.bzl", _directory_path = "directory_path")""", """load("@aspect_rules_js//js:defs.bzl", _js_binary = "js_binary", _js_run_binary = "js_run_binary", _js_test = "js_test")""", @@ -297,18 +371,36 @@ def _impl(rctx): bazel_name = bazel_name, bin_name = _sanitize_bin_name(name), bin_path = bins[name], - dir_suffix = utils.dir_suffix, - root_package = rctx.attr.root_package, link_workspace = rctx.attr.link_workspace, - store_link_prefix = utils.store_link_prefix, + package = rctx.attr.package, + root_package = rctx.attr.root_package, + version = rctx.attr.version, ), ) - bin_struct_fields = [ - "{name} = {name}, {name}_test = {name}_test, {name}_binary = {name}_binary".format(name = _sanitize_bin_name(name)) - for name in bins - ] - bin_bzl.append("bin = struct(%s)\n" % ",\n".join(bin_struct_fields)) + bin_struct_fields = [] + for bin_name in bins: + sanitized_bin_name = _sanitize_bin_name(bin_name) + bin_struct_fields.append( + """ {bin_name} = lambda name, **kwargs: _{bin_name}_internal(name, link_root_name = link_root_name, **kwargs), + {bin_name}_test = lambda name, **kwargs: _{bin_name}_test_internal(name, link_root_name = link_root_name, **kwargs), + {bin_name}_binary = lambda name, **kwargs: _{bin_name}_binary_internal(name, link_root_name = link_root_name, **kwargs),""".format( + bin_name = sanitized_bin_name, + ), + ) + + bin_bzl.append("""def bin_factory(link_root_name): + # bind link_root_name using lambdas + return struct( +{bin_struct_fields} + ) + +bin = bin_factory("node_modules") +""".format( + package = rctx.attr.package, + version = rctx.attr.version, + bin_struct_fields = "\n".join(bin_struct_fields), + )) if link_package == "": root_package_json_bzl = True @@ -344,15 +436,21 @@ def _sanitize_bin_name(name): return name.replace("-", "_") def _impl_links(rctx): - ref_deps = [] - lc_deps = [] - deps = [] + ref_deps = {} + lc_deps = {} + deps = {} for (dep_name, dep_version) in rctx.attr.deps.items(): - ref_deps.append("{store_link_prefix}{bazel_name}__ref".format( - bazel_name = utils.bazel_name(dep_name, dep_version), - store_link_prefix = utils.store_link_prefix, - )) + if dep_version.startswith("/"): + store_package, store_version = utils.parse_pnpm_name(dep_version[1:]) + else: + store_package = dep_name + store_version = dep_version + dep_store_target_ref = """":{{}}/{package}/store/{version}/ref".format(link_root_name)""".format( + package = store_package, + version = store_version, + ) + ref_deps[dep_store_target_ref] = ref_deps[dep_store_target_ref] + [dep_name] if dep_store_target_ref in ref_deps else [dep_name] transitive_closure_pattern = len(rctx.attr.transitive_closure) > 0 if transitive_closure_pattern: @@ -361,33 +459,41 @@ def _impl_links(rctx): # party npm deps; it is not recommended for 1st party deps for (dep_name, dep_versions) in rctx.attr.transitive_closure.items(): for dep_version in dep_versions: + if dep_version.startswith("/"): + store_package, store_version = utils.parse_pnpm_name(dep_version[1:]) + else: + store_package = dep_name + store_version = dep_version + dep_store_target_pkg = """":{{}}/{package}/store/{version}/pkg".format(link_root_name)""".format( + package = store_package, + version = store_version, + ) if dep_name == rctx.attr.package and dep_version == rctx.attr.version: + dep_store_target_pkg_pre_lc_lite = """":{{}}/{package}/store/{version}/pkg_pre_lc_lite".format(link_root_name)""".format( + package = store_package, + version = store_version, + ) + # special case for lifecycle transitive closure deps; do not depend on # the __pkg of this package as that will be the output directory # of the lifecycle action - lc_deps.append("{store_link_prefix}{bazel_name}__pkg_pre_lc_lite".format( - bazel_name = utils.bazel_name(dep_name, dep_version), - store_link_prefix = utils.store_link_prefix, - )) + lc_deps[dep_store_target_pkg_pre_lc_lite] = lc_deps[dep_store_target_pkg_pre_lc_lite] + [dep_name] if dep_store_target_pkg_pre_lc_lite in lc_deps else [dep_name] else: - lc_deps.append("{store_link_prefix}{bazel_name}__pkg".format( - bazel_name = utils.bazel_name(dep_name, dep_version), - store_link_prefix = utils.store_link_prefix, - )) - deps.append("{store_link_prefix}{bazel_name}__pkg".format( - bazel_name = utils.bazel_name(dep_name, dep_version), - store_link_prefix = utils.store_link_prefix, - )) + lc_deps[dep_store_target_pkg] = lc_deps[dep_store_target_pkg] + [dep_name] if dep_store_target_pkg in lc_deps else [dep_name] + deps[dep_store_target_pkg] = deps[dep_store_target_pkg] + [dep_name] if dep_store_target_pkg in deps else [dep_name] else: for (dep_name, dep_version) in rctx.attr.deps.items(): - lc_deps.append("{store_link_prefix}{bazel_name}".format( - bazel_name = utils.bazel_name(dep_name, dep_version), - store_link_prefix = utils.store_link_prefix, - )) - deps.append("{store_link_prefix}{bazel_name}".format( - bazel_name = utils.bazel_name(dep_name, dep_version), - store_link_prefix = utils.store_link_prefix, - )) + if dep_version.startswith("/"): + store_package, store_version = utils.parse_pnpm_name(dep_version[1:]) + else: + store_package = dep_name + store_version = dep_version + dep_store_target = """":{{}}/{package}/store/{version}/pkg".format(link_root_name)""".format( + package = store_package, + version = store_version, + ) + lc_deps[dep_store_target] = lc_deps[dep_store_target] + [dep_name] if dep_store_target in lc_deps else [dep_name] + deps[dep_store_target] = deps[dep_store_target] + [dep_name] if dep_store_target in deps else [dep_name] virtual_store_name = utils.virtual_store_name(rctx.attr.package, rctx.attr.version) @@ -395,32 +501,40 @@ def _impl_links(rctx): lifecycle_target_name = paths.join("node_modules", utils.virtual_store_root, virtual_store_name, "node_modules", rctx.attr.package) # strip _links post-fix to get the repository name of the npm sources - npm_import_sources_repo_name = rctx.name[:-len(utils.links_suffix)] + npm_import_sources_repo_name = rctx.name[:-len(utils.links_repo_suffix)] if npm_import_sources_repo_name.startswith("aspect_rules_js.npm."): npm_import_sources_repo_name = npm_import_sources_repo_name[len("aspect_rules_js.npm."):] npm_package_target = "@{}//:source_directory".format(npm_import_sources_repo_name) npm_package_target_lc = "@{}//:pkg".format(npm_import_sources_repo_name) + link_packages = {} + for package, link_aliases in rctx.attr.link_packages.items(): + link_packages[package] = link_aliases or [rctx.attr.package] + + # collapse link aliases lists into to acomma separated strings + for dep in deps.keys(): + deps[dep] = ",".join(deps[dep]) + for dep in lc_deps.keys(): + lc_deps[dep] = ",".join(lc_deps[dep]) + for dep in ref_deps.keys(): + ref_deps[dep] = ",".join(ref_deps[dep]) + npm_link_package_bzl = [_LINK_JS_PACKAGE_TMPL.format( - bazel_name = utils.bazel_name(rctx.attr.package, rctx.attr.version), - deps = starlark_codegen_utils.to_list_attr(deps, 1), - dir_suffix = utils.dir_suffix, + deps = starlark_codegen_utils.to_dict_attr(deps, 2, quote_key = False), direct_default = "None" if rctx.attr.link_packages else "True", extract_to_dirname = _EXTRACT_TO_DIRNAME, npm_package_target = npm_package_target, npm_package_target_lc = npm_package_target_lc, - lc_deps = starlark_codegen_utils.to_list_attr(lc_deps, 1), + lc_deps = starlark_codegen_utils.to_dict_attr(lc_deps, 2, quote_key = False), lifecycle_build_target = str(rctx.attr.lifecycle_build_target), lifecycle_target_name = lifecycle_target_name, npm_link_package_bzl = "@%s//:%s" % (rctx.name, _DEFS_BZL_FILENAME), - link_packages = rctx.attr.link_packages, + link_packages = starlark_codegen_utils.to_dict_attr(link_packages, 1, quote_value = False), package = rctx.attr.package, - package_directory_output_group = utils.package_directory_output_group, rctx_name = rctx.name, - ref_deps = starlark_codegen_utils.to_list_attr(ref_deps, 1), + ref_deps = starlark_codegen_utils.to_dict_attr(ref_deps, 2, quote_key = False), root_package = rctx.attr.root_package, - store_link_prefix = utils.store_link_prefix, transitive_closure_pattern = str(transitive_closure_pattern), version = rctx.attr.version, virtual_store_root = utils.virtual_store_root, @@ -436,7 +550,7 @@ _COMMON_ATTRS = { "package": attr.string(mandatory = True), "version": attr.string(mandatory = True), "root_package": attr.string(), - "link_packages": attr.string_list(), + "link_packages": attr.string_list_dict(), } _ATTRS_LINKS = dicts.add(_COMMON_ATTRS, { diff --git a/npm/private/npm_link_package.bzl b/npm/private/npm_link_package.bzl index 608be5008..532cb2f77 100644 --- a/npm/private/npm_link_package.bzl +++ b/npm/private/npm_link_package.bzl @@ -54,11 +54,54 @@ _ATTRS_STORE = { providers = [NpmPackageInfo], mandatory = True, ), - "deps": attr.label_list( - doc = """Other node packages this one depends on. + "deps": attr.label_keyed_string_dict( + doc = """Other node packages store link targets one depends on mapped to the name to link them under in this packages deps. This should include *all* modules the program may need at runtime. + You can find all the package store link targets in your repository with + + ``` + bazel query ... | grep /store/ | grep -v /dir | grep -v /pkg | grep -v /ref + ``` + + 1st party deps will typically be versioned 0.0.0 (unless set to another version explicitly in + npm_link_package). For example, + + ``` + //:node_modules/@mycorp/mylib/store/0.0.0 + ``` + + 3rd party package store link targets will include the version. For example, + + ``` + //:node_modules/cliui/store/7.0.4 + ``` + + If imported via npm_translate_lock, the version may include peer dep(s), + + ``` + //:node_modules/debug/store/4.3.4_supports-color@8.1.1 + ``` + + It could be also be a `github.com` url based version, + + ``` + //:node_modules/debug/store/github.com/ngokevin/debug/9742c5f383a6f8046241920156236ade8ec30d53 + ``` + + In general, package store link targets names for 3rd party packages that come from + `npm_translate_lock` start with the name passed to the `npm_link_all_packages` macro + (typically 'node_modules') followed by `//store/` where `package` is the + package name (including @scope segment if any) and `version` is the specific version of + the package that comes from the pnpm-lock.yaml file. + + Package store link targets names for 3rd party package that come directly from an + `npm_import` start with the name passed to the `npm_import`'s `npm_link_imported_package` + macro (typically 'node_modules') followed by `//store/` where `package` + matches the `package` attribute in the npm_import of the package and `version` matches the + `version` attribute. + > In typical usage, a node.js program sometimes requires modules which were > never declared as dependencies. > This pattern is typically used when the program has conditional behavior @@ -95,6 +138,13 @@ _ATTRS_DIRECT = { providers = [_StoreInfo], mandatory = True, ), + "package": attr.string( + doc = """The package name to link to. + +If unset, the package name of the src npm_link_package_store is used. +If set, takes precendance over the package name in the src npm_link_package_store. +""", + ), } def _impl_store(ctx): @@ -112,7 +162,7 @@ def _impl_store(ctx): virtual_store_directory = None direct_files = [] - direct_ref_deps = [] + direct_ref_deps = {} if ctx.attr.src: # output the package as a TreeArtifact to its virtual store location @@ -133,7 +183,7 @@ def _impl_store(ctx): copy_directory_action(ctx, src_directory, virtual_store_directory, is_windows = is_windows) direct_files.append(virtual_store_directory) - for dep in ctx.attr.deps: + for dep, _dep_aliases in ctx.attr.deps.items(): # symlink the package's direct deps to its virtual store location if dep[_StoreInfo].root_package != ctx.label.package: msg = """npm_link_package_store in %s package cannot depend on npm_link_package_store in %s package. @@ -141,69 +191,70 @@ deps of npm_link_package_store must be in the same package.""" % (ctx.label.pack fail(msg) dep_package = dep[_StoreInfo].package dep_version = dep[_StoreInfo].version + dep_aliases = _dep_aliases.split(",") if _dep_aliases else [dep_package] dep_virtual_store_directory = dep[_StoreInfo].virtual_store_directory if dep_virtual_store_directory: - # "node_modules/{virtual_store_root}/{virtual_store_name}/node_modules/{package}" - dep_symlink_path = paths.join("node_modules", utils.virtual_store_root, virtual_store_name, "node_modules", dep_package) - dep_symlink = ctx.actions.declare_file(dep_symlink_path) - ctx.actions.symlink( - output = dep_symlink, - target_file = dep_virtual_store_directory, - ) - direct_files.append(dep_symlink) + for dep_alias in dep_aliases: + # "node_modules/{virtual_store_root}/{virtual_store_name}/node_modules/{package}" + dep_symlink_path = paths.join("node_modules", utils.virtual_store_root, virtual_store_name, "node_modules", dep_alias) + dep_symlink = ctx.actions.declare_file(dep_symlink_path) + ctx.actions.symlink( + output = dep_symlink, + target_file = dep_virtual_store_directory, + ) + direct_files.append(dep_symlink) else: # this is a ref npm_link_package, a downstream terminal npm_link_package # for this npm depedency will create the dep symlinks for this dep; # this pattern is used to break circular dependencies between 3rd # party npm deps; it is not recommended for 1st party deps - direct_ref_deps.append(dep) + direct_ref_deps[dep] = dep_aliases else: # if ctx.attr.src is _not_ set and ctx.attr.deps is, this is a terminal # package with deps being the transitive closure of deps; # this pattern is used to break circular dependencies between 3rd # party npm deps; it is not recommended for 1st party deps deps_map = {} - for dep in ctx.attr.deps: + for dep, _dep_aliases in ctx.attr.deps.items(): + dep_package = dep[_StoreInfo].package + dep_aliases = _dep_aliases.split(",") if _dep_aliases else [dep_package] + # create a map of deps that have virtual store directories if dep[_StoreInfo].virtual_store_directory: - dep_package = dep[_StoreInfo].package - dep_version = dep[_StoreInfo].version - deps_map[utils.pnpm_name(dep_package, dep_version)] = dep + deps_map[utils.virtual_store_name(dep[_StoreInfo].package, dep[_StoreInfo].version)] = dep else: # this is a ref npm_link_package, a downstream terminal npm_link_package for this npm # depedency will create the dep symlinks for this dep; this pattern is used to break # for lifecycle hooks on 3rd party deps; it is not recommended for 1st party deps - direct_ref_deps.append(dep) + direct_ref_deps[dep] = dep_aliases for dep in ctx.attr.deps: - dep_package = dep[_StoreInfo].package - dep_version = dep[_StoreInfo].version - dep_virtual_store_name = utils.virtual_store_name(dep_package, dep_version) + dep_virtual_store_name = utils.virtual_store_name(dep[_StoreInfo].package, dep[_StoreInfo].version) dep_ref_deps = dep[_StoreInfo].ref_deps - if dep_package == package and dep_version == version: + if virtual_store_name == dep_virtual_store_name: # provide the node_modules directory for this package if found in the transitive_closure virtual_store_directory = dep[_StoreInfo].virtual_store_directory if virtual_store_directory: direct_files.append(virtual_store_directory) - for dep_ref_dep in dep_ref_deps: - dep_ref_dep_package = dep_ref_dep[_StoreInfo].package - dep_ref_dep_version = dep_ref_dep[_StoreInfo].version - if dep_ref_dep_package == package and dep_ref_dep_version == version: + for dep_ref_dep, dep_ref_dep_aliases in dep_ref_deps.items(): + dep_ref_dep_virtual_store_name = utils.virtual_store_name(dep_ref_dep[_StoreInfo].package, dep_ref_dep[_StoreInfo].version) + if dep_ref_dep_virtual_store_name == virtual_store_name: + # ignore reference back to self in dyadic circular deps pass else: - dep_ref_dep_pnpm_name = utils.pnpm_name(dep_ref_dep_package, dep_ref_dep_version) - if not dep_ref_dep_pnpm_name in deps_map: - fail("Expecting {} to be in deps".format(dep_ref_dep_pnpm_name)) - actual_dep = deps_map[dep_ref_dep_pnpm_name] + if not dep_ref_dep_virtual_store_name in deps_map: + fail("Expecting {} to be in deps".format(dep_ref_dep_virtual_store_name)) + actual_dep = deps_map[dep_ref_dep_virtual_store_name] dep_ref_def_virtual_store_directory = actual_dep[_StoreInfo].virtual_store_directory if dep_ref_def_virtual_store_directory: - # "node_modules/{virtual_store_root}/{virtual_store_name}/node_modules/{package}" - dep_ref_dep_symlink_path = paths.join("node_modules", utils.virtual_store_root, dep_virtual_store_name, "node_modules", dep_ref_dep_package) - dep_ref_dep_symlink = ctx.actions.declare_file(dep_ref_dep_symlink_path) - ctx.actions.symlink( - output = dep_ref_dep_symlink, - target_file = dep_ref_def_virtual_store_directory, - ) - direct_files.append(dep_ref_dep_symlink) + for dep_ref_dep_alias in dep_ref_dep_aliases: + # "node_modules/{virtual_store_root}/{virtual_store_name}/node_modules/{package}" + dep_ref_dep_symlink_path = paths.join("node_modules", utils.virtual_store_root, dep_virtual_store_name, "node_modules", dep_ref_dep_alias) + dep_ref_dep_symlink = ctx.actions.declare_file(dep_ref_dep_symlink_path) + ctx.actions.symlink( + output = dep_ref_dep_symlink, + target_file = dep_ref_def_virtual_store_directory, + ) + direct_files.append(dep_ref_dep_symlink) direct_files = depset(direct = direct_files) files_depsets = [direct_files] @@ -218,7 +269,7 @@ deps of npm_link_package_store must be in the same package.""" % (ctx.label.pack # inspect the package.json#typings field or search for .d.ts files in the package. declaration_info( declarations = direct_files, - deps = ctx.attr.deps, + deps = ctx.attr.deps.keys(), ), _StoreInfo( label = ctx.label, @@ -242,11 +293,13 @@ def _impl_direct(ctx): if not virtual_store_directory: fail("src must be a npm_link_package that provides a virtual_store_directory") + package = ctx.attr.package if ctx.attr.package else ctx.attr.src[_StoreInfo].package + # symlink the package's path in the virtual store to the root of the node_modules # as a direct dependency root_symlink = ctx.actions.declare_file( # "node_modules/{package}" - paths.join("node_modules", ctx.attr.src[_StoreInfo].package), + paths.join("node_modules", package), ) ctx.actions.symlink( output = root_symlink, @@ -293,83 +346,13 @@ npm_link_package_direct = rule( provides = npm_link_package_direct_lib.provides, ) -def _name_for_store(name): - """Strip the standard node_modules/ naming convention prefix off of the name used for the store""" - if name.startswith("node_modules/"): - return name[len("node_modules/"):] - else: - return name - -def npm_link_package_dep( - name, - version = None, - root_package = ""): - """Returns the label to the npm_link_package store for a package. - - This can be used to generate virtual store target names for the deps list - of a npm_link_package. - - Example root BUILD.file where the virtual store is linked by default, - - ``` - load("@npm//:defs.bzl", "npm_link_all_packages") - load("@aspect_rules_js//:defs.bzl", "npm_link_package") - - # Links all packages from the `npm_translate_lock(name = "npm", pnpm_lock = "//:pnpm-lock.yaml")` - # repository rule. - npm_link_all_packages(name = "node_modules") - - # Link a first party `@lib/foo` defined by the `npm_package` `//lib/foo:foo` target. - npm_link_package( - name = "node_modules/@lib/foo", - src = "//lib/foo", - ) - - # Link a first party `@lib/bar` defined by the `npm_package` `//lib/bar:bar` target - # that depends on `@lib/foo` and on `acorn` specified in `package.json` and fetched - # with `npm_translate_lock` - npm_link_package( - name = "link_lib_bar", - src = "//lib/bar", - deps = [ - npm_link_package_dep("node_modules/@lib/foo"), - npm_link_package_dep("acorn", version = "8.4.0"), - ], - ) - ``` - - Args: - name: The name of the link target. - For first-party packages, this must match the `name` passed to npm_link_package - for the package in the root package when not linking at the root package. - - For 3rd party deps fetched with an npm_import or via a npm_translate_lock repository rule, - the name must match the `package` attribute of the corresponding `npm_import`. This is typically - the npm package name. - version: The version of the package - This should be left unset for first-party packages linked manually with npm_link_package. - - For 3rd party deps fetched with an npm_import or via a npm_translate_lock repository rule, - the package version is required to qualify the dependency. It must the `version` attribute - of the corresponding `npm_import`. - root_package: The bazel package of the virtual store. - Defaults to the current package - - Returns: - The label of the direct link for the given package at the given link package, - """ - return Label("//{root_package}:{store_link_prefix}{bazel_name}".format( - bazel_name = utils.bazel_name(_name_for_store(name), version), - root_package = root_package, - store_link_prefix = utils.store_link_prefix, - )) - def npm_link_package( name, + version = "0.0.0", root_package = "", direct = True, src = None, - deps = [], + deps = {}, fail_if_no_link = True, auto_manual = True, visibility = ["//visibility:public"], @@ -385,9 +368,10 @@ def npm_link_package( the package directory for creating entry points or accessing files in the package. Args: - name: The name of the direct alias target to create if linked directly. + name: The name of the direct link target to create (if linked directly). For first-party deps linked across a workspace, the name must match in all packages being linked as it is used to derive the virtual store link target name. + version: version used to identify the package in the virtual store root_package: the root package where the node_modules virtual store is linked to direct: whether or not to link a direct dependency in this package For 3rd party deps fetched with an npm_import, direct may not be specified if @@ -423,10 +407,7 @@ def npm_link_package( msg = "src may only be specified when linking in the root package '{}'".format(root_package) fail(msg) - store_target_name = "{store_link_prefix}{bazel_name}".format( - bazel_name = utils.bazel_name(_name_for_store(name)), - store_link_prefix = utils.store_link_prefix, - ) + store_target_name = "{}/store/{}".format(name, version) tags = kwargs.pop("tags", []) if auto_manual and "manual" not in tags: @@ -448,9 +429,9 @@ def npm_link_package( # link as a direct dependency in node_modules of this package npm_link_package_direct( name = name, - src = "//{root_package}:{store_target}".format( + src = "//{root_package}:{store_target_name}".format( root_package = root_package, - store_target = store_target_name, + store_target_name = store_target_name, ), tags = tags, visibility = visibility, diff --git a/npm/private/npm_translate_lock.bzl b/npm/private/npm_translate_lock.bzl index 876d87f93..3a2419145 100644 --- a/npm/private/npm_translate_lock.bzl +++ b/npm/private/npm_translate_lock.bzl @@ -156,15 +156,16 @@ _NPM_IMPORT_TMPL = \ """ _BIN_TMPL = \ - """load("@{repo_name}//{repo_package_json_bzl}", _bin = "bin") + """load("@{repo_name}//{repo_package_json_bzl}", _bin = "bin", _bin_factory = "bin_factory") bin = _bin +bin_factory = _bin_factory """ _FP_STORE_TMPL = \ """ if is_root: _npm_link_package_store( - name = "{store_link_prefix}{bazel_name}", + name = "{{}}/{package}/store/0.0.0".format(name), src = "{npm_package_target}", package = "{package}", version = "0.0.0", @@ -180,7 +181,7 @@ _FP_DIRECT_TMPL = \ # terminal target for direct dependencies _npm_link_package_direct( name = "{{}}/{name}".format(name), - src = "//{root_package}:{store_link_prefix}{bazel_name}", + src = "//{root_package}:{{}}/{package}/store/0.0.0".format(name), visibility = ["//visibility:public"], tags = ["manual"], ) @@ -191,7 +192,7 @@ _FP_DIRECT_TMPL = \ native.filegroup( name = "{{}}/{name}/dir".format(name), srcs = [":{{}}/{name}".format(name)], - output_group = "{package_directory_output_group}", + output_group = utils.package_directory_output_group, visibility = ["//visibility:public"], tags = ["manual"], ) @@ -293,7 +294,7 @@ def _gen_npm_imports(lockfile, attr): if repo_name.startswith("aspect_rules_js.npm."): repo_name = repo_name[len("aspect_rules_js.npm."):] - link_packages = [] + link_packages = {} for import_path, importer in lockfile.get("importers").items(): dependencies = importer.get("dependencies") @@ -301,9 +302,18 @@ def _gen_npm_imports(lockfile, attr): fail("expected dict of dependencies in processed importer '%s'" % import_path) link_package = _link_package(root_package, import_path) for dep_package, dep_version in dependencies.items(): - if not dep_version.startswith("link:") and package == utils.pnpm_name(dep_package, dep_version): + if dep_version.startswith("link:"): + continue + if dep_version.startswith("/"): + pnpm_name = dep_version[1:] + else: + pnpm_name = utils.pnpm_name(dep_package, dep_version) + if package == pnpm_name: # this package is a direct dependency at this import path - link_packages.append(link_package) + if link_package not in link_packages: + link_packages[link_package] = [dep_package] + else: + link_packages[link_package].append(dep_package) run_lifecycle_hooks = ( requires_build and @@ -353,10 +363,11 @@ def _impl(rctx): importer_paths = importers.keys() - link_packages = [_link_package(root_package, import_path) for import_path in importer_paths] + direct_packages = [_link_package(root_package, import_path) for import_path in importer_paths] defs_bzl_header = generated_by_lines + ["""# buildifier: disable=bzl-visibility -load("@aspect_rules_js//npm/private:npm_linked_packages.bzl", "npm_linked_packages")"""] +load("@aspect_rules_js//npm/private:npm_linked_packages.bzl", "npm_linked_packages") +load("@aspect_rules_js//npm/private:utils.bzl", _utils = "utils")"""] npm_imports = _gen_npm_imports(lockfile, rctx.attr) @@ -374,27 +385,44 @@ load("@aspect_rules_js//npm/private:npm_linked_packages.bzl", "npm_linked_packag dep_path = _link_package(root_package, import_path, dep_version[len("link:"):]) dep_key = "{}+{}".format(dep_package, dep_path) if dep_key in fp_links.keys(): - fp_links[dep_key]["link_packages"].append(link_package) + fp_links[dep_key]["link_packages"][link_package] = [] else: - transitive_deps = [] + transitive_deps = {} raw_deps = {} if dep_importer in importers.keys(): raw_deps = importers.get(dep_importer).get("dependencies") for raw_package, raw_version in raw_deps.items(): if raw_version.startswith("link:"): - raw_path = _link_package(root_package, dep_importer, raw_version[len("link:"):]) - raw_bazel_name = utils.bazel_name(raw_package, raw_path) + dep_store_target = """"//{root_package}:{{}}/{package}/store/{version}".format(name)""".format( + root_package = root_package, + package = raw_package, + version = "0.0.0", + ) + elif raw_version.startswith("/"): + store_package, store_version = utils.parse_pnpm_name(raw_version[1:]) + dep_store_target = """"//{root_package}:{{}}/{package}/store/{version}".format(name)""".format( + root_package = root_package, + package = store_package, + version = store_version, + ) + else: + dep_store_target = """"//{root_package}:{{}}/{package}/store/{version}".format(name)""".format( + root_package = root_package, + package = raw_package, + version = raw_version, + ) + if dep_store_target not in transitive_deps: + transitive_deps[dep_store_target] = [raw_package] else: - raw_bazel_name = utils.bazel_name(raw_package, raw_version) - transitive_deps.append("//{root_package}:{store_link_prefix}{bazel_name}".format( - bazel_name = raw_bazel_name, - root_package = root_package, - store_link_prefix = utils.store_link_prefix, - )) + transitive_deps[dep_store_target].append(raw_package) + + # collapse link aliases lists into to acomma separated strings + for dep_store_target in transitive_deps.keys(): + transitive_deps[dep_store_target] = ",".join(transitive_deps[dep_store_target]) fp_links[dep_key] = { "package": dep_package, "path": dep_path, - "link_packages": [link_package], + "link_packages": {link_package: []}, "deps": transitive_deps, } @@ -404,47 +432,57 @@ load("@aspect_rules_js//npm/private:npm_linked_packages.bzl", "npm_linked_packag _npm_link_package_direct = "npm_link_package_direct")""") defs_bzl_body = [ - """def npm_link_all_packages(name = "node_modules"): + """def npm_link_all_packages(name = "node_modules", imported_links = []): \"\"\"Generated list of npm_link_package() target generators and first-party linked packages corresponding to the packages in @{pnpm_lock_wksp}{pnpm_lock} Args: name: name of catch all target to generate for all packages linked + imported_links: optional list link functions from manually imported packages + that were fetched with npm_import rules, + + 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, + ], + )``` \"\"\" + + # @unused + utils = _utils root_package = "{root_package}" - link_packages = {link_packages} + direct_packages = {direct_packages} is_root = native.package_name() == root_package - is_direct = native.package_name() in link_packages + is_direct = native.package_name() in direct_packages if not is_root and not is_direct: - msg = "The npm_link_all_packages() macro loaded from {defs_bzl_file} and called in bazel package '%s' may only be called in the bazel package(s) corresponding to the root package '{root_package}' and packages [{link_packages_comma_separated}]" % native.package_name() + msg = "The npm_link_all_packages() macro loaded from {defs_bzl_file} and called in bazel package '%s' may only be called in the bazel package(s) corresponding to the root package '{root_package}' and packages [{direct_packages_comma_separated}]" % native.package_name() fail(msg) direct_targets = [] scoped_direct_targets = {{}} + + for link_fn in imported_links: + new_direct_targets, new_scoped_targets = link_fn(name) + direct_targets.extend(new_direct_targets) + for _scope, _targets in new_scoped_targets.items(): + scoped_direct_targets[_scope] = scoped_direct_targets[_scope] + _targets if _scope in scoped_direct_targets else _targets """.format( pnpm_lock_wksp = str(rctx.attr.pnpm_lock.workspace_name), pnpm_lock = str(rctx.attr.pnpm_lock), root_package = root_package, - link_packages = str(link_packages), - link_packages_comma_separated = "'" + "', '".join(link_packages) + "'" if len(link_packages) else "", + direct_packages = str(direct_packages), + direct_packages_comma_separated = "'" + "', '".join(direct_packages) + "'" if len(direct_packages) else "", defs_bzl_file = "@{}//:{}".format(rctx.name, _DEFS_BZL_FILENAME), ), ] - # Gather list of all scopes across third-party and first-party deps - package_scopes = [] - for _import in npm_imports: - if len(_import.package.split("/", 1)) > 1: - package_scope = _import.package.split("/", 1)[0] - if package_scope not in package_scopes: - package_scopes.append(package_scope) - for fp_link in fp_links.values(): - fp_package = fp_link.get("package") - if len(fp_package.split("/", 1)) > 1: - package_scope = fp_package.split("/", 1)[0] - if package_scope not in package_scopes: - package_scopes.append(package_scope) - for package_scope in package_scopes: - defs_bzl_body.append(""" scoped_direct_targets["{}"] = []""".format(package_scope)) - + root_links_bzl = [] + direct_links_bzl = {} for (i, _import) in enumerate(npm_imports): maybe_integrity = """ integrity = "%s",""" % _import.integrity if _import.integrity else "" @@ -464,7 +502,7 @@ load("@aspect_rules_js//npm/private:npm_linked_packages.bzl", "npm_linked_packag run_lifecycle_hooks = True,""") if _import.run_lifecycle_hooks else "" repositories_bzl.append(_NPM_IMPORT_TMPL.format( - link_packages = _import.link_packages, + link_packages = starlark_codegen_utils.to_dict_attr(_import.link_packages, 2, quote_value = False), link_workspace = rctx.attr.pnpm_lock.workspace_name, maybe_custom_postinstall = maybe_custom_postinstall, maybe_deps = maybe_deps, @@ -480,24 +518,43 @@ load("@aspect_rules_js//npm/private:npm_linked_packages.bzl", "npm_linked_packag version = _import.version, )) - defs_bzl_header.append( - """load("@{repo_name}{links_suffix}//:defs.bzl", link_{i} = "npm_link_package")""".format( - i = i, - repo_name = _import.name, - links_suffix = utils.links_suffix, - ), - ) - defs_bzl_body.append(""" direct_targets.append(link_{i}(name = "{{}}/{name}".format(name), direct = None, fail_if_no_link = False))""".format( + if _import.link_packages: + defs_bzl_header.append( + """load("@{repo_name}{links_repo_suffix}//:defs.bzl", link_{i}_direct = "npm_link_imported_package_direct", link_{i}_store = "npm_link_imported_package_store")""".format( + i = i, + repo_name = _import.name, + links_repo_suffix = utils.links_repo_suffix, + ), + ) + else: + defs_bzl_header.append( + """load("@{repo_name}{links_repo_suffix}//:defs.bzl", link_{i}_store = "npm_link_imported_package_store")""".format( + i = i, + repo_name = _import.name, + links_repo_suffix = utils.links_repo_suffix, + ), + ) + + root_links_bzl.append(""" link_{i}_store(name = "{{}}/{name}".format(name))""".format( i = i, name = _import.package, )) - if len(_import.package.split("/", 1)) > 1: - package_scope = _import.package.split("/", 1)[0] - defs_bzl_body.append(""" scoped_direct_targets["{package_scope}"].append(direct_targets[-1])""".format( - package_scope = package_scope, - )) - - for link_package in _import.link_packages: + for link_package, _link_aliases in _import.link_packages.items(): + link_aliases = _link_aliases or [_import.package] + for link_alias in link_aliases: + if link_package not in direct_links_bzl: + direct_links_bzl[link_package] = [] + direct_links_bzl[link_package].append(""" direct_targets.append(link_{i}_direct(name = "{{}}/{name}".format(name)))""".format( + i = i, + name = link_alias, + )) + if len(link_alias.split("/", 1)) > 1: + package_scope = link_alias.split("/", 1)[0] + direct_links_bzl[link_package].append(""" scoped_direct_targets["{package_scope}"] = scoped_direct_targets["{package_scope}"] + [direct_targets[-1]] if "{package_scope}" in scoped_direct_targets else [direct_targets[-1]]""".format( + package_scope = package_scope, + )) + + for link_package in _import.link_packages.keys(): # Generate a package_json.bzl file for the bin entries (even if there are none) # Note, there's no has_bin attribute on npm_import so we can't get the boolean # value from the _import struct. @@ -514,11 +571,18 @@ load("@aspect_rules_js//npm/private:npm_linked_packages.bzl", "npm_linked_packag rctx.file(package_json_bzl_file_path, "\n".join([ _BIN_TMPL.format( repo_package_json_bzl = repo_package_json_bzl, - name = _import.package, repo_name = _import.name, ), ])) + defs_bzl_body.append(""" if is_root:""") + defs_bzl_body.extend(root_links_bzl) + + defs_bzl_body.append(""" if is_direct:""") + for link_package, bzl in direct_links_bzl.items(): + defs_bzl_body.append(""" if native.package_name() == "{}":""".format(link_package)) + defs_bzl_body.extend(bzl) + for fp_link in fp_links.values(): fp_package = fp_link.get("package") fp_path = fp_link.get("path") @@ -529,44 +593,38 @@ load("@aspect_rules_js//npm/private:npm_linked_packages.bzl", "npm_linked_packag defs_bzl_body.append(_FP_STORE_TMPL.format( bazel_name = fp_bazel_name, - deps = starlark_codegen_utils.to_list_attr(fp_deps, 3), + deps = starlark_codegen_utils.to_dict_attr(fp_deps, 3, quote_key = False), npm_package_target = fp_target, package = fp_package, - store_link_prefix = utils.store_link_prefix, )) defs_bzl_body.append(_FP_DIRECT_TMPL.format( bazel_name = fp_bazel_name, name = fp_package, - dir_suffix = utils.dir_suffix, - link_packages = fp_link_packages, + link_packages = fp_link_packages.keys(), package = fp_package, - package_directory_output_group = utils.package_directory_output_group, root_package = root_package, - store_link_prefix = utils.store_link_prefix, )) if len(fp_package.split("/", 1)) > 1: package_scope = fp_package.split("/", 1)[0] - defs_bzl_body.append(""" scoped_direct_targets["{package_scope}"].append(direct_targets[-1])""".format( + defs_bzl_body.append(""" scoped_direct_targets["{package_scope}"] = scoped_direct_targets["{package_scope}"] + [direct_targets[-1]] if "{package_scope}" in scoped_direct_targets else [direct_targets[-1]]""".format( package_scope = package_scope, )) # Generate catch all & scoped npm_linked_packages target defs_bzl_body.append(""" for scope, scoped_targets in scoped_direct_targets.items(): - direct_scoped_targets = [t for t in scoped_targets if t] - if direct_scoped_targets: - npm_linked_packages( - name = "{}/{}".format(name, scope), - srcs = direct_scoped_targets, - tags = ["manual"], - visibility = ["//visibility:public"], - ) + npm_linked_packages( + name = "{}/{}".format(name, scope), + srcs = scoped_targets, + tags = ["manual"], + visibility = ["//visibility:public"], + ) npm_linked_packages( name = name, - srcs = [t for t in direct_targets if t], + srcs = direct_targets, tags = ["manual"], visibility = ["//visibility:public"], )""") diff --git a/npm/private/test/BUILD.bazel b/npm/private/test/BUILD.bazel index 328587df7..62cc999df 100644 --- a/npm/private/test/BUILD.bazel +++ b/npm/private/test/BUILD.bazel @@ -28,9 +28,11 @@ write_source_files( filegroup( name = "build_some_node_modules", srcs = [ + "node_modules/@plotly/regl", "node_modules/bufferutil", "node_modules/debug", "node_modules/esbuild", + "node_modules/regl", "node_modules/webpack-bundle-analyzer", # intentionally don't include node_modules/unused ], diff --git a/npm/private/test/defs_checked.bzl b/npm/private/test/defs_checked.bzl index 43230ed21..42d1cc5c1 100755 --- a/npm/private/test/defs_checked.bzl +++ b/npm/private/test/defs_checked.bzl @@ -2,408 +2,450 @@ # buildifier: disable=bzl-visibility load("@aspect_rules_js//npm/private:npm_linked_packages.bzl", "npm_linked_packages") -load("@npm__at_aspect-test_a__5.0.0__links//:defs.bzl", link_0 = "npm_link_package") -load("@npm__at_aspect-test_b__5.0.0__links//:defs.bzl", link_1 = "npm_link_package") -load("@npm__at_aspect-test_c__1.0.0__links//:defs.bzl", link_2 = "npm_link_package") -load("@npm__at_aspect-test_c__2.0.0__links//:defs.bzl", link_3 = "npm_link_package") -load("@npm__at_aspect-test_d__2.0.0__at_aspect-test_c_1.0.0__links//:defs.bzl", link_4 = "npm_link_package") -load("@npm__at_aspect-test_d__2.0.0__at_aspect-test_c_2.0.0__links//:defs.bzl", link_5 = "npm_link_package") -load("@npm__at_gregmagolan_test-a__0.0.1__links//:defs.bzl", link_6 = "npm_link_package") -load("@npm__at_gregmagolan_test-b__0.0.2__links//:defs.bzl", link_7 = "npm_link_package") -load("@npm__at_polka_url__1.0.0-next.21__links//:defs.bzl", link_8 = "npm_link_package") -load("@npm__at_rollup_plugin-commonjs__21.1.0__rollup_2.70.2__links//:defs.bzl", link_9 = "npm_link_package") -load("@npm__at_rollup_pluginutils__3.1.0__rollup_2.70.2__links//:defs.bzl", link_10 = "npm_link_package") -load("@npm__at_types_estree__0.0.39__links//:defs.bzl", link_11 = "npm_link_package") -load("@npm__at_types_estree__0.0.51__links//:defs.bzl", link_12 = "npm_link_package") -load("@npm__at_types_node__16.11.36__links//:defs.bzl", link_13 = "npm_link_package") -load("@npm__at_ungap_promise-all-settled__1.1.2__links//:defs.bzl", link_14 = "npm_link_package") -load("@npm__acorn-walk__8.2.0__links//:defs.bzl", link_15 = "npm_link_package") -load("@npm__acorn__8.7.1__links//:defs.bzl", link_16 = "npm_link_package") -load("@npm__ansi-colors__4.1.1__links//:defs.bzl", link_17 = "npm_link_package") -load("@npm__ansi-regex__5.0.1__links//:defs.bzl", link_18 = "npm_link_package") -load("@npm__ansi-styles__4.3.0__links//:defs.bzl", link_19 = "npm_link_package") -load("@npm__anymatch__3.1.2__links//:defs.bzl", link_20 = "npm_link_package") -load("@npm__argparse__2.0.1__links//:defs.bzl", link_21 = "npm_link_package") -load("@npm__balanced-match__1.0.2__links//:defs.bzl", link_22 = "npm_link_package") -load("@npm__binary-extensions__2.2.0__links//:defs.bzl", link_23 = "npm_link_package") -load("@npm__brace-expansion__1.1.11__links//:defs.bzl", link_24 = "npm_link_package") -load("@npm__brace-expansion__2.0.1__links//:defs.bzl", link_25 = "npm_link_package") -load("@npm__braces__3.0.2__links//:defs.bzl", link_26 = "npm_link_package") -load("@npm__browser-stdout__1.3.1__links//:defs.bzl", link_27 = "npm_link_package") -load("@npm__bufferutil__4.0.1__links//:defs.bzl", link_28 = "npm_link_package") -load("@npm__camelcase__6.3.0__links//:defs.bzl", link_29 = "npm_link_package") -load("@npm__chalk__4.1.2__links//:defs.bzl", link_30 = "npm_link_package") -load("@npm__charenc__0.0.2__links//:defs.bzl", link_31 = "npm_link_package") -load("@npm__chokidar__3.5.3__links//:defs.bzl", link_32 = "npm_link_package") -load("@npm__cliui__7.0.4__links//:defs.bzl", link_33 = "npm_link_package") -load("@npm__color-convert__2.0.1__links//:defs.bzl", link_34 = "npm_link_package") -load("@npm__color-name__1.1.4__links//:defs.bzl", link_35 = "npm_link_package") -load("@npm__commander__7.2.0__links//:defs.bzl", link_36 = "npm_link_package") -load("@npm__commondir__1.0.1__links//:defs.bzl", link_37 = "npm_link_package") -load("@npm__concat-map__0.0.1__links//:defs.bzl", link_38 = "npm_link_package") -load("@npm__crypt__0.0.2__links//:defs.bzl", link_39 = "npm_link_package") -load("@npm__debug__2.6.9__links//:defs.bzl", link_40 = "npm_link_package") -load("@npm__debug__4.3.4__links//:defs.bzl", link_41 = "npm_link_package") -load("@npm__debug__4.3.4__supports-color_8.1.1__links//:defs.bzl", link_42 = "npm_link_package") -load("@npm__decamelize__4.0.0__links//:defs.bzl", link_43 = "npm_link_package") -load("@npm__dequal__2.0.2__links//:defs.bzl", link_44 = "npm_link_package") -load("@npm__diff__5.0.0__links//:defs.bzl", link_45 = "npm_link_package") -load("@npm__diff__5.1.0__links//:defs.bzl", link_46 = "npm_link_package") -load("@npm__duplexer__0.1.2__links//:defs.bzl", link_47 = "npm_link_package") -load("@npm__emoji-regex__8.0.0__links//:defs.bzl", link_48 = "npm_link_package") -load("@npm__esbuild-android-64__0.14.38__links//:defs.bzl", link_49 = "npm_link_package") -load("@npm__esbuild-android-arm64__0.14.38__links//:defs.bzl", link_50 = "npm_link_package") -load("@npm__esbuild-darwin-64__0.14.38__links//:defs.bzl", link_51 = "npm_link_package") -load("@npm__esbuild-darwin-arm64__0.14.38__links//:defs.bzl", link_52 = "npm_link_package") -load("@npm__esbuild-freebsd-64__0.14.38__links//:defs.bzl", link_53 = "npm_link_package") -load("@npm__esbuild-freebsd-arm64__0.14.38__links//:defs.bzl", link_54 = "npm_link_package") -load("@npm__esbuild-linux-32__0.14.38__links//:defs.bzl", link_55 = "npm_link_package") -load("@npm__esbuild-linux-64__0.14.38__links//:defs.bzl", link_56 = "npm_link_package") -load("@npm__esbuild-linux-arm__0.14.38__links//:defs.bzl", link_57 = "npm_link_package") -load("@npm__esbuild-linux-arm64__0.14.38__links//:defs.bzl", link_58 = "npm_link_package") -load("@npm__esbuild-linux-mips64le__0.14.38__links//:defs.bzl", link_59 = "npm_link_package") -load("@npm__esbuild-linux-ppc64le__0.14.38__links//:defs.bzl", link_60 = "npm_link_package") -load("@npm__esbuild-linux-riscv64__0.14.38__links//:defs.bzl", link_61 = "npm_link_package") -load("@npm__esbuild-linux-s390x__0.14.38__links//:defs.bzl", link_62 = "npm_link_package") -load("@npm__esbuild-netbsd-64__0.14.38__links//:defs.bzl", link_63 = "npm_link_package") -load("@npm__esbuild-openbsd-64__0.14.38__links//:defs.bzl", link_64 = "npm_link_package") -load("@npm__esbuild-sunos-64__0.14.38__links//:defs.bzl", link_65 = "npm_link_package") -load("@npm__esbuild-windows-32__0.14.38__links//:defs.bzl", link_66 = "npm_link_package") -load("@npm__esbuild-windows-64__0.14.38__links//:defs.bzl", link_67 = "npm_link_package") -load("@npm__esbuild-windows-arm64__0.14.38__links//:defs.bzl", link_68 = "npm_link_package") -load("@npm__esbuild__0.14.38__links//:defs.bzl", link_69 = "npm_link_package") -load("@npm__escalade__3.1.1__links//:defs.bzl", link_70 = "npm_link_package") -load("@npm__escape-string-regexp__4.0.0__links//:defs.bzl", link_71 = "npm_link_package") -load("@npm__esprima__1.0.0__links//:defs.bzl", link_72 = "npm_link_package") -load("@npm__estree-walker__1.0.1__links//:defs.bzl", link_73 = "npm_link_package") -load("@npm__estree-walker__2.0.2__links//:defs.bzl", link_74 = "npm_link_package") -load("@npm__fill-range__7.0.1__links//:defs.bzl", link_75 = "npm_link_package") -load("@npm__find-up__5.0.0__links//:defs.bzl", link_76 = "npm_link_package") -load("@npm__flat__5.0.2__links//:defs.bzl", link_77 = "npm_link_package") -load("@npm__fs.realpath__1.0.0__links//:defs.bzl", link_78 = "npm_link_package") -load("@npm__fsevents__2.3.2__links//:defs.bzl", link_79 = "npm_link_package") -load("@npm__function-bind__1.1.1__links//:defs.bzl", link_80 = "npm_link_package") -load("@npm__get-caller-file__2.0.5__links//:defs.bzl", link_81 = "npm_link_package") -load("@npm__glob-parent__5.1.2__links//:defs.bzl", link_82 = "npm_link_package") -load("@npm__glob__7.2.0__links//:defs.bzl", link_83 = "npm_link_package") -load("@npm__glob__7.2.3__links//:defs.bzl", link_84 = "npm_link_package") -load("@npm__gzip-size__6.0.0__links//:defs.bzl", link_85 = "npm_link_package") -load("@npm__has-flag__4.0.0__links//:defs.bzl", link_86 = "npm_link_package") -load("@npm__has__1.0.3__links//:defs.bzl", link_87 = "npm_link_package") -load("@npm__he__1.2.0__links//:defs.bzl", link_88 = "npm_link_package") -load("@npm__inflight__1.0.6__links//:defs.bzl", link_89 = "npm_link_package") -load("@npm__inherits__2.0.4__links//:defs.bzl", link_90 = "npm_link_package") -load("@npm__is-binary-path__2.1.0__links//:defs.bzl", link_91 = "npm_link_package") -load("@npm__is-buffer__1.1.6__links//:defs.bzl", link_92 = "npm_link_package") -load("@npm__is-core-module__2.9.0__links//:defs.bzl", link_93 = "npm_link_package") -load("@npm__is-extglob__2.1.1__links//:defs.bzl", link_94 = "npm_link_package") -load("@npm__is-fullwidth-code-point__3.0.0__links//:defs.bzl", link_95 = "npm_link_package") -load("@npm__is-glob__4.0.3__links//:defs.bzl", link_96 = "npm_link_package") -load("@npm__is-number__7.0.0__links//:defs.bzl", link_97 = "npm_link_package") -load("@npm__is-plain-obj__2.1.0__links//:defs.bzl", link_98 = "npm_link_package") -load("@npm__is-reference__1.2.1__links//:defs.bzl", link_99 = "npm_link_package") -load("@npm__is-unicode-supported__0.1.0__links//:defs.bzl", link_100 = "npm_link_package") -load("@npm__js-tokens__4.0.0__links//:defs.bzl", link_101 = "npm_link_package") -load("@npm__js-yaml__4.1.0__links//:defs.bzl", link_102 = "npm_link_package") -load("@npm__kleur__4.1.4__links//:defs.bzl", link_103 = "npm_link_package") -load("@npm__locate-path__6.0.0__links//:defs.bzl", link_104 = "npm_link_package") -load("@npm__lodash__4.17.21__links//:defs.bzl", link_105 = "npm_link_package") -load("@npm__log-symbols__4.1.0__links//:defs.bzl", link_106 = "npm_link_package") -load("@npm__loose-envify__1.4.0__links//:defs.bzl", link_107 = "npm_link_package") -load("@npm__magic-string__0.25.9__links//:defs.bzl", link_108 = "npm_link_package") -load("@npm__md5__2.3.0__links//:defs.bzl", link_109 = "npm_link_package") -load("@npm__minimatch__3.1.2__links//:defs.bzl", link_110 = "npm_link_package") -load("@npm__minimatch__5.0.1__links//:defs.bzl", link_111 = "npm_link_package") -load("@npm__minimist__0.0.10__links//:defs.bzl", link_112 = "npm_link_package") -load("@npm__minimist__1.2.6__links//:defs.bzl", link_113 = "npm_link_package") -load("@npm__mkdirp__0.5.6__links//:defs.bzl", link_114 = "npm_link_package") -load("@npm__mobx-react-lite__3.4.0__mobx_6.3.0_react_17.0.2__links//:defs.bzl", link_115 = "npm_link_package") -load("@npm__mobx-react__7.3.0__mobx_6.3.0_react_17.0.2__links//:defs.bzl", link_116 = "npm_link_package") -load("@npm__mobx__6.3.0__links//:defs.bzl", link_117 = "npm_link_package") -load("@npm__mocha-junit-reporter__2.0.2__mocha_10.0.0__links//:defs.bzl", link_118 = "npm_link_package") -load("@npm__mocha-multi-reporters__1.5.1__mocha_10.0.0__links//:defs.bzl", link_119 = "npm_link_package") -load("@npm__mocha__10.0.0__th2rfume6p4m5jxelm27wrhnly__links//:defs.bzl", link_120 = "npm_link_package") -load("@npm__mri__1.2.0__links//:defs.bzl", link_121 = "npm_link_package") -load("@npm__mrmime__1.0.0__links//:defs.bzl", link_122 = "npm_link_package") -load("@npm__ms__0.7.3__links//:defs.bzl", link_123 = "npm_link_package") -load("@npm__ms__2.0.0__links//:defs.bzl", link_124 = "npm_link_package") -load("@npm__ms__2.1.2__links//:defs.bzl", link_125 = "npm_link_package") -load("@npm__ms__2.1.3__links//:defs.bzl", link_126 = "npm_link_package") -load("@npm__nanoid__3.3.3__links//:defs.bzl", link_127 = "npm_link_package") -load("@npm__node-gyp-build__3.7.0__links//:defs.bzl", link_128 = "npm_link_package") -load("@npm__normalize-path__3.0.0__links//:defs.bzl", link_129 = "npm_link_package") -load("@npm__object-assign__4.1.1__links//:defs.bzl", link_130 = "npm_link_package") -load("@npm__once__1.4.0__links//:defs.bzl", link_131 = "npm_link_package") -load("@npm__opener__1.5.2__links//:defs.bzl", link_132 = "npm_link_package") -load("@npm__optimist__0.6.0__links//:defs.bzl", link_133 = "npm_link_package") -load("@npm__p-limit__3.1.0__links//:defs.bzl", link_134 = "npm_link_package") -load("@npm__p-locate__5.0.0__links//:defs.bzl", link_135 = "npm_link_package") -load("@npm__path-exists__4.0.0__links//:defs.bzl", link_136 = "npm_link_package") -load("@npm__path-is-absolute__1.0.1__links//:defs.bzl", link_137 = "npm_link_package") -load("@npm__path-parse__1.0.7__links//:defs.bzl", link_138 = "npm_link_package") -load("@npm__picomatch__2.3.1__links//:defs.bzl", link_139 = "npm_link_package") -load("@npm__randombytes__2.1.0__links//:defs.bzl", link_140 = "npm_link_package") -load("@npm__react__17.0.2__links//:defs.bzl", link_141 = "npm_link_package") -load("@npm__readdirp__3.6.0__links//:defs.bzl", link_142 = "npm_link_package") -load("@npm__require-directory__2.1.1__links//:defs.bzl", link_143 = "npm_link_package") -load("@npm__resolve__1.22.0__links//:defs.bzl", link_144 = "npm_link_package") -load("@npm__rollup__2.70.2__links//:defs.bzl", link_145 = "npm_link_package") -load("@npm__sade__1.8.1__links//:defs.bzl", link_146 = "npm_link_package") -load("@npm__safe-buffer__5.2.1__links//:defs.bzl", link_147 = "npm_link_package") -load("@npm__serialize-javascript__6.0.0__links//:defs.bzl", link_148 = "npm_link_package") -load("@npm__sirv__1.0.19__links//:defs.bzl", link_149 = "npm_link_package") -load("@npm__sourcemap-codec__1.4.8__links//:defs.bzl", link_150 = "npm_link_package") -load("@npm__string-width__4.2.3__links//:defs.bzl", link_151 = "npm_link_package") -load("@npm__strip-ansi__6.0.1__links//:defs.bzl", link_152 = "npm_link_package") -load("@npm__strip-json-comments__3.1.1__links//:defs.bzl", link_153 = "npm_link_package") -load("@npm__supports-color__7.2.0__links//:defs.bzl", link_154 = "npm_link_package") -load("@npm__supports-color__8.1.1__links//:defs.bzl", link_155 = "npm_link_package") -load("@npm__supports-preserve-symlinks-flag__1.0.0__links//:defs.bzl", link_156 = "npm_link_package") -load("@npm__to-regex-range__5.0.1__links//:defs.bzl", link_157 = "npm_link_package") -load("@npm__totalist__1.1.0__links//:defs.bzl", link_158 = "npm_link_package") -load("@npm__typescript__4.7.2__links//:defs.bzl", link_159 = "npm_link_package") -load("@npm__unused__0.2.2__links//:defs.bzl", link_160 = "npm_link_package") -load("@npm__uvu__0.5.3__links//:defs.bzl", link_161 = "npm_link_package") -load("@npm__webpack-bundle-analyzer__4.5.0__bufferutil_4.0.1__links//:defs.bzl", link_162 = "npm_link_package") -load("@npm__wordwrap__0.0.3__links//:defs.bzl", link_163 = "npm_link_package") -load("@npm__workerpool__6.2.1__links//:defs.bzl", link_164 = "npm_link_package") -load("@npm__wrap-ansi__7.0.0__links//:defs.bzl", link_165 = "npm_link_package") -load("@npm__wrappy__1.0.2__links//:defs.bzl", link_166 = "npm_link_package") -load("@npm__ws__7.5.8__bufferutil_4.0.1__links//:defs.bzl", link_167 = "npm_link_package") -load("@npm__xml__1.0.1__links//:defs.bzl", link_168 = "npm_link_package") -load("@npm__y18n__5.0.8__links//:defs.bzl", link_169 = "npm_link_package") -load("@npm__yargs-parser__20.2.4__links//:defs.bzl", link_170 = "npm_link_package") -load("@npm__yargs-unparser__2.0.0__links//:defs.bzl", link_171 = "npm_link_package") -load("@npm__yargs__16.2.0__links//:defs.bzl", link_172 = "npm_link_package") -load("@npm__yocto-queue__0.1.0__links//:defs.bzl", link_173 = "npm_link_package") -load("@npm__debug__github.com_ngokevin_debug_9742c5f383a6f8046241920156236ade8ec30d53__links//:defs.bzl", link_174 = "npm_link_package") +load("@aspect_rules_js//npm/private:utils.bzl", _utils = "utils") +load("@npm__at_aspect-test_a__5.0.0__links//:defs.bzl", link_0_direct = "npm_link_imported_package_direct", link_0_store = "npm_link_imported_package_store") +load("@npm__at_aspect-test_b__5.0.0__links//:defs.bzl", link_1_store = "npm_link_imported_package_store") +load("@npm__at_aspect-test_c__1.0.0__links//:defs.bzl", link_2_store = "npm_link_imported_package_store") +load("@npm__at_aspect-test_c__2.0.0__links//:defs.bzl", link_3_direct = "npm_link_imported_package_direct", link_3_store = "npm_link_imported_package_store") +load("@npm__at_aspect-test_d__2.0.0__at_aspect-test_c_1.0.0__links//:defs.bzl", link_4_store = "npm_link_imported_package_store") +load("@npm__at_aspect-test_d__2.0.0__at_aspect-test_c_2.0.0__links//:defs.bzl", link_5_store = "npm_link_imported_package_store") +load("@npm__at_gregmagolan_test-a__0.0.1__links//:defs.bzl", link_6_store = "npm_link_imported_package_store") +load("@npm__at_gregmagolan_test-b__0.0.2__links//:defs.bzl", link_7_direct = "npm_link_imported_package_direct", link_7_store = "npm_link_imported_package_store") +load("@npm__at_plotly_regl__2.1.2__links//:defs.bzl", link_8_direct = "npm_link_imported_package_direct", link_8_store = "npm_link_imported_package_store") +load("@npm__at_polka_url__1.0.0-next.21__links//:defs.bzl", link_9_store = "npm_link_imported_package_store") +load("@npm__at_rollup_plugin-commonjs__21.1.0__rollup_2.70.2__links//:defs.bzl", link_10_direct = "npm_link_imported_package_direct", link_10_store = "npm_link_imported_package_store") +load("@npm__at_rollup_pluginutils__3.1.0__rollup_2.70.2__links//:defs.bzl", link_11_store = "npm_link_imported_package_store") +load("@npm__at_types_estree__0.0.39__links//:defs.bzl", link_12_store = "npm_link_imported_package_store") +load("@npm__at_types_estree__0.0.51__links//:defs.bzl", link_13_store = "npm_link_imported_package_store") +load("@npm__at_types_node__16.11.36__links//:defs.bzl", link_14_direct = "npm_link_imported_package_direct", link_14_store = "npm_link_imported_package_store") +load("@npm__at_ungap_promise-all-settled__1.1.2__links//:defs.bzl", link_15_store = "npm_link_imported_package_store") +load("@npm__acorn-walk__8.2.0__links//:defs.bzl", link_16_store = "npm_link_imported_package_store") +load("@npm__acorn__8.7.1__links//:defs.bzl", link_17_direct = "npm_link_imported_package_direct", link_17_store = "npm_link_imported_package_store") +load("@npm__ansi-colors__4.1.1__links//:defs.bzl", link_18_store = "npm_link_imported_package_store") +load("@npm__ansi-regex__5.0.1__links//:defs.bzl", link_19_store = "npm_link_imported_package_store") +load("@npm__ansi-styles__4.3.0__links//:defs.bzl", link_20_store = "npm_link_imported_package_store") +load("@npm__anymatch__3.1.2__links//:defs.bzl", link_21_store = "npm_link_imported_package_store") +load("@npm__argparse__2.0.1__links//:defs.bzl", link_22_store = "npm_link_imported_package_store") +load("@npm__balanced-match__1.0.2__links//:defs.bzl", link_23_store = "npm_link_imported_package_store") +load("@npm__binary-extensions__2.2.0__links//:defs.bzl", link_24_store = "npm_link_imported_package_store") +load("@npm__brace-expansion__1.1.11__links//:defs.bzl", link_25_store = "npm_link_imported_package_store") +load("@npm__brace-expansion__2.0.1__links//:defs.bzl", link_26_store = "npm_link_imported_package_store") +load("@npm__braces__3.0.2__links//:defs.bzl", link_27_store = "npm_link_imported_package_store") +load("@npm__browser-stdout__1.3.1__links//:defs.bzl", link_28_store = "npm_link_imported_package_store") +load("@npm__bufferutil__4.0.1__links//:defs.bzl", link_29_direct = "npm_link_imported_package_direct", link_29_store = "npm_link_imported_package_store") +load("@npm__camelcase__6.3.0__links//:defs.bzl", link_30_store = "npm_link_imported_package_store") +load("@npm__chalk__4.1.2__links//:defs.bzl", link_31_store = "npm_link_imported_package_store") +load("@npm__charenc__0.0.2__links//:defs.bzl", link_32_store = "npm_link_imported_package_store") +load("@npm__chokidar__3.5.3__links//:defs.bzl", link_33_store = "npm_link_imported_package_store") +load("@npm__cliui__7.0.4__links//:defs.bzl", link_34_store = "npm_link_imported_package_store") +load("@npm__color-convert__2.0.1__links//:defs.bzl", link_35_store = "npm_link_imported_package_store") +load("@npm__color-name__1.1.4__links//:defs.bzl", link_36_store = "npm_link_imported_package_store") +load("@npm__commander__7.2.0__links//:defs.bzl", link_37_store = "npm_link_imported_package_store") +load("@npm__commondir__1.0.1__links//:defs.bzl", link_38_store = "npm_link_imported_package_store") +load("@npm__concat-map__0.0.1__links//:defs.bzl", link_39_store = "npm_link_imported_package_store") +load("@npm__crypt__0.0.2__links//:defs.bzl", link_40_store = "npm_link_imported_package_store") +load("@npm__debug__2.6.9__links//:defs.bzl", link_41_store = "npm_link_imported_package_store") +load("@npm__debug__4.3.4__links//:defs.bzl", link_42_store = "npm_link_imported_package_store") +load("@npm__debug__4.3.4__supports-color_8.1.1__links//:defs.bzl", link_43_store = "npm_link_imported_package_store") +load("@npm__decamelize__4.0.0__links//:defs.bzl", link_44_store = "npm_link_imported_package_store") +load("@npm__dequal__2.0.2__links//:defs.bzl", link_45_store = "npm_link_imported_package_store") +load("@npm__diff__5.0.0__links//:defs.bzl", link_46_store = "npm_link_imported_package_store") +load("@npm__diff__5.1.0__links//:defs.bzl", link_47_store = "npm_link_imported_package_store") +load("@npm__duplexer__0.1.2__links//:defs.bzl", link_48_store = "npm_link_imported_package_store") +load("@npm__emoji-regex__8.0.0__links//:defs.bzl", link_49_store = "npm_link_imported_package_store") +load("@npm__esbuild-android-64__0.14.38__links//:defs.bzl", link_50_store = "npm_link_imported_package_store") +load("@npm__esbuild-android-arm64__0.14.38__links//:defs.bzl", link_51_store = "npm_link_imported_package_store") +load("@npm__esbuild-darwin-64__0.14.38__links//:defs.bzl", link_52_store = "npm_link_imported_package_store") +load("@npm__esbuild-darwin-arm64__0.14.38__links//:defs.bzl", link_53_store = "npm_link_imported_package_store") +load("@npm__esbuild-freebsd-64__0.14.38__links//:defs.bzl", link_54_store = "npm_link_imported_package_store") +load("@npm__esbuild-freebsd-arm64__0.14.38__links//:defs.bzl", link_55_store = "npm_link_imported_package_store") +load("@npm__esbuild-linux-32__0.14.38__links//:defs.bzl", link_56_store = "npm_link_imported_package_store") +load("@npm__esbuild-linux-64__0.14.38__links//:defs.bzl", link_57_store = "npm_link_imported_package_store") +load("@npm__esbuild-linux-arm__0.14.38__links//:defs.bzl", link_58_store = "npm_link_imported_package_store") +load("@npm__esbuild-linux-arm64__0.14.38__links//:defs.bzl", link_59_store = "npm_link_imported_package_store") +load("@npm__esbuild-linux-mips64le__0.14.38__links//:defs.bzl", link_60_store = "npm_link_imported_package_store") +load("@npm__esbuild-linux-ppc64le__0.14.38__links//:defs.bzl", link_61_store = "npm_link_imported_package_store") +load("@npm__esbuild-linux-riscv64__0.14.38__links//:defs.bzl", link_62_store = "npm_link_imported_package_store") +load("@npm__esbuild-linux-s390x__0.14.38__links//:defs.bzl", link_63_store = "npm_link_imported_package_store") +load("@npm__esbuild-netbsd-64__0.14.38__links//:defs.bzl", link_64_store = "npm_link_imported_package_store") +load("@npm__esbuild-openbsd-64__0.14.38__links//:defs.bzl", link_65_store = "npm_link_imported_package_store") +load("@npm__esbuild-sunos-64__0.14.38__links//:defs.bzl", link_66_store = "npm_link_imported_package_store") +load("@npm__esbuild-windows-32__0.14.38__links//:defs.bzl", link_67_store = "npm_link_imported_package_store") +load("@npm__esbuild-windows-64__0.14.38__links//:defs.bzl", link_68_store = "npm_link_imported_package_store") +load("@npm__esbuild-windows-arm64__0.14.38__links//:defs.bzl", link_69_store = "npm_link_imported_package_store") +load("@npm__esbuild__0.14.38__links//:defs.bzl", link_70_direct = "npm_link_imported_package_direct", link_70_store = "npm_link_imported_package_store") +load("@npm__escalade__3.1.1__links//:defs.bzl", link_71_store = "npm_link_imported_package_store") +load("@npm__escape-string-regexp__4.0.0__links//:defs.bzl", link_72_store = "npm_link_imported_package_store") +load("@npm__esprima__1.0.0__links//:defs.bzl", link_73_store = "npm_link_imported_package_store") +load("@npm__estree-walker__1.0.1__links//:defs.bzl", link_74_store = "npm_link_imported_package_store") +load("@npm__estree-walker__2.0.2__links//:defs.bzl", link_75_store = "npm_link_imported_package_store") +load("@npm__fill-range__7.0.1__links//:defs.bzl", link_76_store = "npm_link_imported_package_store") +load("@npm__find-up__5.0.0__links//:defs.bzl", link_77_store = "npm_link_imported_package_store") +load("@npm__flat__5.0.2__links//:defs.bzl", link_78_store = "npm_link_imported_package_store") +load("@npm__fs.realpath__1.0.0__links//:defs.bzl", link_79_store = "npm_link_imported_package_store") +load("@npm__fsevents__2.3.2__links//:defs.bzl", link_80_store = "npm_link_imported_package_store") +load("@npm__function-bind__1.1.1__links//:defs.bzl", link_81_store = "npm_link_imported_package_store") +load("@npm__get-caller-file__2.0.5__links//:defs.bzl", link_82_store = "npm_link_imported_package_store") +load("@npm__glob-parent__5.1.2__links//:defs.bzl", link_83_store = "npm_link_imported_package_store") +load("@npm__glob__7.2.0__links//:defs.bzl", link_84_store = "npm_link_imported_package_store") +load("@npm__glob__7.2.3__links//:defs.bzl", link_85_store = "npm_link_imported_package_store") +load("@npm__gzip-size__6.0.0__links//:defs.bzl", link_86_store = "npm_link_imported_package_store") +load("@npm__has-flag__4.0.0__links//:defs.bzl", link_87_store = "npm_link_imported_package_store") +load("@npm__has__1.0.3__links//:defs.bzl", link_88_store = "npm_link_imported_package_store") +load("@npm__he__1.2.0__links//:defs.bzl", link_89_store = "npm_link_imported_package_store") +load("@npm__inflight__1.0.6__links//:defs.bzl", link_90_store = "npm_link_imported_package_store") +load("@npm__inherits__2.0.4__links//:defs.bzl", link_91_store = "npm_link_imported_package_store") +load("@npm__is-binary-path__2.1.0__links//:defs.bzl", link_92_store = "npm_link_imported_package_store") +load("@npm__is-buffer__1.1.6__links//:defs.bzl", link_93_store = "npm_link_imported_package_store") +load("@npm__is-core-module__2.9.0__links//:defs.bzl", link_94_store = "npm_link_imported_package_store") +load("@npm__is-extglob__2.1.1__links//:defs.bzl", link_95_store = "npm_link_imported_package_store") +load("@npm__is-fullwidth-code-point__3.0.0__links//:defs.bzl", link_96_store = "npm_link_imported_package_store") +load("@npm__is-glob__4.0.3__links//:defs.bzl", link_97_store = "npm_link_imported_package_store") +load("@npm__is-number__7.0.0__links//:defs.bzl", link_98_store = "npm_link_imported_package_store") +load("@npm__is-plain-obj__2.1.0__links//:defs.bzl", link_99_store = "npm_link_imported_package_store") +load("@npm__is-reference__1.2.1__links//:defs.bzl", link_100_store = "npm_link_imported_package_store") +load("@npm__is-unicode-supported__0.1.0__links//:defs.bzl", link_101_store = "npm_link_imported_package_store") +load("@npm__js-tokens__4.0.0__links//:defs.bzl", link_102_store = "npm_link_imported_package_store") +load("@npm__js-yaml__4.1.0__links//:defs.bzl", link_103_store = "npm_link_imported_package_store") +load("@npm__kleur__4.1.4__links//:defs.bzl", link_104_store = "npm_link_imported_package_store") +load("@npm__locate-path__6.0.0__links//:defs.bzl", link_105_store = "npm_link_imported_package_store") +load("@npm__lodash__4.17.21__links//:defs.bzl", link_106_store = "npm_link_imported_package_store") +load("@npm__log-symbols__4.1.0__links//:defs.bzl", link_107_store = "npm_link_imported_package_store") +load("@npm__loose-envify__1.4.0__links//:defs.bzl", link_108_store = "npm_link_imported_package_store") +load("@npm__magic-string__0.25.9__links//:defs.bzl", link_109_store = "npm_link_imported_package_store") +load("@npm__md5__2.3.0__links//:defs.bzl", link_110_store = "npm_link_imported_package_store") +load("@npm__minimatch__3.1.2__links//:defs.bzl", link_111_store = "npm_link_imported_package_store") +load("@npm__minimatch__5.0.1__links//:defs.bzl", link_112_store = "npm_link_imported_package_store") +load("@npm__minimist__0.0.10__links//:defs.bzl", link_113_store = "npm_link_imported_package_store") +load("@npm__minimist__1.2.6__links//:defs.bzl", link_114_store = "npm_link_imported_package_store") +load("@npm__mkdirp__0.5.6__links//:defs.bzl", link_115_store = "npm_link_imported_package_store") +load("@npm__mobx-react-lite__3.4.0__mobx_6.3.0_react_17.0.2__links//:defs.bzl", link_116_store = "npm_link_imported_package_store") +load("@npm__mobx-react__7.3.0__mobx_6.3.0_react_17.0.2__links//:defs.bzl", link_117_direct = "npm_link_imported_package_direct", link_117_store = "npm_link_imported_package_store") +load("@npm__mobx__6.3.0__links//:defs.bzl", link_118_direct = "npm_link_imported_package_direct", link_118_store = "npm_link_imported_package_store") +load("@npm__mocha-junit-reporter__2.0.2__mocha_10.0.0__links//:defs.bzl", link_119_direct = "npm_link_imported_package_direct", link_119_store = "npm_link_imported_package_store") +load("@npm__mocha-multi-reporters__1.5.1__mocha_10.0.0__links//:defs.bzl", link_120_direct = "npm_link_imported_package_direct", link_120_store = "npm_link_imported_package_store") +load("@npm__mocha__10.0.0__th2rfume6p4m5jxelm27wrhnly__links//:defs.bzl", link_121_direct = "npm_link_imported_package_direct", link_121_store = "npm_link_imported_package_store") +load("@npm__mri__1.2.0__links//:defs.bzl", link_122_store = "npm_link_imported_package_store") +load("@npm__mrmime__1.0.0__links//:defs.bzl", link_123_store = "npm_link_imported_package_store") +load("@npm__ms__0.7.3__links//:defs.bzl", link_124_store = "npm_link_imported_package_store") +load("@npm__ms__2.0.0__links//:defs.bzl", link_125_store = "npm_link_imported_package_store") +load("@npm__ms__2.1.2__links//:defs.bzl", link_126_store = "npm_link_imported_package_store") +load("@npm__ms__2.1.3__links//:defs.bzl", link_127_store = "npm_link_imported_package_store") +load("@npm__nanoid__3.3.3__links//:defs.bzl", link_128_store = "npm_link_imported_package_store") +load("@npm__node-gyp-build__3.7.0__links//:defs.bzl", link_129_store = "npm_link_imported_package_store") +load("@npm__normalize-path__3.0.0__links//:defs.bzl", link_130_store = "npm_link_imported_package_store") +load("@npm__object-assign__4.1.1__links//:defs.bzl", link_131_store = "npm_link_imported_package_store") +load("@npm__once__1.4.0__links//:defs.bzl", link_132_store = "npm_link_imported_package_store") +load("@npm__opener__1.5.2__links//:defs.bzl", link_133_store = "npm_link_imported_package_store") +load("@npm__optimist__0.6.0__links//:defs.bzl", link_134_store = "npm_link_imported_package_store") +load("@npm__p-limit__3.1.0__links//:defs.bzl", link_135_store = "npm_link_imported_package_store") +load("@npm__p-locate__5.0.0__links//:defs.bzl", link_136_store = "npm_link_imported_package_store") +load("@npm__path-exists__4.0.0__links//:defs.bzl", link_137_store = "npm_link_imported_package_store") +load("@npm__path-is-absolute__1.0.1__links//:defs.bzl", link_138_store = "npm_link_imported_package_store") +load("@npm__path-parse__1.0.7__links//:defs.bzl", link_139_store = "npm_link_imported_package_store") +load("@npm__picomatch__2.3.1__links//:defs.bzl", link_140_store = "npm_link_imported_package_store") +load("@npm__randombytes__2.1.0__links//:defs.bzl", link_141_store = "npm_link_imported_package_store") +load("@npm__react__17.0.2__links//:defs.bzl", link_142_direct = "npm_link_imported_package_direct", link_142_store = "npm_link_imported_package_store") +load("@npm__readdirp__3.6.0__links//:defs.bzl", link_143_store = "npm_link_imported_package_store") +load("@npm__require-directory__2.1.1__links//:defs.bzl", link_144_store = "npm_link_imported_package_store") +load("@npm__resolve__1.22.0__links//:defs.bzl", link_145_store = "npm_link_imported_package_store") +load("@npm__rollup__2.70.2__links//:defs.bzl", link_146_direct = "npm_link_imported_package_direct", link_146_store = "npm_link_imported_package_store") +load("@npm__sade__1.8.1__links//:defs.bzl", link_147_store = "npm_link_imported_package_store") +load("@npm__safe-buffer__5.2.1__links//:defs.bzl", link_148_store = "npm_link_imported_package_store") +load("@npm__serialize-javascript__6.0.0__links//:defs.bzl", link_149_store = "npm_link_imported_package_store") +load("@npm__sirv__1.0.19__links//:defs.bzl", link_150_store = "npm_link_imported_package_store") +load("@npm__sourcemap-codec__1.4.8__links//:defs.bzl", link_151_store = "npm_link_imported_package_store") +load("@npm__string-width__4.2.3__links//:defs.bzl", link_152_store = "npm_link_imported_package_store") +load("@npm__strip-ansi__6.0.1__links//:defs.bzl", link_153_store = "npm_link_imported_package_store") +load("@npm__strip-json-comments__3.1.1__links//:defs.bzl", link_154_store = "npm_link_imported_package_store") +load("@npm__supports-color__7.2.0__links//:defs.bzl", link_155_store = "npm_link_imported_package_store") +load("@npm__supports-color__8.1.1__links//:defs.bzl", link_156_store = "npm_link_imported_package_store") +load("@npm__supports-preserve-symlinks-flag__1.0.0__links//:defs.bzl", link_157_store = "npm_link_imported_package_store") +load("@npm__to-regex-range__5.0.1__links//:defs.bzl", link_158_store = "npm_link_imported_package_store") +load("@npm__totalist__1.1.0__links//:defs.bzl", link_159_store = "npm_link_imported_package_store") +load("@npm__typescript__4.7.2__links//:defs.bzl", link_160_direct = "npm_link_imported_package_direct", link_160_store = "npm_link_imported_package_store") +load("@npm__unused__0.2.2__links//:defs.bzl", link_161_direct = "npm_link_imported_package_direct", link_161_store = "npm_link_imported_package_store") +load("@npm__uuid__8.3.2__links//:defs.bzl", link_162_direct = "npm_link_imported_package_direct", link_162_store = "npm_link_imported_package_store") +load("@npm__uvu__0.5.3__links//:defs.bzl", link_163_direct = "npm_link_imported_package_direct", link_163_store = "npm_link_imported_package_store") +load("@npm__webpack-bundle-analyzer__4.5.0__bufferutil_4.0.1__links//:defs.bzl", link_164_direct = "npm_link_imported_package_direct", link_164_store = "npm_link_imported_package_store") +load("@npm__wordwrap__0.0.3__links//:defs.bzl", link_165_store = "npm_link_imported_package_store") +load("@npm__workerpool__6.2.1__links//:defs.bzl", link_166_store = "npm_link_imported_package_store") +load("@npm__wrap-ansi__7.0.0__links//:defs.bzl", link_167_store = "npm_link_imported_package_store") +load("@npm__wrappy__1.0.2__links//:defs.bzl", link_168_store = "npm_link_imported_package_store") +load("@npm__ws__7.5.8__bufferutil_4.0.1__links//:defs.bzl", link_169_store = "npm_link_imported_package_store") +load("@npm__xml__1.0.1__links//:defs.bzl", link_170_store = "npm_link_imported_package_store") +load("@npm__y18n__5.0.8__links//:defs.bzl", link_171_store = "npm_link_imported_package_store") +load("@npm__yargs-parser__20.2.4__links//:defs.bzl", link_172_store = "npm_link_imported_package_store") +load("@npm__yargs-unparser__2.0.0__links//:defs.bzl", link_173_store = "npm_link_imported_package_store") +load("@npm__yargs__16.2.0__links//:defs.bzl", link_174_store = "npm_link_imported_package_store") +load("@npm__yocto-queue__0.1.0__links//:defs.bzl", link_175_store = "npm_link_imported_package_store") +load("@npm__debug__github.com_ngokevin_debug_9742c5f383a6f8046241920156236ade8ec30d53__links//:defs.bzl", link_176_direct = "npm_link_imported_package_direct", link_176_store = "npm_link_imported_package_store") -def npm_link_all_packages(name = "node_modules"): +def npm_link_all_packages(name = "node_modules", imported_links = []): """Generated list of npm_link_package() target generators and first-party linked packages corresponding to the packages in @//:pnpm-lock.yaml Args: name: name of catch all target to generate for all packages linked + imported_links: optional list link functions from manually imported packages + that were fetched with npm_import rules, + + 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, + ], + )``` """ + + # @unused + utils = _utils root_package = "" - link_packages = ["", "examples/macro", "examples/npm_deps", "npm/private/test"] + direct_packages = ["", "examples/lib", "examples/macro", "examples/npm_deps", "npm/private/test"] is_root = native.package_name() == root_package - is_direct = native.package_name() in link_packages + is_direct = native.package_name() in direct_packages if not is_root and not is_direct: - msg = "The npm_link_all_packages() macro loaded from @npm//:defs.bzl and called in bazel package '%s' may only be called in the bazel package(s) corresponding to the root package '' and packages ['', 'examples/macro', 'examples/npm_deps', 'npm/private/test']" % native.package_name() + msg = "The npm_link_all_packages() macro loaded from @npm//:defs.bzl and called in bazel package '%s' may only be called in the bazel package(s) corresponding to the root package '' and packages ['', 'examples/lib', 'examples/macro', 'examples/npm_deps', 'npm/private/test']" % native.package_name() fail(msg) direct_targets = [] scoped_direct_targets = {} - scoped_direct_targets["@aspect-test"] = [] - scoped_direct_targets["@gregmagolan"] = [] - scoped_direct_targets["@polka"] = [] - scoped_direct_targets["@rollup"] = [] - scoped_direct_targets["@types"] = [] - scoped_direct_targets["@ungap"] = [] - direct_targets.append(link_0(name = "{}/@aspect-test/a".format(name), direct = None, fail_if_no_link = False)) - scoped_direct_targets["@aspect-test"].append(direct_targets[-1]) - direct_targets.append(link_1(name = "{}/@aspect-test/b".format(name), direct = None, fail_if_no_link = False)) - scoped_direct_targets["@aspect-test"].append(direct_targets[-1]) - direct_targets.append(link_2(name = "{}/@aspect-test/c".format(name), direct = None, fail_if_no_link = False)) - scoped_direct_targets["@aspect-test"].append(direct_targets[-1]) - direct_targets.append(link_3(name = "{}/@aspect-test/c".format(name), direct = None, fail_if_no_link = False)) - scoped_direct_targets["@aspect-test"].append(direct_targets[-1]) - direct_targets.append(link_4(name = "{}/@aspect-test/d".format(name), direct = None, fail_if_no_link = False)) - scoped_direct_targets["@aspect-test"].append(direct_targets[-1]) - direct_targets.append(link_5(name = "{}/@aspect-test/d".format(name), direct = None, fail_if_no_link = False)) - scoped_direct_targets["@aspect-test"].append(direct_targets[-1]) - direct_targets.append(link_6(name = "{}/@gregmagolan/test-a".format(name), direct = None, fail_if_no_link = False)) - scoped_direct_targets["@gregmagolan"].append(direct_targets[-1]) - direct_targets.append(link_7(name = "{}/@gregmagolan/test-b".format(name), direct = None, fail_if_no_link = False)) - scoped_direct_targets["@gregmagolan"].append(direct_targets[-1]) - direct_targets.append(link_8(name = "{}/@polka/url".format(name), direct = None, fail_if_no_link = False)) - scoped_direct_targets["@polka"].append(direct_targets[-1]) - direct_targets.append(link_9(name = "{}/@rollup/plugin-commonjs".format(name), direct = None, fail_if_no_link = False)) - scoped_direct_targets["@rollup"].append(direct_targets[-1]) - direct_targets.append(link_10(name = "{}/@rollup/pluginutils".format(name), direct = None, fail_if_no_link = False)) - scoped_direct_targets["@rollup"].append(direct_targets[-1]) - direct_targets.append(link_11(name = "{}/@types/estree".format(name), direct = None, fail_if_no_link = False)) - scoped_direct_targets["@types"].append(direct_targets[-1]) - direct_targets.append(link_12(name = "{}/@types/estree".format(name), direct = None, fail_if_no_link = False)) - scoped_direct_targets["@types"].append(direct_targets[-1]) - direct_targets.append(link_13(name = "{}/@types/node".format(name), direct = None, fail_if_no_link = False)) - scoped_direct_targets["@types"].append(direct_targets[-1]) - direct_targets.append(link_14(name = "{}/@ungap/promise-all-settled".format(name), direct = None, fail_if_no_link = False)) - scoped_direct_targets["@ungap"].append(direct_targets[-1]) - direct_targets.append(link_15(name = "{}/acorn-walk".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_16(name = "{}/acorn".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_17(name = "{}/ansi-colors".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_18(name = "{}/ansi-regex".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_19(name = "{}/ansi-styles".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_20(name = "{}/anymatch".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_21(name = "{}/argparse".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_22(name = "{}/balanced-match".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_23(name = "{}/binary-extensions".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_24(name = "{}/brace-expansion".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_25(name = "{}/brace-expansion".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_26(name = "{}/braces".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_27(name = "{}/browser-stdout".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_28(name = "{}/bufferutil".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_29(name = "{}/camelcase".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_30(name = "{}/chalk".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_31(name = "{}/charenc".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_32(name = "{}/chokidar".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_33(name = "{}/cliui".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_34(name = "{}/color-convert".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_35(name = "{}/color-name".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_36(name = "{}/commander".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_37(name = "{}/commondir".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_38(name = "{}/concat-map".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_39(name = "{}/crypt".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_40(name = "{}/debug".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_41(name = "{}/debug".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_42(name = "{}/debug".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_43(name = "{}/decamelize".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_44(name = "{}/dequal".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_45(name = "{}/diff".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_46(name = "{}/diff".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_47(name = "{}/duplexer".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_48(name = "{}/emoji-regex".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_49(name = "{}/esbuild-android-64".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_50(name = "{}/esbuild-android-arm64".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_51(name = "{}/esbuild-darwin-64".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_52(name = "{}/esbuild-darwin-arm64".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_53(name = "{}/esbuild-freebsd-64".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_54(name = "{}/esbuild-freebsd-arm64".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_55(name = "{}/esbuild-linux-32".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_56(name = "{}/esbuild-linux-64".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_57(name = "{}/esbuild-linux-arm".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_58(name = "{}/esbuild-linux-arm64".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_59(name = "{}/esbuild-linux-mips64le".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_60(name = "{}/esbuild-linux-ppc64le".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_61(name = "{}/esbuild-linux-riscv64".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_62(name = "{}/esbuild-linux-s390x".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_63(name = "{}/esbuild-netbsd-64".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_64(name = "{}/esbuild-openbsd-64".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_65(name = "{}/esbuild-sunos-64".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_66(name = "{}/esbuild-windows-32".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_67(name = "{}/esbuild-windows-64".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_68(name = "{}/esbuild-windows-arm64".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_69(name = "{}/esbuild".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_70(name = "{}/escalade".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_71(name = "{}/escape-string-regexp".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_72(name = "{}/esprima".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_73(name = "{}/estree-walker".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_74(name = "{}/estree-walker".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_75(name = "{}/fill-range".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_76(name = "{}/find-up".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_77(name = "{}/flat".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_78(name = "{}/fs.realpath".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_79(name = "{}/fsevents".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_80(name = "{}/function-bind".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_81(name = "{}/get-caller-file".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_82(name = "{}/glob-parent".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_83(name = "{}/glob".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_84(name = "{}/glob".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_85(name = "{}/gzip-size".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_86(name = "{}/has-flag".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_87(name = "{}/has".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_88(name = "{}/he".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_89(name = "{}/inflight".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_90(name = "{}/inherits".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_91(name = "{}/is-binary-path".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_92(name = "{}/is-buffer".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_93(name = "{}/is-core-module".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_94(name = "{}/is-extglob".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_95(name = "{}/is-fullwidth-code-point".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_96(name = "{}/is-glob".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_97(name = "{}/is-number".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_98(name = "{}/is-plain-obj".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_99(name = "{}/is-reference".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_100(name = "{}/is-unicode-supported".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_101(name = "{}/js-tokens".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_102(name = "{}/js-yaml".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_103(name = "{}/kleur".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_104(name = "{}/locate-path".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_105(name = "{}/lodash".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_106(name = "{}/log-symbols".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_107(name = "{}/loose-envify".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_108(name = "{}/magic-string".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_109(name = "{}/md5".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_110(name = "{}/minimatch".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_111(name = "{}/minimatch".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_112(name = "{}/minimist".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_113(name = "{}/minimist".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_114(name = "{}/mkdirp".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_115(name = "{}/mobx-react-lite".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_116(name = "{}/mobx-react".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_117(name = "{}/mobx".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_118(name = "{}/mocha-junit-reporter".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_119(name = "{}/mocha-multi-reporters".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_120(name = "{}/mocha".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_121(name = "{}/mri".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_122(name = "{}/mrmime".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_123(name = "{}/ms".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_124(name = "{}/ms".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_125(name = "{}/ms".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_126(name = "{}/ms".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_127(name = "{}/nanoid".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_128(name = "{}/node-gyp-build".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_129(name = "{}/normalize-path".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_130(name = "{}/object-assign".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_131(name = "{}/once".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_132(name = "{}/opener".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_133(name = "{}/optimist".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_134(name = "{}/p-limit".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_135(name = "{}/p-locate".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_136(name = "{}/path-exists".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_137(name = "{}/path-is-absolute".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_138(name = "{}/path-parse".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_139(name = "{}/picomatch".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_140(name = "{}/randombytes".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_141(name = "{}/react".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_142(name = "{}/readdirp".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_143(name = "{}/require-directory".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_144(name = "{}/resolve".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_145(name = "{}/rollup".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_146(name = "{}/sade".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_147(name = "{}/safe-buffer".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_148(name = "{}/serialize-javascript".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_149(name = "{}/sirv".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_150(name = "{}/sourcemap-codec".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_151(name = "{}/string-width".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_152(name = "{}/strip-ansi".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_153(name = "{}/strip-json-comments".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_154(name = "{}/supports-color".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_155(name = "{}/supports-color".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_156(name = "{}/supports-preserve-symlinks-flag".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_157(name = "{}/to-regex-range".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_158(name = "{}/totalist".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_159(name = "{}/typescript".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_160(name = "{}/unused".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_161(name = "{}/uvu".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_162(name = "{}/webpack-bundle-analyzer".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_163(name = "{}/wordwrap".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_164(name = "{}/workerpool".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_165(name = "{}/wrap-ansi".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_166(name = "{}/wrappy".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_167(name = "{}/ws".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_168(name = "{}/xml".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_169(name = "{}/y18n".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_170(name = "{}/yargs-parser".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_171(name = "{}/yargs-unparser".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_172(name = "{}/yargs".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_173(name = "{}/yocto-queue".format(name), direct = None, fail_if_no_link = False)) - direct_targets.append(link_174(name = "{}/debug".format(name), direct = None, fail_if_no_link = False)) + for link_fn in imported_links: + new_direct_targets, new_scoped_targets = link_fn(name) + direct_targets.extend(new_direct_targets) + for _scope, _targets in new_scoped_targets.items(): + scoped_direct_targets[_scope] = scoped_direct_targets[_scope] + _targets if _scope in scoped_direct_targets else _targets + + if is_root: + link_0_store(name = "{}/@aspect-test/a".format(name)) + link_1_store(name = "{}/@aspect-test/b".format(name)) + link_2_store(name = "{}/@aspect-test/c".format(name)) + link_3_store(name = "{}/@aspect-test/c".format(name)) + link_4_store(name = "{}/@aspect-test/d".format(name)) + link_5_store(name = "{}/@aspect-test/d".format(name)) + link_6_store(name = "{}/@gregmagolan/test-a".format(name)) + link_7_store(name = "{}/@gregmagolan/test-b".format(name)) + link_8_store(name = "{}/@plotly/regl".format(name)) + link_9_store(name = "{}/@polka/url".format(name)) + link_10_store(name = "{}/@rollup/plugin-commonjs".format(name)) + link_11_store(name = "{}/@rollup/pluginutils".format(name)) + link_12_store(name = "{}/@types/estree".format(name)) + link_13_store(name = "{}/@types/estree".format(name)) + link_14_store(name = "{}/@types/node".format(name)) + link_15_store(name = "{}/@ungap/promise-all-settled".format(name)) + link_16_store(name = "{}/acorn-walk".format(name)) + link_17_store(name = "{}/acorn".format(name)) + link_18_store(name = "{}/ansi-colors".format(name)) + link_19_store(name = "{}/ansi-regex".format(name)) + link_20_store(name = "{}/ansi-styles".format(name)) + link_21_store(name = "{}/anymatch".format(name)) + link_22_store(name = "{}/argparse".format(name)) + link_23_store(name = "{}/balanced-match".format(name)) + link_24_store(name = "{}/binary-extensions".format(name)) + link_25_store(name = "{}/brace-expansion".format(name)) + link_26_store(name = "{}/brace-expansion".format(name)) + link_27_store(name = "{}/braces".format(name)) + link_28_store(name = "{}/browser-stdout".format(name)) + link_29_store(name = "{}/bufferutil".format(name)) + link_30_store(name = "{}/camelcase".format(name)) + link_31_store(name = "{}/chalk".format(name)) + link_32_store(name = "{}/charenc".format(name)) + link_33_store(name = "{}/chokidar".format(name)) + link_34_store(name = "{}/cliui".format(name)) + link_35_store(name = "{}/color-convert".format(name)) + link_36_store(name = "{}/color-name".format(name)) + link_37_store(name = "{}/commander".format(name)) + link_38_store(name = "{}/commondir".format(name)) + link_39_store(name = "{}/concat-map".format(name)) + link_40_store(name = "{}/crypt".format(name)) + link_41_store(name = "{}/debug".format(name)) + link_42_store(name = "{}/debug".format(name)) + link_43_store(name = "{}/debug".format(name)) + link_44_store(name = "{}/decamelize".format(name)) + link_45_store(name = "{}/dequal".format(name)) + link_46_store(name = "{}/diff".format(name)) + link_47_store(name = "{}/diff".format(name)) + link_48_store(name = "{}/duplexer".format(name)) + link_49_store(name = "{}/emoji-regex".format(name)) + link_50_store(name = "{}/esbuild-android-64".format(name)) + link_51_store(name = "{}/esbuild-android-arm64".format(name)) + link_52_store(name = "{}/esbuild-darwin-64".format(name)) + link_53_store(name = "{}/esbuild-darwin-arm64".format(name)) + link_54_store(name = "{}/esbuild-freebsd-64".format(name)) + link_55_store(name = "{}/esbuild-freebsd-arm64".format(name)) + link_56_store(name = "{}/esbuild-linux-32".format(name)) + link_57_store(name = "{}/esbuild-linux-64".format(name)) + link_58_store(name = "{}/esbuild-linux-arm".format(name)) + link_59_store(name = "{}/esbuild-linux-arm64".format(name)) + link_60_store(name = "{}/esbuild-linux-mips64le".format(name)) + link_61_store(name = "{}/esbuild-linux-ppc64le".format(name)) + link_62_store(name = "{}/esbuild-linux-riscv64".format(name)) + link_63_store(name = "{}/esbuild-linux-s390x".format(name)) + link_64_store(name = "{}/esbuild-netbsd-64".format(name)) + link_65_store(name = "{}/esbuild-openbsd-64".format(name)) + link_66_store(name = "{}/esbuild-sunos-64".format(name)) + link_67_store(name = "{}/esbuild-windows-32".format(name)) + link_68_store(name = "{}/esbuild-windows-64".format(name)) + link_69_store(name = "{}/esbuild-windows-arm64".format(name)) + link_70_store(name = "{}/esbuild".format(name)) + link_71_store(name = "{}/escalade".format(name)) + link_72_store(name = "{}/escape-string-regexp".format(name)) + link_73_store(name = "{}/esprima".format(name)) + link_74_store(name = "{}/estree-walker".format(name)) + link_75_store(name = "{}/estree-walker".format(name)) + link_76_store(name = "{}/fill-range".format(name)) + link_77_store(name = "{}/find-up".format(name)) + link_78_store(name = "{}/flat".format(name)) + link_79_store(name = "{}/fs.realpath".format(name)) + link_80_store(name = "{}/fsevents".format(name)) + link_81_store(name = "{}/function-bind".format(name)) + link_82_store(name = "{}/get-caller-file".format(name)) + link_83_store(name = "{}/glob-parent".format(name)) + link_84_store(name = "{}/glob".format(name)) + link_85_store(name = "{}/glob".format(name)) + link_86_store(name = "{}/gzip-size".format(name)) + link_87_store(name = "{}/has-flag".format(name)) + link_88_store(name = "{}/has".format(name)) + link_89_store(name = "{}/he".format(name)) + link_90_store(name = "{}/inflight".format(name)) + link_91_store(name = "{}/inherits".format(name)) + link_92_store(name = "{}/is-binary-path".format(name)) + link_93_store(name = "{}/is-buffer".format(name)) + link_94_store(name = "{}/is-core-module".format(name)) + link_95_store(name = "{}/is-extglob".format(name)) + link_96_store(name = "{}/is-fullwidth-code-point".format(name)) + link_97_store(name = "{}/is-glob".format(name)) + link_98_store(name = "{}/is-number".format(name)) + link_99_store(name = "{}/is-plain-obj".format(name)) + link_100_store(name = "{}/is-reference".format(name)) + link_101_store(name = "{}/is-unicode-supported".format(name)) + link_102_store(name = "{}/js-tokens".format(name)) + link_103_store(name = "{}/js-yaml".format(name)) + link_104_store(name = "{}/kleur".format(name)) + link_105_store(name = "{}/locate-path".format(name)) + link_106_store(name = "{}/lodash".format(name)) + link_107_store(name = "{}/log-symbols".format(name)) + link_108_store(name = "{}/loose-envify".format(name)) + link_109_store(name = "{}/magic-string".format(name)) + link_110_store(name = "{}/md5".format(name)) + link_111_store(name = "{}/minimatch".format(name)) + link_112_store(name = "{}/minimatch".format(name)) + link_113_store(name = "{}/minimist".format(name)) + link_114_store(name = "{}/minimist".format(name)) + link_115_store(name = "{}/mkdirp".format(name)) + link_116_store(name = "{}/mobx-react-lite".format(name)) + link_117_store(name = "{}/mobx-react".format(name)) + link_118_store(name = "{}/mobx".format(name)) + link_119_store(name = "{}/mocha-junit-reporter".format(name)) + link_120_store(name = "{}/mocha-multi-reporters".format(name)) + link_121_store(name = "{}/mocha".format(name)) + link_122_store(name = "{}/mri".format(name)) + link_123_store(name = "{}/mrmime".format(name)) + link_124_store(name = "{}/ms".format(name)) + link_125_store(name = "{}/ms".format(name)) + link_126_store(name = "{}/ms".format(name)) + link_127_store(name = "{}/ms".format(name)) + link_128_store(name = "{}/nanoid".format(name)) + link_129_store(name = "{}/node-gyp-build".format(name)) + link_130_store(name = "{}/normalize-path".format(name)) + link_131_store(name = "{}/object-assign".format(name)) + link_132_store(name = "{}/once".format(name)) + link_133_store(name = "{}/opener".format(name)) + link_134_store(name = "{}/optimist".format(name)) + link_135_store(name = "{}/p-limit".format(name)) + link_136_store(name = "{}/p-locate".format(name)) + link_137_store(name = "{}/path-exists".format(name)) + link_138_store(name = "{}/path-is-absolute".format(name)) + link_139_store(name = "{}/path-parse".format(name)) + link_140_store(name = "{}/picomatch".format(name)) + link_141_store(name = "{}/randombytes".format(name)) + link_142_store(name = "{}/react".format(name)) + link_143_store(name = "{}/readdirp".format(name)) + link_144_store(name = "{}/require-directory".format(name)) + link_145_store(name = "{}/resolve".format(name)) + link_146_store(name = "{}/rollup".format(name)) + link_147_store(name = "{}/sade".format(name)) + link_148_store(name = "{}/safe-buffer".format(name)) + link_149_store(name = "{}/serialize-javascript".format(name)) + link_150_store(name = "{}/sirv".format(name)) + link_151_store(name = "{}/sourcemap-codec".format(name)) + link_152_store(name = "{}/string-width".format(name)) + link_153_store(name = "{}/strip-ansi".format(name)) + link_154_store(name = "{}/strip-json-comments".format(name)) + link_155_store(name = "{}/supports-color".format(name)) + link_156_store(name = "{}/supports-color".format(name)) + link_157_store(name = "{}/supports-preserve-symlinks-flag".format(name)) + link_158_store(name = "{}/to-regex-range".format(name)) + link_159_store(name = "{}/totalist".format(name)) + link_160_store(name = "{}/typescript".format(name)) + link_161_store(name = "{}/unused".format(name)) + link_162_store(name = "{}/uuid".format(name)) + link_163_store(name = "{}/uvu".format(name)) + link_164_store(name = "{}/webpack-bundle-analyzer".format(name)) + link_165_store(name = "{}/wordwrap".format(name)) + link_166_store(name = "{}/workerpool".format(name)) + link_167_store(name = "{}/wrap-ansi".format(name)) + link_168_store(name = "{}/wrappy".format(name)) + link_169_store(name = "{}/ws".format(name)) + link_170_store(name = "{}/xml".format(name)) + link_171_store(name = "{}/y18n".format(name)) + link_172_store(name = "{}/yargs-parser".format(name)) + link_173_store(name = "{}/yargs-unparser".format(name)) + link_174_store(name = "{}/yargs".format(name)) + link_175_store(name = "{}/yocto-queue".format(name)) + link_176_store(name = "{}/debug".format(name)) + if is_direct: + if native.package_name() == "examples/npm_deps": + direct_targets.append(link_0_direct(name = "{}/@aspect-test/a".format(name))) + scoped_direct_targets["@aspect-test"] = scoped_direct_targets["@aspect-test"] + [direct_targets[-1]] if "@aspect-test" in scoped_direct_targets else [direct_targets[-1]] + direct_targets.append(link_3_direct(name = "{}/@aspect-test/c".format(name))) + scoped_direct_targets["@aspect-test"] = scoped_direct_targets["@aspect-test"] + [direct_targets[-1]] if "@aspect-test" in scoped_direct_targets else [direct_targets[-1]] + direct_targets.append(link_7_direct(name = "{}/@gregmagolan/test-b".format(name))) + scoped_direct_targets["@gregmagolan"] = scoped_direct_targets["@gregmagolan"] + [direct_targets[-1]] if "@gregmagolan" in scoped_direct_targets else [direct_targets[-1]] + direct_targets.append(link_10_direct(name = "{}/@rollup/plugin-commonjs".format(name))) + scoped_direct_targets["@rollup"] = scoped_direct_targets["@rollup"] + [direct_targets[-1]] if "@rollup" in scoped_direct_targets else [direct_targets[-1]] + direct_targets.append(link_117_direct(name = "{}/mobx-react".format(name))) + direct_targets.append(link_118_direct(name = "{}/mobx".format(name))) + direct_targets.append(link_142_direct(name = "{}/react".format(name))) + direct_targets.append(link_146_direct(name = "{}/rollup".format(name))) + direct_targets.append(link_163_direct(name = "{}/uvu".format(name))) + if native.package_name() == "npm/private/test": + direct_targets.append(link_8_direct(name = "{}/@plotly/regl".format(name))) + scoped_direct_targets["@plotly"] = scoped_direct_targets["@plotly"] + [direct_targets[-1]] if "@plotly" in scoped_direct_targets else [direct_targets[-1]] + direct_targets.append(link_8_direct(name = "{}/regl".format(name))) + direct_targets.append(link_29_direct(name = "{}/bufferutil".format(name))) + direct_targets.append(link_70_direct(name = "{}/esbuild".format(name))) + direct_targets.append(link_161_direct(name = "{}/unused".format(name))) + direct_targets.append(link_164_direct(name = "{}/webpack-bundle-analyzer".format(name))) + direct_targets.append(link_176_direct(name = "{}/debug".format(name))) + if native.package_name() == "": + direct_targets.append(link_14_direct(name = "{}/@types/node".format(name))) + scoped_direct_targets["@types"] = scoped_direct_targets["@types"] + [direct_targets[-1]] if "@types" in scoped_direct_targets else [direct_targets[-1]] + direct_targets.append(link_160_direct(name = "{}/typescript".format(name))) + if native.package_name() == "examples/lib": + direct_targets.append(link_17_direct(name = "{}/acorn".format(name))) + direct_targets.append(link_162_direct(name = "{}/uuid".format(name))) + if native.package_name() == "examples/macro": + direct_targets.append(link_119_direct(name = "{}/mocha-junit-reporter".format(name))) + direct_targets.append(link_120_direct(name = "{}/mocha-multi-reporters".format(name))) + direct_targets.append(link_121_direct(name = "{}/mocha".format(name))) for scope, scoped_targets in scoped_direct_targets.items(): - direct_scoped_targets = [t for t in scoped_targets if t] - if direct_scoped_targets: - npm_linked_packages( - name = "{}/{}".format(name, scope), - srcs = direct_scoped_targets, - tags = ["manual"], - visibility = ["//visibility:public"], - ) + npm_linked_packages( + name = "{}/{}".format(name, scope), + srcs = scoped_targets, + tags = ["manual"], + visibility = ["//visibility:public"], + ) npm_linked_packages( name = name, - srcs = [t for t in direct_targets if t], + srcs = direct_targets, tags = ["manual"], visibility = ["//visibility:public"], ) diff --git a/npm/private/test/package.json b/npm/private/test/package.json index ad2aafa14..de319713b 100644 --- a/npm/private/test/package.json +++ b/npm/private/test/package.json @@ -5,6 +5,8 @@ "bufferutil": "4.0.1", "debug": "ngokevin/debug#9742c5f383a6f8046241920156236ade8ec30d53", "esbuild": "0.14.38", + "regl": "npm:@plotly/regl@2.1.2", + "@plotly/regl": "2.1.2", "unused": "latest", "webpack-bundle-analyzer": "4.5.0" } diff --git a/npm/private/test/package_json_checked.bzl b/npm/private/test/package_json_checked.bzl index 5b0f277c0..a23178732 100755 --- a/npm/private/test/package_json_checked.bzl +++ b/npm/private/test/package_json_checked.bzl @@ -3,16 +3,17 @@ load("@aspect_bazel_lib//lib:directory_path.bzl", _directory_path = "directory_path") load("@aspect_rules_js//js:defs.bzl", _js_binary = "js_binary", _js_run_binary = "js_run_binary", _js_test = "js_test") -def rollup(name, **kwargs): +def _rollup_internal(name, link_root_name, **kwargs): + store_target_name = "{}/rollup/store/2.70.2".format(link_root_name) _directory_path( name = "%s__entry_point" % name, - directory = "@//:store_link__rollup__2.70.2__dir", + directory = "@//:{}/dir".format(store_target_name), path = "dist/bin/rollup", ) _js_binary( name = "%s__js_binary" % name, entry_point = ":%s__entry_point" % name, - data = ["@//:store_link__rollup__2.70.2"], + data = ["@//:{}".format(store_target_name)], ) _js_run_binary( name = name, @@ -20,30 +21,49 @@ def rollup(name, **kwargs): **kwargs ) -def rollup_test(name, **kwargs): +def _rollup_test_internal(name, link_root_name, **kwargs): + store_target_name = "{}/rollup/store/2.70.2".format(link_root_name) _directory_path( name = "%s__entry_point" % name, - directory = "@//:store_link__rollup__2.70.2__dir", + directory = "@//:{}/dir".format(store_target_name), path = "dist/bin/rollup", ) _js_test( name = name, entry_point = ":%s__entry_point" % name, - data = kwargs.pop("data", []) + ["@//:store_link__rollup__2.70.2"], + data = kwargs.pop("data", []) + ["@//:{}".format(store_target_name)], **kwargs ) -def rollup_binary(name, **kwargs): +def _rollup_binary_internal(name, link_root_name, **kwargs): + store_target_name = "{}/rollup/store/2.70.2".format(link_root_name) _directory_path( name = "%s__entry_point" % name, - directory = "@//:store_link__rollup__2.70.2__dir", + directory = "@//:{}/dir".format(store_target_name), path = "dist/bin/rollup", ) _js_binary( name = name, entry_point = ":%s__entry_point" % name, - data = kwargs.pop("data", []) + ["@//:store_link__rollup__2.70.2"], + data = kwargs.pop("data", []) + ["@//:{}".format(store_target_name)], **kwargs ) -bin = struct(rollup = rollup, rollup_test = rollup_test, rollup_binary = rollup_binary) +def rollup(name, **kwargs): + _rollup_internal(name, "node_modules", **kwargs) + +def rollup_test(name, **kwargs): + _rollup_test_internal(name, "node_modules", **kwargs) + +def rollup_binary(name, **kwargs): + _rollup_binary_internal(name, "node_modules", **kwargs) + +def bin_factory(link_root_name): + # bind link_root_name using lambdas + return struct( + rollup = lambda name, **kwargs: _rollup_internal(name, link_root_name = link_root_name, **kwargs), + rollup_test = lambda name, **kwargs: _rollup_test_internal(name, link_root_name = link_root_name, **kwargs), + rollup_binary = lambda name, **kwargs: _rollup_binary_internal(name, link_root_name = link_root_name, **kwargs), + ) + +bin = bin_factory("node_modules") diff --git a/npm/private/test/package_json_with_dashes_checked.bzl b/npm/private/test/package_json_with_dashes_checked.bzl index 659f9c798..8c48d0e87 100755 --- a/npm/private/test/package_json_with_dashes_checked.bzl +++ b/npm/private/test/package_json_with_dashes_checked.bzl @@ -3,16 +3,17 @@ load("@aspect_bazel_lib//lib:directory_path.bzl", _directory_path = "directory_path") load("@aspect_rules_js//js:defs.bzl", _js_binary = "js_binary", _js_run_binary = "js_run_binary", _js_test = "js_test") -def webpack_bundle_analyzer(name, **kwargs): +def _webpack_bundle_analyzer_internal(name, link_root_name, **kwargs): + store_target_name = "{}/webpack-bundle-analyzer/store/4.5.0_bufferutil@4.0.1".format(link_root_name) _directory_path( name = "%s__entry_point" % name, - directory = "@//:store_link__webpack-bundle-analyzer__4.5.0__bufferutil_4.0.1__dir", + directory = "@//:{}/dir".format(store_target_name), path = "lib/bin/analyzer.js", ) _js_binary( name = "%s__js_binary" % name, entry_point = ":%s__entry_point" % name, - data = ["@//:store_link__webpack-bundle-analyzer__4.5.0__bufferutil_4.0.1"], + data = ["@//:{}".format(store_target_name)], ) _js_run_binary( name = name, @@ -20,30 +21,49 @@ def webpack_bundle_analyzer(name, **kwargs): **kwargs ) -def webpack_bundle_analyzer_test(name, **kwargs): +def _webpack_bundle_analyzer_test_internal(name, link_root_name, **kwargs): + store_target_name = "{}/webpack-bundle-analyzer/store/4.5.0_bufferutil@4.0.1".format(link_root_name) _directory_path( name = "%s__entry_point" % name, - directory = "@//:store_link__webpack-bundle-analyzer__4.5.0__bufferutil_4.0.1__dir", + directory = "@//:{}/dir".format(store_target_name), path = "lib/bin/analyzer.js", ) _js_test( name = name, entry_point = ":%s__entry_point" % name, - data = kwargs.pop("data", []) + ["@//:store_link__webpack-bundle-analyzer__4.5.0__bufferutil_4.0.1"], + data = kwargs.pop("data", []) + ["@//:{}".format(store_target_name)], **kwargs ) -def webpack_bundle_analyzer_binary(name, **kwargs): +def _webpack_bundle_analyzer_binary_internal(name, link_root_name, **kwargs): + store_target_name = "{}/webpack-bundle-analyzer/store/4.5.0_bufferutil@4.0.1".format(link_root_name) _directory_path( name = "%s__entry_point" % name, - directory = "@//:store_link__webpack-bundle-analyzer__4.5.0__bufferutil_4.0.1__dir", + directory = "@//:{}/dir".format(store_target_name), path = "lib/bin/analyzer.js", ) _js_binary( name = name, entry_point = ":%s__entry_point" % name, - data = kwargs.pop("data", []) + ["@//:store_link__webpack-bundle-analyzer__4.5.0__bufferutil_4.0.1"], + data = kwargs.pop("data", []) + ["@//:{}".format(store_target_name)], **kwargs ) -bin = struct(webpack_bundle_analyzer = webpack_bundle_analyzer, webpack_bundle_analyzer_test = webpack_bundle_analyzer_test, webpack_bundle_analyzer_binary = webpack_bundle_analyzer_binary) +def webpack_bundle_analyzer(name, **kwargs): + _webpack_bundle_analyzer_internal(name, "node_modules", **kwargs) + +def webpack_bundle_analyzer_test(name, **kwargs): + _webpack_bundle_analyzer_test_internal(name, "node_modules", **kwargs) + +def webpack_bundle_analyzer_binary(name, **kwargs): + _webpack_bundle_analyzer_binary_internal(name, "node_modules", **kwargs) + +def bin_factory(link_root_name): + # bind link_root_name using lambdas + return struct( + webpack_bundle_analyzer = lambda name, **kwargs: _webpack_bundle_analyzer_internal(name, link_root_name = link_root_name, **kwargs), + webpack_bundle_analyzer_test = lambda name, **kwargs: _webpack_bundle_analyzer_test_internal(name, link_root_name = link_root_name, **kwargs), + webpack_bundle_analyzer_binary = lambda name, **kwargs: _webpack_bundle_analyzer_binary_internal(name, link_root_name = link_root_name, **kwargs), + ) + +bin = bin_factory("node_modules") diff --git a/npm/private/test/repositories_checked.bzl b/npm/private/test/repositories_checked.bzl index e495bfa99..39f74d1d7 100755 --- a/npm/private/test/repositories_checked.bzl +++ b/npm/private/test/repositories_checked.bzl @@ -8,7 +8,9 @@ def npm_repositories(): name = "npm__at_aspect-test_a__5.0.0", root_package = "", link_workspace = "", - link_packages = ["examples/npm_deps"], + link_packages = { + "examples/npm_deps": ["@aspect-test/a"], + }, package = "@aspect-test/a", version = "5.0.0", integrity = "sha512-t/lwpVXG/jmxTotGEsmjwuihC2Lvz/Iqt63o78SI3O5XallxtFp5j2WM2M6HwkFiii9I42KdlAF8B3plZMz0Fw==", @@ -29,7 +31,7 @@ def npm_repositories(): name = "npm__at_aspect-test_b__5.0.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "@aspect-test/b", version = "5.0.0", integrity = "sha512-MyIW6gHL3ds0BmDTOktorHLJUya5eZLGZlOxsKN2M9c3DWp+p1pBrA6KLQX1iq9BciryhpKwl82IAxP4jG52kw==", @@ -50,7 +52,7 @@ def npm_repositories(): name = "npm__at_aspect-test_c__1.0.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "@aspect-test/c", version = "1.0.0", integrity = "sha512-UorLD4TFr9CWFeYbUd5etaxSo201fYEFR+rSxXytfzefX41EWCBabsXhdhvXjK6v/HRuo1y1I1NiW2P3/bKJeA==", @@ -65,7 +67,9 @@ def npm_repositories(): name = "npm__at_aspect-test_c__2.0.0", root_package = "", link_workspace = "", - link_packages = ["examples/npm_deps"], + link_packages = { + "examples/npm_deps": ["@aspect-test/c"], + }, package = "@aspect-test/c", version = "2.0.0", integrity = "sha512-vRuHi/8zxZ+IRGdgdX4VoMNFZrR9UqO87yQx61IGIkjgV7QcKUeu5jfvIE3Mr0WNQeMdO1JpyTx1UUpsE73iug==", @@ -80,7 +84,7 @@ def npm_repositories(): name = "npm__at_aspect-test_d__2.0.0__at_aspect-test_c_1.0.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "@aspect-test/d", version = "2.0.0_@aspect-test+c@1.0.0", integrity = "sha512-jndwr8pLUfn795uApTcXG/yZ5hV2At1aS/wo5BVLxqlVVgLoOETF/Dp4QOjMHE/SXkXFowz6Hao+WpmzVvAO0A==", @@ -97,7 +101,7 @@ def npm_repositories(): name = "npm__at_aspect-test_d__2.0.0__at_aspect-test_c_2.0.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "@aspect-test/d", version = "2.0.0_@aspect-test+c@2.0.0", integrity = "sha512-jndwr8pLUfn795uApTcXG/yZ5hV2At1aS/wo5BVLxqlVVgLoOETF/Dp4QOjMHE/SXkXFowz6Hao+WpmzVvAO0A==", @@ -114,7 +118,7 @@ def npm_repositories(): name = "npm__at_gregmagolan_test-a__0.0.1", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "@gregmagolan/test-a", version = "0.0.1", integrity = "sha512-nMZ3MKkXZ+uYbrm8R3dfdt3v1gOOLtf88CdDciWxMYGLr29oVjQG11y2fz4IRBR6R7hI2Gj+G9sHZ69wLTnjfA==", @@ -129,7 +133,9 @@ def npm_repositories(): name = "npm__at_gregmagolan_test-b__0.0.2", root_package = "", link_workspace = "", - link_packages = ["examples/npm_deps"], + link_packages = { + "examples/npm_deps": ["@gregmagolan/test-b"], + }, package = "@gregmagolan/test-b", version = "0.0.2", integrity = "sha512-h+LeJUbUued9XyQwxKMUdklGiGxPYJ1RvTAK9612ctCiMS2Fn0wu/Au5kHsMHxm8l4bOfpgAWmQ0OQQy7wUBCg==", @@ -142,11 +148,26 @@ def npm_repositories(): }, ) + npm_import( + name = "npm__at_plotly_regl__2.1.2", + root_package = "", + link_workspace = "", + link_packages = { + "npm/private/test": ["@plotly/regl", "regl"], + }, + package = "@plotly/regl", + version = "2.1.2", + integrity = "sha512-Mdk+vUACbQvjd0m/1JJjOOafmkp/EpmHjISsopEz5Av44CBq7rPC05HHNbYGKVyNUF2zmEoBS/TT0pd0SPFFyw==", + transitive_closure = { + "@plotly/regl": ["2.1.2"], + }, + ) + npm_import( name = "npm__at_polka_url__1.0.0-next.21", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "@polka/url", version = "1.0.0-next.21", integrity = "sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g==", @@ -159,7 +180,9 @@ def npm_repositories(): name = "npm__at_rollup_plugin-commonjs__21.1.0__rollup_2.70.2", root_package = "", link_workspace = "", - link_packages = ["examples/npm_deps"], + link_packages = { + "examples/npm_deps": ["@rollup/plugin-commonjs"], + }, package = "@rollup/plugin-commonjs", version = "21.1.0_rollup@2.70.2", integrity = "sha512-6ZtHx3VHIp2ReNNDxHjuUml6ur+WcQ28N1yHgCQwsbNkQg2suhxGMDQGJOn/KuDxKtd1xuZP5xSTwBA4GQ8hbA==", @@ -209,7 +232,7 @@ def npm_repositories(): name = "npm__at_rollup_pluginutils__3.1.0__rollup_2.70.2", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "@rollup/pluginutils", version = "3.1.0_rollup@2.70.2", integrity = "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==", @@ -233,7 +256,7 @@ def npm_repositories(): name = "npm__at_types_estree__0.0.39", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "@types/estree", version = "0.0.39", integrity = "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", @@ -246,7 +269,7 @@ def npm_repositories(): name = "npm__at_types_estree__0.0.51", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "@types/estree", version = "0.0.51", integrity = "sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ==", @@ -259,7 +282,9 @@ def npm_repositories(): name = "npm__at_types_node__16.11.36", root_package = "", link_workspace = "", - link_packages = [""], + link_packages = { + "": ["@types/node"], + }, package = "@types/node", version = "16.11.36", integrity = "sha512-FR5QJe+TaoZ2GsMHkjuwoNabr+UrJNRr2HNOo+r/7vhcuntM6Ee/pRPOnRhhL2XE9OOvX9VLEq+BcXl3VjNoWA==", @@ -272,7 +297,7 @@ def npm_repositories(): name = "npm__at_ungap_promise-all-settled__1.1.2", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "@ungap/promise-all-settled", version = "1.1.2", integrity = "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", @@ -285,7 +310,7 @@ def npm_repositories(): name = "npm__acorn-walk__8.2.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "acorn-walk", version = "8.2.0", integrity = "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", @@ -298,7 +323,9 @@ def npm_repositories(): name = "npm__acorn__8.7.1", root_package = "", link_workspace = "", - link_packages = [], + link_packages = { + "examples/lib": ["acorn"], + }, package = "acorn", version = "8.7.1", integrity = "sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A==", @@ -311,7 +338,7 @@ def npm_repositories(): name = "npm__ansi-colors__4.1.1", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "ansi-colors", version = "4.1.1", integrity = "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", @@ -324,7 +351,7 @@ def npm_repositories(): name = "npm__ansi-regex__5.0.1", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "ansi-regex", version = "5.0.1", integrity = "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", @@ -337,7 +364,7 @@ def npm_repositories(): name = "npm__ansi-styles__4.3.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "ansi-styles", version = "4.3.0", integrity = "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", @@ -355,7 +382,7 @@ def npm_repositories(): name = "npm__anymatch__3.1.2", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "anymatch", version = "3.1.2", integrity = "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", @@ -374,7 +401,7 @@ def npm_repositories(): name = "npm__argparse__2.0.1", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "argparse", version = "2.0.1", integrity = "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", @@ -387,7 +414,7 @@ def npm_repositories(): name = "npm__balanced-match__1.0.2", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "balanced-match", version = "1.0.2", integrity = "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", @@ -400,7 +427,7 @@ def npm_repositories(): name = "npm__binary-extensions__2.2.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "binary-extensions", version = "2.2.0", integrity = "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", @@ -413,7 +440,7 @@ def npm_repositories(): name = "npm__brace-expansion__1.1.11", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "brace-expansion", version = "1.1.11", integrity = "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", @@ -432,7 +459,7 @@ def npm_repositories(): name = "npm__brace-expansion__2.0.1", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "brace-expansion", version = "2.0.1", integrity = "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", @@ -449,7 +476,7 @@ def npm_repositories(): name = "npm__braces__3.0.2", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "braces", version = "3.0.2", integrity = "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", @@ -468,7 +495,7 @@ def npm_repositories(): name = "npm__browser-stdout__1.3.1", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "browser-stdout", version = "1.3.1", integrity = "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", @@ -481,7 +508,9 @@ def npm_repositories(): name = "npm__bufferutil__4.0.1", root_package = "", link_workspace = "", - link_packages = ["npm/private/test"], + link_packages = { + "npm/private/test": ["bufferutil"], + }, package = "bufferutil", version = "4.0.1", integrity = "sha512-xowrxvpxojqkagPcWRQVXZl0YXhRhAtBEIq3VoER1NH5Mw1n1o0ojdspp+GS2J//2gCVyrzQDApQ4unGF+QOoA==", @@ -499,7 +528,7 @@ def npm_repositories(): name = "npm__camelcase__6.3.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "camelcase", version = "6.3.0", integrity = "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", @@ -512,7 +541,7 @@ def npm_repositories(): name = "npm__chalk__4.1.2", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "chalk", version = "4.1.2", integrity = "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", @@ -534,7 +563,7 @@ def npm_repositories(): name = "npm__charenc__0.0.2", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "charenc", version = "0.0.2", integrity = "sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc=", @@ -547,7 +576,7 @@ def npm_repositories(): name = "npm__chokidar__3.5.3", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "chokidar", version = "3.5.3", integrity = "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", @@ -584,7 +613,7 @@ def npm_repositories(): name = "npm__cliui__7.0.4", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "cliui", version = "7.0.4", integrity = "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", @@ -611,7 +640,7 @@ def npm_repositories(): name = "npm__color-convert__2.0.1", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "color-convert", version = "2.0.1", integrity = "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", @@ -628,7 +657,7 @@ def npm_repositories(): name = "npm__color-name__1.1.4", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "color-name", version = "1.1.4", integrity = "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", @@ -641,7 +670,7 @@ def npm_repositories(): name = "npm__commander__7.2.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "commander", version = "7.2.0", integrity = "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", @@ -654,7 +683,7 @@ def npm_repositories(): name = "npm__commondir__1.0.1", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "commondir", version = "1.0.1", integrity = "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", @@ -667,7 +696,7 @@ def npm_repositories(): name = "npm__concat-map__0.0.1", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "concat-map", version = "0.0.1", integrity = "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", @@ -680,7 +709,7 @@ def npm_repositories(): name = "npm__crypt__0.0.2", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "crypt", version = "0.0.2", integrity = "sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs=", @@ -693,7 +722,7 @@ def npm_repositories(): name = "npm__debug__2.6.9", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "debug", version = "2.6.9", integrity = "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", @@ -710,7 +739,7 @@ def npm_repositories(): name = "npm__debug__4.3.4", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "debug", version = "4.3.4", integrity = "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", @@ -727,7 +756,7 @@ def npm_repositories(): name = "npm__debug__4.3.4__supports-color_8.1.1", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "debug", version = "4.3.4_supports-color@8.1.1", integrity = "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", @@ -747,7 +776,7 @@ def npm_repositories(): name = "npm__decamelize__4.0.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "decamelize", version = "4.0.0", integrity = "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", @@ -760,7 +789,7 @@ def npm_repositories(): name = "npm__dequal__2.0.2", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "dequal", version = "2.0.2", integrity = "sha512-q9K8BlJVxK7hQYqa6XISGmBZbtQQWVXSrRrWreHC94rMt1QL/Impruc+7p2CYSYuVIUr+YCt6hjrs1kkdJRTug==", @@ -773,7 +802,7 @@ def npm_repositories(): name = "npm__diff__5.0.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "diff", version = "5.0.0", integrity = "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", @@ -786,7 +815,7 @@ def npm_repositories(): name = "npm__diff__5.1.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "diff", version = "5.1.0", integrity = "sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw==", @@ -799,7 +828,7 @@ def npm_repositories(): name = "npm__duplexer__0.1.2", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "duplexer", version = "0.1.2", integrity = "sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==", @@ -812,7 +841,7 @@ def npm_repositories(): name = "npm__emoji-regex__8.0.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "emoji-regex", version = "8.0.0", integrity = "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", @@ -825,7 +854,7 @@ def npm_repositories(): name = "npm__esbuild-android-64__0.14.38", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "esbuild-android-64", version = "0.14.38", integrity = "sha512-aRFxR3scRKkbmNuGAK+Gee3+yFxkTJO/cx83Dkyzo4CnQl/2zVSurtG6+G86EQIZ+w+VYngVyK7P3HyTBKu3nw==", @@ -839,7 +868,7 @@ def npm_repositories(): name = "npm__esbuild-android-arm64__0.14.38", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "esbuild-android-arm64", version = "0.14.38", integrity = "sha512-L2NgQRWuHFI89IIZIlpAcINy9FvBk6xFVZ7xGdOwIm8VyhX1vNCEqUJO3DPSSy945Gzdg98cxtNt8Grv1CsyhA==", @@ -853,7 +882,7 @@ def npm_repositories(): name = "npm__esbuild-darwin-64__0.14.38", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "esbuild-darwin-64", version = "0.14.38", integrity = "sha512-5JJvgXkX87Pd1Og0u/NJuO7TSqAikAcQQ74gyJ87bqWRVeouky84ICoV4sN6VV53aTW+NE87qLdGY4QA2S7KNA==", @@ -867,7 +896,7 @@ def npm_repositories(): name = "npm__esbuild-darwin-arm64__0.14.38", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "esbuild-darwin-arm64", version = "0.14.38", integrity = "sha512-eqF+OejMI3mC5Dlo9Kdq/Ilbki9sQBw3QlHW3wjLmsLh+quNfHmGMp3Ly1eWm981iGBMdbtSS9+LRvR2T8B3eQ==", @@ -881,7 +910,7 @@ def npm_repositories(): name = "npm__esbuild-freebsd-64__0.14.38", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "esbuild-freebsd-64", version = "0.14.38", integrity = "sha512-epnPbhZUt93xV5cgeY36ZxPXDsQeO55DppzsIgWM8vgiG/Rz+qYDLmh5ts3e+Ln1wA9dQ+nZmVHw+RjaW3I5Ig==", @@ -895,7 +924,7 @@ def npm_repositories(): name = "npm__esbuild-freebsd-arm64__0.14.38", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "esbuild-freebsd-arm64", version = "0.14.38", integrity = "sha512-/9icXUYJWherhk+y5fjPI5yNUdFPtXHQlwP7/K/zg8t8lQdHVj20SqU9/udQmeUo5pDFHMYzcEFfJqgOVeKNNQ==", @@ -909,7 +938,7 @@ def npm_repositories(): name = "npm__esbuild-linux-32__0.14.38", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "esbuild-linux-32", version = "0.14.38", integrity = "sha512-QfgfeNHRFvr2XeHFzP8kOZVnal3QvST3A0cgq32ZrHjSMFTdgXhMhmWdKzRXP/PKcfv3e2OW9tT9PpcjNvaq6g==", @@ -923,7 +952,7 @@ def npm_repositories(): name = "npm__esbuild-linux-64__0.14.38", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "esbuild-linux-64", version = "0.14.38", integrity = "sha512-uuZHNmqcs+Bj1qiW9k/HZU3FtIHmYiuxZ/6Aa+/KHb/pFKr7R3aVqvxlAudYI9Fw3St0VCPfv7QBpUITSmBR1Q==", @@ -937,7 +966,7 @@ def npm_repositories(): name = "npm__esbuild-linux-arm__0.14.38", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "esbuild-linux-arm", version = "0.14.38", integrity = "sha512-FiFvQe8J3VKTDXG01JbvoVRXQ0x6UZwyrU4IaLBZeq39Bsbatd94Fuc3F1RGqPF5RbIWW7RvkVQjn79ejzysnA==", @@ -951,7 +980,7 @@ def npm_repositories(): name = "npm__esbuild-linux-arm64__0.14.38", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "esbuild-linux-arm64", version = "0.14.38", integrity = "sha512-HlMGZTEsBrXrivr64eZ/EO0NQM8H8DuSENRok9d+Jtvq8hOLzrxfsAT9U94K3KOGk2XgCmkaI2KD8hX7F97lvA==", @@ -965,7 +994,7 @@ def npm_repositories(): name = "npm__esbuild-linux-mips64le__0.14.38", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "esbuild-linux-mips64le", version = "0.14.38", integrity = "sha512-qd1dLf2v7QBiI5wwfil9j0HG/5YMFBAmMVmdeokbNAMbcg49p25t6IlJFXAeLzogv1AvgaXRXvgFNhScYEUXGQ==", @@ -979,7 +1008,7 @@ def npm_repositories(): name = "npm__esbuild-linux-ppc64le__0.14.38", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "esbuild-linux-ppc64le", version = "0.14.38", integrity = "sha512-mnbEm7o69gTl60jSuK+nn+pRsRHGtDPfzhrqEUXyCl7CTOCLtWN2bhK8bgsdp6J/2NyS/wHBjs1x8aBWwP2X9Q==", @@ -993,7 +1022,7 @@ def npm_repositories(): name = "npm__esbuild-linux-riscv64__0.14.38", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "esbuild-linux-riscv64", version = "0.14.38", integrity = "sha512-+p6YKYbuV72uikChRk14FSyNJZ4WfYkffj6Af0/Tw63/6TJX6TnIKE+6D3xtEc7DeDth1fjUOEqm+ApKFXbbVQ==", @@ -1007,7 +1036,7 @@ def npm_repositories(): name = "npm__esbuild-linux-s390x__0.14.38", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "esbuild-linux-s390x", version = "0.14.38", integrity = "sha512-0zUsiDkGJiMHxBQ7JDU8jbaanUY975CdOW1YDrurjrM0vWHfjv9tLQsW9GSyEb/heSK1L5gaweRjzfUVBFoybQ==", @@ -1021,7 +1050,7 @@ def npm_repositories(): name = "npm__esbuild-netbsd-64__0.14.38", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "esbuild-netbsd-64", version = "0.14.38", integrity = "sha512-cljBAApVwkpnJZfnRVThpRBGzCi+a+V9Ofb1fVkKhtrPLDYlHLrSYGtmnoTVWDQdU516qYI8+wOgcGZ4XIZh0Q==", @@ -1035,7 +1064,7 @@ def npm_repositories(): name = "npm__esbuild-openbsd-64__0.14.38", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "esbuild-openbsd-64", version = "0.14.38", integrity = "sha512-CDswYr2PWPGEPpLDUO50mL3WO/07EMjnZDNKpmaxUPsrW+kVM3LoAqr/CE8UbzugpEiflYqJsGPLirThRB18IQ==", @@ -1049,7 +1078,7 @@ def npm_repositories(): name = "npm__esbuild-sunos-64__0.14.38", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "esbuild-sunos-64", version = "0.14.38", integrity = "sha512-2mfIoYW58gKcC3bck0j7lD3RZkqYA7MmujFYmSn9l6TiIcAMpuEvqksO+ntBgbLep/eyjpgdplF7b+4T9VJGOA==", @@ -1063,7 +1092,7 @@ def npm_repositories(): name = "npm__esbuild-windows-32__0.14.38", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "esbuild-windows-32", version = "0.14.38", integrity = "sha512-L2BmEeFZATAvU+FJzJiRLFUP+d9RHN+QXpgaOrs2klshoAm1AE6Us4X6fS9k33Uy5SzScn2TpcgecbqJza1Hjw==", @@ -1077,7 +1106,7 @@ def npm_repositories(): name = "npm__esbuild-windows-64__0.14.38", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "esbuild-windows-64", version = "0.14.38", integrity = "sha512-Khy4wVmebnzue8aeSXLC+6clo/hRYeNIm0DyikoEqX+3w3rcvrhzpoix0S+MF9vzh6JFskkIGD7Zx47ODJNyCw==", @@ -1091,7 +1120,7 @@ def npm_repositories(): name = "npm__esbuild-windows-arm64__0.14.38", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "esbuild-windows-arm64", version = "0.14.38", integrity = "sha512-k3FGCNmHBkqdJXuJszdWciAH77PukEyDsdIryEHn9cKLQFxzhT39dSumeTuggaQcXY57UlmLGIkklWZo2qzHpw==", @@ -1105,7 +1134,9 @@ def npm_repositories(): name = "npm__esbuild__0.14.38", root_package = "", link_workspace = "", - link_packages = ["npm/private/test"], + link_packages = { + "npm/private/test": ["esbuild"], + }, package = "esbuild", version = "0.14.38", integrity = "sha512-12fzJ0fsm7gVZX1YQ1InkOE5f9Tl7cgf6JPYXRJtPIoE0zkWAbHdPHVPPaLi9tYAcEBqheGzqLn/3RdTOyBfcA==", @@ -1161,7 +1192,7 @@ def npm_repositories(): name = "npm__escalade__3.1.1", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "escalade", version = "3.1.1", integrity = "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", @@ -1174,7 +1205,7 @@ def npm_repositories(): name = "npm__escape-string-regexp__4.0.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "escape-string-regexp", version = "4.0.0", integrity = "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", @@ -1187,7 +1218,7 @@ def npm_repositories(): name = "npm__esprima__1.0.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "esprima", version = "1.0.0", integrity = "sha512-k344tuMul8eif80+WDaTCcS5g4xDSO6FRHmCkvlF6t/QSBYQDrvph2VqP23ry9y9oMVEJ/sdJEh8JXT0smlcQQ==", @@ -1200,7 +1231,7 @@ def npm_repositories(): name = "npm__estree-walker__1.0.1", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "estree-walker", version = "1.0.1", integrity = "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==", @@ -1213,7 +1244,7 @@ def npm_repositories(): name = "npm__estree-walker__2.0.2", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "estree-walker", version = "2.0.2", integrity = "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", @@ -1226,7 +1257,7 @@ def npm_repositories(): name = "npm__fill-range__7.0.1", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "fill-range", version = "7.0.1", integrity = "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", @@ -1244,7 +1275,7 @@ def npm_repositories(): name = "npm__find-up__5.0.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "find-up", version = "5.0.0", integrity = "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", @@ -1266,7 +1297,7 @@ def npm_repositories(): name = "npm__flat__5.0.2", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "flat", version = "5.0.2", integrity = "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", @@ -1279,7 +1310,7 @@ def npm_repositories(): name = "npm__fs.realpath__1.0.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "fs.realpath", version = "1.0.0", integrity = "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", @@ -1292,7 +1323,7 @@ def npm_repositories(): name = "npm__fsevents__2.3.2", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "fsevents", version = "2.3.2", integrity = "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", @@ -1306,7 +1337,7 @@ def npm_repositories(): name = "npm__function-bind__1.1.1", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "function-bind", version = "1.1.1", integrity = "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", @@ -1319,7 +1350,7 @@ def npm_repositories(): name = "npm__get-caller-file__2.0.5", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "get-caller-file", version = "2.0.5", integrity = "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", @@ -1332,7 +1363,7 @@ def npm_repositories(): name = "npm__glob-parent__5.1.2", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "glob-parent", version = "5.1.2", integrity = "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", @@ -1350,7 +1381,7 @@ def npm_repositories(): name = "npm__glob__7.2.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "glob", version = "7.2.0", integrity = "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", @@ -1381,7 +1412,7 @@ def npm_repositories(): name = "npm__glob__7.2.3", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "glob", version = "7.2.3", integrity = "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", @@ -1412,7 +1443,7 @@ def npm_repositories(): name = "npm__gzip-size__6.0.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "gzip-size", version = "6.0.0", integrity = "sha512-ax7ZYomf6jqPTQ4+XCpUGyXKHk5WweS+e05MBO4/y3WJ5RkmPXNKvX+bx1behVILVwr6JSQvZAku021CHPXG3Q==", @@ -1429,7 +1460,7 @@ def npm_repositories(): name = "npm__has-flag__4.0.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "has-flag", version = "4.0.0", integrity = "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", @@ -1442,7 +1473,7 @@ def npm_repositories(): name = "npm__has__1.0.3", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "has", version = "1.0.3", integrity = "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", @@ -1459,7 +1490,7 @@ def npm_repositories(): name = "npm__he__1.2.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "he", version = "1.2.0", integrity = "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", @@ -1472,7 +1503,7 @@ def npm_repositories(): name = "npm__inflight__1.0.6", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "inflight", version = "1.0.6", integrity = "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", @@ -1491,7 +1522,7 @@ def npm_repositories(): name = "npm__inherits__2.0.4", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "inherits", version = "2.0.4", integrity = "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", @@ -1504,7 +1535,7 @@ def npm_repositories(): name = "npm__is-binary-path__2.1.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "is-binary-path", version = "2.1.0", integrity = "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", @@ -1521,7 +1552,7 @@ def npm_repositories(): name = "npm__is-buffer__1.1.6", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "is-buffer", version = "1.1.6", integrity = "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", @@ -1534,7 +1565,7 @@ def npm_repositories(): name = "npm__is-core-module__2.9.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "is-core-module", version = "2.9.0", integrity = "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==", @@ -1552,7 +1583,7 @@ def npm_repositories(): name = "npm__is-extglob__2.1.1", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "is-extglob", version = "2.1.1", integrity = "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", @@ -1565,7 +1596,7 @@ def npm_repositories(): name = "npm__is-fullwidth-code-point__3.0.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "is-fullwidth-code-point", version = "3.0.0", integrity = "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", @@ -1578,7 +1609,7 @@ def npm_repositories(): name = "npm__is-glob__4.0.3", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "is-glob", version = "4.0.3", integrity = "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", @@ -1595,7 +1626,7 @@ def npm_repositories(): name = "npm__is-number__7.0.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "is-number", version = "7.0.0", integrity = "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", @@ -1608,7 +1639,7 @@ def npm_repositories(): name = "npm__is-plain-obj__2.1.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "is-plain-obj", version = "2.1.0", integrity = "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", @@ -1621,7 +1652,7 @@ def npm_repositories(): name = "npm__is-reference__1.2.1", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "is-reference", version = "1.2.1", integrity = "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", @@ -1638,7 +1669,7 @@ def npm_repositories(): name = "npm__is-unicode-supported__0.1.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "is-unicode-supported", version = "0.1.0", integrity = "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", @@ -1651,7 +1682,7 @@ def npm_repositories(): name = "npm__js-tokens__4.0.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "js-tokens", version = "4.0.0", integrity = "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", @@ -1664,7 +1695,7 @@ def npm_repositories(): name = "npm__js-yaml__4.1.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "js-yaml", version = "4.1.0", integrity = "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", @@ -1681,7 +1712,7 @@ def npm_repositories(): name = "npm__kleur__4.1.4", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "kleur", version = "4.1.4", integrity = "sha512-8QADVssbrFjivHWQU7KkMgptGTl6WAcSdlbBPY4uNF+mWr6DGcKrvY2w4FQJoXch7+fKMjj0dRrL75vk3k23OA==", @@ -1694,7 +1725,7 @@ def npm_repositories(): name = "npm__locate-path__6.0.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "locate-path", version = "6.0.0", integrity = "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", @@ -1713,7 +1744,7 @@ def npm_repositories(): name = "npm__lodash__4.17.21", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "lodash", version = "4.17.21", integrity = "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", @@ -1726,7 +1757,7 @@ def npm_repositories(): name = "npm__log-symbols__4.1.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "log-symbols", version = "4.1.0", integrity = "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", @@ -1750,7 +1781,7 @@ def npm_repositories(): name = "npm__loose-envify__1.4.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "loose-envify", version = "1.4.0", integrity = "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", @@ -1767,7 +1798,7 @@ def npm_repositories(): name = "npm__magic-string__0.25.9", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "magic-string", version = "0.25.9", integrity = "sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==", @@ -1784,7 +1815,7 @@ def npm_repositories(): name = "npm__md5__2.3.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "md5", version = "2.3.0", integrity = "sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==", @@ -1805,7 +1836,7 @@ def npm_repositories(): name = "npm__minimatch__3.1.2", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "minimatch", version = "3.1.2", integrity = "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", @@ -1824,7 +1855,7 @@ def npm_repositories(): name = "npm__minimatch__5.0.1", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "minimatch", version = "5.0.1", integrity = "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", @@ -1842,7 +1873,7 @@ def npm_repositories(): name = "npm__minimist__0.0.10", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "minimist", version = "0.0.10", integrity = "sha512-iotkTvxc+TwOm5Ieim8VnSNvCDjCK9S8G3scJ50ZthspSxa7jx50jkhYduuAtAjvfDUwSgOwf8+If99AlOEhyw==", @@ -1855,7 +1886,7 @@ def npm_repositories(): name = "npm__minimist__1.2.6", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "minimist", version = "1.2.6", integrity = "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", @@ -1868,7 +1899,7 @@ def npm_repositories(): name = "npm__mkdirp__0.5.6", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "mkdirp", version = "0.5.6", integrity = "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", @@ -1885,7 +1916,7 @@ def npm_repositories(): name = "npm__mobx-react-lite__3.4.0__mobx_6.3.0_react_17.0.2", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "mobx-react-lite", version = "3.4.0_mobx@6.3.0+react@17.0.2", integrity = "sha512-bRuZp3C0itgLKHu/VNxi66DN/XVkQG7xtoBVWxpvC5FhAqbOCP21+nPhULjnzEqd7xBMybp6KwytdUpZKEgpIQ==", @@ -1907,7 +1938,9 @@ def npm_repositories(): name = "npm__mobx-react__7.3.0__mobx_6.3.0_react_17.0.2", root_package = "", link_workspace = "", - link_packages = ["examples/npm_deps"], + link_packages = { + "examples/npm_deps": ["mobx-react"], + }, package = "mobx-react", version = "7.3.0_mobx@6.3.0+react@17.0.2", integrity = "sha512-RGEcwZokopqyJE5JPwXKB9FWMSqFM9NJVO2QPI+z6laJTJeBHqvPicjnKgY5mvihxTeXB1+72TnooqUePeGV1g==", @@ -1931,7 +1964,9 @@ def npm_repositories(): name = "npm__mobx__6.3.0", root_package = "", link_workspace = "", - link_packages = ["examples/npm_deps"], + link_packages = { + "examples/npm_deps": ["mobx"], + }, package = "mobx", version = "6.3.0", integrity = "sha512-Aa1+VXsg4WxqJMTQfWoYuJi5UD10VZhiobSmcs5kcmI3BIT0aVtn7DysvCeDADCzl7dnbX+0BTHUj/v7gLlZpQ==", @@ -1944,7 +1979,9 @@ def npm_repositories(): name = "npm__mocha-junit-reporter__2.0.2__mocha_10.0.0", root_package = "", link_workspace = "", - link_packages = ["examples/macro"], + link_packages = { + "examples/macro": ["mocha-junit-reporter"], + }, package = "mocha-junit-reporter", version = "2.0.2_mocha@10.0.0", integrity = "sha512-vYwWq5hh3v1lG0gdQCBxwNipBfvDiAM1PHroQRNp96+2l72e9wEUTw+mzoK+O0SudgfQ7WvTQZ9Nh3qkAYAjfg==", @@ -2049,7 +2086,9 @@ def npm_repositories(): name = "npm__mocha-multi-reporters__1.5.1__mocha_10.0.0", root_package = "", link_workspace = "", - link_packages = ["examples/macro"], + link_packages = { + "examples/macro": ["mocha-multi-reporters"], + }, package = "mocha-multi-reporters", version = "1.5.1_mocha@10.0.0", integrity = "sha512-Yb4QJOaGLIcmB0VY7Wif5AjvLMUFAdV57D2TWEva1Y0kU/3LjKpeRVmlMIfuO1SVbauve459kgtIizADqxMWPg==", @@ -2143,7 +2182,9 @@ def npm_repositories(): name = "npm__mocha__10.0.0__th2rfume6p4m5jxelm27wrhnly", root_package = "", link_workspace = "", - link_packages = ["examples/macro"], + link_packages = { + "examples/macro": ["mocha"], + }, package = "mocha", version = "10.0.0_th2rfume6p4m5jxelm27wrhnly", integrity = "sha512-0Wl+elVUD43Y0BqPZBzZt8Tnkw9CMUdNYnUsTfOM1vuhJVZL+kiesFYsqwBkEEuEixaiPe5ZQdqDgX2jddhmoA==", @@ -2257,7 +2298,7 @@ def npm_repositories(): name = "npm__mri__1.2.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "mri", version = "1.2.0", integrity = "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==", @@ -2270,7 +2311,7 @@ def npm_repositories(): name = "npm__mrmime__1.0.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "mrmime", version = "1.0.0", integrity = "sha512-a70zx7zFfVO7XpnQ2IX1Myh9yY4UYvfld/dikWRnsXxbyvMcfz+u6UfgNAtH+k2QqtJuzVpv6eLTx1G2+WKZbQ==", @@ -2283,7 +2324,7 @@ def npm_repositories(): name = "npm__ms__0.7.3", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "ms", version = "0.7.3", integrity = "sha512-lrKNzMWqQZgwJahtrtrM+9NgOoDUveDrVmm5aGXrf3BdtL0mq7X6IVzoZaw+TfNti29eHd1/8GI+h45K5cQ6/w==", @@ -2296,7 +2337,7 @@ def npm_repositories(): name = "npm__ms__2.0.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "ms", version = "2.0.0", integrity = "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", @@ -2309,7 +2350,7 @@ def npm_repositories(): name = "npm__ms__2.1.2", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "ms", version = "2.1.2", integrity = "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", @@ -2322,7 +2363,7 @@ def npm_repositories(): name = "npm__ms__2.1.3", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "ms", version = "2.1.3", integrity = "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", @@ -2335,7 +2376,7 @@ def npm_repositories(): name = "npm__nanoid__3.3.3", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "nanoid", version = "3.3.3", integrity = "sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==", @@ -2348,7 +2389,7 @@ def npm_repositories(): name = "npm__node-gyp-build__3.7.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "node-gyp-build", version = "3.7.0", integrity = "sha512-L/Eg02Epx6Si2NXmedx+Okg+4UHqmaf3TNcxd50SF9NQGcJaON3AtU++kax69XV7YWz4tUspqZSAsVofhFKG2w==", @@ -2361,7 +2402,7 @@ def npm_repositories(): name = "npm__normalize-path__3.0.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "normalize-path", version = "3.0.0", integrity = "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", @@ -2374,7 +2415,7 @@ def npm_repositories(): name = "npm__object-assign__4.1.1", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "object-assign", version = "4.1.1", integrity = "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", @@ -2387,7 +2428,7 @@ def npm_repositories(): name = "npm__once__1.4.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "once", version = "1.4.0", integrity = "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", @@ -2404,7 +2445,7 @@ def npm_repositories(): name = "npm__opener__1.5.2", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "opener", version = "1.5.2", integrity = "sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A==", @@ -2417,7 +2458,7 @@ def npm_repositories(): name = "npm__optimist__0.6.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "optimist", version = "0.6.0", integrity = "sha512-ubrZPyOU0AHpXkmwqfWolap+eHMwQ484AKivkf0ZGyysd6fUJZl7ow9iu5UNV1vCZv46HQ7EM83IC3NGJ820hg==", @@ -2436,7 +2477,7 @@ def npm_repositories(): name = "npm__p-limit__3.1.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "p-limit", version = "3.1.0", integrity = "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", @@ -2453,7 +2494,7 @@ def npm_repositories(): name = "npm__p-locate__5.0.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "p-locate", version = "5.0.0", integrity = "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", @@ -2471,7 +2512,7 @@ def npm_repositories(): name = "npm__path-exists__4.0.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "path-exists", version = "4.0.0", integrity = "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", @@ -2484,7 +2525,7 @@ def npm_repositories(): name = "npm__path-is-absolute__1.0.1", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "path-is-absolute", version = "1.0.1", integrity = "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", @@ -2497,7 +2538,7 @@ def npm_repositories(): name = "npm__path-parse__1.0.7", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "path-parse", version = "1.0.7", integrity = "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", @@ -2510,7 +2551,7 @@ def npm_repositories(): name = "npm__picomatch__2.3.1", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "picomatch", version = "2.3.1", integrity = "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", @@ -2523,7 +2564,7 @@ def npm_repositories(): name = "npm__randombytes__2.1.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "randombytes", version = "2.1.0", integrity = "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", @@ -2540,7 +2581,9 @@ def npm_repositories(): name = "npm__react__17.0.2", root_package = "", link_workspace = "", - link_packages = ["examples/npm_deps"], + link_packages = { + "examples/npm_deps": ["react"], + }, package = "react", version = "17.0.2", integrity = "sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==", @@ -2560,7 +2603,7 @@ def npm_repositories(): name = "npm__readdirp__3.6.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "readdirp", version = "3.6.0", integrity = "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", @@ -2577,7 +2620,7 @@ def npm_repositories(): name = "npm__require-directory__2.1.1", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "require-directory", version = "2.1.1", integrity = "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", @@ -2590,7 +2633,7 @@ def npm_repositories(): name = "npm__resolve__1.22.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "resolve", version = "1.22.0", integrity = "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==", @@ -2613,7 +2656,9 @@ def npm_repositories(): name = "npm__rollup__2.70.2", root_package = "", link_workspace = "", - link_packages = ["examples/npm_deps"], + link_packages = { + "examples/npm_deps": ["rollup"], + }, package = "rollup", version = "2.70.2", integrity = "sha512-EitogNZnfku65I1DD5Mxe8JYRUCy0hkK5X84IlDtUs+O6JRMpRciXTzyCUuX11b5L5pvjH+OmFXiQ3XjabcXgg==", @@ -2630,7 +2675,7 @@ def npm_repositories(): name = "npm__sade__1.8.1", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "sade", version = "1.8.1", integrity = "sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==", @@ -2647,7 +2692,7 @@ def npm_repositories(): name = "npm__safe-buffer__5.2.1", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "safe-buffer", version = "5.2.1", integrity = "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", @@ -2660,7 +2705,7 @@ def npm_repositories(): name = "npm__serialize-javascript__6.0.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "serialize-javascript", version = "6.0.0", integrity = "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", @@ -2678,7 +2723,7 @@ def npm_repositories(): name = "npm__sirv__1.0.19", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "sirv", version = "1.0.19", integrity = "sha512-JuLThK3TnZG1TAKDwNIqNq6QA2afLOCcm+iE8D1Kj3GA40pSPsxQjjJl0J8X3tsR7T+CP1GavpzLwYkgVLWrZQ==", @@ -2699,7 +2744,7 @@ def npm_repositories(): name = "npm__sourcemap-codec__1.4.8", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "sourcemap-codec", version = "1.4.8", integrity = "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", @@ -2712,7 +2757,7 @@ def npm_repositories(): name = "npm__string-width__4.2.3", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "string-width", version = "4.2.3", integrity = "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", @@ -2734,7 +2779,7 @@ def npm_repositories(): name = "npm__strip-ansi__6.0.1", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "strip-ansi", version = "6.0.1", integrity = "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", @@ -2751,7 +2796,7 @@ def npm_repositories(): name = "npm__strip-json-comments__3.1.1", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "strip-json-comments", version = "3.1.1", integrity = "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", @@ -2764,7 +2809,7 @@ def npm_repositories(): name = "npm__supports-color__7.2.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "supports-color", version = "7.2.0", integrity = "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", @@ -2781,7 +2826,7 @@ def npm_repositories(): name = "npm__supports-color__8.1.1", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "supports-color", version = "8.1.1", integrity = "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", @@ -2798,7 +2843,7 @@ def npm_repositories(): name = "npm__supports-preserve-symlinks-flag__1.0.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "supports-preserve-symlinks-flag", version = "1.0.0", integrity = "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", @@ -2811,7 +2856,7 @@ def npm_repositories(): name = "npm__to-regex-range__5.0.1", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "to-regex-range", version = "5.0.1", integrity = "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", @@ -2828,7 +2873,7 @@ def npm_repositories(): name = "npm__totalist__1.1.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "totalist", version = "1.1.0", integrity = "sha512-gduQwd1rOdDMGxFG1gEvhV88Oirdo2p+KjoYFU7k2g+i7n6AFFbDQ5kMPUsW0pNbfQsB/cwXvT1i4Bue0s9g5g==", @@ -2841,7 +2886,9 @@ def npm_repositories(): name = "npm__typescript__4.7.2", root_package = "", link_workspace = "", - link_packages = [""], + link_packages = { + "": ["typescript"], + }, package = "typescript", version = "4.7.2", integrity = "sha512-Mamb1iX2FDUpcTRzltPxgWMKy3fhg0TN378ylbktPGPK/99KbDtMQ4W1hwgsbPAsG3a0xKa1vmw4VKZQbkvz5A==", @@ -2854,7 +2901,9 @@ def npm_repositories(): name = "npm__unused__0.2.2", root_package = "", link_workspace = "", - link_packages = ["npm/private/test"], + link_packages = { + "npm/private/test": ["unused"], + }, package = "unused", version = "0.2.2", integrity = "sha1-zhJIBInz3ZPRDxt6yDzA1YQj6qA=", @@ -2871,11 +2920,28 @@ def npm_repositories(): }, ) + npm_import( + name = "npm__uuid__8.3.2", + root_package = "", + link_workspace = "", + link_packages = { + "examples/lib": ["uuid"], + }, + package = "uuid", + version = "8.3.2", + integrity = "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + transitive_closure = { + "uuid": ["8.3.2"], + }, + ) + npm_import( name = "npm__uvu__0.5.3", root_package = "", link_workspace = "", - link_packages = ["examples/npm_deps"], + link_packages = { + "examples/npm_deps": ["uvu"], + }, package = "uvu", version = "0.5.3", integrity = "sha512-brFwqA3FXzilmtnIyJ+CxdkInkY/i4ErvP7uV0DnUVxQcQ55reuHphorpF+tZoVHK2MniZ/VJzI7zJQoc9T9Yw==", @@ -2899,7 +2965,9 @@ def npm_repositories(): name = "npm__webpack-bundle-analyzer__4.5.0__bufferutil_4.0.1", root_package = "", link_workspace = "", - link_packages = ["npm/private/test"], + link_packages = { + "npm/private/test": ["webpack-bundle-analyzer"], + }, package = "webpack-bundle-analyzer", version = "4.5.0_bufferutil@4.0.1", integrity = "sha512-GUMZlM3SKwS8Z+CKeIFx7CVoHn3dXFcUAjT/dcZQQmfSZGvitPfMob2ipjai7ovFFqPvTqkEZ/leL4O0YOdAYQ==", @@ -2943,7 +3011,7 @@ def npm_repositories(): name = "npm__wordwrap__0.0.3", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "wordwrap", version = "0.0.3", integrity = "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", @@ -2956,7 +3024,7 @@ def npm_repositories(): name = "npm__workerpool__6.2.1", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "workerpool", version = "6.2.1", integrity = "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==", @@ -2969,7 +3037,7 @@ def npm_repositories(): name = "npm__wrap-ansi__7.0.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "wrap-ansi", version = "7.0.0", integrity = "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", @@ -2995,7 +3063,7 @@ def npm_repositories(): name = "npm__wrappy__1.0.2", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "wrappy", version = "1.0.2", integrity = "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", @@ -3008,7 +3076,7 @@ def npm_repositories(): name = "npm__ws__7.5.8__bufferutil_4.0.1", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "ws", version = "7.5.8_bufferutil@4.0.1", integrity = "sha512-ri1Id1WinAX5Jqn9HejiGb8crfRio0Qgu8+MtL36rlTA6RLsMdWt1Az/19A2Qij6uSHUMphEFaTKa4WG+UNHNw==", @@ -3026,7 +3094,7 @@ def npm_repositories(): name = "npm__xml__1.0.1", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "xml", version = "1.0.1", integrity = "sha1-eLpyAgApxbyHuKgaPPzXS0ovweU=", @@ -3039,7 +3107,7 @@ def npm_repositories(): name = "npm__y18n__5.0.8", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "y18n", version = "5.0.8", integrity = "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", @@ -3052,7 +3120,7 @@ def npm_repositories(): name = "npm__yargs-parser__20.2.4", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "yargs-parser", version = "20.2.4", integrity = "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", @@ -3065,7 +3133,7 @@ def npm_repositories(): name = "npm__yargs-unparser__2.0.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "yargs-unparser", version = "2.0.0", integrity = "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", @@ -3088,7 +3156,7 @@ def npm_repositories(): name = "npm__yargs__16.2.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "yargs", version = "16.2.0", integrity = "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", @@ -3125,7 +3193,7 @@ def npm_repositories(): name = "npm__yocto-queue__0.1.0", root_package = "", link_workspace = "", - link_packages = [], + link_packages = {}, package = "yocto-queue", version = "0.1.0", integrity = "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", @@ -3138,7 +3206,9 @@ def npm_repositories(): name = "npm__debug__github.com_ngokevin_debug_9742c5f383a6f8046241920156236ade8ec30d53", root_package = "", link_workspace = "", - link_packages = ["npm/private/test"], + link_packages = { + "npm/private/test": ["debug"], + }, package = "debug", version = "github.com/ngokevin/debug/9742c5f383a6f8046241920156236ade8ec30d53", url = "https://codeload.github.com/ngokevin/debug/tar.gz/9742c5f383a6f8046241920156236ade8ec30d53", diff --git a/npm/private/utils.bzl b/npm/private/utils.bzl index f73c5a7f5..d6dd0933e 100644 --- a/npm/private/utils.bzl +++ b/npm/private/utils.bzl @@ -94,12 +94,8 @@ utils = struct( strip_peer_dep_version = _strip_peer_dep_version, # Symlinked node_modules structure virtual store path under node_modules virtual_store_root = ".aspect_rules_js", - # Prefix for npm_link_package_store links - store_link_prefix = "store_link__", - # Suffix for package directory filegroup - dir_suffix = "__dir", # Suffix for npm_import links repository - links_suffix = "__links", + links_repo_suffix = "__links", # Output group name for the package directory of a linked package package_directory_output_group = "package_directory", ) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c898eef9f..dc507105b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -10,6 +10,15 @@ importers: '@types/node': 16.11.36 typescript: 4.7.2 + examples/lib: + specifiers: + acorn: '*' + uuid: 8.3.2 + dependencies: + uuid: 8.3.2 + optionalDependencies: + acorn: 8.7.1 + examples/macro: specifiers: mocha: ^10.0.0 @@ -44,15 +53,19 @@ importers: npm/private/test: specifiers: + '@plotly/regl': 2.1.2 bufferutil: 4.0.1 debug: ngokevin/debug#9742c5f383a6f8046241920156236ade8ec30d53 esbuild: 0.14.38 + regl: npm:@plotly/regl@2.1.2 unused: latest webpack-bundle-analyzer: 4.5.0 devDependencies: + '@plotly/regl': 2.1.2 bufferutil: 4.0.1 debug: github.com/ngokevin/debug/9742c5f383a6f8046241920156236ade8ec30d53 esbuild: 0.14.38 + regl: /@plotly/regl/2.1.2 unused: 0.2.2 webpack-bundle-analyzer: 4.5.0_bufferutil@4.0.1 @@ -116,6 +129,10 @@ packages: '@gregmagolan/test-a': 0.0.1 dev: true + /@plotly/regl/2.1.2: + resolution: {integrity: sha512-Mdk+vUACbQvjd0m/1JJjOOafmkp/EpmHjISsopEz5Av44CBq7rPC05HHNbYGKVyNUF2zmEoBS/TT0pd0SPFFyw==} + dev: true + /@polka/url/1.0.0-next.21: resolution: {integrity: sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g==} dev: true @@ -173,7 +190,6 @@ packages: resolution: {integrity: sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A==} engines: {node: '>=0.4.0'} hasBin: true - dev: true /ansi-colors/4.1.1: resolution: {integrity: sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==} @@ -1189,6 +1205,11 @@ packages: optimist: 0.6.0 dev: true + /uuid/8.3.2: + resolution: {integrity: sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==} + hasBin: true + dev: false + /uvu/0.5.3: resolution: {integrity: sha512-brFwqA3FXzilmtnIyJ+CxdkInkY/i4ErvP7uV0DnUVxQcQ55reuHphorpF+tZoVHK2MniZ/VJzI7zJQoc9T9Yw==} engines: {node: '>=8'} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 550dbc91d..cd90aaedc 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,5 +1,5 @@ packages: + - 'examples/lib' - 'examples/macro' - 'examples/npm_deps' - - 'examples/macro' - 'npm/private/test'