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 24, 12:45 UTC
fix(desktop): exclude opposite macOS pty prebuilds (#9240)
Exotic committed
Sep 2, 2026 at 23:44 UTC
8d5b712de3cbd84118327808c403756e8894014a
1 file changed
+19
-1
scripts/build-desktop-artifact.ts
+19
-1
@@ -941,6 +941,19 @@ export const MAC_FILE_EXCLUSIONS = [
941
"!**/node_modules/node-pty/prebuilds/win32-*/**/*",
942
"!**/node_modules/node-pty/third_party/conpty/**/*",
943
] as const;
944
+
945
+// node-pty publishes both Darwin prebuilds in one package. Single-architecture
946
+// apps only need the native target; universal apps need both. An omitted arch
947
+// preserves the existing common exclusions for callers that only inspect the
948
+// generic platform config.
949
+export function resolveMacFileExclusions(arch?: typeof BuildArch.Type) {
950
+ if (arch === undefined || arch === "universal") {
951
+ return [...MAC_FILE_EXCLUSIONS];
952
+ }
953
+
954
+ const unusedArch = arch === "arm64" ? "x64" : "arm64";
955
+ return [...MAC_FILE_EXCLUSIONS, `!**/node_modules/node-pty/prebuilds/darwin-${unusedArch}/**/*`];
956
+}
957
// Windows ships the server tree (bundle + node_modules) as a separate
958
// resources/server.asar sidecar instead of loose files: the NSIS installer
959
// then extracts a handful of large archives instead of thousands of small
@@ -2428,13 +2441,17 @@ export const createBuildConfig = Effect.fn("createBuildConfig")(function* (
2441
// sidecar staging skips the archive in that case, and listing a resource
2442
// whose source file was never written fails the electron-builder step.
2443
wslRuntimeBundled = false,
2444
+ arch?: typeof BuildArch.Type,
2445
) {
2446
const buildConfig: Record<string, unknown> = {
2447
appId: DESKTOP_APP_ID,
2448
productName: resolveDesktopProductName(version),
2449
artifactName: "T3-Code-${version}-${arch}.${ext}",
2450
electronLanguages: [...DESKTOP_ELECTRON_LANGUAGES],
2437
- files: [...DESKTOP_FILE_EXCLUSIONS, ...(platform === "mac" ? MAC_FILE_EXCLUSIONS : [])],
2451
+ files: [
2452
+ ...DESKTOP_FILE_EXCLUSIONS,
2453
+ ...(platform === "mac" ? resolveMacFileExclusions(arch) : []),
2454
+ ],
2455
directories: {
2456
buildResources: "apps/desktop/resources",
2457
},
@@ -3502,6 +3519,7 @@ const buildDesktopArtifact = Effect.fn("buildDesktopArtifact")(function* (
3519
}
3520
: undefined,
3521
bundlesWslRuntime({ arch: options.arch, prebuildPath: options.wslPrebuild }),
3522
+ options.arch,
3523
),
3524
dependencies: stageDependencies,
3525
devDependencies: {