Skip to content

chore(cli): migrate @fern-api/cli-migrations to use CliError#14991

Draft
FedeZara wants to merge 1 commit intomainfrom
FedeZara/refactor/cli-error-cli-migrations
Draft

chore(cli): migrate @fern-api/cli-migrations to use CliError#14991
FedeZara wants to merge 1 commit intomainfrom
FedeZara/refactor/cli-error-cli-migrations

Conversation

@FedeZara
Copy link
Copy Markdown
Contributor

@FedeZara FedeZara commented Apr 14, 2026

Description

Migrates @fern-api/cli-migrations to use explicit CliError error codes on every failAndThrow / failWithoutThrowing call site.

This is one of the package migration PRs that follow the error classification system introduced in #14749.

Changes Made

Assigned typed error codes across 36 files in packages/cli/cli-migrations/src/, covering every failAndThrow and failWithoutThrowing invocation. Also added missing CliError imports to all migration files that reference CliError.Code.

Error codes used

Code Usage
CONFIG_ERROR Fern directory not found, generators.yml missing/invalid, missing configuration
PARSE_ERROR Failed YAML migrations, malformed schema objects, invalid type/union/error maps
VALIDATION_ERROR Invalid migration targets, schema validation during upgrades

Files touched (grouped by area)

  • Run migrations: runMigrations.ts
  • Early migrations (0.0.x): discriminant/, union-single-property-key/, add-mode-to-draft-generators/, remove-inline-error-declarations/, add-publishing-to-release-generators/, rename-alias-key-to-type/, add-error-discriminant/, add-generator-groups/, add-error-discrimination-config/
  • Mid migrations (0.1.x-0.9.x): add-inline-requests/, add-value-key-to-type-examples/, change-services-key-to-service/, move-service-docs-to-top-level/, require-generators-yml/, use-generators-yml-specs/, add-path-parameter-order-setting/, add-suffix-to-docs-domain/
  • Late migrations (1.0+): update-settings-defaults/ (1.0.0 and 2.0.0-rc0), migrate-deprecated-generator-api-settings/, enable-smart-casing/, update-directory-structure/

Testing

  • Existing tests pass (pnpm test, excluding e2e and pre-existing environment failures)

@FedeZara FedeZara changed the title refactor(cli): rename FernCliError to TaskAbortSignal chore(cli): migrate @fern-api/cli-migrations to use CliError Apr 14, 2026
Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@FedeZara FedeZara force-pushed the FedeZara/refactor/cli-error-cli-migrations branch from 53466cc to 1598453 Compare April 14, 2026 22:36
@FedeZara FedeZara force-pushed the FedeZara/refactor/cli-error-cli-migrations branch from 1598453 to 19354ff Compare April 15, 2026 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant