Lines 3671-3711javascript
3671 const content = renderRegionTsconfig(cwd, cfg, region);
3672 const out = resolve9(cwd, cfg.tsconfig);
3673 writeFileSync5(out, content);
3675 writeFileSync5(resolve9(cwd, applyTo), content);
3676 return { generated: out, applied: resolve9(cwd, applyTo) };
3678 return { generated: out };
3680function resetTsconfig(cwd, path) {
3681 const rel = relative2(cwd, resolve9(cwd, path));
3682 const show = spawnSync("git", ["show", `HEAD:./${rel}`], {
3686 if (show.status !== 0) {
3687 throw new RegionError(`Cannot restore "${rel}" from git HEAD: ${show.stderr.trim() || "not a tracked file?"}`);
3689 writeFileSync5(resolve9(cwd, path), show.stdout);
3691function runRegionCheck(cwd, cfg, runner = (p) => {
3692 const r4 = spawnSync("bunx", ["tsc", "--noEmit", "-p", p], {
3693 cwd,
HighRuntime Package Install
Package source invokes a package manager install command at runtime.
dist/index.jsView on unpkg · L3691 3696 return { ok: r4.status === 0, output: `${r4.stdout ?? ""}${r4.stderr ?? ""}` };
3699 for (const region of discoverRegions(cwd, cfg)) {
3700 writeRegionTsconfig(cwd, cfg, region);
3701 const { ok, output } = runner(resolve9(cwd, cfg.tsconfig));
3702 results.push({ region, ok, output });
3707// src/commands/region.ts
3708var regionCommand = defineCommand({
3711 description: "Region-scoped type programs: generate a tsconfig containing ONLY the selected region (mirror of the build-time region alias swap)"