Skip to content

v2.0.0-rc7

Compare
Choose a tag to compare
@github-actions github-actions released this 23 Jul 06:34
· 39 commits to main since this release
9cede2b

Important

See #1671 for list of BREAKING CHANGES in rules_js 2.0. We'll copy over the list of BREAKING CHANGES to these release notes soon.

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-rc7")

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

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 = "dfd2c5494b43704ab33574ae701b31b68ca27333e5da1a76b5e39374cdd8dda4",
    strip_prefix = "rules_js-2.0.0-rc7",
    url = "https://github.com/aspect-build/rules_js/releases/download/v2.0.0-rc7/rules_js-v2.0.0-rc7.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: remove stray TODO by @alexeagle in #1839
  • Changes by create-pull-request action by @github-actions in #1841
  • test(pnpm): normalize typescript version across lockfile version tests by @jbedard in #1845
  • fix(pnpm): npm: aliases to self by @jbedard in #1846
  • Changes by create-pull-request action by @github-actions in #1851
  • test: consuming linked js_library vs npm_package by @jbedard in #1852
  • test: strip system dependent system_tar attribute from repositories.bzl snapshot by @jbedard in #1856
  • Changes by create-pull-request action by @github-actions in #1861
  • test: add additional npm: dependency lockfile tests by @jbedard in #1854
  • fix(npm): invalid export of package/resolved.json by @jbedard in #1855
  • test(npm): add tests for odd package names by @jbedard in #1860

Full Changelog: v2.0.0-rc6...v2.0.0-rc7