refactor: move internal build logic to cli-build package#1412
Open
snocorp wants to merge 2 commits into
Open
Conversation
Contributor
📦 Bundle Stats —
|
| Metric | Value | vs main (65e9ebf) |
|---|---|---|
| Internal (raw) | 2.7 KB | - |
| Internal (gzip) | 1.0 KB | - |
| Bundled (raw) | 11.16 MB | - |
| Bundled (gzip) | 2.10 MB | - |
| Import time | 827ms | -12ms, -1.4% |
bin:sanity
| Metric | Value | vs main (65e9ebf) |
|---|---|---|
| Internal (raw) | 782 B | - |
| Internal (gzip) | 423 B | - |
| Bundled (raw) | 9.87 MB | - |
| Bundled (gzip) | 1.78 MB | - |
| Import time | 2.14s | -65ms, -2.9% |
🗺️ 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 (65e9ebfc)
| Metric | Value | vs main (65e9ebf) |
|---|---|---|
| Internal (raw) | 106.7 KB | - |
| Internal (gzip) | 26.7 KB | - |
| Bundled (raw) | 21.72 MB | - |
| Bundled (gzip) | 3.46 MB | - |
| Import time | 708ms | -26ms, -3.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 (65e9ebfc)
| Metric | Value | vs main (65e9ebf) |
|---|---|---|
| Internal (raw) | 908 B | - |
| Internal (gzip) | 483 B | - |
| Bundled (raw) | 931 B | - |
| Bundled (gzip) | 491 B | - |
| 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 6 changed files against main @ Overall Coverage
|
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
This is the last PR needed before integrating the build logic into the runtime CLI. The logic for building studios and apps has been ported to the cli-build package.
Note
This is a breaking change for the cli-build package as it removed some un used exports. The cli package is the only dependent of the cli-build package so this is a safe bump.
Testing
Tests were ported or updated as needed. Note that I did not port the buildStaticFiles test as it requires a fixture that is not available in the cli-build package and would add a lot of complexity just for that one test suite if ported.
Note
Medium Risk
Large refactor of the build command path; behavior is intended to be preserved via ported tests, but
@sanity/cli-buildis a breaking major for internal export consumers.Overview
Moves the full studio and app build orchestration from
@sanity/cliinto@sanity/cli-build, so the runtime CLI can call the same paths without duplicating Vite/auto-updates logic.buildAppandbuildStudionow live in cli-build with a flag-freeBuildOptionsAPI—CLI actions only mapcliConfig/flagsand inject CLI-specific hooks (checkAppId,compareDependencyVersions,upgradePackages,determineBasePath).@sanity/cli-build/_internal/buildis updated accordingly (major: drops some unused exports, addsbuildApp/buildStudioand shared compare types).Tests for build behavior move to cli-build (injected deps); CLI keeps thinner appId-warning tests that mock the internal builders.
Reviewed by Cursor Bugbot for commit 5a9db03. Bugbot is set up for automated code reviews on this repo. Configure here.