This commit is contained in:
leokun
2026-06-30 10:38:52 +08:00
commit c083be5ec2
312 changed files with 146628 additions and 0 deletions
@@ -0,0 +1,15 @@
#!/usr/bin/env bash
# Run vitest with any additional arguments passed after --
npx vitest run --config vitest.config.ts "$@"
# Capture the exit code
exit_code=$?
# If tests failed, echo the colored error message
if [ $exit_code -ne 0 ]; then
echo -e "\033[1;31m❌ Test failed -- you can set CURSOR_EXT_TEST_LOG_LEVEL=info to see more logs\033[0m"
fi
# Exit with the same code as vitest
exit $exit_code
@@ -0,0 +1,29 @@
#!/bin/bash
include_files=()
for f in "$@"; do
include_files+=("${f#$PWD/}")
done
node_modules/.bin/tsc --noEmit -p . | (
status=0
show_continuation=false
while IFS='' read -r line; do
case "$line" in
(' '*)
if $show_continuation; then
echo "$line" >&2
fi
;;
(*)
file="${line%%(*}"
if [[ " ${include_files[@]} " =~ " ${file} " ]]; then
show_continuation=true
echo "$line" >&2
status=1
else
show_continuation=false
fi
;;
esac
done
exit $status
)