@sablier/devkit 1.2.3 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/just/base.just +10 -3
- package/just/tsv.just +42 -36
- package/package.json +1 -1
package/just/base.just
CHANGED
|
@@ -48,13 +48,20 @@ alias tb := tsc-build
|
|
|
48
48
|
# CHECKS #
|
|
49
49
|
# ---------------------------------------------------------------------------- #
|
|
50
50
|
|
|
51
|
-
# Check code with Biome
|
|
51
|
+
# Check code with Biome - runs both the checker and the linter
|
|
52
52
|
[group("checks")]
|
|
53
53
|
[no-cd]
|
|
54
54
|
@biome-check +globs=".":
|
|
55
55
|
na biome check {{ globs }}
|
|
56
56
|
alias bc := biome-check
|
|
57
57
|
|
|
58
|
+
# Lint code with Biome
|
|
59
|
+
[group("checks")]
|
|
60
|
+
[no-cd]
|
|
61
|
+
@biome-lint +globs=".":
|
|
62
|
+
na biome lint {{ globs }}
|
|
63
|
+
alias bl := biome-lint
|
|
64
|
+
|
|
58
65
|
# Fix code with Biome
|
|
59
66
|
# The `noUnusedImports` rule is disabled by default to allow unused imports during development
|
|
60
67
|
[group("checks")]
|
|
@@ -72,7 +79,7 @@ alias bw := biome-write
|
|
|
72
79
|
just _run-with-status prettier-check
|
|
73
80
|
just _run-with-status tsc-check
|
|
74
81
|
echo ""
|
|
75
|
-
echo '{{ GREEN }}
|
|
82
|
+
echo '{{ GREEN }}All code checks passed!{{ NORMAL }}'
|
|
76
83
|
alias fc := full-check
|
|
77
84
|
|
|
78
85
|
# Run all code fixes
|
|
@@ -82,7 +89,7 @@ alias fc := full-check
|
|
|
82
89
|
just _run-with-status biome-write
|
|
83
90
|
just _run-with-status prettier-write
|
|
84
91
|
echo ""
|
|
85
|
-
echo '{{ GREEN }}
|
|
92
|
+
echo '{{ GREEN }}All code fixes applied!{{ NORMAL }}'
|
|
86
93
|
alias fw := full-write
|
|
87
94
|
|
|
88
95
|
# Run knip checks
|
package/just/tsv.just
CHANGED
|
@@ -7,7 +7,7 @@ import "./settings.just"
|
|
|
7
7
|
# Check TSV files using qsv: https://github.com/dathere/qsv
|
|
8
8
|
[group("checks")]
|
|
9
9
|
[script]
|
|
10
|
-
_tsv-check globs="data/*/*.tsv" schema="":
|
|
10
|
+
_tsv-check globs="data/*/*.tsv" schema="" ignore="*.tsv.invalid|*.tsv.valid|*validation-errors.tsv":
|
|
11
11
|
if ! command -v qsv >/dev/null 2>&1; then
|
|
12
12
|
echo "✗ qsv CLI not found"
|
|
13
13
|
echo "Install it: https://github.com/dathere/qsv"
|
|
@@ -19,7 +19,7 @@ _tsv-check globs="data/*/*.tsv" schema="":
|
|
|
19
19
|
for file in {{ globs }}; do
|
|
20
20
|
# Skip validation artifact files
|
|
21
21
|
case "$file" in
|
|
22
|
-
|
|
22
|
+
{{ ignore }})
|
|
23
23
|
continue
|
|
24
24
|
;;
|
|
25
25
|
esac
|
|
@@ -31,40 +31,7 @@ _tsv-check globs="data/*/*.tsv" schema="":
|
|
|
31
31
|
schema_arg="{{ schema }}"
|
|
32
32
|
if ! qsv validate "$file" ${schema_arg:+"$schema_arg"} > /dev/null 2>&1; then
|
|
33
33
|
echo "❌ Validation failed for: $file"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
if [ -f "$error_file" ]; then
|
|
37
|
-
# Try to count total errors (subtract 1 for header row)
|
|
38
|
-
total_errors=$(qsv count "$error_file" 2>/dev/null || echo "0")
|
|
39
|
-
if [ "$total_errors" != "0" ]; then
|
|
40
|
-
total_errors=$((total_errors - 1))
|
|
41
|
-
fi
|
|
42
|
-
|
|
43
|
-
echo ""
|
|
44
|
-
if [ "$total_errors" != "0" ] && [ "$total_errors" -gt 0 ]; then
|
|
45
|
-
echo "First 20 validation errors (${total_errors} total):"
|
|
46
|
-
else
|
|
47
|
-
echo "Validation errors:"
|
|
48
|
-
fi
|
|
49
|
-
echo ""
|
|
50
|
-
|
|
51
|
-
# Try to use qsv table for nice formatting, fall back to basic display
|
|
52
|
-
if qsv slice --start 0 --len 21 "$error_file" 2>/dev/null | qsv table 2>/dev/null; then
|
|
53
|
-
: # Success, output already shown
|
|
54
|
-
else
|
|
55
|
-
head -n 21 "$error_file"
|
|
56
|
-
fi
|
|
57
|
-
|
|
58
|
-
if [ "$total_errors" != "0" ] && [ "$total_errors" -gt 20 ]; then
|
|
59
|
-
echo ""
|
|
60
|
-
echo "... and $((total_errors - 20)) more errors"
|
|
61
|
-
fi
|
|
62
|
-
echo ""
|
|
63
|
-
echo "Full details: $error_file"
|
|
64
|
-
else
|
|
65
|
-
echo "Error file not found: $error_file"
|
|
66
|
-
fi
|
|
67
|
-
|
|
34
|
+
just _tsv-show-errors "$file"
|
|
68
35
|
exit 1
|
|
69
36
|
fi
|
|
70
37
|
done
|
|
@@ -74,3 +41,42 @@ _tsv-check globs="data/*/*.tsv" schema="":
|
|
|
74
41
|
else
|
|
75
42
|
echo "✅ All TSV files are valid"
|
|
76
43
|
fi
|
|
44
|
+
|
|
45
|
+
# Show validation errors for a TSV file
|
|
46
|
+
[group("checks")]
|
|
47
|
+
[script]
|
|
48
|
+
_tsv-show-errors file:
|
|
49
|
+
error_file="{{ file }}.validation-errors.tsv"
|
|
50
|
+
|
|
51
|
+
if [ ! -f "$error_file" ]; then
|
|
52
|
+
echo "Error file not found: $error_file"
|
|
53
|
+
exit 0
|
|
54
|
+
fi
|
|
55
|
+
|
|
56
|
+
# Try to count total errors (subtract 1 for header row)
|
|
57
|
+
total_errors=$(qsv count "$error_file" 2>/dev/null || echo "0")
|
|
58
|
+
if [ "$total_errors" != "0" ]; then
|
|
59
|
+
total_errors=$((total_errors - 1))
|
|
60
|
+
fi
|
|
61
|
+
|
|
62
|
+
echo ""
|
|
63
|
+
if [ "$total_errors" != "0" ] && [ "$total_errors" -gt 0 ]; then
|
|
64
|
+
echo "First 20 validation errors (${total_errors} total):"
|
|
65
|
+
else
|
|
66
|
+
echo "Validation errors:"
|
|
67
|
+
fi
|
|
68
|
+
echo ""
|
|
69
|
+
|
|
70
|
+
# Try to use qsv table for nice formatting, fall back to basic display
|
|
71
|
+
if qsv slice --start 0 --len 21 "$error_file" 2>/dev/null | qsv table 2>/dev/null; then
|
|
72
|
+
: # Success, output already shown
|
|
73
|
+
else
|
|
74
|
+
head -n 21 "$error_file"
|
|
75
|
+
fi
|
|
76
|
+
|
|
77
|
+
if [ "$total_errors" != "0" ] && [ "$total_errors" -gt 20 ]; then
|
|
78
|
+
echo ""
|
|
79
|
+
echo "... and $((total_errors - 20)) more errors"
|
|
80
|
+
fi
|
|
81
|
+
echo ""
|
|
82
|
+
echo "Full details: $error_file"
|
package/package.json
CHANGED