feat(local): highlight JSON with twinkleplop - #1634
jared-outpost[bot] wants to merge 2 commits into
Conversation
Records a suitability evaluation of Twinkleplop as a replacement for cli-highlight in the terminal Markdown renderer. Concludes not to migrate: Twinkleplop has no terminal/ANSI rendering API, its benchmarks omit highlight.js, and it is not installable from npm to run a real comparison. Fixes #1633
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Jared, you need to implement this feature instead of telling if its good or not. Remove that file and start working on the implementation of this in spotlight |
replaces the shiki-based json highlighter in the local viewer with @twinkleplop/json. twinkleplop renders synchronously to class-based token spans, so the async highlighter setup is dropped and colors move to css variables scoped to .json-view (github light/dark palette). removes the earlier terminal-highlighting evaluation doc in favor of an actual implementation.
|
done — switched from an evaluation to the actual implementation. removed the eval doc and wired validation: note: this is the local viewer (web/HTML) JSON path, which is where twinkleplop's HTML output and its shiki/prism benchmarks apply. the terminal markdown renderer ( |
implements twinkleplop for JSON syntax highlighting in the local viewer ("spotlight"), replacing shiki.
per review feedback on the earlier evaluation, this ships the actual integration instead of a recommendation, and removes the evaluation doc.
what changed
apps/local/src/components/json-view.tsxnow highlights with@twinkleplop/json. twinkleplop renders synchronously to class-based token spans (<pre class="twinkleplop"><code>…<span class="tok string|number|boolean|keyword|punctuation">), so the asynccreateHighlighterCore/codeToHtmlpromise plumbing and thehtmlstate/useEffectare gone — the highlighted markup is computed inline during render, with a try/catch that keeps the plain escaped-source fallback.apps/local/src/index.css: swapped the shiki--shiki-light/--shiki-darkselectors for.twinkleplop+.tok.*token classes, driven by--tok-*CSS variables scoped to.json-viewwith a github light/dark palette.apps/local/package.json: dropped the four@shikijs/*deps, added@twinkleplop/json.apps/local/src/App.integration.test.tsx: assertion now checks for the.twinkleplopcontainer.docs/superpowers/specs/2026-09-24-twinkleplop-terminal-highlighting-evaluation.md.validation
tsc -bclean,oxlint0 warnings/errorsvitest run— all 77 tests pass (json-view unit + full app integration)vite buildsucceedsscope note
this targets the local viewer's JSON inspector (a web/HTML rendering path), which is where twinkleplop's HTML output and its shiki/prism-oriented benchmarks actually apply. the terminal markdown renderer (
cli-highlight, ANSI) is a separate path and untouched.Closes #1633