Releases: aspect-build/rules_ts
v2.1.0
Using Bzlmod with Bazel 6:
Add to your MODULE.bazel
file:
bazel_dep(name = "aspect_rules_ts", version = "2.1.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 = "bd3e7b17e677d2b8ba1bac3862f0f238ab16edb3e43fb0f0b9308649ea58a2ad",
strip_prefix = "rules_ts-2.1.0",
url = "https://github.com/aspect-build/rules_ts/releases/download/v2.1.0/rules_ts-v2.1.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 = "node",
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: update bcr maintainers list by @kormide in #481
- chore: upgrade to Aspect Workflows 5.8.7 by @gregmagolan in #482
- feat: import toolchains to use for copy actions by @kormide in #484
Full Changelog: v2.0.1...v2.1.0
v2.0.1
Using Bzlmod with Bazel 6:
Add to your MODULE.bazel
file:
bazel_dep(name = "aspect_rules_ts", version = "2.0.1")
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 = "0f43d06b02895f825ac18a60901e899d91b22a11d44c4008c8383ada6096a4a9",
strip_prefix = "rules_ts-2.0.1",
url = "https://github.com/aspect-build/rules_ts/releases/download/v2.0.1/rules_ts-v2.0.1.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 = "node",
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()
What's Changed
- docs: indicate that aspect configure does proto now by @alexeagle in #443
- chore: update to Aspect Workflows 5.7.5 by @gregmagolan in #444
- chore: limit GHA workflows polling to 1 minute by @gregmagolan in #445
- docs: add troubleshooting note about debugging by @jbedard in #442
- chore: upgrade to Aspect Workflows 5.8.0-rc4 by @gregmagolan in #450
- chore: upgrade to Aspect Workflows 5.8.0-rc6 by @gregmagolan in #452
- chore: upgrade to Aspect Workflows 5.8.0-rc7 by @gregmagolan in #453
- chore: upgrade to Aspect Workflows 5.8.0-rc8 by @gregmagolan in #454
- chore: bump remote cache size & shard count & turn on k8s observability by @gregmagolan in #455
- chore: set --remote_download_minimal and --nobuild_runfile_links for all Workflows tasks by @gregmagolan in #456
- chore: bump remote cache to 384 gb by @gregmagolan in #457
- chore: upgrade to Aspect Workflows 5.8.0-rc11 by @gregmagolan in #458
- chore: update to Bazel 6.3.2 and Aspect CLI 5.7.2 by @gregmagolan in #459
- chore: upgrade to Aspect Workflows 5.8.0-rc12 by @gregmagolan in #460
- chore: upgrade to Aspect Workflows 5.8.0-rc14 by @gregmagolan in #461
- chore: upgrade to Aspect Workflows 5.8.0 by @gregmagolan in #462
- chore: reduce warming job frequency to once per day by @gregmagolan in #463
- chore: fixup warming cron --- gha does not support timezone by @gregmagolan in #464
- chore: update warming job to aspect-build/[email protected] by @gregmagolan in #465
- fix: ensure ts_project does not propagate testonly to build_test by @sallustfire in #469
- chore: upgrade to Aspect Workflows 5.8.2 by @gregmagolan in #470
- chore: update buildifier targets used by Aspect Workflows by @gregmagolan in #472
- chore: upgrade to Aspect Workflows 5.8.3 by @gregmagolan in #473
- refactor: put 'git archive' config in .gitattributes by @alexeagle in #475
- chore: mirror ts version 5.2.2 by @jbedard in #477
- chore: add automation for TS version mirroring by @alexeagle in #480
- fix: allow dict() tsconfig defined at analysis time by @jbedard in #478
Full Changelog: v2.0.0...v2.0.1
v2.0.0-rc1
Using Bzlmod with Bazel 6:
Add to your MODULE.bazel
file:
bazel_dep(name = "aspect_rules_ts", version = "2.0.0-rc1")
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 = "6f715bd3d525c1be062d4663caf242ea549981c0dbcc2e410456dc9c8cfd7bd4",
strip_prefix = "rules_ts-2.0.0-rc1",
url = "https://github.com/aspect-build/rules_ts/releases/download/v2.0.0-rc1/rules_ts-v2.0.0-rc1.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 = "node",
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()
What's Changed
- fix: add missing data dep by @alexeagle in #437
- chore: update to Aspect Workflows 5.7.2 by @gregmagolan in #438
- chore: update to Aspect Workflows 5.7.3 by @gregmagolan in #440
- feat: stamp our version into release by @alexeagle in #441
- feat: add check_for_update by @alexeagle in #439
Full Changelog: v2.0.0-rc0...v2.0.0-rc1
v2.0.0
Welcome to the first major release of rules_ts since 1.0.0.
We'll update these release notes periodically as we get feedback from users.
New Features
We now support Protocol Buffers and gRPC. See https://github.com/aspect-build/rules_ts/blob/main/docs/proto.md
We no longer default to a Persistent Worker mode to make the developer round-trip fast, as this was buggy and we don't have the resources to maintain a custom TypeScript compiler wrapper. Instead, we recommend using a faster transpiler. The upgrade flow will print some error messages on the first run to help you migrate.
We now check for rules_ts updates as part of running rules_ts_dependencies
, see https://github.com/aspect-build/rules_ts/blob/main/docs/repositories.md#rules_ts_dependencies-check_for_updates. You can opt-out of the data collection by setting this attribute to False
.
Breaking Changes
- We now support only Bazel 6.0 or greater, since we rely on validation actions
- We require that you select a value for the
skipLibCheck
flag, as there is no good default - you can either be fast or correct. Instructions are printed to the terminal on the first build. - We require that you select a value for the
transpiler
attribute. Again, there is no good default since the choices are to be fast or compatible. Documentation is at https://github.com/aspect-build/rules_ts/blob/main/docs/transpiler.md - "Persistent Worker" mode is no longer enabled by default. It requires a custom
tsc
compiler program, and we don't have the resources or funding to deal with the bugs this brings. We think that choosing a faster transpiler is a better solution. If your organization would like support for worker mode, you can fund the maintenance work. Or, if you'd like to take over the persistent worker Node.js program, we are open to relocating the code to a separate repository. - The
supports_workers
attribute onts_project
is now a tri-state[-1, 0, 1]
rather than a boolean. --define=VERBOSE_LOGS
no longer has an effect, use the--@aspect_rules_ts//ts:verbose=true
flag instead- Replace usage of
load("@aspect_rules_ts//ts:repositories.bzl", "LATEST_VERSION")
withLATEST_TYPESCRIPT_VERSION
- The
ts_project
macro now produces ats_project
rule. Any bazel query expressions, aspect implementations, or other "leaky abstractions" that keyed on the kind of the underlying rule being "ts_project_rule" will need to be updated to the new name "ts_project". - json inputs that are not sources and do not have an input / output collision are now declared
Using Bzlmod with Bazel 6:
Add to your MODULE.bazel
file:
bazel_dep(name = "aspect_rules_ts", version = "2.0.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 = "8aabb2055629a7becae2e77ae828950d3581d7fc3602fe0276e6e039b65092cb",
strip_prefix = "rules_ts-2.0.0",
url = "https://github.com/aspect-build/rules_ts/releases/download/v2.0.0/rules_ts-v2.0.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 = "node",
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()
What's Changed
- chore: fix docstring indents by @gregmagolan in #343
- feat: introduce skip_lib_check attribute by @thesayyn in #345
- Revert "feat: introduce skip_lib_check attribute" by @alexeagle in #347
- feat: skipLibCheck take 2 by @alexeagle in #350
- examples: add tsconfig types example by @jbedard in #351
- feat: implement custom flags for verbosity and workers by @thesayyn in #294
- feat: configure ts_project progress_message based on transpile/declaration config by @jbedard in #355
- fix: dictionary tsconfig extends with bzlmod by @jbedard in #358
- Updated typescript versions by @UebelAndre in #353
- docs: add troubleshooting docs about undeclared dependencies by @jbedard in #359
- refactor: consider json a js source (if resolve_json_module) by @gzm0 in #322
- chore: drop support for Bazel 5 by @alexeagle in #372
- fix: ts_project macro creates same-named rule by @alexeagle in #370
- feat: ask users about skipLibCheck when upgrading to 2.0 by @alexeagle in #371
- Move TS config validation to validation output group by @dzbarsky in #138
- chore: green up 2.x branch by @alexeagle in #396
- chore: readme updates for 2.0 by @alexeagle in #395
- feat(2.0): force users to choose a transpiler by @alexeagle in #397
- chore(2.0): remove LATEST_VERSION by @alexeagle in #403
- chore(2.0): remove VERBOSE_LOGS env var by @alexeagle in #402
- chore: flip supports_workers to default False by @alexeagle in #401
- chore(docs): move transpiler migration instructions to markdown by @alexeagle in #404
- fix: instructions for bazelrc should vary on common by @alexeagle in #406
- fix(transpiler): move the check for default_to_tsc_transpiler by @alexeagle in #405
- chore: upgrade to bazel 6.3 by @alexeagle in #407
- fix(transpiler): allow explicit 'opt-in' to tsc by @alexeagle in #408
- chore: run gazelle by @alexeagle in #413
- chore: remove maybe helper by @alexeagle in #414
- chore: bump rules_js version by @alexeagle in #419
- feat: read typescript version from resolved.json by @alexeagle in #418
- docs: put debug sections about worker mode together by @alexeagle in #422
- chore: switch rbe to buildbuddy by @alexeagle in #430
- fix: don't recommend bazelrc common verb by @alexeagle in #431
- chore: update to Aspect Workflows 5.7.1 by @gregmagolan in #435
- fix: add missing data dep by @alexeagle in #437
- chore: update to Aspect Workflows 5.7.2 by @gregmagolan in #438
- chore: update to Aspect Workflows 5.7.3 by @gregmagolan in #440
- feat: stamp our version into release by @alexeagle in #441
- feat: add check_for_update by @alexeagle in #439
New Contributors
- @UebelAndre made their first contribution in #353
- @dzbarsky made their first contribution in #138
Full Changelog: v1.3.3...v2.0.0
v2.0.0-rc0
Using Bzlmod with Bazel 6:
Add to your MODULE.bazel
file:
bazel_dep(name = "aspect_rules_ts", version = "2.0.0-rc0")
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 = "8f94152da908e747c007162e01e7da8f36eb399f675d5dc4799be20ea7f302f4",
strip_prefix = "rules_ts-2.0.0-rc0",
url = "https://github.com/aspect-build/rules_ts/releases/download/v2.0.0-rc0/rules_ts-v2.0.0-rc0.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 = "node",
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()
What's Changed
- chore: switch rbe to buildbuddy by @alexeagle in #430
- fix: don't recommend bazelrc common verb by @alexeagle in #431
- chore: update to Aspect Workflows 5.7.1 by @gregmagolan in #435
Full Changelog: v2.0.0-beta1...v2.0.0-rc0
v2.0.0-beta1
Using Bzlmod with Bazel 6:
Add to your MODULE.bazel
file:
bazel_dep(name = "aspect_rules_ts", version = "2.0.0-beta1")
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 = "885d91b8d8df2864c3b7030de5313e4cd71ef235a21232038a9f3313973f2651",
strip_prefix = "rules_ts-2.0.0-beta1",
url = "https://github.com/aspect-build/rules_ts/releases/download/v2.0.0-beta1/rules_ts-v2.0.0-beta1.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 = "node",
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()
What's Changed
- fix: instructions for bazelrc should vary on common by @alexeagle in #406
- fix(transpiler): move the check for default_to_tsc_transpiler by @alexeagle in #405
- chore: upgrade to bazel 6.3 by @alexeagle in #407
- fix(transpiler): allow explicit 'opt-in' to tsc by @alexeagle in #408
- chore: run gazelle by @alexeagle in #413
- chore: remove maybe helper by @alexeagle in #414
- chore: bump rules_js version by @alexeagle in #419
- feat: read typescript version from resolved.json by @alexeagle in #418
- docs: put debug sections about worker mode together by @alexeagle in #422
Full Changelog: v2.0.0-beta0...v2.0.0-beta1
v2.0.0-beta0
This is the beginning of our 2.0.0 major release cycle, containing any breaking changes we've been saving up since 1.0. More breaking changes are possible before 2.0.0-rc0, at which point there will be only bugfixes before 2.0.0 final.
Note: we are looking for a corporate sponsor for this release! Your company will get prominent placement in any release announcements, on the release page itself, and on the project README. If you're looking to hire any DevInfra people, this is a great way to broadcast your company's position on supporting open source! If we don't find a sponsor, we may change to a more restrictive license for the 2.0 release, with the intent to restore it to Apache-2.0 for the 2.1 release.
Breaking Changes
- We now require Bazel 6.0 or greater, since we rely on validation actions
- We require that you select a value for the
skipLibCheck
flag, as there is no good default - you can either be fast or correct. Instructions are printed to the terminal on the first build. - We require that you select a value for the
transpiler
attribute. Again, there is no good default since the choices are to be fast or compatible. Documentation is at https://github.com/aspect-build/rules_ts/blob/2.x/docs/transpiler.md - "Persistent Worker" mode is no longer enabled by default. It requires a custom
tsc
compiler program, and we don't have the resources or funding to deal with the bugs this brings. We think that choosing a faster transpiler is a better solution. If your organization would like support for worker mode, you can fund the maintenance work. Or, if you'd like to take over the persistent worker Node.js program, we are open to relocating the code to a separate repository. - The
supports_workers
attribute onts_project
is now a tri-state[-1, 0, 1]
rather than a boolean. --define=VERBOSE_LOGS
no longer has an effect, use the--@aspect_rules_ts//ts:verbose=true
flag instead- Replace usage of
load("@aspect_rules_ts//ts:repositories.bzl", "LATEST_VERSION")
withLATEST_TYPESCRIPT_VERSION
- The
ts_project
macro now produces ats_project
rule. Any bazel query expressions, aspect implementations, or other "leaky abstractions" that keyed on the kind of the underlying rule being "ts_project_rule" will need to be updated to the new name "ts_project". - json inputs that are not sources and do not have an input / output collision are now declared
Using Bzlmod with Bazel 6:
Add to your MODULE.bazel
file:
bazel_dep(name = "aspect_rules_ts", version = "2.0.0-beta0")
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 = "71fff38c05c2b866dbada246f12f57db9c793e5fad36765223563e7f6a940bb0",
strip_prefix = "rules_ts-2.0.0-beta0",
url = "https://github.com/aspect-build/rules_ts/releases/download/v2.0.0-beta0/rules_ts-v2.0.0-beta0.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
)
# 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 = "node",
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()
What's Changed
- chore: fix docstring indents by @gregmagolan in #343
- feat: introduce skip_lib_check attribute by @thesayyn in #345
- Revert "feat: introduce skip_lib_check attribute" by @alexeagle in #347
- feat: skipLibCheck take 2 by @alexeagle in #350
- examples: add tsconfig types example by @jbedard in #351
- feat: implement custom flags for verbosity and workers by @thesayyn in #294
- feat: configure ts_project progress_message based on transpile/declaration config by @jbedard in #355
- fix: dictionary tsconfig extends with bzlmod by @jbedard in #358
- Updated typescript versions by @UebelAndre in #353
- docs: add troubleshooting docs about undeclared dependencies by @jbedard in #359
- refactor: consider json a js source (if resolve_json_module) by @gzm0 in #322
- chore: drop support for Bazel 5 by @alexeagle in #372
- fix: ts_project macro creates same-named rule by @alexeagle in #370
- feat: ask users about skipLibCheck when upgrading to 2.0 by @alexeagle in #371
- Move TS config validation to validation output group by @dzbarsky in #138
- chore: green up 2.x branch by @alexeagle in #396
- chore: readme updates for 2.0 by @alexeagle in #395
- feat(2.0): force users to choose a transpiler by @alexeagle in #397
- chore(2.0): remove LATEST_VERSION by @alexeagle in #403
- chore(2.0): remove VERBOSE_LOGS env var by @alexeagle in #402
- chore: flip supports_workers to default False by @alexeagle in #401
- chore(docs): move transpiler migration instructions to markdown by @alexeagle in #404
New Contributors
- @UebelAndre made their first contribution in #353
- @dzbarsky made their first contribution in #138
Full Changelog: v1.3.3...v2.0.0-beta0
v1.4.5
Using Bzlmod with Bazel 6:
Add to your MODULE.bazel
file:
bazel_dep(name = "aspect_rules_ts", version = "1.4.5")
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 = "4c3f34fff9f96ffc9c26635d8235a32a23a6797324486c7d23c1dfa477e8b451",
strip_prefix = "rules_ts-1.4.5",
url = "https://github.com/aspect-build/rules_ts/releases/download/v1.4.5/rules_ts-v1.4.5.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
)
# 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 = "node",
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()
What's Changed
- chore: bump rules_js dep to 1.29.2 to pickup Windows fix by @gregmagolan in #385
Full Changelog: v1.4.4...v1.4.5
v1.4.4
Using Bzlmod with Bazel 6:
Add to your MODULE.bazel
file:
bazel_dep(name = "aspect_rules_ts", version = "1.4.4")
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 = "2bf5e2398713561ddaaaed8385dd6cee1bb21fe7856a5aac57b9e99ebf0291e2",
strip_prefix = "rules_ts-1.4.4",
url = "https://github.com/aspect-build/rules_ts/releases/download/v1.4.4/rules_ts-v1.4.4.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
)
# 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 = "node",
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()
What's Changed
Full Changelog: v1.4.3...v1.4.4
v1.4.3
Using Bzlmod with Bazel 6:
Add to your MODULE.bazel
file:
bazel_dep(name = "aspect_rules_ts", version = "1.4.3")
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 = "4a5b2b9a11b76f25e8f3f4734dde1b77682f0ac58d7c5ec688dba7b8f340d57d",
strip_prefix = "rules_ts-1.4.3",
url = "https://github.com/aspect-build/rules_ts/releases/download/v1.4.3/rules_ts-v1.4.3.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
)
# 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 = "node",
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()
What's Changed
- ci: enable buildifier check on ci by @jbedard in #379
- ci: add bazel 7 prerelease tests by @jbedard in #382
- Add tool version for TypeScript 5.1.5 by @ericrafalovsky in #383
- feat: update mirrored TS versions by @mattem in #384
New Contributors
- @ericrafalovsky made their first contribution in #383
Full Changelog: v1.4.2...v1.4.3