From f72903d05dab130c976ecb84feeca7176bf2c83d Mon Sep 17 00:00:00 2001 From: jochen Date: Fri, 9 Oct 2026 03:23:01 +0200 Subject: [PATCH] A TypeScript module with tests and no sources of its own is tested, not skipped powerlevel10k carries only data and a test that reads it; the part skipped it silently. --- merge-check-typescript.sh | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/merge-check-typescript.sh b/merge-check-typescript.sh index b6885c42..de5aa5a0 100644 --- a/merge-check-typescript.sh +++ b/merge-check-typescript.sh @@ -63,24 +63,27 @@ for m in $touched; do cp -r "$p" "$copy/node_modules/" done sources=$(cd "$copy" && find . -name '*.ts' ! -name '*.d.ts' ! -path './test/*' ! -path './node_modules/*' ! -path './dist/*' | sort) - if [ -z "$sources" ]; then - continue - fi - echo "type-checking $d (TypeScript)" - # shellcheck disable=SC2086 # the module's sources, none with a space in its name - if ! (cd "$copy" && node "$tsc" --noEmit --module NodeNext --moduleResolution NodeNext --target ES2022 \ - --types node $sources); then - failed="$failed $m" - continue + if [ -n "$sources" ]; then + echo "type-checking $d (TypeScript)" + # shellcheck disable=SC2086 # the module's sources, none with a space in its name + if ! (cd "$copy" && node "$tsc" --noEmit --module NodeNext --moduleResolution NodeNext --target ES2022 \ + --types node $sources); then + failed="$failed $m" + continue + fi + else + echo "$d has no TypeScript sources of its own to type-check: its tests read its files" fi if ! ls "$copy"/test/*.test.ts >/dev/null 2>&1; then echo "NOT TESTED: $d is TypeScript and has no tests of its own" continue fi - # shellcheck disable=SC2086 - (cd "$copy" && node "$tsc" --module NodeNext --moduleResolution NodeNext --target ES2022 --types node \ - --rootDir . --outDir dist $sources && node "$tsc" --module NodeNext --moduleResolution NodeNext \ - --target ES2022 --types node --rootDir . --outDir . $sources) + if [ -n "$sources" ]; then + # shellcheck disable=SC2086 + (cd "$copy" && node "$tsc" --module NodeNext --moduleResolution NodeNext --target ES2022 --types node \ + --rootDir . --outDir dist $sources && node "$tsc" --module NodeNext --moduleResolution NodeNext \ + --target ES2022 --types node --rootDir . --outDir . $sources) + fi echo "testing $d (TypeScript)" if ! (cd "$copy" && node --test --test-reporter=spec --experimental-strip-types \ --no-warnings=ExperimentalWarning test/*.test.ts); then