feat: print all entries and schema URLs in non-TTY mode (#2226)#2227
feat: print all entries and schema URLs in non-TTY mode (#2226)#2227upupming merged 3 commits intolynx-family:mainfrom
Conversation
🦋 Changeset detectedLatest commit: 55273a4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
📝 WalkthroughWalkthroughA non-TTY handling path was added to the QR code plugin's registerConsoleShortcuts: when stdin or stdout is not a TTY, a new printNonTTY function prints all entries and their schema URLs in a structured format, invokes onPrint callbacks, and returns early instead of running the interactive loop. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
59ce3f0 to
62eaad6
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@packages/rspeedy/plugin-qrcode/src/shortcuts.ts`:
- Line 94: S_BAR_END is being pushed raw into the lines array while S_BAR
symbols are wrapped with color.gray; update the usage where
lines.push(`${S_BAR_END}`) is called so S_BAR_END is wrapped with color.gray
(same wrapper used for S_BAR) to keep bar symbol coloring consistent (locate the
lines.push call for S_BAR_END and mirror the color.gray(...) usage applied to
S_BAR).
🧹 Nitpick comments (1)
packages/rspeedy/plugin-qrcode/test/shortcuts.test.ts (1)
55-73: Consider usingafterEachforwriteSpycleanup to guard against assertion failures.If an assertion throws before
writeSpy.mockRestore()is reached, the spy leaks into subsequent tests. Moving the restore into anafterEach(or using vitest'svi.restoreAllMocksconfig) would be more robust.Also applies to: 108-131
…2226) In non-TTY environments (CI/CD, AI coding agents, piped output), the interactive loop was skipped and only the first entry's QR code was rendered — which is useless in these contexts. Now `registerConsoleShortcuts` detects non-TTY and prints a structured list of all entries with all schema URLs, buffered into a single write to avoid interleaving with other async output. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
62eaad6 to
4664951
Compare
Web Explorer#7772 Bundle Size — 383.74KiB (0%).55273a4(current) vs 98b2504 main#7766(baseline) Bundle metrics
|
| Current #7772 |
Baseline #7766 |
|
|---|---|---|
154.88KiB |
154.88KiB |
|
35.06KiB |
35.06KiB |
|
0% |
0% |
|
8 |
8 |
|
8 |
8 |
|
238 |
238 |
|
16 |
16 |
|
2.99% |
2.99% |
|
4 |
4 |
|
0 |
0 |
Bundle size by type no changes
| Current #7772 |
Baseline #7766 |
|
|---|---|---|
252.83KiB |
252.83KiB |
|
95.85KiB |
95.85KiB |
|
35.06KiB |
35.06KiB |
Bundle analysis report Branch knullptr:feat/no-tty Project dashboard
Generated by RelativeCI Documentation Report issue
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Merging this PR will degrade performance by 5.47%
Performance Changes
Comparing Footnotes
|
|
LGTM, thanks! |
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @lynx-js/react@0.116.4 ### Patch Changes - Support `ReactLynx::hooks::setState` trace for function components. ([#2198](#2198)) - fix: properly cleanup `__DestroyLifetime` listeners and listCallbacks in `snapshotDestroyList`. ([#2224](#2224)) ## @lynx-js/qrcode-rsbuild-plugin@0.4.6 ### Patch Changes - Print all entries with all schema URLs in non-TTY environments instead of only showing the first entry's QR code. ([#2227](#2227)) ## @lynx-js/react-rsbuild-plugin@0.12.9 ### Patch Changes - Add alias for `use-sync-external-store/with-selector.js` and `use-sync-external-store/shim/with-selector.js` pointing to @lynx-js/use-sync-external-store. ([#2200](#2200)) - Updated dependencies \[[`9033e2d`](9033e2d)]: - @lynx-js/template-webpack-plugin@0.10.4 - @lynx-js/react-alias-rsbuild-plugin@0.12.9 - @lynx-js/use-sync-external-store@1.5.0 - @lynx-js/react-refresh-webpack-plugin@0.3.4 - @lynx-js/react-webpack-plugin@0.7.4 - @lynx-js/css-extract-webpack-plugin@0.7.0 ## @lynx-js/css-serializer@0.1.4 ### Patch Changes - Move `cssChunksToMap` implementation from `@lynx-js/template-webpack-plugin` to `@lynx-js/css-serializer` for future reuse. ([#2269](#2269)) ## @lynx-js/web-core-wasm@0.0.4 ### Patch Changes - Refactor web element templates and server-side rendering logic ([#2205](#2205)) - Updated dependencies \[[`94e5779`](94e5779), [`9033e2d`](9033e2d)]: - @lynx-js/web-elements@0.11.3 - @lynx-js/css-serializer@0.1.4 ## @lynx-js/web-elements@0.11.3 ### Patch Changes - fix: firefox 147+ layout issue ([#2205](#2205)) ## @lynx-js/template-webpack-plugin@0.10.4 ### Patch Changes - Move `cssChunksToMap` implementation from `@lynx-js/template-webpack-plugin` to `@lynx-js/css-serializer` for future reuse. ([#2269](#2269)) - Updated dependencies \[[`9033e2d`](9033e2d)]: - @lynx-js/css-serializer@0.1.4 ## @lynx-js/react-alias-rsbuild-plugin@0.12.9 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
In non-TTY environments (CI/CD, AI coding agents, piped output), the interactive loop was skipped and only the first entry's QR code was rendered — which is useless in these contexts.
Now
registerConsoleShortcutsdetects non-TTY and prints a structured list of all entries with all schema URLs, buffered into a single write to avoid interleaving with other async output.Summary by CodeRabbit
Checklist