From ef86fcc17c299a2ed1a6e580d45afa5b47e3f2ac Mon Sep 17 00:00:00 2001 From: Greg Magolan Date: Tue, 31 May 2022 10:50:00 -0700 Subject: [PATCH] feat: simplify public API link_js_package and package label helpers (#139) --- BUILD.bazel | 37 +- WORKSPACE | 7 +- docs/link_js_package.md | 97 ++- docs/npm_import.md | 8 +- e2e/link_js_package/BUILD.bazel | 2 +- e2e/link_js_package/src/BUILD.bazel | 4 +- e2e/pnpm_workspace_dot_dot/app/a/BUILD.bazel | 14 +- e2e/pnpm_workspace_dot_dot/app/b/BUILD.bazel | 24 +- e2e/rules_foo/foo/BUILD.bazel | 4 +- e2e/rules_foo/npm_repositories.bzl | 24 +- examples/BUILD.bazel | 49 +- examples/genrule/BUILD.bazel | 57 +- examples/js_binary/BUILD.bazel | 31 +- examples/lib/BUILD.bazel | 10 - examples/macro/BUILD.bazel | 2 +- examples/npm_deps/BUILD.bazel | 25 +- examples/npm_deps/package.json | 2 + examples/{ => npm_deps}/patches/test-a.patch | 0 .../{ => npm_deps}/patches/test-a@0.0.1.patch | 0 js/defs.bzl | 40 +- js/npm_import.bzl | 18 +- js/private/link_js_package.bzl | 184 ++++- js/private/npm_import.bzl | 162 ++--- js/private/pnpm_utils.bzl | 8 +- js/private/test/BUILD.bazel | 5 +- js/private/test/defs_checked.bzl | 367 +++++----- {examples => js/private/test}/package.json | 4 +- js/private/test/package_json_checked.bzl | 12 +- .../test/package_json_with_dashes_checked.bzl | 12 +- js/private/test/repositories_checked.bzl | 674 +++++++++--------- js/private/translate_pnpm_lock.bzl | 199 +++--- pnpm-lock.yaml | 42 +- pnpm-workspace.yaml | 2 +- 33 files changed, 1192 insertions(+), 934 deletions(-) rename examples/{ => npm_deps}/patches/test-a.patch (100%) rename examples/{ => npm_deps}/patches/test-a@0.0.1.patch (100%) rename {examples => js/private/test}/package.json (60%) diff --git a/BUILD.bazel b/BUILD.bazel index 26a0addc2..1de9739fa 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -1,11 +1,42 @@ load("@bazel_gazelle//:def.bzl", "gazelle", "gazelle_binary") load("@npm//:defs.bzl", "link_js_packages") +load("@acorn__8.4.0__links//:link_js_package.bzl", link_acorn = "link_js_package") +load("//js:defs.bzl", "link_js_package", "link_js_package_dep") -# Link all packages from the /WORKSPACE translate_pnpm_lock in the package.json to -# bazel-bin/examples/node_modules as well as the virtual store since this package.json -# is the root of the pnpm workspace +# Link all packages from the /WORKSPACE translate_pnpm_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 link_js_packages() +# 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 +link_acorn( + name = "acorn_link", + # `direct` set to False as an example of *not* also linking this 3rd dependency as a + # direct dependency in the package at bazel-bin/node_modules/@mycorp/mylib. Alternately, + # you may specify link_packages in the npm_import of this package and direct is then + # automatically set to True when this is called in the packages listed. + direct = False, +) + +# Linking a first-party dependency to the virtual store in bazel-bin/node_modules/.aspect_rules_js +link_js_package( + name = "mycorp_mylib_link", + src = "//examples/lib", + # `direct` set to False as an example of *not* also linking this first-party dependency as a + # direct dependency in the package at bazel-bin/node_modules/@mycorp/mylib. + direct = False, + deps = [ + # For a 3rd party deps fetched with an npm_import or via a translate_pnpm_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`. + link_js_package_dep( + "acorn", + version = "8.4.0", + ), + ], +) + gazelle_binary( name = "gazelle_bin", languages = ["@bazel_skylib//gazelle/bzl"], diff --git a/WORKSPACE b/WORKSPACE index c68c57248..267da59d8 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -53,8 +53,8 @@ translate_pnpm_lock( "@gregmagolan/test-a": ["-p1"], }, patches = { - "@gregmagolan/test-a": ["//examples:patches/test-a.patch"], - "@gregmagolan/test-a@0.0.1": ["//examples:patches/test-a@0.0.1.patch"], + "@gregmagolan/test-a": ["//examples/npm_deps:patches/test-a.patch"], + "@gregmagolan/test-a@0.0.1": ["//examples/npm_deps:patches/test-a@0.0.1.patch"], }, pnpm_lock = "//:pnpm-lock.yaml", ) @@ -70,6 +70,7 @@ npm_import( name = "acorn__8.4.0", integrity = "sha512-ULr0LDaEqQrMFGyQ3bhJkLsbtrQ8QibAseGZeaSUiT/6zb9IvIkomWHJIvgvwad+hinRAgsI51JcWk2yvwyL+w==", package = "acorn", - root_path = "examples", + # Root package where to link the virtual store + root_package = "", version = "8.4.0", ) diff --git a/docs/link_js_package.md b/docs/link_js_package.md index 566854c7e..5ec7fdf45 100644 --- a/docs/link_js_package.md +++ b/docs/link_js_package.md @@ -12,8 +12,8 @@ link_js_package_direct(name, @@ -65,7 +65,98 @@ https://github.com/npm/rfcs/blob/main/accepted/0042-isolated-mode.md. | 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 | [] | | package | The package name to link to.

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

If unset, the package name in the JsPackageInfo src must be set. If set, takes precendance over the package name in the JsPackageInfo src. | String | optional | "" | +| version | The package version being linked.

If unset, the package version in the JsPackageInfo src must be set. If set, takes precendance over the package version in the JsPackageInfo src. | String | optional | "" | + + + + +## link_js_package + +
+link_js_package(name, root_package, direct, src, deps, fail_if_no_link, visibility, kwargs)
+
+ +"Links a package to the virtual store if in the root package and directly to node_modules if direct is True. + +When called at the root_package, a virtual store target is generated named "link__{bazelified_name}__store". + +When linking direct, a "{name}" alias is generated which consists of the direct node_modules link and transitively +its virtual store link and the virtual store links of the transitive closure of deps. + +When linking direct, "{name}__dir" alias is also generated that refers to a directory artifact can be used to access +the package directory for creating entry points or accessing files in the package. + + +**PARAMETERS** + + +| Name | Description | Default Value | +| :------------- | :------------- | :------------- | +| name | The name of the package. This should generally by the same as | none | +| 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 js_package target to link; may only to be specified when linking in the root package | None | +| deps | list of link_js_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 | +| visibility | the visibility of the generated targets | ["//visibility:public"] | +| kwargs | see attributes of link_js_package_store rule | none | + + + + +## link_js_package_dep + +
+link_js_package_dep(name, version, root_package)
+
+ +Returns the label to the link_js_package store for a package. + +This can be used to generate virtual store target names for the deps list +of a link_js_package. + +Example root BUILD.file where the virtual store is linked by default, + +``` +load("@npm//:defs.bzl", "link_js_packages") +load("@aspect_rules_js//:defs.bzl", "link_js_package") + +# Links all packages from the `translate_pnpm_lock(name = "npm", pnpm_lock = "//:pnpm-lock.yaml")` +# repository rule. +link_js_packages() + +# Link a first party `@lib/foo` defined by the `js_package` `//lib/foo:foo` target. +link_js_package( + name = "lib_foo_link", + src = "//lib/foo", +) + +# Link a first party `@lib/bar` defined by the `js_package` `//lib/bar:bar` target +# that depends on `@lib/foo` and on `acorn` specified in `package.json` and fetched +# with `translate_pnpm_lock` +link_js_package( + name = "lib_bar_link", + src = "//lib/bar", + deps = [ + link_js_package_dep("lib_foo_link"), + link_js_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 link_js_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 translate_pnpm_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 link_js_package.

For 3rd party deps fetched with an npm_import or via a translate_pnpm_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, diff --git a/docs/npm_import.md b/docs/npm_import.md index 37c8e9d11..40bad9ca2 100644 --- a/docs/npm_import.md +++ b/docs/npm_import.md @@ -143,8 +143,8 @@ and must depend on packages with their versioned label like `@npm__types_node-15 ## npm_import
-npm_import(name, package, version, deps, transitive_closure, root_path, link_workspace, link_paths,
-           run_lifecycle_hooks, integrity, patch_args, patches, custom_postinstall)
+npm_import(name, package, version, deps, transitive_closure, root_package, link_workspace,
+           link_packages, run_lifecycle_hooks, integrity, patch_args, patches, custom_postinstall)
 
Import a single npm package into Bazel. @@ -225,9 +225,9 @@ common --experimental_downloader_config=.bazel_downloader_config | version | Version of the npm package, such as 8.4.0 | none | | deps | A dict other npm packages this one depends on where the key is the package name and value is the version | {} | | 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_path | 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 translate_pnpm_lock. | "" | +| 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 translate_pnpm_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 translate_pnpm_lock. Can be left unspecified if the link workspace is the user workspace. | "" | -| link_paths | List of paths where direct links will be created at for this package. These paths are relative to the root package with "." being the node_modules at the root package. | ["."] | +| 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 link_js_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. | 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. | "" | | patch_args | Arguments to pass to the patch tool. -p1 will usually be needed for patches generated by git. | ["-p0"] | diff --git a/e2e/link_js_package/BUILD.bazel b/e2e/link_js_package/BUILD.bazel index 674179750..897d5e51d 100644 --- a/e2e/link_js_package/BUILD.bazel +++ b/e2e/link_js_package/BUILD.bazel @@ -1,6 +1,6 @@ load("@npm//:defs.bzl", "link_js_packages") load("@aspect_rules_js//js:defs.bzl", "link_js_package") -load("@rules_foo_npm//@aspect-test/a:package_json.bzl", aspect_test_a_bin = "bin") +load("@rules_foo_npm//foo/@aspect-test/a:package_json.bzl", aspect_test_a_bin = "bin") link_js_packages() diff --git a/e2e/link_js_package/src/BUILD.bazel b/e2e/link_js_package/src/BUILD.bazel index 265eba507..cc3bb9428 100644 --- a/e2e/link_js_package/src/BUILD.bazel +++ b/e2e/link_js_package/src/BUILD.bazel @@ -8,7 +8,7 @@ js_binary( "@npm//@aspect-test/a", "@npm//@aspect-test/b", "@npm//@aspect-test/c", - "@rules_foo_npm//@aspect-test/a", + "@rules_foo_npm//foo/@aspect-test/a", ], entry_point = "main.js", ) @@ -21,7 +21,7 @@ js_test( "@npm//@aspect-test/a", "@npm//@aspect-test/b", "@npm//@aspect-test/c", - "@rules_foo_npm//@aspect-test/a", + "@rules_foo_npm//foo/@aspect-test/a", ], entry_point = "main.js", log_level = "info", diff --git a/e2e/pnpm_workspace_dot_dot/app/a/BUILD.bazel b/e2e/pnpm_workspace_dot_dot/app/a/BUILD.bazel index 484c50648..8250ea930 100644 --- a/e2e/pnpm_workspace_dot_dot/app/a/BUILD.bazel +++ b/e2e/pnpm_workspace_dot_dot/app/a/BUILD.bazel @@ -1,6 +1,6 @@ load("@aspect_rules_js//js:defs.bzl", "js_binary", "js_test") load("@npm//:defs.bzl", "link_js_packages") -load("@npm//dot_dot/app/a/@aspect-test/a:package_json.bzl", aspect_test_a_bin = "bin") +load("@npm//app/a/@aspect-test/a:package_json.bzl", aspect_test_a_bin = "bin") link_js_packages() @@ -8,9 +8,9 @@ js_binary( name = "main", args = ["foo"], data = [ - "@npm//@aspect-test", - "@npm//dot_dot/app/a/@aspect-test", - "@npm//dot_dot/app/a/@lib", + "@npm//app/a/@aspect-test", + "@npm//app/a/@lib", + "@npm//root/@aspect-test", ], entry_point = "main.js", ) @@ -19,9 +19,9 @@ js_test( name = "test", args = ["foo"], data = [ - "@npm//@aspect-test", - "@npm//dot_dot/app/a/@aspect-test", - "@npm//dot_dot/app/a/@lib", + "@npm//app/a/@aspect-test", + "@npm//app/a/@lib", + "@npm//root/@aspect-test", ], entry_point = "main.js", log_level = "info", diff --git a/e2e/pnpm_workspace_dot_dot/app/b/BUILD.bazel b/e2e/pnpm_workspace_dot_dot/app/b/BUILD.bazel index 7275579cc..a68bcde18 100644 --- a/e2e/pnpm_workspace_dot_dot/app/b/BUILD.bazel +++ b/e2e/pnpm_workspace_dot_dot/app/b/BUILD.bazel @@ -7,12 +7,12 @@ js_binary( name = "main", args = ["foo"], data = [ - "@npm//@aspect-test/a", - "@npm//@aspect-test/b", - "@npm//@aspect-test/c", - "@npm//dot_dot/app/b/@aspect-test/h", - "@npm//dot_dot/app/b/@lib/b", - "@npm//dot_dot/app/b/@lib/b_alias", + "@npm//app/b/@aspect-test/h", + "@npm//app/b/@lib/b", + "@npm//app/b/@lib/b_alias", + "@npm//root/@aspect-test/a", + "@npm//root/@aspect-test/b", + "@npm//root/@aspect-test/c", ], entry_point = "main.js", ) @@ -21,12 +21,12 @@ js_test( name = "test", args = ["foo"], data = [ - "@npm//@aspect-test/a", - "@npm//@aspect-test/b", - "@npm//@aspect-test/c", - "@npm//dot_dot/app/b/@aspect-test/h", - "@npm//dot_dot/app/b/@lib/b", - "@npm//dot_dot/app/b/@lib/b_alias", + "@npm//app/b/@aspect-test/h", + "@npm//app/b/@lib/b", + "@npm//app/b/@lib/b_alias", + "@npm//root/@aspect-test/a", + "@npm//root/@aspect-test/b", + "@npm//root/@aspect-test/c", ], entry_point = "main.js", log_level = "info", diff --git a/e2e/rules_foo/foo/BUILD.bazel b/e2e/rules_foo/foo/BUILD.bazel index 89d373cfe..a188c42bb 100644 --- a/e2e/rules_foo/foo/BUILD.bazel +++ b/e2e/rules_foo/foo/BUILD.bazel @@ -6,7 +6,7 @@ link_js_packages() js_binary( name = "main", data = [ - "@rules_foo_npm//@aspect-test/a", + "@rules_foo_npm//foo/@aspect-test/a", ], entry_point = "main.js", ) @@ -14,7 +14,7 @@ js_binary( js_test( name = "test", data = [ - "@rules_foo_npm//@aspect-test/a", + "@rules_foo_npm//foo/@aspect-test/a", ], entry_point = "main.js", log_level = "info", diff --git a/e2e/rules_foo/npm_repositories.bzl b/e2e/rules_foo/npm_repositories.bzl index 2085478f0..d3ebf93c4 100644 --- a/e2e/rules_foo/npm_repositories.bzl +++ b/e2e/rules_foo/npm_repositories.bzl @@ -7,9 +7,9 @@ def npm_repositories(): npm_import( name = "rules_foo_npm__at_aspect-test_a__5.0.0", integrity = "sha512-t/lwpVXG/jmxTotGEsmjwuihC2Lvz/Iqt63o78SI3O5XallxtFp5j2WM2M6HwkFiii9I42KdlAF8B3plZMz0Fw==", - root_path = "foo", + root_package = "foo", link_workspace = "rules_foo", - link_paths = ["."], + link_packages = ["foo"], package = "@aspect-test/a", version = "5.0.0", deps = { @@ -28,9 +28,9 @@ def npm_repositories(): npm_import( name = "rules_foo_npm__at_aspect-test_b__5.0.0", integrity = "sha512-MyIW6gHL3ds0BmDTOktorHLJUya5eZLGZlOxsKN2M9c3DWp+p1pBrA6KLQX1iq9BciryhpKwl82IAxP4jG52kw==", - root_path = "foo", + root_package = "foo", link_workspace = "rules_foo", - link_paths = [], + link_packages = [], package = "@aspect-test/b", version = "5.0.0", deps = { @@ -49,9 +49,9 @@ def npm_repositories(): npm_import( name = "rules_foo_npm__at_aspect-test_c__1.0.0", integrity = "sha512-UorLD4TFr9CWFeYbUd5etaxSo201fYEFR+rSxXytfzefX41EWCBabsXhdhvXjK6v/HRuo1y1I1NiW2P3/bKJeA==", - root_path = "foo", + root_package = "foo", link_workspace = "rules_foo", - link_paths = [], + link_packages = [], package = "@aspect-test/c", version = "1.0.0", transitive_closure = { @@ -63,9 +63,9 @@ def npm_repositories(): npm_import( name = "rules_foo_npm__at_aspect-test_c__2.0.0", integrity = "sha512-vRuHi/8zxZ+IRGdgdX4VoMNFZrR9UqO87yQx61IGIkjgV7QcKUeu5jfvIE3Mr0WNQeMdO1JpyTx1UUpsE73iug==", - root_path = "foo", + root_package = "foo", link_workspace = "rules_foo", - link_paths = [], + link_packages = [], package = "@aspect-test/c", version = "2.0.0", transitive_closure = { @@ -77,9 +77,9 @@ def npm_repositories(): npm_import( name = "rules_foo_npm__at_aspect-test_d__2.0.0__at_aspect-test_c_1.0.0", integrity = "sha512-jndwr8pLUfn795uApTcXG/yZ5hV2At1aS/wo5BVLxqlVVgLoOETF/Dp4QOjMHE/SXkXFowz6Hao+WpmzVvAO0A==", - root_path = "foo", + root_package = "foo", link_workspace = "rules_foo", - link_paths = [], + link_packages = [], package = "@aspect-test/d", version = "2.0.0_@aspect-test+c@1.0.0", deps = { @@ -94,9 +94,9 @@ def npm_repositories(): npm_import( name = "rules_foo_npm__at_aspect-test_d__2.0.0__at_aspect-test_c_2.0.0", integrity = "sha512-jndwr8pLUfn795uApTcXG/yZ5hV2At1aS/wo5BVLxqlVVgLoOETF/Dp4QOjMHE/SXkXFowz6Hao+WpmzVvAO0A==", - root_path = "foo", + root_package = "foo", link_workspace = "rules_foo", - link_paths = [], + link_packages = [], package = "@aspect-test/d", version = "2.0.0_@aspect-test+c@2.0.0", deps = { diff --git a/examples/BUILD.bazel b/examples/BUILD.bazel index 622d01673..8125b850d 100644 --- a/examples/BUILD.bazel +++ b/examples/BUILD.bazel @@ -1,58 +1,13 @@ load("@bazel_skylib//rules:write_file.bzl", "write_file") -load("@npm//:defs.bzl", "link_js_packages", "package") -load("@acorn__8.4.0__links//:link_js_package.bzl", link_acorn = "link_js_package") -load("//js:defs.bzl", "link_js_package") - -########################### - -# Link all packages from the /WORKSPACE translate_pnpm_lock in the examples/package.json to -# bazel-bin/examples/node_modules -link_js_packages() - -# Link the acorn package, was fetched separately with npm_import from /WORKSPACE, to -# bazel-bin/examples/node_modules -link_acorn() - -# Example of manually linking a first party dependency to bazel-bin/examples/node_modules -link_js_package( - name = package("@mycorp/mylib").name, - src = "//examples/lib", - visibility = ["//examples:__subpackages__"], - deps = [package("acorn", "examples")], -) ########################### # Fixtures for example tests -# Trivial test fixture: a nodejs program that writes to a file -write_file( - name = "js", - out = "some.js", - content = ["require('fs').writeFileSync(process.argv[2], 'stuff')"], - visibility = ["//examples:__subpackages__"], -) - -# The output produced by that program, for assertions -write_file( - name = "write_expected", - out = "expected", - content = ["stuff"], - visibility = ["//examples:__subpackages__"], -) - -# Trivial test fixture: the shortest legal JS program -write_file( - name = "write_one", - out = "one.js", - content = ["1"], - visibility = ["//examples:__subpackages__"], -) - # For using acorn as our test fixture, this is -# the serialized AST for the that shortest legal JS program +# the serialized AST for the shortest legal JS program write_file( name = "write_expected_one_ast", - out = "expected_ast.json", + out = "expected_one_ast.json", content = [ """{"type":"Program","start":0,"end":1,"body":[{"type":"ExpressionStatement","start":0,"end":1,"expression":{"type":"Literal","start":0,"end":1,"value":1,"raw":"1"}}],"sourceType":"script"}\n""", ], diff --git a/examples/genrule/BUILD.bazel b/examples/genrule/BUILD.bazel index 3e3aef7ef..f6aec71bb 100644 --- a/examples/genrule/BUILD.bazel +++ b/examples/genrule/BUILD.bazel @@ -1,29 +1,46 @@ load("@aspect_bazel_lib//lib:copy_to_bin.bzl", "copy_to_bin") load("@bazel_skylib//rules:diff_test.bzl", "diff_test") -load("@npm//:defs.bzl", "package", "package_dir") +load("@bazel_skylib//rules:write_file.bzl", "write_file") load("@acorn__8.4.0__links//:link_js_package.bzl", link_acorn = "link_js_package") -# Link the acorn package, was fetched separately with npm_import from /WORKSPACE, to -# bazel-bin/examples/node_modules -link_acorn() +# Link the acorn package, which was fetched separately with npm_import from /WORKSPACE, as +# a direct dependency in bazel-bin/examples/genrule/node_modules +link_acorn(name = "acorn_link") ############################# # Test case 1 # Show that you can use the node toolchain together with a genrule(). # This gives you complete control over starting the interpreter, but you also have to # manually handle module resolution. + +# Trivial test fixture: a nodejs program that writes to a file +write_file( + name = "js", + out = "some1.js", + content = ["require('fs').writeFileSync(process.argv[2], 'stuff')"], + visibility = ["//examples:__subpackages__"], +) + +# The output produced by that program, for assertions +write_file( + name = "write_expected", + out = "expected1", + content = ["stuff"], + visibility = ["//examples:__subpackages__"], +) + genrule( name = "use_node_toolchain", - srcs = ["//examples:some.js"], + srcs = [":some1.js"], outs = ["actual1"], - cmd = "$(NODE_PATH) $(execpath //examples:some.js) $@", + cmd = "$(NODE_PATH) $(execpath :some1.js) $@", toolchains = ["@nodejs_toolchains//:resolved_toolchain"], tools = ["@nodejs_toolchains//:resolved_toolchain"], ) diff_test( name = "test_genrule", - file1 = "//examples:expected", + file1 = "expected1", file2 = "actual1", ) @@ -32,20 +49,28 @@ diff_test( # Directly invoke a bin from a package from npm to transform inputs to bazel-out # Similar to build_bazel_rules_nodejs generated npm_package_bin targets +# Trivial test fixture: the shortest legal JS program +write_file( + name = "write_one", + out = "one.js", + content = ["1"], + visibility = ["//examples:__subpackages__"], +) + genrule( name = "call_acorn", srcs = [ - "//examples:one.js", - package("acorn", "examples"), - package_dir("acorn", "examples"), + ":one.js", + ":acorn_link", + ":acorn_link__dir", ], outs = ["actual2"], cmd = """ $(NODE_PATH) \\ - ./$(execpath %s)/bin/acorn \\ + ./$(execpath :acorn_link__dir)/bin/acorn \\ --compact \\ - $(execpath //examples:one.js) \\ - > $@""" % package_dir("acorn", "examples"), + $(execpath :one.js) \\ + > $@""", toolchains = ["@nodejs_toolchains//:resolved_toolchain"], tools = ["@nodejs_toolchains//:resolved_toolchain"], ) @@ -53,7 +78,7 @@ genrule( diff_test( name = "test_acorn", file1 = "actual2", - file2 = "//examples:expected_ast.json", + file2 = "//examples:expected_one_ast.json", ) ################################################ @@ -70,7 +95,7 @@ genrule( name = "require_acorn", srcs = [ ":require_acorn_js", - package("acorn", "examples"), + ":acorn_link", ], outs = ["actual3"], cmd = """ @@ -84,5 +109,5 @@ genrule( diff_test( name = "test_require_acorn", file1 = "actual3", - file2 = "//examples:expected_ast.json", + file2 = "//examples:expected_one_ast.json", ) diff --git a/examples/js_binary/BUILD.bazel b/examples/js_binary/BUILD.bazel index adc12b26d..6d925662d 100644 --- a/examples/js_binary/BUILD.bazel +++ b/examples/js_binary/BUILD.bazel @@ -1,10 +1,18 @@ +load("@acorn__8.4.0__links//:link_js_package.bzl", link_acorn = "link_js_package") load("@aspect_bazel_lib//lib:directory_path.bzl", "directory_path") load("@bazel_skylib//rules:diff_test.bzl", "diff_test") load("@bazel_skylib//rules:write_file.bzl", "write_file") -load("@npm//:defs.bzl", "package", "package_dir") -load("//js:defs.bzl", "js_binary", "js_test") +load("@npm//examples/npm_deps/@aspect-test/a:package_json.bzl", aspect_test_a_bin = "bin") +load("//js:defs.bzl", "js_binary", "js_test", "link_js_package") load("//js:run_js_binary.bzl", "run_js_binary") +# Link the acorn package, which was fetched separately with npm_import from /WORKSPACE, as +# a direct dependency in bazel-bin/examples/js_binary/node_modules +link_acorn(name = "acorn_link") + +# Link @mycorp/mylib as a direct dependency in bazel-bin/examples/js_binary/node_modules +link_js_package(name = "mycorp_mylib_link") + #################################################### # Test case 4 # Show that a js_binary can be used with run_js_binary @@ -12,7 +20,7 @@ load("//js:run_js_binary.bzl", "run_js_binary") js_binary( name = "bin", - data = [package("acorn", "examples")], + data = [":acorn_link"], entry_point = "require_acorn.js", ) @@ -27,7 +35,7 @@ run_js_binary( diff_test( name = "test_js_binary_under_run_js_binary", - file1 = "//examples:expected_ast.json", + file1 = "//examples:expected_one_ast.json", file2 = "actual4", ) @@ -55,7 +63,7 @@ write_file( js_binary( name = "bin6", - data = [package("@mycorp/mylib", "examples")], + data = [":mycorp_mylib_link"], entry_point = "case6.js", ) @@ -69,7 +77,7 @@ run_js_binary( diff_test( name = "test6", - file1 = "//examples:expected_ast.json", + file1 = "//examples:expected_one_ast.json", file2 = "actual6", ) @@ -266,7 +274,7 @@ run_js_binary( directory_path( name = "acorn_entry_point", - directory = package_dir("acorn", "examples"), + directory = ":acorn_link__dir", path = "bin/acorn", ) @@ -298,3 +306,12 @@ diff_test( file1 = ":expected13", file2 = ":actual13", ) + +#################################################### +# Test case 14 +# Show that we can run a generated bin from a package where the npm package +# is not linked. In this case @aspect-test/a is linked to the //examples/npm_deps:__pkg__ + +aspect_test_a_bin.bin_a_test( + name = "aspect_bin_a_test", +) diff --git a/examples/lib/BUILD.bazel b/examples/lib/BUILD.bazel index d210d48fc..be6894b77 100644 --- a/examples/lib/BUILD.bazel +++ b/examples/lib/BUILD.bazel @@ -1,5 +1,4 @@ load("@aspect_rules_js//js:defs.bzl", "js_package") -load("@npm//examples/@aspect-test/a:package_json.bzl", aspect_test_a_bin = "bin") js_package( name = "lib", @@ -10,12 +9,3 @@ js_package( package = "@mycorp/mylib", visibility = ["//visibility:public"], ) - -#################################################### -# Sub-package test case 1 -# Show that we can run a generated bin from a package where the npm package -# is not linked. In this case @aspect-test/a is linked to the //examples:__pkg__ - -aspect_test_a_bin.bin_a_test( - name = "aspect_bin_a_test", -) diff --git a/examples/macro/BUILD.bazel b/examples/macro/BUILD.bazel index 01dac3af2..3034c2a75 100644 --- a/examples/macro/BUILD.bazel +++ b/examples/macro/BUILD.bazel @@ -1,7 +1,7 @@ load("//examples/macro:mocha.bzl", "mocha_test") load("@npm//:defs.bzl", "link_js_packages") -# Link all packages in our package.json to +# Link all direct dependencies in /examples/macro/package.json to # bazel-bin/examples/macro/node_modules link_js_packages() diff --git a/examples/npm_deps/BUILD.bazel b/examples/npm_deps/BUILD.bazel index 1abbd274a..e63d32c23 100644 --- a/examples/npm_deps/BUILD.bazel +++ b/examples/npm_deps/BUILD.bazel @@ -1,8 +1,12 @@ +load("@acorn__8.4.0__links//:link_js_package.bzl", link_acorn = "link_js_package") load("@aspect_rules_js//js:defs.bzl", "js_binary", "js_test") load("@aspect_rules_js//js:run_js_binary.bzl", "run_js_binary") load("@bazel_skylib//rules:diff_test.bzl", "diff_test") load("@bazel_skylib//rules:write_file.bzl", "write_file") -load("@npm//:defs.bzl", "link_js_packages", "package", "package_dir") +load("@npm//:defs.bzl", "link_js_packages") +load("//js:defs.bzl", "link_js_package") + +########################### # Directly load from rollup's bin entries, skipping the "bin" helper from package_json.bzl # Just to show what the syntax de-sugaring looks like, and to test that @@ -12,7 +16,16 @@ load("@npm__rollup__2.70.2//examples/npm_deps:package_json.bzl", "rollup", "roll # Load from the "bin" property from the package.json of the uvu package load("@npm//examples/npm_deps/uvu:package_json.bzl", uvu_bin = "bin") -# Link all packages in our package.json to +########################### + +# Link the acorn package, which was fetched separately with npm_import from /WORKSPACE, as +# a direct dependency in bazel-bin/examples/npm_deps/node_modules +link_acorn(name = "acorn_link") + +# Link @mycorp/mylib as a direct dependency in bazel-bin/examples/npm_deps/node_modules +link_js_package(name = "mycorp_mylib_link") + +# Link all direct dependencies in /examples/npm_deps/package.json to # bazel-bin/examples/npm_deps/node_modules link_js_packages() @@ -85,7 +98,7 @@ if (content.answer !== '42*') { js_test( name = "test3", data = [ - package("@aspect-test/c", "examples"), + "@npm//examples/npm_deps/@aspect-test/c", ], entry_point = "case3.js", ) @@ -111,9 +124,9 @@ if (!/^moo\\s+mooo\\s*$/.test(content)) { js_test( name = "test4", - args = ["$(rootpath %s)" % package_dir("@aspect-test/c", "examples")], + args = ["$(rootpath @npm//examples/npm_deps/@aspect-test/c:dir)"], data = [ - package_dir("@aspect-test/c", "examples"), + "@npm//examples/npm_deps/@aspect-test/c:dir", ], entry_point = "case4.js", ) @@ -200,7 +213,7 @@ uvu_test( "false", ], data = [ + ":mycorp_mylib_link", ":uvu_spec", - package("@mycorp/mylib", "examples"), ], ) diff --git a/examples/npm_deps/package.json b/examples/npm_deps/package.json index 15f346951..b04231ea3 100644 --- a/examples/npm_deps/package.json +++ b/examples/npm_deps/package.json @@ -1,6 +1,8 @@ { "private": true, "devDependencies": { + "@aspect-test/a": "5.0.0", + "@aspect-test/c": "2.0.0", "@gregmagolan/test-b": "0.0.2", "@rollup/plugin-commonjs": "21.1.0", "mobx-react": "7.3.0", diff --git a/examples/patches/test-a.patch b/examples/npm_deps/patches/test-a.patch similarity index 100% rename from examples/patches/test-a.patch rename to examples/npm_deps/patches/test-a.patch diff --git a/examples/patches/test-a@0.0.1.patch b/examples/npm_deps/patches/test-a@0.0.1.patch similarity index 100% rename from examples/patches/test-a@0.0.1.patch rename to examples/npm_deps/patches/test-a@0.0.1.patch diff --git a/js/defs.bzl b/js/defs.bzl index 0c1dc9d75..65ce28840 100644 --- a/js/defs.bzl +++ b/js/defs.bzl @@ -14,10 +14,9 @@ load( ) load( "//js/private:link_js_package.bzl", - _link_js_package_direct = "link_js_package_direct", - _link_js_package_store = "link_js_package_store", + _link_js_package = "link_js_package", + _link_js_package_dep = "link_js_package_dep", ) -load("//js/private:pnpm_utils.bzl", _pnpm_utils = "pnpm_utils") def js_binary(**kwargs): _js_binary( @@ -40,39 +39,8 @@ def js_test(**kwargs): js_package = _js_package JsPackageInfo = _JsPackageInfo -def link_js_package(name, **kwargs): - """"Public API macro around link_js_package_store and link_js_package_direct rules. - - Links a package to the virtual store and directly to node_modules. - - Args: - name: name of the link_js_package_direct target - **kwargs: see attributes of link_js_package_store rule - """ - - # link the virtual store - _link_js_package_store( - name = "{}{}".format(name, _pnpm_utils.store_postfix), - **kwargs - ) - - # Link as a direct dependency in node_modules - _link_js_package_direct( - name = name, - src = ":{}{}".format(name, _pnpm_utils.store_postfix), - tags = kwargs.get("tags", None), - visibility = kwargs.get("visibility", []), - ) - - # filegroup target that provides a single file which is - # package directory for use in $(execpath) and $(rootpath) - native.filegroup( - name = "{}{}".format(name, _pnpm_utils.dir_postfix), - srcs = [":{}".format(name)], - output_group = _pnpm_utils.package_directory_output_group, - tags = kwargs.get("tags", None), - visibility = kwargs.get("visibility", []), - ) +link_js_package = _link_js_package +link_js_package_dep = _link_js_package_dep # export the starlark libraries as a public API js_binary_lib = _js_binary_lib diff --git a/js/npm_import.bzl b/js/npm_import.bzl index 0b88b119f..5fc7916d2 100644 --- a/js/npm_import.bzl +++ b/js/npm_import.bzl @@ -35,9 +35,9 @@ def npm_import( version, deps = {}, transitive_closure = {}, - root_path = "", + root_package = "", link_workspace = "", - link_paths = ["."], + link_packages = [], run_lifecycle_hooks = False, integrity = "", patch_args = ["-p0"], @@ -117,12 +117,14 @@ def npm_import( deps: A dict other npm packages this one depends on where the key is the package name and value is the version 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_path: The root package where the node_modules virtual store is linked to. + 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 `translate_pnpm_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 `translate_pnpm_lock`. Can be left unspecified if the link workspace is the user workspace. - link_paths: List of paths where direct links will be created at for this package. + 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 link_js_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. @@ -149,9 +151,9 @@ def npm_import( name = name, package = package, version = version, - root_path = root_path, + root_package = root_package, link_workspace = link_workspace, - link_paths = link_paths, + link_packages = link_packages, integrity = integrity, patch_args = patch_args, patches = patches, @@ -165,8 +167,8 @@ def npm_import( name = "{}{}".format(name, _pnpm_utils.links_postfix), package = package, version = version, - root_path = root_path, - link_paths = link_paths, + root_package = root_package, + link_packages = link_packages, deps = deps, transitive_closure = transitive_closure, lifecycle_build_target = run_lifecycle_hooks or not (not custom_postinstall), diff --git a/js/private/link_js_package.bzl b/js/private/link_js_package.bzl index 2d0dd78be..a89a6c667 100644 --- a/js/private/link_js_package.bzl +++ b/js/private/link_js_package.bzl @@ -34,8 +34,8 @@ https://github.com/npm/rfcs/blob/main/accepted/0042-isolated-mode.md. _DOC_DIRECT = """Defines a node package that is linked into a node_modules tree as a direct dependency. -This is used in co-ordination with link_js_package that links into the virtual store in -with a pnpm style symlinked node_modules output tree. +This is used in co-ordination with the link_js_package_store rule that links into the +node_modules/.apsect_rules_js virtual store with a pnpm style symlinked node_modules output tree. The term "package" is defined at @@ -82,8 +82,8 @@ If set, takes precendance over the package name in the JsPackageInfo src. "version": attr.string( doc = """The package version being linked. -If unset, the package name in the JsPackageInfo src must be set. -If set, takes precendance over the package name in the JsPackageInfo src. +If unset, the package version in the JsPackageInfo src must be set. +If set, takes precendance over the package version in the JsPackageInfo src. """, ), "_windows_constraint": attr.label(default = "@platforms//os:windows"), @@ -137,7 +137,7 @@ def _impl_store(ctx): # symlink the package's direct deps to its virtual store location dep_link_package = dep[_LinkJsPackageInfo].link_package if dep_link_package != ctx.label.package: - if not ctx.label.package.startwith(dep_link_package + "/"): + if not ctx.label.package.startswith(dep_link_package + "/"): msg = """link_js_package in %s package cannot depend on link_js_package in %s package. deps of link_js_package must be in the same package or in a parent package.""" % (ctx.label.package, dep_link_package) fail(msg) @@ -295,3 +295,177 @@ link_js_package_direct = rule( attrs = link_js_package_direct_lib.attrs, provides = link_js_package_direct_lib.provides, ) + +def link_js_package_dep( + name, + version = None, + root_package = ""): + """Returns the label to the link_js_package store for a package. + + This can be used to generate virtual store target names for the deps list + of a link_js_package. + + Example root BUILD.file where the virtual store is linked by default, + + ``` + load("@npm//:defs.bzl", "link_js_packages") + load("@aspect_rules_js//:defs.bzl", "link_js_package") + + # Links all packages from the `translate_pnpm_lock(name = "npm", pnpm_lock = "//:pnpm-lock.yaml")` + # repository rule. + link_js_packages() + + # Link a first party `@lib/foo` defined by the `js_package` `//lib/foo:foo` target. + link_js_package( + name = "lib_foo_link", + src = "//lib/foo", + ) + + # Link a first party `@lib/bar` defined by the `js_package` `//lib/bar:bar` target + # that depends on `@lib/foo` and on `acorn` specified in `package.json` and fetched + # with `translate_pnpm_lock` + link_js_package( + name = "lib_bar_link", + src = "//lib/bar", + deps = [ + link_js_package_dep("lib_foo_link"), + link_js_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 link_js_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 translate_pnpm_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 link_js_package. + + For 3rd party deps fetched with an npm_import or via a translate_pnpm_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_namespace}{bazel_name}".format( + bazel_name = pnpm_utils.bazel_name(name, version), + root_package = root_package, + store_namespace = pnpm_utils.store_link_target_namespace, + )) + +def link_js_package( + name, + root_package = "", + direct = True, + src = None, + deps = [], + fail_if_no_link = True, + visibility = ["//visibility:public"], + **kwargs): + """"Links a package to the virtual store if in the root package and directly to node_modules if direct is True. + + When called at the root_package, a virtual store target is generated named "link__{bazelified_name}__store". + + When linking direct, a "{name}" alias is generated which consists of the direct node_modules link and transitively + its virtual store link and the virtual store links of the transitive closure of deps. + + When linking direct, "{name}__dir" alias is also generated that refers to a directory artifact can be used to access + the package directory for creating entry points or accessing files in the package. + + Args: + name: The name of the package. + This should generally by the same as + 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. + src: the js_package target to link; may only to be specified when linking in the root package + deps: list of link_js_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 + visibility: the visibility of the generated targets + **kwargs: see attributes of link_js_package_store rule + """ + is_root = native.package_name() == root_package + is_direct = direct + + if fail_if_no_link and not is_root and not is_direct: + msg = "Nothing to link in bazel package '{bazel_package}' for {name}. This is neither the root package nor a direct link.".format( + bazel_package = native.package_name(), + name = name, + ) + fail(msg) + + if deps and not is_root: + msg = "deps may only be specified when linking in the root package '{}'".format(root_package) + fail(msg) + + if src and not is_root: + msg = "src may only be specified when linking in the root package '{}'".format(root_package) + fail(msg) + + link_target_name = "{direct_namespace}{bazel_name}".format( + bazel_name = pnpm_utils.bazel_name(name), + direct_namespace = pnpm_utils.direct_link_target_namespace, + ) + + dir_target_name = "{direct_namespace}{bazel_name}{dir_postfix}".format( + bazel_name = pnpm_utils.bazel_name(name), + dir_postfix = pnpm_utils.dir_postfix, + direct_namespace = pnpm_utils.direct_link_target_namespace, + ) + + store_target_name = "{store_namespace}{bazel_name}".format( + bazel_name = pnpm_utils.bazel_name(name), + store_namespace = pnpm_utils.store_link_target_namespace, + ) + + if is_root: + # link the virtual store when linking at the root + link_js_package_store( + name = store_target_name, + src = src, + deps = deps, + visibility = visibility, + **kwargs + ) + + if direct: + # link as a direct dependency in node_modules of this package + link_js_package_direct( + name = link_target_name, + src = "//{root_package}:{store_target}".format( + root_package = root_package, + store_target = store_target_name, + ), + tags = kwargs.get("tags", None), + visibility = visibility, + ) + + # filegroup target that provides a single file which is + # package directory for use in $(execpath) and $(rootpath) + native.filegroup( + name = dir_target_name, + srcs = [":{}".format(link_target_name)], + output_group = pnpm_utils.package_directory_output_group, + tags = kwargs.get("tags", None), + visibility = visibility, + ) + + native.alias( + name = name, + actual = ":{}".format(link_target_name), + visibility = visibility, + ) + + native.alias( + name = "{}{}".format(name, pnpm_utils.dir_postfix), + actual = ":{}".format(dir_target_name), + visibility = visibility, + ) diff --git a/js/private/npm_import.bzl b/js/private/npm_import.bzl index 896274375..70bf74dbd 100644 --- a/js/private/npm_import.bzl +++ b/js/private/npm_import.bzl @@ -10,14 +10,24 @@ _LINK_JS_PACKAGE_TMPL = """load("@aspect_rules_js//js:defs.bzl", _js_package = " load("@aspect_rules_js//js:run_js_binary.bzl", _run_js_binary = "run_js_binary") load("@aspect_rules_js//js/private:link_js_package_store_internal.bzl", _link_js_package_store = "link_js_package_store_internal") load("@aspect_rules_js//js/private:link_js_package.bzl", _link_js_package_direct = "link_js_package_direct") -load("@aspect_rules_js//js/private:pnpm_utils.bzl", _pnpm_utils = "pnpm_utils") load("@bazel_skylib//lib:paths.bzl", _paths = "paths") # buildifier: disable=unnamed-macro -def link_js_package(fail_if_no_link = False): +def link_js_package( + name, + direct = {direct_default}, + fail_if_no_link = True, + visibility = ["//visibility:public"]): "Generated link_js_package_store and link_js_package_direct targets for npm package {package}@{version}" - is_root = native.package_name() == "{root_path}" + root_package = "{root_package}" + + is_root = native.package_name() == root_package + + link_packages = {link_packages} + + if link_packages and direct != None: + fail("direct attribute cannot be specified when link_packages are set") if is_root: # link the virtual store if we are linking in the root package @@ -32,15 +42,15 @@ def link_js_package(fail_if_no_link = False): # reference target used to avoid circular deps _link_js_package_store( - name = "{namespace}{bazel_name}__ref", + name = "{store_namespace}{bazel_name}__ref", package = "{package}", version = "{version}", ) # post-lifecycle target with reference deps for use in terminal target with transitive closure _link_js_package_store( - name = "{namespace}{bazel_name}__pkg", - src = "{namespace}{bazel_name}__jsp" if lifecycle_build_target else "{js_package_target}", + name = "{store_namespace}{bazel_name}__pkg", + src = "{store_namespace}{bazel_name}__jsp" if lifecycle_build_target else "{js_package_target}", package = "{package}", version = "{version}", deps = ref_deps, @@ -48,18 +58,18 @@ def link_js_package(fail_if_no_link = False): # virtual store target with transitive closure of all node package dependencies _link_js_package_store( - name = "{namespace}{bazel_name}{store_postfix}", + name = "{store_namespace}{bazel_name}", src = None if {transitive_closure_pattern} else "{js_package_target}", package = "{package}", version = "{version}", deps = deps, - visibility = ["//visibility:public"], + visibility = visibility, ) if lifecycle_build_target: # pre-lifecycle target with reference deps for use terminal pre-lifecycle target _link_js_package_store( - name = "{namespace}{bazel_name}__pkg_lite", + name = "{store_namespace}{bazel_name}__pkg_lite", package = "{package}", version = "{version}", deps = ref_deps, @@ -67,7 +77,7 @@ def link_js_package(fail_if_no_link = False): # terminal pre-lifecycle target for use in lifecycle build target below _link_js_package_store( - name = "{namespace}{bazel_name}__pkg_lc", + name = "{store_namespace}{bazel_name}__pkg_lc", package = "{package}", version = "{version}", deps = lc_deps, @@ -78,7 +88,7 @@ def link_js_package(fail_if_no_link = False): name = "{lifecycle_target_name}", srcs = [ "{js_package_target_lc}", - ":{namespace}{bazel_name}__pkg_lc" + ":{store_namespace}{bazel_name}__pkg_lc" ], # run_js_binary runs in the output dir; must add "../../../" because paths are relative to the exec root args = [ @@ -93,51 +103,49 @@ def link_js_package(fail_if_no_link = False): # post-lifecycle js_package _js_package( - name = "{namespace}{bazel_name}__jsp", + name = "{store_namespace}{bazel_name}__jsp", src = ":{lifecycle_target_name}", package = "{package}", version = "{version}", ) # link direct deps - is_direct = False - for link_path in {link_paths}: - link_package_path = _paths.normalize(_paths.join("{root_path}", link_path)) - if link_package_path == ".": - link_package_path = "" - if link_package_path == native.package_name(): + is_direct = not (not direct) + for link_package in link_packages: + if direct == None and link_package == native.package_name(): is_direct = True - # terminal target for direct dependencies - _link_js_package_direct( - name = "{namespace}{bazel_name}", - src = "//{root_path}:{namespace}{bazel_name}{store_postfix}", - visibility = ["//visibility:public"], - ) + if is_direct: + # terminal target for direct dependencies + _link_js_package_direct( + name = "{direct_namespace}{bazel_name}", + src = "//{root_package}:{store_namespace}{bazel_name}", + visibility = visibility, + ) - # filegroup target that provides a single file which is - # package directory for use in $(execpath) and $(rootpath) - native.filegroup( - name = "{namespace}{bazel_name}{dir_postfix}", - srcs = [":{namespace}{bazel_name}"], - output_group = "{package_directory_output_group}", - visibility = ["//visibility:public"], - ) + # filegroup target that provides a single file which is + # package directory for use in $(execpath) and $(rootpath) + native.filegroup( + name = "{direct_namespace}{bazel_name}{dir_postfix}", + srcs = [":{direct_namespace}{bazel_name}"], + output_group = "{package_directory_output_group}", + visibility = visibility, + ) - native.alias( - name = "{namespace}{alias}", - actual = ":{namespace}{bazel_name}", - visibility = ["//visibility:public"], - ) + native.alias( + name = name, + actual = ":{direct_namespace}{bazel_name}", + visibility = visibility, + ) - native.alias( - name = "{namespace}{alias}{dir_postfix}", - actual = ":{namespace}{bazel_name}{dir_postfix}", - visibility = ["//visibility:public"], - ) + native.alias( + name = "{{}}{dir_postfix}".format(name), + actual = ":{direct_namespace}{bazel_name}{dir_postfix}", + visibility = visibility, + ) 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_path of this workspace nor a link_path of this package." % native.package_name() + 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) """ @@ -145,13 +153,13 @@ _BIN_MACRO_TMPL = """ def {bin_name}(name, **kwargs): _directory_path( name = "%s__entry_point" % name, - directory = "@{link_workspace}//{link_package}:{namespace}{bazel_name}{dir_postfix}", + directory = "@{link_workspace}//{link_package}:{direct_namespace}{bazel_name}{dir_postfix}", path = "{bin_path}", ) _js_binary( name = "%s__js_binary" % name, entry_point = ":%s__entry_point" % name, - data = ["@{link_workspace}//{link_package}:{namespace}{bazel_name}"], + data = ["@{link_workspace}//{link_package}:{direct_namespace}{bazel_name}"], ) _run_js_binary( name = name, @@ -162,26 +170,26 @@ def {bin_name}(name, **kwargs): def {bin_name}_test(name, **kwargs): _directory_path( name = "%s__entry_point" % name, - directory = "@{link_workspace}//{link_package}:{namespace}{bazel_name}{dir_postfix}", + directory = "@{link_workspace}//{link_package}:{direct_namespace}{bazel_name}{dir_postfix}", path = "{bin_path}", ) _js_test( name = name, entry_point = ":%s__entry_point" % name, - data = kwargs.pop("data", []) + ["@{link_workspace}//{link_package}:{namespace}{bazel_name}"], + data = kwargs.pop("data", []) + ["@{link_workspace}//{link_package}:{direct_namespace}{bazel_name}"], **kwargs ) def {bin_name}_binary(name, **kwargs): _directory_path( name = "%s__entry_point" % name, - directory = "@{link_workspace}//{link_package}:{namespace}{bazel_name}{dir_postfix}", + directory = "@{link_workspace}//{link_package}:{direct_namespace}{bazel_name}{dir_postfix}", path = "{bin_path}", ) _js_binary( name = name, entry_point = ":%s__entry_point" % name, - data = kwargs.pop("data", []) + ["@{link_workspace}//{link_package}:{namespace}{bazel_name}"], + data = kwargs.pop("data", []) + ["@{link_workspace}//{link_package}:{direct_namespace}{bazel_name}"], **kwargs ) """ @@ -267,16 +275,12 @@ def _impl(rctx): root_package_json_bzl = False if bins: - for link_path in rctx.attr.link_paths: - escaped_link_path = link_path.replace("../", "dot_dot/") + for link_package in rctx.attr.link_packages: 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_test = "js_test")""", """load("@aspect_rules_js//js:run_js_binary.bzl", _run_js_binary = "run_js_binary")""", ] - link_package = paths.normalize(paths.join(rctx.attr.root_path, link_path)) - if link_package == ".": - link_package = "" for name in bins: bin_bzl.append( _BIN_MACRO_TMPL.format( @@ -284,9 +288,9 @@ def _impl(rctx): bin_name = _sanitize_bin_name(name), bin_path = bins[name], dir_postfix = pnpm_utils.dir_postfix, - link_workspace = rctx.attr.link_workspace, + direct_namespace = pnpm_utils.direct_link_target_namespace, link_package = link_package, - namespace = pnpm_utils.js_package_target_namespace, + link_workspace = rctx.attr.link_workspace, ), ) @@ -296,13 +300,13 @@ def _impl(rctx): ] bin_bzl.append("bin = struct(%s)\n" % ",\n".join(bin_struct_fields)) - if escaped_link_path == ".": + if link_package == "": root_package_json_bzl = True else: - rctx.file(paths.normalize(paths.join(escaped_link_path, "BUILD.bazel")), "\n".join(generated_by_lines + [ + rctx.file(paths.normalize(paths.join(link_package, "BUILD.bazel")), "\n".join(generated_by_lines + [ "exports_files(%s)" % starlark_codegen_utils.to_list_attr(["package_json.bzl"]), ])) - rctx.file(paths.normalize(paths.join(escaped_link_path, "package_json.bzl")), "\n".join(bin_bzl)) + rctx.file(paths.normalize(paths.join(link_package, "package_json.bzl")), "\n".join(bin_bzl)) if rctx.attr.run_lifecycle_hooks: _inject_run_lifecycle_hooks(rctx, pkg_json_path) @@ -338,9 +342,9 @@ def _impl_links(rctx): deps = [] for (dep_name, dep_version) in rctx.attr.deps.items(): - ref_deps.append("{namespace}{bazel_name}__ref".format( - namespace = pnpm_utils.js_package_target_namespace, + ref_deps.append("{store_namespace}{bazel_name}__ref".format( bazel_name = pnpm_utils.bazel_name(dep_name, dep_version), + store_namespace = pnpm_utils.store_link_target_namespace, )) transitive_closure_pattern = len(rctx.attr.transitive_closure) > 0 @@ -354,30 +358,28 @@ def _impl_links(rctx): # 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("{namespace}{bazel_name}__pkg_lite".format( - namespace = pnpm_utils.js_package_target_namespace, + lc_deps.append("{store_namespace}{bazel_name}__pkg_lite".format( bazel_name = pnpm_utils.bazel_name(dep_name, dep_version), + store_namespace = pnpm_utils.store_link_target_namespace, )) else: - lc_deps.append("{namespace}{bazel_name}__pkg".format( - namespace = pnpm_utils.js_package_target_namespace, + lc_deps.append("{store_namespace}{bazel_name}__pkg".format( bazel_name = pnpm_utils.bazel_name(dep_name, dep_version), + store_namespace = pnpm_utils.store_link_target_namespace, )) - deps.append("{namespace}{bazel_name}__pkg".format( - namespace = pnpm_utils.js_package_target_namespace, + deps.append("{store_namespace}{bazel_name}__pkg".format( bazel_name = pnpm_utils.bazel_name(dep_name, dep_version), + store_namespace = pnpm_utils.store_link_target_namespace, )) else: for (dep_name, dep_version) in rctx.attr.deps.items(): - lc_deps.append("{namespace}{bazel_name}{store_postfix}".format( - namespace = pnpm_utils.js_package_target_namespace, + lc_deps.append("{store_namespace}{bazel_name}".format( bazel_name = pnpm_utils.bazel_name(dep_name, dep_version), - store_postfix = pnpm_utils.store_postfix, + store_namespace = pnpm_utils.store_link_target_namespace, )) - deps.append("{namespace}{bazel_name}{store_postfix}".format( - namespace = pnpm_utils.js_package_target_namespace, + deps.append("{store_namespace}{bazel_name}".format( bazel_name = pnpm_utils.bazel_name(dep_name, dep_version), - store_postfix = pnpm_utils.store_postfix, + store_namespace = pnpm_utils.store_link_target_namespace, )) virtual_store_name = pnpm_utils.virtual_store_name(rctx.attr.package, rctx.attr.version) @@ -392,10 +394,11 @@ def _impl_links(rctx): js_package_target_lc = "@{}//:jsp".format(npm_import_sources_repo_name) link_js_package_bzl = [_LINK_JS_PACKAGE_TMPL.format( - alias = pnpm_utils.bazel_name(rctx.attr.package), bazel_name = pnpm_utils.bazel_name(rctx.attr.package, rctx.attr.version), deps = starlark_codegen_utils.to_list_attr(deps, 1), dir_postfix = pnpm_utils.dir_postfix, + direct_namespace = pnpm_utils.direct_link_target_namespace, + direct_default = "None" if rctx.attr.link_packages else "True", extract_to_dirname = _EXTRACT_TO_DIRNAME, js_package_target = js_package_target, js_package_target_lc = js_package_target_lc, @@ -403,14 +406,13 @@ def _impl_links(rctx): lifecycle_build_target = str(rctx.attr.lifecycle_build_target), lifecycle_target_name = lifecycle_target_name, link_js_package_bzl = "@%s//:%s" % (rctx.name, _LINK_JS_PACKAGE_BZL_FILENAME), - link_paths = rctx.attr.link_paths, - namespace = pnpm_utils.js_package_target_namespace, + link_packages = rctx.attr.link_packages, package = rctx.attr.package, package_directory_output_group = pnpm_utils.package_directory_output_group, rctx_name = rctx.name, ref_deps = starlark_codegen_utils.to_list_attr(ref_deps, 1), - root_path = rctx.attr.root_path, - store_postfix = pnpm_utils.store_postfix, + root_package = rctx.attr.root_package, + store_namespace = pnpm_utils.store_link_target_namespace, transitive_closure_pattern = str(transitive_closure_pattern), version = rctx.attr.version, virtual_store_root = pnpm_utils.virtual_store_root, @@ -425,8 +427,8 @@ def _impl_links(rctx): _COMMON_ATTRS = { "package": attr.string(mandatory = True), "version": attr.string(mandatory = True), - "root_path": attr.string(), - "link_paths": attr.string_list(), + "root_package": attr.string(), + "link_packages": attr.string_list(), } _ATTRS_LINKS = dicts.add(_COMMON_ATTRS, { diff --git a/js/private/pnpm_utils.bzl b/js/private/pnpm_utils.bzl index 29e9ff3ea..d012747b9 100644 --- a/js/private/pnpm_utils.bzl +++ b/js/private/pnpm_utils.bzl @@ -91,14 +91,14 @@ pnpm_utils = struct( friendly_name = _friendly_name, virtual_store_name = _virtual_store_name, strip_peer_dep_version = _strip_peer_dep_version, - # Prefix namespace to use for generated js_binary targets and aliases - js_package_target_namespace = "jsp__", # Symlinked node_modules structure virtual store path under node_modules virtual_store_root = ".aspect_rules_js", + # Prefix namespace to use for js_package direct links + direct_link_target_namespace = "direct__", + # Prefix namespace to use for js_package store links + store_link_target_namespace = "store__", # Postfix for npm_import links repository links_postfix = "__links", - # Postfix for virtual store target - store_postfix = "__store", # Postfix for package directory filegroup and alias targets dir_postfix = "__dir", # Output group name for the package directory of a linked package diff --git a/js/private/test/BUILD.bazel b/js/private/test/BUILD.bazel index 76f1c0417..617f55a53 100644 --- a/js/private/test/BUILD.bazel +++ b/js/private/test/BUILD.bazel @@ -1,6 +1,7 @@ load("@bazel_skylib//rules:write_file.bzl", "write_file") load("@aspect_bazel_lib//lib:write_source_files.bzl", "write_source_files") load("@aspect_bazel_lib_host//:defs.bzl", "host") +load("@npm//:defs.bzl", "link_js_packages") load("//js:defs.bzl", "js_binary") load(":pnpm_utils_tests.bzl", "pnpm_utils_tests") load(":transitive_closure_tests.bzl", "transitive_closure_tests") @@ -8,6 +9,8 @@ load(":yaml_tests.bzl", "yaml_tests") # gazelle:exclude *_checked.bzl +link_js_packages() + # Unit tests pnpm_utils_tests(name = "test_pnpm_utils") @@ -52,6 +55,6 @@ write_source_files( "repositories_checked.bzl": "@npm//:repositories.bzl", "defs_checked.bzl": "@npm//:defs.bzl", "package_json_checked.bzl": "@npm__rollup__2.70.2//examples/npm_deps:package_json.bzl", - "package_json_with_dashes_checked.bzl": "@npm__webpack-bundle-analyzer__4.5.0__bufferutil_4.0.1//examples:package_json.bzl", + "package_json_with_dashes_checked.bzl": "@npm__webpack-bundle-analyzer__4.5.0__bufferutil_4.0.1//js/private/test:package_json.bzl", }, ) diff --git a/js/private/test/defs_checked.bzl b/js/private/test/defs_checked.bzl index 939835a45..d59103936 100755 --- a/js/private/test/defs_checked.bzl +++ b/js/private/test/defs_checked.bzl @@ -1,6 +1,5 @@ "@generated by @aspect_rules_js//js/private:translate_pnpm_lock.bzl from pnpm lock file @//:pnpm-lock.yaml" -load("@aspect_rules_js//js/private:pnpm_utils.bzl", _pnpm_utils = "pnpm_utils") load("@bazel_skylib//lib:paths.bzl", _paths = "paths") load("@npm__at_aspect-test_a__5.0.0__links//:link_js_package.bzl", link_0 = "link_js_package") load("@npm__at_aspect-test_b__5.0.0__links//:link_js_package.bzl", link_1 = "link_js_package") @@ -173,204 +172,186 @@ load("@npm__yocto-queue__0.1.0__links//:link_js_package.bzl", link_167 = "link_j # buildifier: disable=unnamed-macro def link_js_packages(): - "Generated list of link_js_package() target generators and first party linked packages corresponding to the packages in @//:pnpm-lock.yaml" - root_path = "" - importer_paths = [".", "examples", "examples/lib", "examples/macro", "examples/npm_deps"] - is_root = native.package_name() == root_path + "Generated list of link_js_package() target generators and first-party linked packages corresponding to the packages in @//:pnpm-lock.yaml" + root_package = "" + importer_paths = [".", "examples/lib", "examples/macro", "examples/npm_deps", "js/private/test"] + is_root = native.package_name() == root_package is_direct = False for import_path in importer_paths: - importer_package_path = _paths.normalize(_paths.join(root_path, import_path)) + importer_package_path = _paths.normalize(_paths.join(root_package, import_path)) if importer_package_path == ".": importer_package_path = "" if importer_package_path == native.package_name(): is_direct = True if not is_root and not is_direct: - msg = "The link_js_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 corresponding to importer paths ['.', 'examples', 'examples/lib', 'examples/macro', 'examples/npm_deps']" % native.package_name() + msg = "The link_js_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 corresponding to importer paths ['.', 'examples/lib', 'examples/macro', 'examples/npm_deps', 'js/private/test']" % native.package_name() fail(msg) - link_0(False) - link_1(False) - link_2(False) - link_3(False) - link_4(False) - link_5(False) - link_6(False) - link_7(False) - link_8(False) - link_9(False) - link_10(False) - link_11(False) - link_12(False) - link_13(False) - link_14(False) - link_15(False) - link_16(False) - link_17(False) - link_18(False) - link_19(False) - link_20(False) - link_21(False) - link_22(False) - link_23(False) - link_24(False) - link_25(False) - link_26(False) - link_27(False) - link_28(False) - link_29(False) - link_30(False) - link_31(False) - link_32(False) - link_33(False) - link_34(False) - link_35(False) - link_36(False) - link_37(False) - link_38(False) - link_39(False) - link_40(False) - link_41(False) - link_42(False) - link_43(False) - link_44(False) - link_45(False) - link_46(False) - link_47(False) - link_48(False) - link_49(False) - link_50(False) - link_51(False) - link_52(False) - link_53(False) - link_54(False) - link_55(False) - link_56(False) - link_57(False) - link_58(False) - link_59(False) - link_60(False) - link_61(False) - link_62(False) - link_63(False) - link_64(False) - link_65(False) - link_66(False) - link_67(False) - link_68(False) - link_69(False) - link_70(False) - link_71(False) - link_72(False) - link_73(False) - link_74(False) - link_75(False) - link_76(False) - link_77(False) - link_78(False) - link_79(False) - link_80(False) - link_81(False) - link_82(False) - link_83(False) - link_84(False) - link_85(False) - link_86(False) - link_87(False) - link_88(False) - link_89(False) - link_90(False) - link_91(False) - link_92(False) - link_93(False) - link_94(False) - link_95(False) - link_96(False) - link_97(False) - link_98(False) - link_99(False) - link_100(False) - link_101(False) - link_102(False) - link_103(False) - link_104(False) - link_105(False) - link_106(False) - link_107(False) - link_108(False) - link_109(False) - link_110(False) - link_111(False) - link_112(False) - link_113(False) - link_114(False) - link_115(False) - link_116(False) - link_117(False) - link_118(False) - link_119(False) - link_120(False) - link_121(False) - link_122(False) - link_123(False) - link_124(False) - link_125(False) - link_126(False) - link_127(False) - link_128(False) - link_129(False) - link_130(False) - link_131(False) - link_132(False) - link_133(False) - link_134(False) - link_135(False) - link_136(False) - link_137(False) - link_138(False) - link_139(False) - link_140(False) - link_141(False) - link_142(False) - link_143(False) - link_144(False) - link_145(False) - link_146(False) - link_147(False) - link_148(False) - link_149(False) - link_150(False) - link_151(False) - link_152(False) - link_153(False) - link_154(False) - link_155(False) - link_156(False) - link_157(False) - link_158(False) - link_159(False) - link_160(False) - link_161(False) - link_162(False) - link_163(False) - link_164(False) - link_165(False) - link_166(False) - link_167(False) - -def package(name, import_path = "."): - package_path = _paths.normalize(_paths.join("", import_path)) - if package_path == ".": - package_path = "" - return Label("@//{package_path}:jsp__{bazel_name}".format( - package_path = package_path, - bazel_name = _pnpm_utils.bazel_name(name), - )) - -def package_dir(name, import_path = "."): - package_path = _paths.normalize(_paths.join("", import_path)) - if package_path == ".": - package_path = "" - return Label("@//{package_path}:jsp__{bazel_name}__dir".format( - package_path = package_path, - bazel_name = _pnpm_utils.bazel_name(name), - )) + link_0(name = "direct__at_aspect-test_a", direct = None, fail_if_no_link = False) + link_1(name = "direct__at_aspect-test_b", direct = None, fail_if_no_link = False) + link_2(name = "direct__at_aspect-test_c", direct = None, fail_if_no_link = False) + link_3(name = "direct__at_aspect-test_c", direct = None, fail_if_no_link = False) + link_4(name = "direct__at_aspect-test_d", direct = None, fail_if_no_link = False) + link_5(name = "direct__at_aspect-test_d", direct = None, fail_if_no_link = False) + link_6(name = "direct__at_gregmagolan_test-a", direct = None, fail_if_no_link = False) + link_7(name = "direct__at_gregmagolan_test-b", direct = None, fail_if_no_link = False) + link_8(name = "direct__at_polka_url", direct = None, fail_if_no_link = False) + link_9(name = "direct__at_rollup_plugin-commonjs", direct = None, fail_if_no_link = False) + link_10(name = "direct__at_rollup_pluginutils", direct = None, fail_if_no_link = False) + link_11(name = "direct__at_types_estree", direct = None, fail_if_no_link = False) + link_12(name = "direct__at_types_estree", direct = None, fail_if_no_link = False) + link_13(name = "direct__at_types_node", direct = None, fail_if_no_link = False) + link_14(name = "direct__at_ungap_promise-all-settled", direct = None, fail_if_no_link = False) + link_15(name = "direct__acorn-walk", direct = None, fail_if_no_link = False) + link_16(name = "direct__acorn", direct = None, fail_if_no_link = False) + link_17(name = "direct__ansi-colors", direct = None, fail_if_no_link = False) + link_18(name = "direct__ansi-regex", direct = None, fail_if_no_link = False) + link_19(name = "direct__ansi-styles", direct = None, fail_if_no_link = False) + link_20(name = "direct__anymatch", direct = None, fail_if_no_link = False) + link_21(name = "direct__argparse", direct = None, fail_if_no_link = False) + link_22(name = "direct__balanced-match", direct = None, fail_if_no_link = False) + link_23(name = "direct__binary-extensions", direct = None, fail_if_no_link = False) + link_24(name = "direct__brace-expansion", direct = None, fail_if_no_link = False) + link_25(name = "direct__brace-expansion", direct = None, fail_if_no_link = False) + link_26(name = "direct__braces", direct = None, fail_if_no_link = False) + link_27(name = "direct__browser-stdout", direct = None, fail_if_no_link = False) + link_28(name = "direct__bufferutil", direct = None, fail_if_no_link = False) + link_29(name = "direct__camelcase", direct = None, fail_if_no_link = False) + link_30(name = "direct__chalk", direct = None, fail_if_no_link = False) + link_31(name = "direct__charenc", direct = None, fail_if_no_link = False) + link_32(name = "direct__chokidar", direct = None, fail_if_no_link = False) + link_33(name = "direct__cliui", direct = None, fail_if_no_link = False) + link_34(name = "direct__color-convert", direct = None, fail_if_no_link = False) + link_35(name = "direct__color-name", direct = None, fail_if_no_link = False) + link_36(name = "direct__commander", direct = None, fail_if_no_link = False) + link_37(name = "direct__commondir", direct = None, fail_if_no_link = False) + link_38(name = "direct__concat-map", direct = None, fail_if_no_link = False) + link_39(name = "direct__crypt", direct = None, fail_if_no_link = False) + link_40(name = "direct__debug", direct = None, fail_if_no_link = False) + link_41(name = "direct__debug", direct = None, fail_if_no_link = False) + link_42(name = "direct__debug", direct = None, fail_if_no_link = False) + link_43(name = "direct__decamelize", direct = None, fail_if_no_link = False) + link_44(name = "direct__dequal", direct = None, fail_if_no_link = False) + link_45(name = "direct__diff", direct = None, fail_if_no_link = False) + link_46(name = "direct__diff", direct = None, fail_if_no_link = False) + link_47(name = "direct__duplexer", direct = None, fail_if_no_link = False) + link_48(name = "direct__emoji-regex", direct = None, fail_if_no_link = False) + link_49(name = "direct__esbuild-android-64", direct = None, fail_if_no_link = False) + link_50(name = "direct__esbuild-android-arm64", direct = None, fail_if_no_link = False) + link_51(name = "direct__esbuild-darwin-64", direct = None, fail_if_no_link = False) + link_52(name = "direct__esbuild-darwin-arm64", direct = None, fail_if_no_link = False) + link_53(name = "direct__esbuild-freebsd-64", direct = None, fail_if_no_link = False) + link_54(name = "direct__esbuild-freebsd-arm64", direct = None, fail_if_no_link = False) + link_55(name = "direct__esbuild-linux-32", direct = None, fail_if_no_link = False) + link_56(name = "direct__esbuild-linux-64", direct = None, fail_if_no_link = False) + link_57(name = "direct__esbuild-linux-arm", direct = None, fail_if_no_link = False) + link_58(name = "direct__esbuild-linux-arm64", direct = None, fail_if_no_link = False) + link_59(name = "direct__esbuild-linux-mips64le", direct = None, fail_if_no_link = False) + link_60(name = "direct__esbuild-linux-ppc64le", direct = None, fail_if_no_link = False) + link_61(name = "direct__esbuild-linux-riscv64", direct = None, fail_if_no_link = False) + link_62(name = "direct__esbuild-linux-s390x", direct = None, fail_if_no_link = False) + link_63(name = "direct__esbuild-netbsd-64", direct = None, fail_if_no_link = False) + link_64(name = "direct__esbuild-openbsd-64", direct = None, fail_if_no_link = False) + link_65(name = "direct__esbuild-sunos-64", direct = None, fail_if_no_link = False) + link_66(name = "direct__esbuild-windows-32", direct = None, fail_if_no_link = False) + link_67(name = "direct__esbuild-windows-64", direct = None, fail_if_no_link = False) + link_68(name = "direct__esbuild-windows-arm64", direct = None, fail_if_no_link = False) + link_69(name = "direct__esbuild", direct = None, fail_if_no_link = False) + link_70(name = "direct__escalade", direct = None, fail_if_no_link = False) + link_71(name = "direct__escape-string-regexp", direct = None, fail_if_no_link = False) + link_72(name = "direct__estree-walker", direct = None, fail_if_no_link = False) + link_73(name = "direct__estree-walker", direct = None, fail_if_no_link = False) + link_74(name = "direct__fill-range", direct = None, fail_if_no_link = False) + link_75(name = "direct__find-up", direct = None, fail_if_no_link = False) + link_76(name = "direct__flat", direct = None, fail_if_no_link = False) + link_77(name = "direct__fs.realpath", direct = None, fail_if_no_link = False) + link_78(name = "direct__fsevents", direct = None, fail_if_no_link = False) + link_79(name = "direct__function-bind", direct = None, fail_if_no_link = False) + link_80(name = "direct__get-caller-file", direct = None, fail_if_no_link = False) + link_81(name = "direct__glob-parent", direct = None, fail_if_no_link = False) + link_82(name = "direct__glob", direct = None, fail_if_no_link = False) + link_83(name = "direct__glob", direct = None, fail_if_no_link = False) + link_84(name = "direct__gzip-size", direct = None, fail_if_no_link = False) + link_85(name = "direct__has-flag", direct = None, fail_if_no_link = False) + link_86(name = "direct__has", direct = None, fail_if_no_link = False) + link_87(name = "direct__he", direct = None, fail_if_no_link = False) + link_88(name = "direct__inflight", direct = None, fail_if_no_link = False) + link_89(name = "direct__inherits", direct = None, fail_if_no_link = False) + link_90(name = "direct__is-binary-path", direct = None, fail_if_no_link = False) + link_91(name = "direct__is-buffer", direct = None, fail_if_no_link = False) + link_92(name = "direct__is-core-module", direct = None, fail_if_no_link = False) + link_93(name = "direct__is-extglob", direct = None, fail_if_no_link = False) + link_94(name = "direct__is-fullwidth-code-point", direct = None, fail_if_no_link = False) + link_95(name = "direct__is-glob", direct = None, fail_if_no_link = False) + link_96(name = "direct__is-number", direct = None, fail_if_no_link = False) + link_97(name = "direct__is-plain-obj", direct = None, fail_if_no_link = False) + link_98(name = "direct__is-reference", direct = None, fail_if_no_link = False) + link_99(name = "direct__is-unicode-supported", direct = None, fail_if_no_link = False) + link_100(name = "direct__js-tokens", direct = None, fail_if_no_link = False) + link_101(name = "direct__js-yaml", direct = None, fail_if_no_link = False) + link_102(name = "direct__kleur", direct = None, fail_if_no_link = False) + link_103(name = "direct__locate-path", direct = None, fail_if_no_link = False) + link_104(name = "direct__lodash", direct = None, fail_if_no_link = False) + link_105(name = "direct__log-symbols", direct = None, fail_if_no_link = False) + link_106(name = "direct__loose-envify", direct = None, fail_if_no_link = False) + link_107(name = "direct__magic-string", direct = None, fail_if_no_link = False) + link_108(name = "direct__md5", direct = None, fail_if_no_link = False) + link_109(name = "direct__minimatch", direct = None, fail_if_no_link = False) + link_110(name = "direct__minimatch", direct = None, fail_if_no_link = False) + link_111(name = "direct__minimist", direct = None, fail_if_no_link = False) + link_112(name = "direct__mkdirp", direct = None, fail_if_no_link = False) + link_113(name = "direct__mobx-react-lite", direct = None, fail_if_no_link = False) + link_114(name = "direct__mobx-react", direct = None, fail_if_no_link = False) + link_115(name = "direct__mobx", direct = None, fail_if_no_link = False) + link_116(name = "direct__mocha-junit-reporter", direct = None, fail_if_no_link = False) + link_117(name = "direct__mocha-multi-reporters", direct = None, fail_if_no_link = False) + link_118(name = "direct__mocha", direct = None, fail_if_no_link = False) + link_119(name = "direct__mri", direct = None, fail_if_no_link = False) + link_120(name = "direct__mrmime", direct = None, fail_if_no_link = False) + link_121(name = "direct__ms", direct = None, fail_if_no_link = False) + link_122(name = "direct__ms", direct = None, fail_if_no_link = False) + link_123(name = "direct__ms", direct = None, fail_if_no_link = False) + link_124(name = "direct__nanoid", direct = None, fail_if_no_link = False) + link_125(name = "direct__node-gyp-build", direct = None, fail_if_no_link = False) + link_126(name = "direct__normalize-path", direct = None, fail_if_no_link = False) + link_127(name = "direct__object-assign", direct = None, fail_if_no_link = False) + link_128(name = "direct__once", direct = None, fail_if_no_link = False) + link_129(name = "direct__opener", direct = None, fail_if_no_link = False) + link_130(name = "direct__p-limit", direct = None, fail_if_no_link = False) + link_131(name = "direct__p-locate", direct = None, fail_if_no_link = False) + link_132(name = "direct__path-exists", direct = None, fail_if_no_link = False) + link_133(name = "direct__path-is-absolute", direct = None, fail_if_no_link = False) + link_134(name = "direct__path-parse", direct = None, fail_if_no_link = False) + link_135(name = "direct__picomatch", direct = None, fail_if_no_link = False) + link_136(name = "direct__randombytes", direct = None, fail_if_no_link = False) + link_137(name = "direct__react", direct = None, fail_if_no_link = False) + link_138(name = "direct__readdirp", direct = None, fail_if_no_link = False) + link_139(name = "direct__require-directory", direct = None, fail_if_no_link = False) + link_140(name = "direct__resolve", direct = None, fail_if_no_link = False) + link_141(name = "direct__rollup", direct = None, fail_if_no_link = False) + link_142(name = "direct__sade", direct = None, fail_if_no_link = False) + link_143(name = "direct__safe-buffer", direct = None, fail_if_no_link = False) + link_144(name = "direct__serialize-javascript", direct = None, fail_if_no_link = False) + link_145(name = "direct__sirv", direct = None, fail_if_no_link = False) + link_146(name = "direct__sourcemap-codec", direct = None, fail_if_no_link = False) + link_147(name = "direct__string-width", direct = None, fail_if_no_link = False) + link_148(name = "direct__strip-ansi", direct = None, fail_if_no_link = False) + link_149(name = "direct__strip-json-comments", direct = None, fail_if_no_link = False) + link_150(name = "direct__supports-color", direct = None, fail_if_no_link = False) + link_151(name = "direct__supports-color", direct = None, fail_if_no_link = False) + link_152(name = "direct__supports-preserve-symlinks-flag", direct = None, fail_if_no_link = False) + link_153(name = "direct__to-regex-range", direct = None, fail_if_no_link = False) + link_154(name = "direct__totalist", direct = None, fail_if_no_link = False) + link_155(name = "direct__typescript", direct = None, fail_if_no_link = False) + link_156(name = "direct__uvu", direct = None, fail_if_no_link = False) + link_157(name = "direct__webpack-bundle-analyzer", direct = None, fail_if_no_link = False) + link_158(name = "direct__workerpool", direct = None, fail_if_no_link = False) + link_159(name = "direct__wrap-ansi", direct = None, fail_if_no_link = False) + link_160(name = "direct__wrappy", direct = None, fail_if_no_link = False) + link_161(name = "direct__ws", direct = None, fail_if_no_link = False) + link_162(name = "direct__xml", direct = None, fail_if_no_link = False) + link_163(name = "direct__y18n", direct = None, fail_if_no_link = False) + link_164(name = "direct__yargs-parser", direct = None, fail_if_no_link = False) + link_165(name = "direct__yargs-unparser", direct = None, fail_if_no_link = False) + link_166(name = "direct__yargs", direct = None, fail_if_no_link = False) + link_167(name = "direct__yocto-queue", direct = None, fail_if_no_link = False) diff --git a/examples/package.json b/js/private/test/package.json similarity index 60% rename from examples/package.json rename to js/private/test/package.json index 12f89db66..3e7eba011 100644 --- a/examples/package.json +++ b/js/private/test/package.json @@ -1,9 +1,7 @@ { "private": true, + "// devDependencies": "test linking & building 3rd party npm packages with problematic postinstall", "devDependencies": { - "@aspect-test/a": "5.0.0", - "@aspect-test/b": "5.0.0", - "@aspect-test/c": "2.0.0", "bufferutil": "4.0.1", "esbuild": "0.14.38", "webpack-bundle-analyzer": "4.5.0" diff --git a/js/private/test/package_json_checked.bzl b/js/private/test/package_json_checked.bzl index 00b1133f5..4b2d8a9e9 100755 --- a/js/private/test/package_json_checked.bzl +++ b/js/private/test/package_json_checked.bzl @@ -7,13 +7,13 @@ load("@aspect_rules_js//js:run_js_binary.bzl", _run_js_binary = "run_js_binary") def rollup(name, **kwargs): _directory_path( name = "%s__entry_point" % name, - directory = "@//examples/npm_deps:jsp__rollup__2.70.2__dir", + directory = "@//examples/npm_deps:direct__rollup__2.70.2__dir", path = "dist/bin/rollup", ) _js_binary( name = "%s__js_binary" % name, entry_point = ":%s__entry_point" % name, - data = ["@//examples/npm_deps:jsp__rollup__2.70.2"], + data = ["@//examples/npm_deps:direct__rollup__2.70.2"], ) _run_js_binary( name = name, @@ -24,26 +24,26 @@ def rollup(name, **kwargs): def rollup_test(name, **kwargs): _directory_path( name = "%s__entry_point" % name, - directory = "@//examples/npm_deps:jsp__rollup__2.70.2__dir", + directory = "@//examples/npm_deps:direct__rollup__2.70.2__dir", path = "dist/bin/rollup", ) _js_test( name = name, entry_point = ":%s__entry_point" % name, - data = kwargs.pop("data", []) + ["@//examples/npm_deps:jsp__rollup__2.70.2"], + data = kwargs.pop("data", []) + ["@//examples/npm_deps:direct__rollup__2.70.2"], **kwargs ) def rollup_binary(name, **kwargs): _directory_path( name = "%s__entry_point" % name, - directory = "@//examples/npm_deps:jsp__rollup__2.70.2__dir", + directory = "@//examples/npm_deps:direct__rollup__2.70.2__dir", path = "dist/bin/rollup", ) _js_binary( name = name, entry_point = ":%s__entry_point" % name, - data = kwargs.pop("data", []) + ["@//examples/npm_deps:jsp__rollup__2.70.2"], + data = kwargs.pop("data", []) + ["@//examples/npm_deps:direct__rollup__2.70.2"], **kwargs ) diff --git a/js/private/test/package_json_with_dashes_checked.bzl b/js/private/test/package_json_with_dashes_checked.bzl index 18aa58906..f4f89ccd2 100755 --- a/js/private/test/package_json_with_dashes_checked.bzl +++ b/js/private/test/package_json_with_dashes_checked.bzl @@ -7,13 +7,13 @@ load("@aspect_rules_js//js:run_js_binary.bzl", _run_js_binary = "run_js_binary") def webpack_bundle_analyzer(name, **kwargs): _directory_path( name = "%s__entry_point" % name, - directory = "@//examples:jsp__webpack-bundle-analyzer__4.5.0__bufferutil_4.0.1__dir", + directory = "@//js/private/test:direct__webpack-bundle-analyzer__4.5.0__bufferutil_4.0.1__dir", path = "lib/bin/analyzer.js", ) _js_binary( name = "%s__js_binary" % name, entry_point = ":%s__entry_point" % name, - data = ["@//examples:jsp__webpack-bundle-analyzer__4.5.0__bufferutil_4.0.1"], + data = ["@//js/private/test:direct__webpack-bundle-analyzer__4.5.0__bufferutil_4.0.1"], ) _run_js_binary( name = name, @@ -24,26 +24,26 @@ def webpack_bundle_analyzer(name, **kwargs): def webpack_bundle_analyzer_test(name, **kwargs): _directory_path( name = "%s__entry_point" % name, - directory = "@//examples:jsp__webpack-bundle-analyzer__4.5.0__bufferutil_4.0.1__dir", + directory = "@//js/private/test:direct__webpack-bundle-analyzer__4.5.0__bufferutil_4.0.1__dir", path = "lib/bin/analyzer.js", ) _js_test( name = name, entry_point = ":%s__entry_point" % name, - data = kwargs.pop("data", []) + ["@//examples:jsp__webpack-bundle-analyzer__4.5.0__bufferutil_4.0.1"], + data = kwargs.pop("data", []) + ["@//js/private/test:direct__webpack-bundle-analyzer__4.5.0__bufferutil_4.0.1"], **kwargs ) def webpack_bundle_analyzer_binary(name, **kwargs): _directory_path( name = "%s__entry_point" % name, - directory = "@//examples:jsp__webpack-bundle-analyzer__4.5.0__bufferutil_4.0.1__dir", + directory = "@//js/private/test:direct__webpack-bundle-analyzer__4.5.0__bufferutil_4.0.1__dir", path = "lib/bin/analyzer.js", ) _js_binary( name = name, entry_point = ":%s__entry_point" % name, - data = kwargs.pop("data", []) + ["@//examples:jsp__webpack-bundle-analyzer__4.5.0__bufferutil_4.0.1"], + data = kwargs.pop("data", []) + ["@//js/private/test:direct__webpack-bundle-analyzer__4.5.0__bufferutil_4.0.1"], **kwargs ) diff --git a/js/private/test/repositories_checked.bzl b/js/private/test/repositories_checked.bzl index 09151f3f3..4297d41e5 100755 --- a/js/private/test/repositories_checked.bzl +++ b/js/private/test/repositories_checked.bzl @@ -7,9 +7,9 @@ def npm_repositories(): npm_import( name = "npm__at_aspect-test_a__5.0.0", integrity = "sha512-t/lwpVXG/jmxTotGEsmjwuihC2Lvz/Iqt63o78SI3O5XallxtFp5j2WM2M6HwkFiii9I42KdlAF8B3plZMz0Fw==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = ["examples"], + link_packages = ["examples/npm_deps"], package = "@aspect-test/a", version = "5.0.0", deps = { @@ -28,9 +28,9 @@ def npm_repositories(): npm_import( name = "npm__at_aspect-test_b__5.0.0", integrity = "sha512-MyIW6gHL3ds0BmDTOktorHLJUya5eZLGZlOxsKN2M9c3DWp+p1pBrA6KLQX1iq9BciryhpKwl82IAxP4jG52kw==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = ["examples"], + link_packages = [], package = "@aspect-test/b", version = "5.0.0", deps = { @@ -49,9 +49,9 @@ def npm_repositories(): npm_import( name = "npm__at_aspect-test_c__1.0.0", integrity = "sha512-UorLD4TFr9CWFeYbUd5etaxSo201fYEFR+rSxXytfzefX41EWCBabsXhdhvXjK6v/HRuo1y1I1NiW2P3/bKJeA==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "@aspect-test/c", version = "1.0.0", transitive_closure = { @@ -64,9 +64,9 @@ def npm_repositories(): npm_import( name = "npm__at_aspect-test_c__2.0.0", integrity = "sha512-vRuHi/8zxZ+IRGdgdX4VoMNFZrR9UqO87yQx61IGIkjgV7QcKUeu5jfvIE3Mr0WNQeMdO1JpyTx1UUpsE73iug==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = ["examples"], + link_packages = ["examples/npm_deps"], package = "@aspect-test/c", version = "2.0.0", transitive_closure = { @@ -79,9 +79,9 @@ def npm_repositories(): npm_import( name = "npm__at_aspect-test_d__2.0.0__at_aspect-test_c_1.0.0", integrity = "sha512-jndwr8pLUfn795uApTcXG/yZ5hV2At1aS/wo5BVLxqlVVgLoOETF/Dp4QOjMHE/SXkXFowz6Hao+WpmzVvAO0A==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "@aspect-test/d", version = "2.0.0_@aspect-test+c@1.0.0", deps = { @@ -96,9 +96,9 @@ def npm_repositories(): npm_import( name = "npm__at_aspect-test_d__2.0.0__at_aspect-test_c_2.0.0", integrity = "sha512-jndwr8pLUfn795uApTcXG/yZ5hV2At1aS/wo5BVLxqlVVgLoOETF/Dp4QOjMHE/SXkXFowz6Hao+WpmzVvAO0A==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "@aspect-test/d", version = "2.0.0_@aspect-test+c@2.0.0", deps = { @@ -113,24 +113,24 @@ def npm_repositories(): npm_import( name = "npm__at_gregmagolan_test-a__0.0.1", integrity = "sha512-nMZ3MKkXZ+uYbrm8R3dfdt3v1gOOLtf88CdDciWxMYGLr29oVjQG11y2fz4IRBR6R7hI2Gj+G9sHZ69wLTnjfA==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "@gregmagolan/test-a", version = "0.0.1", transitive_closure = { "@gregmagolan/test-a": ["0.0.1"], }, - patches = ["//examples:patches/test-a.patch", "//examples:patches/test-a@0.0.1.patch"], + patches = ["//examples/npm_deps:patches/test-a.patch", "//examples/npm_deps:patches/test-a@0.0.1.patch"], patch_args = ["-p1"], ) npm_import( name = "npm__at_gregmagolan_test-b__0.0.2", integrity = "sha512-h+LeJUbUued9XyQwxKMUdklGiGxPYJ1RvTAK9612ctCiMS2Fn0wu/Au5kHsMHxm8l4bOfpgAWmQ0OQQy7wUBCg==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = ["examples/npm_deps"], + link_packages = ["examples/npm_deps"], package = "@gregmagolan/test-b", version = "0.0.2", deps = { @@ -145,9 +145,9 @@ def npm_repositories(): npm_import( name = "npm__at_polka_url__1.0.0-next.21", integrity = "sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "@polka/url", version = "1.0.0-next.21", transitive_closure = { @@ -158,9 +158,9 @@ def npm_repositories(): npm_import( name = "npm__at_rollup_plugin-commonjs__21.1.0__rollup_2.70.2", integrity = "sha512-6ZtHx3VHIp2ReNNDxHjuUml6ur+WcQ28N1yHgCQwsbNkQg2suhxGMDQGJOn/KuDxKtd1xuZP5xSTwBA4GQ8hbA==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = ["examples/npm_deps"], + link_packages = ["examples/npm_deps"], package = "@rollup/plugin-commonjs", version = "21.1.0_rollup@2.70.2", deps = { @@ -208,9 +208,9 @@ def npm_repositories(): npm_import( name = "npm__at_rollup_pluginutils__3.1.0__rollup_2.70.2", integrity = "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "@rollup/pluginutils", version = "3.1.0_rollup@2.70.2", deps = { @@ -232,9 +232,9 @@ def npm_repositories(): npm_import( name = "npm__at_types_estree__0.0.39", integrity = "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "@types/estree", version = "0.0.39", transitive_closure = { @@ -245,9 +245,9 @@ def npm_repositories(): npm_import( name = "npm__at_types_estree__0.0.51", integrity = "sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "@types/estree", version = "0.0.51", transitive_closure = { @@ -258,9 +258,9 @@ def npm_repositories(): npm_import( name = "npm__at_types_node__16.11.36", integrity = "sha512-FR5QJe+TaoZ2GsMHkjuwoNabr+UrJNRr2HNOo+r/7vhcuntM6Ee/pRPOnRhhL2XE9OOvX9VLEq+BcXl3VjNoWA==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = ["."], + link_packages = [""], package = "@types/node", version = "16.11.36", transitive_closure = { @@ -271,9 +271,9 @@ def npm_repositories(): npm_import( name = "npm__at_ungap_promise-all-settled__1.1.2", integrity = "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "@ungap/promise-all-settled", version = "1.1.2", transitive_closure = { @@ -284,9 +284,9 @@ def npm_repositories(): npm_import( name = "npm__acorn-walk__8.2.0", integrity = "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "acorn-walk", version = "8.2.0", transitive_closure = { @@ -297,9 +297,9 @@ def npm_repositories(): npm_import( name = "npm__acorn__8.7.1", integrity = "sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "acorn", version = "8.7.1", transitive_closure = { @@ -310,9 +310,9 @@ def npm_repositories(): npm_import( name = "npm__ansi-colors__4.1.1", integrity = "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "ansi-colors", version = "4.1.1", transitive_closure = { @@ -323,9 +323,9 @@ def npm_repositories(): npm_import( name = "npm__ansi-regex__5.0.1", integrity = "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "ansi-regex", version = "5.0.1", transitive_closure = { @@ -336,9 +336,9 @@ def npm_repositories(): npm_import( name = "npm__ansi-styles__4.3.0", integrity = "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "ansi-styles", version = "4.3.0", deps = { @@ -354,9 +354,9 @@ def npm_repositories(): npm_import( name = "npm__anymatch__3.1.2", integrity = "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "anymatch", version = "3.1.2", deps = { @@ -373,9 +373,9 @@ def npm_repositories(): npm_import( name = "npm__argparse__2.0.1", integrity = "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "argparse", version = "2.0.1", transitive_closure = { @@ -386,9 +386,9 @@ def npm_repositories(): npm_import( name = "npm__balanced-match__1.0.2", integrity = "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "balanced-match", version = "1.0.2", transitive_closure = { @@ -399,9 +399,9 @@ def npm_repositories(): npm_import( name = "npm__binary-extensions__2.2.0", integrity = "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "binary-extensions", version = "2.2.0", transitive_closure = { @@ -412,9 +412,9 @@ def npm_repositories(): npm_import( name = "npm__brace-expansion__1.1.11", integrity = "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "brace-expansion", version = "1.1.11", deps = { @@ -431,9 +431,9 @@ def npm_repositories(): npm_import( name = "npm__brace-expansion__2.0.1", integrity = "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "brace-expansion", version = "2.0.1", deps = { @@ -448,9 +448,9 @@ def npm_repositories(): npm_import( name = "npm__braces__3.0.2", integrity = "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "braces", version = "3.0.2", deps = { @@ -467,9 +467,9 @@ def npm_repositories(): npm_import( name = "npm__browser-stdout__1.3.1", integrity = "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "browser-stdout", version = "1.3.1", transitive_closure = { @@ -480,9 +480,9 @@ def npm_repositories(): npm_import( name = "npm__bufferutil__4.0.1", integrity = "sha512-xowrxvpxojqkagPcWRQVXZl0YXhRhAtBEIq3VoER1NH5Mw1n1o0ojdspp+GS2J//2gCVyrzQDApQ4unGF+QOoA==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = ["examples"], + link_packages = ["js/private/test"], package = "bufferutil", version = "4.0.1", deps = { @@ -498,9 +498,9 @@ def npm_repositories(): npm_import( name = "npm__camelcase__6.3.0", integrity = "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "camelcase", version = "6.3.0", transitive_closure = { @@ -511,9 +511,9 @@ def npm_repositories(): npm_import( name = "npm__chalk__4.1.2", integrity = "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "chalk", version = "4.1.2", deps = { @@ -533,9 +533,9 @@ def npm_repositories(): npm_import( name = "npm__charenc__0.0.2", integrity = "sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "charenc", version = "0.0.2", transitive_closure = { @@ -546,9 +546,9 @@ def npm_repositories(): npm_import( name = "npm__chokidar__3.5.3", integrity = "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "chokidar", version = "3.5.3", deps = { @@ -583,9 +583,9 @@ def npm_repositories(): npm_import( name = "npm__cliui__7.0.4", integrity = "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "cliui", version = "7.0.4", deps = { @@ -610,9 +610,9 @@ def npm_repositories(): npm_import( name = "npm__color-convert__2.0.1", integrity = "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "color-convert", version = "2.0.1", deps = { @@ -627,9 +627,9 @@ def npm_repositories(): npm_import( name = "npm__color-name__1.1.4", integrity = "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "color-name", version = "1.1.4", transitive_closure = { @@ -640,9 +640,9 @@ def npm_repositories(): npm_import( name = "npm__commander__7.2.0", integrity = "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "commander", version = "7.2.0", transitive_closure = { @@ -653,9 +653,9 @@ def npm_repositories(): npm_import( name = "npm__commondir__1.0.1", integrity = "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "commondir", version = "1.0.1", transitive_closure = { @@ -666,9 +666,9 @@ def npm_repositories(): npm_import( name = "npm__concat-map__0.0.1", integrity = "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "concat-map", version = "0.0.1", transitive_closure = { @@ -679,9 +679,9 @@ def npm_repositories(): npm_import( name = "npm__crypt__0.0.2", integrity = "sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "crypt", version = "0.0.2", transitive_closure = { @@ -692,9 +692,9 @@ def npm_repositories(): npm_import( name = "npm__debug__2.6.9", integrity = "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "debug", version = "2.6.9", deps = { @@ -709,9 +709,9 @@ def npm_repositories(): npm_import( name = "npm__debug__4.3.4", integrity = "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "debug", version = "4.3.4", deps = { @@ -726,9 +726,9 @@ def npm_repositories(): npm_import( name = "npm__debug__4.3.4__supports-color_8.1.1", integrity = "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "debug", version = "4.3.4_supports-color@8.1.1", deps = { @@ -746,9 +746,9 @@ def npm_repositories(): npm_import( name = "npm__decamelize__4.0.0", integrity = "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "decamelize", version = "4.0.0", transitive_closure = { @@ -759,9 +759,9 @@ def npm_repositories(): npm_import( name = "npm__dequal__2.0.2", integrity = "sha512-q9K8BlJVxK7hQYqa6XISGmBZbtQQWVXSrRrWreHC94rMt1QL/Impruc+7p2CYSYuVIUr+YCt6hjrs1kkdJRTug==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "dequal", version = "2.0.2", transitive_closure = { @@ -772,9 +772,9 @@ def npm_repositories(): npm_import( name = "npm__diff__5.0.0", integrity = "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "diff", version = "5.0.0", transitive_closure = { @@ -785,9 +785,9 @@ def npm_repositories(): npm_import( name = "npm__diff__5.1.0", integrity = "sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "diff", version = "5.1.0", transitive_closure = { @@ -798,9 +798,9 @@ def npm_repositories(): npm_import( name = "npm__duplexer__0.1.2", integrity = "sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "duplexer", version = "0.1.2", transitive_closure = { @@ -811,9 +811,9 @@ def npm_repositories(): npm_import( name = "npm__emoji-regex__8.0.0", integrity = "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "emoji-regex", version = "8.0.0", transitive_closure = { @@ -824,9 +824,9 @@ def npm_repositories(): npm_import( name = "npm__esbuild-android-64__0.14.38", integrity = "sha512-aRFxR3scRKkbmNuGAK+Gee3+yFxkTJO/cx83Dkyzo4CnQl/2zVSurtG6+G86EQIZ+w+VYngVyK7P3HyTBKu3nw==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "esbuild-android-64", version = "0.14.38", transitive_closure = { @@ -838,9 +838,9 @@ def npm_repositories(): npm_import( name = "npm__esbuild-android-arm64__0.14.38", integrity = "sha512-L2NgQRWuHFI89IIZIlpAcINy9FvBk6xFVZ7xGdOwIm8VyhX1vNCEqUJO3DPSSy945Gzdg98cxtNt8Grv1CsyhA==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "esbuild-android-arm64", version = "0.14.38", transitive_closure = { @@ -852,9 +852,9 @@ def npm_repositories(): npm_import( name = "npm__esbuild-darwin-64__0.14.38", integrity = "sha512-5JJvgXkX87Pd1Og0u/NJuO7TSqAikAcQQ74gyJ87bqWRVeouky84ICoV4sN6VV53aTW+NE87qLdGY4QA2S7KNA==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "esbuild-darwin-64", version = "0.14.38", transitive_closure = { @@ -866,9 +866,9 @@ def npm_repositories(): npm_import( name = "npm__esbuild-darwin-arm64__0.14.38", integrity = "sha512-eqF+OejMI3mC5Dlo9Kdq/Ilbki9sQBw3QlHW3wjLmsLh+quNfHmGMp3Ly1eWm981iGBMdbtSS9+LRvR2T8B3eQ==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "esbuild-darwin-arm64", version = "0.14.38", transitive_closure = { @@ -880,9 +880,9 @@ def npm_repositories(): npm_import( name = "npm__esbuild-freebsd-64__0.14.38", integrity = "sha512-epnPbhZUt93xV5cgeY36ZxPXDsQeO55DppzsIgWM8vgiG/Rz+qYDLmh5ts3e+Ln1wA9dQ+nZmVHw+RjaW3I5Ig==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "esbuild-freebsd-64", version = "0.14.38", transitive_closure = { @@ -894,9 +894,9 @@ def npm_repositories(): npm_import( name = "npm__esbuild-freebsd-arm64__0.14.38", integrity = "sha512-/9icXUYJWherhk+y5fjPI5yNUdFPtXHQlwP7/K/zg8t8lQdHVj20SqU9/udQmeUo5pDFHMYzcEFfJqgOVeKNNQ==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "esbuild-freebsd-arm64", version = "0.14.38", transitive_closure = { @@ -908,9 +908,9 @@ def npm_repositories(): npm_import( name = "npm__esbuild-linux-32__0.14.38", integrity = "sha512-QfgfeNHRFvr2XeHFzP8kOZVnal3QvST3A0cgq32ZrHjSMFTdgXhMhmWdKzRXP/PKcfv3e2OW9tT9PpcjNvaq6g==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "esbuild-linux-32", version = "0.14.38", transitive_closure = { @@ -922,9 +922,9 @@ def npm_repositories(): npm_import( name = "npm__esbuild-linux-64__0.14.38", integrity = "sha512-uuZHNmqcs+Bj1qiW9k/HZU3FtIHmYiuxZ/6Aa+/KHb/pFKr7R3aVqvxlAudYI9Fw3St0VCPfv7QBpUITSmBR1Q==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "esbuild-linux-64", version = "0.14.38", transitive_closure = { @@ -936,9 +936,9 @@ def npm_repositories(): npm_import( name = "npm__esbuild-linux-arm__0.14.38", integrity = "sha512-FiFvQe8J3VKTDXG01JbvoVRXQ0x6UZwyrU4IaLBZeq39Bsbatd94Fuc3F1RGqPF5RbIWW7RvkVQjn79ejzysnA==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "esbuild-linux-arm", version = "0.14.38", transitive_closure = { @@ -950,9 +950,9 @@ def npm_repositories(): npm_import( name = "npm__esbuild-linux-arm64__0.14.38", integrity = "sha512-HlMGZTEsBrXrivr64eZ/EO0NQM8H8DuSENRok9d+Jtvq8hOLzrxfsAT9U94K3KOGk2XgCmkaI2KD8hX7F97lvA==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "esbuild-linux-arm64", version = "0.14.38", transitive_closure = { @@ -964,9 +964,9 @@ def npm_repositories(): npm_import( name = "npm__esbuild-linux-mips64le__0.14.38", integrity = "sha512-qd1dLf2v7QBiI5wwfil9j0HG/5YMFBAmMVmdeokbNAMbcg49p25t6IlJFXAeLzogv1AvgaXRXvgFNhScYEUXGQ==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "esbuild-linux-mips64le", version = "0.14.38", transitive_closure = { @@ -978,9 +978,9 @@ def npm_repositories(): npm_import( name = "npm__esbuild-linux-ppc64le__0.14.38", integrity = "sha512-mnbEm7o69gTl60jSuK+nn+pRsRHGtDPfzhrqEUXyCl7CTOCLtWN2bhK8bgsdp6J/2NyS/wHBjs1x8aBWwP2X9Q==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "esbuild-linux-ppc64le", version = "0.14.38", transitive_closure = { @@ -992,9 +992,9 @@ def npm_repositories(): npm_import( name = "npm__esbuild-linux-riscv64__0.14.38", integrity = "sha512-+p6YKYbuV72uikChRk14FSyNJZ4WfYkffj6Af0/Tw63/6TJX6TnIKE+6D3xtEc7DeDth1fjUOEqm+ApKFXbbVQ==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "esbuild-linux-riscv64", version = "0.14.38", transitive_closure = { @@ -1006,9 +1006,9 @@ def npm_repositories(): npm_import( name = "npm__esbuild-linux-s390x__0.14.38", integrity = "sha512-0zUsiDkGJiMHxBQ7JDU8jbaanUY975CdOW1YDrurjrM0vWHfjv9tLQsW9GSyEb/heSK1L5gaweRjzfUVBFoybQ==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "esbuild-linux-s390x", version = "0.14.38", transitive_closure = { @@ -1020,9 +1020,9 @@ def npm_repositories(): npm_import( name = "npm__esbuild-netbsd-64__0.14.38", integrity = "sha512-cljBAApVwkpnJZfnRVThpRBGzCi+a+V9Ofb1fVkKhtrPLDYlHLrSYGtmnoTVWDQdU516qYI8+wOgcGZ4XIZh0Q==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "esbuild-netbsd-64", version = "0.14.38", transitive_closure = { @@ -1034,9 +1034,9 @@ def npm_repositories(): npm_import( name = "npm__esbuild-openbsd-64__0.14.38", integrity = "sha512-CDswYr2PWPGEPpLDUO50mL3WO/07EMjnZDNKpmaxUPsrW+kVM3LoAqr/CE8UbzugpEiflYqJsGPLirThRB18IQ==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "esbuild-openbsd-64", version = "0.14.38", transitive_closure = { @@ -1048,9 +1048,9 @@ def npm_repositories(): npm_import( name = "npm__esbuild-sunos-64__0.14.38", integrity = "sha512-2mfIoYW58gKcC3bck0j7lD3RZkqYA7MmujFYmSn9l6TiIcAMpuEvqksO+ntBgbLep/eyjpgdplF7b+4T9VJGOA==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "esbuild-sunos-64", version = "0.14.38", transitive_closure = { @@ -1062,9 +1062,9 @@ def npm_repositories(): npm_import( name = "npm__esbuild-windows-32__0.14.38", integrity = "sha512-L2BmEeFZATAvU+FJzJiRLFUP+d9RHN+QXpgaOrs2klshoAm1AE6Us4X6fS9k33Uy5SzScn2TpcgecbqJza1Hjw==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "esbuild-windows-32", version = "0.14.38", transitive_closure = { @@ -1076,9 +1076,9 @@ def npm_repositories(): npm_import( name = "npm__esbuild-windows-64__0.14.38", integrity = "sha512-Khy4wVmebnzue8aeSXLC+6clo/hRYeNIm0DyikoEqX+3w3rcvrhzpoix0S+MF9vzh6JFskkIGD7Zx47ODJNyCw==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "esbuild-windows-64", version = "0.14.38", transitive_closure = { @@ -1090,9 +1090,9 @@ def npm_repositories(): npm_import( name = "npm__esbuild-windows-arm64__0.14.38", integrity = "sha512-k3FGCNmHBkqdJXuJszdWciAH77PukEyDsdIryEHn9cKLQFxzhT39dSumeTuggaQcXY57UlmLGIkklWZo2qzHpw==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "esbuild-windows-arm64", version = "0.14.38", transitive_closure = { @@ -1104,9 +1104,9 @@ def npm_repositories(): npm_import( name = "npm__esbuild__0.14.38", integrity = "sha512-12fzJ0fsm7gVZX1YQ1InkOE5f9Tl7cgf6JPYXRJtPIoE0zkWAbHdPHVPPaLi9tYAcEBqheGzqLn/3RdTOyBfcA==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = ["examples"], + link_packages = ["js/private/test"], package = "esbuild", version = "0.14.38", deps = { @@ -1160,9 +1160,9 @@ def npm_repositories(): npm_import( name = "npm__escalade__3.1.1", integrity = "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "escalade", version = "3.1.1", transitive_closure = { @@ -1173,9 +1173,9 @@ def npm_repositories(): npm_import( name = "npm__escape-string-regexp__4.0.0", integrity = "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "escape-string-regexp", version = "4.0.0", transitive_closure = { @@ -1186,9 +1186,9 @@ def npm_repositories(): npm_import( name = "npm__estree-walker__1.0.1", integrity = "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "estree-walker", version = "1.0.1", transitive_closure = { @@ -1199,9 +1199,9 @@ def npm_repositories(): npm_import( name = "npm__estree-walker__2.0.2", integrity = "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "estree-walker", version = "2.0.2", transitive_closure = { @@ -1212,9 +1212,9 @@ def npm_repositories(): npm_import( name = "npm__fill-range__7.0.1", integrity = "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "fill-range", version = "7.0.1", deps = { @@ -1230,9 +1230,9 @@ def npm_repositories(): npm_import( name = "npm__find-up__5.0.0", integrity = "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "find-up", version = "5.0.0", deps = { @@ -1252,9 +1252,9 @@ def npm_repositories(): npm_import( name = "npm__flat__5.0.2", integrity = "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "flat", version = "5.0.2", transitive_closure = { @@ -1265,9 +1265,9 @@ def npm_repositories(): npm_import( name = "npm__fs.realpath__1.0.0", integrity = "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "fs.realpath", version = "1.0.0", transitive_closure = { @@ -1278,9 +1278,9 @@ def npm_repositories(): npm_import( name = "npm__fsevents__2.3.2", integrity = "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "fsevents", version = "2.3.2", transitive_closure = { @@ -1292,9 +1292,9 @@ def npm_repositories(): npm_import( name = "npm__function-bind__1.1.1", integrity = "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "function-bind", version = "1.1.1", transitive_closure = { @@ -1305,9 +1305,9 @@ def npm_repositories(): npm_import( name = "npm__get-caller-file__2.0.5", integrity = "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "get-caller-file", version = "2.0.5", transitive_closure = { @@ -1318,9 +1318,9 @@ def npm_repositories(): npm_import( name = "npm__glob-parent__5.1.2", integrity = "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "glob-parent", version = "5.1.2", deps = { @@ -1336,9 +1336,9 @@ def npm_repositories(): npm_import( name = "npm__glob__7.2.0", integrity = "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "glob", version = "7.2.0", deps = { @@ -1367,9 +1367,9 @@ def npm_repositories(): npm_import( name = "npm__glob__7.2.3", integrity = "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "glob", version = "7.2.3", deps = { @@ -1398,9 +1398,9 @@ def npm_repositories(): npm_import( name = "npm__gzip-size__6.0.0", integrity = "sha512-ax7ZYomf6jqPTQ4+XCpUGyXKHk5WweS+e05MBO4/y3WJ5RkmPXNKvX+bx1behVILVwr6JSQvZAku021CHPXG3Q==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "gzip-size", version = "6.0.0", deps = { @@ -1415,9 +1415,9 @@ def npm_repositories(): npm_import( name = "npm__has-flag__4.0.0", integrity = "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "has-flag", version = "4.0.0", transitive_closure = { @@ -1428,9 +1428,9 @@ def npm_repositories(): npm_import( name = "npm__has__1.0.3", integrity = "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "has", version = "1.0.3", deps = { @@ -1445,9 +1445,9 @@ def npm_repositories(): npm_import( name = "npm__he__1.2.0", integrity = "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "he", version = "1.2.0", transitive_closure = { @@ -1458,9 +1458,9 @@ def npm_repositories(): npm_import( name = "npm__inflight__1.0.6", integrity = "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "inflight", version = "1.0.6", deps = { @@ -1477,9 +1477,9 @@ def npm_repositories(): npm_import( name = "npm__inherits__2.0.4", integrity = "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "inherits", version = "2.0.4", transitive_closure = { @@ -1490,9 +1490,9 @@ def npm_repositories(): npm_import( name = "npm__is-binary-path__2.1.0", integrity = "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "is-binary-path", version = "2.1.0", deps = { @@ -1507,9 +1507,9 @@ def npm_repositories(): npm_import( name = "npm__is-buffer__1.1.6", integrity = "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "is-buffer", version = "1.1.6", transitive_closure = { @@ -1520,9 +1520,9 @@ def npm_repositories(): npm_import( name = "npm__is-core-module__2.9.0", integrity = "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "is-core-module", version = "2.9.0", deps = { @@ -1538,9 +1538,9 @@ def npm_repositories(): npm_import( name = "npm__is-extglob__2.1.1", integrity = "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "is-extglob", version = "2.1.1", transitive_closure = { @@ -1551,9 +1551,9 @@ def npm_repositories(): npm_import( name = "npm__is-fullwidth-code-point__3.0.0", integrity = "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "is-fullwidth-code-point", version = "3.0.0", transitive_closure = { @@ -1564,9 +1564,9 @@ def npm_repositories(): npm_import( name = "npm__is-glob__4.0.3", integrity = "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "is-glob", version = "4.0.3", deps = { @@ -1581,9 +1581,9 @@ def npm_repositories(): npm_import( name = "npm__is-number__7.0.0", integrity = "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "is-number", version = "7.0.0", transitive_closure = { @@ -1594,9 +1594,9 @@ def npm_repositories(): npm_import( name = "npm__is-plain-obj__2.1.0", integrity = "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "is-plain-obj", version = "2.1.0", transitive_closure = { @@ -1607,9 +1607,9 @@ def npm_repositories(): npm_import( name = "npm__is-reference__1.2.1", integrity = "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "is-reference", version = "1.2.1", deps = { @@ -1624,9 +1624,9 @@ def npm_repositories(): npm_import( name = "npm__is-unicode-supported__0.1.0", integrity = "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "is-unicode-supported", version = "0.1.0", transitive_closure = { @@ -1637,9 +1637,9 @@ def npm_repositories(): npm_import( name = "npm__js-tokens__4.0.0", integrity = "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "js-tokens", version = "4.0.0", transitive_closure = { @@ -1650,9 +1650,9 @@ def npm_repositories(): npm_import( name = "npm__js-yaml__4.1.0", integrity = "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "js-yaml", version = "4.1.0", deps = { @@ -1667,9 +1667,9 @@ def npm_repositories(): npm_import( name = "npm__kleur__4.1.4", integrity = "sha512-8QADVssbrFjivHWQU7KkMgptGTl6WAcSdlbBPY4uNF+mWr6DGcKrvY2w4FQJoXch7+fKMjj0dRrL75vk3k23OA==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "kleur", version = "4.1.4", transitive_closure = { @@ -1680,9 +1680,9 @@ def npm_repositories(): npm_import( name = "npm__locate-path__6.0.0", integrity = "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "locate-path", version = "6.0.0", deps = { @@ -1699,9 +1699,9 @@ def npm_repositories(): npm_import( name = "npm__lodash__4.17.21", integrity = "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "lodash", version = "4.17.21", transitive_closure = { @@ -1712,9 +1712,9 @@ def npm_repositories(): npm_import( name = "npm__log-symbols__4.1.0", integrity = "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "log-symbols", version = "4.1.0", deps = { @@ -1736,9 +1736,9 @@ def npm_repositories(): npm_import( name = "npm__loose-envify__1.4.0", integrity = "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "loose-envify", version = "1.4.0", deps = { @@ -1753,9 +1753,9 @@ def npm_repositories(): npm_import( name = "npm__magic-string__0.25.9", integrity = "sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "magic-string", version = "0.25.9", deps = { @@ -1770,9 +1770,9 @@ def npm_repositories(): npm_import( name = "npm__md5__2.3.0", integrity = "sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "md5", version = "2.3.0", deps = { @@ -1791,9 +1791,9 @@ def npm_repositories(): npm_import( name = "npm__minimatch__3.1.2", integrity = "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "minimatch", version = "3.1.2", deps = { @@ -1810,9 +1810,9 @@ def npm_repositories(): npm_import( name = "npm__minimatch__5.0.1", integrity = "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "minimatch", version = "5.0.1", deps = { @@ -1828,9 +1828,9 @@ def npm_repositories(): npm_import( name = "npm__minimist__1.2.6", integrity = "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "minimist", version = "1.2.6", transitive_closure = { @@ -1841,9 +1841,9 @@ def npm_repositories(): npm_import( name = "npm__mkdirp__0.5.6", integrity = "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "mkdirp", version = "0.5.6", deps = { @@ -1858,9 +1858,9 @@ def npm_repositories(): npm_import( name = "npm__mobx-react-lite__3.4.0__mobx_6.3.0_react_17.0.2", integrity = "sha512-bRuZp3C0itgLKHu/VNxi66DN/XVkQG7xtoBVWxpvC5FhAqbOCP21+nPhULjnzEqd7xBMybp6KwytdUpZKEgpIQ==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "mobx-react-lite", version = "3.4.0_mobx@6.3.0+react@17.0.2", deps = { @@ -1880,9 +1880,9 @@ def npm_repositories(): npm_import( name = "npm__mobx-react__7.3.0__mobx_6.3.0_react_17.0.2", integrity = "sha512-RGEcwZokopqyJE5JPwXKB9FWMSqFM9NJVO2QPI+z6laJTJeBHqvPicjnKgY5mvihxTeXB1+72TnooqUePeGV1g==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = ["examples/npm_deps"], + link_packages = ["examples/npm_deps"], package = "mobx-react", version = "7.3.0_mobx@6.3.0+react@17.0.2", deps = { @@ -1904,9 +1904,9 @@ def npm_repositories(): npm_import( name = "npm__mobx__6.3.0", integrity = "sha512-Aa1+VXsg4WxqJMTQfWoYuJi5UD10VZhiobSmcs5kcmI3BIT0aVtn7DysvCeDADCzl7dnbX+0BTHUj/v7gLlZpQ==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = ["examples/npm_deps"], + link_packages = ["examples/npm_deps"], package = "mobx", version = "6.3.0", transitive_closure = { @@ -1917,9 +1917,9 @@ def npm_repositories(): npm_import( name = "npm__mocha-junit-reporter__2.0.2__mocha_10.0.0", integrity = "sha512-vYwWq5hh3v1lG0gdQCBxwNipBfvDiAM1PHroQRNp96+2l72e9wEUTw+mzoK+O0SudgfQ7WvTQZ9Nh3qkAYAjfg==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = ["examples/macro"], + link_packages = ["examples/macro"], package = "mocha-junit-reporter", version = "2.0.2_mocha@10.0.0", deps = { @@ -2022,9 +2022,9 @@ def npm_repositories(): npm_import( name = "npm__mocha-multi-reporters__1.5.1__mocha_10.0.0", integrity = "sha512-Yb4QJOaGLIcmB0VY7Wif5AjvLMUFAdV57D2TWEva1Y0kU/3LjKpeRVmlMIfuO1SVbauve459kgtIizADqxMWPg==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = ["examples/macro"], + link_packages = ["examples/macro"], package = "mocha-multi-reporters", version = "1.5.1_mocha@10.0.0", deps = { @@ -2116,9 +2116,9 @@ def npm_repositories(): npm_import( name = "npm__mocha__10.0.0__mocha-multi-reporters_1.5.1", integrity = "sha512-0Wl+elVUD43Y0BqPZBzZt8Tnkw9CMUdNYnUsTfOM1vuhJVZL+kiesFYsqwBkEEuEixaiPe5ZQdqDgX2jddhmoA==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = ["examples/macro"], + link_packages = ["examples/macro"], package = "mocha", version = "10.0.0_mocha-multi-reporters@1.5.1", deps = { @@ -2230,9 +2230,9 @@ def npm_repositories(): npm_import( name = "npm__mri__1.2.0", integrity = "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "mri", version = "1.2.0", transitive_closure = { @@ -2243,9 +2243,9 @@ def npm_repositories(): npm_import( name = "npm__mrmime__1.0.0", integrity = "sha512-a70zx7zFfVO7XpnQ2IX1Myh9yY4UYvfld/dikWRnsXxbyvMcfz+u6UfgNAtH+k2QqtJuzVpv6eLTx1G2+WKZbQ==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "mrmime", version = "1.0.0", transitive_closure = { @@ -2256,9 +2256,9 @@ def npm_repositories(): npm_import( name = "npm__ms__2.0.0", integrity = "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "ms", version = "2.0.0", transitive_closure = { @@ -2269,9 +2269,9 @@ def npm_repositories(): npm_import( name = "npm__ms__2.1.2", integrity = "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "ms", version = "2.1.2", transitive_closure = { @@ -2282,9 +2282,9 @@ def npm_repositories(): npm_import( name = "npm__ms__2.1.3", integrity = "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "ms", version = "2.1.3", transitive_closure = { @@ -2295,9 +2295,9 @@ def npm_repositories(): npm_import( name = "npm__nanoid__3.3.3", integrity = "sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "nanoid", version = "3.3.3", transitive_closure = { @@ -2308,9 +2308,9 @@ def npm_repositories(): npm_import( name = "npm__node-gyp-build__3.7.0", integrity = "sha512-L/Eg02Epx6Si2NXmedx+Okg+4UHqmaf3TNcxd50SF9NQGcJaON3AtU++kax69XV7YWz4tUspqZSAsVofhFKG2w==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "node-gyp-build", version = "3.7.0", transitive_closure = { @@ -2321,9 +2321,9 @@ def npm_repositories(): npm_import( name = "npm__normalize-path__3.0.0", integrity = "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "normalize-path", version = "3.0.0", transitive_closure = { @@ -2334,9 +2334,9 @@ def npm_repositories(): npm_import( name = "npm__object-assign__4.1.1", integrity = "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "object-assign", version = "4.1.1", transitive_closure = { @@ -2347,9 +2347,9 @@ def npm_repositories(): npm_import( name = "npm__once__1.4.0", integrity = "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "once", version = "1.4.0", deps = { @@ -2364,9 +2364,9 @@ def npm_repositories(): npm_import( name = "npm__opener__1.5.2", integrity = "sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "opener", version = "1.5.2", transitive_closure = { @@ -2377,9 +2377,9 @@ def npm_repositories(): npm_import( name = "npm__p-limit__3.1.0", integrity = "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "p-limit", version = "3.1.0", deps = { @@ -2394,9 +2394,9 @@ def npm_repositories(): npm_import( name = "npm__p-locate__5.0.0", integrity = "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "p-locate", version = "5.0.0", deps = { @@ -2412,9 +2412,9 @@ def npm_repositories(): npm_import( name = "npm__path-exists__4.0.0", integrity = "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "path-exists", version = "4.0.0", transitive_closure = { @@ -2425,9 +2425,9 @@ def npm_repositories(): npm_import( name = "npm__path-is-absolute__1.0.1", integrity = "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "path-is-absolute", version = "1.0.1", transitive_closure = { @@ -2438,9 +2438,9 @@ def npm_repositories(): npm_import( name = "npm__path-parse__1.0.7", integrity = "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "path-parse", version = "1.0.7", transitive_closure = { @@ -2451,9 +2451,9 @@ def npm_repositories(): npm_import( name = "npm__picomatch__2.3.1", integrity = "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "picomatch", version = "2.3.1", transitive_closure = { @@ -2464,9 +2464,9 @@ def npm_repositories(): npm_import( name = "npm__randombytes__2.1.0", integrity = "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "randombytes", version = "2.1.0", deps = { @@ -2481,9 +2481,9 @@ def npm_repositories(): npm_import( name = "npm__react__17.0.2", integrity = "sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = ["examples/npm_deps"], + link_packages = ["examples/npm_deps"], package = "react", version = "17.0.2", deps = { @@ -2501,9 +2501,9 @@ def npm_repositories(): npm_import( name = "npm__readdirp__3.6.0", integrity = "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "readdirp", version = "3.6.0", deps = { @@ -2518,9 +2518,9 @@ def npm_repositories(): npm_import( name = "npm__require-directory__2.1.1", integrity = "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "require-directory", version = "2.1.1", transitive_closure = { @@ -2531,9 +2531,9 @@ def npm_repositories(): npm_import( name = "npm__resolve__1.22.0", integrity = "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "resolve", version = "1.22.0", deps = { @@ -2554,9 +2554,9 @@ def npm_repositories(): npm_import( name = "npm__rollup__2.70.2", integrity = "sha512-EitogNZnfku65I1DD5Mxe8JYRUCy0hkK5X84IlDtUs+O6JRMpRciXTzyCUuX11b5L5pvjH+OmFXiQ3XjabcXgg==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = ["examples/npm_deps"], + link_packages = ["examples/npm_deps"], package = "rollup", version = "2.70.2", deps = { @@ -2571,9 +2571,9 @@ def npm_repositories(): npm_import( name = "npm__sade__1.8.1", integrity = "sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "sade", version = "1.8.1", deps = { @@ -2588,9 +2588,9 @@ def npm_repositories(): npm_import( name = "npm__safe-buffer__5.2.1", integrity = "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "safe-buffer", version = "5.2.1", transitive_closure = { @@ -2601,9 +2601,9 @@ def npm_repositories(): npm_import( name = "npm__serialize-javascript__6.0.0", integrity = "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "serialize-javascript", version = "6.0.0", deps = { @@ -2619,9 +2619,9 @@ def npm_repositories(): npm_import( name = "npm__sirv__1.0.19", integrity = "sha512-JuLThK3TnZG1TAKDwNIqNq6QA2afLOCcm+iE8D1Kj3GA40pSPsxQjjJl0J8X3tsR7T+CP1GavpzLwYkgVLWrZQ==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "sirv", version = "1.0.19", deps = { @@ -2640,9 +2640,9 @@ def npm_repositories(): npm_import( name = "npm__sourcemap-codec__1.4.8", integrity = "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "sourcemap-codec", version = "1.4.8", transitive_closure = { @@ -2653,9 +2653,9 @@ def npm_repositories(): npm_import( name = "npm__string-width__4.2.3", integrity = "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "string-width", version = "4.2.3", deps = { @@ -2675,9 +2675,9 @@ def npm_repositories(): npm_import( name = "npm__strip-ansi__6.0.1", integrity = "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "strip-ansi", version = "6.0.1", deps = { @@ -2692,9 +2692,9 @@ def npm_repositories(): npm_import( name = "npm__strip-json-comments__3.1.1", integrity = "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "strip-json-comments", version = "3.1.1", transitive_closure = { @@ -2705,9 +2705,9 @@ def npm_repositories(): npm_import( name = "npm__supports-color__7.2.0", integrity = "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "supports-color", version = "7.2.0", deps = { @@ -2722,9 +2722,9 @@ def npm_repositories(): npm_import( name = "npm__supports-color__8.1.1", integrity = "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "supports-color", version = "8.1.1", deps = { @@ -2739,9 +2739,9 @@ def npm_repositories(): npm_import( name = "npm__supports-preserve-symlinks-flag__1.0.0", integrity = "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "supports-preserve-symlinks-flag", version = "1.0.0", transitive_closure = { @@ -2752,9 +2752,9 @@ def npm_repositories(): npm_import( name = "npm__to-regex-range__5.0.1", integrity = "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "to-regex-range", version = "5.0.1", deps = { @@ -2769,9 +2769,9 @@ def npm_repositories(): npm_import( name = "npm__totalist__1.1.0", integrity = "sha512-gduQwd1rOdDMGxFG1gEvhV88Oirdo2p+KjoYFU7k2g+i7n6AFFbDQ5kMPUsW0pNbfQsB/cwXvT1i4Bue0s9g5g==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "totalist", version = "1.1.0", transitive_closure = { @@ -2782,9 +2782,9 @@ def npm_repositories(): npm_import( name = "npm__typescript__4.7.2", integrity = "sha512-Mamb1iX2FDUpcTRzltPxgWMKy3fhg0TN378ylbktPGPK/99KbDtMQ4W1hwgsbPAsG3a0xKa1vmw4VKZQbkvz5A==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = ["."], + link_packages = [""], package = "typescript", version = "4.7.2", transitive_closure = { @@ -2795,9 +2795,9 @@ def npm_repositories(): npm_import( name = "npm__uvu__0.5.3", integrity = "sha512-brFwqA3FXzilmtnIyJ+CxdkInkY/i4ErvP7uV0DnUVxQcQ55reuHphorpF+tZoVHK2MniZ/VJzI7zJQoc9T9Yw==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = ["examples/npm_deps"], + link_packages = ["examples/npm_deps"], package = "uvu", version = "0.5.3", deps = { @@ -2819,9 +2819,9 @@ def npm_repositories(): npm_import( name = "npm__webpack-bundle-analyzer__4.5.0__bufferutil_4.0.1", integrity = "sha512-GUMZlM3SKwS8Z+CKeIFx7CVoHn3dXFcUAjT/dcZQQmfSZGvitPfMob2ipjai7ovFFqPvTqkEZ/leL4O0YOdAYQ==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = ["examples"], + link_packages = ["js/private/test"], package = "webpack-bundle-analyzer", version = "4.5.0_bufferutil@4.0.1", deps = { @@ -2863,9 +2863,9 @@ def npm_repositories(): npm_import( name = "npm__workerpool__6.2.1", integrity = "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "workerpool", version = "6.2.1", transitive_closure = { @@ -2876,9 +2876,9 @@ def npm_repositories(): npm_import( name = "npm__wrap-ansi__7.0.0", integrity = "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "wrap-ansi", version = "7.0.0", deps = { @@ -2902,9 +2902,9 @@ def npm_repositories(): npm_import( name = "npm__wrappy__1.0.2", integrity = "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "wrappy", version = "1.0.2", transitive_closure = { @@ -2915,9 +2915,9 @@ def npm_repositories(): npm_import( name = "npm__ws__7.5.8__bufferutil_4.0.1", integrity = "sha512-ri1Id1WinAX5Jqn9HejiGb8crfRio0Qgu8+MtL36rlTA6RLsMdWt1Az/19A2Qij6uSHUMphEFaTKa4WG+UNHNw==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "ws", version = "7.5.8_bufferutil@4.0.1", deps = { @@ -2933,9 +2933,9 @@ def npm_repositories(): npm_import( name = "npm__xml__1.0.1", integrity = "sha1-eLpyAgApxbyHuKgaPPzXS0ovweU=", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "xml", version = "1.0.1", transitive_closure = { @@ -2946,9 +2946,9 @@ def npm_repositories(): npm_import( name = "npm__y18n__5.0.8", integrity = "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "y18n", version = "5.0.8", transitive_closure = { @@ -2959,9 +2959,9 @@ def npm_repositories(): npm_import( name = "npm__yargs-parser__20.2.4", integrity = "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "yargs-parser", version = "20.2.4", transitive_closure = { @@ -2972,9 +2972,9 @@ def npm_repositories(): npm_import( name = "npm__yargs-unparser__2.0.0", integrity = "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "yargs-unparser", version = "2.0.0", deps = { @@ -2995,9 +2995,9 @@ def npm_repositories(): npm_import( name = "npm__yargs__16.2.0", integrity = "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "yargs", version = "16.2.0", deps = { @@ -3032,9 +3032,9 @@ def npm_repositories(): npm_import( name = "npm__yocto-queue__0.1.0", integrity = "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - root_path = "", + root_package = "", link_workspace = "", - link_paths = [], + link_packages = [], package = "yocto-queue", version = "0.1.0", transitive_closure = { diff --git a/js/private/translate_pnpm_lock.bzl b/js/private/translate_pnpm_lock.bzl index 4ea20e9e1..a9d76e501 100644 --- a/js/private/translate_pnpm_lock.bzl +++ b/js/private/translate_pnpm_lock.bzl @@ -148,32 +148,29 @@ _NPM_IMPORT_TMPL = \ """ npm_import( name = "{name}", integrity = "{integrity}", - root_path = "{root_path}", + root_package = "{root_package}", link_workspace = "{link_workspace}", - link_paths = {link_paths}, + link_packages = {link_packages}, package = "{package}", version = "{pnpm_version}",{maybe_deps}{maybe_transitive_closure}{maybe_patches}{maybe_patch_args}{maybe_run_lifecycle_hooks}{maybe_custom_postinstall} ) """ _ALIAS_TMPL = \ - """load("//:defs.bzl", _package = "package", _package_dir = "package_dir") - -alias( + """alias( name = "{basename}", - actual = _package("{name}", "{import_path}"), + actual = "@{link_workspace}//{link_package}:{direct_namespace}{bazel_name}", visibility = ["//visibility:public"], ) alias( name = "dir", - actual = _package_dir("{name}", "{import_path}"), + actual = "@{link_workspace}//{link_package}:{direct_namespace}{bazel_name}{dir_postfix}", visibility = ["//visibility:public"], )""" _SCOPE_TMPL = \ - """load("//:defs.bzl", _package = "package") -load("@aspect_rules_js//js/private:linked_js_packages.bzl", "linked_js_packages") + """load("@aspect_rules_js//js/private:linked_js_packages.bzl", "linked_js_packages") linked_js_packages( name = "{scope}", @@ -181,27 +178,6 @@ linked_js_packages( visibility = ["//visibility:public"], )""" -_PACKAGE_TMPL = \ - """ -def package(name, import_path = "."): - package_path = _paths.normalize(_paths.join("{root_path}", import_path)) - if package_path == ".": - package_path = "" - return Label("@{workspace}//{{package_path}}:{namespace}{{bazel_name}}".format( - package_path = package_path, - bazel_name = _pnpm_utils.bazel_name(name), - )) - -def package_dir(name, import_path = "."): - package_path = _paths.normalize(_paths.join("{root_path}", import_path)) - if package_path == ".": - package_path = "" - return Label("@{workspace}//{{package_path}}:{namespace}{{bazel_name}}{dir_postfix}".format( - package_path = package_path, - bazel_name = _pnpm_utils.bazel_name(name), - )) -""" - _BIN_TMPL = \ """load("@{repo_name}//{repo_package_json_bzl}", _bin = "bin") bin = _bin @@ -211,7 +187,7 @@ _FP_STORE_TMPL = \ """ if is_root: _link_js_package_store( - name = "{namespace}{bazel_name}{store_postfix}", + name = "{store_namespace}{bazel_name}", src = "{js_package_target}", package = "{package}", version = "0.0.0", @@ -221,36 +197,33 @@ _FP_STORE_TMPL = \ _FP_DIRECT_TMPL = \ """ - for link_path in {link_paths}: - link_package_path = _paths.normalize(_paths.join("{root_path}", link_path)) - if link_package_path == ".": - link_package_path = "" - if link_package_path == native.package_name(): + for link_package in {link_packages}: + if link_package == native.package_name(): # terminal target for direct dependencies _link_js_package_direct( - name = "{namespace}{bazel_name}", - src = "//{root_path}:{namespace}{bazel_name}{store_postfix}", + name = "{direct_namespace}{bazel_name}", + src = "//{root_package}:{store_namespace}{bazel_name}", visibility = ["//visibility:public"], ) # filegroup target that provides a single file which is # package directory for use in $(execpath) and $(rootpath) native.filegroup( - name = "{namespace}{bazel_name}{dir_postfix}", - srcs = [":{namespace}{bazel_name}"], + name = "{direct_namespace}{bazel_name}{dir_postfix}", + srcs = [":{direct_namespace}{bazel_name}"], output_group = "{package_directory_output_group}", visibility = ["//visibility:public"], ) native.alias( - name = "{namespace}{alias}", - actual = ":{namespace}{bazel_name}", + name = "{direct_namespace}{alias}", + actual = ":{direct_namespace}{bazel_name}", visibility = ["//visibility:public"], ) native.alias( - name = "{namespace}{alias}{dir_postfix}", - actual = ":{namespace}{bazel_name}{dir_postfix}", + name = "{direct_namespace}{alias}{dir_postfix}", + actual = ":{direct_namespace}{bazel_name}{dir_postfix}", visibility = ["//visibility:public"], )""" @@ -263,11 +236,13 @@ def _generated_by_lines(pnpm_lock_wksp, pnpm_lock): "", # empty line after bzl docstring since buildifier expects this if this file is vendored in ] -def _fp_link_path(root_path, import_path, rel_path): - fp_link_path = paths.normalize(paths.join(root_path, import_path, rel_path)) - if fp_link_path == ".": - fail("root bazel package first party dep not supported") - return fp_link_path +def _link_package(root_package, import_path, rel_path = "."): + link_package = paths.normalize(paths.join(root_package, import_path, rel_path)) + if link_package.startswith("../"): + fail("Invalid link_package outside of the WORKSPACE: {}".format(link_package)) + if link_package == ".": + link_package = "" + return link_package def _impl(rctx): if rctx.attr.prod and rctx.attr.dev: @@ -276,7 +251,7 @@ def _impl(rctx): lockfile = _process_lockfile(rctx) # root path is the directory of the pnpm_lock file - root_path = rctx.attr.pnpm_lock.package + root_package = rctx.attr.pnpm_lock.package # don't allow a pnpm lock file that isn't in the root directory of a bazel package if paths.dirname(rctx.attr.pnpm_lock.name): @@ -306,30 +281,29 @@ def _impl(rctx): defs_bzl_file = "defs.bzl" defs_bzl_header = generated_by_lines + [ - """load("@aspect_rules_js//js/private:pnpm_utils.bzl", _pnpm_utils = "pnpm_utils")""", """load("@bazel_skylib//lib:paths.bzl", _paths = "paths")""", ] defs_bzl_body = [ """# buildifier: disable=unnamed-macro def link_js_packages(): - "Generated list of link_js_package() target generators and first party linked packages corresponding to the packages in @{pnpm_lock_wksp}{pnpm_lock}" - root_path = "{root_path}" + "Generated list of link_js_package() target generators and first-party linked packages corresponding to the packages in @{pnpm_lock_wksp}{pnpm_lock}" + root_package = "{root_package}" importer_paths = {importer_paths} - is_root = native.package_name() == root_path + is_root = native.package_name() == root_package is_direct = False for import_path in importer_paths: - importer_package_path = _paths.normalize(_paths.join(root_path, import_path)) + importer_package_path = _paths.normalize(_paths.join(root_package, import_path)) if importer_package_path == ".": importer_package_path = "" if importer_package_path == native.package_name(): is_direct = True if not is_root and not is_direct: - msg = "The link_js_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_path}' and packages corresponding to importer paths [{importer_paths_comma_separated}]" % native.package_name() + msg = "The link_js_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 corresponding to importer paths [{importer_paths_comma_separated}]" % native.package_name() fail(msg) """.format( pnpm_lock_wksp = str(rctx.attr.pnpm_lock.workspace_name), pnpm_lock = str(rctx.attr.pnpm_lock), - root_path = root_path, + root_package = root_package, importer_paths = str(importer_paths), importer_paths_comma_separated = "'" + "', '".join(importer_paths) + "'" if len(importer_paths) else "", defs_bzl_file = "@{}//:{}".format(rctx.name, defs_bzl_file), @@ -381,16 +355,17 @@ def link_js_packages(): repo_name = "%s__%s" % (rctx.name, pnpm_utils.bazel_name(name, pnpm_version)) - link_paths = [] + link_packages = [] for import_path, importer in importers.items(): dependencies = importer.get("dependencies") if type(dependencies) != "dict": 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 == pnpm_utils.pnpm_name(dep_package, dep_version): # this package is a direct dependency at this import path - link_paths.append(import_path) + link_packages.append(link_package) run_lifecycle_hooks = requires_build and rctx.attr.run_lifecycle_hooks and name not in rctx.attr.lifecycle_hooks_exclude and friendly_name not in rctx.attr.lifecycle_hooks_exclude @@ -409,7 +384,7 @@ def link_js_packages(): repositories_bzl.append(_NPM_IMPORT_TMPL.format( integrity = integrity, - link_paths = link_paths, + link_packages = link_packages, link_workspace = rctx.attr.pnpm_lock.workspace_name, maybe_custom_postinstall = maybe_custom_postinstall, maybe_deps = maybe_deps, @@ -420,7 +395,7 @@ def link_js_packages(): name = repo_name, package = name, pnpm_version = pnpm_version, - root_path = root_path, + root_package = root_package, )) defs_bzl_header.append( @@ -430,25 +405,31 @@ def link_js_packages(): links_postfix = pnpm_utils.links_postfix, ), ) - defs_bzl_body.append(" link_{i}(False)".format(i = i)) + defs_bzl_body.append(""" link_{i}(name = "{direct_namespace}{bazel_name}", direct = None, fail_if_no_link = False)""".format( + i = i, + direct_namespace = pnpm_utils.direct_link_target_namespace, + bazel_name = pnpm_utils.bazel_name(name), + )) # For direct dependencies create alias targets @repo_name//name, @repo_name//@scope/name, # @repo_name//name:dir and @repo_name//@scope/name:dir - for link_path in link_paths: - escaped_link_path = link_path.replace("../", "dot_dot/") - build_file_path = paths.normalize(paths.join(escaped_link_path, name, "BUILD.bazel")) + for link_package in link_packages: + build_file_path = paths.normalize(paths.join(link_package, name, "BUILD.bazel")) rctx.file(build_file_path, "\n".join(generated_by_lines + [ _ALIAS_TMPL.format( basename = paths.basename(name), - import_path = link_path, - name = name, + bazel_name = pnpm_utils.bazel_name(name), + dir_postfix = pnpm_utils.dir_postfix, + direct_namespace = pnpm_utils.direct_link_target_namespace, + link_package = link_package, + link_workspace = rctx.attr.pnpm_lock.workspace_name, ), ])) # Generate a package_json.bzl file if there are bin entries if has_bin: - package_json_bzl_file_path = paths.normalize(paths.join(escaped_link_path, name, "package_json.bzl")) - repo_package_json_bzl = paths.normalize(paths.join(escaped_link_path, "package_json.bzl")).rsplit("/", 1) + package_json_bzl_file_path = paths.normalize(paths.join(link_package, name, "package_json.bzl")) + repo_package_json_bzl = paths.normalize(paths.join(link_package, "package_json.bzl")).rsplit("/", 1) if len(repo_package_json_bzl) == 1: repo_package_json_bzl = [""] + repo_package_json_bzl repo_package_json_bzl = ":".join(repo_package_json_bzl) @@ -463,25 +444,33 @@ def link_js_packages(): # Gather scoped packages if len(name.split("/", 1)) > 1: package_scope = name.split("/", 1)[0] - build_file_package = paths.normalize(paths.join(escaped_link_path, package_scope)) + build_file_package = paths.normalize(paths.join(link_package, package_scope)) if build_file_package not in scoped_packages: scoped_packages[build_file_package] = [] - scoped_packages[build_file_package].append("""_package("{}", "{}")""".format(name, link_path)) + scoped_packages[build_file_package].append( + "@{link_workspace}//{link_package}:{direct_namespace}{bazel_name}".format( + bazel_name = pnpm_utils.bazel_name(name), + direct_namespace = pnpm_utils.direct_link_target_namespace, + link_package = link_package, + link_workspace = rctx.attr.pnpm_lock.workspace_name, + ), + ) fp_links = {} - # Look for first party links + # Look for first-party links for import_path, importer in importers.items(): dependencies = importer.get("dependencies") if type(dependencies) != "dict": 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 dep_version.startswith("link:"): - dep_importer = _fp_link_path(".", import_path, dep_version[len("link:"):]) - dep_path = _fp_link_path(root_path, import_path, dep_version[len("link:"):]) + dep_importer = paths.normalize(paths.join(import_path, dep_version[len("link:"):])) + 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_paths"].append(import_path) + fp_links[dep_key]["link_packages"].append(link_package) else: transitive_deps = [] raw_deps = {} @@ -489,20 +478,19 @@ def link_js_packages(): raw_deps = importers.get(dep_importer).get("dependencies") for raw_package, raw_version in raw_deps.items(): if raw_version.startswith("link:"): - raw_path = _fp_link_path(root_path, dep_importer, raw_version[len("link:"):]) + raw_path = _link_package(root_package, dep_importer, raw_version[len("link:"):]) raw_bazel_name = pnpm_utils.bazel_name(raw_package, raw_path) else: raw_bazel_name = pnpm_utils.bazel_name(raw_package, raw_version) - transitive_deps.append("//{root_path}:{namespace}{bazel_name}{store_postfix}".format( - root_path = root_path, - namespace = pnpm_utils.js_package_target_namespace, + transitive_deps.append("//{root_package}:{store_namespace}{bazel_name}".format( bazel_name = raw_bazel_name, - store_postfix = pnpm_utils.store_postfix, + root_package = root_package, + store_namespace = pnpm_utils.store_link_target_namespace, )) fp_links[dep_key] = { "package": dep_package, "path": dep_path, - "link_paths": [import_path], + "link_packages": [link_package], "deps": transitive_deps, } @@ -514,7 +502,7 @@ def link_js_packages(): for fp_link in fp_links.values(): fp_package = fp_link.get("package") fp_path = fp_link.get("path") - fp_link_paths = fp_link.get("link_paths") + fp_link_packages = fp_link.get("link_packages") fp_deps = fp_link.get("deps") fp_bazel_name = pnpm_utils.bazel_name(fp_package, fp_path) fp_target = "//{}:{}".format(fp_path, paths.basename(fp_path)) @@ -522,62 +510,65 @@ def link_js_packages(): defs_bzl_body.append(_FP_STORE_TMPL.format( bazel_name = fp_bazel_name, deps = starlark_codegen_utils.to_list_attr(fp_deps, 3), + direct_namespace = pnpm_utils.direct_link_target_namespace, js_package_target = fp_target, - namespace = pnpm_utils.js_package_target_namespace, package = fp_package, - store_postfix = pnpm_utils.store_postfix, + store_namespace = pnpm_utils.store_link_target_namespace, )) defs_bzl_body.append(_FP_DIRECT_TMPL.format( alias = pnpm_utils.bazel_name(fp_package), bazel_name = fp_bazel_name, dir_postfix = pnpm_utils.dir_postfix, - link_paths = fp_link_paths, - namespace = pnpm_utils.js_package_target_namespace, + direct_namespace = pnpm_utils.direct_link_target_namespace, + link_packages = fp_link_packages, package = fp_package, package_directory_output_group = pnpm_utils.package_directory_output_group, - root_path = root_path, - store_postfix = pnpm_utils.store_postfix, + root_package = root_package, + store_namespace = pnpm_utils.store_link_target_namespace, )) # Create alias targets @repo_name//name, @repo_name//@scope/name, # @repo_name//name:dir and @repo_name//@scope/name:dir - for link_path in fp_link_paths: - escaped_link_path = link_path.replace("../", "dot_dot/") - build_file_path = paths.normalize(paths.join(escaped_link_path, fp_package, "BUILD.bazel")) + for link_package in fp_link_packages: + build_file_path = paths.normalize(paths.join(link_package, fp_package, "BUILD.bazel")) rctx.file(build_file_path, "\n".join(generated_by_lines + [ _ALIAS_TMPL.format( basename = paths.basename(fp_package), - import_path = link_path, - name = fp_package, + bazel_name = pnpm_utils.bazel_name(fp_package), + dir_postfix = pnpm_utils.dir_postfix, + direct_namespace = pnpm_utils.direct_link_target_namespace, + link_package = link_package, + link_workspace = rctx.attr.pnpm_lock.workspace_name, ), ])) # Gather scoped packages if len(fp_package.split("/", 1)) > 1: package_scope = fp_package.split("/", 1)[0] - build_file_package = paths.normalize(paths.join(escaped_link_path, package_scope)) + build_file_package = paths.normalize(paths.join(link_package, package_scope)) if build_file_package not in scoped_packages: scoped_packages[build_file_package] = [] - scoped_packages[build_file_package].append("""_package("{}", "{}")""".format(fp_package, link_path)) + scoped_packages[build_file_package].append( + "@{link_workspace}//{link_package}:{direct_namespace}{bazel_name}".format( + bazel_name = pnpm_utils.bazel_name(fp_package), + direct_namespace = pnpm_utils.direct_link_target_namespace, + link_package = link_package, + link_workspace = rctx.attr.pnpm_lock.workspace_name, + ), + ) # Generate scoped @npm//@scope targets for build_file_package, scope_packages in scoped_packages.items(): rctx.file(paths.join(build_file_package, "BUILD.bazel"), "\n".join(generated_by_lines + [ _SCOPE_TMPL.format( scope = paths.basename(build_file_package), - srcs = starlark_codegen_utils.to_list_attr(scope_packages, 1, quote_value = False), + srcs = starlark_codegen_utils.to_list_attr(scope_packages, 1), + package_path = build_file_package, ), ])) - defs_bzl_body.append(_PACKAGE_TMPL.format( - dir_postfix = pnpm_utils.dir_postfix, - namespace = pnpm_utils.js_package_target_namespace, - root_path = root_path, - workspace = rctx.attr.pnpm_lock.workspace_name, - )) - - rctx.file(defs_bzl_file, "\n".join(defs_bzl_header + [""] + defs_bzl_body)) + rctx.file(defs_bzl_file, "\n".join(defs_bzl_header + [""] + defs_bzl_body + [""])) rctx.file("repositories.bzl", "\n".join(repositories_bzl)) rctx.file("BUILD.bazel", """exports_files(["defs.bzl", "repositories.bzl"])""") diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 28b8ef197..a64a5ab8d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,4 +1,4 @@ -lockfileVersion: 5.3 +lockfileVersion: 5.4 importers: @@ -10,21 +10,21 @@ importers: '@types/node': 16.11.36 typescript: 4.7.2 - examples: + examples/lib: + specifiers: {} + + examples/lib: + specifiers: {} + + examples/macro: specifiers: - '@aspect-test/a': 5.0.0 - '@aspect-test/b': 5.0.0 - '@aspect-test/c': 2.0.0 - bufferutil: 4.0.1 - esbuild: 0.14.38 - webpack-bundle-analyzer: 4.5.0 + mocha: ^10.0.0 + mocha-junit-reporter: ^2.0.2 + mocha-multi-reporters: ^1.5.1 devDependencies: - '@aspect-test/a': 5.0.0 - '@aspect-test/b': 5.0.0 - '@aspect-test/c': 2.0.0 - bufferutil: 4.0.1 - esbuild: 0.14.38 - webpack-bundle-analyzer: 4.5.0_bufferutil@4.0.1 + mocha: 10.0.0_mocha-multi-reporters@1.5.1 + mocha-junit-reporter: 2.0.2_mocha@10.0.0 + mocha-multi-reporters: 1.5.1_mocha@10.0.0 examples/lib: specifiers: {} @@ -41,6 +41,8 @@ importers: examples/npm_deps: specifiers: + '@aspect-test/a': 5.0.0 + '@aspect-test/c': 2.0.0 '@gregmagolan/test-b': 0.0.2 '@rollup/plugin-commonjs': 21.1.0 mobx: 6.3.0 @@ -49,6 +51,8 @@ importers: rollup: 2.70.2 uvu: 0.5.3 devDependencies: + '@aspect-test/a': 5.0.0 + '@aspect-test/c': 2.0.0 '@gregmagolan/test-b': 0.0.2 '@rollup/plugin-commonjs': 21.1.0_rollup@2.70.2 mobx: 6.3.0 @@ -57,6 +61,16 @@ importers: rollup: 2.70.2 uvu: 0.5.3 + js/private/test: + specifiers: + bufferutil: 4.0.1 + esbuild: 0.14.38 + webpack-bundle-analyzer: 4.5.0 + devDependencies: + bufferutil: 4.0.1 + esbuild: 0.14.38 + webpack-bundle-analyzer: 4.5.0_bufferutil@4.0.1 + packages: /@aspect-test/a/5.0.0: diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 05486c067..96645c3d3 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,3 +1,3 @@ packages: - - 'examples' - 'examples/*' + - 'js/private/test'