Skip to content

Commit 9081e23

Browse files
authored
build: define typescript version via string in module.bazel file (#31798)
Within our module.bazel file when describing the version of typescript to use for rules_ts, we use ts_version instead of ts_version_from to prevent our package.json file from being part of the set of files used to calculate the sha for the lock file. Any unrelated change to the version of the typescript file would end up causing our lockfile to be out of date. This amount of churn has proven to be too much for our current setup. We instead now test to validate the versions defined in the package.json and MODULE.bazel files match.
1 parent 4de4b29 commit 9081e23

File tree

5 files changed

+14
-12
lines changed

5 files changed

+14
-12
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ jobs:
116116
- name: Install node modules
117117
run: pnpm install --frozen-lockfile
118118
- name: Run tests
119-
run: bazel test --build_tag_filters=-e2e --test_tag_filters=-e2e --build_tests_only --test_env="DEBUG=puppeteer:*" -- src/...
119+
run: bazel test --build_tests_only --test_tag_filters=-linker-integration-test --test_tag_filters=-e2e -- //... -//goldens/... -//integration/...
120120

121121
build:
122122
runs-on: ubuntu-latest-16core

.github/workflows/pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ jobs:
113113
- name: Install node modules
114114
run: pnpm install --frozen-lockfile
115115
- name: Run tests
116-
run: bazel test --build_tag_filters=-e2e --test_tag_filters=-e2e --build_tests_only -- src/...
116+
run: bazel test --build_tests_only --test_tag_filters=-linker-integration-test --test_tag_filters=-e2e -- //... -//goldens/... -//integration/...
117117

118118
build:
119119
runs-on: ubuntu-latest-16core

BUILD.bazel

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
load("@devinfra//bazel/validation:defs.bzl", "validate_ts_version_matching")
2+
load("@npm//:defs.bzl", "npm_link_all_packages")
13
load("//:pkg-externals.bzl", "PKG_EXTERNALS")
24
load("//src/cdk:config.bzl", "CDK_ENTRYPOINTS")
35
load("//src/cdk-experimental:config.bzl", "CDK_EXPERIMENTAL_ENTRYPOINTS")
46
load("//src/material:config.bzl", "MATERIAL_ENTRYPOINTS", "MATERIAL_TESTING_ENTRYPOINTS")
57
load("//src/material-experimental:config.bzl", "MATERIAL_EXPERIMENTAL_ENTRYPOINTS", "MATERIAL_EXPERIMENTAL_TESTING_ENTRYPOINTS")
6-
load("@npm//:defs.bzl", "npm_link_all_packages")
78

89
package(default_visibility = ["//visibility:public"])
910

@@ -35,3 +36,8 @@ genrule(
3536
outs = ["entry_points_manifest.json"],
3637
cmd = "echo '%s' > $@" % entryPoints,
3738
)
39+
40+
validate_ts_version_matching(
41+
module_lock_file = "MODULE.bazel.lock",
42+
package_json = "package.json",
43+
)

MODULE.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ git_override(
3939
bazel_dep(name = "devinfra")
4040
git_override(
4141
module_name = "devinfra",
42-
commit = "80db036355181684ed07021a175e9f039190d3d6",
42+
commit = "7e2eefa1375195fa7616f78a76f538a188852067",
4343
remote = "https://github.com/angular/dev-infra.git",
4444
)
4545

@@ -51,7 +51,7 @@ rules_ts_ext.deps(
5151
name = "components_npm_typescript",
5252
# Obtained by: curl --silent https://registry.npmjs.org/typescript/5.9.2 | jq -r '.dist.integrity'
5353
ts_integrity = "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==",
54-
ts_version_from = "//:package.json",
54+
ts_version = "5.9.2",
5555
)
5656
use_repo(rules_ts_ext, **{"npm_typescript": "components_npm_typescript"})
5757

MODULE.bazel.lock

Lines changed: 3 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)