ci: the acceptance jobs run bun install before packing (prepack builds the package's declarations with the pinned TypeScript; without node_modules npm pack failed and every acceptance cell went red on 5ed787a); build-node names the missing install instead of a bare ENOENT

This commit is contained in:
CRTkafa 2026-10-15 06:33:01 +08:00
parent 5ed787a8ca
commit d72b199645
3 changed files with 9 additions and 0 deletions

View file

@ -41,6 +41,7 @@ export function buildNode(out = NODE_BUNDLE): { path: string; bytes: number } {
export function buildEntry(dir = join(ROOT, 'dist')): void {
const types = join(dir, 'types');
rmSync(types, { recursive: true, force: true });
if (!statSync(join(ROOT, 'node_modules', '.bin', 'tsc'), { throwIfNoEntry: false })) throw new Error('no TypeScript in node_modules: run `bun install` first (npm pack builds the declarations with it)');
const tsc = Bun.spawnSync([join(ROOT, 'node_modules', '.bin', 'tsc'), '-p', 'tsconfig.types.json', '--outDir', types], { cwd: ROOT, stdout: 'pipe', stderr: 'pipe' });
if (tsc.exitCode !== 0) throw new Error(`tsc (declarations) failed\n${tsc.stdout.toString()}${tsc.stderr.toString()}`);
if (!statSync(join(types, 'lib', 'config.d.ts'), { throwIfNoEntry: false })) throw new Error('no dist/types/lib/config.d.ts');