Skip to content

Commit 21e744b

Browse files
committed
chore: bug fix and new version
1 parent 908d9a5 commit 21e744b

4 files changed

Lines changed: 21 additions & 8 deletions

File tree

packages/cli/cli-v2/src/__test__/GeneratorPipeline.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function makeTarget(overrides: Partial<Target>): Target {
3232
describe("GeneratorPipeline", () => {
3333
describe("custom registry constraint", () => {
3434
it("rejects custom registry with remote generation", async () => {
35-
const context = createTestContext({ cwd: AbsoluteFilePath.of("/tmp") });
35+
const context = await createTestContext({ cwd: AbsoluteFilePath.of("/tmp") });
3636
const pipeline = new GeneratorPipeline({ context, cliVersion: "0.0.0" });
3737
const task = createMockTask();
3838

@@ -50,7 +50,7 @@ describe("GeneratorPipeline", () => {
5050
});
5151

5252
it("allows undefined registry with remote generation", async () => {
53-
const context = createTestContext({ cwd: AbsoluteFilePath.of("/tmp") });
53+
const context = await createTestContext({ cwd: AbsoluteFilePath.of("/tmp") });
5454
const pipeline = new GeneratorPipeline({ context, cliVersion: "0.0.0" });
5555
const task = createMockTask();
5656

packages/cli/cli-v2/src/commands/api/compile/command.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Audiences } from "@fern-api/configuration";
22
import { streamObjectToFile } from "@fern-api/fs-utils";
3-
import { CliError, TaskAbortSignal } from "@fern-api/task-context";
3+
import { CliError } from "@fern-api/task-context";
44

55
import chalk from "chalk";
66
import { JsonStreamStringify } from "json-stream-stringify";
@@ -117,7 +117,7 @@ export class CompileCommand {
117117
`${violation.displayRelativeFilepath}:${violation.line}:${violation.column}: ${violation.message}`
118118
);
119119
}
120-
throw new TaskAbortSignal();
120+
throw CliError.validationError(`API '${apiName}' has ${result.violations.length} validation errors`);
121121
}
122122
}
123123

packages/cli/cli/versions.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
11
# yaml-language-server: $schema=../../../fern-versions-yml.schema.json
2+
3+
- version: 4.67.0
4+
changelogEntry:
5+
- summary: |
6+
Unify CLI error reporting under a single `CliError` type. The previous
7+
`LoggableFernCliError` type has been removed in favor of the shared
8+
`CliError` from `@fern-api/task-context`. Sentry reporting for
9+
unclassified errors is temporarily disabled while error classification
10+
is improved.
11+
type: chore
12+
createdAt: "2026-04-10"
13+
irVersion: 66
14+
215
- version: 4.66.1
316
changelogEntry:
417
- summary: |

packages/seed/src/TaskContextImpl.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import { addPrefixToString } from "@fern-api/core-utils";
44
import { createLogger, LogLevel } from "@fern-api/logger";
55
import {
6-
type CliErrorCode,
6+
CliError,
77
CreateInteractiveTaskParams,
88
Finishable,
99
InteractiveTaskContext,
@@ -79,18 +79,18 @@ export class TaskContextImpl implements Startable<TaskContext>, Finishable, Task
7979

8080
public takeOverTerminal: (run: () => void | Promise<void>) => Promise<void>;
8181

82-
public failAndThrow(message?: string, error?: unknown, _options?: { code?: CliErrorCode }): never {
82+
public failAndThrow(message?: string, error?: unknown, _options?: { code?: CliError.Code }): never {
8383
this.failWithoutThrowing(message, error);
8484
this.finish();
8585
throw new TaskAbortSignal();
8686
}
8787

88-
public failWithoutThrowing(message?: string, error?: unknown, _options?: { code?: CliErrorCode }): void {
88+
public failWithoutThrowing(message?: string, error?: unknown, _options?: { code?: CliError.Code }): void {
8989
logErrorMessage({ message, error, logger: this.logger });
9090
this.result = TaskResult.Failure;
9191
}
9292

93-
public captureException(_error: unknown, _code?: CliErrorCode): void {
93+
public captureException(_error: unknown, _code?: CliError.Code): void {
9494
// no-op in seed context
9595
}
9696

0 commit comments

Comments
 (0)