mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
build: define typescript version via string in module.bazel file (#63431)
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. PR Close #63431
This commit is contained in:
committed by
Jessica Janiuk
parent
b2ed21b642
commit
7ccf368236
+6
-1
@@ -1,4 +1,5 @@
|
||||
load("@aspect_rules_js//js:defs.bzl", "js_library")
|
||||
load("@devinfra//bazel/validation:defs.bzl", "validate_ts_version_matching")
|
||||
load("@npm//:defs.bzl", "npm_link_all_packages")
|
||||
load("//:yarn.bzl", "YARN_PATH")
|
||||
load("//tools:defaults.bzl", "copy_to_bin", "js_binary")
|
||||
@@ -11,7 +12,6 @@ exports_files([
|
||||
"browser-providers.conf.js",
|
||||
YARN_PATH,
|
||||
"package.json",
|
||||
"angular.json",
|
||||
])
|
||||
|
||||
npm_link_all_packages(
|
||||
@@ -25,6 +25,11 @@ filegroup(
|
||||
srcs = ["package.json"],
|
||||
)
|
||||
|
||||
validate_ts_version_matching(
|
||||
module_lock_file = "MODULE.bazel.lock",
|
||||
package_json = "package.json",
|
||||
)
|
||||
|
||||
alias(
|
||||
name = "tsconfig.json",
|
||||
actual = "//packages:tsconfig-build.json",
|
||||
|
||||
+1
-1
@@ -104,7 +104,7 @@ rules_ts_ext.deps(
|
||||
name = "angular_npm_typescript",
|
||||
# Obtained by: curl --silent https://registry.npmjs.org/typescript/5.9.2 | jq -r '.dist.integrity'
|
||||
ts_integrity = "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==",
|
||||
ts_version_from = "//:package.json",
|
||||
ts_version = "5.9.2",
|
||||
)
|
||||
use_repo(rules_ts_ext, **{"npm_typescript": "angular_npm_typescript"})
|
||||
|
||||
|
||||
Generated
+2
-4
@@ -545,9 +545,8 @@
|
||||
"@@aspect_rules_ts~//ts:extensions.bzl%ext": {
|
||||
"general": {
|
||||
"bzlTransitiveDigest": "9IJp6IlB/FMHFBJe4MX/DQM4zi3oArC8yqYE/+NyPwk=",
|
||||
"usagesDigest": "VEukiyPNBCfwTk3eLa/G6XI3Kv7diVRz/46ULqKcb78=",
|
||||
"usagesDigest": "dQksgKjptt43p6K/aEOYjcWKS47HbtBzBSMhEYqUYts=",
|
||||
"recordedFileInputs": {
|
||||
"@@//package.json": "424408e31cbc2ea0d8c16641b88b5be7b14a79fd714b0865a3077debed50d04a",
|
||||
"@@rules_browsers~//package.json": "45572077938c7a4916e4aaedf7db7ce8425854ab92f35348cff02a2134023bb8"
|
||||
},
|
||||
"recordedDirentsInputs": {},
|
||||
@@ -557,8 +556,7 @@
|
||||
"bzlFile": "@@aspect_rules_ts~//ts/private:npm_repositories.bzl",
|
||||
"ruleClassName": "http_archive_version",
|
||||
"attributes": {
|
||||
"version": "",
|
||||
"version_from": "@@//:package.json",
|
||||
"version": "5.9.2",
|
||||
"integrity": "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==",
|
||||
"urls": [
|
||||
"https://registry.npmjs.org/typescript/-/typescript-{}.tgz"
|
||||
|
||||
Reference in New Issue
Block a user