@devries-cameron20 / t3code Mirror · read-only / commits / ed9b7ca9c5
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 22, 19:30 UTC

fix(build): pin Node 26.12.1 for development and standalone releases (#23165)

Alex committed Oct 21, 2026 at 17:16 UTC ed9b7ca9c53843ea1e6b466bf7d52928d10e7db0
5 files changed +15 -13
.github/workflows/release-desktop.yml
+3 -8
@@ -253,18 +253,13 @@ jobs:
253 if [[ "${{ inputs.version }}" =~ -nightly\.[0-9]{8}\.[0-9]+$ ]]; then brand=nightly; fi
254 node scripts/apply-web-brand-assets.ts "$brand" apps/server/dist/client
255
256 - # The single-executable is built with a Node that supports --build-sea
257 - # (25.7+); the repo itself stays on the engines.node version. A native
258 - # build injects into the runner's own Node; a Windows target downloads its
259 - # node.exe.
256 + # Setup Vite+ selects the exact engines.node version from package.json.
257 + # Native builds embed that executable; cross-target builds download the
258 + # same version for their target.
259 - name: Build CLI single-executable
260 if: inputs.cli_archive
261 shell: bash
262 env:
264 - # The exact version, not a major: vp downloads it from nodejs.org/dist on
265 - # the runner, and only exact versions have a dist directory. Keep in
266 - # step with SEA_NODE_VERSION in apps/server/vite.config.ts.
267 - VP_NODE_VERSION: "26.8.2"
263 # The executable bundles the server again, so it needs the same stamp
264 # as release.yml's JS bundle.
265 T3CODE_TELEMETRY_CHANNEL: ${{ github.repository == 'pingdotgg/t3code' && inputs.release_channel || 'dev' }}
apps/server/scripts/cli.ts
+2 -1
@@ -11,6 +11,7 @@ import { ChildProcess, ChildProcessSpawner } from "effect/process";
11
12 import { DEVELOPMENT_ICON_OVERRIDES } from "../../../scripts/lib/brand-assets.ts";
13 import { findEsmImportsOfExternalPackages } from "../../../scripts/lib/cli-executable-imports.ts";
14 +import rootPackageJson from "../../../package.json" with { type: "json" };
15 import { resolveSpawnCommand } from "@t3tools/shared/shell";
16 import {
17 ServerCliBuildAssetMissingError,
@@ -149,7 +150,7 @@ const buildExeCmd = Command.make(
150 }),
151 ).pipe(
152 Command.withDescription(
152 - "Build the server as a Node single-executable (needs a Node 25.7+ host for --build-sea). The binary still resolves native packages from a node_modules tree beside it.",
153 + `Build the server as a Node single-executable. Native builds require Node ${rootPackageJson.engines.node}; explicit cross-target builds need a Node 25.7+ host for --build-sea. The binary still resolves native packages from a node_modules tree beside it.`,
154 ),
155 );
156
apps/server/vite.config.ts
+8 -2
@@ -3,6 +3,7 @@ import { defineConfig, mergeConfig } from "vite-plus";
3
4 import baseConfig from "../../vite.config.ts";
5 import { loadRepoEnv } from "../../scripts/lib/public-config.ts";
6 +import rootPackageJson from "../../package.json" with { type: "json" };
7 import packageJson from "./package.json" with { type: "json" };
8 import { WeightedShardSequencer } from "./src/testUtils/weightedShardSequencer.ts";
9
@@ -34,7 +35,6 @@ if (!TELEMETRY_CHANNELS.includes(telemetryChannel)) {
35 // executable needs a host Node that supports `--build-sea` (25.7+), so this is
36 // a separate mode rather than a second entry in the default build.
37 const packExecutable = process.env.T3CODE_PACK_EXE === "1";
37 -const SEA_NODE_VERSION = "26.8.2";
38 const SEA_TARGETS = {
39 "darwin-arm64": { platform: "darwin", arch: "arm64" },
40 "darwin-x64": { platform: "darwin", arch: "x64" },
@@ -44,6 +44,12 @@ const SEA_TARGETS = {
44 "win-x64": { platform: "win", arch: "x64" },
45 } as const;
46 const packExecutableTarget = process.env.T3CODE_PACK_EXE_TARGET?.trim();
47 +const cliNodeVersion = rootPackageJson.engines.node;
48 +if (packExecutable && !packExecutableTarget && process.versions.node !== cliNodeVersion) {
49 + throw new Error(
50 + `Native CLI executables must be built with Node ${cliNodeVersion}; running ${process.versions.node}.`,
51 + );
52 +}
53 if (packExecutableTarget && !Object.hasOwn(SEA_TARGETS, packExecutableTarget)) {
54 throw new Error(
55 `T3CODE_PACK_EXE_TARGET must be one of ${Object.keys(SEA_TARGETS).join(", ")}, got "${packExecutableTarget}".`,
@@ -53,7 +59,7 @@ const packExecutableTargets = packExecutableTarget
59 ? [
60 {
61 ...SEA_TARGETS[packExecutableTarget as keyof typeof SEA_TARGETS],
56 - nodeVersion: SEA_NODE_VERSION,
62 + nodeVersion: cliNodeVersion,
63 },
64 ]
65 : undefined;
docs/operations/release.md
+1 -1
@@ -44,7 +44,7 @@ the version.
44 - Includes Electron auto-update metadata (for example `latest*.yml`, `nightly*.yml`, and `*.blockmap`) in release assets.
45 - Builds a self-contained CLI archive per platform (`t3-<version>-<platform>-<arch>.tar.gz`, `.zip` on Windows) in the same job as that target's desktop artifact and attaches them to the GitHub Release with a `SHA256SUMS` file, on every channel, for five targets: macOS arm64, Linux x64 and arm64, Windows x64 and arm64. Every archive is smoke-tested on hardware of its own architecture, and every one but the Windows archives is also built and signed there. There is no macOS x64 archive: Node single-executables are unsupported on x64 macOS (the SEA docs list macOS as arm64 only) and the binary segfaults on start; the x64 desktop app is Electron and unaffected.
46 - The archive holds the server as a Node single-executable (`scripts/build-cli-archive.ts`), so unpacking it needs neither Node, npm, nor a compiler. It is the only form in which T3 Code manages a runtime: the desktop's SSH environments, the boot service, `t3 update`, and the install scripts all download and verify this archive against `SHA256SUMS`. The `t3` npm package exists for people who run `npx t3` or `npm install -g t3` themselves, and it downloads this same archive too; nothing in the product installs from npm. The `curl | sh` installers are `scripts/install.sh` and `scripts/install.ps1`; the marketing site copies them into its `public/` at build time (`apps/marketing/scripts/stage-install-scripts.mjs`) and serves them at `t3.codes/install.sh` and `/install.ps1`.
47 - - The executable is built with a Node that supports `--build-sea` (`VP_NODE_VERSION=26.8.2`, kept in step with `SEA_NODE_VERSION` in `apps/server/vite.config.ts`), while the repo stays on `engines.node`.
47 + - The root `package.json` pins `engines.node` to the exact Node version used by development, CI and standalone executables. Keep it exact: cross-target builds download that version, and native executable builds reject a different host Node version. Runtime changes need a new T3 release version because installed runtimes are cached by that version.
48 - macOS archives are signed with the Developer ID certificate and notarized when the Apple secrets are present (ad hoc otherwise, which still runs from `curl`/`tar` installs). Windows executables use the same Azure Trusted Signing setup as the installer. Every native addon in the macOS archive is signed too, since the hardened runtime refuses unsigned libraries.
49 - Each archive is extracted and executed (`scripts/smoke-cli-archive.ts`) on its build runner, or on the `verify_runner` for Windows.
50 - After the GitHub Release is published, publishes the `t3` npm package with OIDC trusted publishing from the same workflow file. It is only a launcher (`scripts/npm-launcher/t3.mjs`): on first run it downloads its exact version's CLI archive from the GitHub Release, verifies it against `SHA256SUMS`, and unpacks it into `<T3 home>/runtime/versions/<version>`, the layout the install scripts and `t3 update` share. The executables are not on npm. They used to be, as `@t3code/t3-<platform>-<arch>` optional dependencies, but npm's publish-time scanning held those 80-250 MB packages back for up to an hour after the launcher was live, and every install in that window got a launcher with no executable. Those packages stay on npm at their old versions and get no new ones. Because the launcher reads from the release, `publish_cli` runs after `release`, never before.
package.json
+1 -1
@@ -62,7 +62,7 @@
62 "vite-plus": "catalog:"
63 },
64 "engines": {
65 - "node": "^24.13.1"
65 + "node": "26.12.1"
66 },
67 "packageManager": "pnpm@12.14.0"
68 }