diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index 8696bcd..f79b656 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -223,15 +223,25 @@ jobs: - name: Checkout repository uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 - - name: Run the panel frontend test suite + # One `npm ci` for both checks below: it is by far the slowest part of + # this job, and a second one would learn nothing the first did not. + # + # `npm ci`, not `npm install`, for the same reason the Dockerfile uses it: + # the lockfile is what makes the tree that gets checked the tree that + # gets shipped. + - name: Type-check and test the panel frontend shell: bash run: | set -euo pipefail cd userbot/panel/frontend - # `npm ci`, not `npm install`, for the same reason the Dockerfile - # uses it: the lockfile is what makes the tree that gets tested the - # tree that gets shipped. npm ci + + # svelte-check has been a devDependency all along with no script + # pointing at it, so the type errors it reports had nowhere to + # surface. It is clean today, which is the only reason it can be a + # gate: it stops at whatever upstream introduces rather than + # reporting a backlog we inherited. + npm run check npm test validate: diff --git a/userbot/panel/frontend/package.json b/userbot/panel/frontend/package.json index 9c30d10..97a0d3a 100644 --- a/userbot/panel/frontend/package.json +++ b/userbot/panel/frontend/package.json @@ -6,7 +6,8 @@ "scripts": { "build": "vite build", "dev": "vite --host 0.0.0.0", - "test": "vitest run" + "test": "vitest run", + "check": "svelte-check --tsconfig ./tsconfig.json" }, "dependencies": { "lucide-svelte": "^0.468.0",