diff --git a/.babysteps/tauri-migration.plan.md b/.babysteps/tauri-migration.plan.md
new file mode 100644
index 0000000..4867d88
--- /dev/null
+++ b/.babysteps/tauri-migration.plan.md
@@ -0,0 +1,96 @@
+# Main-to-Tauri feature-parity follow-up
+
+Feature parity, not a whole-branch merge. Two queues share this file: the active
+2026-11-06..08 delta queue (D01-D09), then the remaining collection/artwork/platform
+queue (M03-M06) from the earlier plan.
+
+## Where the branches stand
+
+- Baseline: `tauri-port` at `b0eec88` (`3e1432c` M02 plus the artwork-display fix).
+- Source: `origin/main` at `0310657`; the delta is `96fd68c..0310657`, 32 commits.
+ The earlier plan compared against `96fd68c`, and `main` was fast-forwarded from
+ there to `0310657` after M01/M02 were planned.
+- Completed already: M01 (`b1b29ac`) and M02 (`3e1432c`).
+- Main originals for every read below are snapshotted in
+ `localTmp/main-ref-0310657/` (ignored scratch; regenerate with the command under
+ Reference snapshot if the directory is missing).
+
+Keep Tauri v2 as the product runtime. Every forecast below is under the 225,000-token
+work budget. The active model prices all stages at $0, so the $0.70 per-slice cap is
+not approached; a paid model would be governed by the same cap. Existing desktop and
+Android target constraints, the Android support limitations, and `docs/donot.md`
+remain authoritative.
+
+## Delta queue (active)
+
+Every row prices the standing set — `docs/STATE.md`, this plan, its task list,
+`docs/donot.md` and `.operator/specs/desktop-runtime.md` — plus the task's own reads.
+`reads` is the row's whole priced set and `allowance` is the non-reading estimate; a
+slice's seed copies both verbatim and `babysteps-budget --seed` rejects any file the
+row does not price.
+
+| slice | task | scope | reads | allowance |
+|---|---|---|---|---:|
+| P1 | D01 | Quiet interface palette, `interface.css`, grouped Settings, shortened copy, artwork type grid, transparent header. | docs/STATE.md, .babysteps/tauri-migration.plan.md, docs/donot.md, .operator/specs/desktop-runtime.md, .babysteps/main-delta.tasks.json, renderer/index.html, renderer/styles.css, renderer/appearance.js, localTmp/main-ref-0310657/renderer/index.html, localTmp/main-ref-0310657/renderer/styles.css, localTmp/main-ref-0310657/renderer/appearance.js, localTmp/main-ref-0310657/renderer/interface.css | 87827 |
+| P2 | D02 | Launcher chrome: `LibraryChrome`, `DetailsResize`, shelf space when details hide, `/` search, console previews and key navigation. | docs/STATE.md, .babysteps/tauri-migration.plan.md, docs/donot.md, .operator/specs/desktop-runtime.md, .babysteps/main-delta.tasks.json, renderer/app.js, renderer/index.html, renderer/styles.css, localTmp/main-ref-0310657/renderer/app.js, localTmp/main-ref-0310657/renderer/index.html | 70827 |
+| P3 | D03 | Flat graphite button-prompt SVG/PNG set, `build-prompts.js`, manifest and preview, prompt checks. | docs/STATE.md, .babysteps/tauri-migration.plan.md, docs/donot.md, .operator/specs/desktop-runtime.md, .babysteps/main-delta.tasks.json, renderer/prompts.js, scripts/build-prompts.js, scripts/check-prompts.cjs, scripts/check-prompts-preload.cjs, localTmp/main-ref-0310657/renderer/prompts.js, localTmp/main-ref-0310657/scripts/build-prompts.js, localTmp/main-ref-0310657/scripts/check-prompts.cjs | 27828 |
+| P4 | D04 | Page turn and media carousel replacing spinner and colour cards, retired-layout migration, selected-disc geometry, bookshelf disc peek and sizing, carousel checks. | docs/STATE.md, .babysteps/tauri-migration.plan.md, docs/donot.md, .operator/specs/desktop-runtime.md, .babysteps/main-delta.tasks.json, renderer/app.js, renderer/appearance.js, renderer/library-ui.css, renderer/styles.css, scripts/check-carousel.cjs, scripts/check-library-ui.cjs, localTmp/main-ref-0310657/renderer/app.js, localTmp/main-ref-0310657/renderer/appearance.js, localTmp/main-ref-0310657/renderer/library-ui.css, localTmp/main-ref-0310657/renderer/styles.css, localTmp/main-ref-0310657/scripts/check-carousel.cjs, localTmp/main-ref-0310657/scripts/check-library-ui.cjs | 48827 |
+| P5 | D05 | Back covers, cartridge lift, spine hinges, label z-offset, physical-media overrides, Super Famicom packaging, booklet proportions. | docs/STATE.md, .babysteps/tauri-migration.plan.md, docs/donot.md, .operator/specs/desktop-runtime.md, .babysteps/main-delta.tasks.json, renderer/app.js, renderer/art.js, renderer/packaging.js, renderer/cartridges.js, renderer/styles.css, localTmp/main-ref-0310657/renderer/app.js, localTmp/main-ref-0310657/renderer/art.js, localTmp/main-ref-0310657/renderer/packaging.js, localTmp/main-ref-0310657/renderer/cartridges.js, localTmp/main-ref-0310657/renderer/styles.css | 53828 |
+| P6 | D06 | Library cache and cache-first start, 16-way parallel scan, one listing per folder, tie-only size stats, disc side-file check, title sort, `startLibrary`/`applyLibrary`. | docs/STATE.md, .babysteps/tauri-migration.plan.md, docs/donot.md, .operator/specs/desktop-runtime.md, .babysteps/main-delta.tasks.json, src-tauri/src/backend.rs, src-tauri/src/config.rs, src-tauri/src/lib.rs, renderer/app.js, renderer/tauri-bridge.js, scripts/check-library-ui.cjs, localTmp/main-ref-0310657/main.js, localTmp/main-ref-0310657/renderer/app.js, localTmp/main-ref-0310657/preload.js | 50827 |
+| P7 | D07 | Polite web artwork source plus MarioWiki and Internet Archive front-cover fallbacks, disk cache, source UI and checks. | docs/STATE.md, .babysteps/tauri-migration.plan.md, docs/donot.md, .operator/specs/desktop-runtime.md, .babysteps/main-delta.tasks.json, src-tauri/src/artwork.rs, src-tauri/src/backend.rs, renderer/artwork-ui.js, scripts/check-artwork.cjs, scripts/check-artwork-ui.cjs, .operator/specs/artwork-service.md, localTmp/main-ref-0310657/web-source.js, localTmp/main-ref-0310657/mariowiki.js, localTmp/main-ref-0310657/internet-archive.js, localTmp/main-ref-0310657/artwork.js, localTmp/main-ref-0310657/scripts/check-artwork.cjs, localTmp/main-ref-0310657/scripts/check-artwork-ui.cjs | 102827 |
+| P8 | D08 | Feedback dialog, report composition, diagnostics/copy/open commands and issue templates. | docs/STATE.md, .babysteps/tauri-migration.plan.md, docs/donot.md, .operator/specs/desktop-runtime.md, .babysteps/main-delta.tasks.json, renderer/index.html, renderer/styles.css, renderer/tauri-bridge.js, src-tauri/src/backend.rs, src-tauri/src/lib.rs, src-tauri/Cargo.toml, localTmp/main-ref-0310657/feedback.js, localTmp/main-ref-0310657/renderer/feedback-ui.js, localTmp/main-ref-0310657/renderer/index.html, localTmp/main-ref-0310657/renderer/styles.css, localTmp/main-ref-0310657/scripts/check-feedback.cjs, localTmp/main-ref-0310657/scripts/check-feedback-ui.cjs, localTmp/main-ref-0310657/.github/ISSUE_TEMPLATE/bug_report.md, localTmp/main-ref-0310657/.github/ISSUE_TEMPLATE/feedback.md | 67827 |
+| P9 | D09 | Demo capture, README/CHANGELOG/screenshots, exclusion record, gates and the parity audit close-out. | docs/STATE.md, .babysteps/tauri-migration.plan.md, docs/donot.md, .operator/specs/desktop-runtime.md, .babysteps/main-delta.tasks.json, README.md, docs/SUPPORT.md, package.json, .github/workflows/release.yml, scripts/record-reddit-demo.cjs, scripts/reddit-demo-timeline.js, localTmp/main-ref-0310657/README.md, localTmp/main-ref-0310657/CHANGELOG.md, localTmp/main-ref-0310657/package.json, localTmp/main-ref-0310657/scripts/capture-readme.cjs, localTmp/main-ref-0310657/scripts/record-reddit-demo.cjs, localTmp/main-ref-0310657/scripts/reddit-demo-timeline.js, localTmp/main-ref-0310657/scripts/full-demo-timeline.js | 60975 |
+| P10 | M03 | Collection administration, user-added systems and games, hide/group/rename, per-game emulator selection, details editor, hidden list, drag order and Recomp menus from `64a5ba6`. | docs/STATE.md, .babysteps/tauri-migration.plan.md, docs/donot.md, .operator/specs/desktop-runtime.md, .babysteps/main-to-tauri.tasks.json, renderer/app.js, renderer/tauri-bridge.js, src-tauri/src/backend.rs, src-tauri/src/config.rs, src-tauri/src/emulators.rs, scripts/check-library-ui.cjs | 104888 |
+| P11a | M04a | Compatible LaunchBox/ScreenScraper provider behavior through the Rust artwork service only; manual workflows stay in M04b. | docs/STATE.md, .babysteps/tauri-migration.plan.md, docs/donot.md, .operator/specs/desktop-runtime.md, .babysteps/main-to-tauri.tasks.json, src-tauri/src/artwork.rs, src-tauri/src/backend.rs, scripts/check-artwork.cjs, .operator/specs/artwork-service.md | 70000 |
+| P11b | M04b | Manual discovery/download/viewing workflows (artwork.js manual handling, Art manual drawing, artwork UI) against the provider contract established in M04a. | docs/STATE.md, .babysteps/tauri-migration.plan.md, docs/donot.md, .operator/specs/desktop-runtime.md, .babysteps/main-to-tauri.tasks.json, artwork.js, renderer/art.js, renderer/artwork-ui.js, scripts/check-artwork-ui.cjs | 55000 |
+| P12a | M05a | Platform-aware launch behavior: Steam/SteamOS, Linux X11/gamescope, and launch logging only where missing. | docs/STATE.md, .babysteps/tauri-migration.plan.md, docs/donot.md, .operator/specs/desktop-runtime.md, .babysteps/main-to-tauri.tasks.json, renderer/app.js, src-tauri/src/backend.rs, src-tauri/src/config.rs | 70000 |
+| P12b | M05b | Emulator metadata and custom/PC game configuration: updated emulator/system metadata and custom/PC game configuration only where missing. | docs/STATE.md, .babysteps/tauri-migration.plan.md, docs/donot.md, .operator/specs/desktop-runtime.md, .babysteps/main-to-tauri.tasks.json, emulators.json, src-tauri/src/emulators.rs, src-tauri/src/config.rs | 50000 |
+| P13 | M06 | Remaining parity checks, Tauri release docs and target validation not already closed by D09. | docs/STATE.md, .babysteps/tauri-migration.plan.md, docs/donot.md, .operator/specs/desktop-runtime.md, .babysteps/main-to-tauri.tasks.json, scripts/check-library-ui.cjs, scripts/check-carousel.cjs, scripts/check-artwork.cjs, scripts/check-artwork-ui.cjs, .github/workflows/release.yml, README.md, docs/SUPPORT.md, src-tauri/Cargo.toml, src-tauri/tauri.conf.json | 95019 |
+
+Order is strictly D01, D02, D03, D04, D05, D06, D07, D08, D09, then M03, M04a, M04b, M05a, M05b, M06 (M03 after D09; M04a after M03; M04b after M04a; M05a after M03; M05b after M03; M06 after M01, M04b and M05b).
+
+## Exclusions
+
+- Leia SR is Windows-only: an Electron offscreen renderer and a native D3D11
+ presenter. No macOS, Linux ARM64 or Android target can use it, so `native/leia-*`,
+ `renderer/leia-*`, `leia-output.js`, the `3D` button, `LeiaUI` and the snapshot
+ IPC are excluded. Revisit only if a Windows target is added.
+- Main's Electron release path, `checks.yml`, Capacitor `android/` project and
+ `start.bat` are excluded. The Tauri `.github/workflows/release.yml` is authoritative.
+- The stray 571 KB root file `1` added by `01b77fd` is not ported.
+- Do not port all of `main`; port the listed behaviour and adapt it to the branch
+ renderer.
+
+## Renderer divergence to respect
+
+The branch renderer is not a smaller copy of main's: at `b0eec88`, `app.js` is 50 KB
+against main's 124 KB, `index.html` 19 KB against 34 KB, `packaging.js` 8 KB against
+17 KB, and `cartridges.js` 6 KB against 17 KB. The branch has no `minimal.css` or
+`physical-models.css` at all; its rules are merged into `styles.css`. Main's delta
+patches therefore have to be translated, not cherry-picked, and whole-file imports
+of `minimal.css`/`physical-models.css` are out of scope.
+
+## Approved task list
+
+`.babysteps/main-delta.tasks.json` for D01-D09, then `.babysteps/main-to-tauri.tasks.json`
+for M03-M06. Do not change scope, estimates or order without re-planning.
+
+## Reference snapshot
+
+```sh
+mkdir -p localTmp/main-ref-0310657
+git archive 0310657 -- feedback.js main.js preload.js artwork.js web-source.js \
+ mariowiki.js internet-archive.js CHANGELOG.md .github/ISSUE_TEMPLATE \
+ scripts/build-prompts.js scripts/check-carousel.cjs scripts/check-library-ui.cjs \
+ scripts/check-artwork.cjs scripts/check-artwork-ui.cjs scripts/check-feedback.cjs \
+ scripts/check-feedback-ui.cjs scripts/check-prompts.cjs scripts/capture-readme.cjs \
+ scripts/record-reddit-demo.cjs scripts/reddit-demo-timeline.js \
+ scripts/full-demo-timeline.js renderer/app.js renderer/appearance.js \
+ renderer/art.js renderer/packaging.js renderer/cartridges.js \
+ renderer/library-ui.css renderer/library-ui.js renderer/styles.css \
+ renderer/index.html renderer/prompts.js renderer/interface.css \
+ renderer/minimal.css renderer/physical-models.css renderer/feedback-ui.js \
+ renderer/xmb.css package.json README.md |
+ tar -x -C localTmp/main-ref-0310657
+```
+
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
new file mode 100644
index 0000000..0fc546a
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -0,0 +1,21 @@
+---
+name: Report a problem
+about: Something in PyroCade is broken or behaving unexpectedly
+title: "[Bug] "
+---
+
+## Problem
+What happened, and what did you expect? Include the error message if there is one.
+
+## Steps to reproduce
+1.
+2.
+3.
+
+## App and device
+- PyroCade version:
+- Operating system and version:
+- Emulator and version (if relevant):
+
+## Screenshots or other details (optional)
+You can attach screenshots here. Reports are public: remove passwords, personal file paths and other private information. Please do not attach games, BIOS files or keys.
diff --git a/.github/ISSUE_TEMPLATE/feedback.md b/.github/ISSUE_TEMPLATE/feedback.md
new file mode 100644
index 0000000..6ae0b32
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feedback.md
@@ -0,0 +1,14 @@
+---
+name: Feedback or suggestion
+about: Share an idea, request a feature or tell us how PyroCade could work better
+title: "[Feedback] "
+---
+
+## Feedback
+What would you like to see changed or added?
+
+## How it would help
+Describe what you are trying to do and how this would help you.
+
+## Examples or screenshots (optional)
+Reports are public: leave out passwords, personal file paths and other private information.
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 8deb193..662a900 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -1,9 +1,7 @@
-# Builds the Windows installer and the Linux packages, smoke-tests Linux, and attaches
-# everything to a *draft* GitHub release. Publish the draft when it looks right; installed
-# copies of PyroCade only see published releases.
name: Release
on:
+ pull_request:
push:
tags: ['v*']
workflow_dispatch:
@@ -19,75 +17,326 @@ env:
TAG: ${{ github.event.inputs.tag || github.ref_name }}
jobs:
- windows:
- runs-on: windows-latest
+ validate:
+ runs-on: ubuntu-24.04
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-node@v4
+ with:
+ node-version: 22
+ cache: npm
+ - uses: dtolnay/rust-toolchain@stable
+ - run: sudo apt-get update && sudo apt-get install -y build-essential curl file libgtk-3-dev libssl-dev libwebkit2gtk-4.1-dev libxdo-dev patchelf rpm librsvg2-dev wget xvfb
+ - run: npm ci
+ - name: Check Rust formatting
+ run: cargo fmt --manifest-path src-tauri/Cargo.toml -- --check
+ - name: Test migrated Rust behavior
+ run: npm run tauri:test
+ - name: Check renderer and parity scripts
+ run: |
+ node --check scripts/check-library-ui.cjs
+ node --check scripts/check-carousel.cjs
+ node --check scripts/check-artwork.cjs
+ node --check scripts/check-artwork-ui.cjs
+ npm run artwork:check
+ - name: Check Rust targets
+ run: cargo check --manifest-path src-tauri/Cargo.toml
+
+ macos-arm64:
+ if: ${{ github.event_name != 'pull_request' }}
+ needs: validate
+ runs-on: macos-14
+ env:
+ TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
+ TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
+ TAURI_UPDATER_PUBLIC_KEY: ${{ vars.TAURI_UPDATER_PUBLIC_KEY }}
steps:
- uses: actions/checkout@v4
with: { ref: '${{ env.TAG }}' }
- uses: actions/setup-node@v4
with: { node-version: 22, cache: npm }
- run: npm ci
- - run: npx electron-builder --win nsis --publish never
+ - uses: dtolnay/rust-toolchain@stable
+ with:
+ targets: aarch64-apple-darwin
+ - name: Verify native ARM64 runner
+ run: test "$(uname -m)" = arm64
+ - name: Build macOS ARM64 release
+ run: |
+ if [ -n "$TAURI_SIGNING_PRIVATE_KEY" ] && [ -n "$TAURI_UPDATER_PUBLIC_KEY" ]; then
+ TAURI_CONFIG="$(python3 - <<'PY'
+ import json, os
+ print(json.dumps({
+ "bundle": {"createUpdaterArtifacts": True},
+ "plugins": {"updater": {
+ "pubkey": os.environ["TAURI_UPDATER_PUBLIC_KEY"],
+ "endpoints": [f"https://github.com/{os.environ['GITHUB_REPOSITORY']}/releases/latest/download/latest.json"],
+ }},
+ }))
+ PY
+ )"
+ export TAURI_CONFIG
+ fi
+ npm run dist:macos:arm64
+ - name: Install and smoke-test macOS ARM64 artifact
+ env:
+ APP_SMOKE_STARTUP_SECONDS: 10
+ run: |
+ dmg=$(find src-tauri/target/aarch64-apple-darwin/release/bundle/dmg -name '*.dmg' -print -quit)
+ test -n "$dmg"
+ mountpoint="$RUNNER_TEMP/pyrocade-dmg"
+ installed_app="$RUNNER_TEMP/Applications/PyroCade.app"
+ mkdir -p "$mountpoint" "$(dirname "$installed_app")"
+ hdiutil attach "$dmg" -nobrowse -readonly -mountpoint "$mountpoint"
+ app=$(find "$mountpoint" -maxdepth 2 -name '*.app' -print -quit)
+ test -n "$app"
+ ditto "$app" "$installed_app"
+ hdiutil detach "$mountpoint"
+ executable=$(/usr/libexec/PlistBuddy -c 'Print :CFBundleExecutable' "$installed_app/Contents/Info.plist")
+ "$installed_app/Contents/MacOS/$executable" >"$RUNNER_TEMP/pyrocade-smoke.log" 2>&1 &
+ app_pid=$!
+ sleep "$APP_SMOKE_STARTUP_SECONDS"
+ if ! kill -0 "$app_pid" 2>/dev/null; then
+ cat "$RUNNER_TEMP/pyrocade-smoke.log"
+ exit 1
+ fi
+ kill "$app_pid"
+ wait "$app_pid" || true
+ - name: Collect macOS release artifacts
+ run: |
+ mkdir -p dist
+ cp -f src-tauri/target/aarch64-apple-darwin/release/bundle/dmg/*.dmg dist/
+ cp -f src-tauri/target/aarch64-apple-darwin/release/bundle/macos/*.app.tar.gz dist/ 2>/dev/null || :
+ cp -f src-tauri/target/aarch64-apple-darwin/release/bundle/macos/*.app.tar.gz.sig dist/ 2>/dev/null || :
- uses: actions/upload-artifact@v4
with:
- name: windows
- path: dist/PyroCade-Setup-*.exe
+ name: pyrocade-macos-arm64
+ path: dist/*
if-no-files-found: error
- linux:
- runs-on: ubuntu-22.04
+ linux-arm64:
+ if: ${{ github.event_name != 'pull_request' }}
+ needs: validate
+ runs-on: macos-14
+ env:
+ TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
+ TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
+ TAURI_UPDATER_PUBLIC_KEY: ${{ vars.TAURI_UPDATER_PUBLIC_KEY }}
steps:
- uses: actions/checkout@v4
with: { ref: '${{ env.TAG }}' }
- uses: actions/setup-node@v4
with: { node-version: 22, cache: npm }
- # rpm builds the Fedora package, libarchive-tools the Arch one; xvfb runs the smoke test.
- - run: sudo apt-get update && sudo apt-get install -y rpm libarchive-tools xvfb
- run: npm ci
- - run: npx electron-builder --linux AppImage deb rpm pacman --publish never
- - name: Smoke test the AppImage
+ - name: Build and package Linux ARM64 in Apple Container
env:
- APPIMAGE_EXTRACT_AND_RUN: '1'
- PYROCADE_SNAP: ${{ runner.temp }}/appimage.png
- PYROCADE_JS: (async()=>JSON.stringify({version:await api.appVersion(),emulators:(await api.emuList()).filter(e=>e.managed).length,demo:!document.getElementById('demoBanner').classList.contains('hidden')}))()
+ GITHUB_REPOSITORY: ${{ github.repository }}
run: |
- chmod +x dist/PyroCade-*.AppImage
- timeout 120 xvfb-run -a dist/PyroCade-*.AppImage --no-sandbox
- cat "$PYROCADE_SNAP.txt"; echo
- test -s "$PYROCADE_SNAP"
- grep -q '"emulators":11' "$PYROCADE_SNAP.txt"
- - name: Smoke test the .deb
+ set -eu
+ mkdir -p dist
+ container run --rm --memory 3G --cpus 4 \
+ -v "$GITHUB_WORKSPACE:/work" -w /work \
+ -e GITHUB_REPOSITORY \
+ ubuntu:24.04 bash -lc '
+ set -eu
+ apt-get update
+ DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential curl file libgtk-3-dev libssl-dev libwebkit2gtk-4.1-dev libxdo-dev patchelf rpm librsvg2-dev wget xvfb pkg-config
+ curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
+ DEBIAN_FRONTEND=noninteractive apt-get install -y nodejs
+ curl --proto "=https" --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal
+ . "$HOME/.cargo/env"
+ rustup target add aarch64-unknown-linux-gnu
+ cargo install tauri-cli --locked
+ export CARGO_TARGET_DIR=/work/localTmp/linux-arm64-target
+ mkdir -p "$CARGO_TARGET_DIR"
+ cat > /tmp/build-appimage.mjs <<'JS'
+ import { spawnSync } from 'node:child_process';
+ import fs from 'node:fs';
+ import path from 'node:path';
+ import os from 'node:os';
+ const root = '/work';
+ const env = { ...process.env, PATH: `${process.env.HOME}/.cargo/bin:${process.env.PATH}` };
+ const run = (command, args, options = {}) => {
+ const result = spawnSync(command, args, { stdio: 'inherit', env, ...options });
+ if (result.status !== 0) throw new Error(`${command} failed with ${result.status}`);
+ };
+ const targetDir = '/work/localTmp/linux-arm64-target';
+ const bundle = path.join(targetDir, 'aarch64-unknown-linux-gnu/release/bundle');
+ const bundleAppImage = path.join(bundle, 'appimage');
+ const base = path.join(os.tmpdir(), 'pyrocade-appimage');
+ const target = path.join(base, 'appdir');
+ fs.rmSync(base, { recursive: true, force: true });
+ fs.mkdirSync(base, { recursive: true });
+ run('cargo', ['tauri', 'build', '--target', 'aarch64-unknown-linux-gnu', '--bundles', 'deb,rpm'], { cwd: root, env: { ...env, CARGO_TARGET_DIR: targetDir } });
+ const appimageConfig = { bundle: { targets: ['appimage'], createUpdaterArtifacts: Boolean(env.TAURI_SIGNING_PRIVATE_KEY && env.TAURI_UPDATER_PUBLIC_KEY) } };
+ if (env.TAURI_UPDATER_PUBLIC_KEY) appimageConfig.plugins = { updater: { pubkey: env.TAURI_UPDATER_PUBLIC_KEY, endpoints: [`https://github.com/${env.GITHUB_REPOSITORY}/releases/latest/download/latest.json`] } };
+ const appimageEnv = { ...env, TAURI_CONFIG: JSON.stringify(appimageConfig), CARGO_TARGET_DIR: targetDir };
+ run('cargo', ['tauri', 'build', '--target', 'aarch64-unknown-linux-gnu', '--bundles', 'appimage'], { cwd: root, env: appimageEnv });
+ const sourceAppDir = path.join(bundleAppImage, 'PyroCade.AppDir');
+ if (!fs.existsSync(sourceAppDir)) throw new Error(`Tauri did not produce ${sourceAppDir}`);
+ const copyTree = (sourceDir, targetDir) => {
+ fs.mkdirSync(targetDir, { recursive: true });
+ for (const entry of fs.readdirSync(sourceDir, { withFileTypes: true })) {
+ const sourceFile = path.join(sourceDir, entry.name);
+ const targetFile = path.join(targetDir, entry.name);
+ if (entry.isDirectory()) copyTree(sourceFile, targetFile);
+ else if (entry.isSymbolicLink()) fs.symlinkSync(fs.readlinkSync(sourceFile), targetFile);
+ else fs.copyFileSync(sourceFile, targetFile);
+ }
+ };
+ copyTree(sourceAppDir, target);
+ fs.chmodSync(target, 0o755);
+ const executable = path.join(target, 'usr/bin/pyrocade');
+ if (!fs.existsSync(executable)) throw new Error(`Missing AppImage executable: ${executable}`);
+ const appimagetool = path.join(base, 'appimagetool');
+ run('curl', ['-fL', 'https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-aarch64.AppImage', '-o', appimagetool]);
+ fs.chmodSync(appimagetool, 0o755);
+ run(appimagetool, ['--appimage-extract'], { cwd: base });
+ const toolDir = path.join(base, 'squashfs-root');
+ if (!fs.existsSync(path.join(toolDir, 'AppRun'))) throw new Error('Failed to extract appimagetool runtime');
+ const pkgVersion = JSON.parse(fs.readFileSync(path.join(root, 'src-tauri/tauri.conf.json'), 'utf8')).version;
+ const out = path.join(root, 'dist', `PyroCade_${pkgVersion}_aarch64-extract.AppImage`);
+ const runtime = path.join(base, 'runtime-aarch64');
+ run('curl', ['-fL', 'https://github.com/AppImage/AppImageKit/releases/download/continuous/runtime-aarch64', '-o', runtime]);
+ fs.chmodSync(runtime, 0o755);
+ run(path.join(toolDir, 'AppRun'), ['--runtime-file', runtime, target, out], { cwd: base, env: { ...env, ARCH: 'arm64' } });
+ if (!fs.existsSync(out)) throw new Error(`Missing extracted-type AppImage: ${out}`);
+ for (const kind of ['deb', 'rpm']) {
+ const source = path.join(bundle, kind);
+ for (const file of fs.readdirSync(source)) {
+ const p = path.join(source, file);
+ if (fs.statSync(p).isFile()) fs.copyFileSync(p, path.join(root, 'dist', file));
+ }
+ }
+ JS
+ node /tmp/build-appimage.mjs
+ '
+ - uses: actions/upload-artifact@v4
+ with:
+ name: pyrocade-linux-arm64
+ path: dist/*
+ if-no-files-found: error
+
+ android-arm64:
+ needs: validate
+ runs-on: ubuntu-24.04
+ env:
+ NODE_VERSION: '22'
+ JAVA_VERSION: '17'
+ ANDROID_COMPILE_API_LEVEL: '36'
+ ANDROID_TARGET_API_LEVEL: '35'
+ ANDROID_BUILD_TOOLS_VERSION: '36.0.0'
+ ANDROID_NDK_VERSION: '28.2.13676358'
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || env.TAG }}
+ - uses: actions/setup-node@v4
+ with:
+ node-version: ${{ env.NODE_VERSION }}
+ cache: npm
+ - uses: actions/setup-java@v4
+ with:
+ distribution: temurin
+ java-version: ${{ env.JAVA_VERSION }}
+ - uses: android-actions/setup-android@v3
+ - name: Install pinned Android SDK components
+ run: |
+ sdkmanager --install "platforms;android-${ANDROID_COMPILE_API_LEVEL}" "platforms;android-${ANDROID_TARGET_API_LEVEL}" "build-tools;${ANDROID_BUILD_TOOLS_VERSION}" "ndk;${ANDROID_NDK_VERSION}"
+ set +e
+ yes | sdkmanager --licenses
+ license_status=${PIPESTATUS[1]}
+ set -e
+ test "$license_status" -eq 0
+ - uses: dtolnay/rust-toolchain@stable
+ with:
+ targets: aarch64-linux-android
+ - run: npm ci
+ - name: Add APK output directory
+ run: mkdir -p dist
+ - name: Generate Android project
+ run: npm run tauri -- android init --ci --skip-targets-install
+ - name: Build Android ARM64 APK
env:
- PYROCADE_SNAP: ${{ runner.temp }}/deb.png
+ KEYSTORE_B64: ${{ secrets.PYROCADE_ANDROID_KEYSTORE }}
+ KEYSTORE_PASSWORD: ${{ secrets.PYROCADE_ANDROID_KEYSTORE_PASSWORD }}
+ KEY_ALIAS: ${{ secrets.PYROCADE_ANDROID_KEY_ALIAS }}
+ KEY_PASSWORD: ${{ secrets.PYROCADE_ANDROID_KEY_PASSWORD }}
run: |
- sudo apt-get install -y ./dist/pyrocade_*_amd64.deb
- timeout 120 xvfb-run -a pyrocade --no-sandbox
- test -s "$PYROCADE_SNAP"
+ keystore_dir="$RUNNER_TEMP/android-signing"
+ mkdir -p "$keystore_dir"
+ if [ -n "$KEYSTORE_B64" ]; then
+ echo "$KEYSTORE_B64" | base64 -d > "$keystore_dir/release.keystore"
+ chmod 600 "$keystore_dir/release.keystore"
+ export TAURI_ANDROID_KEYSTORE_PATH="$keystore_dir/release.keystore"
+ export TAURI_ANDROID_KEYSTORE_PASSWORD="$KEYSTORE_PASSWORD"
+ export TAURI_ANDROID_KEY_ALIAS="$KEY_ALIAS"
+ export TAURI_ANDROID_KEY_PASSWORD="$KEY_PASSWORD"
+ elif [ "$GITHUB_EVENT_NAME" != "pull_request" ]; then
+ echo "A stable private Android keystore is required for release builds." >&2
+ exit 1
+ fi
+ npm run dist:android:arm64
- uses: actions/upload-artifact@v4
with:
- name: linux
- path: |
- dist/PyroCade-*.AppImage
- dist/pyrocade_*.deb
- dist/pyrocade-*.rpm
- dist/pyrocade-*.pkg.tar.zst
- ${{ runner.temp }}/*.png
+ name: ${{ github.event_name == 'pull_request' && 'pyrocade-android-arm64-unsigned-ci' || 'pyrocade-android-arm64' }}
+ path: dist/*.apk
if-no-files-found: error
release:
- needs: [windows, linux]
+ needs: [validate, macos-arm64, linux-arm64, android-arm64]
runs-on: ubuntu-latest
steps:
+ - run: mkdir -p dist
- uses: actions/download-artifact@v4
- with: { path: out }
+ with: { path: dist }
+ - name: Generate signed updater manifest
+ env:
+ GH_REPO: ${{ github.repository }}
+ GH_TAG: ${{ env.TAG }}
+ run: |
+ python3 - <<'PY'
+ from datetime import datetime, timezone
+ import json, os
+ from pathlib import Path
+ from urllib.parse import quote
+
+ platforms = {}
+ for signature_path in Path("dist").rglob("*.sig"):
+ filename = signature_path.name[:-4]
+ if filename.endswith(".app.tar.gz"):
+ target = "darwin-aarch64"
+ elif filename.endswith("-extract.AppImage"):
+ target = "linux-aarch64"
+ else:
+ continue
+ artifact = signature_path.with_name(filename)
+ if not artifact.is_file():
+ continue
+ platforms[target] = {
+ "signature": signature_path.read_text().strip(),
+ "url": f"https://github.com/{os.environ['GH_REPO']}/releases/download/{quote(os.environ['GH_TAG'])}/{quote(filename)}",
+ }
+
+ if platforms:
+ manifest = {
+ "version": os.environ["GH_TAG"].lstrip("vV"),
+ "pub_date": datetime.now(timezone.utc).isoformat(),
+ "platforms": platforms,
+ }
+ Path("dist/latest.json").write_text(json.dumps(manifest, indent=2) + "\n")
+ print(f"Generated signed updater manifest for: {', '.join(sorted(platforms))}")
+ else:
+ print("No signed updater artifacts; releases will use manual update links.")
+ PY
- name: Attach to draft release
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: |
- files=$(find out -type f \( -name '*.exe' -o -name '*.AppImage' -o -name '*.deb' -o -name '*.rpm' -o -name '*.pkg.tar.zst' \))
+ mapfile -d '' files < <(find dist -mindepth 2 -type f ! -name '*.idsig' -print0)
if gh release view "$TAG" >/dev/null 2>&1; then
- gh release upload "$TAG" $files --clobber
+ gh release upload "$TAG" "${files[@]}" --clobber
else
- gh release create "$TAG" $files --draft --title "PyroCade ${TAG#v}" --generate-notes
+ gh release create "$TAG" "${files[@]}" --draft --title "PyroCade ${TAG#v}" --generate-notes
fi
diff --git a/.gitignore b/.gitignore
index 0944209..ba2efb9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -15,5 +15,13 @@ Desktop.ini
.vscode/
*.log
-# Installer builds
+# Installer builds and scratch references
dist/
+localTmp/
+src-tauri/target/
+src-tauri/gen/schemas/
+src-tauri/gen/android/
+.opencode/
+.operator/
+.rnsk-memory/
+./.rnsk-memory
diff --git a/AGENTS.md b/AGENTS.md
new file mode 100644
index 0000000..f99a83a
--- /dev/null
+++ b/AGENTS.md
@@ -0,0 +1,330 @@
+# PyroCade — `tauri-port` Fork (Windows build guide)
+
+> **Windows-only: if you are building on macOS, ignore this file.**
+> This file lives at the repo root, *outside* `renderer/`. The Tauri build
+> bundles `frontendDist` (`../renderer`), so `AGENTS.md` is never packaged into
+> a macOS `.app`/`.dmg` (or any other bundle) and is not read by any build
+> script. On a Mac, delete/skip this file and build with the standard
+> `npm run dist:macos:arm64` flow instead.
+
+An agent (Claude Code / Anthropic harness, Cursor, Copilot, etc.) ramping on
+this fork should treat **Windows as the primary target**. Upstream
+(`Pyrodrifter/PyroCade`, branch `main`) is the original Electron app. This
+fork (`kaicherry/PyroCade`, branch `tauri-port`) is the Tauri v2 port.
+
+```
+Branch: tauri-port Remote: https://github.com/kaicherry/PyroCade.git
+Renderer: renderer/ (static HTML/CSS/JS, no bundler)
+Host: src-tauri/ (Tauri 2 + Rust)
+Emulator catalog: emulators.json
+CI: .github/workflows/release.yml
+```
+
+Electron is **dev-only** — it is not part of the shipped app. It is used for
+`scripts/check-*.cjs` harness runs (`prompts:export`, `prompts:check`,
+`carousel:check`, `brand:*`, `demo:record`, `docs:screens`). The shipped runtime
+is Tauri WebView2 (Windows) / WKWebView (macOS) / WebKitGTK (Linux).
+
+---
+
+## 1. Prerequisites (Windows)
+
+All paths below assume PowerShell 7+ (or Windows Terminal) and a **native
+Win32** checkout (not WSL for the Tauri build itself).
+
+| Tool | Version / notes |
+|------|-----------------|
+| Windows | 10 (1809+) or 11, x64. ARM64 Windows cross-build is not configured. |
+| Git | For `git clone`; line endings must be `CRLF` (default on Windows) |
+| Node.js | **22 LTS** (match `.github/workflows/release.yml`). Add Node to `PATH` before Tauri. |
+| Rust | **stable** via rustup; MSVC target. `rustup toolchain install stable`, `rustup default stable`. |
+| MSVC Build Tools | Required by Tauri/Rust: **Visual Studio Build Tools 2022** with _“Desktop development with C++”_ workload (MSVC v143, Windows 10/11 SDK). |
+| WebView2 | Pre-installed on Win10 1809+/Win11. On older/enterprise images, install the Evergreen Runtime: |
+| NSIS / WiX | Optional for Windows installers. If you add bundle targets, install NSIS (and WiX 3 for MSI) and ensure `makensis.exe` is on `PATH`. |
+
+Verify:
+
+```powershell
+node -v # v22.x
+npm -v
+cargo --version
+rustc --version
+cl.exe # from “Developer PowerShell for VS 2022” — or install Build Tools
+```
+
+If `cl.exe` is not found, launch a **Developer PowerShell for VS 2022**,
+or run `vswhere` / enable “VS Developer Shell” before `tauri build`.
+
+---
+
+## 2. Clone and install
+
+```powershell
+git clone https://github.com/kaicherry/PyroCade.git pyroCade
+Set-Location pyroCade
+git checkout tauri-port
+npm ci
+```
+
+`npm ci` installs `npm` deps including `@tauri-apps/cli` (`^2.11.4`) and
+dev-only `electron` (`^39.0.0`). `cargo` deps install on first build.
+
+If Electron fails with `Electron failed to install correctly, please delete
+node_modules/electron`:
+
+```powershell
+Remove-Item -Recurse -Force node_modules\electron
+npm install electron --ignore-scripts=false
+```
+
+Electron is only needed for `npx electron scripts/*.cjs` checks. Tauri
+`tauri dev` / `tauri build` do not need a working Electron install.
+
+---
+
+## 3. Run in dev mode
+
+```powershell
+npm start
+# = tauri dev
+```
+
+Runs the Rust host + dev WebView and presents `renderer/index.html`. The
+renderer is **static** — there is no `vite`/`webpack` step. Edit
+`renderer/*.js|css` and the dev window reloads.
+
+- Rust changes: Vite-style hot reload does **not** apply — let `tauri dev`
+ rebuild the Rust binary.
+- To test the release bundle: `npm run build` (see §4).
+
+Environment:
+
+| Var | Purpose |
+|-----|---------|
+| `TAURI_CONFIG` | Override bundle keys at build time (updater pubkey/endpoints in CI). |
+| `CARGO_TARGET_DIR` | Custom target dir (CI Linux job uses `localTmp/`; on Windows you can keep the default `src-tauri\target\`). |
+
+---
+
+## 4. Build a Windows release
+
+Windows x64 artifacts are produced two ways:
+
+### Native (on Windows)
+
+```powershell
+# Dev/debug bundle (single-file .exe + default targets)
+npx tauri build
+
+# Bundled release (same command, release profile)
+npm run build
+
+# Output layout (default targets from src-tauri/tauri.conf.json)
+# src-tauri\target\release\pyrocade.exe
+# src-tauri\target\release\bundle\
+```
+
+### Cross-compile from macOS (cargo-xwin)
+
+Tauri documents NSIS cross-compilation from macOS/Linux (MSI needs Windows/WiX).
+Prerequisites on macOS: `brew install nsis llvm lld`, `rustup target add
+x86_64-pc-windows-msvc`, `cargo install --locked cargo-xwin`. Use the
+**rustup** toolchain (Homebrew `rustc` lacks the Windows target) and expose
+LLVM's `llvm-rc`/`lld`:
+
+```bash
+export PATH="/Users/kaicherry/.rustup/toolchains/stable-aarch64-apple-darwin/bin:$HOME/.cargo/bin:/opt/homebrew/opt/llvm@22/bin:$PATH"
+npm run tauri build -- --runner cargo-xwin --target x86_64-pc-windows-msvc --bundles nsis
+# → src-tauri/target/x86_64-pc-windows-msvc/release/bundle/nsis/PyroCade_*_x64-setup.exe
+```
+
+If `rust-lld` aborts with `Library not loaded: @rpath/libLLVM.dylib`, symlink
+`~/.rustup/.../lib/libLLVM.dylib` into
+`~/.rustup/.../lib/rustlib/aarch64-apple-darwin/lib/` (rustup layout puts it
+one level up from where the linker looks). `windows.nsis.installerIcon`
+must be `../renderer/assets/brand/pyrocade.ico` (NSIS needs ICO, not PNG).
+
+### Bundle targets
+
+`src-tauri/tauri.conf.json` lists:
+
+```json
+"targets": ["app", "dmg", "appimage", "deb", "rpm", "nsis", "msi"]
+```
+
+`nsis`/`msi` are native Windows installers. `app`/`dmg`/`appimage`/`deb`/`rpm`
+are the macOS/Linux set (see §5 table). Fixtures built from macOS supply
+`PyroCade_*_x64-setup.exe` (NSIS) + portable `PyroCade_*_x64.exe`.
+
+For a **single-file exe / app folder only** (no installer), keep default
+`targets` and use `src-tauri\target\release\pyrocade.exe` (or
+`bundle\msi\`/`nsis\` when enabled). Copy the `.exe` for manual QA without
+building installers.
+
+### Linux AppImage (extract-type, non-FUSE)
+
+Build in Apple Containers with **container-local** storage (spec:
+`desktop-runtime.md`): one-shot `container run --memory 3G --cpus 4` for
+ARM64, `-a x86_64` for x86_64 via Rosetta 2 (never Lima QEMU — ~50 min).
+Inside the container: deps + Node 22 + Rust + `cargo tauri build`, then
+`copyTree` the `PyroCade.AppDir` to `os.tmpdir()` and package with
+
+```
+AppRun --runtime-file
+```
+
+(`cargo tauri build --bundles appimage` alone already emits a standard
+AppImage; the extract-type repack is the distributable on the release page.)
+
+### macOS signing / notarization
+
+macOS artifacts use Developer ID + notarization:
+
+```bash
+APPLE_SIGNING_IDENTITY="Developer ID Application: …" \
+ npm run tauri build -- --target aarch64-apple-darwin --bundles app,dmg
+xcrun notarytool submit dist/PyroCade_*_aarch64.dmg --keychain-profile impressium --wait
+xcrun stapler staple dist/PyroCade_*_aarch64.dmg
+```
+
+`impressium` is a stored `notarytool` Keychain profile (Apple ID + Team ID +
+app-specific password already in Keychain). Verify with
+`spctl -a -vv PyroCade.app` → `accepted source=Notarized Developer ID`.
+
+### Android signing
+
+Applies on Windows, macOS and CI alike. Tauri reads
+`src-tauri/gen/android/keystore.properties` (private, gitignored):
+
+```
+keyAlias=pyrocade
+storeFile=/Users//.keystores/pyrocade.jks
+```
+
+plus a `signingConfigs.release` block in the generated
+`app/build.gradle.kts`. Both are produced by `scripts/configure-android.cjs`
+when `TAURI_ANDROID_KEYSTORE_PATH` / `TAURI_ANDROID_KEYSTORE_PASSWORD` /
+`TAURI_ANDROID_KEY_ALIAS` / `TAURI_ANDROID_KEY_PASSWORD` env are set;
+generate the store once with `keytool -genkeypair -keystore ~/.keystores/pyrocade.jks
+-alias pyrocade -keyalg RSA -keysize 2048 -validity 10000`, then
+
+```bash
+npm run tauri:android:configure
+RUSTC="$(rustup which rustc)" npm run dist:android:arm64
+```
+
+Signed output is `app-arm64-release.apk` (rename to
+`PyroCade_0.2.1_android-arm64.apk` for the release). Verify with
+`$ANDROID_HOME/build-tools/36.0.0/apksigner verify --print-certs dist/*.apk`.
+
+### Emulator catalog on Windows
+
+`emulators.json` uses per-OS `platforms` keys (`windows` / `macos` / `linux`).
+`src-tauri/src/emulators.rs::target_platform()` returns `windows` under
+`cfg(target_os = "windows")`. On Windows, the downloader selects the
+`windows/x86_64` (or current-arch) asset when present. Custom linking
+(“Use existing program…”, “Choose program…”, `--with-args {rom}`) is the
+same flow as the other OSes.
+
+### App data on Windows
+
+Per-user data (`config.json`, `data/emulators//`, `data/media/`) lives
+under Tauri's app-data dir (notably `%APPDATA%\PyroCade` / Letta-style path
+returned by `dirs`). Never commit `data/` — it is `.gitignored`.
+
+---
+
+## 5. Checks
+
+Run from the repo root (PowerShell). All should be green before opening a PR.
+
+```powershell
+# Rust (gates — fmt/test/check)
+cargo fmt --manifest-path src-tauri/Cargo.toml -- --check
+cargo test --manifest-path src-tauri/Cargo.toml
+cargo check --manifest-path src-tauri/Cargo.toml
+
+# Renderer / parity checks
+node scripts/check-artwork.cjs # npm run artwork:check
+node scripts/check-feedback.cjs # part of npm run feedback:check
+```
+
+Electron checks (`npx electron scripts/check-*.cjs`, `npm run prompts:check`,
+`npm run carousel:check`, etc.) run the static renderer headless — they
+exercise Nintendo/Xbox/PlayStation prompts, carousel layout, brand/icon
+export and demo timelines without a Tauri window.
+
+On Windows, prefer `node --check
+
+
@@ -216,6 +368,10 @@ Download artwork
+
+
+
+