refactor(init): move init logic to action pattern#845
Conversation
|
Claude finished @mttdnt's task in 3m 28s —— View job PR Review
ChangesetThis PR is tagged as a refactor, but the latest commit ( Issues1. if (dataset && opts.unattended) {
return {datasetName: dataset, userAction: 'none'}
}In unattended mode with 2. Inconsistency in Three code paths for unattended + projectId behave inconsistently:
The middle case throws even when a specific if (projects.length === 0 && unattended && !projectId) {
throw new InitError('No projects found for current user', 1)
}3. Missing test for the restored unattended behavior The commit |
This stack of pull requests is managed by Graphite. Learn more about stacking. |
📦 Bundle Stats —
|
| Metric | Value | vs main (e902217) | vs v6.2.1 |
|---|---|---|---|
| Internal (raw) | 2.1 KB | - | - |
| Internal (gzip) | 799 B | - | - |
| Bundled (raw) | 11.06 MB | - | +9.12 MB, +470.6% |
| Bundled (gzip) | 2.07 MB | - | +1.60 MB, +335.8% |
| Import time | 844ms | +0ms, +0.0% | +27ms, +3.3% |
bin:sanity
| Metric | Value | vs main (e902217) | vs v6.2.1 |
|---|---|---|---|
| Internal (raw) | 975 B | - | - |
| Internal (gzip) | 460 B | - | - |
| Bundled (raw) | 9.83 MB | - | +9.12 MB, +1286.7% |
| Bundled (gzip) | 1.77 MB | - | +1.60 MB, +940.0% |
| Import time | NaNs | - | NaNs, NaN% |
🗺️ 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 (e9022171) · v1.2.1 (npm)
| Metric | Value | vs main (e902217) | vs v1.2.1 |
|---|---|---|---|
| Internal (raw) | 92.2 KB | - | +3.9 KB, +4.4% |
| Internal (gzip) | 21.6 KB | - | +1.1 KB, +5.5% |
| Bundled (raw) | 21.64 MB | - | +9.08 MB, +72.3% |
| Bundled (gzip) | 3.43 MB | - | +1.58 MB, +85.9% |
| Import time | 790ms | +3ms, +0.4% | +39ms, +5.2% |
🗺️ 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.
Coverage Delta
Comparing 11 changed files against main @ Overall Coverage
|
📦 Bundle Stats —
|
| Metric | Value | vs main (9a7e204) |
|---|---|---|
| Internal (raw) | 2.1 KB | - |
| Internal (gzip) | 799 B | - |
| Bundled (raw) | 10.94 MB | - |
| Bundled (gzip) | 2.05 MB | - |
| Import time | 837ms | +5ms, +0.5% |
bin:sanity
| Metric | Value | vs main (9a7e204) |
|---|---|---|
| Internal (raw) | 975 B | - |
| Internal (gzip) | 460 B | - |
| Bundled (raw) | 9.84 MB | - |
| Bundled (gzip) | 1.77 MB | - |
| Import time | 2.01s | +20ms, +1.0% |
🗺️ 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 (9a7e2044)
| Metric | Value | vs main (9a7e204) |
|---|---|---|
| Internal (raw) | 93.1 KB | - |
| Internal (gzip) | 21.9 KB | - |
| Bundled (raw) | 21.62 MB | - |
| Bundled (gzip) | 3.42 MB | - |
| Import time | 811ms | +17ms, +2.2% |
🗺️ 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 (9a7e2044)
| Metric | Value | vs main (9a7e204) |
|---|---|---|
| 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.
Coverage Delta
Comparing 11 changed files against main @ Overall Coverage
|
Coverage Delta
Comparing 11 changed files against main @ Overall Coverage
|
Behavior present on main but lost when bundled-create was rebased (commits predate these fixes): - Pass --missing to dataset import - Allow --bare mode without --output-path in unattended mode - Default to "production" dataset in unattended mode without --dataset Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

refactor(init): move init logic to action pattern (#748)
refactor(init): split init flows into separate functions (#753)