Skip to content

web-terrarium 0.2.0

Choose a tag to compare

@stevez stevez released this 25 Oct 17:45
· 3 commits to main since this release
d775ab4

Added

  • Static apps (app.type: 'static'): React, Vue, Svelte and other apps built with Vite, or any site whose build output is only files. stage runs app.build (default npm run build) and ships app.dir (default dist). In the desktop app, a static server built into web-terrarium serves it:
    • correct file types; hashed files cached for good, index.html checked on every load;
    • single-page apps: paths with no file extension that match no file get index.html (app.spa, default on);
    • app.proxy forwards path prefixes to another server, like Vite's dev proxy, e.g. { '/api': 'http://{host}:{port:mock}' };
    • refuses paths that would leave the build output.
  • app.type is guessed when it's not set: next for projects that depend on Next.js, static for Vite projects.

Changed

  • Every launch starts fresh: the app's window storage (local storage, IndexedDB, cookies, cache) is cleared at start-up. Before, it was only out of reach because the port changed, and it piled up on disk.
  • CI template (templates/desktop-app.yml):
    • smoke-tests each packaged app: launches it, waits for app ready in servers.log, loads the page, quits;
    • uploads zips as they are (upload-artifact@v7 with archive: false), so a download is the app's zip, not a zip inside a zip;
    • attaches the zips to a GitHub Release on v* tags;
    • documents that install-tools swaps native binaries for sharp only.
  • README: an Examples section with three real apps (two Next.js, one static), and a simpler per-system CI workflow for projects whose packages are all on public npm.

Install: npm install --save-dev web-terrarium · npm