- Add external opener support alongside browser/editor launches - Remove the `open` dependency and cover platform behavior in tests
Showing the changes to apps/server/src/wsServer.ts (1 of 7 files). Show all
Unified · Split
| @@ -58,7 +58,7 @@ import { ProviderService } from "./provider/Services/ProviderService"; · 57 unmodified lines | |||
| 58 | import { ProviderRegistry } from "./provider/Services/ProviderRegistry"; | 58 | import { ProviderRegistry } from "./provider/Services/ProviderRegistry"; |
| 59 | import { CheckpointDiffQuery } from "./checkpointing/Services/CheckpointDiffQuery"; | 59 | import { CheckpointDiffQuery } from "./checkpointing/Services/CheckpointDiffQuery"; |
| 60 | import { clamp } from "effect/Number"; | 60 | import { clamp } from "effect/Number"; |
| 61 | import { Open, resolveAvailableEditors } from "./open"; | 61 | import { Open } from "./open"; |
| 62 | import { ServerConfig } from "./config"; | 62 | import { ServerConfig } from "./config"; |
| 63 | import { GitCore } from "./git/Services/GitCore.ts"; | 63 | import { GitCore } from "./git/Services/GitCore.ts"; |
| 64 | import { tryHandleProjectFaviconRequest } from "./projectFaviconRoute"; | 64 | import { tryHandleProjectFaviconRequest } from "./projectFaviconRoute"; |
| @@ -250,7 +250,10 @@ export const createServer = Effect.fn(function* (): Effect.fn.Return< · 185 unmodified lines | |||
| 250 | logWebSocketEvents, | 250 | logWebSocketEvents, |
| 251 | autoBootstrapProjectFromCwd, | 251 | autoBootstrapProjectFromCwd, |
| 252 | } = serverConfig; | 252 | } = serverConfig; |
| 253 | const availableEditors = resolveAvailableEditors(); | 253 | const open = yield* Open; |
| 254 | const availableEditors = yield* open.getAvailableEditors.pipe( | ||
| 255 | Effect.mapError((cause) => new ServerLifecycleError({ operation: "availableEditors", cause })), | ||
| 256 | ); | ||
| 254 | 257 | ||
| 255 | const runtimeServices = yield* Effect.services< | 258 | const runtimeServices = yield* Effect.services< |
| 256 | ServerRuntimeServices | ServerConfig | FileSystem.FileSystem | Path.Path | 259 | ServerRuntimeServices | ServerConfig | FileSystem.FileSystem | Path.Path |
| @@ -615,7 +618,7 @@ export const createServer = Effect.fn(function* (): Effect.fn.Return< · 358 unmodified lines | |||
| 615 | const projectionReadModelQuery = yield* ProjectionSnapshotQuery; | 618 | const projectionReadModelQuery = yield* ProjectionSnapshotQuery; |
| 616 | const checkpointDiffQuery = yield* CheckpointDiffQuery; | 619 | const checkpointDiffQuery = yield* CheckpointDiffQuery; |
| 617 | const orchestrationReactor = yield* OrchestrationReactor; | 620 | const orchestrationReactor = yield* OrchestrationReactor; |
| 618 | const { openInEditor } = yield* Open; | 621 | const { openInEditor } = open; |
| 619 | 622 | ||
| 620 | const subscriptionsScope = yield* Scope.make("sequential"); | 623 | const subscriptionsScope = yield* Scope.make("sequential"); |
| 621 | yield* Effect.addFinalizer(() => Scope.close(subscriptionsScope, Exit.void)); | 624 | yield* Effect.addFinalizer(() => Scope.close(subscriptionsScope, Exit.void)); |