mirror of
https://github.com/saltbo/zpan.git
synced 2026-08-29 08:16:58 +08:00
b92df828ab
* ci: parallelize and isolate test suites * ci: avoid unavailable Playwright video runtime * ci: shard coverage and cache docker smoke * ci: balance Playwright shards by test * ci: smoke test the CLI container * ci: enforce merged coverage thresholds * ci: ratchet canonical coverage baseline * ci: make coverage ratchet lossless * ci: organize parallel gates by responsibility * perf(ci): reduce total runner time * perf(ci): balance runner cost and latency * perf(ci): suppress passing test logs * fix(test): make coverage sorting proof deterministic * perf(docker): exclude test-only build inputs * perf(ci): scope Docker smokes to packaging changes * refactor(test): enforce fast test boundaries * test: isolate coverage ownership * perf(test): run backend projects concurrently * perf(ci): separate test layers by runtime * perf(test): separate integration boundaries * perf(ci): prioritize test runners * docs(ci): clarify package scheduling * test: restore shared Cloudflare mocks * fix(preview): isolate Cloudflare E2E build config * fix(auth): bind preview sessions to request origin * revert: remove ineffective preview auth workaround * fix(auth): stop signing JWTs on session reads
24 lines
885 B
JavaScript
24 lines
885 B
JavaScript
import { spawn } from 'node:child_process'
|
|
import { createRequire } from 'node:module'
|
|
|
|
const require = createRequire(import.meta.url)
|
|
const tsc = require.resolve('typescript/bin/tsc')
|
|
const projects = ['server/tsconfig.json', 'src/tsconfig.json']
|
|
const results = await Promise.all(projects.map(runTypecheck))
|
|
const failures = results.filter(({ code }) => code !== 0)
|
|
|
|
if (failures.length > 0) {
|
|
throw new Error(`Typecheck failed: ${failures.map(({ project }) => project).join(', ')}`)
|
|
}
|
|
|
|
function runTypecheck(project) {
|
|
return new Promise((resolve, reject) => {
|
|
const child = spawn(process.execPath, [tsc, '--noEmit', '-p', project], { stdio: 'inherit' })
|
|
child.on('error', reject)
|
|
child.on('exit', (code, signal) => {
|
|
if (signal) reject(new Error(`Typecheck terminated by ${signal}: ${project}`))
|
|
else resolve({ project, code: code ?? 1 })
|
|
})
|
|
})
|
|
}
|