Repository navigation
v0.2.0
Minor Changes
-
33abe38Thanks @Shironex! - In url mode, anavpath that starts with/('/docs/', or{ goto: '/docs/' }) now resolves under the target url's path instead of its origin: withurl: 'https://x.io/app/'or'https://x.io/app'it visitshttps://x.io/app/docs/. Configs that worked around this by repeating the base path ('/app/docs/'withurl: '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 withurl: 'http://localhost:5173/index.html','/about'visitshttp://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: agotothat 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 othergotoresolves exactly as in 0.1.1, withnew 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'withurl: 'https://x.io/app/'visitshttps://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. -
3274ec3Thanks @Shironex! - Newoutputs.readme: falsefor portfolio-only configs (frameandallskip the README images; portfolio and hero still render from the raw captures) andoutputs.portfolio.gallery: false | '<path>.json'to skip or relocateshowcase.gallery.json, for example out of a web root.PortfolioResult.galleryFileis nowundefinedwhen the gallery is skipped. -
07f120aThanks @Shironex! - Terminal clips: a tty config can listclips, short animated recordings thatshowcase record(andshowcase all) writes tooutputs.clips(defaultassets/showcase/{lang}/{id}.{ext}). Each clip starts a fresh app and runs itssteps({ keys },{ type, delayMs? },{ waitFor },{ sleep }) on the kit's own frame clock atfps(default 10), merges frames that did not change, and is framed like the README images with one frame render per clip. It endstailMs(default 1500) after the last step, atdurationMs(default 60000) or atmaxFrames(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 withquitKeyafter the tail. Formats default to lossless animated WebP plus GIF;'mp4'is opt-in and needsffmpegon PATH.showcase readmelists clips after the shots, and says why instead of printing an empty table whenoutputs.readmeisfalseand--onlynames only shots. Clips in url and cdp mode are refused until web clips arrive in v0.3. New exports:recordandencodeAnimation(frames plus delays in, WebP, GIF or MP4 out).encodeAnimationrefuses input it cannot encode with aShowcaseErrorand splits a delay longer than sharp's 65535 ms per frame into repeats that add up to it. For MP4,ffmpegis 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. -
1d571faThanks @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 presskeys(or run anavfunction with the terminal session), wait forwaitFortext and canrestartthe app;readyis text on screen; a newterminalblock 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 --ttywrites a starter config. Needs@lydell/node-pty(ornode-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_THEMEandTERMINAL_DEFAULTS.Types:
ShowcaseConfigis nowWebConfigorTtyConfig(defineConfigpicks one fromtarget.mode), andResolvedConfigisResolvedWebConfig | ResolvedTtyConfig; narrow withisTtyConfig(config)before reading web-only fields such asviewport.
Patch Changes
67be194Thanks @Shironex! - Terminal apps:target.inheritEnvcontrols which of your environment variables the app gets (trueby default;falseor a list of names keeps tokens and home paths out of an app whose screen becomes a committed image, whilePATHand on WindowsPATHEXT,SystemRootandComSpecare 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.cmdor.batshim that contain"or%are refused with a clear error (cmd.exe cannot pass them), and trailing backslashes arrive intact.renderTtyScreenchecks the theme of the look it is given.openTtySessionreturns before Windows reports the app's PID, so Ctrl+C requests the terminal's teardown even that early.