Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@effect/platform-node": "catalog:",
"@effect/platform-node-shared": "catalog:",
"@effect/sql-sqlite-bun": "catalog:",
"@ff-labs/fff-node": "^0.9.4",
"@ff-labs/fff-node": "0.9.4",
"@opencode-ai/sdk": "^1.3.15",
"@pierre/diffs": "catalog:",
"effect": "catalog:",
Expand Down
37 changes: 37 additions & 0 deletions patches/@ff-labs__fff-node@0.9.4.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
diff --git a/dist/src/binary.js b/dist/src/binary.js
index ee181aef5007e4bf34a49479c089ca30f73a320b..327e2c55c83cc4c50d396a3109190ef10af75ca7 100644
--- a/dist/src/binary.js
+++ b/dist/src/binary.js
@@ -7,7 +7,7 @@
*/
import { existsSync, readFileSync } from "node:fs";
import { createRequire } from "node:module";
-import { dirname, join } from "node:path";
+import { dirname, join, sep } from "node:path";
import { fileURLToPath } from "node:url";
import { getLibFilename, getNpmPackageName } from "./platform.js";
/**
@@ -46,6 +46,14 @@ function getPackageDir() {
// Fallback: assume we're one level deep in src/
return dirname(currentDir);
}
+function resolveUnpackedAsarPath(binaryPath) {
+ const asarSegment = `${sep}app.asar${sep}`;
+ if (!binaryPath.includes(asarSegment)) {
+ return binaryPath;
+ }
+ const unpackedPath = binaryPath.replace(asarSegment, `${sep}app.asar.unpacked${sep}`);
+ return existsSync(unpackedPath) ? unpackedPath : binaryPath;
+}
/**
* Check if the binary exists in any known location
*/
@@ -69,7 +77,7 @@ function resolveFromNpmPackage() {
const packageDir = dirname(packageJsonPath);
const binaryPath = join(packageDir, getLibFilename());
if (existsSync(binaryPath)) {
- return binaryPath;
+ return resolveUnpackedAsarPath(binaryPath);
}
}
catch {
9 changes: 6 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

70 changes: 34 additions & 36 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -1,46 +1,45 @@
packages:
- "apps/*"
- "infra/*"
- "oxlint-plugin-t3code"
- "packages/*"
- "scripts"

onlyBuiltDependencies:
- electron
- esbuild
- msgpackr-extract
- node-pty
- sharp

ignoredBuiltDependencies:
- msw
- apps/*
- infra/*
- oxlint-plugin-t3code
- packages/*
- scripts

catalog:
effect: 4.0.0-beta.78
"@effect/atom-react": 4.0.0-beta.78
"@effect/openapi-generator": 4.0.0-beta.78
"@effect/platform-bun": 4.0.0-beta.78
"@effect/platform-node": 4.0.0-beta.78
"@effect/platform-node-shared": 4.0.0-beta.78
"@effect/sql-pg": 4.0.0-beta.78
"@effect/sql-sqlite-bun": 4.0.0-beta.78
"@effect/vitest": 4.0.0-beta.78
"@effect/tsgo": 0.13.2
"@effect/vitest": 4.0.0-beta.78
"@noble/curves": 1.9.1
"@noble/hashes": 1.8.0
"@pierre/diffs": 1.3.0-beta.4
"@vitest/runner": 4.1.8
"@types/node": 24.12.4
"@typescript/native-preview": 7.0.0-dev.20260604.1
"@vitest/runner": 4.1.8
effect: 4.0.0-beta.78
jose: 6.2.2
typescript: ~6.0.3
vitest: npm:@voidzero-dev/vite-plus-test@0.1.24
vite: npm:@voidzero-dev/vite-plus-core@0.1.24
vite-plus: 0.1.24
vitest: npm:@voidzero-dev/vite-plus-test@0.1.24
yaml: ^2.9.0

ignoredBuiltDependencies:
- msw

onlyBuiltDependencies:
- electron
- esbuild
- msgpackr-extract
- node-pty
- sharp

overrides:
# Clerk publishes wallet auth integrations as required dependencies. T3 Code does
# not support wallet auth, so keep that unused dependency tree out of installs.
"@clerk/clerk-js>@base-org/account": "-"
"@clerk/clerk-js>@coinbase/wallet-sdk": "-"
"@clerk/clerk-js>@solana/wallet-adapter-base": "-"
Expand All @@ -56,37 +55,36 @@ overrides:
"@effect/vitest": "catalog:"
"@effect/vitest>@vitest/runner": "-"
"@effect/vitest>vitest": "-"
# Pinned to the version the patch in patchedDependencies targets — a fresh
# resolve (e.g. release-smoke regenerating the lockfile) must not drift to a
# newer release and orphan the patch (ERR_PNPM_UNUSED_PATCH).
"@expo/metro-config": "56.0.13"
"@expo/metro-config": 56.0.13
"@types/node": "catalog:"
effect: "catalog:"
vite: "catalog:"
vitest: "catalog:"
yaml: "catalog:"
peerDependencyRules:
allowAny:
- vite
- vitest
allowedVersions:
vite: "*"
vitest: "*"

packageExtensions:
"@effect/vitest@*":
dependencies:
vite-plus: "catalog:"
peerDependenciesMeta:
vitest:
optional: true
"vite-plus@*":
vite-plus@*:
dependencies:
vite: "catalog:"

patchedDependencies:
# Keep non-browser consumers off the root entrypoint, which eagerly imports
# DOM-dependent renderers. These utility/type subpaths are safe for mobile.
"@pierre/diffs@1.3.0-beta.4": patches/@pierre%2Fdiffs@1.3.0-beta.4.patch
"@effect/vitest@4.0.0-beta.78": patches/@effect__vitest@4.0.0-beta.78.patch
"@expo/metro-config@56.0.13": patches/@expo%2Fmetro-config@56.0.13.patch
"@ff-labs/fff-node@0.9.4": patches/@ff-labs__fff-node@0.9.4.patch
"@pierre/diffs@1.3.0-beta.4": patches/@pierre%2Fdiffs@1.3.0-beta.4.patch
effect@4.0.0-beta.78: patches/effect@4.0.0-beta.78.patch
react-native-nitro-modules@0.35.9: patches/react-native-nitro-modules@0.35.9.patch

peerDependencyRules:
allowAny:
- vite
- vitest
allowedVersions:
vite: "*"
vitest: "*"
50 changes: 50 additions & 0 deletions scripts/build-desktop-artifact.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,19 @@ import * as Layer from "effect/Layer";
import * as Option from "effect/Option";

import {
createStageWorkspaceConfig,
createStagePnpmConfig,
DESKTOP_ASAR_UNPACK,
resolveDesktopRuntimeDependencies,
resolveFffNativeDependencies,
resolveBuildOptions,
resolveDesktopBuildIconAssets,
resolveDesktopProductName,
resolveDesktopUpdateChannel,
resolveGitHubPublishConfig,
resolveMockUpdateServerPort,
resolveMockUpdateServerUrl,
STAGE_INSTALL_ARGS,
} from "./build-desktop-artifact.ts";
import { BRAND_ASSET_PATHS } from "./lib/brand-assets.ts";
import { HostProcessArchitecture, HostProcessPlatform } from "@t3tools/shared/hostProcess";
Expand Down Expand Up @@ -114,17 +118,20 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {
createStagePnpmConfig(
{
"@expo/metro-config@56.0.13": "patches/@expo%2Fmetro-config@56.0.13.patch",
"@ff-labs/fff-node@0.9.4": "patches/@ff-labs__fff-node@0.9.4.patch",
"@pierre/diffs@1.1.20": "patches/@pierre%2Fdiffs@1.1.20.patch",
"alchemy@2.0.0-beta.49": "patches/alchemy@2.0.0-beta.49.patch",
"effect@4.0.0-beta.73": "patches/effect@4.0.0-beta.73.patch",
},
{
"@ff-labs/fff-node": "0.9.4",
"@pierre/diffs": "1.1.20",
effect: "4.0.0-beta.73",
},
),
{
patchedDependencies: {
"@ff-labs/fff-node@0.9.4": "patches/@ff-labs__fff-node@0.9.4.patch",
"@pierre/diffs@1.1.20": "patches/@pierre%2Fdiffs@1.1.20.patch",
"effect@4.0.0-beta.73": "patches/effect@4.0.0-beta.73.patch",
},
Expand All @@ -142,6 +149,49 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {
);
});

it("installs optional native dependencies for the target desktop architecture", () => {
assert.deepStrictEqual(STAGE_INSTALL_ARGS, ["install", "--prod"]);
assert.deepStrictEqual(createStageWorkspaceConfig("mac", "x64"), {
supportedArchitectures: {
os: ["darwin"],
cpu: ["x64"],
},
});
assert.deepStrictEqual(createStageWorkspaceConfig("win", "arm64"), {
supportedArchitectures: {
os: ["win32"],
cpu: ["arm64"],
},
});
assert.deepStrictEqual(createStageWorkspaceConfig("mac", "universal"), {
supportedArchitectures: {
os: ["darwin"],
cpu: ["arm64", "x64"],
},
});
});

it("unpacks the fff shared library for filesystem and FFI access", () => {
assert.deepStrictEqual(DESKTOP_ASAR_UNPACK, ["node_modules/@ff-labs/fff-bin-*/**/*"]);
});

it("promotes target fff binaries to direct staged dependencies", () => {
assert.deepStrictEqual(resolveFffNativeDependencies("mac", "arm64", "0.9.4"), {
"@ff-labs/fff-bin-darwin-arm64": "0.9.4",
});
assert.deepStrictEqual(resolveFffNativeDependencies("mac", "universal", "0.9.4"), {
"@ff-labs/fff-bin-darwin-arm64": "0.9.4",
"@ff-labs/fff-bin-darwin-x64": "0.9.4",
});
assert.deepStrictEqual(resolveFffNativeDependencies("win", "x64", "0.9.4"), {
"@ff-labs/fff-bin-win32-x64": "0.9.4",
});
assert.deepStrictEqual(resolveFffNativeDependencies("linux", "arm64", "0.9.4"), {
"@ff-labs/fff-bin-linux-arm64-gnu": "0.9.4",
"@ff-labs/fff-bin-linux-arm64-musl": "0.9.4",
});
});

it("falls back to the default mock update port when the configured port is blank", () => {
assert.equal(resolveMockUpdateServerUrl(undefined), "http://localhost:3000");
assert.equal(resolveMockUpdateServerUrl(4123), "http://localhost:4123");
Expand Down
Loading
Loading