Refactor workspace service boundaries (#25152)

This commit is contained in:
Kit Langton
2026-04-30 15:34:37 -04:00
committed by GitHub
parent b315a70773
commit 0e9d9282c6
14 changed files with 433 additions and 417 deletions

View File

@@ -50,6 +50,7 @@ const it = testEffect(
NodeHttpServer.layerTest,
NodeServices.layer,
Project.defaultLayer,
Workspace.defaultLayer,
Socket.layerWebSocketConstructorGlobal,
),
)
@@ -116,16 +117,17 @@ const syncResponse = (request: HttpServerRequest.HttpServerRequest) => {
const createWorkspace = (input: { projectID: Project.Info["id"]; type: string; adaptor: WorkspaceAdaptor }) =>
Effect.acquireRelease(
Effect.promise(async () => {
Effect.gen(function* () {
registerAdaptor(input.projectID, input.type, input.adaptor)
return Workspace.create({
const workspace = yield* Workspace.Service
return yield* workspace.create({
type: input.type,
branch: null,
extra: null,
projectID: input.projectID,
})
}),
(workspace) => Effect.promise(() => Workspace.remove(workspace.id)).pipe(Effect.ignore),
(info) => Workspace.Service.use((workspace) => workspace.remove(info.id)).pipe(Effect.ignore),
)
const createRemoteWorkspace = (input: {