From 2262bd4180408f8a307a54bd52c52b7b1d67805e Mon Sep 17 00:00:00 2001 From: Joey Perrott Date: Fri, 5 Dec 2025 20:59:45 +0000 Subject: [PATCH] fix(bazel): correct typescript version validation logic Previously we were looking for the specific `npm_typescript` named repository to determine the version instead of looking for the most recently (and most locally) version for comparison. --- bazel/validation/verify-typescript.mjs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/bazel/validation/verify-typescript.mjs b/bazel/validation/verify-typescript.mjs index 4bce2e1f0..b33a97521 100644 --- a/bazel/validation/verify-typescript.mjs +++ b/bazel/validation/verify-typescript.mjs @@ -34,16 +34,15 @@ async function main([packageJsonPath, moduleLockFilePath]) { // the first value/item from the `generaredRepoSpecs` property and get the version from the // attributes there. const generatedRepoSpecs = + // TODO: Remove pre bazel v8 lockfile attribute path. moduleLock['moduleExtensions']?.['@@aspect_rules_ts~//ts:extensions.bzl%ext']?.['general']?.[ 'generatedRepoSpecs' + ] || + moduleLock['moduleExtensions']?.['@@aspect_rules_ts+//ts:extensions.bzl%ext']?.['general']?.[ + 'generatedRepoSpecs' ]; lockfileVersion = - // TODO: Remove pre bazel v8 lockfile attribute path. - Object.values(generatedRepoSpecs || {})[0]?.['attributes']?.['version'] || - moduleLock['moduleExtensions']['@@aspect_rules_ts+//ts:extensions.bzl%ext']['general'][ - 'generatedRepoSpecs' - ]['npm_typescript']?.['attributes']?.['version'] || - 'unknown'; + Object.values(generatedRepoSpecs || {})[0]?.['attributes']?.['version'] || 'unknown'; } catch { console.error('Unable to find the typescript version within the MODULE.bazel.lock file.'); }