Skip to content

v2.9.2

Choose a tag to compare

@github-actions github-actions released this 18 Jan 06:41
· 227 commits to main since this release
74d32f8

Many companies are successfully building with rules_js.
If you're getting value from the project, please let us know!
Just comment on our Adoption Discussion.

Using Bzlmod with Bazel 6:

Add to your MODULE.bazel file:

bazel_dep(name = "aspect_rules_js", version = "2.9.2")

####### Node.js version #########
# By default you get the node version from DEFAULT_NODE_VERSION in @rules_nodejs//nodejs:repositories.bzl
# Optionally you can pin a different node version:
bazel_dep(name = "rules_nodejs", version = "6.3.0")
node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node", dev_dependency = True)
node.toolchain(node_version = "18.14.2")
#################################

npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm", dev_dependency = True)

npm.npm_translate_lock(
    name = "npm",
    pnpm_lock = "//:pnpm-lock.yaml",
    verify_node_modules_ignored = "//:.bazelignore",
)

use_repo(npm, "npm")

pnpm = use_extension("@aspect_rules_js//npm:extensions.bzl", "pnpm")

# Allows developers to use the matching pnpm version, for example:
# bazel run -- @pnpm --dir /home/runner/work/rules_js/rules_js install
use_repo(pnpm, "pnpm")

Using WORKSPACE

Paste this snippet into your WORKSPACE file:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "aspect_rules_js",
    sha256 = "1774702556e1d0b83b7f5eb58ec95676afe6481c62596b53f5b96575bacccf73",
    strip_prefix = "rules_js-2.9.2",
    url = "https://github.com/aspect-build/rules_js/releases/download/v2.9.2/rules_js-v2.9.2.tar.gz",
)

load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")

rules_js_dependencies()

load("@aspect_rules_js//js:toolchains.bzl", "DEFAULT_NODE_VERSION", "rules_js_register_toolchains")

rules_js_register_toolchains(node_version = DEFAULT_NODE_VERSION)

load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")

npm_translate_lock(
    name = "npm",
    npmrc = "//:.npmrc",
    pnpm_lock = "//:pnpm-lock.yaml",
    verify_node_modules_ignored = "//:.bazelignore",
)

load("@npm//:repositories.bzl", "npm_repositories")

npm_repositories()

What's Changed

  • test: dedupe test package name by @jbedard in #2611
  • test: add additional esm sandbox assertions by @jbedard in #2603
  • refactor: removing trailing whitespace in generated code by @jbedard in #2613
  • chore: simplify renovate bot config by @jbedard in #2609
  • refactor: simplify ts imports in fs patches by @jbedard in #2612
  • chore(deps): update bazel-contrib/.github action to v7.2.4 by @renovate[bot] in #2620
  • test: vite repro of 656 by @jbedard in #2618
  • fix: remove duplicate js_run_devserver.mjs file by @jbedard in #2630
  • test: assertions for sandboxing of third-party packages by @jbedard in #2614
  • js_binary and js_run_binary to support invocation across bazel workspaces by @f-luo in #2344
  • refactor: upgrade aspect_bazel_lib,rules_nodejs for bazel9 fixes by @jbedard in #2659

New Contributors

Full Changelog: v2.9.1...v2.9.2