Unified · Split
| @@ -42,10 +42,21 @@ export type ServerHandlers = { · 41 unmodified lines | ||
| 42 | 42 | }; |
| 43 | 43 | |
| 44 | 44 | const closeServerHandlers = async (handlers: ServerHandlers): Promise<void> => { |
| 45 | − await Promise.all([ | |
| 46 | − handlers.api.dispose().catch(() => undefined), | |
| 47 | − handlers.mcp.close().catch(() => undefined), | |
| 48 | − ]); | |
| 45 | + await Effect.runPromise( | |
| 46 | + Effect.all( | |
| 47 | + [ | |
| 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 | 62 | export const createServerHandlers = async (): Promise<ServerHandlers> => { |
| @@ -107,5 +118,10 @@ export const getServerHandlers = (): Promise<ServerHandlers> => · 55 unmodified lines | ||
| 107 | 118 | serverHandlersRuntime.runPromise(ServerHandlersService.asEffect()); |
| 108 | 119 | |
| 109 | 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 | 6 | import { tanstackRouter } from "@tanstack/router-plugin/vite"; |
| 7 | 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 | 10 | const rootPackage = JSON.parse( |
| 10 | 11 | readFileSync(new URL("../../package.json", import.meta.url), "utf8"), |
| 11 | 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 | 15 | const cliPackage = JSON.parse( |
| 14 | 16 | readFileSync(new URL("../cli/package.json", import.meta.url), "utf8"), |
| 15 | 17 | ) as { version?: string }; |
| @@ -43,6 +45,7 @@ function executorApiPlugin(): Plugin { · 27 unmodified lines | ||
| 43 | 45 | |
| 44 | 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 | 49 | try { |
| 47 | 50 | if (!handlers) { |
| 48 | 51 | const { getServerHandlers } = await import("./src/server/main"); |