Refactor open service onto Effect-backed process spawning
- Add external opener support alongside browser/editor launches - Remove the `open` dependency and cover platform behavior in tests
This commit is contained in:
1 parent
48fc85e7fe
commit
2ade03788b
7 files changed
+1134
-437
No files matched your search
@@ -58,7 +58,7 @@ import { ProviderService } from "./provider/Services/ProviderService";
|
||||
import { ProviderRegistry } from "./provider/Services/ProviderRegistry";
|
||||
import { CheckpointDiffQuery } from "./checkpointing/Services/CheckpointDiffQuery";
|
||||
import { clamp } from "effect/Number";
|
||||
import { Open, resolveAvailableEditors } from "./open";
|
||||
import { Open } from "./open";
|
||||
import { ServerConfig } from "./config";
|
||||
import { GitCore } from "./git/Services/GitCore.ts";
|
||||
import { tryHandleProjectFaviconRequest } from "./projectFaviconRoute";
|
||||
@@ -250,7 +250,10 @@ export const createServer = Effect.fn(function* (): Effect.fn.Return<
|
||||
logWebSocketEvents,
|
||||
autoBootstrapProjectFromCwd,
|
||||
} = serverConfig;
|
||||
const availableEditors = resolveAvailableEditors();
|
||||
const open = yield* Open;
|
||||
const availableEditors = yield* open.getAvailableEditors.pipe(
|
||||
Effect.mapError((cause) => new ServerLifecycleError({ operation: "availableEditors", cause })),
|
||||
);
|
||||
|
||||
const runtimeServices = yield* Effect.services<
|
||||
ServerRuntimeServices | ServerConfig | FileSystem.FileSystem | Path.Path
|
||||
@@ -615,7 +618,7 @@ export const createServer = Effect.fn(function* (): Effect.fn.Return<
|
||||
const projectionReadModelQuery = yield* ProjectionSnapshotQuery;
|
||||
const checkpointDiffQuery = yield* CheckpointDiffQuery;
|
||||
const orchestrationReactor = yield* OrchestrationReactor;
|
||||
const { openInEditor } = yield* Open;
|
||||
const { openInEditor } = open;
|
||||
|
||||
const subscriptionsScope = yield* Scope.make("sequential");
|
||||
yield* Effect.addFinalizer(() => Scope.close(subscriptionsScope, Exit.void));
|
||||
|
||||
Reference in new issue
Block a user