authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-02-24 14:17:52-08:00
committergravatar for jmarminge@gmail.comJulius Marminge <jmarminge@gmail.com> 2026-02-26 13:20:36-08:00
logc9b0da63a11f6668619c0fc1c3901a5e84fe1d65
tree5e8d0658d2195ff69a35bb6b5a15909b2afb67d8
parent33ca29c2656ec6acd8986c210516f66b4a898fa9

niceee


2 files changed, 7 insertions(+), 8 deletions(-)

apps/server/src/main.test.ts+1-1
......@@ -24,7 +24,7 @@ const testLayer = Layer.mergeAll(
2424 cwd: "/tmp/t3-test-workspace",
2525 fixPath: Effect.void,
2626 findAvailablePort,
27 resolveStaticDir: () => Effect.undefined,
27 resolveStaticDir: Effect.undefined,
2828 } satisfies CliConfigShape),
2929 Layer.succeed(Server, {
3030 createServer,
apps/server/src/main.ts+6-7
......@@ -26,7 +26,7 @@ export interface CliConfigShape {
2626 readonly cwd: string;
2727 readonly fixPath: Effect.Effect<unknown, never>;
2828 readonly findAvailablePort: (preferred: number) => Effect.Effect<number, StartupError>;
29 readonly resolveStaticDir: () => Effect.Effect<string | undefined>;
29 readonly resolveStaticDir: Effect.Effect<string | undefined>;
3030}
3131
3232export class CliConfig extends ServiceMap.Service<CliConfig, CliConfigShape>()(
......@@ -141,7 +141,7 @@ const resolveCliConfig = Effect.fn(function* (input: CliInput) {
141141 const devUrl = env.devUrl;
142142 const noBrowser = env.noBrowser ?? mode === "desktop";
143143 const authToken = Option.getOrUndefined(input.token) ?? env.authToken;
144 const staticDir = devUrl ? undefined : yield* cliConfig.resolveStaticDir();
144 const staticDir = devUrl ? undefined : yield* cliConfig.resolveStaticDir;
145145
146146 return {
147147 mode,
......@@ -245,11 +245,10 @@ export const CliConfigLive = Layer.effect(
245245 cwd: process.cwd(),
246246 fixPath: Effect.sync(fixPath),
247247 findAvailablePort,
248 resolveStaticDir: () =>
249 resolveStaticDir().pipe(
250 Effect.provideService(FileSystem.FileSystem, fileSystem),
251 Effect.provideService(Path.Path, path),
252 ),
248 resolveStaticDir: resolveStaticDir().pipe(
249 Effect.provideService(FileSystem.FileSystem, fileSystem),
250 Effect.provideService(Path.Path, path),
251 ),
253252 } satisfies CliConfigShape;
254253 }),
255254);