fix(cli): pass schemaExtraction config through to build#1002
Merged
Conversation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Claude finished @binoy14's task in 1m 32s —— View job Review
Missing log message in
Changeset Bump type (patch) and summary are appropriate. |
Contributor
📦 Bundle Stats —
|
| Metric | Value | vs main (09f6d9e) |
|---|---|---|
| Internal (raw) | 2.1 KB | - |
| Internal (gzip) | 799 B | - |
| Bundled (raw) | 10.94 MB | - |
| Bundled (gzip) | 2.05 MB | - |
| Import time | 854ms | -2ms, -0.2% |
bin:sanity
| Metric | Value | vs main (09f6d9e) |
|---|---|---|
| Internal (raw) | 975 B | - |
| Internal (gzip) | 460 B | - |
| Bundled (raw) | 9.84 MB | - |
| Bundled (gzip) | 1.77 MB | - |
| Import time | 2.03s | -3ms, -0.1% |
🗺️ View treemap · Artifacts
Details
- Import time regressions over 10% are flagged with
⚠️ - Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.
📦 Bundle Stats — @sanity/cli-core
Compared against main (09f6d9e6)
| Metric | Value | vs main (09f6d9e) |
|---|---|---|
| Internal (raw) | 93.8 KB | - |
| Internal (gzip) | 21.9 KB | - |
| Bundled (raw) | 21.62 MB | - |
| Bundled (gzip) | 3.42 MB | - |
| Import time | 797ms | -13ms, -1.6% |
🗺️ View treemap · Artifacts
Details
- Import time regressions over 10% are flagged with
⚠️ - Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.
📦 Bundle Stats — create-sanity
Compared against main (09f6d9e6)
| Metric | Value | vs main (09f6d9e) |
|---|---|---|
| Internal (raw) | 976 B | - |
| Internal (gzip) | 507 B | - |
| Bundled (raw) | 50.7 KB | - |
| Bundled (gzip) | 12.6 KB | - |
| Import time | ❌ ChildProcess denied: node | - |
Details
- Import time regressions over 10% are flagged with
⚠️ - Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.
Contributor
Coverage Delta
Comparing 3 changed files against main @ Overall Coverage
|
kbrabrand
approved these changes
Apr 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The
schemaExtractionconfig fromsanity.cli.tswas not being passed through to the Vite build pipeline duringsanity build(both studio and app builds). This was a gap from the CLI migration — the dev server path (sanity dev) correctly wired it through, but the build path did not.This means users with
schemaExtraction: { enabled: true }in theirsanity.cli.tswould see schema extraction work during development but silently be skipped during production builds.What to review
buildStaticFiles.ts— AddedschemaExtractiontoStaticBuildOptionsand threaded it through togetViteConfigbuildStudio.ts— PassescliConfig?.schemaExtractiontobuildStaticFilesand logs an info message when enabled (matching old CLI behavior)buildApp.ts— Same pass-through for the app build pathTesting
Existing
getViteConfigtests (25/25 passing) already cover schema extraction in the Vite config layer. The fix threads the config through to that layer which was previously unreachable from the build path.🤖 Generated with Claude Code
Note
Low Risk
Small, additive wiring/logging change that only affects builds when
schemaExtractionis configured and enabled.Overview
sanity buildnow threadsschemaExtractionfromsanity.cli.tsthrough the production build pipeline so schema extraction is applied during Studio and App builds.This adds
schemaExtractiontobuildStaticFilesoptions (and forwards it togetViteConfig), passes the config from bothbuildStudioandbuildApp, and logs an info message when schema extraction is enabled. A patch changeset is included.Reviewed by Cursor Bugbot for commit 4f5ef6c. Bugbot is set up for automated code reviews on this repo. Configure here.