Skip to content

Releases: aspect-build/rules_js

v3.0.0-rc4

30 Jan 23:19
cecda76

Choose a tag to compare

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.

Add to your MODULE.bazel file:

bazel_dep(name = "aspect_rules_js", version = "3.0.0-rc4")

# Translate the pnpm-lock.yaml file to bazel targets
npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm")
npm.npm_translate_lock(
    name = "npm",
    pnpm_lock = "//:pnpm-lock.yaml",
    verify_node_modules_ignored = "//:.bazelignore",
)
use_repo(npm, "npm")

# Allows developers to use the matching pnpm version, for example:
# bazel run -- @pnpm --dir /home/runner/work/rules_js/rules_js install
pnpm = use_extension("@aspect_rules_js//npm:extensions.bzl", "pnpm", dev_dependency = True)
use_repo(pnpm, "pnpm")

By default you get the node version from DEFAULT_NODE_VERSION in @rules_nodejs//nodejs:repositories.bzl
Optionally you can pin a different version using rules_nodejs:

bazel_dep(name = "rules_nodejs", version = "6.7.3")
node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node")
node.toolchain(node_version = "24.13.0")

What's Changed

  • test: remove primary bazel version testing from gha by @jbedard in #2701
  • Revert "fix: produce starlark_doc_extract rules for public API" by @alexeagle in #2710
  • chore(docs): document public APIs, not private ones by @alexeagle in #2711

Full Changelog: v3.0.0-rc3...v3.0.0-rc4

v3.0.0-rc3

30 Jan 00:32
6eac655

Choose a tag to compare

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.

Add to your MODULE.bazel file:

bazel_dep(name = "aspect_rules_js", version = "3.0.0-rc3")

# Translate the pnpm-lock.yaml file to bazel targets
npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm")
npm.npm_translate_lock(
    name = "npm",
    pnpm_lock = "//:pnpm-lock.yaml",
    verify_node_modules_ignored = "//:.bazelignore",
)
use_repo(npm, "npm")

# Allows developers to use the matching pnpm version, for example:
# bazel run -- @pnpm --dir /home/runner/work/rules_js/rules_js install
pnpm = use_extension("@aspect_rules_js//npm:extensions.bzl", "pnpm", dev_dependency = True)
use_repo(pnpm, "pnpm")

By default you get the node version from DEFAULT_NODE_VERSION in @rules_nodejs//nodejs:repositories.bzl
Optionally you can pin a different version using rules_nodejs:

bazel_dep(name = "rules_nodejs", version = "6.7.3")
node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node")
node.toolchain(node_version = "24.13.0")

What's Changed

  • chore(deps): update pre-commit hook commitizen-tools/commitizen to v4 by @renovate[bot] in #2680
  • chore: Fix up a few broken links by @MatrixFrog in #2697
  • feat: support reproducible pnpm downloads using bazel facts api by @jbedard in #2698
  • fix: add check to ensure home npmrc exists in module extension by @smocherla-brex in #2702
  • refactor: upgrade platforms bzlmod dep to v1 by @jbedard in #2704
  • refactor(deps): remove use of path-exists, upgrade @pnpm/lifecycle by @renovate[bot] in #2682
  • fix: produce starlark_doc_extract rules for public API by @alexeagle in #2703
  • test: remove use of WORKSPACE.bzlmod in tests, prep e2e tests for bazel 8+ by @jbedard in #2705

New Contributors

Full Changelog: v3.0.0-rc2...v3.0.0-rc3

v3.0.0-rc2

23 Jan 19:36
87976ff

Choose a tag to compare

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.

Add to your MODULE.bazel file:

bazel_dep(name = "aspect_rules_js", version = "3.0.0-rc2")

# Translate the pnpm-lock.yaml file to bazel targets
npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm")
npm.npm_translate_lock(
    name = "npm",
    pnpm_lock = "//:pnpm-lock.yaml",
    verify_node_modules_ignored = "//:.bazelignore",
)
use_repo(npm, "npm")

# Allows developers to use the matching pnpm version, for example:
# bazel run -- @pnpm --dir /home/runner/work/rules_js/rules_js install
pnpm = use_extension("@aspect_rules_js//npm:extensions.bzl", "pnpm", dev_dependency = True)
use_repo(pnpm, "pnpm")

By default you get the node version from DEFAULT_NODE_VERSION in @rules_nodejs//nodejs:repositories.bzl
Optionally you can pin a different version using rules_nodejs:

bazel_dep(name = "rules_nodejs", version = "6.7.3")
node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node")
node.toolchain(node_version = "24.13.0")

What's Changed

  • chore(deps): update pre-commit hook koalaman/shellcheck-precommit to v0.11.0 by @renovate[bot] in #2678
  • chore(deps): update pre-commit hook commitizen-tools/commitizen to v3.31.0 by @renovate[bot] in #2677
  • chore(deps): update dependency jsonpath-plus to v10 [security] by @renovate[bot] in #2692
  • fix: support negated pnpm os|cpu constraints by @jbedard in #2696

Full Changelog: v3.0.0-rc1...v3.0.0-rc2

v3.0.0-rc1

21 Jan 19:49
2037af9

Choose a tag to compare

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.

Add to your MODULE.bazel file:

bazel_dep(name = "aspect_rules_js", version = "3.0.0-rc1")

# Translate the pnpm-lock.yaml file to bazel targets
npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm")
npm.npm_translate_lock(
    name = "npm",
    pnpm_lock = "//:pnpm-lock.yaml",
    verify_node_modules_ignored = "//:.bazelignore",
)
use_repo(npm, "npm")

# Allows developers to use the matching pnpm version, for example:
# bazel run -- @pnpm --dir /home/runner/work/rules_js/rules_js install
pnpm = use_extension("@aspect_rules_js//npm:extensions.bzl", "pnpm", dev_dependency = True)
use_repo(pnpm, "pnpm")

By default you get the node version from DEFAULT_NODE_VERSION in @rules_nodejs//nodejs:repositories.bzl
Optionally you can pin a different version using rules_nodejs:

bazel_dep(name = "rules_nodejs", version = "6.7.3")
node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node")
node.toolchain(node_version = "24.13.0")

What's Changed

  • chore: mirror pnpm versions by @jbedard in #2668
  • chore(deps): update webfactory/ssh-agent action to v0.9.1 by @renovate[bot] in #2669
  • chore(deps): update bazel-contrib/.github action to v7.3.0 by @renovate[bot] in #2670
  • chore: upgrade pnpm, rollup deps by @jbedard in #2667
  • chore(deps): update pre-commit hook keith/pre-commit-buildifier to v8 by @renovate[bot] in #2681
  • test: update e2e test MODULE deps by @jbedard in #2683
  • chore(deps): update @rollup dependencies by @renovate[bot] in #2671
  • fix: crash when printing .bazelignore error message with bazel8 by @jbedard in #2687
  • chore: update ci bazel9 testing 9.0.0 by @jbedard in #2689
  • fix: allow link: deps to non-project directories by @jbedard in #2691

Full Changelog: v3.0.0-rc0...v3.0.0-rc1

v3.0.0-rc0

19 Jan 21:30
dd02fde

Choose a tag to compare

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.

Notable Changes

  • Platform-specific optional npm dependencies (#2538)
  • Package exclusion presets + default exclusion list (#2652)
  • pnpm module extension include_npm support (#2580)
  • Bazel path-mapping support (#2575)
  • Default Node version bumped to v22 via rules_nodejs 6.7 (#2649)
  • Properly escape quotes in js_binary(env) (#2657)
  • Upgrade to bazel-lib v3 (#2457)
  • Many performance improvements with the removal of legacy code

Breaking Changes

  • WORKSPACE support removed (#2455)
  • minimum Bazel now 7.6+ (#2458, #2645)
  • Pnpm <9 support removed (#2456)
  • Ability to rename :node_modules/ target prefix removed (#2202)
  • Any use of aspect_bazel_lib must be at minimum 2.22.4 for forward compatibility (#2567)

Add to your MODULE.bazel file:

bazel_dep(name = "aspect_rules_js", version = "3.0.0-rc0")

# Translate the pnpm-lock.yaml file to bazel targets
npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm")
npm.npm_translate_lock(
    name = "npm",
    pnpm_lock = "//:pnpm-lock.yaml",
    verify_node_modules_ignored = "//:.bazelignore",
)
use_repo(npm, "npm")

# Allows developers to use the matching pnpm version, for example:
# bazel run -- @pnpm --dir /home/runner/work/rules_js/rules_js install
pnpm = use_extension("@aspect_rules_js//npm:extensions.bzl", "pnpm", dev_dependency = True)
use_repo(pnpm, "pnpm")

By default you get the node version from DEFAULT_NODE_VERSION in @rules_nodejs//nodejs:repositories.bzl
Optionally you can pin a different version using rules_nodejs:

bazel_dep(name = "rules_nodejs", version = "6.7.3")
node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node")
node.toolchain(node_version = "24.13.0")

What's Changed

  • chore: update release notes snippets by @jbedard in #2651
  • refactor: remove use of bazel_features, old docs/tests, deprecate verify_node_modules_ignored by @jbedard in #2650
  • feat: upgrade rules_nodejs to 6.7, default node version to v22 by @jbedard in #2649
  • refactor: remove unnecessary code, simplify bool() casting by @jbedard in #2654
  • fix: quotes in js_binary(env) by @jbedard in #2657
  • refactor: remove docs+references to old pnpm,bazel by @jbedard in #2656
  • fix: return full label paths from npm_link_targets by @jbedard in #2655
  • feat: add package exclusion presets, enable default exclusion list by @jbedard in #2652
  • fix: node fs.readlinkSync patch should maintain relative links by @jbedard in #2661

Full Changelog: v3.0.0-alpha.4...v3.0.0-rc0

v2.9.2

18 Jan 06:41
74d32f8

Choose a tag to compare

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

v3.0.0-alpha.4

14 Jan 21:44
af8f6f7

Choose a tag to compare

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:

Add to your MODULE.bazel file:

bazel_dep(name = "aspect_rules_js", version = "3.0.0-alpha.4")

####### 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.6.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")

What's Changed

  • docs: remove comment referencing unsupported nodejs version by @jbedard in #2589
  • refactor: remove pnpm-workspace.yaml from label_store by @dzbarsky in #2500
  • refactor: remove use of label-store for package patch files by @dzbarsky in #2542
  • refactor: remove support for undeclared .npmrc and pnpm-workspace files by @jbedard in #2632
  • refactor: remove npmrc from label-store by @jbedard in #2631
  • refactor: remove pnpm import when no pnpm_lock present by @jbedard in #2634
  • refactor: remove label_store npm_package_lock,yarn_lock by @jbedard in #2633
  • refactor: remove label_store, utils.exists by @jbedard in #2635
  • fix: hash long package store and repository names by @jbedard in #2629
  • refactor: remove deprecated npm_import(dev) attribute by @jbedard in #2637
  • refactor: cleanup exclude_package_contents implementation, docs by @jbedard in #2638
  • refactor: remove legacy bazel workaround by @jbedard in #2641
  • refactor: reduce conversion of paths,labels to str by @jbedard in #2639
  • docs: remove references to WORKSPACE and non-bzlmod APIs by @jbedard in #2644
  • refactor: change repo rules to use coreutils by @jbedard in #2643
  • refactor: do not duplicate js_library result JsInfo in runfiles by @jbedard in #2615
  • refactor: move npm/private/lifecycle to pnpm workspace, bazel build by @jbedard in #2646
  • refactor: upgrade @pnpm/lifecycle package by @jbedard in #2647
  • chore: enable bazel9 rc tests by @jbedard in #2648
  • refactor: remove support and references to bazel-lib <3.x, bazel<7.6 by @jbedard in #2645

Full Changelog: v3.0.0-alpha.3...v3.0.0-alpha.4

v2.9.1

05 Jan 19:55
ee2708b

Choose a tag to compare

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.1")

####### 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 = "b87afa2205b6fa4540e01d2c47b02a92ed67e24e24f738d46c4c8099836a769a",
    strip_prefix = "rules_js-2.9.1",
    url = "https://github.com/aspect-build/rules_js/releases/download/v2.9.1/rules_js-v2.9.1.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

  • chore: update Next.js version to 15.2.6 by @scottshuffler in #2591
  • Fix fetching npm packages from git repositories by @thomasdraebing in #2403
  • fix: do not serialize Label() via "".join() when tar command fails by @jbedard in #2593
  • chore: add github_user_id to bcr metadata.template.json by @jbedard in #2588
  • fix(pnpm): Parse integrity hash from package.json packageManager if provided by @Geethree in #2596
  • fix: npm deps on git+https urls by @jbedard in #2592
  • chore(deps): update actions/checkout action to v6 by @renovate[bot] in #2523
  • chore(deps): update peter-evans/create-pull-request action to v8 by @renovate[bot] in #2572
  • chore(deps): update bazel-contrib/publish-to-bcr action to v1.1.0 by @renovate[bot] in #2599
  • test: move babel test deps into test/node-patches/package.json by @jbedard in #2598
  • chore(deps): update actions/cache action to v5 by @renovate[bot] in #2602

New Contributors

Full Changelog: v2.9.0...v2.9.1

v3.0.0-alpha.3

17 Dec 20:16
b7ca695

Choose a tag to compare

v3.0.0-alpha.3 Pre-release
Pre-release

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:

Add to your MODULE.bazel file:

bazel_dep(name = "aspect_rules_js", version = "3.0.0-alpha.3")

####### 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.6.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")

What's Changed

  • feat: add include_npm to pnpm module extension by @jbedard in #2580
  • refactor: js_image_layer to output with .tar extension when uncompressed by @jbedard in #2586
  • chore: declare aspect_bazel_lib dep on 2.22.4 to include ceaff542 by @jbedard in #2587

Full Changelog: v3.0.0-alpha.2...v3.0.0-alpha.3

v2.9.0

02 Jan 22:05
092dd78

Choose a tag to compare

What's Changed

  • feat: support bazel path-mapping (#2575) by @jbedard in #2576
  • docs: typo with the include_external_repositories example by @jbedard in #2582
  • js image layer to output with .tar extension when uncompressed by @fa93hws in #2585

New Contributors

Full Changelog: v2.8.3...v2.9.0