chore(cli): consolidate small CliError migration branches#15013
chore(cli): consolidate small CliError migration branches#15013
Conversation
37df560 to
fd464b8
Compare
fd464b8 to
0cf10c3
Compare
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
The two happy-path tests in loader.test.ts fall through to loadMigrationModule, which performs a real `npm install @fern-api/generator-migrations@latest`. That call is network-bound and regularly exceeds the 5s vitest default on CI, producing a flaky timeout (observed 2s–8s locally). Made-with: Cursor
SDK Generation Benchmark ResultsComparing PR branch against latest nightly baseline on Full benchmark table (click to expand)
main (generator): generator-only time via --skip-scripts (includes Docker image build, container startup, IR parsing, and code generation — this is the same Docker-based flow customers use via |
Docs Generation Benchmark ResultsComparing PR branch against latest nightly baseline on
Docs generation runs |

Description
Consolidates CliError migrations for multiple smaller CLI packages into a single PR:
@fern-api/init,@fern-api/project-loader,@fern-api/auth,@fern-api/api-workspace-validator,@fern-api/workspace-loader,@fern-api/docs-resolver,@fern-api/fern-definition-formatter,@fern-api/ir-to-jsonschema,@fern-api/login,@fern-api/api-workspace-commons, and others.This is one of the package migration PRs that follow the error classification system introduced in #14749.
Changes Made
Assigned typed error codes across call sites in multiple smaller CLI packages. Also added missing
CliErrorimports to all files that referenceCliError.Code.Error codes used
CONFIG_ERRORAUTH_ERRORNETWORK_ERRORVALIDATION_ERRORPARSE_ERRORREFERENCE_ERRORVERSION_ERRORFiles touched (grouped by area)
createFernDirectoryAndOrganization.ts,initializeWithMintlify.ts,initializeWithReadme.tsloadProject.tsorgs/createOrganizationIfDoesNotExist.ts,users/getCurrentUser.tsapi-workspace-validator/validateAPIWorkspaceAndLogIssues.ts,loader/loadAsyncAPIFile.ts,loader/loadOpenAPIFile.tsdocs-resolver/ApiReferenceNodeConverter.tsformatter/formatWorkspace.ts,ir-to-jsonschema/JsonSchemaConverterContext.tsauth0-login/doAuth0DeviceAuthorizationFlow.ts,askToLogin.tsapi-workspace-commons/checkVersionExists.tsTesting
pnpm test, excluding e2e and pre-existing environment failures)