blob: 226fc8b88c911da6014d3a14907de93a84b6ee7c [file]
bazel_dep(name = "aspect_rules_js", version = "0.0.0", dev_dependency = True)
local_path_override(
module_name = "aspect_rules_js",
path = "../..",
)
bazel_dep(name = "other_module")
local_path_override(
module_name = "other_module",
path = "other_module",
)
bazel_dep(name = "bazel_lib", version = "3.0.0", dev_dependency = True)
bazel_dep(name = "bazel_skylib", version = "1.5.0", dev_dependency = True)
bazel_dep(name = "platforms", version = "1.0.0", dev_dependency = True)
npm = use_extension(
"@aspect_rules_js//npm:extensions.bzl",
"npm",
dev_dependency = True,
)
npm.npm_translate_lock(
name = "npm",
# Test that lifecycle hooks can resolve node, npm as well as dep bins on that PATH.
# This e2e test is run on Windows as well so this test coverage is here for now. Once
# Windows CI runs on the root MODULE, coverage can be moved there.
# See https://github.com/aspect-build/rules_js/pull/1142 for more info.
custom_postinstalls = {
"chalk": "node --version",
"jasmine": "tsc --version",
},
npmrc = "//:.npmrc",
pnpm_lock = "//:pnpm-lock.yaml",
verify_node_modules_ignored = "//:.bazelignore",
)
use_repo(npm, "npm")
# The following is just a demonstration that you can skip the npm_translate_lock feature
# and import npm packages directly, with no lock file.
# This is not typical use.
# See docs in https://registry.bazel.build/docs/aspect_rules_js#module_extension-npm_import about the difference.
npm.npm_import(
name = "npm_meaning-of-life",
package = "meaning-of-life",
version = "1.0.0",
)
use_repo(npm, "npm_meaning-of-life")
use_repo(npm, "npm_meaning-of-life__links")
pnpm = use_extension("@aspect_rules_js//npm:extensions.bzl", "pnpm")
# Choose a different version of pnpm - note that only the "root" module may do this,
# not some transitive dependency.
pnpm.pnpm(
name = "pnpm",
pnpm_version_from = "//:package.json",
)
pnpm.pnpm(
name = "other_pnpm",
pnpm_version = "9.15.9",
)
# Allows developers to run the identical version of pnpm for local workflows like
# bazel run -- @pnpm --dir $PWD install
use_repo(pnpm, "other_pnpm", "pnpm")