Repository navigation
docs: generate the screenshots from a docs playground - #1145
Merged
Merged
Conversation
pnpm docs:screenshots runs tests/docs-screenshots, a Playwright spec on the e2e fixtures: it opens each DevTools tab of playgrounds/docs (a small shop with pages, components, server routes, a task and a storage mount), puts it in the state the docs show, captures the Vite DevTools panel and writes docs/images/<tab>.webp. The docs-screenshots workflow runs it from the Actions tab and opens a pull request when the images changed. The features page gets the six new screenshots (payload, runtime configs, timeline, server routes, server tasks, storage). Amp-Thread-ID: https://ampcode.com/threads/T-01a18296-d1f3-75e5-9fa1-f749b3e3f1fa Co-authored-by: Sébastien Chopin <atinux@gmail.com>
The product API now takes 600ms, so useFetch spans its route segment, and the spec zooms the timeline in before capturing it. The segments were at their 50px minimum, cutting off the function names. Amp-Thread-ID: https://ampcode.com/threads/T-01a18296-d1f3-75e5-9fa1-f749b3e3f1fa Co-authored-by: Sébastien Chopin <atinux@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Generates the docs screenshots instead of taking them by hand.
playgrounds/docs: a small shop (pages, components, composables, middleware, server routes, a Nitro task, ashopstorage mount, app and runtime config, UnoCSS and VueUse) so every tab has realistic content.pnpm docs:screenshotsrunstests/docs-screenshots/screenshots.spec.tswith the e2e fixtures (openDevTools,navigateTab,VITE_DEVTOOLS_DISABLE_CLIENT_AUTH). For each tab it sets up the state the docs show (expands the payload, sends a request in Server Routes, runs the task, records a timeline), captures the Vite DevTools panel and its dock bar at 2x in dark mode, and writesdocs/images/<tab>.webp. Chromium encodes the WebP, so no image dependency is added.docs-screenshotsworkflow (workflow_dispatch): runs the script and opens a PR with the updated images when they changed.Notes
gh pr createneeds "Allow GitHub Actions to create and approve pull requests" in the repo settings.Ran
pnpm docs:screenshotslocally (passes, about 25 s),pnpm lint,pnpm typecheckandpnpm knip(same output asmain), and checked the new images render on the nuxt.com dev server.