chore(ci): pin TypeScript og kjør typecheck som gate
G0-P0. typecheck-all.ts kjørte 'bunx tsc', som henter nyeste utgivelse ved hver kjøring — gaten kunne gå rød, eller stille slutte å fange ting, fordi TypeScript hadde sluppet en versjon og ikke fordi repoet endret seg. typescript pinnet til 7.0.2; scriptet bruker node_modules/.bin/tsc. Nytt Typecheck-steg i test.yml, plassert FØR testene: en typefeil er billigere å lese enn kjøretidsfeilen den til slutt forårsaker. Helsesjekkens antakelse om baseUrl stemmer ikke lenger — feltet finnes ikke i repoet, og alle 26 pakker er grønne inkludert consumer-strict. dist-build/ lagt i .gitignore (observer-avviket fra G0). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -18,6 +18,16 @@ import { readdirSync, statSync, existsSync } from 'fs';
|
||||
import { join } from 'path';
|
||||
import { $ } from 'bun';
|
||||
|
||||
|
||||
/**
|
||||
* The pinned compiler, not whatever `bunx` resolves today.
|
||||
*
|
||||
* `bunx tsc` fetches the newest release on every run, so this gate could go
|
||||
* red — or, worse, quietly stop catching things — because TypeScript shipped,
|
||||
* not because the repo changed. The version is pinned in devDependencies and
|
||||
* resolved from node_modules here.
|
||||
*/
|
||||
const TSC = join(import.meta.dir, '..', 'node_modules', '.bin', 'tsc');
|
||||
const ROOT = join(import.meta.dir, '..');
|
||||
const PACKAGES_DIR = join(ROOT, 'packages');
|
||||
|
||||
@@ -38,7 +48,7 @@ const failed: { pkg: string; out: string }[] = [];
|
||||
|
||||
for (const pkg of packages) {
|
||||
const dir = join(PACKAGES_DIR, pkg);
|
||||
const proc = Bun.spawnSync(['bunx', 'tsc', '--noEmit', '-p', 'tsconfig.json'], {
|
||||
const proc = Bun.spawnSync([TSC, '--noEmit', '-p', 'tsconfig.json'], {
|
||||
cwd: dir,
|
||||
stdout: 'pipe',
|
||||
stderr: 'pipe',
|
||||
@@ -73,7 +83,7 @@ if (filter.size === 0) {
|
||||
console.log('Consumer-strict smoke (lib: DOM, exactOptional, paths→workspace) ...');
|
||||
const consumerDir = join(ROOT, 'tests', 'consumer-strict');
|
||||
if (existsSync(join(consumerDir, 'tsconfig.json'))) {
|
||||
const proc = Bun.spawnSync(['bunx', 'tsc', '--noEmit', '-p', 'tsconfig.json'], {
|
||||
const proc = Bun.spawnSync([TSC, '--noEmit', '-p', 'tsconfig.json'], {
|
||||
cwd: consumerDir,
|
||||
stdout: 'pipe',
|
||||
stderr: 'pipe',
|
||||
|
||||
Reference in New Issue
Block a user