| 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 = [ |
| "v90", |
| "v101", |
| "v110", |
| ] |
| |
| # Lockfiles with unique test cases |
| PNPM_LOCK_TEST_CASES = [ |
| "override-with-alias-url-v9", |
| "isaacs-cliui-v90", |
| "docusaurus-direct-peer-v9", |
| "versionless-patch-v9", |
| "nested-peer-v9", |
| "rerooted-nested-projects-v10/root", |
| "workspace-peer-v9", |
| "multi-document-v11", |
| ] |
| |
| bazel_dep(name = "bazel_lib", version = "3.0.0") |
| |
| bazel_dep(name = "bazel_skylib", version = "1.5.0", dev_dependency = True) |
| bazel_dep(name = "rules_nodejs", version = "6.7.3", dev_dependency = True) |
| |
| 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.10" % version, |
| "lock-%s__at_types_sizzle__2.3.10__links" % version, |
| |
| # Deps with circles |
| "lock-%s__at_aspect-test_a__5.0.2__links" % version, |
| "lock-%s__at_aspect-test_b__5.0.2__links" % version, |
| |
| # Dep with lifecycle hooks |
| "lock-%s__at_aspect-test_c__2.0.0__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_626159424" % version, |
| |
| # Dep with patch |
| "lock-%s__meaning-of-life__1.0.0_%s" % ( |
| version, |
| "1287509853" if version == "v90" else "124257499", |
| ), |
| |
| # Vendored tarball |
| "lock-%s__lodash__file_.._vendored_lodash-4.17.21.tgz" % version, |
| "lock-%s__lodash__file_.._vendored_lodash-4.17.21.tgz__links" % version, |
| |
| # optional deps, os/cpu conditions |
| "lock-%s__esbuild__0.27.0__links" % version, |
| "lock-%s__sass-embedded__1.97.3__links" % version, |
| "lock-%s__at_vscode_vsce-sign__2.0.9__links" % version, |
| ) |
| for version in PNPM_LOCK_VERSIONS |
| ] |
| |
| [ |
| npm.npm_translate_lock( |
| name = lockfile.split("/")[0], |
| pnpm_lock = "//cases/%s:pnpm-lock.yaml" % lockfile, |
| verify_node_modules_ignored = "//:.bazelignore", |
| ) |
| for lockfile in PNPM_LOCK_TEST_CASES |
| ] |
| |
| [ |
| use_repo( |
| npm, |
| lockfile.split("/")[0], |
| ) |
| for lockfile in PNPM_LOCK_TEST_CASES |
| ] |
| |
| # @nested-peer-v9 tests |
| use_repo( |
| npm, |
| "nested-peer-v9__eslint-plugin-barrel-files__3.0.1_eslint_9.29.0_jiti_2.6.1", |
| "nested-peer-v9__eslint__9.29.0_jiti_2.6.1", |
| ) |