v2.2.0
Using Bzlmod with Bazel 6:
Add to your MODULE.bazel file:
bazel_dep(name = "aspect_rules_ts", version = "2.2.0")
rules_ts_ext = use_extension(
"@aspect_rules_ts//ts:extensions.bzl",
"ext",
dev_dependency = True,
)
rules_ts_ext.deps()
use_repo(rules_ts_ext, "npm_typescript")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_ts",
sha256 = "c77f0dfa78c407893806491223c1264c289074feefbf706721743a3556fa7cea",
strip_prefix = "rules_ts-2.2.0",
url = "https://github.com/aspect-build/rules_ts/releases/download/v2.2.0/rules_ts-v2.2.0.tar.gz",
)
##################
# rules_ts setup #
##################
# Fetches the rules_ts dependencies.
# If you want to have a different version of some dependency,
# you should fetch it *before* calling this.
# Alternatively, you can skip calling this function, so long as you've
# already fetched all the dependencies.
load("@aspect_rules_ts//ts:repositories.bzl", "rules_ts_dependencies")
rules_ts_dependencies(
# This keeps the TypeScript version in-sync with the editor, which is typically best.
ts_version_from = "//:package.json",
# Alternatively, you could pick a specific version, or use
# load("@aspect_rules_ts//ts:repositories.bzl", "LATEST_TYPESCRIPT_VERSION")
# ts_version = LATEST_TYPESCRIPT_VERSION
)
load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
rules_js_dependencies()
load("@bazel_features//:deps.bzl", "bazel_features_deps")
bazel_features_deps()
# Fetch and register node, if you haven't already
load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains")
nodejs_register_toolchains(
name = "nodejs",
node_version = DEFAULT_NODE_VERSION,
)
# Register aspect_bazel_lib toolchains;
# If you use npm_translate_lock or npm_import from aspect_rules_js you can omit this block.
load("@aspect_bazel_lib//lib:repositories.bzl", "register_copy_directory_toolchains", "register_copy_to_directory_toolchains")
register_copy_directory_toolchains()
register_copy_to_directory_toolchains()To use rules_ts with bazel-lib 2.x, you must additionally register the coreutils toolchain.
load("@aspect_bazel_lib//lib:repositories.bzl", "register_coreutils_toolchains")
register_coreutils_toolchains()What's Changed
- chore: add external remote cache for local development by @gregmagolan in #526
- chore: follow migration instruction for connectrpc by @alexeagle in #521
- ci: disable RBE for now by @alexeagle in #529
- Revert "fix: don't recommend bazelrc common verb" by @alexeagle in #528
- chore: enable lib checks by @alexeagle in #527
- chore(examples): upgrade Babel by @alexeagle in #530
- chore: re-enable RBE testing by @alexeagle in #531
- chore: tear out check_for_updates feature by @alexeagle in #535
- chore: BCR testing on Bazel 6 and 7 by @alexeagle in #532
- chore: cancel previous GHA from the same PR by @gregmagolan in #538
- test: assets being copied can make a conflicting asset by @YvanGuidoin in #533
- chore: remove gofmt by @alexeagle in #541
- perf: use starlark string.removeprefix by @jbedard in #544
- chore: update always_delivery to auto_delivery by @gregmagolan in #547
- feat: add ts_project validation of root/out/typing_out dir options by @jbedard in #552
- chore: upgrade to Aspect Workflows 5.9.11 by @gregmagolan in #554
New Contributors
- @YvanGuidoin made their first contribution in #533
Full Changelog: v2.1.1...v2.2.0