Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions apps/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"fix:all": "nx run-many -t lint:fix fmt:fix knip:fix --projects=$npm_package_name"
},
"devDependencies": {
"@anthropic-ai/claude-agent-sdk": "^0.3.159",
"@anthropic-ai/claude-agent-sdk": "^0.3.160",
"@anthropic-ai/sdk": "^0.100.1",
"@clack/prompts": "^1.5.0",
"@effect/atom-react": "catalog:",
Expand All @@ -53,7 +53,7 @@
"@supabase/stack": "workspace:*",
"@tsconfig/bun": "catalog:",
"@types/bun": "catalog:",
"@types/react": "^19.2.15",
"@types/react": "^19.2.16",
"@typescript/native-preview": "catalog:",
"@vercel/detect-agent": "^1.2.3",
"@vitest/coverage-istanbul": "catalog:",
Expand All @@ -65,8 +65,8 @@
"oxfmt": "catalog:",
"oxlint": "catalog:",
"oxlint-tsgolint": "catalog:",
"posthog-node": "^5.35.8",
"react": "^19.2.6",
"posthog-node": "^5.35.11",
"react": "^19.2.7",
"react-devtools-core": "^7.0.1",
"semantic-release": "^25.0.3",
"smol-toml": "^1.6.1",
Expand Down
33 changes: 17 additions & 16 deletions apps/cli/src/next/commands/logs/logs.integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,9 @@ import { logs } from "./logs.handler.ts";
import { mockOutput, mockProcessControl, withEnv } from "../../../../tests/helpers/mocks.ts";
import { makeRunningStackFixture } from "../../../../tests/helpers/running-stack.ts";

const waitFor = Effect.fnUntraced(function* (
condition: () => boolean,
message: string,
attempts = 50,
) {
for (let attempt = 0; attempt < attempts; attempt++) {
if (condition()) {
return;
}
yield* Effect.sleep("1 millis");
}
throw new Error(message);
});
type LogsHistoryCompletion =
| { readonly type: "exit"; readonly code: number }
| { readonly type: "fiber"; readonly exit: Exit.Exit<unknown, unknown> };

describe("logs handler", () => {
it.live("shows a friendly failure when no local stack is running", () => {
Expand Down Expand Up @@ -78,10 +68,21 @@ describe("logs handler", () => {
noFollow: true,
}).pipe(Effect.provide(layer), Effect.forkChild({ startImmediately: true }));

yield* waitFor(
() => processControl.exitCalls.includes(0),
"logs command did not finish its history snapshot",
const completion: LogsHistoryCompletion = yield* Effect.race(
Effect.map(
processControl.awaitExit,
(code): LogsHistoryCompletion => ({ type: "exit", code }),
),
Effect.map(Fiber.await(fiber), (exit): LogsHistoryCompletion => ({ type: "fiber", exit })),
);
if (completion.type === "fiber") {
throw new Error(
Exit.isFailure(completion.exit)
? "logs command failed before finishing its history snapshot"
: "logs command completed before reporting process exit",
);
}
expect(completion.code).toBe(0);
yield* Fiber.interrupt(fiber);

expect(out.messages).toContainEqual(
Expand Down
8 changes: 6 additions & 2 deletions apps/cli/tests/helpers/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ export function mockProcessControl(
) {
let exitCode: number | undefined;
const exitCalls: number[] = [];
const exitDeferred = Deferred.makeUnsafe<number>();

return {
layer: Layer.succeed(ProcessControl, {
Expand All @@ -166,9 +167,11 @@ export function mockProcessControl(
awaitShutdown: opts.awaitShutdown ?? Effect.never,
holdSignals: (_signals) => Effect.void,
exit: (code: number) =>
Effect.sync(() => {
Effect.gen(function* () {
exitCalls.push(code);
}).pipe(Effect.flatMap(() => Effect.never)),
yield* Deferred.succeed(exitDeferred, code);
return yield* Effect.never;
}),
setExitCode: (code: number) =>
Effect.sync(() => {
exitCode = code;
Expand All @@ -178,6 +181,7 @@ export function mockProcessControl(
get exitCalls() {
return exitCalls;
},
awaitExit: Deferred.await(exitDeferred),
get exitCode() {
return exitCode;
},
Expand Down
8 changes: 4 additions & 4 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
"fumadocs-core": "^16.9.3",
"fumadocs-mdx": "^15.0.10",
"fumadocs-ui": "^16.9.3",
"next": "^16.2.6",
"react": "^19.2.6",
"react-dom": "^19.2.6"
"next": "^16.2.7",
"react": "^19.2.7",
"react-dom": "^19.2.7"
},
"devDependencies": {
"@types/mdx": "^2.0.13",
"@types/node": "^25.9.1",
"@types/react": "^19.2.15",
"@types/react": "^19.2.16",
"@types/react-dom": "^19.1.6",
"typescript": "^6.0.3"
},
Expand Down
Loading
Loading