Skip to content

Releases: aspect-build/rules_js

v2.1.0

10 Oct 06:07
194622e
Compare
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.1.0")

####### 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 = "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 = "75c25a0f15a9e4592bbda45b57aa089e4bf17f9176fd735351e8c6444df87b52",
    strip_prefix = "rules_js-2.1.0",
    url = "https://github.com/aspect-build/rules_js/releases/download/v2.1.0/rules_js-v2.1.0.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

  • Changes by create-pull-request action by @github-actions in #1922
  • chore(deps): update webfactory/ssh-agent action to v0.9.0 by @renovate in #1634
  • Add support for + in canonical repo names by @fmeum in #1927
  • docs: Clarify that $npm_package.publish requires publishable = True by @fweikert in #1926
  • chore(deps): update aspect by @renovate in #1923
  • chore: restore windows testing by @alexeagle in #1920
  • Changes by create-pull-request action by @github-actions in #1930
  • chore: fix broken links by @alexeagle in #1931
  • chore: adopt conclusion job for stable status check by @alexeagle in #1921
  • test: add @bazel/runfiles test by @jbedard in #1895
  • chore(deps): update bazel by @renovate in #1928
  • chore(deps): update patch updates by @renovate in #1937
  • chore(deps): update @types by @renovate in #1558
  • chore(deps): update rollup by @renovate in #1874
  • chore(deps): update dependency bazel_skylib_gazelle_plugin to v1.7.1 - autoclosed by @renovate in #1943
  • chore(deps): update syncpack digest to 805e36f by @renovate in #1829
  • chore(deps): update dependency rollup to v3.29.5 [security] by @renovate in #1940
  • chore(deps): update dependency gazelle to v0.39.1 by @renovate in #1945
  • chore(deps): update dependency buildifier_prebuilt to v7 by @renovate in #1949
  • chore(deps): update peter-evans/create-pull-request action to v7 by @renovate in #1950
  • chore(deps): update dependency rules_go to v0.50.1 by @renovate in #1953
  • chore(deps): update dependency stardoc to v0.7.1 by @renovate in #1954
  • feat(pnpm): allow latest as version to get the latest version by @gzm0 in #1933
  • chore: disable renovate for unit test projects by @jbedard in #1960
  • chore(deps): update softprops/action-gh-release action to v2 by @renovate in #1951
  • Changes by create-pull-request action by @github-actions in #1965
  • ci: fix matrix job on GitHub Actions by @gregmagolan in #1967
  • docs: merge gather_files_from_js_infos rename PRs in migration docs by @gzm0 in #1891
  • chore: bump to Aspect CLI 2024.41.17 by @gregmagolan in #1968

New Contributors

Full Changelog: v2.0.2...v2.1.0

v2.0.2

01 Oct 15:22
bf93e47
Compare
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.0.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.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 = "91655ebd3178f979fcacd018f8f42aa9d3bc79c4fbddb7be9521971ec77e6aee",
    strip_prefix = "rules_js-2.0.2",
    url = "https://github.com/aspect-build/rules_js/releases/download/v2.0.2/rules_js-v2.0.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

  • perf(npm): use actions.run instead of actions.run_shell by @jbedard in #1905
  • refactor(npm): improve pnpm.onlyBuiltDependencies error message by @jbedard in #1902
  • chore: use aspect workflows RBE by @kormide in #1908
  • chore: now testing on Aspect Workflows RBE by @gregmagolan in #1909
  • perf: avoid large array concatenation by @jbedard in #1883
  • doc: add callout for dependency on generate_bzl_library_targets by @plobsing in #1911
  • fix(npm): respect npm_package include_transitive_sources attribute by @jbedard in #1912
  • Changes by create-pull-request action by @github-actions in #1906
  • docs(pnpm): add note about pnpm vs bazel patching by @jbedard in #1916

New Contributors

Full Changelog: v2.0.1...v2.0.2

v2.0.1

21 Aug 20:20
4f5ef8c
Compare
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.0.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.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 = "4cab6898f0ff8048e32640cce06a47aa4b92b2fb330d055940f95f24c8ebb868",
    strip_prefix = "rules_js-2.0.1",
    url = "https://github.com/aspect-build/rules_js/releases/download/v2.0.1/rules_js-v2.0.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

  • fix(docs): linkify PRs in rules_js2 migration guide by @alexeagle in #1890
  • Changes by create-pull-request action by @github-actions in #1892
  • fix: fix permission denied failure on buildbarn RBE by @gregmagolan in #1894
  • docs: add note about js_binary shell script by @jbedard in #1897
  • fix: remove problematic chmod extract command in npm_package_store in favor of using a custom postinstall by @gregmagolan in #1904

Full Changelog: v2.0.0...v2.0.1

v2.0.0

15 Aug 02:12
90b64b6
Compare
Choose a tag to compare

This is our first semver-major release since 1.0 and has some breaking changes.
These are documented in the rules_js 2.0 migration guide.
Note that you'll need to upgrade other rules that depend on rules_js at the same time.

There is a known issue with usage on Windows: #1739
If you use rules_js on Windows we'd love to know about it. Having active users justifies prioritizing the fix.

Using Bzlmod (recommended):

Add to your MODULE.bazel file:

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

####### 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 = "6b7e73c35b97615a09281090da3645d9f03b2a09e8caa791377ad9022c88e2e6",
    strip_prefix = "rules_js-2.0.0",
    url = "https://github.com/aspect-build/rules_js/releases/download/v2.0.0/rules_js-v2.0.0.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 aspect.dev URL references to aspect.build by @gregmagolan in #1747
  • chore: add pnpm versions 8.15.4 through 9.1.1 by @gregmagolan in #1730
  • test: generate fresh lockfile each time for pnpm lockfile test by @jbedard in #1750
  • refactor: normalize pnpm lockfile data in parser by @jbedard in #1735
  • Fix typo in onlyBuiltDependencies by @surma in #1752
  • chore: bump miminum dep to aspect_bazel_lib 2.7.6 by @gregmagolan in #1755
  • refactor: simplify handling of #423, package aliases by @jbedard in #1757
  • refactor: move npm_registry_url to utils by @jbedard in #1758
  • refactor: do not include registry url in package keys by @jbedard in #1759
  • feat: add include_npm_sources to npm_package by @gregmagolan in #1760
  • docs: update section on "Exec failed due to IOException" by @fmeum in #1761
  • fix: include package store directory in default output of npm_link_package_store by @gregmagolan in #1762
  • chore: bump minimum aspect_bazel_lib to 2.7.7 by @gregmagolan in #1763
  • test: add lockfile test cases by @jbedard in #1764
  • chore: automate pnpm version mirroring by @alexeagle in #1766
  • fix(pnpm): support pnpm9 URL, github version package versions by @jbedard in #1765
  • fix(pnpm): support npm: alias dependencies with pnpm lockfile v5 by @jbedard in #1767
  • chore: bump to rules_oci 1.7.6 by @gregmagolan in #1768
  • refactor: sort generated npm_translate_lock store targets by @jbedard in #1769
  • fix(pnpm): support npm: aliases to packages in alternate registries by @jbedard in #1770
  • fix(pnpm): npm aliases to url specifiers by @jbedard in #1772
  • test: add test cases for individual pnpm lockfile issues by @jbedard in #1773
  • refactor(pnpm): remove .parse_pnpm_package_key util by @jbedard in #1774
  • fix(pnpm): pnpm9 transitive npm: dependenies by @jbedard in #1775
  • fix(pnpm): pnpm9 npm: dependencies with peers by @jbedard in #1776
  • refactor: remote non-functional exclude_declarations_from_npm_packages alias by @gregmagolan in #1778
  • Changes by create-pull-request action by @github-actions in #1771
  • refactor(pnpm): move pnpm parsing logic to pnpm.bzl by @jbedard in #1777
  • Changes by create-pull-request action by @github-actions in #1779
  • fix: fix issue with bzlmod toolchain registration by bumping minimum rules_nodejs to 6.1.2 by @gregmagolan in #1780
  • chore: fixup pattern for try-import of user.bazelrc by @gregmagolan in #1789
  • perf: do not put files_runfiles in files + transitive_files by @jbedard in #1782
  • perf: avoid cloning data_files when not copy_data_files_to_bin by @jbedard in #1783
  • perf: avoid large temp arrays, use single loop by @jbedard in #1784
  • perf: avoid js_info param validation on default values by @jbedard in #1785
  • chore: bump minimum rules_nodejs to 6.2.0 by @gregmagolan in #1792
  • chore: fixup load statement ordering in generated bzl by @gregmagolan in #1795
  • fix: handle malformed npm packages gracefully in extract action by @gregmagolan in #1794
  • perf: minimize cost of checking bazel version by @dzbarsky in #1800
  • perf: use string.elems for char iteration by @DavidZbarsky-at in #1802
  • Changes by create-pull-request action by @github-actions in #1804
  • [perf] Optimize npm_package_store by @DavidZbarsky-at in #1801
  • Optimize _is_gnu_tar check by @DavidZbarsky-at in #1807
  • refactor: remove optional empty depset direct by @jbedard in #1790
  • perf: do not check JsInfo hasattr for always-set attributes by @jbedard in #1786
  • perf: only validate deprecated js_info params when extra params specified by @jbedard in #1799
  • refactor: sort lock translation action cache content by @jbedard in #1796
  • perf: do not include sources,types when transitive_sources,type already included by @jbedard in #1803
  • perf: reduce use of bazel_skylib paths.join by @jbedard in #1812
  • Changes by create-pull-request action by @github-actions in #1809
  • perf: do not double process lifecycle_hooks* attributes in bzlmod by @jbedard in #1805
  • perf: change js_helpers gather_* utils to accept list, not depset by @jbedard in #1787
  • refactor: change npm_import(is_gnu_tar) to system_tar by @jbedard in #1811
  • perf: Allow opting out of arg/env expansion by @DavidZbarsky-at in #1810
  • test: npm: dependencies by @jbedard in #1815
  • perf: remove unused template vars by @jbedard in #1819
  • fix: use .cjs extension for fs patches by @jbedard in #1818
  • fix(pnpm): npm: aliases to packages with peer deps by @jbedard in #1824
  • refactor(pnpm): strip special characters from pkg labels by @jbedard in #1821
  • refactor: remove unused peer_dependencies field by @jbedard in #1826
  • perf: reduce string concatenation in lockfile parsing by @...
Read more

v2.0.0-rc10

09 Aug 06:28
acb0f7e
Compare
Choose a tag to compare

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

####### 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 = "fb6589b7db7def75d1f3abd606c6997b0360ff8c0c18ec8a4ae4d435930bd0b4",
    strip_prefix = "rules_js-2.0.0-rc10",
    url = "https://github.com/aspect-build/rules_js/releases/download/v2.0.0-rc10/rules_js-v2.0.0-rc10.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

  • Use canonical repo name for cross-repo npm_translate_lock by @fmeum in #1876
  • perf: do not sanitize npm package labels multiple times by @jbedard in #1822
  • Changes by create-pull-request action by @github-actions in #1878
  • docs(npm): document support for pnpm9 by @jbedard in #1882

Full Changelog: v2.0.0-rc9...v2.0.0-rc10

v2.0.0-rc9

27 Jul 04:01
e306629
Compare
Choose a tag to compare

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

####### 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 = "f8536470864c91f91c83aea91de9a27607ca5e6d8a9fcdd56132cf422c6b7b56",
    strip_prefix = "rules_js-2.0.0-rc9",
    url = "https://github.com/aspect-build/rules_js/releases/download/v2.0.0-rc9/rules_js-v2.0.0-rc9.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

  • fix(npm): npm_link_package() in subdirectory to js_library() package by @jbedard in #1871
  • fix: handle js_library 1p deps correctly in js_run_devserver by @gregmagolan in #1872
  • fix: delete old files & folders on each js_run_devserver sync by @gregmagolan in #1873

Full Changelog: v2.0.0-rc8...v2.0.0-rc9

v2.0.0-rc8

25 Jul 22:55
002b638
Compare
Choose a tag to compare

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

####### 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 = "c1c33715f459d112b53b2bb15fd53a738824c6d331a181abe33fe0ef2a2c3f1f",
    strip_prefix = "rules_js-2.0.0-rc8",
    url = "https://github.com/aspect-build/rules_js/releases/download/v2.0.0-rc8/rules_js-v2.0.0-rc8.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: include package.json files in npm_translate_lock(data) by @jbedard in #1853
  • refactor(npm): change string template var from overused "name" to "pkg" by @jbedard in #1867
  • test: remove platform specific system_tar from test snapshots by @jbedard in #1866
  • perf(npm): reduce package_name() calls by @jbedard in #1864
  • perf(npm): reduce use of string.split by @jbedard in #1865
  • fix(npm): expost package_json.bzl and resolved.json for each package alias by @jbedard in #1857
  • refactor: remove pkg_glob api by @jbedard in #1862
  • perf(npm): reduce array concatenation by @jbedard in #1859
  • test(npm): add test using git+ssh protocol in version by @jbedard in #1868
  • fix: do not put sources+types into NpmPackageStoreInfo.files by @jbedard in #1850

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

v2.0.0-rc7

23 Jul 06:34
9cede2b
Compare
Choose a tag to compare

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

v2.0.0-rc6

02 Jul 23:20
1696b07
Compare
Choose a tag to compare

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

####### 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 = "a723815986f3dd8b2c58d0ea76fde0ed56eed65de3212df712e631e5fc7d8790",
    strip_prefix = "rules_js-2.0.0-rc6",
    url = "https://github.com/aspect-build/rules_js/releases/download/v2.0.0-rc6/rules_js-v2.0.0-rc6.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

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

v2.0.0-rc5

17 Jun 18:08
Compare
Choose a tag to compare

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

####### 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 = "3bad4ab669d4d38d0d137275b946a46ce6f8f17fecc6c7affba64966a9054246",
    strip_prefix = "rules_js-2.0.0-rc5",
    url = "https://github.com/aspect-build/rules_js/releases/download/v2.0.0-rc5/rules_js-v2.0.0-rc5.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

  • Changes by create-pull-request action by @github-actions in #1779
  • fix: fix issue with bzlmod toolchain registration by bumping minimum rules_nodejs to 6.1.2 by @gregmagolan in #1780
  • chore: fixup pattern for try-import of user.bazelrc by @gregmagolan in #1789
  • perf: do not put files_runfiles in files + transitive_files by @jbedard in #1782
  • perf: avoid cloning data_files when not copy_data_files_to_bin by @jbedard in #1783
  • perf: avoid large temp arrays, use single loop by @jbedard in #1784
  • perf: avoid js_info param validation on default values by @jbedard in #1785
  • chore: bump minimum rules_nodejs to 6.2.0 by @gregmagolan in #1792
  • chore: fixup load statement ordering in generated bzl by @gregmagolan in #1795
  • fix: handle malformed npm packages gracefully in extract action by @gregmagolan in #1794
  • perf: minimize cost of checking bazel version by @dzbarsky in #1800
  • perf: use string.elems for char iteration by @DavidZbarsky-at in #1802
  • Changes by create-pull-request action by @github-actions in #1804

New Contributors

Full Changelog: v2.0.0-rc4...v2.0.0-rc5