From aebe700366eaafbdc43b7471dbd578417513bdeb Mon Sep 17 00:00:00 2001 From: Knotty Wyvern Date: Thu, 29 Oct 2026 01:25:53 -0700 Subject: [PATCH] Ship the browser engine as its own release file The installer no longer bundles the engine, and the installer script stops when the bundle names it or when the setup file is over 30 MB. pnpm build:browser-engine packages the engine, writes a deterministic ZIP and its record to releases/browser-engine//, and pins the ZIP in the host. The installer hooks remove the engine folder that 0.1.48 leaves behind, and uninstall removes the downloaded engine. --- CLAUDE.md | 5 +- browser-runtime/docs/architecture.md | 2 +- browser-runtime/docs/status.md | 2 +- browser-runtime/test/runestone.conf.json | 3 +- docs/builds.md | 58 +++++- docs/development.md | 2 +- docs/linux.md | 4 +- docs/releases.md | 28 ++- package.json | 1 + scripts/buildBrowserEngine.mjs | 193 ++++++++++++++++++ scripts/buildInstaller.mjs | 12 +- src-tauri/build.rs | 3 - src-tauri/tauri.browser.conf.json | 7 - src-tauri/tauri.conf.json | 5 +- src-tauri/windows/hooks.nsh | 14 ++ tests/unit/release/buildBrowserEngine.spec.ts | 127 ++++++++++++ tests/unit/release/buildInstaller.spec.ts | 28 ++- tests/unit/release/installerVersion.spec.ts | 69 ++++++- 18 files changed, 511 insertions(+), 52 deletions(-) create mode 100644 scripts/buildBrowserEngine.mjs delete mode 100644 src-tauri/tauri.browser.conf.json create mode 100644 tests/unit/release/buildBrowserEngine.spec.ts diff --git a/CLAUDE.md b/CLAUDE.md index ae4b537..6fe4f97 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -26,6 +26,7 @@ The [development guide](docs/development.md#architecture) maps the source folder | `pnpm check:menus` | Menu surface inventory | | `pnpm smoke [filter...]` | Browser smoke tests (`tests/smoke/`). See [Browser smoke tests](docs/development.md#browser-smoke-tests). | | `pnpm build:installer --version ` | Windows installer. See [Builds](docs/builds.md). | +| `pnpm build:browser-engine --release-url --version ` | Browser engine ZIP and its pin. See [Build the browser engine](docs/builds.md#build-the-browser-engine). | | `pnpm package:plugin [output-folder]` | Plugin ZIP | | `pnpm sdk:build` | Build the plugin SDK in `packages/plugin-sdk/` | | `pnpm release:sdk --version ` | Prepare an SDK release in the public SDK clone. It never pushes. See [SDK releases](docs/releases.md). | @@ -74,13 +75,13 @@ Rules from the owner: - Versions use `zz.yy.xx`. A hotfix adds a lowercase letter suffix: `0.2.28a`, then `0.2.28b`. - Keep the current version during source edits, fixes, documentation, and checks. Instruction-only edits never change it. -- Set the next version only when you produce a build: a RuneStone installer or a plugin ZIP. +- Set the next version only when you produce a build: a RuneStone installer, a browser engine ZIP, or a plugin ZIP. A regular build increases `xx` by one. A hotfix build increases only the suffix. - If the build fails, restore the previous version fields. Failed attempts do not use up a version. - Increase `yy` or `zz` only when the owner directs a release. - Report a new version only after its artifact exists. Report the full artifact path. - Completed builds go in `releases/`, outside Git. Never overwrite a release with different contents. -- Repository releases contain only installers or plugin ZIPs, with an empty description. +- Repository releases contain only installers, browser engine ZIPs, or plugin ZIPs, with an empty description. ## Windows installer diff --git a/browser-runtime/docs/architecture.md b/browser-runtime/docs/architecture.md index 622a387..115a61b 100644 --- a/browser-runtime/docs/architecture.md +++ b/browser-runtime/docs/architecture.md @@ -5,7 +5,7 @@ This directory contains the runtime, bundled filter lists, licenses, and tests. Electron runs in its own process, with a separate dependency lock. Run `npm ci` in this directory to install the runtime dependencies. -Run `npm run package` and `npm run stage:host` to prepare the resource for a host installer. +Run `npm run package` and `npm run stage:host` to use the engine in `pnpm tauri dev`. In the host repository, `pnpm build:browser-engine` makes the release ZIP that users download. No Browser plugin ZIP or sibling checkout is required. ## Page isolation diff --git a/browser-runtime/docs/status.md b/browser-runtime/docs/status.md index 7359d8e..07d452f 100644 --- a/browser-runtime/docs/status.md +++ b/browser-runtime/docs/status.md @@ -5,7 +5,7 @@ The former Browser repository is no longer a build dependency. | Capability | State | | --- | --- | -| Delivery | Built into RuneStone, with an isolated Chromium process | +| Delivery | A separate download that RuneStone installs on first use. It runs as an isolated Chromium process. | | Interface | Editor tabs, Bookmarks, Settings, split panes, and separate windows | | Profiles | Default User profile, blank profiles, and independent copies | | Page input | Pointer input, wheel scrolling, middle-button scrolling, text, clipboard shortcuts, and composition text | diff --git a/browser-runtime/test/runestone.conf.json b/browser-runtime/test/runestone.conf.json index de1f797..e43aa46 100644 --- a/browser-runtime/test/runestone.conf.json +++ b/browser-runtime/test/runestone.conf.json @@ -3,6 +3,5 @@ "productName": "RuneStone Browser Test", "app": { "windows": [{ "label": "main", "title": "RuneStone browser test (isolated)", "visible": false, "width": 1400, "height": 900, "decorations": false, "dragDropEnabled": false }] - }, - "bundle": { "resources": { "browser-engine/": "browser-engine/" } } + } } diff --git a/docs/builds.md b/docs/builds.md index 0f5cd3a..8117cd1 100644 --- a/docs/builds.md +++ b/docs/builds.md @@ -13,7 +13,7 @@ Use the [release policy](releases.md) to select the version, store the files, an Prerequisites: - The source setup in [Run from source](development.md#run-from-source). -- A Windows Browser runtime staged in `src-tauri/browser-engine`. See [Built-in browser runtime](development.md#built-in-browser-runtime). The installer bundles that folder. +- The pin of the browser engine in `src-tauri/browser-engine.json`. To build a new engine first, see [Build the browser engine](#build-the-browser-engine). The installer does not include the engine. - Internet access for the first build. Tauri downloads NSIS and the WebView2 bootstrapper. Procedure, in the RuneStone repository root: @@ -45,7 +45,7 @@ Source: `scripts/buildInstaller.mjs`. 1. Reads the version and makes sure that all version fields match the current version. 2. Makes sure that downgrade protection stays on in `tauri.conf.json` and `tauri.windows.conf.json`. - Makes sure that `tauri.windows.conf.json` names the installer hooks and that the browser runtime is staged. + Makes sure that `tauri.windows.conf.json` names the installer hooks and that `tauri.conf.json` does not bundle the browser engine. 3. Stops if the setup file or `host.json` exists in the bundle folder or in `releases//`. A dry run prints the plan and stops here. 4. Saves copies of the four version files as `*.before` in `output/installer-build//