Skip to content

fix(deps): update runtime cli#1108

Closed
runeb wants to merge 3 commits into
mainfrom
codex/runtime-cli-tty-test
Closed

fix(deps): update runtime cli#1108
runeb wants to merge 3 commits into
mainfrom
codex/runtime-cli-tty-test

Conversation

@runeb
Copy link
Copy Markdown
Member

@runeb runeb commented May 20, 2026

Description

Bumps @sanity/runtime-cli from ^15.0.2 to ^15.1.1 and updates the init update-check tests to stub terminal window size when exercising TTY output.

This isolates the dependency that exposed the oclif screen-width assumption behind the failing Node 22/24 shards.

What to review

Review the package bump, generated lockfile update, and the checkForUpdates test setup/teardown around stdout/stderr.getWindowSize.

Testing

  • CI=true CLAUDECODE=1 PNPM_CONFIG_IGNORE_WORKSPACE=true pnpm exec vitest run packages/@sanity/cli/src/hooks/init/tests/checkForUpdates.test.ts
  • Result: 22 passed

Note

Low Risk
Low risk patch-level dependency bump; main behavioral impact is improved terminal width detection in non-TTY environments, with test-only stubbing changes to keep update-check tests stable.

Overview
Updates @sanity/cli to use @sanity/runtime-cli@^15.1.1 (and refreshes pnpm-lock.yaml) to address terminal width detection issues in non-TTY environments.

Adjusts checkForUpdates init-hook tests to explicitly stub and later restore process.stdout/stderr.getWindowSize, preventing failures when TTY-related screen-width APIs are assumed.

Reviewed by Cursor Bugbot for commit 480129a. Bugbot is set up for automated code reviews on this repo. Configure here.

@claude
Copy link
Copy Markdown

claude Bot commented May 20, 2026

Claude finished @runeb's task in 1m 21s —— View job


Review

No blocking issues. The dep bump, changeset, and test stubbing all look correct.

Changeset (.changeset/pr-1108.md)

  • Patch bump is appropriate for a dep update with no public API change.
  • Summary is concise and developer-focused. Good.

Dependency (packages/@sanity/cli/package.json:87)

  • ^15.0.2^15.1.1 — semver-compatible patch range, lockfile updated accordingly.

Test changes (checkForUpdates.test.ts)

  • The mockGetWindowSize / restoreGetWindowSize pair correctly handles the case where process.stdout.getWindowSize is undefined (the non-TTY shard scenario this PR is targeting). Capturing originals at module load, spying per-test, and cleaning up in afterAll via Reflect.deleteProperty is the right pattern.
  • vi.restoreAllMocks() in afterEach will leave the fallback () => windowSize function attached to the stream between tests in cases where the original was undefined. That's fine because beforeEach re-spies, and afterAll deletes it — just worth noting that the stream property identity changes mid-suite. No functional impact.

Minor (optional)

checkForUpdates.test.ts:64stream.getWindowSize ||= () => windowSize works, but ??= would be marginally more correct semantically (only assign when truly undefined, not on any falsy value). Not worth a re-push on its own; getWindowSize can't realistically be 0/""/null here.


  • Read changed files
  • Review package bump
  • Review test changes
  • Review changeset
  • Post review
    Branch

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 20, 2026

📦 Bundle Stats — @sanity/cli

Compared against main (5b4d3c08)

@sanity/cli

Metric Value vs main (5b4d3c0)
Internal (raw) 2.1 KB -
Internal (gzip) 799 B -
Bundled (raw) 10.97 MB -
Bundled (gzip) 2.06 MB -
Import time 838ms +10ms, +1.2%

bin:sanity

Metric Value vs main (5b4d3c0)
Internal (raw) 1023 B -
Internal (gzip) 486 B -
Bundled (raw) 9.84 MB -
Bundled (gzip) 1.77 MB -
Import time 1.97s +3ms, +0.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 — @sanity/cli-core

Compared against main (5b4d3c08)

Metric Value vs main (5b4d3c0)
Internal (raw) 96.2 KB -
Internal (gzip) 22.5 KB -
Bundled (raw) 21.61 MB -
Bundled (gzip) 3.42 MB -
Import time 793ms +1ms, +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 — create-sanity

Compared against main (5b4d3c08)

Metric Value vs main (5b4d3c0)
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.

@runeb runeb marked this pull request as ready for review May 20, 2026 00:40
@runeb runeb requested a review from a team as a code owner May 20, 2026 00:40
@runeb runeb requested a review from jonahsnider May 20, 2026 00:40
@runeb
Copy link
Copy Markdown
Member Author

runeb commented May 20, 2026

This PR is needed to unblock the test failures on #1081

@github-actions
Copy link
Copy Markdown
Contributor

Coverage Delta

No covered files changed in this PR.

Overall Coverage

Metric Coverage
Statements 84.3% (±0%)
Branches 74.3% (±0%)
Functions 84.2% (±0%)
Lines 84.8% (±0%)

@runeb runeb enabled auto-merge (squash) May 20, 2026 01:06
@runeb
Copy link
Copy Markdown
Member Author

runeb commented May 20, 2026

Picking #1111

@runeb runeb closed this May 20, 2026
auto-merge was automatically disabled May 20, 2026 16:20

Pull request was closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant