perf(ci): use tsgo for sdk declaration emit

This commit is contained in:
Peter Steinberger
2026-04-22 04:39:17 +01:00
parent a197b544fe
commit 4d223950a0
3 changed files with 10 additions and 6 deletions

View File

@@ -5,7 +5,10 @@ import path, { resolve } from "node:path";
const require = createRequire(import.meta.url);
const repoRoot = resolve(import.meta.dirname, "..");
const tscBin = require.resolve("typescript/bin/tsc");
const tsgoBin = path.join(
path.dirname(require.resolve("@typescript/native-preview/package.json")),
"bin/tsgo.js",
);
const TYPE_INPUT_EXTENSIONS = new Set([".ts", ".tsx", ".d.ts", ".js", ".mjs", ".json"]);
const VALID_MODES = new Set(["all", "package-boundary"]);
@@ -268,7 +271,7 @@ export async function main(argv = process.argv.slice(2)) {
});
pendingSteps.push({
label: "plugin-sdk boundary dts",
args: [tscBin, "-p", "tsconfig.plugin-sdk.dts.json"],
args: [tsgoBin, "-p", "tsconfig.plugin-sdk.dts.json"],
timeoutMs: 300_000,
stampPath: ROOT_DTS_STAMP,
});
@@ -283,7 +286,7 @@ export async function main(argv = process.argv.slice(2)) {
});
pendingSteps.push({
label: "plugin-sdk package boundary dts",
args: [tscBin, "-p", "packages/plugin-sdk/tsconfig.json"],
args: [tsgoBin, "-p", "packages/plugin-sdk/tsconfig.json"],
timeoutMs: 300_000,
stampPath: PACKAGE_DTS_STAMP,
});

View File

@@ -37,8 +37,9 @@ const RUNTIME_SHIMS: Partial<Record<string, string>> = {
].join("\n"),
};
// `tsc` emits declarations under `dist/plugin-sdk/src/plugin-sdk/*` because the source lives
// at `src/plugin-sdk/*` and `rootDir` is `.` (repo root, to support cross-src/extensions refs).
// TypeScript declaration emit writes files under `dist/plugin-sdk/src/plugin-sdk/*` because the
// source lives at `src/plugin-sdk/*` and `rootDir` is `.` (repo root, to support
// cross-src/extensions refs).
//
// Our package export map points subpath `types` at `dist/plugin-sdk/<entry>.d.ts`, so we
// generate stable entry d.ts files that re-export the real declarations.