v2.0.0-alpha.3
Pre-release
Pre-release
github-actions
released this
29 Apr 00:15
·
277 commits
to main
since this release
Important
rules_js maintainers are working towards a rules_js 2.0 RC release. We don't recommended upgrading to this alpha release. Downstream rule sets such as rules_ts
will also require updates that we're currently working on (tracking issue #1671). The list of BREAKING CHANGES will be included in the 2.0 RC release notes.
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.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.1.0")
node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node", dev_dependency = True)
node.toolchain(node_version = "16.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")
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 = "32546833201bec90457c20b979889cccd2049ec6766a57dc51d184e02cb88200",
strip_prefix = "rules_js-2.0.0-alpha.3",
url = "https://github.com/aspect-build/rules_js/releases/download/v2.0.0-alpha.3/rules_js-v2.0.0-alpha.3.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",
pnpm_lock = "//:pnpm-lock.yaml",
verify_node_modules_ignored = "//:.bazelignore",
)
load("@npm//:repositories.bzl", "npm_repositories")
npm_repositories()
What's Changed
- chore: generate and save binary BEP on Workflows by @gregmagolan in #1674
- fix: support alternative rules_js workspace or repo_name by @jbedard in #1676
- chore: update workflows config by @gregmagolan in #1677
- feat: add npm_package(publishable) to disable npm_publish target generation by @SinimaWath in #1527
- chore: set --test_tag_filters on cli and not via bazelrc by @gregmagolan in #1678
- fix: green up GHA CI coverage step on main by @gregmagolan in #1680
- test: add different pnpm specifier types by @jbedard in #1681
- chore: use canonical --remote_download_outputs=minimal flag for BwoB by @gregmagolan in #1682
- chore: tweak delivery stamping by @gregmagolan in #1685
- chore: fixup typos in gha ci yaml by @gregmagolan in #1686
- refactor: rename JS_RUN_BINARY__USE_EXECROOT_ENTRY_POINT to JS_BINARY__USE_EXECROOT_ENTRY_POINT by @gregmagolan in #1687
- chore: fixup snapshot tests after rebase by @gregmagolan in #1688
Full Changelog: v1.41.2...v2.0.0-alpha.3