Repository navigation
Expand file tree
/
Copy pathjustfile
More file actions
101 lines (84 loc) · 3.26 KB
/
Copy pathjustfile
File metadata and controls
101 lines (84 loc) · 3.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# justfile — Build, test, and lint the TunaOS docs site (Docusaurus)
# Wraps the npm scripts in package.json; test/lint mirror the checks CI
# runs in .github/workflows/lint.yml.
# ── Configuration ───────────────────────────────────────────────────────
default:
@just --list
# ── Setup & build ──────────────────────────────────────────────────────
# Install dependencies (same as bootstrap.yml)
install:
npm ci
# Build the static site into build/
build:
npm run build
# Start the local development server with hot reload
start:
npm run start
# Serve the built site (after just build)
serve:
npm run serve
# Typecheck the TypeScript sources (tsconfig.json)
typecheck:
npm run typecheck
# Alias for typecheck
check: typecheck
# ── Checks (mirror .github/workflows/lint.yml) ─────────────────────────
# Run the Node.js unit tests for scripts/
test:
#!/usr/bin/env bash
set -euo pipefail
FAILED=0
for f in scripts/__tests__/*.test.mjs; do
[[ -f "$f" ]] || continue
echo " Running: $f"
node "$f" || FAILED=1
done
exit $FAILED
# Run standalone repository checks.
checks:
#!/usr/bin/env bash
set -euo pipefail
for f in scripts/checks/*.mjs; do
[[ -f "$f" ]] || continue
node "$f"
done
# Run the Flatpak Python unit tests (install .github/scripts/tests/requirements.txt first)
test-python:
python3 -m pytest .github/scripts/tests/ -v
# Lint markdown and Node.js scripts, and enforce the STE budget.
# Needs markdownlint-cli (npm install -g markdownlint-cli), like lint.yml.
lint:
#!/usr/bin/env bash
set -euo pipefail
markdownlint 'docs/**/*.md' '*.md' \
--ignore docs/docs/tacklebox \
--disable MD013 MD033 MD041 || \
echo "NOTE: markdownlint found issues — review and fix"
FAILED=0
for f in scripts/*.mjs scripts/*.js scripts/lib/*.mjs scripts/checks/*.mjs scripts/__tests__/*.test.mjs; do
[[ -f "$f" ]] || continue
echo " Checking: $f"
node --check "$f" 2>/dev/null || FAILED=1
done
just ste
exit $FAILED
# Simplified Technical English check. The linter lives in tuna-os/.github and
# is shared by every repo in the org, so it is fetched rather than vendored --
# a second copy here is a copy that drifts. Cached between runs; delete the
# cache directory to force a refresh.
ste:
#!/usr/bin/env bash
set -euo pipefail
src=https://raw.githubusercontent.com/tuna-os/.github/main/.github/actions/ste-lint
dir="${XDG_CACHE_HOME:-$HOME/.cache}/tuna-os/ste-lint"
mkdir -p "$dir"
for f in ste-lint.mjs ste-rules.mjs; do
[ -f "$dir/$f" ] || curl -fsSL "$src/$f" -o "$dir/$f"
done
node "$dir/ste-lint.mjs" --summary
node "$dir/ste-lint.mjs" --max "$(cat .ste-budget)" >/dev/null
# Verify package names used in documented Homebrew install commands.
check-install-commands:
node scripts/check-install-commands.mjs
# Run the checks CI runs on PRs
preflight: check lint test checks test-python check-install-commands