fix(build): replace require() with dynamic import() in cross-spawn-spawner (#20580)

pull/20444/head
Kit Langton 2026-04-01 21:55:35 -04:00 committed by GitHub
parent 0cad775427
commit e148b318b7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 5 deletions

View File

@ -491,12 +491,13 @@ export const defaultLayer = layer.pipe(Layer.provide(NodeFileSystem.layer), Laye
import { lazy } from "@/util/lazy" import { lazy } from "@/util/lazy"
const rt = lazy(() => { const rt = lazy(async () => {
// Dynamic import to avoid circular dep: cross-spawn-spawner → run-service → Instance → project → cross-spawn-spawner // Dynamic import to avoid circular dep: cross-spawn-spawner → run-service → Instance → project → cross-spawn-spawner
const { makeRuntime } = require("@/effect/run-service") as typeof import("@/effect/run-service") const { makeRuntime } = await import("@/effect/run-service")
return makeRuntime(ChildProcessSpawner, defaultLayer) return makeRuntime(ChildProcessSpawner, defaultLayer)
}) })
export const runPromiseExit: ReturnType<typeof rt>["runPromiseExit"] = (...args) => type RT = Awaited<ReturnType<typeof rt>>
rt().runPromiseExit(...(args as [any])) export const runPromiseExit: RT["runPromiseExit"] = async (...args) =>
export const runPromise: ReturnType<typeof rt>["runPromise"] = (...args) => rt().runPromise(...(args as [any])) (await rt()).runPromiseExit(...(args as [any]))
export const runPromise: RT["runPromise"] = async (...args) => (await rt()).runPromise(...(args as [any]))