From d447095bd74ef98579c4df1eb98d75c28d6df05e Mon Sep 17 00:00:00 2001 From: Mikael Hugo Date: Sun, 10 May 2026 11:58:58 +0200 Subject: [PATCH] build: switch full build pipeline to TypeScript 7 native (tsgo) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace tsc with tsgo in all build scripts — 5.6x faster emit. tsgo has full emit parity for this codebase (NodeNext, ES2022, strict). - build:core: tsc → tsgo (root tsconfig.json) - copy-resources.cjs: typescript/bin/tsc → @typescript/native-preview/bin/tsgo.js - All workspace packages (agent-core, ai, coding-agent, daemon, google-gemini-cli-provider, native, rpc-client, tui): tsc → tsgo Benchmarks (root project): tsc --project tsconfig.json: 7.7s tsgo --project tsconfig.json: 1.4s (5.6x faster) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- package.json | 2 +- packages/agent-core/package.json | 2 +- packages/ai/package.json | 2 +- packages/coding-agent/package.json | 2 +- packages/daemon/package.json | 2 +- packages/google-gemini-cli-provider/package.json | 2 +- packages/native/package.json | 2 +- packages/rpc-client/package.json | 2 +- packages/tui/package.json | 2 +- scripts/copy-resources.cjs | 4 ++-- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index a4dfe2c5d..fb34140ee 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "build:google-gemini-cli-provider": "npm --workspace @singularity-forge/google-gemini-cli-provider run build", "build:pi": "npm run build:native-pkg && npm run build:pi-tui && npm run build:google-gemini-cli-provider && npm run build:pi-ai && npm run build:pi-agent-core && npm run build:pi-coding-agent", "build:daemon": "npm --workspace @singularity-forge/daemon run build", - "build:core": "npm run build:pi && npm run build:rpc-client && npm run build:daemon && npm run check:versioned-json && tsc && npm run copy-resources && npm run copy-themes && npm run copy-export-html", + "build:core": "npm run build:pi && npm run build:rpc-client && npm run build:daemon && npm run check:versioned-json && tsgo && npm run copy-resources && npm run copy-themes && npm run copy-export-html", "build": "npm run build:core && node scripts/build-web-if-stale.cjs", "stage:web-host": "node scripts/stage-web-standalone.cjs", "build:web-host": "npm --prefix web run build && npm run stage:web-host", diff --git a/packages/agent-core/package.json b/packages/agent-core/package.json index f39ee8671..bf0598725 100644 --- a/packages/agent-core/package.json +++ b/packages/agent-core/package.json @@ -12,7 +12,7 @@ } }, "scripts": { - "build": "tsc -p tsconfig.json" + "build": "tsgo -p tsconfig.json" }, "dependencies": {}, "engines": { diff --git a/packages/ai/package.json b/packages/ai/package.json index c5c29fe3c..234f4a358 100644 --- a/packages/ai/package.json +++ b/packages/ai/package.json @@ -20,7 +20,7 @@ } }, "scripts": { - "build": "tsc -p tsconfig.json" + "build": "tsgo -p tsconfig.json" }, "dependencies": { "@anthropic-ai/sdk": "^0.95.1", diff --git a/packages/coding-agent/package.json b/packages/coding-agent/package.json index d3e2350d9..5d4922d2e 100644 --- a/packages/coding-agent/package.json +++ b/packages/coding-agent/package.json @@ -16,7 +16,7 @@ } }, "scripts": { - "build": "tsc -p tsconfig.json && npm run copy-assets", + "build": "tsgo -p tsconfig.json && npm run copy-assets", "copy-assets": "node scripts/copy-assets.cjs" }, "dependencies": { diff --git a/packages/daemon/package.json b/packages/daemon/package.json index 50bf1a119..19df5f251 100644 --- a/packages/daemon/package.json +++ b/packages/daemon/package.json @@ -25,7 +25,7 @@ "sf-server": "./dist/cli.js" }, "scripts": { - "build": "tsc", + "build": "tsgo", "test": "vitest run packages/daemon/src --root ../.. --config vitest.config.ts" }, "dependencies": { diff --git a/packages/google-gemini-cli-provider/package.json b/packages/google-gemini-cli-provider/package.json index 47123796a..8abab0839 100644 --- a/packages/google-gemini-cli-provider/package.json +++ b/packages/google-gemini-cli-provider/package.json @@ -12,7 +12,7 @@ } }, "scripts": { - "build": "tsc -p tsconfig.json" + "build": "tsgo -p tsconfig.json" }, "dependencies": { "@google/gemini-cli-core": "0.41.2" diff --git a/packages/native/package.json b/packages/native/package.json index 07a01e0be..714320a52 100644 --- a/packages/native/package.json +++ b/packages/native/package.json @@ -6,7 +6,7 @@ "main": "./dist/index.js", "types": "./dist/index.d.ts", "scripts": { - "build": "tsc -p tsconfig.json", + "build": "tsgo -p tsconfig.json", "build:native": "node ../../rust-engine/scripts/build.js", "build:native:dev": "node ../../rust-engine/scripts/build.js --dev", "test": "npm run build:native:dev && node --test src/__tests__/grep.test.mjs src/__tests__/ps.test.mjs src/__tests__/glob.test.mjs src/__tests__/clipboard.test.mjs src/__tests__/highlight.test.mjs src/__tests__/html.test.mjs src/__tests__/text.test.mjs src/__tests__/fd.test.mjs src/__tests__/image.test.mjs src/__tests__/edit.test.mjs src/__tests__/symbol.test.mjs src/__tests__/watch.test.mjs" diff --git a/packages/rpc-client/package.json b/packages/rpc-client/package.json index b8e12c224..bdb1c4156 100644 --- a/packages/rpc-client/package.json +++ b/packages/rpc-client/package.json @@ -25,7 +25,7 @@ "!dist/**/*.test.*" ], "scripts": { - "build": "tsc -p tsconfig.json", + "build": "tsgo -p tsconfig.json", "test": "node --test dist/rpc-client.test.js" }, "engines": { diff --git a/packages/tui/package.json b/packages/tui/package.json index c5a926314..7c95aecbc 100644 --- a/packages/tui/package.json +++ b/packages/tui/package.json @@ -13,7 +13,7 @@ } }, "scripts": { - "build": "tsc -p tsconfig.json" + "build": "tsgo -p tsconfig.json" }, "dependencies": { "chalk": "^5.6.2", diff --git a/scripts/copy-resources.cjs b/scripts/copy-resources.cjs index 4edce2fb3..65189ebfc 100644 --- a/scripts/copy-resources.cjs +++ b/scripts/copy-resources.cjs @@ -75,10 +75,10 @@ function hasTsFilesRecursive(dir) { const hasTsFiles = hasTsFilesRecursive(srcResources); if (hasTsFiles) { - const tscBin = require.resolve("typescript/bin/tsc"); + const tsgoBin = require.resolve("@typescript/native-preview/bin/tsgo.js"); const compile = spawnSync( process.execPath, - [tscBin, "--project", resourcesTsconfig], + [tsgoBin, "--project", resourcesTsconfig], { cwd: root, stdio: "inherit",