Repository navigation
fix(deps): update dependency ink to v8 - #197
Conversation
dawsontoth
left a comment
There was a problem hiding this comment.
The red Typecheck is real: ink 8 narrows the type of useStdout().stdout. It changed from NodeJS.WriteStream to NodeJS.WritableStream, so ink/library/useTerminalSize.ts no longer typechecks. That file reads rows, columns and isTTY, which gives 5 TS2339 errors at lines 7, 8, 12, 18 and 19.
Ink 8 now ships a useWindowSize() hook that returns { columns, rows } and re-renders on resize, which is exactly what our hook does by hand. I verified this replacement on the branch:
import { useWindowSize } from 'ink';
export function useTerminalSize() {
return useWindowSize();
}With that change at 63cb41fb (Node 24.21), typecheck, build, lint and dprint all exit 0. Vitest passes 53 files / 345 tests, and that includes ink/main.test.tsx with COLUMNS=200. The four callers (VirtualList, ActionsView, ChatContent, DiffApprovalView) keep the same return shape.
One more thing to know: ink-stepper@0.2.3, the latest release, still peers ink ^6.6.0 || ^7.0.0. Renovate also bumped our overrides.ink-stepper.ink to ^8.0.0, so the stepper is being forced onto an ink major it doesn't declare support for. Tests pass, but ink-stepper has regressed before on small bumps, so please click through the setup walkthrough once before merging.
ink 8 types useStdout().stdout as NodeJS.WritableStream, which has no
rows, columns or isTTY, so the hand-rolled resize hook no longer
typechecks. ink 8 ships useWindowSize(), which returns the same
{ columns, rows } shape and re-renders on resize.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dawsontoth
left a comment
There was a problem hiding this comment.
Approving with the ink 8 fix (1f9f320): useTerminalSize now uses ink's useWindowSize(). Typecheck, Build, Lint, Format and Test are all green. Before merging, click through the setup walkthrough once: ink-stepper 0.2.3 still peers ink ≤7 and is only forced onto 8 by overrides.
|
🎉 This PR is included in version 0.16.85 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This PR contains the following updates:
^7.0.0→^8.0.0Release Notes
vadimdemedes/ink (ink)
v8.0.0Compare Source
Breaking
7829102minWidthandmaxWidthon<Box>now only accept numbers (#1029)7cd7fd9stdin,stdout, andstderrare now typed as generic Node.js streams (#981)eb82d8frender()options and touseStdin(),useStdout(), anduseStderr(). TTY-only properties likestdout.columnsare no longer part of the typesuseInputno longer receives unrecognized terminal control sequences (#1014)c76893einputwith the ESC stripped, as if typed. They are now droppedNew
contentOffsetXandcontentOffsetYprops to<Box>for building scrollable views (#765)3ba5828overflow="hidden". See the scroll exampleclientWidthandclientHeighttouseBoxMetrics()andmeasureElement()(#988)3ba5828stdin,stdout, andstderroptions ofrender()(#981)eb82d8fPassThroughor otherReadable/Writablestreams. Raw mode is used only whenstdinis a TTY withsetRawMode()incrementalRenderingmode (#1036)91eb50awsdependency in favor of the nativeWebSocketfor React DevTools (#976)33567edkey.returnb73ebf4Fixes
Rendering
fe1d123clear()494ebebclear()fc358c2f603aebc800284cdc18fa06385e9013feb29a501e4507c0c9509ea75<Transform>line indices when clipping4f3c7aa<Static>and nested<Text>753a5f8undefined274b15afc685bconRenderafter the frame is written83d7de5<Static><Static>output on full-clear frames (#1005)d661543<Static>output when resuming re-enters the alternate screen (#1012)9235028793fe59<Static>output after abandoned concurrent renders8678b76<Static>output when its identity changescfdd9e6<Static>rowsf6b2620c0fa4ef5911f44staticNodereference on indirect subtree removal (#979)5448e6bText
4b4493436f5624<Text>vanishing when it starts above the top of the output (#1001)77aba4a405f7512fbc26a32dc266b419e5c80b1c9cb0dfd619dfe1377fe1577f7e57a5064df65<Transform>wrap points changefc685bc9c323f61e57b233be9ed7Input
2ee828creportAssociatedTextnow enablesreportAllKeysAsEscapeCodesautomatically13707d236d7739onKittyQueryResponsestable acrossrerender()calls (#1007)70beca561004d7suspendTerminal()handles idempotent, and do not restore input modes that were released or belong to an unmounted appa7297c4b35e89ac613707a6789fbFocus
02ae1e5disableFocus()blur the focused component as documented, and respect it when new components auto-focusd130588d130588f6f7dc7Other
<Transform>labels, rewrapping when the terminal widens, and restoring output after console writes (#1028)f480301bebfe2d81e2451renderToString()swallowing thrownundefined, and run effect cleanup when output rendering fails9f7c1d0useWindowSize()missing resizes before it subscribesfab670b53244dcuseAnimation()values while pausedf25d312render()options that areundefined659249dad9e3eawrapTextcache returning results for the wrong text or width (#998)3809acc064b4f6waitUntilExit()after unmount1fcd380Migration guide
React 19.3
Upgrade
react(and@types/react) to 19.3 or later.minWidthandmaxWidthUse a number. If you need a relative minimum or maximum width, compute it from
useWindowSize()oruseBoxMetrics()of the parent.Stream types
useStdout().stdoutis now typed asNodeJS.WritableStream, so TTY properties likecolumnsandrowsare no longer available in the types. UseuseWindowSize()instead, which also re-renders on resize.Control sequences in
useInputIf your
useInputhandler parsed mouse reports, focus events, or other terminal replies frominput, it will no longer receive them. Keys that Ink recognizes, including Kitty keyboard protocol events, are not affected.Configuration
📅 Schedule: (in timezone America/New_York)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
This PR was generated by Mend Renovate. View the repository job log.