Showing the changes to apps (2 of 2 files). Show all
Unified · Split
| @@ -42,10 +42,21 @@ export type ServerHandlers = { · 41 unmodified lines | |||
| 42 | }; | 42 | }; |
| 43 | 43 | ||
| 44 | const closeServerHandlers = async (handlers: ServerHandlers): Promise<void> => { | 44 | const closeServerHandlers = async (handlers: ServerHandlers): Promise<void> => { |
| 45 | await Promise.all([ | 45 | await Effect.runPromise( |
| 46 | handlers.api.dispose().catch(() => undefined), | 46 | Effect.all( |
| 47 | handlers.mcp.close().catch(() => undefined), | 47 | [ |
| 48 | ]); | 48 | Effect.tryPromise({ |
| 49 | try: () => handlers.api.dispose(), | ||
| 50 | catch: (cause) => cause, | ||
| 51 | }).pipe(Effect.ignore), | ||
| 52 | Effect.tryPromise({ | ||
| 53 | try: () => handlers.mcp.close(), | ||
| 54 | catch: (cause) => cause, | ||
| 55 | }).pipe(Effect.ignore), | ||
| 56 | ], | ||
| 57 | { concurrency: "unbounded" }, | ||
| 58 | ), | ||
| 59 | ); | ||
| 49 | }; | 60 | }; |
| 50 | 61 | ||
| 51 | export const createServerHandlers = async (): Promise<ServerHandlers> => { | 62 | export const createServerHandlers = async (): Promise<ServerHandlers> => { |
| @@ -107,5 +118,10 @@ export const getServerHandlers = (): Promise<ServerHandlers> => · 55 unmodified lines | |||
| 107 | serverHandlersRuntime.runPromise(ServerHandlersService.asEffect()); | 118 | serverHandlersRuntime.runPromise(ServerHandlersService.asEffect()); |
| 108 | 119 | ||
| 109 | export const disposeServerHandlers = async (): Promise<void> => { | 120 | export const disposeServerHandlers = async (): Promise<void> => { |
| 110 | await serverHandlersRuntime.dispose().catch(() => undefined); | 121 | await Effect.runPromise( |
| 122 | Effect.tryPromise({ | ||
| 123 | try: () => serverHandlersRuntime.dispose(), | ||
| 124 | catch: (cause) => cause, | ||
| 125 | }).pipe(Effect.ignore), | ||
| 126 | ); | ||
| 111 | }; | 127 | }; |
| @@ -6,10 +6,12 @@ import tailwindcss from "@tailwindcss/vite"; · 5 unmodified lines | |||
| 6 | import { tanstackRouter } from "@tanstack/router-plugin/vite"; | 6 | import { tanstackRouter } from "@tanstack/router-plugin/vite"; |
| 7 | import executorVitePlugin from "@executor-js/vite-plugin"; | 7 | import executorVitePlugin from "@executor-js/vite-plugin"; |
| 8 | 8 | ||
| 9 | // oxlint-disable-next-line executor/no-json-parse -- boundary: Vite config reads package metadata from package.json | ||
| 9 | const rootPackage = JSON.parse( | 10 | const rootPackage = JSON.parse( |
| 10 | readFileSync(new URL("../../package.json", import.meta.url), "utf8"), | 11 | readFileSync(new URL("../../package.json", import.meta.url), "utf8"), |
| 11 | ) as { version: string; homepage?: string; repository?: string | { url?: string } }; | 12 | ) as { version: string; homepage?: string; repository?: string | { url?: string } }; |
| 12 | 13 | ||
| 14 | // oxlint-disable-next-line executor/no-json-parse -- boundary: Vite config reads package metadata from package.json | ||
| 13 | const cliPackage = JSON.parse( | 15 | const cliPackage = JSON.parse( |
| 14 | readFileSync(new URL("../cli/package.json", import.meta.url), "utf8"), | 16 | readFileSync(new URL("../cli/package.json", import.meta.url), "utf8"), |
| 15 | ) as { version?: string }; | 17 | ) as { version?: string }; |
| @@ -43,6 +45,7 @@ function executorApiPlugin(): Plugin { · 27 unmodified lines | |||
| 43 | 45 | ||
| 44 | if (!isApi && !isMcp) return next(); | 46 | if (!isApi && !isMcp) return next(); |
| 45 | 47 | ||
| 48 | // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: Vite middleware must convert handler failures into HTTP 500 responses | ||
| 46 | try { | 49 | try { |
| 47 | if (!handlers) { | 50 | if (!handlers) { |
| 48 | const { getServerHandlers } = await import("./src/server/main"); | 51 | const { getServerHandlers } = await import("./src/server/main"); |