| ... | @@ -26,7 +26,7 @@ export interface CliConfigShape { | ... | @@ -26,7 +26,7 @@ export interface CliConfigShape { |
| 26 | readonly cwd: string; | 26 | readonly cwd: string; |
| 27 | readonly fixPath: Effect.Effect<unknown, never>; | 27 | readonly fixPath: Effect.Effect<unknown, never>; |
| 28 | readonly findAvailablePort: (preferred: number) => Effect.Effect<number, StartupError>; | 28 | readonly findAvailablePort: (preferred: number) => Effect.Effect<number, StartupError>; |
| 29 | readonly resolveStaticDir: () => Effect.Effect<string | undefined>; | 29 | readonly resolveStaticDir: Effect.Effect<string | undefined>; |
| 30 | } | 30 | } |
| 31 | | 31 | |
| 32 | export class CliConfig extends ServiceMap.Service<CliConfig, CliConfigShape>()( | 32 | export class CliConfig extends ServiceMap.Service<CliConfig, CliConfigShape>()( |
| ... | @@ -141,7 +141,7 @@ const resolveCliConfig = Effect.fn(function* (input: CliInput) { | ... | @@ -141,7 +141,7 @@ const resolveCliConfig = Effect.fn(function* (input: CliInput) { |
| 141 | const devUrl = env.devUrl; | 141 | const devUrl = env.devUrl; |
| 142 | const noBrowser = env.noBrowser ?? mode === "desktop"; | 142 | const noBrowser = env.noBrowser ?? mode === "desktop"; |
| 143 | const authToken = Option.getOrUndefined(input.token) ?? env.authToken; | 143 | const authToken = Option.getOrUndefined(input.token) ?? env.authToken; |
| 144 | const staticDir = devUrl ? undefined : yield* cliConfig.resolveStaticDir(); | 144 | const staticDir = devUrl ? undefined : yield* cliConfig.resolveStaticDir; |
| 145 | | 145 | |
| 146 | return { | 146 | return { |
| 147 | mode, | 147 | mode, |
| ... | @@ -245,11 +245,10 @@ export const CliConfigLive = Layer.effect( | ... | @@ -245,11 +245,10 @@ export const CliConfigLive = Layer.effect( |
| 245 | cwd: process.cwd(), | 245 | cwd: process.cwd(), |
| 246 | fixPath: Effect.sync(fixPath), | 246 | fixPath: Effect.sync(fixPath), |
| 247 | findAvailablePort, | 247 | findAvailablePort, |
| 248 | resolveStaticDir: () => | 248 | resolveStaticDir: resolveStaticDir().pipe( |
| 249 | resolveStaticDir().pipe( | 249 | Effect.provideService(FileSystem.FileSystem, fileSystem), |
| 250 | Effect.provideService(FileSystem.FileSystem, fileSystem), | 250 | Effect.provideService(Path.Path, path), |
| 251 | Effect.provideService(Path.Path, path), | 251 | ), |
| 252 | ), | | |
| 253 | } satisfies CliConfigShape; | 252 | } satisfies CliConfigShape; |
| 254 | }), | 253 | }), |
| 255 | ); | 254 | ); |