Skip to content

v0.2.0

Choose a tag to compare

@github-actions github-actions released this 26 Sep 21:51
· 129 commits to main since this release
92e8ec2

Minor Changes

  • 33abe38 Thanks @Shironex! - In url mode, a nav path that starts with / ('/docs/', or { goto: '/docs/' }) now resolves under the target url's path instead of its origin: with url: 'https://x.io/app/' or 'https://x.io/app' it visits https://x.io/app/docs/. Configs that worked around this by repeating the base path ('/app/docs/' with url: 'https://x.io/app/') should drop the prefix. The base directory is the url's path; a last segment with a dot names a file and is dropped, like a relative link, so with url: 'http://localhost:5173/index.html', '/about' visits http://localhost:5173/about. A trailing slash always means a directory (https://x.io/v1.2/). "Starts with /" is read the way the url parser reads it: a goto that starts with a backslash ('\docs'), or with a slash or backslash after leading spaces, tabs or control characters (' /docs'), gets the same rule. So do protocol-relative spellings ('//host/x', '\\host/x', ' //host/x'): they no longer visit another host but stay on the target origin (https://x.io/app//host/x). Every other goto resolves exactly as in 0.1.1, with new URL(goto, url): '#/settings' and '?tab=2' keep the url's file (http://h/app/index.html#/settings), 'docs/' and '../x' resolve from the url as written, 'https://other.dev/x' is left alone, and a scheme with a relative path is relative when it matches the url's scheme ('https:docs' with url: 'https://x.io/app/' visits https://x.io/app/docs). With a url at the origin root (http://localhost:5173), a root-relative path such as '/about' visits the same page as before.

  • 3274ec3 Thanks @Shironex! - New outputs.readme: false for portfolio-only configs (frame and all skip the README images; portfolio and hero still render from the raw captures) and outputs.portfolio.gallery: false | '<path>.json' to skip or relocate showcase.gallery.json, for example out of a web root. PortfolioResult.galleryFile is now undefined when the gallery is skipped.

  • 07f120a Thanks @Shironex! - Terminal clips: a tty config can list clips, short animated recordings that showcase record (and showcase all) writes to outputs.clips (default assets/showcase/{lang}/{id}.{ext}). Each clip starts a fresh app and runs its steps ({ keys }, { type, delayMs? }, { waitFor }, { sleep }) on the kit's own frame clock at fps (default 10), merges frames that did not change, and is framed like the README images with one frame render per clip. It ends tailMs (default 1500) after the last step, at durationMs (default 60000) or at maxFrames (default 300 frames after merging, each held in memory until the clip is encoded), whichever comes first; the last two warn and still write what was recorded. The app may exit during the tail (a CLI that prints and exits, or a last step that quits it), which ends the clip on its last screen; exiting before the steps are done fails the clip. Most TUIs clear the screen when they quit, so leave the quit key out of the steps: the kit quits the app with quitKey after the tail. Formats default to lossless animated WebP plus GIF; 'mp4' is opt-in and needs ffmpeg on PATH. showcase readme lists clips after the shots, and says why instead of printing an empty table when outputs.readme is false and --only names only shots. Clips in url and cdp mode are refused until web clips arrive in v0.3. New exports: record and encodeAnimation (frames plus delays in, WebP, GIF or MP4 out). encodeAnimation refuses input it cannot encode with a ShowcaseError and splits a delay longer than sharp's 65535 ms per frame into repeats that add up to it. For MP4, ffmpeg is looked up in absolute PATH entries only, Ctrl+C stops it and removes its temporary folder, and an encode that runs over 5 minutes is stopped with an error.

  • 1d571fa Thanks @Shironex! - Terminal apps: target.mode: 'tty' runs a TUI or CLI in a pseudo terminal and captures its screen into the same raw, framed, portfolio, hero and README outputs as web apps. Shots press keys (or run a nav function with the terminal session), wait for waitFor text and can restart the app; ready is text on screen; a new terminal block sets the theme, font, line height, padding and cursor, with JetBrains Mono bundled. Web-only keys (viewport, colorScheme, css) are rejected in tty mode and tty-only keys in url and cdp mode. showcase init --tty writes a starter config. Needs @lydell/node-pty (or node-pty) as an optional peer and Node, not the Bun runtime. The terminal engine is exported for scripts: openTtySession, renderTtyScreen, resolveTerminalOptions, parseKeys, DARK_THEME, LIGHT_THEME and TERMINAL_DEFAULTS.

    Types: ShowcaseConfig is now WebConfig or TtyConfig (defineConfig picks one from target.mode), and ResolvedConfig is ResolvedWebConfig | ResolvedTtyConfig; narrow with isTtyConfig(config) before reading web-only fields such as viewport.

Patch Changes

  • 67be194 Thanks @Shironex! - Terminal apps: target.inheritEnv controls which of your environment variables the app gets (true by default; false or a list of names keeps tokens and home paths out of an app whose screen becomes a committed image, while PATH and on Windows PATHEXT, SystemRoot and ComSpec are still inherited so it can start). A CLI that prints its screen and exits at once is now captured instead of failing with "exited before". Arguments passed through a Windows .cmd or .bat shim that contain " or % are refused with a clear error (cmd.exe cannot pass them), and trailing backslashes arrive intact. renderTtyScreen checks the theme of the look it is given. openTtySession returns before Windows reports the app's PID, so Ctrl+C requests the terminal's teardown even that early.