Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): Windows Git launches no longer block RPC #32234

ClosedSidreyas(GitHub profile, opens in a new tab)wants to merge 3 commits intomain fromrefs/pull/32234/headopened View on GitHub

Showing 10 changed files with 92 additions and 0 deletions (loading 9).

x
0 of 10 viewed, 10 left
92 additions and 0 deletionsapps/server/src/process/WindowsSpawn.tsAdded
View file
@@ -0,0 +1,92 @@
+import * as Context from "effect/Context";
+import * as Effect from "effect/Effect";
+import * as FileSystem from "effect/FileSystem";
+import * as Layer from "effect/Layer";
+import * as PlatformError from "effect/PlatformError";
+import * as Scope from "effect/Scope";
+import * as Sink from "effect/Sink";
+import * as Redacted from "effect/Redacted";
+import * as Stream from "effect/Stream";
+import type * as ChildProcess from "effect/process/ChildProcess";
+import * as ChildProcessSpawner from "effect/process/ChildProcessSpawner";
+import * as HostProcess from "@t3tools/shared/HostProcess";
+import { makePool } from "./windowsProcessWorker.ts";
+​
+type Spawn = (
+ command: ChildProcess.StandardCommand,
+) => Effect.Effect<
+ Pick<ChildProcessSpawner.ChildProcessHandle, "stdin" | "stdout" | "stderr" | "exitCode">,
+ PlatformError.PlatformError,
+ Scope.Scope
+>;
+​
+export const WindowsSpawn = Context.Reference<Spawn | undefined>("t3/WindowsSpawn", {
+ defaultValue: () => undefined,
+});
+​
+export const layer = Layer.effect(
+ WindowsSpawn,
+ Effect.gen(function* () {
+ if ((yield* HostProcess.Platform) !== "win32") return undefined;