Skip to content

fix(core): add typegen to CLI config type#283

Merged
binoy14 merged 2 commits intomainfrom
01-12-fix_core_add_typegen_to_cli_config_type
Jan 14, 2026
Merged

fix(core): add typegen to CLI config type#283
binoy14 merged 2 commits intomainfrom
01-12-fix_core_add_typegen_to_cli_config_type

Conversation

@binoy14
Copy link
Contributor

@binoy14 binoy14 commented Jan 12, 2026

No description provided.

Copy link
Contributor Author

binoy14 commented Jan 12, 2026

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

@claude
Copy link

claude bot commented Jan 12, 2026

Claude finished @binoy14's task in 1m 34s —— View job


Code Review

  • Read changed files
  • Analyze implementation
  • Post review findings

Issues Found

1. Type mismatch between schema and type definition

The schema (schemas.ts:78) uses z.custom<TypeGenConfig>() while the type definition (cliConfig.ts:89) uses Partial<TypeGenConfig>. These should match.

Fix: Change the schema to match the type definition:

typegen: z.custom<Partial<TypeGenConfig>>().optional(),

2. Version inconsistency

@sanity/codegen is added as ^5.2.0 in cli-core, but original-cli uses ^5.1.0 (see packages/@sanity/original-cli/package.json:85).

Recommendation: Align the versions across packages for consistency, unless there's a specific reason for the version bump.

3. Missing test coverage

No tests were added for the new typegen configuration option.

Recommendation: Add tests to verify the typegen config is properly validated and typed.

@github-actions
Copy link

github-actions bot commented Jan 12, 2026

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 77.12% 5489 / 7117
🔵 Statements 76.33% 5631 / 7377
🔵 Functions 68.33% 818 / 1197
🔵 Branches 64.17% 2442 / 3805
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/@sanity/cli-core/src/config/cli/schemas.ts 100% 100% 100% 100%
Generated in workflow #1464 for commit f6d2632 by the Vitest Coverage Report Action

@github-actions
Copy link

github-actions bot commented Jan 12, 2026

Preview this PR with pkg.pr.new

Run the Sanity CLI

npx https://pkg.pr.new/sanity-io/cli/@sanity/cli@f6d2632 <command>

...Or upgrade project dependencies

📦 @sanity/cli
pnpm install https://pkg.pr.new/@sanity/cli@f6d2632
📦 @sanity/cli-core
pnpm install https://pkg.pr.new/@sanity/cli-core@f6d2632
📦 @sanity/cli-test
pnpm install https://pkg.pr.new/@sanity/cli-test@f6d2632
📦 @sanity/eslint-config-cli
pnpm install https://pkg.pr.new/@sanity/eslint-config-cli@f6d2632

View Commit (f6d2632)

@binoy14 binoy14 marked this pull request as ready for review January 13, 2026 00:46
@binoy14 binoy14 requested a review from a team as a code owner January 13, 2026 00:46
@binoy14 binoy14 requested review from ryanbonial and removed request for a team January 13, 2026 00:46
@binoy14 binoy14 merged commit 11be33a into main Jan 14, 2026
23 checks passed
@binoy14 binoy14 deleted the 01-12-fix_core_add_typegen_to_cli_config_type branch January 14, 2026 19:13
@squiggler-legacy squiggler-legacy bot mentioned this pull request Jan 14, 2026
@squiggler-app squiggler-app bot mentioned this pull request Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants