also looking at this
fix(ci): build the SDK types with the repo's own tsc (and pin the pantry action)
#104
29 files
+85
-56
| @@ -0,0 +1,21 @@ | ||
| 1 | /** | |
| 2 | * Run the `tsc` this package declares, not the one on PATH. | |
| 3 | * | |
| 4 | * `bunx tsc` resolves through PATH. In CI the pantry action provisions its own | |
| 5 | * typescript into `<repo>/pantry` and puts it ahead of `node_modules/.bin`, so | |
| 6 | * the same command silently ran a different compiler — a dev build the | |
| 7 | * lockfile never pinned, and one whose linux-x64 platform binary is missing: | |
| 8 | * | |
| 9 | * Error: Unable to resolve @typescript/typescript-linux-x64. | |
| 10 | * | |
| 11 | * Locally nothing shadows `node_modules/.bin`, which is why the break only | |
| 12 | * ever showed up in one CI job. Resolving through the module graph instead of | |
| 13 | * PATH makes both places run the version `bun.lock` says. | |
| 14 | */ | |
| 15 | import { dirname, join } from 'node:path' | |
| 16 | ||
| 17 | const pkgRoot = dirname(dirname(Bun.resolveSync('typescript', import.meta.dir))) | |
| 18 | const tsc = join(pkgRoot, 'bin', 'tsc') | |
| 19 | ||
| 20 | const proc = Bun.spawn(['bun', tsc, ...Bun.argv.slice(2)], { stdio: ['inherit', 'inherit', 'inherit'] }) | |
| 21 | process.exit(await proc.exited) | |