Skip to content
Open
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
100 changes: 50 additions & 50 deletions apps/code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,57 +41,57 @@
"license": "MIT",
"devDependencies": {
"@biomejs/biome": "2.2.4",
"@electron-forge/cli": "^7.11.1",
"@electron-forge/maker-deb": "^7.11.1",
"@electron-forge/maker-dmg": "^7.11.1",
"@electron-forge/maker-rpm": "^7.11.1",
"@electron-forge/maker-squirrel": "^7.11.1",
"@electron-forge/maker-zip": "^7.11.1",
"@electron-forge/plugin-vite": "^7.11.1",
"@electron-forge/publisher-github": "^7.11.1",
"@electron-forge/shared-types": "^7.11.1",
"@electron/rebuild": "^4.0.3",
"@playwright/test": "^1.42.0",
"@posthog/rollup-plugin": "^1.4.0",
"@electron-forge/cli": "^7.11.2",
"@electron-forge/maker-deb": "^7.11.2",
"@electron-forge/maker-dmg": "^7.11.2",
"@electron-forge/maker-rpm": "^7.11.2",
"@electron-forge/maker-squirrel": "^7.11.2",
"@electron-forge/maker-zip": "^7.11.2",
"@electron-forge/plugin-vite": "^7.11.2",
"@electron-forge/publisher-github": "^7.11.2",
"@electron-forge/shared-types": "^7.11.2",
"@electron/rebuild": "^4.0.4",
"@playwright/test": "^1.60.0",
"@posthog/rollup-plugin": "^1.4.4",
"@reforged/maker-appimage": "^5.2.0",
"@storybook/addon-a11y": "10.2.0",
"@storybook/addon-docs": "10.2.0",
"@storybook/react-vite": "10.2.0",
"@storybook/addon-a11y": "10.4.1",
"@storybook/addon-docs": "10.4.1",
"@storybook/react-vite": "10.4.1",
"@tanstack/devtools-vite": "^0.7.0",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.0",
"@testing-library/user-event": "^14.6.1",
"@types/better-sqlite3": "^7.6.13",
"@types/canvas-confetti": "^1.9.0",
"@types/node": "^24.0.0",
"@types/react": "^19.1.0",
"@types/react-dom": "^19.1.0",
"@types/react": "^19.2.15",
"@types/react-dom": "^19.2.3",
"@types/semver": "^7.7.1",
"@vitejs/plugin-react": "^4.2.1",
"@vitest/ui": "^4.0.10",
"adm-zip": "^0.5.16",
"electron": "^41.0.0",
"@vitejs/plugin-react": "^6.0.2",
"@vitest/ui": "^4.1.7",
"adm-zip": "^0.5.17",
"electron": "^42.3.0",
"husky": "^9.1.7",
"jimp": "^1.6.0",
"jimp": "^1.6.1",
"jsdom": "^26.0.0",
"lint-staged": "^15.5.2",
"memfs": "^4.56.10",
"postcss": "^8.4.33",
"storybook": "10.2.0",
"tailwindcss": "^4.2.2",
"tsx": "^4.20.6",
"typed-openapi": "^2.2.2",
"memfs": "^4.57.3",
"postcss": "^8.5.15",
"storybook": "10.4.1",
"tailwindcss": "^4.3.0",
"tsx": "^4.22.3",
"typed-openapi": "^2.2.6",
"typescript": "^5.9.3",
"vite": "^6.0.7",
"vite-tsconfig-paths": "^5.1.4",
"vitest": "^4.0.10",
"yaml": "^2.8.1"
"vite": "^8.0.14",
"vite-tsconfig-paths": "^6.1.1",
"vitest": "^4.1.7",
"yaml": "^2.9.0"
},
"dependencies": {
"@fontsource-variable/inter": "^5.2.8",
"@inversifyjs/strongly-typed": "2.2.0",
"@json-render/core": "^0.19.0",
"@modelcontextprotocol/sdk": "^1.12.1",
"@modelcontextprotocol/sdk": "^1.29.0",
"@opentelemetry/api-logs": "^0.208.0",
"@opentelemetry/exporter-logs-otlp-http": "^0.208.0",
"@opentelemetry/resources": "^2.5.0",
Expand All @@ -117,20 +117,20 @@
"@posthog/workspace-client": "workspace:*",
"@posthog/workspace-server": "workspace:*",
"@radix-ui/themes": "^3.2.1",
"@tailwindcss/vite": "^4.2.2",
"@tanstack/react-query": "^5.90.2",
"@tanstack/router-plugin": "^1.95.0",
"@trpc/client": "^11.12.0",
"@trpc/server": "^11.12.0",
"@trpc/tanstack-react-query": "^11.12.0",
"better-sqlite3": "^12.8.0",
"@tailwindcss/vite": "^4.3.0",
"@tanstack/react-query": "^5.100.14",
"@tanstack/router-plugin": "^1.168.13",
"@trpc/client": "^11.17.0",
"@trpc/server": "^11.17.0",
"@trpc/tanstack-react-query": "^11.17.0",
"better-sqlite3": "^12.10.0",
"chokidar": "^5.0.0",
"detect-libc": "^1.0.3",
"dotenv": "^17.2.3",
"drizzle-orm": "^0.45.1",
"electron-log": "^5.4.3",
"dotenv": "^17.4.2",
"drizzle-orm": "^0.45.2",
"electron-log": "^5.4.4",
"electron-store": "^11.0.0",
"fflate": "^0.8.2",
"fflate": "^0.8.3",
"file-icon": "^6.0.0",
"fzf": "^0.5.2",
"ignore": "^7.0.5",
Expand All @@ -140,17 +140,17 @@
"node-addon-api": "^8.5.0",
"node-machine-id": "^1.1.12",
"node-pty": "1.1.0",
"posthog-node": "^5.24.10",
"posthog-node": "^5.35.6",
"radix-themes-tw": "0.2.3",
"react": "19.1.0",
"react-dom": "19.1.0",
"react": "19.2.6",
"react-dom": "19.2.6",
"react-hotkeys-hook": "^4.4.4",
"reflect-metadata": "^0.2.2",
"semver": "^7.6.0",
"semver": "^7.8.1",
"shadcn": "^4.1.2",
"smol-toml": "^1.6.0",
"smol-toml": "^1.6.1",
"tailwindcss-scroll-mask": "^0.0.3",
"tw-animate-css": "^1.4.0",
"zod": "^4.1.12"
"zod": "^4.4.3"
}
}
3 changes: 1 addition & 2 deletions apps/code/scripts/postinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ fi
echo "Rebuilding native modules for Electron..."

cd "$REPO_ROOT"
npx @electron/rebuild -f -m node_modules/node-pty
npx @electron/rebuild -f -m node_modules/better-sqlite3 || echo "⚠ better-sqlite3 electron rebuild FAILED — app DB will not load"
node scripts/rebuild-better-sqlite3-electron.mjs

echo "Patching Electron app name..."
bash "$SCRIPTS_DIR/patch-electron-name.sh"
Expand Down
26 changes: 19 additions & 7 deletions apps/code/vite.main.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,32 @@ function getBuildDate(): string {

const __dirname = path.dirname(fileURLToPath(import.meta.url));

function fixFilenameCircularRef(): Plugin {
function fixImportMetaUrl(): Plugin {
return {
name: "fix-filename-circular-ref",
name: "fix-import-meta-url",
enforce: "post",
generateBundle(_options, bundle) {
// Rolldown (Vite 8) lowers `import.meta.url` to `{}.url` (undefined) in the
// CJS main bundle, crashing createRequire/fileURLToPath at boot. Restore a
// CJS-safe URL from the bundle's own __filename.
let replaced = 0;
for (const fileName in bundle) {
const chunk = bundle[fileName];
if (chunk.type === "chunk") {
chunk.code = chunk.code.replace(
/const __filename(\d+) = [\w$]+\.fileURLToPath\(typeof document === "undefined" \? require\("url"\)\.pathToFileURL\(__filename\1\)\.href : [^;]+\);/g,
"const __filename$1 = __filename;",
);
chunk.code = chunk.code.replace(/\{\}\.url/g, () => {
replaced++;
return 'require("url").pathToFileURL(__filename).href';
});
}
}
// If a future Rolldown changes or fixes that lowering, this plugin silently
// stops firing and the boot crash returns. Warn loudly so we re-check the
// packaged app's boot (or drop this plugin once Rolldown handles it).
if (replaced === 0) {
this.warn(
"fix-import-meta-url found no `{}.url` to patch; verify Rolldown's import.meta.url lowering and that the packaged app still boots",
);
}
},
};
}
Expand Down Expand Up @@ -609,7 +621,7 @@ export default defineConfig(({ mode }) => {
plugins: [
tsconfigPaths(),
autoServicesPlugin(join(__dirname, "src/main/services")),
fixFilenameCircularRef(),
fixImportMetaUrl(),
copyClaudeExecutable(),
copyPosthogPlugin(isDev),
copyDrizzleMigrations(),
Expand Down
7 changes: 4 additions & 3 deletions apps/code/vite.workspace-server.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ const nativeModules = new Set([
"file-icon",
]);

const isExternal = (id: string): boolean =>
nodeBuiltins.has(id) || nativeModules.has(id);
// Rolldown (Vite 8) merges ssr.external into rollupOptions.external as one
// array and rejects function entries, so this must stay a plain string list.
const externalModules = [...nodeBuiltins, ...nativeModules];

export default defineConfig({
resolve: {
Expand Down Expand Up @@ -55,7 +56,7 @@ export default defineConfig({
output: {
entryFileNames: "workspace-server.js",
},
external: isExternal,
external: externalModules,
},
},
});
17 changes: 1 addition & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@
"test:vitest": "pnpm --filter code --filter @posthog/electron-trpc test",
"test:e2e": "pnpm --filter code test:e2e",
"test:e2e:headed": "pnpm --filter code test:e2e:headed",
"rebuild:sqlite-node": "node scripts/rebuild-better-sqlite3-node.mjs",
"rebuild:sqlite-electron": "npx @electron/rebuild -f -m node_modules/better-sqlite3",
"typecheck": "turbo typecheck",
"boundaries": "node scripts/check-host-boundaries.mjs",
"lint": "biome check --write --unsafe",
"format": "biome format --write",
"clean": "pnpm -r clean",
Expand All @@ -52,24 +49,12 @@
"knip": "^5.66.3",
"lint-staged": "^15.5.2",
"mprocs": "^0.7.1",
"turbo": "^2.6.2"
"turbo": "^2.9.16"
},
"lint-staged": {
"*.{ts,tsx,js,jsx}": [
"biome check --write --unsafe --files-ignore-unknown=true --no-errors-on-unmatched",
"bash -c 'pnpm typecheck'"
]
},
"pnpm": {
"onlyBuiltDependencies": [
"electron",
"electron-winstaller",
"node-pty",
"better-sqlite3",
"@posthog/cli"
],
"overrides": {
"zod": "4.3.6"
}
}
}
4 changes: 2 additions & 2 deletions packages/electron-trpc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"@trpc/client": "^11.8.0",
"@trpc/server": "^11.8.0",
"@types/node": "^24.0.0",
"@vitest/coverage-v8": "^0.34.0",
"electron": "^41.0.0",
"@vitest/coverage-v8": "^2.1.8",
"electron": "^42.3.0",
"superjson": "^2.2.2",
"typescript": "^5.8.3",
"vite": "^6.0.7",
Expand Down
2 changes: 2 additions & 0 deletions packages/electron-trpc/src/main/handleIPCMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ export async function handleIPCMessage<TRouter extends AnyTRPCRouter>({
getRawInput: async () => input,
type,
signal: abortController.signal,
// IPC operations are never batched
batchIndex: 0,
});

const isIterableResult = isAsyncIterable(result) || isObservable(result);
Expand Down
3 changes: 2 additions & 1 deletion packages/host-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"@posthog/shared": "workspace:*",
"@posthog/workspace-client": "workspace:*",
"@posthog/workspace-server": "workspace:*",
"@trpc/client": "catalog:"
"@trpc/client": "catalog:",
"zod": "^4.4.3"
},
"peerDependencies": {
"@tanstack/react-query": "catalog:",
Expand Down
1 change: 1 addition & 0 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
"unified": "^11.0.5",
"virtua": "^0.48.6",
"vscode-icons-js": "^11.6.1",
"zod": "^4.4.3",
"zustand": "^4.5.0"
},
"peerDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,13 @@ export function useSignalTeamConfigMutations() {
);

if (previous) {
const optimistic: SignalTeamConfig = {
...previous,
autostart_base_branches: branches,
};
queryClient.setQueryData<SignalTeamConfig | null>(
TEAM_CONFIG_QUERY_KEY,
{
...previous,
autostart_base_branches: branches,
},
optimistic,
);
}

Expand Down
3 changes: 2 additions & 1 deletion packages/ui/src/features/tasks/useTaskMutations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ export function useRenameTask() {
if (previousDetail) {
queryClient.setQueryData<Task | undefined>(
taskKeys.detail(taskId),
(current) => rollbackDetailData(current, previousDetail, newTitle),
(current) =>
rollbackDetailData<Task>(current, previousDetail, newTitle),
);
}
if (rollbackSession) {
Expand Down
47 changes: 47 additions & 0 deletions patches/better-sqlite3@12.10.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
diff --git a/src/better_sqlite3.cpp b/src/better_sqlite3.cpp
index 13f054a641f63dda3ebbf71ea5613cf12b054fad..78e99304e9d798545688066026c2b7d2fb385858 100644
--- a/src/better_sqlite3.cpp
+++ b/src/better_sqlite3.cpp
@@ -57,7 +57,12 @@ NODE_MODULE_INIT(/* exports, context */) {

// Initialize addon instance.
Addon* addon = new Addon(isolate);
+#if defined(NODE_MODULE_VERSION) && NODE_MODULE_VERSION >= 146
+ // V8 14.6+ (Electron 42, Node 26) drops the untagged External::New overload.
+ v8::Local<v8::External> data = v8::External::New(isolate, addon, v8::kExternalPointerTypeTagDefault);
+#else
v8::Local<v8::External> data = v8::External::New(isolate, addon);
+#endif
node::AddEnvironmentCleanupHook(isolate, Addon::Cleanup, addon);

// Create and export native-backed classes and functions.
diff --git a/src/util/helpers.cpp b/src/util/helpers.cpp
index f7771520075e2dc871d1d60b801bbbb540c6c23d..db7fd9f563b3984f88b3c452e30b8c9eca2bf106 100644
--- a/src/util/helpers.cpp
+++ b/src/util/helpers.cpp
@@ -89,7 +89,7 @@ void SetPrototypeGetter(
recv->InstanceTemplate()->SetNativeDataProperty(
InternalizedFromLatin1(isolate, name),
func,
- 0,
+ nullptr,
data
);
}
diff --git a/src/util/macros.cpp b/src/util/macros.cpp
index e75d53763e575cb1ec5f560d1303100ebb380249..49a04a8e13e900bb3bb9d15817b12d2543543bf0 100644
--- a/src/util/macros.cpp
+++ b/src/util/macros.cpp
@@ -27,7 +27,12 @@
#define EasyIsolate v8::Isolate* isolate = v8::Isolate::GetCurrent()
#define OnlyIsolate info.GetIsolate()
#define OnlyContext isolate->GetCurrentContext()
+#if defined(NODE_MODULE_VERSION) && NODE_MODULE_VERSION >= 146
+// V8 14.6+ (Electron 42, Node 26) drops the untagged External::Value overload.
+#define OnlyAddon static_cast<Addon*>(info.Data().As<v8::External>()->Value(v8::kExternalPointerTypeTagDefault))
+#else
#define OnlyAddon static_cast<Addon*>(info.Data().As<v8::External>()->Value())
+#endif
#define UseIsolate v8::Isolate* isolate = OnlyIsolate
#define UseContext v8::Local<v8::Context> ctx = OnlyContext
#define UseAddon Addon* addon = OnlyAddon
Loading