blob: 41473fc8e748e4961f2ec01ab6b196eb43ccc90c [file]
bazel_dep(name = "aspect_rules_js", version = "0.0.0", dev_dependency = True)
local_path_override(
module_name = "aspect_rules_js",
path = "../..",
)
# The same primary lockfile across all versions
PNPM_LOCK_VERSIONS = [
"v54",
"v60",
"v61",
"v90",
]
# Lockfiles with unique test cases
PNPM_LOCK_TEST_CASES = [
"tarball-no-url-v54.yaml",
"override-with-alias-url-v9.yaml",
"isaacs-cliui-v90.yaml",
"docusaurus-direct-peer-v6.yaml",
"docusaurus-direct-peer-v9.yaml",
]
bazel_dep(name = "aspect_bazel_lib", version = "2.7.7")
bazel_dep(name = "bazel_skylib", version = "1.5.0", dev_dependency = True)
bazel_dep(name = "rules_nodejs", version = "6.2.0", dev_dependency = True)
bazel_dep(name = "platforms", version = "0.0.5")
node = use_extension(
"@rules_nodejs//nodejs:extensions.bzl",
"node",
dev_dependency = True,
)
use_repo(node, "nodejs_toolchains")
use_repo(node, "nodejs_darwin_amd64")
use_repo(node, "nodejs_darwin_arm64")
use_repo(node, "nodejs_linux_amd64")
use_repo(node, "nodejs_linux_arm64")
npm = use_extension(
"@aspect_rules_js//npm:extensions.bzl",
"npm",
dev_dependency = True,
)
[
npm.npm_translate_lock(
name = "lock-%s" % version,
data = [
"//%s:package.json" % version,
"//%s:patches/meaning-of-life@1.0.0-pnpm.patch" % version,
],
pnpm_lock = "//%s:pnpm-lock.yaml" % version,
verify_node_modules_ignored = "//:.bazelignore",
)
for version in PNPM_LOCK_VERSIONS
]
# repos used by the lockfile tests
[
use_repo(
npm,
"lock-%s" % version,
# Dep with bin entries etc
"lock-%s__rollup__2.14.0" % version,
"lock-%s__rollup__2.14.0__links" % version,
"lock-%s__rollup__3.29.4" % version,
"lock-%s__rollup__3.29.4__links" % version,
# Dep only referenced via npm: should have the real package name in the repo name
"lock-%s__at_types_sizzle__2.3.8" % version,
"lock-%s__at_types_sizzle__2.3.8__links" % version,
# Dep with peers
"lock-%s__at_aspect-test_d__2.0.0_at_aspect-test_c_2.0.2" % version,
"lock-%s__at_aspect-test_d__2.0.0_at_aspect-test_c_2.0.2__links" % version,
# Deep with many peers
"lock-%s__at_rollup_plugin-typescript__8.2.1_%s" % (
version,
"ommloj5qql5ba6x5wuiluawhoi" if version == "v54" else "1662662592" if version == "v90" else "1813138439",
),
# Dep with patch
"lock-%s__meaning-of-life__1.0.0_o3deharooos255qt5xdujc3cuq" % version,
)
for version in PNPM_LOCK_VERSIONS
]
[
npm.npm_translate_lock(
name = lockfile.replace(".yaml", ""),
pnpm_lock = "//cases:%s" % lockfile,
verify_node_modules_ignored = "//:.bazelignore",
)
for lockfile in PNPM_LOCK_TEST_CASES
]
[
use_repo(
npm,
lockfile.replace(".yaml", ""),
)
for lockfile in PNPM_LOCK_TEST_CASES
]