[tauri] TauriPlatforms: Merge four versions from one codebase: the PWA, and Android, iOS and desktop apps through a Tauri 2 shell
This commit is contained in:
@@ -5,6 +5,7 @@ One row per feature, with its analysis document (CLAUDE.md §5.1). Gaps live in
|
||||
|
||||
| Feature | Phase | Status | Analysis | Review |
|
||||
|:--|:--|:--|:--|:--|
|
||||
| Four versions, one garden: the Tauri 2 shell (`apps/rosea-tauri`) for Android, iOS and desktop beside the PWA; a Windows build and an Android debug APK run on the tablet | Platform track | Merged to `main` 2026-11-17; built on this machine, not distributed. iOS needs a Mac (G-T1); *Keep her safe* in the apps is a release blocker (G-T4) | [tauri-platforms.md](features/tauri-platforms.md) | [feature-tauri-platforms.md](reviews/feature-tauri-platforms.md) |
|
||||
| Workspace, contracts, gates, PWA shell | 0 | Merged to `main` 2026-11-01 (`d11d242`); built, not deployed. Phase 0 gate still open | [phase0-workspace.md](features/phase0-workspace.md) | [feature-phase0-workspace.md](reviews/feature-phase0-workspace.md) |
|
||||
| Roadmap and gameplay docs, read against the code | 0 | Merged 2026-11-01; Q1–Q7 answered by the author | — | [docs-roadmap-gameplay.md](reviews/docs-roadmap-gameplay.md) |
|
||||
| The Letter slot: page at `#letter`, empty `docs/LETTER.md` | 0 | Merged to `main`; built, not deployed. Invisible until the author writes | [letter-slot.md](features/letter-slot.md) | [feature-letter-slot.md](reviews/feature-letter-slot.md) |
|
||||
|
||||
+22
-2
@@ -37,8 +37,8 @@ board exist, and the first real picture is the author's to make.
|
||||
| G0.18 | The library is empty | Open. **Phase 0 gate**: 60 sentences, each sourced and verified public domain (ROADMAP Phase 0). Release needs ≥ 365. `verifiedBy` is a person, so an agent may propose candidates but never mark one verified (D4). Since 2026-11-02 candidates wait in `content/candidates/`, each with where to read it; the author verifies with `pnpm library:verify <id…> --by <name>` (day-sentence.md P8). |
|
||||
| G0.19 | Event kinds other than `care` | Open. GAMEPLAY.md now exists; each kind arrives with the feature doc that uses it, starting in Phase 1. |
|
||||
| G0.20 | Node 22.11 on the dev machine is below what some pinned dependencies declare | Narrowed 2026-11-17: the machine runs **Node 22.23.4** (upgraded by the author). Its newer time zone data exposed a stale town list, fixed on `fix/coyhaique` (Santiago had been on a southern zone's clock since the first build). **Still open:** unpin the dependencies pinned for 22.11 (D11), in their own commit. |
|
||||
| G0.21 | No PNG icons | Open (predicted trap). iOS ignores SVG for `apple-touch-icon`. Comes through the art pipeline. |
|
||||
| G0.22 | No CI | Open. Every gate ran on this machine only. With G0.13. |
|
||||
| G0.21 | No PNG icons | Open (predicted trap). iOS ignores SVG for `apple-touch-icon`. Comes through the art pipeline. Narrowed 2026-11-17: the apps make PNG/ICO icons from `icon.svg` at build time (`tauri icon`, never committed); the PWA still has none, and the picture is still the placeholder. |
|
||||
| G0.22 | No CI | Open. Every gate ran on this machine only. With G0.13. Since 2026-11-17 the APK and the Windows installer are also built by hand here (G-T7). |
|
||||
| G0.23 | Source maps are built and would be published | Open. `sourcemap: true`; maps are not precached. Decide with G0.13 whether the repository is public. If not, use `'hidden'`. |
|
||||
| G0.24 | No art pipeline: `docs/ART.md`, `art/STYLE.md` (drafted with the author), `art/manifest.json` for Phase 1 assets, SVG placeholders, `tools/art-prep` | **Pipeline built 2026-11-01** (`feature/art-board`): docs/ART.md, the Phase 1 manifest (25 pictures), 29 generated stand-ins, `tools/art-prep` (50 tests; 5 of 5 put-back bugs caught), the art board published. STYLE.md approved by the author 2026-11-01 (S1–S5 kept as drafted; `docs/style-approved`). The board grew to 53 pictures with Phases 2–3 (`art/phase2-3-pictures`); the fox's look F1–F4 approved with a deep red-orange coat (`art/fox-coat`). 2026-11-07, `art/board-v2`: the first `rose-sheet` came out as watercolour with a smiley on a ball; STYLE.md §1 and every prompt rewritten (look first, face on the petals, no pixel numbers, the book's motifs checked in review, not named), and the board grew to 86 pictures for Phases 1–5 (board version 4). **Still open:** the **Phase 0 gate**, one real picture through every step into `art/final/`. |
|
||||
| ~~G0.25~~ | ~~No slot for *A Letter from the Gardener*~~ | Closed 2026-11-01, merged to `main`. `docs/LETTER.md` holds slots as comments only; the page opens at `#letter` once it has words. 16 ui tests, and e2e on both the empty and a temporary written letter. Mutations caught: the link while empty, any link scheme, focus not moving, *heal* in the letter. |
|
||||
@@ -63,6 +63,26 @@ sentences). Nothing in Phase 1 is visible to the player yet.
|
||||
| ~~G1.10~~ | ~~The garden named only the sunset, never the sunrise (ROADMAP Phase 1: *sunset and sunrise*)~~ | Closed 2026-11-17 on `feature/sunrise`: from sunset until it comes, the line names the real sunrise; the in-game sunset still names the sunset. engine `nextSunEvent` with a 300-run property; e2e at 05:00 in Brno; seen on a real Android tablet. 5 of 5 put-back bugs caught. |
|
||||
| G1.3 | Towns have no Czech names (*Vídeň*) | Open. Natural Earth has none; arrives with Czech copy. |
|
||||
|
||||
## The platform track — four versions (from 2026-11-17)
|
||||
|
||||
Decided by the author 2026-11-17: the PWA, an Android APK, an iOS app and a desktop app from one
|
||||
Svelte codebase, the apps through a Tauri 2 shell. Analysis:
|
||||
[`features/tauri-platforms.md`](features/tauri-platforms.md); review:
|
||||
[`reviews/feature-tauri-platforms.md`](reviews/feature-tauri-platforms.md).
|
||||
|
||||
| Id | Gap | Status / evidence |
|
||||
|:--|:--|:--|
|
||||
| ~~G-T0~~ | ~~No shell, no app on any platform~~ | Closed 2026-11-17 on `feature/tauri-platforms`: `apps/rosea-tauri`; Windows `.exe` + NSIS installer built and checked (watered, closed, reopened, still watered); Android debug APK verified with `aapt2` (no permission, no backup) and checked on the WAVE 10C, Android 16, offline by construction. 40 shell tests; 14 of 14 drills caught. |
|
||||
| G-T1 | iOS | Open. Needs macOS + Xcode, the iOS Rust targets, an Apple developer account. `pnpm tauri:ios` refuses elsewhere. |
|
||||
| G-T2 | macOS and Linux desktop builds | Open. Each on its own system; macOS signing/notarisation. |
|
||||
| G-T3 | Release signing (Android keystore, Windows certificate); AAB; stores | Open. Phase 6. Keys never in the repository. |
|
||||
| G-T4 | **Keep her safe inside the apps — release blocker** | Open. Measured: *Save her to a file* does nothing on Android; the words say *this browser*; `persist()` is always `false`. Needs app copy and a working save (first plugin). No app reaches a player before this closes. |
|
||||
| G-T5 | Bringing her back from a file inside the apps | Open. The Android file picker opens; no round trip seen. |
|
||||
| G-T6 | WebView2's own traffic not measured for Rosea | Open. Flags from Amicitia's measurement are set; measure before a desktop release. |
|
||||
| G-T7 | No CI for the apps | Open. With G0.22. |
|
||||
| G-T8 | Webview storage eviction | Partly measured: `persist()` is `false` in WebView2 and Android WebView. Pressure eviction of app storage not measured. G-T4 is the answer either way. |
|
||||
| G-T9 | The app icon is the placeholder | Open. With G0.21. |
|
||||
|
||||
## Design questions — answered
|
||||
|
||||
Raised by GAMEPLAY.md and ROADMAP.md, answered by the author 2026-11-01. Details in
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
# Four versions, one garden — the Tauri 2 shell
|
||||
|
||||
Status: built on `feature/tauri-platforms`, 2026-11-17. Decided by the author the same day: *"I need
|
||||
also android apk version, desktop version, ios version and pwa version … based on the tauri2
|
||||
framework."* CLAUDE.md §2 (*Four versions, one garden*), §3, §4, §8; ROADMAP *The platform track*.
|
||||
Review: [`feature-tauri-platforms.md`](../reviews/feature-tauri-platforms.md).
|
||||
|
||||
## 1. Why and what, in the player's terms
|
||||
|
||||
Until now Rosea Domi was a page you open from a link and may add to the home screen. Now the same
|
||||
garden also comes as an **app**: an Android app to install from a file (later from a store), a
|
||||
desktop app for Windows (macOS and Linux once built on those systems), and an iOS app once there is
|
||||
a Mac to build it on. The PWA stays as it is.
|
||||
|
||||
What the player meets is the same in all four: the same rose, the same words, the same sunset, the
|
||||
same *Keep her safe*. Nothing asks for an account, nothing goes online. Differences they may notice:
|
||||
|
||||
- The app opens straight into the garden, with its own icon, without a browser around it.
|
||||
- In the app there is never *A new version of the garden is ready*: a new version comes as a new app.
|
||||
- A rose in the PWA and a rose in the app on the same phone are **two roses**. To carry one across,
|
||||
*Keep her safe* saves her to a file and brings her back (on Android, see G-T4).
|
||||
|
||||
Why now and not in Phase 6: the shell needs no new feature, and an APK puts the Phase 1 spike on the
|
||||
author's phone without any hosting (G0.13 is still open).
|
||||
|
||||
## 2. Technical architecture
|
||||
|
||||
```mermaid
|
||||
flowchart LR
|
||||
subgraph game["one Svelte 5 codebase"]
|
||||
schema["packages/schema"] --- engine["packages/engine"]
|
||||
engine --- ui["packages/ui"]
|
||||
storage["packages/storage<br/>(IndexedDB)"] --- engine
|
||||
content["packages/content"] --- schema
|
||||
identity["packages/identity"] --- schema
|
||||
app["apps/rosea<br/>App.svelte wiring"]
|
||||
ui --> app
|
||||
storage --> app
|
||||
content --> app
|
||||
identity --> app
|
||||
end
|
||||
app -->|"vite build<br/>(default mode)"| dist["apps/rosea/dist/<br/>base /Rosea/, service worker,<br/>manifest, <meta> CSP"]
|
||||
app -->|"vite build --mode tauri"| distt["apps/rosea/dist-tauri/<br/>base /, no worker, no manifest,<br/>no <meta> CSP"]
|
||||
dist --> pwa["PWA<br/>GitHub Pages"]
|
||||
distt --> shell["apps/rosea-tauri/src-tauri<br/>tauri.conf.json (CSP, name, version)<br/>lib.rs: a window, nothing else"]
|
||||
shell --> win["Windows<br/>WebView2 · NSIS"]
|
||||
shell --> android["Android<br/>System WebView · APK<br/>(privacy patch on gen/)"]
|
||||
shell --> ios["iOS<br/>WKWebView<br/>(macOS + Xcode only)"]
|
||||
shell --> mac["macOS / Linux<br/>WKWebView / WebKitGTK"]
|
||||
```
|
||||
|
||||
| # | Decision | Why |
|
||||
|:--|:--|:--|
|
||||
| D1 | **`apps/rosea-tauri/` with `src-tauri/` inside**, a workspace package `@rosea/tauri` holding the Tauri CLI and the scripts. Not Tauri's default `apps/rosea/src-tauri/`. | The Tauri 2 CLI finds `src-tauri/tauri.conf.json` below the folder it runs in, so this is its expected layout one level down. The PWA's package stays free of Rust and of the CLI; the shell is deletable; its only input is a built folder, the same seam the e2e suites test. |
|
||||
| D2 | **Two builds of one game.** `vite build --mode tauri` (`build:shell`) → `apps/rosea/dist-tauri/`: base `/`; `vite-plugin-pwa` disabled (no worker, no manifest; `registerSW` becomes its no-op); no `<meta>` CSP; no source maps. One build-time constant, `__ROSEA_SHELL__`, read in `App.svelte` only. | Tauri serves the files at the root of its own origin; the files are already on the device, so a worker would only cache a second copy and could serve a stale game after an update; see D4 for the CSP. A separate folder means a shell build can never overwrite the PWA's and be deployed by mistake. Source maps would ship inside every installer. |
|
||||
| D3 | **Name, identifier, version.** `productName` and the window title `Rosea Domi` (a test holds them equal to `PRODUCT_NAME`); identifier **`cz.mareknovak.domi.rosea`**, like Culina's `cz.mareknovak.domi.culina`; `version` read from `apps/rosea/package.json` (Tauri accepts a path to a `package.json`). | The name may change in one commit (CLAUDE.md preamble). The identifier may not, once an app has reached a player: Android and iOS treat a new identifier as a different app, which would leave the rose behind in the old one. One version for the game and the apps; Android refuses a lower version as a downgrade. |
|
||||
| D4 | **The CSP comes from Tauri**, the same string as the PWA's `<meta>` (`apps/rosea/csp.ts`), held equal by the shell's test. | A page with both a `<meta>` policy and a header obeys both; Tauri adds hashes for what it injects only to its own header, so a `<meta>` copy would block that. One string in source, two delivery routes. |
|
||||
| D5 | **The Rust side opens a window and does nothing else.** No command, no plugin, no `@tauri-apps/api` in the game, and no `capabilities/` folder, so the page is granted no IPC. | The game already works fully in a webview. Every plugin is a new path for bytes to leave the device; each is reviewed before it is added (notifications, Phase 6). |
|
||||
| D6 | **Android privacy, applied to the generated project before every build** (`src/android-privacy.ts`, `scripts/android.ts`, run from `tauri.android.conf.json`'s `beforeBuildCommand`): no `INTERNET` permission; `allowBackup="false"` and rules excluding every domain from cloud backup and device transfer; WebView metrics opt-out and Safe Browsing off. **Verified on the built APK** with `aapt2`. | `gen/android` is regenerated by `tauri android init` and never committed. Amicitia measured on 2026-11-08 that Android System WebView sends an Autofill query to Google the moment a field takes focus, and that manifest switches do not stop it; only the missing permission does. Rosea has a field (*Where do you want your sunset?*). Auto Backup would copy the care log, the keys and the town to the player's cloud without their choosing. |
|
||||
| D7 | **Windows: WebView2's own traffic switched off** with `additionalBrowserArgs` — Amicitia's measured list (DNS-over-HTTPS upgrade, SmartScreen, experimentation, Autofill server, background networking, component updates, sync, pings, phishing detection, DNS prefetch). | Amicitia measured WebView2 reaching Google, Cloudflare and Microsoft within seconds of opening with no request of its own. The flags are undocumented feature names; a runtime update can break them, so the measurement is repeated per release (G-T6). |
|
||||
| D8 | **Icons are made at build time** from `apps/rosea/public/icon.svg` with `tauri icon` and never committed. | No raster images in git except art in `art/final/` (CLAUDE.md §5.2). The SVG is a placeholder until the art pipeline makes the real icon (G0.21). |
|
||||
| D9 | **In the apps, the game counts as installed**: it asks `navigator.storage.persist()` after the first care, as an installed PWA does, and never shows the iOS hint to add the page to the home screen. | WKWebView's user agent says *iPhone*; without this, the iOS app would tell the player to install the app they are in. |
|
||||
| D10 | **`useHttpsScheme: true`**: the game's origin is `https://tauri.localhost` on Windows and Android. | IndexedDB is per origin. Tauri warns that changing this value between releases moves the database and the app can no longer see the old one: it must be chosen before the first release and never changed. `https` is a secure context without relying on the `*.localhost` exception (WebCrypto makes the player's key). |
|
||||
| D11 | **Per-platform bundle targets** in `tauri.{windows,macos,linux}.conf.json`: NSIS (current user) on Windows; `.app` and `.dmg` on macOS; `.deb` and AppImage on Linux. | One config would try to make targets the machine cannot (MSI needs WiX, a download). |
|
||||
| D12 | **Commands**: `pnpm tauri:dev`, `tauri:build`, `tauri:android` (a debug APK for arm64, then `verify`), `tauri:ios` (refuses off macOS with the reason). No Android dev command yet. | An Android dev build needs `INTERNET` to reach the dev server and `adb reverse` to keep it on 127.0.0.1 (CLAUDE.md §5.7); not needed to test what exists. |
|
||||
|
||||
What did **not** change: every package; the PWA's base path, worker, manifest and `<meta>` policy,
|
||||
held by the existing e2e and offline suites. (The PWA's bundle is not byte-identical: `__ROSEA_SHELL__`
|
||||
is folded to `'web'` there.)
|
||||
|
||||
## 3. Risk analysis
|
||||
|
||||
Risk here means *a lonely person feeling worse*, *someone's location*, or *someone being reachable who
|
||||
did not ask to be* (CLAUDE.md §5.1).
|
||||
|
||||
| Risk | Platform | Answer |
|
||||
|:--|:--|:--|
|
||||
| **The rose is lost** when the app is uninstalled, the phone is replaced, or the app's data is cleared. | all apps | Uninstalling an app deletes its data; Android Auto Backup is deliberately off (D6). *Keep her safe* is the way to move or keep her, and on Android saving a file is unproven (G-T4). Said plainly in this doc and in the review; the Letter may say it to the player later. |
|
||||
| **The rose is lost to an origin change** (`useHttpsScheme`, identifier, scheme). | Windows, Android | D3, D10: both fixed before the first release, with a test each. CLAUDE.md §8 records both as *forever*. |
|
||||
| **Two roses** for one player (PWA and app). | all | Expected and stated (§1). Nothing in the game counts or compares them. |
|
||||
| **The webview phones home** — bytes leave without the player. | Android | No `INTERNET`: the kernel refuses any socket (D6). Proof: `aapt2` on the APK, `dumpsys package` on the tablet. |
|
||||
| | Windows | `additionalBrowserArgs` (D7). Not measured for Rosea on this machine (G-T6). WebView2 itself is updated by Windows Update, outside the app. |
|
||||
| | iOS / macOS | WKWebView has no telemetry switch to set; not measured (G-T1). |
|
||||
| **Location leaves the device.** | all | The town stays in IndexedDB. No backup (Android), no network (Android), no plugin (all). |
|
||||
| **An SDK that counts.** | all | No analytics, crash-reporting or ads library: `Cargo.toml` has `tauri` alone and a test keeps it so; the game has no new dependency. Tauri itself sends nothing. |
|
||||
| **The Windows installer fetches WebView2** if it is missing (Tauri's default `downloadBootstrapper`). | Windows | A one-time download from Microsoft during installation, on a machine without WebView2 (Windows 10 and 11 ship it). Noted, not changed: an offline installer would embed ~150 MB. |
|
||||
| **Reachability.** | all | Nothing new: no free text, no network, no IPC. |
|
||||
| **A stale game after an update.** | apps | No service worker (D2): the game is the one inside the installed package. |
|
||||
| **Guilt or dependence.** | all | The app adds no notification, badge or reminder. Notifications are Phase 6, with their own Soul review. |
|
||||
|
||||
## 4. Gap analysis
|
||||
|
||||
| Id | Gap | Designed solution / state |
|
||||
|:--|:--|:--|
|
||||
| G-T1 | **iOS** cannot be built on Windows. | Needs macOS with Xcode (and its command-line tools, CocoaPods not required by Tauri 2), the Rust targets `aarch64-apple-ios` and `aarch64-apple-ios-sim`, and an **Apple developer account**: a free Apple ID can sign for one's own device for 7 days; TestFlight and the App Store need the paid programme. Then `pnpm tauri:ios`. Unknown until measured there: where WKWebView keeps IndexedDB, whether iOS purges it for an unused app, and whether `<a download>` saves her file. **Open.** |
|
||||
| G-T2 | **macOS and Linux desktop builds** are not built. | Each on its own system: `pnpm tauri:build` (`.app`/`.dmg`; `.deb`/AppImage). macOS outside the App Store also needs signing and notarisation with a paid account, or Gatekeeper warns. **Open.** |
|
||||
| G-T3 | **Release signing** for Android (a keystore) and Windows (a code-signing certificate). | Debug builds only today. The keystore and its passwords never enter the repository (CLAUDE.md §5.2). Phase 6. **Open.** |
|
||||
| G-T4 | **Keep her safe inside the apps — a release blocker.** The game saves through `<a download>` on a blob URL, and its words speak of *this browser*. | **Measured 2026-11-17.** Windows: the save starts a download (`rose-2026-11-17.json`). Android (WAVE 10C, WebView 140): **nothing happens**. And in both apps `persist()` answers `false`, so *Keep her safe* says *This browser may clear her if the garden is not opened for a long time. A saved file keeps her for sure.* and offers *Ask the browser to keep her*: wrong words in an app, a worry that is not true of an app's own storage, and on Android a remedy that does nothing. Design for its own feature: app words for *Keep her safe* in `packages/ui/src/copy/` chosen by the shell constant; saving through `tauri-plugin-dialog` + a write (the first plugin, reviewed for network access) or the Android share sheet. **No APK or installer goes to any player before this is closed.** |
|
||||
| G-T5 | **Bringing her back from a file** (`<input type="file">`) inside the apps. | **Measured 2026-11-17 on Android:** the system file picker opens (`com.android.documentsui` `PickActivity`). Reading a chosen file back was not tried (no saved rose on the tablet, see G-T4). Windows: not tried. **Open** until a round trip is seen. |
|
||||
| G-T6 | **WebView2's traffic not measured for Rosea.** | Amicitia's `watch-desktop-network.ps1` approach: run the built exe, list its connections. Before the first desktop release. **Open.** |
|
||||
| G-T7 | **No CI** builds the apps (G0.22). | Builds by hand on this machine; never committed. |
|
||||
| G-T8 | **Storage eviction in WebView2 and Android WebView.** | **Measured 2026-11-17:** `persist()` and `persisted()` answer `false` in both (Android: quota 70 GB, 3 KB used). An app's webview data lives in the app's own storage and goes with an uninstall or *Clear storage*; whether Chromium's pressure eviction can reach it there was not measured. G-T4 is the answer either way. |
|
||||
| G-T9 | **The icon is the PWA's placeholder.** | G0.21; the art pipeline. Android adaptive icons need a foreground layer then. |
|
||||
|
||||
## 5. Verification matrix
|
||||
|
||||
| Case | Kind | Where |
|
||||
|:--|:--|:--|
|
||||
| Name and window title equal `PRODUCT_NAME`; identifier is `cz.mareknovak.domi.rosea`; version read from `apps/rosea/package.json`, which exists | unit | `apps/rosea-tauri/test/config.test.ts` |
|
||||
| Tauri's CSP equals `apps/rosea/csp.ts`; the shell's dev server and build point at `dev:shell` / `build:shell` and `dist-tauri`, dev on 127.0.0.1 | unit | same |
|
||||
| `useHttpsScheme` is `true` (the origin is forever) | unit | same |
|
||||
| WebView2's privacy flags are all in `additionalBrowserArgs` | unit | same |
|
||||
| `Cargo.toml` depends on `tauri` alone; no `capabilities/` folder | unit | same |
|
||||
| The Android build runs the privacy patch before the game's build | unit | same |
|
||||
| Patch on Tauri's stock manifest: `INTERNET` gone, three attributes set, both meta-data present; a second run changes nothing; CRLF kept; an unexpected shape throws | unit | `apps/rosea-tauri/test/android-privacy.test.ts` |
|
||||
| `manifestProblems` names each missing piece on the stock manifest and none on the patched one | unit | same |
|
||||
| The committed rule files exclude every domain everywhere; a file missing one, or including something, is caught | unit | same |
|
||||
| `apkProblems` on real `aapt2` output: the patched APK passes; a stock one (INTERNET, backup on) fails with names | unit | same |
|
||||
| `vite build --mode tauri`: no worker, no `registerSW` script, no manifest, no `<meta>` CSP, assets under `/assets/`, `__ROSEA_SHELL__` replaced | integration | `apps/rosea-tauri/test/shell-build.test.ts` |
|
||||
| The PWA build is unchanged: `<meta>` CSP, worker, manifest scope `/Rosea/` | e2e | `e2e/` (existing suites) |
|
||||
| Windows: the release `.exe` opens the garden; water her; close; open again; she is still watered | manual + script | review (Playwright over WebView2's debugging port on 127.0.0.1) |
|
||||
| Android: the debug APK installs on the WAVE 10C (Android 16), opens the garden, water her, force-stop, open again: still watered; the app has no `INTERNET` (offline by construction) | device | review (`adb`, Playwright over the WebView's DevTools socket) |
|
||||
| The APK asks for no permission, sets `allowBackup=false`, metrics and Safe Browsing off | artefact | `pnpm tauri:android` → `android.ts verify` (aapt2) |
|
||||
| `pnpm tauri:ios` on Windows refuses with the reason and builds nothing | manual | review |
|
||||
| iOS, macOS, Linux | — | not possible here (G-T1, G-T2) |
|
||||
@@ -8,11 +8,11 @@ and **how to apply it**.
|
||||
|:--|:--|:--|
|
||||
| `soul.md` | none yet | What comforts and what only looks like comfort. **The most important file here.** No mechanic exists yet that could teach anything. |
|
||||
| `architecture.md` | none yet | Layering, ownership, seams. |
|
||||
| `design.md` | none yet | Wording, silence, empty states. |
|
||||
| [`design.md`](design.md) | 1 | Wording, silence, empty states. |
|
||||
| [`art.md`](art.md) | 3 | The image pipeline. |
|
||||
| [`code.md`](code.md) | 3 | TypeScript, Svelte, async ordering, Rust. |
|
||||
| [`technical.md`](technical.md) | 7 | The browser and the build as platforms. |
|
||||
| [`testing.md`](testing.md) | 10 | What makes a test worth having, and how a passing test lies. |
|
||||
| [`technical.md`](technical.md) | 9 | The browser and the build as platforms. |
|
||||
| [`testing.md`](testing.md) | 13 | What makes a test worth having, and how a passing test lies. |
|
||||
| `privacy.md` | none yet | What could leave the device or make a person findable. (The geocell finding is in the review, not here: it was caught before it cost anything.) |
|
||||
| [`process.md`](process.md) | 4 | Workflow, commits, credentials, honesty about what shipped. |
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
# Design lessons
|
||||
|
||||
What the player is shown and why: wording, silence, empty states (CLAUDE.md §5.1b).
|
||||
|
||||
## Words that are true in a browser can be false, and frightening, in an app
|
||||
|
||||
**What happened.** In the Android and Windows apps (2026-11-17, `feature/tauri-platforms`) *Keep her
|
||||
safe* said *This browser may clear her if the garden is not opened for a long time. A saved file
|
||||
keeps her for sure.* and offered *Ask the browser to keep her*. In an app there is no browser to ask,
|
||||
`persist()` always answers no, the inactivity warning is not true of an app's own storage, and on
|
||||
Android *Save her to a file* did nothing at all. The comfort became a worry with a broken remedy.
|
||||
|
||||
**Why it bit.** The words were written, carefully, for one place (a browser tab or an installed PWA)
|
||||
and were carried unchanged into another. Copy states facts about the platform; when the platform
|
||||
changes, the facts do.
|
||||
|
||||
**How to apply it.** When the game reaches a new platform, read every sentence that speaks about the
|
||||
device, the browser, storage or files, on that platform, and check that each claim is still true and
|
||||
each offered action still works. A remedy that silently fails is worse than none. Until then the
|
||||
platform is not shipped to players (here: G-T4, a release blocker).
|
||||
@@ -97,3 +97,30 @@ derivation deserves a second look, not just the one zone.
|
||||
|
||||
**How to apply it.** After a Node upgrade, run the content tests first. When generated data changes,
|
||||
diff it item by item (here: every town whose zone moved) and explain each change in the review.
|
||||
|
||||
## A generated project is newer than anything you made before it
|
||||
|
||||
**What happened.** The first Android APK (2026-11-17) carried Tauri's logo. `scripts/icons.ts` copied
|
||||
Rosea's icons only when the target was older than `icon.svg`, but `tauri android init` had just
|
||||
written its own icon into `gen/android`, newer than both.
|
||||
|
||||
**Why it bit.** A date check answers "has the source changed since?", not "is this file mine?". A
|
||||
generator that runs later wins every date comparison.
|
||||
|
||||
**How to apply it.** Copy what must survive a generator unconditionally, and check it by content
|
||||
(`android.ts check` compares the icon's bytes). Then look at the artefact: the APK's own icon was
|
||||
hashed against ours.
|
||||
|
||||
## The proof of an app's permissions is the built package
|
||||
|
||||
**What happened.** Following Amicitia (its lessons/technical.md), `pnpm tauri:android` ends by reading
|
||||
the APK with `aapt2 dump permissions` and `dump xmltree`, and the device check reads
|
||||
`dumpsys package` on the tablet. The source manifest was right; the APK also held a
|
||||
`DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION` that the source never mentions (androidx merges it).
|
||||
|
||||
**Why it bit.** The manifest merge adds what libraries declare. A check on the source would never see
|
||||
a permission a library adds.
|
||||
|
||||
**How to apply it.** Check permissions, backup flags and WebView switches on the APK and on the
|
||||
installed package, and name each allowed exception precisely (this package's own receiver guard,
|
||||
not any app's).
|
||||
|
||||
@@ -146,3 +146,41 @@ asserts something the edge makes false.
|
||||
**How to apply it.** Bound every search to the region the test means (here: daytime on the
|
||||
pour's own local day), and when a test built on a search fails, print what the search
|
||||
returned before debugging the code under test.
|
||||
|
||||
## A constant the minifier folds cannot be found in the bundle
|
||||
|
||||
**What happened.** The first shell-build test (`apps/rosea-tauri/test/shell-build.test.ts`, 2026-11-17)
|
||||
asserted that the string `"tauri"` was in the built JavaScript, to prove `__ROSEA_SHELL__` was
|
||||
`'tauri'`. Vite replaces the constant, and the minifier then folds `'tauri' === 'tauri'` to `!0`:
|
||||
the string is gone whether the build was right or wrong.
|
||||
|
||||
**Why it bit.** A test that reads build output tests every step of the build, the minifier included.
|
||||
An assertion about a literal that only exists before minification is about the source, not the bundle.
|
||||
|
||||
**How to apply it.** Assert what the bundle must not contain (the constant's name, which would throw
|
||||
in the webview), and prove the behaviour where it runs: here, the device check.
|
||||
|
||||
## A window after a match can read the neighbour's value
|
||||
|
||||
**What happened.** The first APK check looked for a WebView switch's value in the 300 characters
|
||||
after its name in `aapt2 dump xmltree`. The next `<meta-data>` element starts within those 300
|
||||
characters, so a switch turned the wrong way could pass on its neighbour's value.
|
||||
|
||||
**Why it bit.** A fixed window feels safe because the right answer is inside it; so is a wrong one.
|
||||
|
||||
**How to apply it.** Read structured output by its structure (here: the value attribute on the line
|
||||
after the name attribute), and keep a test that flips exactly one value on real output and expects
|
||||
that one name back.
|
||||
|
||||
## A dropped device link is not a failed test, and must not look like a pass either
|
||||
|
||||
**What happened.** On 2026-11-17 the USB link to the Android tablet dropped at least twice within the
|
||||
hour (`device offline`; adb's transport id went 1 → 4 → 5), once between the two visits of the
|
||||
garden check, which then failed on `am force-stop`.
|
||||
|
||||
**Why it bit.** A real device is a second machine with its own life. Retrying everything hides real
|
||||
failures; retrying nothing makes the check a coin toss.
|
||||
|
||||
**How to apply it.** Retry only the failure that names the link (`offline`, `closed`, `no devices`),
|
||||
after `adb wait-for-device`, a bounded number of times; find the device handle again after a drop;
|
||||
let every other failure end the check at once. Report how many runs failed and why.
|
||||
|
||||
@@ -0,0 +1,149 @@
|
||||
# Review — `feature/tauri-platforms`
|
||||
|
||||
Adversarial self-review (CLAUDE.md §5.3). Analysis: [`features/tauri-platforms.md`](../features/tauri-platforms.md).
|
||||
Reviewed 2026-11-17 on Windows 10 Pro (19045), Node 22.23.4, Rust 1.99.0 (MSVC), JDK 17.0.20,
|
||||
Android SDK with NDK 27.1, Tauri CLI 2.12.5, tauri 2.12.6, WebView2 157.0.4341.46. The Android device
|
||||
is a WAVE 10C on Android 16 (API 36) with Android System WebView 140.0.7339.207, over USB. There is no
|
||||
PR: the only remote is Gitea.
|
||||
|
||||
## What the author asked, and what exists now
|
||||
|
||||
*"I need also android apk version, desktop version, ios version and pwa version. Put that to claude.md
|
||||
based on the tauri2 framework."*
|
||||
|
||||
| Version | State |
|
||||
|:--|:--|
|
||||
| PWA | Unchanged; the e2e and offline suites pass (counts below). |
|
||||
| Windows desktop | **Built and run.** `pnpm tauri:build` → `rosea-shell.exe` and `Rosea Domi_0.1.0_x64-setup.exe` (NSIS, 1.31 MiB), 5 min 49 s from cold. The check passed: the garden opens, she is watered, the app is closed and opened again, she is still watered. |
|
||||
| Android | **Built, installed and run on the tablet.** `pnpm tauri:android` → `app-universal-debug.apk` (arm64 only, debug, ~122 MB with debug symbols), verified with `aapt2`; installed with `adb install -r`; the check passed: opens, watered, `am force-stop`, opened again, still watered. Offline by construction: the app holds no `INTERNET` permission. |
|
||||
| iOS | **Not possible here.** `pnpm tauri:ios` refuses on Windows with the reason (seen). What it needs is in the analysis, G-T1. |
|
||||
| macOS, Linux desktop | Not built (G-T2). |
|
||||
|
||||
Downloads: the author approved (2026-11-17) the Tauri CLI from npm, crates from crates.io, Gradle
|
||||
artefacts from Google Maven and Maven Central, all expected to come from this machine's caches.
|
||||
pnpm reported **2 packages downloaded** (the CLI and its Windows binary); cargo and Gradle built
|
||||
without visible fetches. Nothing was installed system-wide. On the tablet: only Rosea's debug APK
|
||||
(Playwright's Android support reached the WebView over adb and installed nothing).
|
||||
|
||||
## Gates
|
||||
|
||||
Filled from the run on the branch head:
|
||||
|
||||
Run on the branch after `main` (the sunrise, Coyhaique) was merged into it, 2026-11-17:
|
||||
|
||||
| Gate | Result |
|
||||
|:--|:--|
|
||||
| `pnpm lint`, `pnpm typecheck` | 0 problems (svelte-check 0 errors) |
|
||||
| `pnpm lint:copy` | 21 files, 0 problems |
|
||||
| `pnpm validate:library` | 0 entries; 78 candidates; 13 of 13 fixtures rejected |
|
||||
| `pnpm test` (guard 74 % → started; `turbo run test --continue`) | **529 passed**: cpu-guard 13, identity 5, schema 19, content 88, storage 65, art-prep 61, **tauri 40**, engine 174, ui 64 |
|
||||
| `pnpm test:e2e` (guard 59 %) | 22 passed |
|
||||
| `pnpm test:offline` (guard 73 %) | 1 passed |
|
||||
| `pnpm tauri:build` (merged tree) | built; NSIS 1.31 MiB; the desktop check **passed** again |
|
||||
| `pnpm tauri:android` (merged tree) | built and `aapt2`-verified. **Not re-run on the tablet:** at that moment `adb` hung on the WAVE 10C (another session had it over Wi-Fi adb, an emulator attached too), and this session left it alone. The on-device passes (3 of 5 runs, below) are of the build before the merge, whose shell and privacy were identical; the merge changed the game (the sunrise), not the shell. |
|
||||
|
||||
The first gate run, before the merge, failed one content test (`America/Coyhaique`, a zone the
|
||||
upgraded Node knows); `main` had fixed it meanwhile (`fix/coyhaique`), which is why `main` was
|
||||
merged into the branch before the final run.
|
||||
|
||||
**The app changed** (CLAUDE.md §5.4) only for the shell: the PWA's `App.svelte` now reads one
|
||||
constant that is `'web'` in its build, so the PWA behaves as before. Rebuilt by the e2e and offline
|
||||
runs; **not deployed** (G0.13). The APK and the installer are on this machine only, not committed.
|
||||
|
||||
## Bug drills
|
||||
|
||||
Each bug put back by script, the named test run, the file restored. One drill spot-checked to fail
|
||||
on the right assertion (the worker left on → *has no service worker and no web manifest*).
|
||||
|
||||
| Put back | Result |
|
||||
|:--|:--|
|
||||
| Tauri's CSP drifts from `csp.ts` (`'unsafe-inline'` added) | CAUGHT |
|
||||
| `useHttpsScheme` flipped to `false` (origin moves, rose left behind) | CAUGHT |
|
||||
| Identifier changed | CAUGHT |
|
||||
| A WebView2 privacy flag dropped | CAUGHT |
|
||||
| The Android build no longer runs the privacy patch | CAUGHT |
|
||||
| A plugin crate added to the shell | CAUGHT |
|
||||
| The service worker left on in the shell build | CAUGHT |
|
||||
| The `<meta>` CSP left in the shell build | CAUGHT |
|
||||
| The shell build under `/Rosea/` | CAUGHT |
|
||||
| The patch forgets to remove `INTERNET` | CAUGHT |
|
||||
| The patch forgets `allowBackup` | CAUGHT |
|
||||
| A rule file stops excluding the database from device transfer | CAUGHT |
|
||||
| The APK check lets any app's receiver-guard permission through | CAUGHT |
|
||||
| The APK check reads a neighbour's meta-data value | CAUGHT |
|
||||
| Tauri's logo left as the launcher icon | CAUGHT by `android.ts check` (exit 1, then 0 after the copy); not a unit test |
|
||||
|
||||
**Not drilled, and no test would catch it:** `App.svelte` not counting the app as installed (D9).
|
||||
Seen only through the check's report (`persist()` is asked; on iOS, the install hint, untestable here).
|
||||
|
||||
## Findings
|
||||
|
||||
| # | Area | Finding | Resolution |
|
||||
|:--|:--|:--|:--|
|
||||
| 1 | **Soul** | Inside the apps, *Keep her safe* says *This browser may clear her if the garden is not opened for a long time. A saved file keeps her for sure.*, offers *Ask the browser to keep her* (which always answers no: `persist()` is `false` in both webviews), and on Android *Save her to a file* **does nothing** (measured). A player is told she may be lost, in the wrong words, and the one remedy fails silently. That is a worry the game made, and a broken promise. | **Deferred, as a release blocker** (G-T4): it needs app words in `packages/ui` copy and a working save, which is the first Tauri plugin and its own feature doc and Soul review. Today the APK and installer exist on this machine only, for the author's own play; CLAUDE.md §8 and the analysis say no app goes to a player before G-T4 closes. Offered as the next session. |
|
||||
| 2 | Correctness | The first APK carried **Tauri's logo**: `icons.ts` skipped the copy because `tauri android init` had written its own icon later than ours. | Fixed: the Android icons are copied into `gen/android` on every build, and `android.ts check` compares the bytes; the rebuilt APK's `mipmap-mdpi` icon hashes to ours. |
|
||||
| 3 | Test honesty | The first APK check read a meta-data value from a 300-character window after its name, which could read the next element's value and pass a wrong switch. | Fixed: it reads the value attribute on the line after the name; a test flips one switch on real `aapt2` output and expects its name; drilled. |
|
||||
| 4 | Test honesty | The first APK check let **any** `…DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION` through, another app's included. | Fixed: only `<this package>.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION`; drilled. |
|
||||
| 5 | Correctness | The first shell-build test asserted the string `"tauri"` in the bundle; the minifier folds `__ROSEA_SHELL__ === 'tauri'` away, so the assertion tested the minifier. | Removed; what the test keeps is that the constant never reaches the webview (it would throw). |
|
||||
| 6 | Correctness | The tablet's USB link dropped at least twice in an hour (`device offline`, transport ids 1 → 4 → 5), once mid-check. | The check waits for the device and retries a dropped `adb` command, and finds the device again for each visit. A failure for any other reason still fails at once. |
|
||||
| 7 | Test honesty | One tablet run timed out clicking *Her numbers* while the garden animated (Playwright never saw the button stable). | The check activates it by keyboard (focus, Enter); the run after the fix passed. Recorded, not hidden: of 5 tablet runs, 3 passed, 1 failed this way, 1 on the USB drop. |
|
||||
| 8 | Privacy | WebView2's environment variables (used by the desktop check to open a debugging port and a temporary data folder) **replace** the app's `additionalBrowserArgs` for that run. | Said in the check's header: the desktop check proves the garden, not WebView2's silence (G-T6). |
|
||||
| 9 | Correctness | Tauri creates `%LOCALAPPDATA%\cz.mareknovak.domi.rosea\` at start even when WebView2's data is elsewhere. | The check's run left that folder empty; it was removed after each run. The player's real data lives there (`EBWebView\`), as §4 says. |
|
||||
| 10 | Privacy | The Windows installer's default WebView2 mode downloads the WebView2 bootstrapper from Microsoft if WebView2 is missing. | Noted in the analysis (§3); Windows 10 and 11 ship WebView2. Not changed. |
|
||||
| 11 | Scope | No Android dev command (`tauri android dev`): it would need `INTERNET` back and `adb reverse` to stay on 127.0.0.1. | Deferred (D12); not needed to test what exists. |
|
||||
| 12 | Design | The window is 480 × 800 on the desktop; the garden was designed for a phone. | Kept: portrait like the PWA's manifest. Whether the desktop app should be wider is the author's call after playing it. |
|
||||
|
||||
## Correctness
|
||||
|
||||
- **Second run**: `android.ts apply` is idempotent (test); `icons.ts` copies every time; a second
|
||||
`pnpm tauri:android` rebuilt in seconds and re-verified.
|
||||
- **Clock and DST**: nothing here reads time; the game's own handling is unchanged.
|
||||
- **Partial write, app closed mid-action**: the app is closed with `kill` (desktop) and
|
||||
`am force-stop` (Android) right after the care was **committed** (the check waits for the log);
|
||||
a force-stop *during* the write was not tried. IndexedDB's transactions are the same as in the PWA.
|
||||
- **Two tabs**: an app has one window; two instances of the desktop app share one WebView2 folder and
|
||||
would talk through `BroadcastChannel` like tabs. Not tried.
|
||||
- **Origin is forever**: identifier and `useHttpsScheme` are pinned by tests and drills.
|
||||
|
||||
## Soul
|
||||
|
||||
Finding 1 is the one: a worry and a broken remedy, in the apps only. Nothing else in this change adds
|
||||
a word, a count, a badge or a reminder. The apps do not notify. The window has no title-bar status.
|
||||
|
||||
## Privacy — every path a byte could leave
|
||||
|
||||
| Path | Android | Windows |
|
||||
|:--|:--|:--|
|
||||
| The game's own requests | none (check: 0 outside the origin) | none (check: 0 outside the origin) |
|
||||
| The webview's own traffic | impossible: no `INTERNET` (dumpsys, aapt2) | switched off by flags; **not measured** (G-T6) |
|
||||
| Cloud backup / device transfer | off (`allowBackup=false`, every domain excluded; dumpsys flags) | n/a (WebView2 data is not roamed) |
|
||||
| Plugins, IPC | none; no capabilities | none; no capabilities |
|
||||
| Installer | n/a | may fetch the WebView2 bootstrapper (finding 10) |
|
||||
| Crash reporting, analytics | none in `Cargo.toml` (test) or the game | same |
|
||||
| What the webview keeps on the device | `app_webview/` holds the IndexedDB, an **empty** Local Storage database Chromium creates (0-byte log: Rosea writes none), and `AwOriginVisitLoggerPrefs.xml`: hashed visit counters for WebView metrics, which are opted out and cannot leave without `INTERNET`; no backup takes them | `EBWebView\` beside the app; not inspected |
|
||||
|
||||
## Reachability
|
||||
|
||||
Nothing new: no field reaches anyone, no network.
|
||||
|
||||
## Offline
|
||||
|
||||
Android is offline by construction and was tested so. The desktop check ran with the machine online
|
||||
(WebView2's own flags replaced, finding 8); the game made no request outside its origin.
|
||||
|
||||
## Test honesty
|
||||
|
||||
- 14 of 14 drills caught; one spot-checked for the right assertion.
|
||||
- The device checks are scripts run by hand, not in `pnpm test`: they need the built app and the
|
||||
tablet. Their results above are from this machine on 2026-11-17.
|
||||
- The APK fixtures are real `aapt2` output of the APK built here, saved with the tests.
|
||||
|
||||
## What was NOT verified
|
||||
|
||||
- iOS, macOS, Linux (G-T1, G-T2). WKWebView's storage location and eviction.
|
||||
- WebView2's network silence for Rosea (G-T6).
|
||||
- Bringing a rose back from a file in either app (G-T5: the Android picker opens; nothing was picked).
|
||||
- A force-stop during a write. Two desktop instances at once.
|
||||
- The NSIS installer itself was built, not run: the check ran the `.exe` from `target/release`.
|
||||
- A release (signed) APK; an AAB; any store (G-T3).
|
||||
- Android versions other than 16, phones (only the tablet), other WebView versions.
|
||||
@@ -31,3 +31,9 @@ Thumbs.db
|
||||
|
||||
# Generated from JSON Schema by packages/schema build
|
||||
packages/schema/src/generated/
|
||||
|
||||
# The Tauri shell (apps/rosea-tauri): the game's copy for it, Tauri's generated mobile
|
||||
# projects and the icons made from apps/rosea/public/icon.svg at build time
|
||||
dist-tauri/
|
||||
apps/rosea-tauri/src-tauri/gen/
|
||||
apps/rosea-tauri/src-tauri/icons/
|
||||
|
||||
@@ -20,14 +20,19 @@ For the engineering picture read [`.agents/GAP_ANALYSIS.md`](.agents/GAP_ANALYSI
|
||||
> always **Rosea Domi** in public, and *Domi* never appears alone. In source the name lives in exactly
|
||||
> three places — `packages/schema/src/constants.ts`, `apps/rosea/index.html` and the web manifest —
|
||||
> plus the `@rosea/*` package scope and the IndexedDB database name, which change together with them.
|
||||
> Renaming must stay a one-commit operation until the name is confirmed.
|
||||
> The app shell adds a fourth: `apps/rosea-tauri/src-tauri/tauri.conf.json` (`productName`, window
|
||||
> title), which the shell's test holds equal to the constants (§2, *Four versions*).
|
||||
> Renaming must stay a one-commit operation until the name is confirmed. The bundle identifier is
|
||||
> the exception: once an APK or installer reaches a player it cannot change without making a
|
||||
> second, separate app, so it is chosen once, before the first release (§8).
|
||||
|
||||
---
|
||||
|
||||
## 1. What this project is
|
||||
|
||||
**Rosea Domi** is a small web game, installable as a PWA, about a living rose, a fox, and the time we
|
||||
give to people. It belongs to the Domi ecosystem and is linked from the parent mode of Panda Domi; the
|
||||
**Rosea Domi** is a small game about a living rose, a fox, and the time we give to people. It ships
|
||||
as **four versions from one Svelte codebase** — a PWA, an Android app, an iOS app and a desktop app
|
||||
(§2, *Four versions*). It belongs to the Domi ecosystem and is linked from the parent mode of Panda Domi; the
|
||||
fox is a quiet nod to Ulfík the red panda (they look alike — an Easter egg, never an explanation).
|
||||
|
||||
It is made **for lonely people**, and the word *loneliness* never appears anywhere in the product.
|
||||
@@ -141,7 +146,13 @@ packages/
|
||||
ui/ # Svelte components + tokens + copy/. No business logic.
|
||||
|
||||
apps/
|
||||
rosea/ # the PWA (Svelte 5 + Vite + workbox) -> @rosea/app
|
||||
rosea/ # the game (Svelte 5 + Vite + workbox) -> @rosea/app. Built twice:
|
||||
# dist/ the PWA, under /Rosea/, with its service worker
|
||||
# dist-tauri/ for the shell: base /, no service worker, no manifest
|
||||
rosea-tauri/ # the Tauri 2 shell -> @rosea/tauri. Wraps apps/rosea/dist-tauri/; imports no package
|
||||
src-tauri/ # Rust (a window and nothing else), tauri.conf.json; no capabilities/, so no IPC
|
||||
android/ # what must survive `tauri android init` (gen/ is never committed)
|
||||
scripts/ # icons from apps/rosea/public/icon.svg; the Android privacy patch
|
||||
|
||||
services/
|
||||
lucerna/ # OPTIONAL discovery service (Phase 4), Rust (Axum) + SQLite.
|
||||
@@ -179,6 +190,7 @@ apps/rosea ──► packages/ui ──► packages/engine ──► packages/sc
|
||||
└───────► packages/identity ──► packages/schema
|
||||
services/lucerna ──► packages/schema (trace shape only, via generated JSON Schema)
|
||||
tools/art-prep ──► art/manifest.json, packages/content, packages/schema (never imported by the app)
|
||||
apps/rosea-tauri ──► apps/rosea's BUILT output (dist-tauri/) only — no package, no source file
|
||||
```
|
||||
|
||||
- `packages/engine` is pure. Time and randomness are parameters. This is what makes growth, taming and
|
||||
@@ -186,6 +198,10 @@ tools/art-prep ──► art/manifest.json, packages/content, packages/schema
|
||||
- `apps/rosea` contains zero growth, taming or sky logic. It renders what the engine returns.
|
||||
- `services/lucerna` must be deletable. If removing it breaks the rose, the planets, the fox, friends
|
||||
or the sunset, the shared sky has stopped being optional and that is a **blocker**.
|
||||
- `apps/rosea-tauri` must be deletable too: removing it leaves the PWA whole. The game never asks
|
||||
which shell it is in except through one build-time constant, `__ROSEA_SHELL__` (`'web'` or
|
||||
`'tauri'`), read in `apps/rosea/src/App.svelte` only, for wiring (no service worker; the app counts
|
||||
as installed). No package ever reads it.
|
||||
|
||||
### Why Svelte, and where Rust earns its place
|
||||
|
||||
@@ -194,12 +210,41 @@ Web first is the decision: the game must run from a link, on any phone, with no
|
||||
|
||||
- **`services/lucerna`** — a small, long-running, internet-facing service. Rust (Axum) gives memory
|
||||
safety and a tiny footprint on a home server. Its contract is the JSON Schema in `packages/schema`.
|
||||
- **A Tauri 2 shell, later (Phase 6)** — same Svelte code, packaged for Android and iOS, matching the
|
||||
ecosystem's move to Tauri. Its main gift is **local notifications without a server** (see the
|
||||
notification trap in §8).
|
||||
- **A Tauri 2 shell, now (the platform track)** — same Svelte code, packaged for Android, iOS and the
|
||||
desktop, matching the ecosystem's move to Tauri. Its later gift (Phase 6) is **local notifications
|
||||
without a server** (see the notification trap in §8).
|
||||
- **Not** a Rust UI framework (Leptos, Dioxus, Yew) and **not** Rust→WASM for the sunset or star
|
||||
maths: both are small and fast in TypeScript. WASM enters only with a measurement that says it must.
|
||||
|
||||
### Four versions, one garden — decided by the author, 2026-11-17
|
||||
|
||||
| Version | Made from | Runs in | Where it can be built |
|
||||
|:--|:--|:--|:--|
|
||||
| **PWA** | `apps/rosea` → `dist/` | any browser; GitHub Pages under `/Rosea/` | any machine |
|
||||
| **Android** (APK) | `apps/rosea-tauri` → `pnpm tauri:android` | Android System WebView | Windows, macOS or Linux with the Android SDK, NDK 27, JDK 17 and the Rust Android targets |
|
||||
| **Desktop** | `apps/rosea-tauri` → `pnpm tauri:build` | WebView2 (Windows), WKWebView (macOS), WebKitGTK (Linux) | each on its own OS: an NSIS installer on Windows; `.app`/`.dmg` on macOS; `.deb`/AppImage on Linux |
|
||||
| **iOS** | `apps/rosea-tauri` → `pnpm tauri:ios` | WKWebView | **macOS with Xcode only**, and an Apple developer account to put it on a phone |
|
||||
|
||||
- **One codebase.** The same Svelte 5 app, the same packages, the same IndexedDB code in all four.
|
||||
The shell adds a window around the built game and nothing else: no Tauri command, no plugin, no
|
||||
`@tauri-apps/api` in the game. Each plugin that arrives later (notifications in Phase 6) is reviewed
|
||||
for network access before it is added, as in Amicitia.
|
||||
- **Layout: `apps/rosea-tauri/src-tauri/`.** The Tauri 2 CLI looks for `src-tauri/tauri.conf.json`
|
||||
below the folder it runs in, so this is the layout it expects, one level down. Not Tauri's default
|
||||
`apps/rosea/src-tauri/`: that would put Rust and the Tauri CLI into the PWA's package. Here the shell
|
||||
is deletable, and its only input is a built folder — the same seam the e2e suites test
|
||||
(`tauri-platforms.md` D1).
|
||||
- **The shell's build of the game** (`vite build --mode tauri`, into `apps/rosea/dist-tauri/`): base `/`,
|
||||
because Tauri serves the files at the root of its own origin; **no service worker and no web
|
||||
manifest**, because the files are already on the device and a store or installer brings updates;
|
||||
the content-security policy delivered by Tauri (`app.security.csp`), the same string as the PWA's
|
||||
`<meta>` policy, held equal by a test (§8).
|
||||
- **The non-negotiable properties hold in all four.** Local-first, anonymous, no free text, never
|
||||
counting people, nothing written outside IndexedDB, no analytics — in any SDK either: the shell
|
||||
links no analytics, crash-reporting or ads library, and the webviews' own reporting is switched off
|
||||
where the platform allows it (§8, *the webview phones home*). The Android app asks for **no
|
||||
`INTERNET` permission** while Rosea has no network feature, so the kernel refuses it any socket.
|
||||
|
||||
---
|
||||
|
||||
## 3. Commands
|
||||
@@ -226,12 +271,26 @@ pnpm art:board # prompts + stand-ins -> tools/art-prep
|
||||
pnpm art:accept <id> <file> # an accepted picture -> art/final/*.webp, sheets cut
|
||||
tsx scripts/build-places.ts <folder> # rebuilds the town list from downloaded Natural Earth + tzdb (by hand)
|
||||
|
||||
# The Tauri 2 shell (apps/rosea-tauri) — each builds the game for the shell first (dist-tauri/):
|
||||
pnpm tauri:dev # desktop window on the Vite dev server, 127.0.0.1:5173
|
||||
pnpm tauri:build # desktop release: on Windows an NSIS installer and the .exe
|
||||
# needs Rust (MSVC), WebView2, VS Build Tools; macOS/Linux on their own OS
|
||||
pnpm tauri:android # Android debug APK (arm64); needs ANDROID_HOME, NDK 27, JDK 17,
|
||||
# the four Rust Android targets. Install: adb install -r <apk>
|
||||
pnpm tauri:ios # macOS + Xcode only — refuses elsewhere with the reason (§8)
|
||||
pnpm --filter @rosea/tauri test # the shell's tests: config (CSP, name, origin), privacy patch, shell build
|
||||
tsx e2e/apps/check-garden.ts desktop # the built .exe: water her, close, reopen, still watered (temp data folder)
|
||||
tsx e2e/apps/check-garden.ts android # the installed APK on the device over adb; `pm clear`s the TEST app first
|
||||
|
||||
# Not yet — they arrive with their first feature:
|
||||
cargo test --manifest-path services/lucerna/Cargo.toml # Phase 4 onward
|
||||
```
|
||||
|
||||
The build's base path is `/Rosea/` (GitHub Pages' project sub-path); `ROSEA_BASE=/x/` overrides it
|
||||
for the build and for both Playwright suites together.
|
||||
for the build and for both Playwright suites together. `pnpm --filter @rosea/app build:shell` builds
|
||||
the shell's copy instead (`--mode tauri`: base `/`, into `dist-tauri/`); the `tauri:*` commands run it.
|
||||
`pnpm tauri:android` ends by reading the built APK with `aapt2` and fails if it asks for any
|
||||
permission or allows backup (`tauri-platforms.md` D6).
|
||||
|
||||
> **The `pnpm test` trap, imported from Aeterna.** Exit code 0 says the command succeeded, not that
|
||||
> tests ran. A filter that matched nothing and a green run look identical. **Quote the counts per
|
||||
@@ -261,7 +320,24 @@ replaying `events` through the engine. A number that cannot be derived from the
|
||||
`derived`.
|
||||
|
||||
**Nothing else is written anywhere.** No cookies, no `localStorage`, no analytics of any kind, no
|
||||
third-party origin, no fonts or images from a CDN.
|
||||
third-party origin, no fonts or images from a CDN. This holds in the shell too: `localStorage` and
|
||||
`sessionStorage` stay forbidden there, and the Rust side writes no file of its own. (The webview keeps
|
||||
its own profile beside the database: caches, an empty Local Storage folder Chromium makes, and on
|
||||
Android hashed visit counters for its metrics, which are switched off and cannot be sent.)
|
||||
|
||||
**Where IndexedDB lives in each version** (the webview owns the folder; Rosea writes only its
|
||||
database there — the webview keeps its own caches beside it):
|
||||
|
||||
| Version | Where the `rosea` database is |
|
||||
|:--|:--|
|
||||
| PWA | the browser profile, per origin; evictable (§8) |
|
||||
| Windows | WebView2's user data folder: `%LOCALAPPDATA%\<identifier>\EBWebView\` |
|
||||
| Android | the app's private data: `/data/data/<identifier>/app_webview/Default/IndexedDB/https_tauri.localhost_0.indexeddb.leveldb` (seen on the tablet) — no Auto Backup, no device transfer (`tauri-platforms.md` D6) |
|
||||
| macOS / iOS | WKWebView's website data in the app's container (`Library/WebKit/`) *(predicted)* |
|
||||
| Linux | WebKitGTK's data dir under `~/.local/share/<identifier>/` *(predicted)* |
|
||||
|
||||
A rose made in the PWA and the same player's Android app are **two roses** until the player carries
|
||||
one across with *Keep her safe* (save to a file, bring her back). Nothing syncs them.
|
||||
|
||||
**On `services/lucerna`, only when the player has opted in to the shared sky (Phase 4):** an anonymous
|
||||
trace id, a coarse geocell (~1 km), a day bucket (never a timestamp finer than a day), and the gesture
|
||||
@@ -314,6 +390,8 @@ Format : [<Package>] <FeatureName>: <one-line description>
|
||||
Example: [engine] RoseGrowth: Grow from total days of care, never from consecutive days
|
||||
Remote : GitHub (primary) — branch main; mirrored to gitea.marek-novak.cz, as in Panda Domi
|
||||
Deploy : GitHub Actions builds apps/rosea and publishes it to GitHub Pages on every merge to main
|
||||
Apps : the APK and the desktop installer are built by hand on this machine until CI can (G0.22);
|
||||
never committed. Release signing keys never enter the repository (§5.3's token rule)
|
||||
```
|
||||
|
||||
PRs are opened and merged on GitHub. The Gitea mirror is a backup and must stay in sync — after every
|
||||
@@ -361,7 +439,10 @@ repository, a review document or command output.
|
||||
### 5.4 The deployed bundle is the only thing the player sees
|
||||
|
||||
The player opens an installed PWA served from a precached shell. Source changes are invisible until
|
||||
the app is rebuilt, the service worker's bytes change, and the client picks up the new worker. When
|
||||
the app is rebuilt, the service worker's bytes change, and the client picks up the new worker. In the
|
||||
Android, iOS and desktop apps the game is inside the package: a change reaches a player only with a
|
||||
new APK or installer, which must carry a higher version (`apps/rosea/package.json`, read by
|
||||
`tauri.conf.json`) or Android refuses it as a downgrade. When
|
||||
reporting a fix, **say whether the bundle was rebuilt and redeployed**. If a change is deliberately
|
||||
invisible (a refactor, a library update), say so explicitly — a fresh build that looks identical is
|
||||
otherwise indistinguishable from a stale one. *(Imported from NoAlgoTube and Aeterna, where it
|
||||
@@ -413,7 +494,10 @@ happened twice.)*
|
||||
|
||||
### 5.7 A test run leaves the machine as it found it
|
||||
|
||||
Nothing binds to anything but `127.0.0.1`. Every browser a test starts is closed in `finally`. Do not
|
||||
Nothing binds to anything but `127.0.0.1` — the shell's dev server and a webview's debugging port
|
||||
included; a phone reaches the dev server through `adb reverse`, never through `--host`. Every browser
|
||||
a test starts is closed in `finally`, and so is every app a test launches (the desktop `.exe`, the
|
||||
app on the tablet: `am force-stop`). Do not
|
||||
start a full run above ~80% CPU. *(Imported from Ludus and Aeterna.)* **Enforced, not trusted:**
|
||||
`pnpm test`, `test:e2e` and `test:offline` first run `pnpm guard:cpu`, which waits up to three minutes
|
||||
for the machine to calm and then refuses (`tools/cpu-guard`, lessons/process.md). A dedicated machine
|
||||
@@ -494,7 +578,7 @@ No timestamp finer than a day, no precise location, no free text, no link to the
|
||||
|
||||
| Trap | Why it bites |
|
||||
|:--|:--|
|
||||
| **A PWA cannot schedule a local notification** *(predicted — verify first)* | The sunset invitation is time-based. A web app generally cannot fire a notification at a set time while closed without a **push server** sending it, and a push server that knows when someone's sunset is knows roughly where they are. On iOS, web push works only for a site added to the home screen. **Decided in Phase 0 (2026-11-01):** in-app sunset only for the web build — no push server — and local notifications through the Tauri shell later (Phase 6). |
|
||||
| **A PWA cannot schedule a local notification** *(predicted — verify first)* | The sunset invitation is time-based. A web app generally cannot fire a notification at a set time while closed without a **push server** sending it, and a push server that knows when someone's sunset is knows roughly where they are. On iOS, web push works only for a site added to the home screen. **Decided in Phase 0 (2026-11-01):** in-app sunset only for the web build — no push server — and local notifications through the Tauri shell later (Phase 6). The shell exists since 2026-11-17; its notification plugin is still Phase 6. |
|
||||
| **Polar day and polar night** *(measured 2026-11-01)* | Above the Arctic Circle the sun does not set in summer or rise in winter. "Every day at sunset" has no answer there. Measured: the almanac has no rise or set in Tromsø on 21 June and no events at all on 21 December. `engine/sun` returns `polar-day` or `polar-night` and a gentle moment for each (the lowest light; noon twilight) — `.agents/features/sun.md` D4. |
|
||||
| **DST and the local day** *(measured 2026-11-01)* | Sunset jumps an hour twice a year under a player who did nothing: Prague's is 18:28 on 28 March and 19:29 on the 29th, while the sun moved one minute. A day boundary computed in UTC records Monday-evening care as Tuesday's. One module computes the day; the sun works in instants. |
|
||||
| **Comfort becomes wallpaper** | The same words every day stop meaning anything. Comfort words are occasional; the real trace of a real person is constant. Track repetition in tests. |
|
||||
@@ -515,6 +599,14 @@ No timestamp finer than a day, no precise location, no free text, no link to the
|
||||
| **Pages hosts files, not services** | `services/lucerna` cannot live on Pages. It runs on Mark's own server (Phase 4), and the app must work fully without it. |
|
||||
| **`pnpm test` exits 0 having run nothing** | Quote counts per package. |
|
||||
| **Playwright against the dev server** | It never registers the service worker and has never reproduced a caching bug. |
|
||||
| **Base path in the shell** *(measured 2026-11-17)* | The PWA lives under `/Rosea/`; Tauri serves the game at the root of its own origin (`https://tauri.localhost/` on Windows and Android with `useHttpsScheme`, `tauri://localhost/` on macOS and iOS). A shell build with base `/Rosea/` would ask for `/Rosea/assets/…` and open a blank window. The shell's copy is built with base `/` into its own folder, so the two can never be mixed up; measured: the garden opens at `https://tauri.localhost/` on Windows and on Android. |
|
||||
| **A service worker inside a webview** *(answered 2026-11-17)* | Inside Tauri the files are already on the device; a worker would cache a second copy, could serve a stale game after an app update, and *A new version of the garden is ready* would offer a refresh that fetches nothing. The shell's build has no worker and no manifest: `vite-plugin-pwa` is disabled there and `registerSW` is its no-op. Measured: no registration in either app. |
|
||||
| **Two content-security policies** *(conflict predicted; the answer measured 2026-11-17)* | The PWA carries its policy in a `<meta>` tag (Pages sends no headers). Tauri can deliver its own policy and adds hashes for the scripts it injects; a page with **both** obeys both, and the `<meta>` would block what Tauri adds. So the shell's build has no `<meta>` policy and Tauri delivers the same string, held equal by `apps/rosea-tauri` test. Measured: no CSP violation and no request outside the origin, on Windows and on Android. |
|
||||
| **IndexedDB eviction in a webview** *(partly measured 2026-11-17)* | WebView2 and Android WebView are Chromium: best-effort storage can be cleared under disk pressure, and an app's data is wiped on uninstall (the Windows uninstaller offers to delete app data). WKWebView on iOS may purge website data of an app that is not used. `persist()` answers `false` in WebView2 and in Android WebView (measured). *Keep her safe* is the real defence — and on Android saving a file through `<a download>` **does nothing** (measured on the tablet), while the words still speak of *this browser*: a release blocker (`tauri-platforms.md` G-T4). |
|
||||
| **The webview phones home** *(measured in Amicitia, 2026-11-08; here: Android closed by construction, Windows unmeasured)* | A webview talks to its maker on its own: WebView2 to Microsoft and DNS-over-HTTPS providers, Android WebView to Google's metrics and an Autofill server as soon as a field takes focus. Desktop: `additionalBrowserArgs` switches these off (undocumented feature names a runtime update can break). Android: no `INTERNET` permission at all while Rosea has no network feature, plus metrics and Safe Browsing off in the manifest, applied by a committed patch because `gen/` is regenerated. Measure on every release build. |
|
||||
| **Auto Backup sends the garden to a cloud** *(answered 2026-11-17)* | A stock Tauri Android manifest lets Android copy the app's data — the care log, the keys, the chosen town — to the player's cloud backup, without the player choosing it. The patch sets `allowBackup="false"` and excludes every domain from cloud backup and device transfer; *Keep her safe* is how a rose moves. Measured: the installed package carries no `ALLOW_BACKUP` flag and no `INTERNET` permission (`dumpsys package`); `pnpm tauri:android` checks the APK itself with `aapt2`. |
|
||||
| **iOS cannot be built on Windows** *(known)* | `tauri ios init` and every iOS build need macOS and Xcode; installing on a phone needs an Apple developer account (free for one's own device, paid for TestFlight and the App Store). `pnpm tauri:ios` refuses on Windows with this reason. |
|
||||
| **The bundle identifier and the origin are forever** | An Android `applicationId` or iOS bundle id cannot change after a release without becoming a different app: the old one keeps the player's rose, the new one starts empty. Chosen once (`cz.mareknovak.domi.rosea`), before the first release, even though the product name may still change. The same holds for `useHttpsScheme` (`true`): flipping it changes the webview's origin, and IndexedDB is per origin, so the rose is left behind. The shell's test pins both. |
|
||||
|
||||
---
|
||||
|
||||
@@ -531,4 +623,5 @@ No timestamp finer than a day, no precise location, no free text, no link to the
|
||||
| Add or edit hope sentences | Agents propose in `content/candidates/`; the author verifies with `pnpm library:verify`. Then `pnpm validate:library` |
|
||||
| Change what friends can send each other | `packages/schema` §6.1 — and re-read §5.6 rule 1 |
|
||||
| Change the shared sky | `services/lucerna/` — and re-read §4 and §5.6 rules 6–7 |
|
||||
| Build the Android, iOS or desktop app | `apps/rosea-tauri/`, then `.agents/features/tauri-platforms.md` and the shell traps in §8 |
|
||||
| Understand a past decision | `.agents/features/*.md`, `git log`, `.agents/reviews/*.md` |
|
||||
|
||||
+20
@@ -113,6 +113,19 @@ Rewritten at the end of each session (CLAUDE.md §5.1).
|
||||
still on 127.0.0.1), driven through Chrome's DevTools socket: first open, the town, watering by a
|
||||
real held touch, the in-game sunset, and **offline** reloads with the server unreachable all pass.
|
||||
When device testing ends, the app used is stopped at once (the author's rule).
|
||||
- **Four versions, one garden (2026-11-17):** merged to `main`, as the author decided: the PWA plus
|
||||
an Android, iOS and desktop app from one codebase through a Tauri 2 shell, `apps/rosea-tauri`
|
||||
(CLAUDE.md §2 *Four versions*, §3, §4, §8; ROADMAP *The platform track*). The **Windows app**
|
||||
(`pnpm tauri:build`) and an **Android debug APK** (`pnpm tauri:android`) were built here; both
|
||||
passed the garden check (watered, closed, reopened, still watered; nothing outside the origin).
|
||||
The APK asks for no permission, not even `INTERNET`, and allows no backup (checked on the APK and
|
||||
on the tablet). **iOS needs a Mac** (G-T1). **No app goes to a player yet:** inside the apps
|
||||
*Keep her safe* speaks of *this browser*, and on Android saving to a file does nothing (G-T4,
|
||||
a release blocker). The debug APK and installer are build output on this machine, not committed:
|
||||
`apps/rosea-tauri/src-tauri/gen/android/app/build/outputs/apk/universal/debug/` and
|
||||
`apps/rosea-tauri/src-tauri/target/release/bundle/nsis/`. Analysis:
|
||||
[`.agents/features/tauri-platforms.md`](.agents/features/tauri-platforms.md). Review:
|
||||
[`.agents/reviews/feature-tauri-platforms.md`](.agents/reviews/feature-tauri-platforms.md).
|
||||
- **Phase 1 is built in code.** What remains of it is the author's: verified sentences (the petal
|
||||
appears with them), hosting (G0.13), and the gate itself — two weeks of daily play on a phone.
|
||||
|
||||
@@ -141,6 +154,9 @@ The notification decision is made: in-app only on the web (G0.26).
|
||||
`packages/engine/src/rose/rose.ts`): how fast she gets thirsty, how often weeds, petals and wind
|
||||
come, and how many days of care each stage takes (full bloom after 25). Play it for a week,
|
||||
then say what feels wrong.
|
||||
7. **The apps:** a Mac with Xcode and an Apple developer account for iOS (G-T1); whether the
|
||||
desktop window (480 × 800, portrait) should be wider; the release signing keys, kept outside
|
||||
the repository (G-T3).
|
||||
|
||||
**How this machine works** (not in the code):
|
||||
|
||||
@@ -153,6 +169,10 @@ The notification decision is made: in-app only on the web (G0.26).
|
||||
download: ask first). The cause is unknown.
|
||||
- **The Android tablet:** WAVE 10C on USB debugging; always `adb -s WAVE10CEEA036785` (an emulator
|
||||
attaches too, and other projects use the same tablet). Stop the app used when testing ends.
|
||||
Its USB link drops now and then (`device offline`); `e2e/apps/check-garden.ts` waits and retries.
|
||||
- **Building the apps:** Rust 1.99 (MSVC) with the four Android targets, JDK 17, the Android SDK at
|
||||
`F:\Tools\Android\Sdk` (NDK 27.1), VS 2022 Build Tools, WebView2 and NSIS are all installed; a
|
||||
cold desktop release build takes about 6 minutes, an Android debug build about 2 after that.
|
||||
|
||||
- **Commit identity:** `mnovak <giteatruenasadminacc.from729@passmail.net>`, set in
|
||||
this repository only.
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Android 11 and earlier: no part of the garden is backed up (tauri-platforms.md D6).
|
||||
Copied into gen/android by scripts/android.ts. -->
|
||||
<full-backup-content>
|
||||
<exclude domain="root" path="." />
|
||||
<exclude domain="file" path="." />
|
||||
<exclude domain="database" path="." />
|
||||
<exclude domain="sharedpref" path="." />
|
||||
<exclude domain="external" path="." />
|
||||
<exclude domain="device_root" path="." />
|
||||
<exclude domain="device_file" path="." />
|
||||
<exclude domain="device_database" path="." />
|
||||
<exclude domain="device_sharedpref" path="." />
|
||||
</full-backup-content>
|
||||
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Android 12 and later. Nothing of the garden goes into a cloud backup or a device-to-device
|
||||
transfer: the care log, the keys and the chosen town stay on this device (CLAUDE.md §4,
|
||||
tauri-platforms.md D6). A rose moves only by the player's own hand, with Keep her safe.
|
||||
allowBackup="false" alone does not stop every device-transfer tool on Android 12+, so every
|
||||
domain is excluded here as well. Copied into gen/android by scripts/android.ts. -->
|
||||
<data-extraction-rules>
|
||||
<cloud-backup>
|
||||
<exclude domain="root" path="." />
|
||||
<exclude domain="file" path="." />
|
||||
<exclude domain="database" path="." />
|
||||
<exclude domain="sharedpref" path="." />
|
||||
<exclude domain="external" path="." />
|
||||
<exclude domain="device_root" path="." />
|
||||
<exclude domain="device_file" path="." />
|
||||
<exclude domain="device_database" path="." />
|
||||
<exclude domain="device_sharedpref" path="." />
|
||||
</cloud-backup>
|
||||
<device-transfer>
|
||||
<exclude domain="root" path="." />
|
||||
<exclude domain="file" path="." />
|
||||
<exclude domain="database" path="." />
|
||||
<exclude domain="sharedpref" path="." />
|
||||
<exclude domain="external" path="." />
|
||||
<exclude domain="device_root" path="." />
|
||||
<exclude domain="device_file" path="." />
|
||||
<exclude domain="device_database" path="." />
|
||||
<exclude domain="device_sharedpref" path="." />
|
||||
</device-transfer>
|
||||
</data-extraction-rules>
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"name": "@rosea/tauri",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"description": "The Tauri 2 shell: the Android, iOS and desktop apps around apps/rosea's built game (dist-tauri/). Imports no package.",
|
||||
"scripts": {
|
||||
"dev": "tsx scripts/icons.ts && tauri dev",
|
||||
"build:desktop": "tsx scripts/icons.ts && tauri build",
|
||||
"build:android": "tsx scripts/android.ts prepare && tauri android build --debug --apk --target aarch64 && tsx scripts/android.ts verify",
|
||||
"build:ios": "tsx scripts/ios.ts",
|
||||
"android:privacy": "tsx scripts/android.ts apply",
|
||||
"android:verify": "tsx scripts/android.ts verify",
|
||||
"typecheck": "tsc -p tsconfig.json",
|
||||
"test": "vitest run --reporter=verbose"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tauri-apps/cli": "2.12.5",
|
||||
"@types/node": "22.20.1",
|
||||
"tsx": "4.23.12",
|
||||
"typescript": "5.9.3",
|
||||
"vitest": "3.2.7"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
/**
|
||||
* The Android app's privacy on the generated project, and the proof on the built APK
|
||||
* (src/android-privacy.ts; tauri-platforms.md D6).
|
||||
*
|
||||
* tsx scripts/android.ts prepare `tauri android init` if needed, icons, then apply
|
||||
* tsx scripts/android.ts apply patch the manifest, copy the rule files, then check
|
||||
* tsx scripts/android.ts check what the generated project lacks; exit 1 if anything
|
||||
* tsx scripts/android.ts verify [apk] the same, read from the BUILT APK with aapt2
|
||||
*
|
||||
* `apply` runs from tauri.android.conf.json's beforeBuildCommand, so `tauri android build`
|
||||
* cannot make an APK without it. A Gradle build started outside the Tauri CLI skips that hook;
|
||||
* `verify` reads the artefact itself, and `pnpm tauri:android` runs it last.
|
||||
*/
|
||||
import { spawnSync } from 'node:child_process';
|
||||
import { copyFileSync, existsSync, mkdirSync, readdirSync, readFileSync, statSync, writeFileSync } from 'node:fs';
|
||||
import { join } from 'node:path';
|
||||
import { apkProblems, manifestProblems, patchManifest, RULE_FILES, RULE_SECTIONS, ruleProblems } from '../src/android-privacy.js';
|
||||
import { PACKAGE, SRC_TAURI, tauri } from './tauri.js';
|
||||
|
||||
const MAIN = join(SRC_TAURI, 'gen', 'android', 'app', 'src', 'main');
|
||||
const MANIFEST = join(MAIN, 'AndroidManifest.xml');
|
||||
const RES_FROM = join(PACKAGE, 'android', 'res', 'xml');
|
||||
const RES_TO = join(MAIN, 'res', 'xml');
|
||||
const OUTPUTS = join(SRC_TAURI, 'gen', 'android', 'app', 'build', 'outputs', 'apk');
|
||||
|
||||
function fail(problems: readonly string[]): never {
|
||||
for (const p of problems) console.error(`android: ${p}`);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
function problems(): string[] {
|
||||
if (!existsSync(MANIFEST)) return [`no generated project (${MANIFEST}); run 'pnpm tauri:android'`];
|
||||
const found = manifestProblems(readFileSync(MANIFEST, 'utf8'));
|
||||
for (const f of RULE_FILES) {
|
||||
const at = join(RES_TO, f);
|
||||
if (!existsSync(at)) found.push(`res/xml/${f} is missing`);
|
||||
else if (readFileSync(at, 'utf8') !== readFileSync(join(RES_FROM, f), 'utf8')) found.push(`res/xml/${f} differs from android/res/xml/${f}`);
|
||||
}
|
||||
// The launcher icon is Rosea's, not the Tauri logo `init` put there (scripts/icons.ts).
|
||||
const ours = join(SRC_TAURI, 'icons', 'android', 'mipmap-mdpi', 'ic_launcher.png');
|
||||
const there = join(MAIN, 'res', 'mipmap-mdpi', 'ic_launcher.png');
|
||||
if (!existsSync(ours) || !existsSync(there) || !readFileSync(ours).equals(readFileSync(there))) {
|
||||
found.push("the launcher icon is not Rosea's (run 'tsx scripts/icons.ts')");
|
||||
}
|
||||
return found;
|
||||
}
|
||||
|
||||
function apply(): void {
|
||||
for (const f of RULE_FILES) {
|
||||
const left = ruleProblems(readFileSync(join(RES_FROM, f), 'utf8'), RULE_SECTIONS[f]);
|
||||
if (left.length > 0) fail(left.map((p) => `android/res/xml/${f}: ${p}`));
|
||||
}
|
||||
if (!existsSync(MANIFEST)) fail([`no generated project (${MANIFEST}); run 'pnpm tauri:android'`]);
|
||||
const before = readFileSync(MANIFEST, 'utf8');
|
||||
const after = patchManifest(before);
|
||||
mkdirSync(RES_TO, { recursive: true });
|
||||
for (const f of RULE_FILES) copyFileSync(join(RES_FROM, f), join(RES_TO, f));
|
||||
if (after !== before) writeFileSync(MANIFEST, after);
|
||||
const left = problems();
|
||||
if (left.length > 0) fail(left);
|
||||
console.log(
|
||||
`android: privacy ${after === before ? 'already in place' : 'applied'} ` +
|
||||
'(no INTERNET, no backup or transfer, WebView metrics and Safe Browsing off)'
|
||||
);
|
||||
}
|
||||
|
||||
function newestApk(dir: string): string | undefined {
|
||||
if (!existsSync(dir)) return undefined;
|
||||
let best: { path: string; at: number } | undefined;
|
||||
const walk = (d: string): void => {
|
||||
for (const name of readdirSync(d)) {
|
||||
const path = join(d, name);
|
||||
const stat = statSync(path);
|
||||
if (stat.isDirectory()) walk(path);
|
||||
else if (name.endsWith('.apk') && (!best || stat.mtimeMs > best.at)) best = { path, at: stat.mtimeMs };
|
||||
}
|
||||
};
|
||||
walk(dir);
|
||||
return best?.path;
|
||||
}
|
||||
|
||||
function aapt2(): string {
|
||||
const sdk = process.env['ANDROID_HOME'] ?? process.env['ANDROID_SDK_ROOT'];
|
||||
if (!sdk) fail(['ANDROID_HOME is not set']);
|
||||
const tools = join(sdk, 'build-tools');
|
||||
const versions = readdirSync(tools).sort((a, b) => b.localeCompare(a, undefined, { numeric: true }));
|
||||
const exe = process.platform === 'win32' ? 'aapt2.exe' : 'aapt2';
|
||||
for (const v of versions) if (existsSync(join(tools, v, exe))) return join(tools, v, exe);
|
||||
return fail([`no aapt2 under ${tools}`]);
|
||||
}
|
||||
|
||||
function verify(apk: string | undefined): void {
|
||||
const file = apk ?? newestApk(OUTPUTS);
|
||||
if (file === undefined || !existsSync(file)) fail([`no APK to verify under ${OUTPUTS}`]);
|
||||
const tool = aapt2();
|
||||
const run = (...args: string[]): string => {
|
||||
const r = spawnSync(tool, args, { encoding: 'utf8' });
|
||||
if (r.status !== 0) fail([`aapt2 ${args.join(' ')} failed: ${r.stderr}`]);
|
||||
return r.stdout;
|
||||
};
|
||||
const left = apkProblems(run('dump', 'permissions', file), run('dump', 'xmltree', '--file', 'AndroidManifest.xml', file));
|
||||
if (left.length > 0) fail(left);
|
||||
console.log(`android: ${file} verified (no permission asked, no backup, WebView metrics and Safe Browsing off)`);
|
||||
}
|
||||
|
||||
const [command, arg] = process.argv.slice(2);
|
||||
try {
|
||||
if (command === 'prepare') {
|
||||
if (!existsSync(MANIFEST)) tauri('android', 'init', '--ci', '--skip-targets-install');
|
||||
await import('./icons.js');
|
||||
apply();
|
||||
} else if (command === 'apply') apply();
|
||||
else if (command === 'check') {
|
||||
const left = problems();
|
||||
if (left.length > 0) fail(left);
|
||||
console.log('android: privacy in place');
|
||||
} else if (command === 'verify') verify(arg);
|
||||
else fail(['usage: android.ts prepare|apply|check|verify [apk]']);
|
||||
} catch (error) {
|
||||
fail([(error as Error).message]);
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* The app's icons, made from the PWA's icon (`apps/rosea/public/icon.svg`) before every build
|
||||
* (tauri-platforms.md D8). They are build output, never committed: the only images in git are
|
||||
* the source SVG and optimised art under art/final/ (CLAUDE.md §5.2). The icon is still a
|
||||
* placeholder; the real one comes through the art pipeline (GAP_ANALYSIS G0.21).
|
||||
*
|
||||
* tsx scripts/icons.ts makes them when missing or older than the SVG, and copies the
|
||||
* Android launcher icons into gen/android when it exists
|
||||
*
|
||||
* The copy is unconditional on purpose: `tauri android init` writes Tauri's own logo into
|
||||
* gen/android, newer than any icon made before it, so a date check kept Tauri's logo in the first
|
||||
* APK (review finding). `scripts/android.ts check` compares the bytes.
|
||||
*/
|
||||
import { cpSync, existsSync, statSync } from 'node:fs';
|
||||
import { join } from 'node:path';
|
||||
import { PACKAGE, SRC_TAURI, tauri } from './tauri.js';
|
||||
|
||||
const SOURCE = join(PACKAGE, '..', 'rosea', 'public', 'icon.svg');
|
||||
const MADE = join(SRC_TAURI, 'icons');
|
||||
export const ANDROID_ICONS = join(MADE, 'android');
|
||||
export const ANDROID_RES = join(SRC_TAURI, 'gen', 'android', 'app', 'src', 'main', 'res');
|
||||
|
||||
const stale = (file: string): boolean => !existsSync(file) || statSync(file).mtimeMs < statSync(SOURCE).mtimeMs;
|
||||
|
||||
if (stale(join(MADE, 'icon.ico')) || stale(join(ANDROID_ICONS, 'mipmap-mdpi', 'ic_launcher.png'))) {
|
||||
tauri('icon', SOURCE);
|
||||
console.log('icons: made from apps/rosea/public/icon.svg');
|
||||
} else {
|
||||
console.log('icons: up to date');
|
||||
}
|
||||
if (existsSync(ANDROID_RES)) {
|
||||
cpSync(ANDROID_ICONS, ANDROID_RES, { recursive: true });
|
||||
console.log('icons: Android launcher icons copied into gen/android');
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* The iOS app. Tauri can build it only on macOS with Xcode, and putting it on a phone needs an
|
||||
* Apple developer account (free for one's own device; paid for TestFlight and the App Store).
|
||||
* Elsewhere this refuses with that reason instead of failing somewhere deep in the CLI
|
||||
* (CLAUDE.md §8, *iOS cannot be built on Windows*; tauri-platforms.md G-T1).
|
||||
*
|
||||
* tsx scripts/ios.ts on macOS: `tauri ios init` once, icons, then `tauri ios build --debug`
|
||||
*/
|
||||
import { existsSync } from 'node:fs';
|
||||
import { join } from 'node:path';
|
||||
import { SRC_TAURI, tauri } from './tauri.js';
|
||||
|
||||
if (process.platform !== 'darwin') {
|
||||
console.error(
|
||||
'ios: the iOS app can only be built on macOS with Xcode (and an Apple developer account to run it on a phone).\n' +
|
||||
`ios: this machine is ${process.platform}. Nothing was built. See .agents/features/tauri-platforms.md, G-T1.`
|
||||
);
|
||||
process.exit(1);
|
||||
}
|
||||
if (!existsSync(join(SRC_TAURI, 'gen', 'apple'))) tauri('ios', 'init', '--ci');
|
||||
await import('./icons.js');
|
||||
tauri('ios', 'build', '--debug', ...process.argv.slice(2));
|
||||
@@ -0,0 +1,19 @@
|
||||
/** Runs the Tauri CLI of this package, in this package's folder, and stops the script if it fails. */
|
||||
import { spawnSync } from 'node:child_process';
|
||||
import { dirname, join } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
export const PACKAGE = join(dirname(fileURLToPath(import.meta.url)), '..');
|
||||
export const SRC_TAURI = join(PACKAGE, 'src-tauri');
|
||||
|
||||
export function tauri(...args: string[]): void {
|
||||
const run = spawnSync('pnpm', ['exec', 'tauri', ...args], {
|
||||
cwd: PACKAGE,
|
||||
stdio: 'inherit',
|
||||
shell: process.platform === 'win32'
|
||||
});
|
||||
if (run.status !== 0) {
|
||||
console.error(`tauri ${args.join(' ')} failed (exit ${String(run.status ?? run.signal)})`);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
Generated
+4521
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,27 @@
|
||||
[package]
|
||||
name = "rosea-shell"
|
||||
version = "0.1.0"
|
||||
description = "The Tauri 2 shell of Rosea Domi: a window around the built game, and nothing else."
|
||||
edition = "2024"
|
||||
publish = false
|
||||
|
||||
[lib]
|
||||
# The `_lib` suffix avoids a clash between the lib and the bin on Windows (cargo#8519).
|
||||
name = "rosea_shell_lib"
|
||||
crate-type = ["staticlib", "cdylib", "rlib"]
|
||||
|
||||
[build-dependencies]
|
||||
tauri-build = { version = "2.7.5", features = [] }
|
||||
|
||||
# No Tauri plugin and no other crate: the shell opens a window on the built game and does
|
||||
# nothing else. Each plugin that arrives later (notifications, Phase 6) is reviewed for
|
||||
# network access first (.agents/features/tauri-platforms.md D5).
|
||||
[dependencies]
|
||||
tauri = { version = "2.12.6", features = [] }
|
||||
|
||||
[profile.release]
|
||||
codegen-units = 1
|
||||
lto = true
|
||||
opt-level = "s"
|
||||
panic = "abort"
|
||||
strip = true
|
||||
@@ -0,0 +1,3 @@
|
||||
fn main() {
|
||||
tauri_build::build()
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
//! The Tauri 2 shell of Rosea Domi (CLAUDE.md §2, *Four versions*).
|
||||
//!
|
||||
//! A window on the built game (`apps/rosea/dist-tauri/`) and nothing else: no command, no
|
||||
//! plugin, no file of its own. The game keeps everything in the webview's IndexedDB, exactly
|
||||
//! as in the PWA. `capabilities/` is absent on purpose, so the page is granted no IPC at all.
|
||||
|
||||
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
||||
pub fn run() {
|
||||
tauri::Builder::default()
|
||||
.run(tauri::generate_context!())
|
||||
// Nothing to recover from here: without a window there is no garden to show.
|
||||
.expect("Rosea Domi could not open its window");
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// No console window behind the garden in a release build on Windows.
|
||||
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
||||
|
||||
fn main() {
|
||||
rosea_shell_lib::run()
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"$schema": "https://schema.tauri.app/config/2",
|
||||
"build": {
|
||||
"beforeBuildCommand": "pnpm --filter @rosea/tauri android:privacy && pnpm --filter @rosea/app build:shell"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"$schema": "https://schema.tauri.app/config/2",
|
||||
"productName": "Rosea Domi",
|
||||
"version": "../../rosea/package.json",
|
||||
"identifier": "cz.mareknovak.domi.rosea",
|
||||
"build": {
|
||||
"beforeDevCommand": "pnpm --filter @rosea/app dev:shell",
|
||||
"devUrl": "http://127.0.0.1:5173",
|
||||
"beforeBuildCommand": "pnpm --filter @rosea/app build:shell",
|
||||
"frontendDist": "../../rosea/dist-tauri"
|
||||
},
|
||||
"app": {
|
||||
"windows": [
|
||||
{
|
||||
"label": "main",
|
||||
"title": "Rosea Domi",
|
||||
"width": 480,
|
||||
"height": 800,
|
||||
"minWidth": 320,
|
||||
"minHeight": 480,
|
||||
"useHttpsScheme": true,
|
||||
"additionalBrowserArgs": "--disable-features=msWebOOUI,msPdfOOUI,msSmartScreenProtection,DnsOverHttpsUpgrade,DohProviderGoogle,DohProviderGoogleDns,DohProviderCloudflare,msExperimentationAndConfigurationService,OptimizationHints,AutofillServerCommunication,MediaRouter,Translate --disable-background-networking --disable-component-update --disable-domain-reliability --disable-sync --no-pings --disable-client-side-phishing-detection --dns-prefetch-disable"
|
||||
}
|
||||
],
|
||||
"security": {
|
||||
"csp": "default-src 'self'; script-src 'self'; style-src 'self'; img-src 'self' data:; font-src 'self'; connect-src 'self'; manifest-src 'self'; worker-src 'self'; object-src 'none'; base-uri 'self'; form-action 'none'"
|
||||
}
|
||||
},
|
||||
"bundle": {
|
||||
"active": true,
|
||||
"icon": ["icons/32x32.png", "icons/128x128.png", "icons/128x128@2x.png", "icons/icon.icns", "icons/icon.ico"],
|
||||
"category": "Game",
|
||||
"shortDescription": "A rose to tend, a fox to befriend, and the time we give to people.",
|
||||
"windows": { "nsis": { "installMode": "currentUser" } }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "$schema": "https://schema.tauri.app/config/2", "bundle": { "targets": ["deb", "appimage"] } }
|
||||
@@ -0,0 +1 @@
|
||||
{ "$schema": "https://schema.tauri.app/config/2", "bundle": { "targets": ["app", "dmg"] } }
|
||||
@@ -0,0 +1 @@
|
||||
{ "$schema": "https://schema.tauri.app/config/2", "bundle": { "targets": ["nsis"] } }
|
||||
@@ -0,0 +1,180 @@
|
||||
/**
|
||||
* The Android app's privacy, applied to Tauri's generated project (tauri-platforms.md D6).
|
||||
*
|
||||
* `src-tauri/gen/android` is written by `tauri android init` and never committed, so every
|
||||
* clone starts from Tauri's stock manifest, which asks for `INTERNET` and lets Android copy the
|
||||
* app's data to the player's cloud backup. What must hold is carried here and applied before
|
||||
* every Android build; the build fails if anything is missing. The approach and the two rule
|
||||
* files follow Amicitia's (its `android-privacy.md`, measured there on 2026-11-08):
|
||||
*
|
||||
* - **no `INTERNET`**: Rosea has no network feature yet, so the kernel refuses the app any
|
||||
* socket, the webview's own traffic included. It comes back with the first feature that
|
||||
* needs the network (Phase 3), and that feature's doc measures the webview first;
|
||||
* - **no backup and no device transfer**: the care log, the keys and the chosen town stay on
|
||||
* this device; *Keep her safe* is how a rose moves;
|
||||
* - the WebView's **metrics** and **Safe Browsing** lookups off, for the day `INTERNET` returns.
|
||||
*
|
||||
* Pure functions on strings; the files are read and written by `scripts/android.ts`.
|
||||
*/
|
||||
|
||||
export const BACKUP_RULES = 'rosea_backup_rules';
|
||||
export const EXTRACTION_RULES = 'rosea_data_extraction_rules';
|
||||
export const RULE_FILES = [`${BACKUP_RULES}.xml`, `${EXTRACTION_RULES}.xml`] as const;
|
||||
|
||||
/** Attributes `<application>` must carry. */
|
||||
export const APPLICATION_ATTRS: Readonly<Record<string, string>> = {
|
||||
'android:allowBackup': 'false',
|
||||
'android:fullBackupContent': `@xml/${BACKUP_RULES}`,
|
||||
'android:dataExtractionRules': `@xml/${EXTRACTION_RULES}`
|
||||
};
|
||||
|
||||
/** WebView switches read from the manifest (developer.android.com, "Manage WebView objects"). */
|
||||
export const META_DATA: Readonly<Record<string, string>> = {
|
||||
'android.webkit.WebView.EnableSafeBrowsing': 'false',
|
||||
'android.webkit.WebView.MetricsOptOut': 'true'
|
||||
};
|
||||
|
||||
const BEGIN = '<!-- rosea-privacy: begin (apps/rosea-tauri/src/android-privacy.ts) -->';
|
||||
const END = '<!-- rosea-privacy: end -->';
|
||||
const INTERNET_LINE = /^[ \t]*<uses-permission\s+android:name="android\.permission\.INTERNET"\s*\/>[ \t]*\n/gm;
|
||||
const INTERNET_ANY = /android\.permission\.INTERNET/;
|
||||
|
||||
const escape = (s: string): string => s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
||||
|
||||
/** The one `<application …>` opening tag, or an error naming what is wrong. */
|
||||
function applicationTag(xml: string): RegExpMatchArray & { index: number } {
|
||||
const tags = [...xml.matchAll(/<application\b[^>]*>/g)];
|
||||
if (tags.length !== 1) throw new Error(`expected one <application> tag, found ${tags.length}`);
|
||||
const tag = tags[0]!;
|
||||
if (tag[0].endsWith('/>')) throw new Error('<application/> is empty; expected a template with children');
|
||||
return tag as RegExpMatchArray & { index: number };
|
||||
}
|
||||
|
||||
function setAttribute(tag: string, name: string, value: string): string {
|
||||
const re = new RegExp(`(\\s${escape(name)}=")[^"]*(")`);
|
||||
if (re.test(tag)) return tag.replace(re, `$1${value}$2`);
|
||||
const indent = /\n([ \t]+)android:/.exec(tag)?.[1] ?? ' ';
|
||||
return tag.replace(/^<application\b/, `<application\n${indent}${name}="${value}"`);
|
||||
}
|
||||
|
||||
/** The manifest with the privacy settings in place. Throws, changing nothing, on an unexpected shape. */
|
||||
export function patchManifest(xml: string): string {
|
||||
const eol = xml.includes('\r\n') ? '\r\n' : '\n';
|
||||
let out = xml.replaceAll('\r\n', '\n');
|
||||
|
||||
// 1. <application> attributes.
|
||||
const tag = applicationTag(out);
|
||||
let patched = tag[0];
|
||||
for (const [name, value] of Object.entries(APPLICATION_ATTRS)) patched = setAttribute(patched, name, value);
|
||||
out = out.slice(0, tag.index) + patched + out.slice(tag.index + tag[0].length);
|
||||
|
||||
// 2. The meta-data block, replaced whole on every run, so a second run changes nothing.
|
||||
const from = out.indexOf(BEGIN);
|
||||
if (from >= 0) {
|
||||
const to = out.indexOf(END, from);
|
||||
if (to < 0) throw new Error('found the begin marker of the privacy block but not its end');
|
||||
const lineStart = out.lastIndexOf('\n', from) + 1;
|
||||
const lineEnd = out.indexOf('\n', to);
|
||||
out = out.slice(0, lineStart) + out.slice(lineEnd + 1);
|
||||
}
|
||||
const closes = [...out.matchAll(/^([ \t]*)<\/application>/gm)];
|
||||
if (closes.length !== 1) throw new Error(`expected one </application>, found ${closes.length}`);
|
||||
const close = closes[0]!;
|
||||
const indent = `${close[1] ?? ''} `;
|
||||
const block = [
|
||||
BEGIN,
|
||||
...Object.entries(META_DATA).map(([n, v]) => `<meta-data android:name="${n}" android:value="${v}" />`),
|
||||
END
|
||||
]
|
||||
.map((line) => `${indent}${line}\n`)
|
||||
.join('');
|
||||
out = out.slice(0, close.index) + block + out.slice(close.index);
|
||||
|
||||
// 3. INTERNET removed. Any other form of asking for it is refused rather than missed.
|
||||
out = out.replace(INTERNET_LINE, '');
|
||||
if (INTERNET_ANY.test(out)) throw new Error('INTERNET is requested in a form this patch does not remove');
|
||||
|
||||
return out.replaceAll('\n', eol);
|
||||
}
|
||||
|
||||
/** What the manifest lacks, by name; empty when it is in order. */
|
||||
export function manifestProblems(xml: string): string[] {
|
||||
const problems: string[] = [];
|
||||
let tag: string;
|
||||
try {
|
||||
tag = applicationTag(xml)[0];
|
||||
} catch (error) {
|
||||
return [(error as Error).message];
|
||||
}
|
||||
for (const [name, value] of Object.entries(APPLICATION_ATTRS)) {
|
||||
if (!new RegExp(`\\s${escape(name)}="${escape(value)}"`).test(tag)) problems.push(`<application> lacks ${name}="${value}"`);
|
||||
}
|
||||
for (const [name, value] of Object.entries(META_DATA)) {
|
||||
if (!new RegExp(`<meta-data\\s+android:name="${escape(name)}"\\s+android:value="${escape(value)}"\\s*/>`).test(xml)) {
|
||||
problems.push(`no meta-data ${name}=${value}`);
|
||||
}
|
||||
}
|
||||
if (INTERNET_ANY.test(xml)) problems.push('android.permission.INTERNET is requested');
|
||||
return problems;
|
||||
}
|
||||
|
||||
/** Every storage domain Android knows; each must be excluded. */
|
||||
export const DOMAINS = [
|
||||
'root', 'file', 'database', 'sharedpref', 'external',
|
||||
'device_root', 'device_file', 'device_database', 'device_sharedpref'
|
||||
] as const;
|
||||
|
||||
/** Where each rules file must exclude everything: '' is the file's root element. */
|
||||
export const RULE_SECTIONS: Readonly<Record<(typeof RULE_FILES)[number], readonly string[]>> = {
|
||||
[`${BACKUP_RULES}.xml`]: [''],
|
||||
[`${EXTRACTION_RULES}.xml`]: ['cloud-backup', 'device-transfer']
|
||||
} as Record<(typeof RULE_FILES)[number], readonly string[]>;
|
||||
|
||||
/** A rules file must exclude every domain in every section, and include nothing. */
|
||||
export function ruleProblems(xml: string, sections: readonly string[]): string[] {
|
||||
const problems: string[] = [];
|
||||
if (/<include\b/.test(xml)) problems.push('includes something');
|
||||
for (const section of sections) {
|
||||
const body = section ? new RegExp(`<${section}\\b[^>]*>([\\s\\S]*?)</${section}>`).exec(xml)?.[1] : xml;
|
||||
if (body === undefined) {
|
||||
problems.push(`no <${section}>`);
|
||||
continue;
|
||||
}
|
||||
for (const domain of DOMAINS) {
|
||||
if (!new RegExp(`<exclude\\s+domain="${domain}"\\s+path="\\."\\s*/>`).test(body)) {
|
||||
problems.push(`${section || 'root'}: ${domain} is not excluded`);
|
||||
}
|
||||
}
|
||||
}
|
||||
return problems;
|
||||
}
|
||||
|
||||
/**
|
||||
* What the BUILT APK says, from `aapt2 dump permissions` and `aapt2 dump xmltree` of its
|
||||
* manifest: the proof is the artefact, not the source (Amicitia lessons/technical.md).
|
||||
* The manifest merge can add permissions from libraries; only the APK can tell.
|
||||
*/
|
||||
export function apkProblems(permissions: string, manifestTree: string): string[] {
|
||||
const problems: string[] = [];
|
||||
const tree = manifestTree.replaceAll('\r\n', '\n');
|
||||
const pkg = /^package: (\S+)$/m.exec(permissions.replaceAll('\r\n', '\n'))?.[1];
|
||||
for (const m of permissions.matchAll(/uses-permission: name='([^']+)'/g)) {
|
||||
const name = m[1]!;
|
||||
// androidx's receiver guard: a signature permission the app declares for itself, granting nothing.
|
||||
if (pkg !== undefined && name === `${pkg}.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION`) continue;
|
||||
// Any other is a review question, not a pass: Rosea asks for no permission yet.
|
||||
problems.push(`the APK asks for ${name}`);
|
||||
}
|
||||
if (!/:allowBackup\(0x[0-9a-f]+\)=false$/m.test(tree)) problems.push('the APK does not set allowBackup=false');
|
||||
for (const [name, value] of Object.entries(META_DATA)) {
|
||||
// aapt2 prints a meta-data element's name attribute, then its value attribute on the next line:
|
||||
// A: http://schemas.android.com/apk/res/android:name(0x01010003)="<name>" (Raw: "<name>")
|
||||
// A: http://schemas.android.com/apk/res/android:value(0x01010024)=true
|
||||
const found = new RegExp(
|
||||
`:name\\(0x[0-9a-f]+\\)="${escape(name)}"[^\\n]*\\n\\s*A: [^\\n]*:value\\(0x[0-9a-f]+\\)=(\\S+)`
|
||||
).exec(tree);
|
||||
if (!found) problems.push(`the APK has no meta-data ${name}`);
|
||||
else if (found[1] !== value && found[1] !== `"${value}"`) problems.push(`the APK's meta-data ${name} is ${found[1]}, not ${value}`);
|
||||
}
|
||||
return problems;
|
||||
}
|
||||
@@ -0,0 +1,180 @@
|
||||
/**
|
||||
* The Android privacy patch (tauri-platforms.md D6), on Tauri 2.12.5's stock manifest exactly as
|
||||
* `tauri android init` wrote it (fixtures/AndroidManifest.stock.xml), and on the committed rule files.
|
||||
*/
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { dirname, join } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import {
|
||||
apkProblems,
|
||||
APPLICATION_ATTRS,
|
||||
DOMAINS,
|
||||
manifestProblems,
|
||||
META_DATA,
|
||||
patchManifest,
|
||||
RULE_FILES,
|
||||
RULE_SECTIONS,
|
||||
ruleProblems
|
||||
} from '../src/android-privacy.js';
|
||||
|
||||
const HERE = dirname(fileURLToPath(import.meta.url));
|
||||
const STOCK = readFileSync(join(HERE, 'fixtures', 'AndroidManifest.stock.xml'), 'utf8').replaceAll('\r\n', '\n');
|
||||
const rules = (f: string): string => readFileSync(join(HERE, '..', 'android', 'res', 'xml', f), 'utf8');
|
||||
|
||||
describe('patchManifest', () => {
|
||||
const patched = patchManifest(STOCK);
|
||||
|
||||
it("removes Tauri's INTERNET permission: the kernel then refuses the app any socket", () => {
|
||||
expect(STOCK).toContain('android.permission.INTERNET');
|
||||
expect(patched).not.toContain('android.permission.INTERNET');
|
||||
});
|
||||
|
||||
it('turns backup and device transfer off on <application>', () => {
|
||||
const tag = /<application\b[^>]*>/.exec(patched)?.[0] ?? '';
|
||||
for (const [name, value] of Object.entries(APPLICATION_ATTRS)) expect(tag).toContain(`${name}="${value}"`);
|
||||
// What Tauri set is kept.
|
||||
expect(tag).toContain('android:icon="@mipmap/ic_launcher"');
|
||||
expect(tag).toContain('android:usesCleartextTraffic="${usesCleartextTraffic}"');
|
||||
});
|
||||
|
||||
it("switches the WebView's metrics and Safe Browsing off, inside <application>", () => {
|
||||
const inside = /<application\b[\s\S]*<\/application>/.exec(patched)?.[0] ?? '';
|
||||
for (const [name, value] of Object.entries(META_DATA)) {
|
||||
expect(inside).toContain(`<meta-data android:name="${name}" android:value="${value}" />`);
|
||||
}
|
||||
});
|
||||
|
||||
it('leaves the rest of the manifest as it was', () => {
|
||||
for (const keep of ['android:name=".MainActivity"', 'android.intent.category.LAUNCHER', 'androidx.core.content.FileProvider']) {
|
||||
expect(patched).toContain(keep);
|
||||
}
|
||||
});
|
||||
|
||||
it('changes nothing on a second run', () => {
|
||||
expect(patchManifest(patched)).toBe(patched);
|
||||
});
|
||||
|
||||
it('keeps Windows line endings when the file has them', () => {
|
||||
const crlf = patchManifest(STOCK.replaceAll('\n', '\r\n'));
|
||||
expect(crlf).toBe(patched.replaceAll('\n', '\r\n'));
|
||||
});
|
||||
|
||||
it('overwrites an allowBackup="true" rather than adding a second one', () => {
|
||||
const on = STOCK.replace('<application', '<application android:allowBackup="true"');
|
||||
const out = patchManifest(on);
|
||||
expect(out).toContain('android:allowBackup="false"');
|
||||
expect(out).not.toContain('android:allowBackup="true"');
|
||||
expect(out.match(/android:allowBackup=/g)).toHaveLength(1);
|
||||
});
|
||||
|
||||
it('refuses a manifest whose shape it does not know, rather than guessing', () => {
|
||||
expect(() => patchManifest(STOCK.replace('</application>', '</application><application></application>'))).toThrow(/application/);
|
||||
expect(() => patchManifest(STOCK.replace(/<application[\s\S]*<\/application>/, '<application />'))).toThrow();
|
||||
// INTERNET asked for in a form the line pattern does not match.
|
||||
const odd = STOCK.replace(
|
||||
'<uses-permission android:name="android.permission.INTERNET" />',
|
||||
'<uses-permission android:name="android.permission.INTERNET" android:maxSdkVersion="99" />'
|
||||
);
|
||||
expect(() => patchManifest(odd)).toThrow(/INTERNET/);
|
||||
});
|
||||
|
||||
it('removes INTERNET written over two lines too', () => {
|
||||
const split = STOCK.replace(
|
||||
'<uses-permission android:name="android.permission.INTERNET" />',
|
||||
'<uses-permission\n android:name="android.permission.INTERNET" />'
|
||||
);
|
||||
expect(patchManifest(split)).not.toContain('INTERNET');
|
||||
});
|
||||
});
|
||||
|
||||
describe('manifestProblems', () => {
|
||||
it("names everything missing from Tauri's stock manifest", () => {
|
||||
const problems = manifestProblems(STOCK);
|
||||
expect(problems).toContain('android.permission.INTERNET is requested');
|
||||
for (const name of Object.keys(APPLICATION_ATTRS)) expect(problems.join('\n')).toContain(name);
|
||||
for (const name of Object.keys(META_DATA)) expect(problems.join('\n')).toContain(name);
|
||||
expect(problems).toHaveLength(1 + Object.keys(APPLICATION_ATTRS).length + Object.keys(META_DATA).length);
|
||||
});
|
||||
|
||||
it('finds nothing missing once patched', () => {
|
||||
expect(manifestProblems(patchManifest(STOCK))).toEqual([]);
|
||||
});
|
||||
|
||||
it('notices a single switch turned back on', () => {
|
||||
const patched = patchManifest(STOCK);
|
||||
expect(manifestProblems(patched.replace('android:allowBackup="false"', 'android:allowBackup="true"'))).toEqual([
|
||||
'<application> lacks android:allowBackup="false"'
|
||||
]);
|
||||
expect(manifestProblems(patched.replace('android:value="true"', 'android:value="false"'))).toEqual([
|
||||
'no meta-data android.webkit.WebView.MetricsOptOut=true'
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('the committed rule files', () => {
|
||||
for (const f of RULE_FILES) {
|
||||
it(`${f} excludes every domain, in every section, and includes nothing`, () => {
|
||||
expect(ruleProblems(rules(f), RULE_SECTIONS[f])).toEqual([]);
|
||||
});
|
||||
}
|
||||
|
||||
it('a file that forgets one domain is caught, by name', () => {
|
||||
const f = 'rosea_data_extraction_rules.xml' as const;
|
||||
const text = rules(f);
|
||||
const firstDb = text.indexOf('<exclude domain="database" path="." />');
|
||||
const broken = text.slice(0, firstDb) + text.slice(firstDb + '<exclude domain="database" path="." />'.length);
|
||||
expect(ruleProblems(broken, RULE_SECTIONS[f])).toEqual(['cloud-backup: database is not excluded']);
|
||||
});
|
||||
|
||||
it('a file that includes something is caught', () => {
|
||||
const f = 'rosea_backup_rules.xml' as const;
|
||||
const broken = rules(f).replace('</full-backup-content>', '<include domain="file" path="." />\n</full-backup-content>');
|
||||
expect(ruleProblems(broken, RULE_SECTIONS[f])).toEqual(['includes something']);
|
||||
});
|
||||
|
||||
it('knows all nine storage domains', () => {
|
||||
expect(DOMAINS).toHaveLength(9);
|
||||
});
|
||||
});
|
||||
|
||||
describe('apkProblems, on aapt2 output of the APK built 2026-11-17 (Tauri 2.12.5, AGP 9.3.1)', () => {
|
||||
const permissions = readFileSync(join(HERE, 'fixtures', 'apk-permissions.txt'), 'utf8');
|
||||
const tree = readFileSync(join(HERE, 'fixtures', 'apk-manifest.xmltree.txt'), 'utf8');
|
||||
|
||||
it('passes the patched APK: no permission asked but androidx own receiver guard', () => {
|
||||
expect(apkProblems(permissions, tree)).toEqual([]);
|
||||
});
|
||||
|
||||
it('names INTERNET, or any permission a library merges in', () => {
|
||||
const more = `${permissions.trimEnd()}\nuses-permission: name='android.permission.INTERNET'\nuses-permission: name='android.permission.ACCESS_NETWORK_STATE'\n`;
|
||||
expect(apkProblems(more, tree)).toEqual([
|
||||
'the APK asks for android.permission.INTERNET',
|
||||
'the APK asks for android.permission.ACCESS_NETWORK_STATE'
|
||||
]);
|
||||
});
|
||||
|
||||
it("does not let another app's receiver guard through", () => {
|
||||
const other = `${permissions.trimEnd()}\nuses-permission: name='com.example.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION'\n`;
|
||||
expect(apkProblems(other, tree)).toEqual(['the APK asks for com.example.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION']);
|
||||
});
|
||||
|
||||
it('names backup left on', () => {
|
||||
expect(apkProblems(permissions, tree.replace(/allowBackup\((0x[0-9a-f]+)\)=false/, 'allowBackup($1)=true'))).toEqual([
|
||||
'the APK does not set allowBackup=false'
|
||||
]);
|
||||
});
|
||||
|
||||
it("reads each WebView switch's own value, not its neighbour's", () => {
|
||||
const flipped = tree.replace(
|
||||
/("android\.webkit\.WebView\.EnableSafeBrowsing"[^\n]*\r?\n\s*A: [^\n]*:value\(0x[0-9a-f]+\))=false/,
|
||||
'$1=true'
|
||||
);
|
||||
expect(flipped).not.toBe(tree);
|
||||
expect(apkProblems(permissions, flipped)).toEqual([
|
||||
"the APK's meta-data android.webkit.WebView.EnableSafeBrowsing is true, not false"
|
||||
]);
|
||||
const gone = tree.replace('"android.webkit.WebView.MetricsOptOut"', '"android.webkit.WebView.Something"');
|
||||
expect(apkProblems(permissions, gone)).toEqual(['the APK has no meta-data android.webkit.WebView.MetricsOptOut']);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,126 @@
|
||||
/**
|
||||
* The shell's configuration holds what tauri-platforms.md decided (D3–D7, D10, D11). Each of
|
||||
* these is a value that fails silently at runtime, or worse, only after a release: a changed
|
||||
* identifier or origin leaves the player's rose behind in the old app.
|
||||
*/
|
||||
import { existsSync, readFileSync } from 'node:fs';
|
||||
import { dirname, join, resolve } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { CSP } from '../../rosea/csp.js';
|
||||
import { PRODUCT_NAME } from '../../../packages/schema/src/constants.js';
|
||||
|
||||
const SRC_TAURI = join(dirname(fileURLToPath(import.meta.url)), '..', 'src-tauri');
|
||||
/** The parts of a Tauri config these tests read. */
|
||||
interface TauriConf {
|
||||
productName?: string;
|
||||
identifier?: string;
|
||||
version?: string;
|
||||
build: { frontendDist: string; beforeBuildCommand: string; beforeDevCommand: string; devUrl: string };
|
||||
app: { windows: Record<string, unknown>[]; security: Record<string, unknown> };
|
||||
bundle: { targets?: string[] };
|
||||
plugins?: unknown;
|
||||
}
|
||||
const json = (name: string): TauriConf => JSON.parse(readFileSync(join(SRC_TAURI, name), 'utf8')) as TauriConf;
|
||||
const conf = json('tauri.conf.json');
|
||||
const window = conf.app.windows[0] ?? {};
|
||||
|
||||
describe('tauri.conf.json', () => {
|
||||
it('names the app with the product name, in the bundle and the window title (D3)', () => {
|
||||
expect(conf.productName).toBe(PRODUCT_NAME);
|
||||
expect(window['title']).toBe(PRODUCT_NAME);
|
||||
});
|
||||
|
||||
it('keeps the identifier it was released with: a new one is a different app (D3)', () => {
|
||||
expect(conf.identifier).toBe('cz.mareknovak.domi.rosea');
|
||||
});
|
||||
|
||||
it("reads its version from the game's package.json (D3)", () => {
|
||||
expect(conf.version).toBe('../../rosea/package.json');
|
||||
const pkg = JSON.parse(readFileSync(resolve(SRC_TAURI, String(conf.version)), 'utf8')) as Record<string, string>;
|
||||
expect(pkg['name']).toBe('@rosea/app');
|
||||
expect(pkg['version']).toMatch(/^\d+\.\d+\.\d+$/);
|
||||
});
|
||||
|
||||
it("delivers the PWA's content-security policy, the same string (D4)", () => {
|
||||
expect(conf.app.security['csp']).toBe(CSP);
|
||||
});
|
||||
|
||||
it("wraps the game's shell build and nothing else (D1, D2)", () => {
|
||||
expect(conf.build.frontendDist).toBe('../../rosea/dist-tauri');
|
||||
expect(resolve(SRC_TAURI, conf.build.frontendDist)).toBe(resolve(SRC_TAURI, '..', '..', 'rosea', 'dist-tauri'));
|
||||
expect(conf.build.beforeBuildCommand).toBe('pnpm --filter @rosea/app build:shell');
|
||||
expect(conf.build.beforeDevCommand).toBe('pnpm --filter @rosea/app dev:shell');
|
||||
});
|
||||
|
||||
it('runs its dev server on 127.0.0.1 only (CLAUDE.md §5.7)', () => {
|
||||
expect(new URL(conf.build.devUrl).hostname).toBe('127.0.0.1');
|
||||
const app = JSON.parse(readFileSync(join(SRC_TAURI, '..', '..', 'rosea', 'package.json'), 'utf8')) as { scripts: Record<string, string> };
|
||||
expect(app['scripts']['dev:shell']).toContain('--host 127.0.0.1');
|
||||
expect(app['scripts']['dev:shell']).toContain('--port 5173');
|
||||
expect(conf.build.devUrl).toBe('http://127.0.0.1:5173');
|
||||
});
|
||||
|
||||
it('keeps the https origin it was released with: IndexedDB lives per origin (D10)', () => {
|
||||
expect(window['useHttpsScheme']).toBe(true);
|
||||
});
|
||||
|
||||
it("switches WebView2's own traffic off (D7)", () => {
|
||||
const args = String(window['additionalBrowserArgs']);
|
||||
for (const flag of [
|
||||
'--disable-background-networking',
|
||||
'--disable-component-update',
|
||||
'--disable-domain-reliability',
|
||||
'--disable-sync',
|
||||
'--no-pings',
|
||||
'--disable-client-side-phishing-detection',
|
||||
'--dns-prefetch-disable'
|
||||
]) {
|
||||
expect(args.split(' ')).toContain(flag);
|
||||
}
|
||||
const disabled = /--disable-features=(\S+)/.exec(args)?.[1]?.split(',') ?? [];
|
||||
for (const feature of [
|
||||
// Tauri's own defaults, which a custom list must repeat.
|
||||
'msWebOOUI', 'msPdfOOUI', 'msSmartScreenProtection',
|
||||
'DnsOverHttpsUpgrade', 'msExperimentationAndConfigurationService', 'AutofillServerCommunication', 'OptimizationHints'
|
||||
]) {
|
||||
expect(disabled).toContain(feature);
|
||||
}
|
||||
});
|
||||
|
||||
it('builds only what each system can make (D11)', () => {
|
||||
expect(json('tauri.windows.conf.json').bundle.targets).toEqual(['nsis']);
|
||||
expect(json('tauri.macos.conf.json').bundle.targets).toEqual(['app', 'dmg']);
|
||||
expect(json('tauri.linux.conf.json').bundle.targets).toEqual(['deb', 'appimage']);
|
||||
expect(conf.bundle.targets).toBeUndefined();
|
||||
});
|
||||
|
||||
it('applies the Android privacy patch before the game is built for Android (D6)', () => {
|
||||
const before = json('tauri.android.conf.json').build.beforeBuildCommand;
|
||||
const patch = before.indexOf('pnpm --filter @rosea/tauri android:privacy');
|
||||
expect(patch).toBe(0);
|
||||
expect(before.indexOf('&& pnpm --filter @rosea/app build:shell')).toBeGreaterThan(patch);
|
||||
});
|
||||
});
|
||||
|
||||
describe('the Rust side (D5)', () => {
|
||||
it('depends on tauri alone: no plugin, no SDK', () => {
|
||||
const cargo = readFileSync(join(SRC_TAURI, 'Cargo.toml'), 'utf8');
|
||||
const deps = /\n\[dependencies\]\n([\s\S]*?)(?:\n\[|$)/.exec(cargo)?.[1] ?? '';
|
||||
const names = deps
|
||||
.split('\n')
|
||||
.map((l) => /^([A-Za-z0-9_-]+)\s*=/.exec(l)?.[1])
|
||||
.filter((n): n is string => n !== undefined);
|
||||
expect(names).toEqual(['tauri']);
|
||||
expect(cargo).not.toMatch(/\[target\.[^\]]*dependencies\]/);
|
||||
});
|
||||
|
||||
it('grants the page no IPC: there is no capabilities folder', () => {
|
||||
expect(existsSync(join(SRC_TAURI, 'capabilities'))).toBe(false);
|
||||
expect(conf.app.security['capabilities']).toBeUndefined();
|
||||
});
|
||||
|
||||
it('declares no plugin configuration', () => {
|
||||
expect(conf.plugins).toBeUndefined();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
|
||||
<!-- AndroidTV support -->
|
||||
<uses-feature android:name="android.software.leanback" android:required="false" />
|
||||
|
||||
<application
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/Theme.rosea_shell"
|
||||
android:usesCleartextTraffic="${usesCleartextTraffic}">
|
||||
<activity
|
||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode"
|
||||
android:launchMode="singleTask"
|
||||
android:label="@string/main_activity_title"
|
||||
android:name=".MainActivity"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
<!-- AndroidTV support -->
|
||||
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="${applicationId}.fileprovider"
|
||||
android:exported="false"
|
||||
android:grantUriPermissions="true">
|
||||
<meta-data
|
||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||
android:resource="@xml/file_paths" />
|
||||
</provider>
|
||||
</application>
|
||||
</manifest>
|
||||
@@ -0,0 +1,89 @@
|
||||
N: android=http://schemas.android.com/apk/res/android (line=2)
|
||||
E: manifest (line=2)
|
||||
A: http://schemas.android.com/apk/res/android:versionCode(0x0101021b)=1000
|
||||
A: http://schemas.android.com/apk/res/android:versionName(0x0101021c)="0.1.0" (Raw: "0.1.0")
|
||||
A: http://schemas.android.com/apk/res/android:compileSdkVersion(0x01010572)=37
|
||||
A: http://schemas.android.com/apk/res/android:compileSdkVersionCodename(0x01010573)="17" (Raw: "17")
|
||||
A: package="cz.mareknovak.domi.rosea" (Raw: "cz.mareknovak.domi.rosea")
|
||||
A: platformBuildVersionCode=37
|
||||
A: platformBuildVersionName=17
|
||||
E: uses-sdk (line=7)
|
||||
A: http://schemas.android.com/apk/res/android:minSdkVersion(0x0101020c)=24
|
||||
A: http://schemas.android.com/apk/res/android:targetSdkVersion(0x01010270)=37
|
||||
E: uses-feature (line=12)
|
||||
A: http://schemas.android.com/apk/res/android:name(0x01010003)="android.software.leanback" (Raw: "android.software.leanback")
|
||||
A: http://schemas.android.com/apk/res/android:required(0x0101028e)=false
|
||||
E: permission (line=16)
|
||||
A: http://schemas.android.com/apk/res/android:name(0x01010003)="cz.mareknovak.domi.rosea.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION" (Raw: "cz.mareknovak.domi.rosea.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION")
|
||||
A: http://schemas.android.com/apk/res/android:protectionLevel(0x01010009)=0x00000002
|
||||
E: uses-permission (line=20)
|
||||
A: http://schemas.android.com/apk/res/android:name(0x01010003)="cz.mareknovak.domi.rosea.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION" (Raw: "cz.mareknovak.domi.rosea.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION")
|
||||
E: application (line=22)
|
||||
A: http://schemas.android.com/apk/res/android:theme(0x01010000)=@0x7f100274
|
||||
A: http://schemas.android.com/apk/res/android:label(0x01010001)=@0x7f0f001c
|
||||
A: http://schemas.android.com/apk/res/android:icon(0x01010002)=@0x7f0d0000
|
||||
A: http://schemas.android.com/apk/res/android:debuggable(0x0101000f)=true
|
||||
A: http://schemas.android.com/apk/res/android:allowBackup(0x01010280)=false
|
||||
A: http://schemas.android.com/apk/res/android:extractNativeLibs(0x010104ea)=false
|
||||
A: http://schemas.android.com/apk/res/android:fullBackupContent(0x010104eb)=@0x7f120001
|
||||
A: http://schemas.android.com/apk/res/android:usesCleartextTraffic(0x010104ec)=true
|
||||
A: http://schemas.android.com/apk/res/android:appComponentFactory(0x0101057a)="androidx.core.app.CoreComponentFactory" (Raw: "androidx.core.app.CoreComponentFactory")
|
||||
A: http://schemas.android.com/apk/res/android:dataExtractionRules(0x0101063e)=@0x7f120002
|
||||
E: activity (line=33)
|
||||
A: http://schemas.android.com/apk/res/android:label(0x01010001)=@0x7f0f0047
|
||||
A: http://schemas.android.com/apk/res/android:name(0x01010003)="cz.mareknovak.domi.rosea.MainActivity" (Raw: "cz.mareknovak.domi.rosea.MainActivity")
|
||||
A: http://schemas.android.com/apk/res/android:exported(0x01010010)=true
|
||||
A: http://schemas.android.com/apk/res/android:launchMode(0x0101001d)=2
|
||||
A: http://schemas.android.com/apk/res/android:configChanges(0x0101001f)=0x00000fb4
|
||||
E: intent-filter (line=39)
|
||||
E: action (line=40)
|
||||
A: http://schemas.android.com/apk/res/android:name(0x01010003)="android.intent.action.MAIN" (Raw: "android.intent.action.MAIN")
|
||||
E: category (line=42)
|
||||
A: http://schemas.android.com/apk/res/android:name(0x01010003)="android.intent.category.LAUNCHER" (Raw: "android.intent.category.LAUNCHER")
|
||||
E: category (line=44)
|
||||
A: http://schemas.android.com/apk/res/android:name(0x01010003)="android.intent.category.LEANBACK_LAUNCHER" (Raw: "android.intent.category.LEANBACK_LAUNCHER")
|
||||
E: provider (line=48)
|
||||
A: http://schemas.android.com/apk/res/android:name(0x01010003)="androidx.core.content.FileProvider" (Raw: "androidx.core.content.FileProvider")
|
||||
A: http://schemas.android.com/apk/res/android:exported(0x01010010)=false
|
||||
A: http://schemas.android.com/apk/res/android:authorities(0x01010018)="cz.mareknovak.domi.rosea.fileprovider" (Raw: "cz.mareknovak.domi.rosea.fileprovider")
|
||||
A: http://schemas.android.com/apk/res/android:grantUriPermissions(0x0101001b)=true
|
||||
E: meta-data (line=53)
|
||||
A: http://schemas.android.com/apk/res/android:name(0x01010003)="android.support.FILE_PROVIDER_PATHS" (Raw: "android.support.FILE_PROVIDER_PATHS")
|
||||
A: http://schemas.android.com/apk/res/android:resource(0x01010025)=@0x7f120000
|
||||
E: meta-data (line=58)
|
||||
A: http://schemas.android.com/apk/res/android:name(0x01010003)="android.webkit.WebView.EnableSafeBrowsing" (Raw: "android.webkit.WebView.EnableSafeBrowsing")
|
||||
A: http://schemas.android.com/apk/res/android:value(0x01010024)=false
|
||||
E: meta-data (line=61)
|
||||
A: http://schemas.android.com/apk/res/android:name(0x01010003)="android.webkit.WebView.MetricsOptOut" (Raw: "android.webkit.WebView.MetricsOptOut")
|
||||
A: http://schemas.android.com/apk/res/android:value(0x01010024)=true
|
||||
E: provider (line=65)
|
||||
A: http://schemas.android.com/apk/res/android:name(0x01010003)="androidx.startup.InitializationProvider" (Raw: "androidx.startup.InitializationProvider")
|
||||
A: http://schemas.android.com/apk/res/android:exported(0x01010010)=false
|
||||
A: http://schemas.android.com/apk/res/android:authorities(0x01010018)="cz.mareknovak.domi.rosea.androidx-startup" (Raw: "cz.mareknovak.domi.rosea.androidx-startup")
|
||||
E: meta-data (line=69)
|
||||
A: http://schemas.android.com/apk/res/android:name(0x01010003)="androidx.emoji2.text.EmojiCompatInitializer" (Raw: "androidx.emoji2.text.EmojiCompatInitializer")
|
||||
A: http://schemas.android.com/apk/res/android:value(0x01010024)="androidx.startup" (Raw: "androidx.startup")
|
||||
E: meta-data (line=72)
|
||||
A: http://schemas.android.com/apk/res/android:name(0x01010003)="androidx.lifecycle.ProcessLifecycleInitializer" (Raw: "androidx.lifecycle.ProcessLifecycleInitializer")
|
||||
A: http://schemas.android.com/apk/res/android:value(0x01010024)="androidx.startup" (Raw: "androidx.startup")
|
||||
E: meta-data (line=75)
|
||||
A: http://schemas.android.com/apk/res/android:name(0x01010003)="androidx.profileinstaller.ProfileInstallerInitializer" (Raw: "androidx.profileinstaller.ProfileInstallerInitializer")
|
||||
A: http://schemas.android.com/apk/res/android:value(0x01010024)="androidx.startup" (Raw: "androidx.startup")
|
||||
E: receiver (line=80)
|
||||
A: http://schemas.android.com/apk/res/android:name(0x01010003)="androidx.profileinstaller.ProfileInstallReceiver" (Raw: "androidx.profileinstaller.ProfileInstallReceiver")
|
||||
A: http://schemas.android.com/apk/res/android:permission(0x01010006)="android.permission.DUMP" (Raw: "android.permission.DUMP")
|
||||
A: http://schemas.android.com/apk/res/android:enabled(0x0101000e)=true
|
||||
A: http://schemas.android.com/apk/res/android:exported(0x01010010)=true
|
||||
A: http://schemas.android.com/apk/res/android:directBootAware(0x01010505)=false
|
||||
E: intent-filter (line=86)
|
||||
E: action (line=87)
|
||||
A: http://schemas.android.com/apk/res/android:name(0x01010003)="androidx.profileinstaller.action.INSTALL_PROFILE" (Raw: "androidx.profileinstaller.action.INSTALL_PROFILE")
|
||||
E: intent-filter (line=89)
|
||||
E: action (line=90)
|
||||
A: http://schemas.android.com/apk/res/android:name(0x01010003)="androidx.profileinstaller.action.SKIP_FILE" (Raw: "androidx.profileinstaller.action.SKIP_FILE")
|
||||
E: intent-filter (line=92)
|
||||
E: action (line=93)
|
||||
A: http://schemas.android.com/apk/res/android:name(0x01010003)="androidx.profileinstaller.action.SAVE_PROFILE" (Raw: "androidx.profileinstaller.action.SAVE_PROFILE")
|
||||
E: intent-filter (line=95)
|
||||
E: action (line=96)
|
||||
A: http://schemas.android.com/apk/res/android:name(0x01010003)="androidx.profileinstaller.action.BENCHMARK_OPERATION" (Raw: "androidx.profileinstaller.action.BENCHMARK_OPERATION")
|
||||
@@ -0,0 +1,3 @@
|
||||
package: cz.mareknovak.domi.rosea
|
||||
permission: cz.mareknovak.domi.rosea.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION
|
||||
uses-permission: name='cz.mareknovak.domi.rosea.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION'
|
||||
@@ -0,0 +1,63 @@
|
||||
/**
|
||||
* The game's build for the shell (`vite build --mode tauri`, tauri-platforms.md D2), made into a
|
||||
* temporary folder and read: no service worker, no manifest, no <meta> policy, assets at the root,
|
||||
* and the shell constant replaced. The PWA's own build is checked by the e2e suites.
|
||||
*/
|
||||
import { spawnSync } from 'node:child_process';
|
||||
import { mkdtempSync, readdirSync, readFileSync, rmSync } from 'node:fs';
|
||||
import { tmpdir } from 'node:os';
|
||||
import { dirname, join } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { afterAll, beforeAll, describe, expect, it } from 'vitest';
|
||||
|
||||
const APP = join(dirname(fileURLToPath(import.meta.url)), '..', '..', 'rosea');
|
||||
let out = '';
|
||||
let html = '';
|
||||
let files: string[] = [];
|
||||
let scripts = '';
|
||||
|
||||
beforeAll(() => {
|
||||
out = mkdtempSync(join(tmpdir(), 'rosea-shell-build-'));
|
||||
const build = spawnSync('pnpm', ['exec', 'vite', 'build', '--mode', 'tauri', '--outDir', out, '--emptyOutDir', '--logLevel', 'error'], {
|
||||
cwd: APP,
|
||||
encoding: 'utf8',
|
||||
shell: process.platform === 'win32'
|
||||
});
|
||||
if (build.status !== 0) throw new Error(`vite build --mode tauri failed:\n${build.stdout}\n${build.stderr}`);
|
||||
files = readdirSync(out, { recursive: true, encoding: 'utf8' }).map((f) => f.replaceAll('\\', '/'));
|
||||
html = readFileSync(join(out, 'index.html'), 'utf8');
|
||||
scripts = files.filter((f) => f.endsWith('.js')).map((f) => readFileSync(join(out, f), 'utf8')).join('\n');
|
||||
}, 120_000);
|
||||
|
||||
afterAll(() => {
|
||||
if (out) rmSync(out, { recursive: true, force: true });
|
||||
});
|
||||
|
||||
describe('the game built for the shell', () => {
|
||||
it('has no service worker and no web manifest', () => {
|
||||
expect(files.filter((f) => /(^|\/)(sw|workbox-[^/]*|registerSW)\.js$/.test(f))).toEqual([]);
|
||||
expect(files.filter((f) => f.endsWith('.webmanifest'))).toEqual([]);
|
||||
expect(html).not.toContain('manifest');
|
||||
expect(scripts).not.toContain('navigator.serviceWorker.register');
|
||||
});
|
||||
|
||||
it('carries no <meta> content-security policy: Tauri delivers it (D4)', () => {
|
||||
expect(html).not.toContain('Content-Security-Policy');
|
||||
});
|
||||
|
||||
it('loads its assets from the root of the origin, not /Rosea/', () => {
|
||||
const urls = [...html.matchAll(/(?:src|href)="([^"]+)"/g)].map((m) => m[1]!);
|
||||
const assets = urls.filter((u) => u.includes('assets/'));
|
||||
expect(assets.length).toBeGreaterThanOrEqual(2);
|
||||
for (const u of assets) expect(u.startsWith('/assets/')).toBe(true);
|
||||
expect(html).not.toContain('/Rosea/');
|
||||
});
|
||||
|
||||
it('replaces the shell constant at build time: left in, it would throw in the webview', () => {
|
||||
expect(scripts).not.toContain('__ROSEA_SHELL__');
|
||||
});
|
||||
|
||||
it('ships no source maps', () => {
|
||||
expect(files.filter((f) => f.endsWith('.map'))).toEqual([]);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"types": ["node"]
|
||||
},
|
||||
"include": ["src/**/*.ts", "scripts/**/*.ts", "test/**/*.ts"]
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* The content-security policy, one string for all four versions (CLAUDE.md §2, *Four versions*).
|
||||
* The PWA carries it in a <meta> tag, because GitHub Pages cannot send headers (CLAUDE.md §8).
|
||||
* The Tauri shell delivers it from `apps/rosea-tauri/src-tauri/tauri.conf.json`
|
||||
* (`app.security.csp`), and the shell's test holds that string equal to this one
|
||||
* (tauri-platforms.md D4).
|
||||
*
|
||||
* `'self'` everywhere and nothing else: no CDN, no font host, no analytics (CLAUDE.md §4).
|
||||
* `frame-ancestors` is ignored in a meta tag and is omitted rather than pretended.
|
||||
*/
|
||||
export const CSP = [
|
||||
"default-src 'self'",
|
||||
"script-src 'self'",
|
||||
"style-src 'self'",
|
||||
"img-src 'self' data:",
|
||||
"font-src 'self'",
|
||||
"connect-src 'self'",
|
||||
"manifest-src 'self'",
|
||||
"worker-src 'self'",
|
||||
"object-src 'none'",
|
||||
"base-uri 'self'",
|
||||
"form-action 'none'"
|
||||
].join('; ');
|
||||
@@ -7,6 +7,8 @@
|
||||
"scripts": {
|
||||
"dev": "vite --host 127.0.0.1 --port 5173 --strictPort",
|
||||
"build": "tsx ../../scripts/validate-library.ts && vite build",
|
||||
"build:shell": "tsx ../../scripts/validate-library.ts && vite build --mode tauri",
|
||||
"dev:shell": "vite --mode tauri --host 127.0.0.1 --port 5173 --strictPort",
|
||||
"typecheck": "svelte-check --threshold error --output human"
|
||||
},
|
||||
"dependencies": {
|
||||
|
||||
@@ -59,8 +59,14 @@
|
||||
persisted: async () => (browserStorage?.persisted ? browserStorage.persisted() : null),
|
||||
persist: async () => (browserStorage?.persist ? browserStorage.persist() : null)
|
||||
};
|
||||
// The Android, iOS and desktop apps are installed by being apps (tauri-platforms.md D9):
|
||||
// they ask to keep the garden after the first care, as an installed PWA does, and never
|
||||
// show the hint to add the page to the home screen.
|
||||
const inApp = __ROSEA_SHELL__ === 'tauri';
|
||||
const installed = (): boolean =>
|
||||
matchMedia('(display-mode: standalone)').matches || (navigator as Navigator & { standalone?: boolean }).standalone === true;
|
||||
inApp ||
|
||||
matchMedia('(display-mode: standalone)').matches ||
|
||||
(navigator as Navigator & { standalone?: boolean }).standalone === true;
|
||||
// An installed app is asked once, after the first care of a visit: by then there is
|
||||
// something to lose, and installed apps are not met with a permission prompt (K5).
|
||||
let askedToKeep = false;
|
||||
@@ -82,7 +88,8 @@
|
||||
|
||||
// --- A new version waiting (calm-refresh.md) ----------------------------
|
||||
// The worker is registered here so the page hears when a new version has installed
|
||||
// and waits. It is offered, never swapped in by itself (U2).
|
||||
// and waits. It is offered, never swapped in by itself (U2). In the apps there is no
|
||||
// worker: this registerSW does nothing, and a new version comes as a new app.
|
||||
let updateReady = $state(false);
|
||||
const updateSW = registerSW({
|
||||
onNeedRefresh: () => (updateReady = true),
|
||||
|
||||
Vendored
+6
@@ -2,6 +2,12 @@
|
||||
/// <reference types="vite/client" />
|
||||
/// <reference types="vite-plugin-pwa/client" />
|
||||
|
||||
/**
|
||||
* Which shell the game was built for (vite.config.ts): `'web'` for the PWA, `'tauri'` for the
|
||||
* Android, iOS and desktop apps. Read in App.svelte only, for wiring (CLAUDE.md §2).
|
||||
*/
|
||||
declare const __ROSEA_SHELL__: 'web' | 'tauri';
|
||||
|
||||
declare module 'virtual:rosea-library' {
|
||||
import type { HopeSentence } from '@rosea/schema';
|
||||
/** The verified hope library, bundled at build time after validate:library passed (day-sentence.md P5). */
|
||||
|
||||
+89
-82
@@ -9,6 +9,18 @@ import { VitePWA } from 'vite-plugin-pwa';
|
||||
// load a workspace package's .ts source, so `vite build` and `svelte-check` both
|
||||
// failed to load this file. The constants module is pure and dependency-free.
|
||||
import { PRODUCT_NAME, PRODUCT_SHORT_NAME } from '../../packages/schema/src/constants.js';
|
||||
import { CSP } from './csp.js';
|
||||
|
||||
/**
|
||||
* Two builds of one game (CLAUDE.md §2, *Four versions*; tauri-platforms.md D2).
|
||||
* - the PWA (default mode): base `/Rosea/`, a service worker, the web manifest, the CSP
|
||||
* in a <meta> tag, into `dist/`;
|
||||
* - the Tauri shell's copy (`--mode tauri`): base `/`, because Tauri serves the game at the
|
||||
* root of its own origin; no worker and no manifest, because the files are already on
|
||||
* the device; no <meta> CSP, because Tauri delivers the same policy and a page that
|
||||
* carries both obeys both; into `dist-tauri/`, so the two can never be mixed up.
|
||||
*/
|
||||
type Shell = 'web' | 'tauri';
|
||||
|
||||
/**
|
||||
* GitHub Pages serves a project site at `/<repo>/`, not `/` (CLAUDE.md §8). Vite
|
||||
@@ -16,45 +28,30 @@ import { PRODUCT_NAME, PRODUCT_SHORT_NAME } from '../../packages/schema/src/cons
|
||||
* derive from this one value, so they cannot disagree. The e2e and offline
|
||||
* suites serve the build under the same prefix.
|
||||
*/
|
||||
const BASE = process.env['ROSEA_BASE'] ?? '/Rosea/';
|
||||
if (!BASE.startsWith('/') || !BASE.endsWith('/')) {
|
||||
throw new Error(`ROSEA_BASE must start and end with '/', got '${BASE}'`);
|
||||
function baseFor(shell: Shell): string {
|
||||
const base = process.env['ROSEA_BASE'] ?? (shell === 'tauri' ? '/' : '/Rosea/');
|
||||
if (!base.startsWith('/') || !base.endsWith('/')) {
|
||||
throw new Error(`ROSEA_BASE must start and end with '/', got '${base}'`);
|
||||
}
|
||||
return base;
|
||||
}
|
||||
|
||||
/**
|
||||
* The content-security policy. GitHub Pages cannot send headers, so it lives in
|
||||
* a <meta> tag (CLAUDE.md §8). It is injected into the BUILT page only, because
|
||||
* the dev server injects inline <style> for hot reload and `style-src 'self'`
|
||||
* The content-security policy (`csp.ts`). GitHub Pages cannot send headers, so the PWA
|
||||
* carries it in a <meta> tag (CLAUDE.md §8). It is injected into the BUILT page only,
|
||||
* because the dev server injects inline <style> for hot reload and `style-src 'self'`
|
||||
* would blank it. E2E runs against the build, where the policy is real.
|
||||
*
|
||||
* `'self'` everywhere and nothing else: no CDN, no font host, no analytics
|
||||
* (CLAUDE.md §4). `frame-ancestors` is ignored in a meta tag and is omitted
|
||||
* rather than pretended.
|
||||
*/
|
||||
const CSP = [
|
||||
"default-src 'self'",
|
||||
"script-src 'self'",
|
||||
"style-src 'self'",
|
||||
"img-src 'self' data:",
|
||||
"font-src 'self'",
|
||||
"connect-src 'self'",
|
||||
"manifest-src 'self'",
|
||||
"worker-src 'self'",
|
||||
"object-src 'none'",
|
||||
"base-uri 'self'",
|
||||
"form-action 'none'"
|
||||
].join('; ');
|
||||
|
||||
function contentSecurityPolicy(): Plugin {
|
||||
return {
|
||||
name: 'rosea-csp',
|
||||
apply: 'build',
|
||||
transformIndexHtml: {
|
||||
order: 'post',
|
||||
handler: () => [
|
||||
{ tag: 'meta', attrs: { 'http-equiv': 'Content-Security-Policy', content: CSP }, injectTo: 'head-prepend' }
|
||||
]
|
||||
}
|
||||
name: 'rosea-csp',
|
||||
apply: 'build',
|
||||
transformIndexHtml: {
|
||||
order: 'post',
|
||||
handler: () => [
|
||||
{ tag: 'meta', attrs: { 'http-equiv': 'Content-Security-Policy', content: CSP }, injectTo: 'head-prepend' }
|
||||
]
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -89,54 +86,64 @@ function hopeLibrary(): Plugin {
|
||||
}
|
||||
|
||||
// Nothing binds to anything but 127.0.0.1 (CLAUDE.md §5.7).
|
||||
export default defineConfig({
|
||||
base: BASE,
|
||||
plugins: [
|
||||
svelte(),
|
||||
contentSecurityPolicy(),
|
||||
hopeLibrary(),
|
||||
VitePWA({
|
||||
strategies: 'generateSW',
|
||||
// Never swap a running app silently. A new worker waits until the player
|
||||
// is offered a calm refresh control (CLAUDE.md §8, GAP_ANALYSIS G0.10).
|
||||
registerType: 'prompt',
|
||||
// The app registers the worker itself through virtual:pwa-register, so it hears
|
||||
// when a new version is waiting (calm-refresh.md U1). Bundled, not inline: the
|
||||
// CSP has no 'unsafe-inline' for scripts.
|
||||
injectRegister: false,
|
||||
manifest: {
|
||||
// The web manifest: one of the three places the name lives, built from
|
||||
// the constants in @rosea/schema so the strings exist only there.
|
||||
name: PRODUCT_NAME,
|
||||
short_name: PRODUCT_SHORT_NAME,
|
||||
description: 'A rose to tend, a fox to befriend, and the time we give to people.',
|
||||
id: BASE,
|
||||
start_url: BASE,
|
||||
scope: BASE,
|
||||
display: 'standalone',
|
||||
orientation: 'portrait',
|
||||
background_color: '#fbf6f1',
|
||||
theme_color: '#b4485e',
|
||||
icons: [{ src: 'icon.svg', sizes: 'any', type: 'image/svg+xml', purpose: 'any' }]
|
||||
},
|
||||
workbox: {
|
||||
// The cache name never contains the build hash; Workbox invalidates
|
||||
// per entry from the precache manifest's revisions.
|
||||
cacheId: 'rosea',
|
||||
globPatterns: ['**/*.{js,css,html,svg,webmanifest}'],
|
||||
navigateFallback: 'index.html',
|
||||
// No runtime caching: the app makes no request it was not asked to make.
|
||||
runtimeCaching: [],
|
||||
cleanupOutdatedCaches: true,
|
||||
// The first worker controls the page that registered it, so a player who
|
||||
// opens the link once and loses signal still has the app.
|
||||
clientsClaim: true,
|
||||
skipWaiting: false
|
||||
},
|
||||
devOptions: { enabled: false }
|
||||
})
|
||||
],
|
||||
server: { host: '127.0.0.1', strictPort: true },
|
||||
preview: { host: '127.0.0.1', strictPort: true },
|
||||
build: { target: 'es2022', sourcemap: true }
|
||||
export default defineConfig(({ mode }) => {
|
||||
const shell: Shell = mode === 'tauri' ? 'tauri' : 'web';
|
||||
const BASE = baseFor(shell);
|
||||
return {
|
||||
base: BASE,
|
||||
// The one way the game knows which shell it is in, read in App.svelte only (CLAUDE.md §2).
|
||||
define: { __ROSEA_SHELL__: JSON.stringify(shell) },
|
||||
plugins: [
|
||||
svelte(),
|
||||
...(shell === 'web' ? [contentSecurityPolicy()] : []),
|
||||
hopeLibrary(),
|
||||
VitePWA({
|
||||
// Off in the shell: `virtual:pwa-register` then gives a registerSW that does nothing,
|
||||
// and no worker, manifest or register script is emitted (tauri-platforms.md D2).
|
||||
disable: shell === 'tauri',
|
||||
strategies: 'generateSW',
|
||||
// Never swap a running app silently. A new worker waits until the player
|
||||
// is offered a calm refresh control (CLAUDE.md §8, GAP_ANALYSIS G0.10).
|
||||
registerType: 'prompt',
|
||||
// The app registers the worker itself through virtual:pwa-register, so it hears
|
||||
// when a new version is waiting (calm-refresh.md U1). Bundled, not inline: the
|
||||
// CSP has no 'unsafe-inline' for scripts.
|
||||
injectRegister: false,
|
||||
manifest: {
|
||||
// The web manifest: one of the three places the name lives, built from
|
||||
// the constants in @rosea/schema so the strings exist only there.
|
||||
name: PRODUCT_NAME,
|
||||
short_name: PRODUCT_SHORT_NAME,
|
||||
description: 'A rose to tend, a fox to befriend, and the time we give to people.',
|
||||
id: BASE,
|
||||
start_url: BASE,
|
||||
scope: BASE,
|
||||
display: 'standalone',
|
||||
orientation: 'portrait',
|
||||
background_color: '#fbf6f1',
|
||||
theme_color: '#b4485e',
|
||||
icons: [{ src: 'icon.svg', sizes: 'any', type: 'image/svg+xml', purpose: 'any' }]
|
||||
},
|
||||
workbox: {
|
||||
// The cache name never contains the build hash; Workbox invalidates
|
||||
// per entry from the precache manifest's revisions.
|
||||
cacheId: 'rosea',
|
||||
globPatterns: ['**/*.{js,css,html,svg,webmanifest}'],
|
||||
navigateFallback: 'index.html',
|
||||
// No runtime caching: the app makes no request it was not asked to make.
|
||||
runtimeCaching: [],
|
||||
cleanupOutdatedCaches: true,
|
||||
// The first worker controls the page that registered it, so a player who
|
||||
// opens the link once and loses signal still has the app.
|
||||
clientsClaim: true,
|
||||
skipWaiting: false
|
||||
},
|
||||
devOptions: { enabled: false }
|
||||
})
|
||||
],
|
||||
server: { host: '127.0.0.1', strictPort: true },
|
||||
preview: { host: '127.0.0.1', strictPort: true },
|
||||
// The shell's copy has no source maps: they would ship inside every installer and APK.
|
||||
build: { target: 'es2022', sourcemap: shell === 'web', outDir: shell === 'tauri' ? 'dist-tauri' : 'dist' }
|
||||
};
|
||||
});
|
||||
|
||||
+29
-4
@@ -51,8 +51,9 @@ parameter. `packages/content` holds the hope library and its validator. `package
|
||||
module that opens IndexedDB, `packages/identity` the only one that holds keys, `packages/sync` the only
|
||||
one that talks to friends (WebRTC, Phase 3). `apps/rosea` is a **Svelte 5 + Vite PWA** — web first,
|
||||
from a link, no store — built by GitHub Actions and hosted on **GitHub Pages**, with a Gitea mirror. **Rust** is used where it earns its place: `services/lucerna`, the optional
|
||||
anonymous discovery service (Axum + SQLite, Phase 4), and later a **Tauri 2** shell for Android and iOS
|
||||
that gives local notifications without a server (Phase 6). All player state is an append-only event log;
|
||||
anonymous discovery service (Axum + SQLite, Phase 4), and a **Tauri 2** shell (`apps/rosea-tauri`) that
|
||||
packages the same game as an Android app, an iOS app and a desktop app — the platform track below, from
|
||||
2026-11-17; its local notifications without a server come in Phase 6. All player state is an append-only event log;
|
||||
every visible thing is a pure function of it.
|
||||
|
||||
---
|
||||
@@ -96,7 +97,8 @@ automatic checks, Claude's review, Mark's approval — into `art/final/`.
|
||||
|
||||
**Out of scope:** planets, fox, friends, any server.
|
||||
|
||||
**Gate — the spike's real question.** Mark plays it daily for two weeks on his phone. Then: *did he go
|
||||
**Gate — the spike's real question.** Mark plays it daily for two weeks on his phone (the Android
|
||||
app from the platform track lets this start before the PWA is hosted). Then: *did he go
|
||||
and look at the real sunset without the game nagging him, and did the rose make him want to come back?*
|
||||
Yes on both is a go. Yes only on the second means a pleasant toy, not Rosea. No on both is a clean stop.
|
||||
|
||||
@@ -150,9 +152,31 @@ errors.
|
||||
**Gate:** a share image leaves the device containing nothing that identifies the player or anyone
|
||||
else.
|
||||
|
||||
### The platform track — four versions · from 2026-11-17, beside the phases
|
||||
|
||||
*Decided by the author 2026-11-17:* Rosea Domi ships as **four versions from one Svelte codebase** —
|
||||
the PWA, an Android APK, an iOS app and a desktop app (Windows first; macOS and Linux when built on
|
||||
those systems). The three apps come from one **Tauri 2** shell, `apps/rosea-tauri`, which wraps the
|
||||
built game and adds nothing to it. This used to wait for Phase 6; it starts now, because the shell needs
|
||||
no new feature and an APK puts the Phase 1 spike on a phone without any hosting. Analysis:
|
||||
[`.agents/features/tauri-platforms.md`](../.agents/features/tauri-platforms.md).
|
||||
|
||||
- The shell, a Windows desktop build and an Android debug APK, built on Mark's Windows machine and run
|
||||
on a real Android tablet.
|
||||
- The same privacy in every version: no network permission on Android while Rosea has no network
|
||||
feature, no cloud backup of the garden, the webviews' own reporting off, no SDK that counts anything.
|
||||
- **iOS** needs a Mac with Xcode and an Apple developer account. It waits for one; nothing in the
|
||||
code stops it.
|
||||
- macOS and Linux desktop builds, each on its own system; signed release builds; CI for the apps (G0.22).
|
||||
|
||||
**Gate:** in each version that exists, the garden opens with the network off, a watered rose is still
|
||||
watered after the app is closed and opened again, and the app sends nothing.
|
||||
|
||||
### Phase 6 — Stores and money · ongoing
|
||||
|
||||
- Tauri 2 shell for Android and iOS: local sunset notifications without a server.
|
||||
- Store listings: Google Play, the App Store, perhaps the Microsoft Store — their texts pass
|
||||
`lint:copy` like every other word.
|
||||
- Local sunset notifications through the shell's notification plugin, without a server.
|
||||
- Monetisation — **not decided** (§6). Constraints already set: tending others is always free; no
|
||||
ads, no subscription-only, no sale of data.
|
||||
|
||||
@@ -166,6 +190,7 @@ else.
|
||||
| **Cold start** | Phases 3–5 need people; Mark will have few players for months. | Phases 1–2 must stand alone; the fox's path to people comes after the game is already worth playing. |
|
||||
| **Content volume** | 365 sourced sentences and many planets is a lot of careful work. | Start with 60 sentences; library grows by tradition; the validator keeps quality. |
|
||||
| **Web notifications** | The sunset invitation may need a push server on the web, with a privacy cost. | Decided in Phase 0; the Tauri shell later removes the server. |
|
||||
| **Four versions, one author** | Every platform has its own traps (webviews that phone home, cloud backups, evictable storage), and iOS needs a Mac. | One codebase; the shell adds a window and nothing else; one test suite for the game, the shell's own checks for its config; iOS waits for a Mac rather than being half-done. |
|
||||
| **Copyright** | The book and Tolkien are protected; a too-close image or line is a legal problem. | Forbidden-names lint; likeness check in the art pipeline; ideas only. |
|
||||
| **Medical-device scope** | Wellbeing claims can pull the app under medical rules. | Forbidden words in all copy, store text included. |
|
||||
| **Safety around strangers** | Lonely people are the people a scammer looks for. | No free text, ever; consent ladder; group meetings in public only. |
|
||||
|
||||
@@ -0,0 +1,225 @@
|
||||
/**
|
||||
* The garden in a BUILT app, on a real machine or device (tauri-platforms.md §5): it opens,
|
||||
* she is watered, the app is closed and opened again, and she is still watered. Also measured
|
||||
* on the way: the origin, that there is no service worker, what `persisted()` answers, that no
|
||||
* request leaves the origin and no CSP violation is reported, and what *Save her to a file* does.
|
||||
*
|
||||
* tsx e2e/apps/check-garden.ts desktop [path-to-exe]
|
||||
* tsx e2e/apps/check-garden.ts android [device-serial]
|
||||
*
|
||||
* Desktop: runs the release `.exe` with its WebView2 data in a fresh temporary folder (never the
|
||||
* player's own) and its DevTools port on 127.0.0.1 only (CLAUDE.md §5.7), through WebView2's own
|
||||
* environment variables. Those replace the app's `additionalBrowserArgs` for this run, so this
|
||||
* check says nothing about WebView2's own traffic (G-T6).
|
||||
* Android: the installed debug APK (`adb install -r`), driven through Playwright's Android support
|
||||
* over adb; its data is cleared first with `pm clear` (it is the test app, not a player's).
|
||||
* Every app it starts is stopped in `finally`.
|
||||
*/
|
||||
import { expect, _android as android, chromium, type Page } from '@playwright/test';
|
||||
import { PRODUCT_NAME } from '@rosea/schema';
|
||||
import { en } from '@rosea/ui/copy';
|
||||
import { spawn, spawnSync, type ChildProcess } from 'node:child_process';
|
||||
import { existsSync, mkdtempSync, rmSync } from 'node:fs';
|
||||
import { tmpdir } from 'node:os';
|
||||
import { join, resolve } from 'node:path';
|
||||
import { storedCare } from '../stored.js';
|
||||
|
||||
const PACKAGE_ID = 'cz.mareknovak.domi.rosea';
|
||||
const report: Record<string, unknown> = {};
|
||||
|
||||
/** Requests that leave the game's origin, and CSP violations, from now on. */
|
||||
function watch(page: Page): { outside: string[]; csp: string[]; errors: string[] } {
|
||||
const seen = { outside: [] as string[], csp: [] as string[], errors: [] as string[] };
|
||||
const origin = new URL(page.url()).origin;
|
||||
page.on('request', (r) => {
|
||||
const url = r.url();
|
||||
if (!url.startsWith(origin + '/') && !url.startsWith('data:') && !url.startsWith('blob:')) seen.outside.push(url);
|
||||
});
|
||||
page.on('console', (m) => {
|
||||
if (m.type() !== 'error') return;
|
||||
if (/Content Security Policy/i.test(m.text())) seen.csp.push(m.text());
|
||||
else seen.errors.push(m.text());
|
||||
});
|
||||
return seen;
|
||||
}
|
||||
|
||||
async function garden(page: Page): Promise<void> {
|
||||
await expect(page.getByRole('heading', { level: 1 })).toHaveText(PRODUCT_NAME, { timeout: 20_000 });
|
||||
}
|
||||
|
||||
/** The first visit: skip the town (no town is the private choice), water her, wait for the write. */
|
||||
async function firstVisit(page: Page): Promise<void> {
|
||||
await garden(page);
|
||||
const seen = watch(page);
|
||||
await page.reload();
|
||||
await garden(page);
|
||||
report['origin'] = await page.evaluate(() => location.origin);
|
||||
report['serviceWorkers'] = await page.evaluate(async () =>
|
||||
'serviceWorker' in navigator ? (await navigator.serviceWorker.getRegistrations()).length : 'no API'
|
||||
);
|
||||
report['manifestLink'] = await page.evaluate(() => document.querySelector('link[rel="manifest"]') !== null);
|
||||
report['cspMeta'] = await page.evaluate(() => document.querySelector('meta[http-equiv="Content-Security-Policy"]') !== null);
|
||||
|
||||
const skip = page.getByRole('button', { name: /^Not now/ });
|
||||
if (await skip.isVisible().catch(() => false)) await skip.click();
|
||||
|
||||
const water = page.getByRole('button', { name: en.rose.water });
|
||||
await expect(water).toBeVisible();
|
||||
const box = await water.boundingBox();
|
||||
if (!box) throw new Error('the Water button has no box');
|
||||
await page.mouse.move(box.x + box.width / 2, box.y + box.height / 2);
|
||||
await page.mouse.down();
|
||||
await page.waitForTimeout(1500);
|
||||
await page.mouse.up();
|
||||
await expect(page.getByText(en.rose.says.thanks)).toBeVisible();
|
||||
await storedCare(page, 1);
|
||||
report['persistedAfterCare'] = await page.evaluate(async () => (navigator.storage?.persisted ? navigator.storage.persisted() : 'no API'));
|
||||
report['firstVisit'] = { outside: seen.outside, csp: seen.csp, errors: seen.errors };
|
||||
}
|
||||
|
||||
/** After the app was closed and opened again: she is still watered. */
|
||||
async function secondVisit(page: Page): Promise<void> {
|
||||
await garden(page);
|
||||
// By keyboard: on the tablet a pointer click once waited 30 s for the button to stop moving
|
||||
// while the garden animated (review). Enter is a real activation, as for a keyboard player.
|
||||
const numbers = page.getByRole('button', { name: en.rose.numbers });
|
||||
await numbers.focus();
|
||||
await numbers.press('Enter');
|
||||
await expect(page.locator('#rose-numbers')).toContainText(`${en.rose.daysOfCare}1`);
|
||||
await storedCare(page, 1);
|
||||
report['afterRestart'] = 'still watered: 1 day of care, the care log kept';
|
||||
}
|
||||
|
||||
/** What *Save her to a file* does here (G-T4): a download event, or nothing. */
|
||||
async function trySave(page: Page): Promise<void> {
|
||||
const title = page.getByRole('button', { name: en.rose.safe.title });
|
||||
if (!(await title.isVisible().catch(() => false))) {
|
||||
report['saveToFile'] = 'Keep her safe not visible';
|
||||
return;
|
||||
}
|
||||
await title.click();
|
||||
const save = page.getByRole('button', { name: en.rose.safe.save });
|
||||
await expect(save).toBeVisible();
|
||||
const download = page.waitForEvent('download', { timeout: 5_000 }).then(
|
||||
async (d) => {
|
||||
await d.cancel();
|
||||
return `a download started: ${d.suggestedFilename()} (cancelled by the check)`;
|
||||
},
|
||||
() => 'nothing happened within 5 s'
|
||||
);
|
||||
await save.click();
|
||||
report['saveToFile'] = await download;
|
||||
}
|
||||
|
||||
async function desktop(exe: string): Promise<void> {
|
||||
if (!existsSync(exe)) throw new Error(`no app at ${exe}; run pnpm tauri:build first`);
|
||||
const data = mkdtempSync(join(tmpdir(), 'rosea-desktop-check-'));
|
||||
const port = 9333;
|
||||
const env = {
|
||||
...process.env,
|
||||
WEBVIEW2_USER_DATA_FOLDER: data,
|
||||
WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS: `--remote-debugging-port=${port} --remote-debugging-address=127.0.0.1`
|
||||
};
|
||||
const start = (): ChildProcess => spawn(exe, [], { env, stdio: 'ignore' });
|
||||
const attach = async (): Promise<{ page: Page; close: () => Promise<void> }> => {
|
||||
for (let i = 0; i < 60; i++) {
|
||||
try {
|
||||
const browser = await chromium.connectOverCDP(`http://127.0.0.1:${port}`);
|
||||
for (let j = 0; j < 40; j++) {
|
||||
const page = browser.contexts().flatMap((c) => c.pages())[0];
|
||||
if (page) return { page, close: () => browser.close() };
|
||||
await new Promise((r) => setTimeout(r, 250));
|
||||
}
|
||||
await browser.close();
|
||||
} catch {
|
||||
// Not listening yet: the app is still starting. Tried again below; a real failure ends in the throw.
|
||||
}
|
||||
await new Promise((r) => setTimeout(r, 500));
|
||||
}
|
||||
throw new Error('the app never opened a page on the debugging port');
|
||||
};
|
||||
let app: ChildProcess | undefined;
|
||||
try {
|
||||
app = start();
|
||||
let session = await attach();
|
||||
await firstVisit(session.page);
|
||||
await session.close();
|
||||
app.kill();
|
||||
await new Promise((r) => setTimeout(r, 1500));
|
||||
|
||||
app = start();
|
||||
session = await attach();
|
||||
await secondVisit(session.page);
|
||||
await trySave(session.page);
|
||||
await session.close();
|
||||
report['dataFolder'] = data;
|
||||
} finally {
|
||||
app?.kill();
|
||||
await new Promise((r) => setTimeout(r, 1000));
|
||||
rmSync(data, { recursive: true, force: true, maxRetries: 5, retryDelay: 500 });
|
||||
}
|
||||
}
|
||||
|
||||
async function androidDevice(serial: string | undefined): Promise<void> {
|
||||
// The USB link to a real tablet drops now and then ("device offline"); a dropped link is waited
|
||||
// for and the command tried again, up to three times. A command that fails for another reason
|
||||
// fails the check at once.
|
||||
const adb = (...args: string[]): string => {
|
||||
const target = serial ? ['-s', serial] : [];
|
||||
for (let attempt = 1; ; attempt++) {
|
||||
const r = spawnSync('adb', [...target, ...args], { encoding: 'utf8' });
|
||||
if (r.status === 0) return r.stdout;
|
||||
const dropped = /offline|closed|not found|no devices/i.test(r.stderr);
|
||||
if (!dropped || attempt === 3) throw new Error(`adb ${args.join(' ')} failed: ${r.stderr}`);
|
||||
spawnSync('adb', [...target, 'wait-for-device'], { timeout: 30_000 });
|
||||
}
|
||||
};
|
||||
// Playwright's handle to the device dies with the link, so it is found again for each visit.
|
||||
const open = async (): Promise<{ page: Page; close: () => Promise<void> }> => {
|
||||
adb('wait-for-device');
|
||||
const devices = await android.devices();
|
||||
const device = serial ? devices.find((d) => d.serial() === serial) : devices[0];
|
||||
if (!device) throw new Error('no Android device over adb');
|
||||
report['device'] = `${device.model()} (${device.serial()})`;
|
||||
adb('shell', 'monkey', '-p', PACKAGE_ID, '-c', 'android.intent.category.LAUNCHER', '1');
|
||||
const webView = await device.webView({ pkg: PACKAGE_ID }, { timeout: 30_000 });
|
||||
return { page: await webView.page(), close: () => device.close() };
|
||||
};
|
||||
const dump = adb('shell', 'dumpsys', 'package', PACKAGE_ID);
|
||||
if (!dump.includes(`Package [${PACKAGE_ID}]`)) throw new Error(`${PACKAGE_ID} is not installed; adb install -r <apk>`);
|
||||
report['internetPermission'] = /android\.permission\.INTERNET/.test(dump);
|
||||
report['allowBackupFlag'] = /flags=\[[^\]]*ALLOW_BACKUP/.test(dump);
|
||||
let session: { page: Page; close: () => Promise<void> } | undefined;
|
||||
try {
|
||||
adb('shell', 'pm', 'clear', PACKAGE_ID);
|
||||
session = await open();
|
||||
await firstVisit(session.page);
|
||||
await session.close();
|
||||
|
||||
adb('shell', 'am', 'force-stop', PACKAGE_ID);
|
||||
await new Promise((r) => setTimeout(r, 1500));
|
||||
session = await open();
|
||||
await secondVisit(session.page);
|
||||
await trySave(session.page);
|
||||
} finally {
|
||||
adb('shell', 'am', 'force-stop', PACKAGE_ID);
|
||||
await session?.close().catch((error: unknown) => console.error('check-garden: closing the device handle failed', error));
|
||||
}
|
||||
}
|
||||
|
||||
const [target, arg] = process.argv.slice(2);
|
||||
try {
|
||||
if (target === 'desktop') {
|
||||
await desktop(resolve(arg ?? 'apps/rosea-tauri/src-tauri/target/release/rosea-shell.exe'));
|
||||
} else if (target === 'android') {
|
||||
await androidDevice(arg);
|
||||
} else {
|
||||
throw new Error('usage: check-garden.ts desktop [exe] | android [serial]');
|
||||
}
|
||||
console.log(JSON.stringify(report, null, 2));
|
||||
console.log(`check-garden ${target}: PASSED`);
|
||||
} catch (error) {
|
||||
console.log(JSON.stringify(report, null, 2));
|
||||
console.error(`check-garden ${target}: FAILED — ${(error as Error).message}`);
|
||||
process.exitCode = 1;
|
||||
}
|
||||
+6
-1
@@ -25,6 +25,9 @@ export default [
|
||||
{
|
||||
ignores: [
|
||||
'**/dist/**',
|
||||
'**/dist-tauri/**',
|
||||
'apps/rosea-tauri/src-tauri/gen/**',
|
||||
'apps/rosea-tauri/src-tauri/target/**',
|
||||
'**/node_modules/**',
|
||||
'**/.turbo/**',
|
||||
'**/generated/**',
|
||||
@@ -61,7 +64,9 @@ export default [
|
||||
files: ['**/*.svelte', '**/*.svelte.ts', '**/*.svelte.js'],
|
||||
languageOptions: {
|
||||
parser: svelteParser,
|
||||
parserOptions: { parser: ts.parser }
|
||||
parserOptions: { parser: ts.parser },
|
||||
// The build-time shell constant (apps/rosea/vite.config.ts), read in App.svelte only.
|
||||
globals: { __ROSEA_SHELL__: 'readonly' }
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
+5
-1
@@ -20,7 +20,11 @@
|
||||
"lint:copy": "tsx scripts/lint-copy.ts",
|
||||
"art:board": "tsx tools/art-prep/src/cli-board.ts",
|
||||
"art:accept": "tsx tools/art-prep/src/cli-accept.ts",
|
||||
"guard:cpu": "tsx tools/cpu-guard/src/cli.ts"
|
||||
"guard:cpu": "tsx tools/cpu-guard/src/cli.ts",
|
||||
"tauri:dev": "pnpm --filter @rosea/tauri dev",
|
||||
"tauri:build": "pnpm --filter @rosea/tauri build:desktop",
|
||||
"tauri:android": "pnpm --filter @rosea/tauri build:android",
|
||||
"tauri:ios": "pnpm --filter @rosea/tauri build:ios"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@axe-core/playwright": "4.13.0",
|
||||
|
||||
Generated
+136
@@ -103,6 +103,24 @@ importers:
|
||||
specifier: 7.4.1
|
||||
version: 7.4.1
|
||||
|
||||
apps/rosea-tauri:
|
||||
devDependencies:
|
||||
'@tauri-apps/cli':
|
||||
specifier: 2.12.5
|
||||
version: 2.12.5
|
||||
'@types/node':
|
||||
specifier: 22.20.1
|
||||
version: 22.20.1
|
||||
tsx:
|
||||
specifier: 4.23.12
|
||||
version: 4.23.12
|
||||
typescript:
|
||||
specifier: 5.9.3
|
||||
version: 5.9.3
|
||||
vitest:
|
||||
specifier: 3.2.7
|
||||
version: 3.2.7(@types/node@22.20.1)(jsdom@25.0.1)(terser@5.51.2)(tsx@4.23.12)
|
||||
|
||||
packages/content:
|
||||
dependencies:
|
||||
'@rosea/schema':
|
||||
@@ -1541,6 +1559,77 @@ packages:
|
||||
svelte: ^5.0.0
|
||||
vite: ^6.0.0
|
||||
|
||||
'@tauri-apps/cli-darwin-arm64@2.12.5':
|
||||
resolution: {integrity: sha512-VVvBRBdTFF7BP7RqGeItp9yDiyXj0DI1laRCEN2q6GLrNkw4wrHeWAxHp23PwtQtn/XET+yTN1jOKrq+Yor5PQ==}
|
||||
engines: {node: '>= 10'}
|
||||
cpu: [arm64]
|
||||
os: [darwin]
|
||||
|
||||
'@tauri-apps/cli-darwin-x64@2.12.5':
|
||||
resolution: {integrity: sha512-A84QYNj93kaG06N2mIFBRZM/X3lf9TyAVQeQwOmP2AJZ2wCt1WLDJgHRCvjeJmwJjJ5Ud0jUbIKbXg8NEGvsVQ==}
|
||||
engines: {node: '>= 10'}
|
||||
cpu: [x64]
|
||||
os: [darwin]
|
||||
|
||||
'@tauri-apps/cli-linux-arm-gnueabihf@2.12.5':
|
||||
resolution: {integrity: sha512-tb/5xG5HV6CJR9AZBmTyI2GCi05vcH8XUjUIjBquAx7x+AE4f1vMWngvq7JW2AqYK8nNl79LJH1GR9Hf5QQc5g==}
|
||||
engines: {node: '>= 10'}
|
||||
cpu: [arm]
|
||||
os: [linux]
|
||||
|
||||
'@tauri-apps/cli-linux-arm64-gnu@2.12.5':
|
||||
resolution: {integrity: sha512-Vb7SlbIWlmIqekfsGYT64wH1cQNg5MET8XFyT6pUlVJ7Y/z6LsOIh4MUal0Z5FCPL83GMuEUNxpYUHpt36teHQ==}
|
||||
engines: {node: '>= 10'}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
|
||||
'@tauri-apps/cli-linux-arm64-musl@2.12.5':
|
||||
resolution: {integrity: sha512-b/YfVGueoTOtENQHY1STBF9XlU4uZDtOiMUErp2Nao/YrDWCKggjxxBZU3ycbeDWUYxl8U8M9seE4HYag1xjiQ==}
|
||||
engines: {node: '>= 10'}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
|
||||
'@tauri-apps/cli-linux-riscv64-gnu@2.12.5':
|
||||
resolution: {integrity: sha512-/EXbTfE9FM9GKSSRL9YTRHcMglTVNzbcwegXM0MBR3ozVgoE+pFq46Ej/InJBs1l+sjSpu6jyi38MZ+xyU/3NQ==}
|
||||
engines: {node: '>= 10'}
|
||||
cpu: [riscv64]
|
||||
os: [linux]
|
||||
|
||||
'@tauri-apps/cli-linux-x64-gnu@2.12.5':
|
||||
resolution: {integrity: sha512-OIun574QsULxaZ5SmPDX4D8bO95RBmYJshu8yGFy0RSyCMKEs/y+o3BThot4fbCv4ttC1Tq6Hzt0QRHXCIgp7w==}
|
||||
engines: {node: '>= 10'}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
|
||||
'@tauri-apps/cli-linux-x64-musl@2.12.5':
|
||||
resolution: {integrity: sha512-GDzWcb/6OzJrHnVGQ/n3XndLan67bZ7cu4zJN9+zFmV10nBgKz5jDDm8sRQO4sGb7bu6Ztiy+Al2XY2ptRY0RQ==}
|
||||
engines: {node: '>= 10'}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
|
||||
'@tauri-apps/cli-win32-arm64-msvc@2.12.5':
|
||||
resolution: {integrity: sha512-61KCX5vo0vex7P/P7sbXdfFhHqs+rFaG+UXK/UBwz/VlLveDx6vgpHkF+rfUIfCqj0VvLArpxR3+rQIzRwxKgw==}
|
||||
engines: {node: '>= 10'}
|
||||
cpu: [arm64]
|
||||
os: [win32]
|
||||
|
||||
'@tauri-apps/cli-win32-ia32-msvc@2.12.5':
|
||||
resolution: {integrity: sha512-mGujjR/MlXwJiQcue4wlXrBYlIEdDCoap0g+GNPlLCb75ilSbWMC8qTsXVuGcLIMumIJvc2v+veDnCHnels/Zg==}
|
||||
engines: {node: '>= 10'}
|
||||
cpu: [ia32]
|
||||
os: [win32]
|
||||
|
||||
'@tauri-apps/cli-win32-x64-msvc@2.12.5':
|
||||
resolution: {integrity: sha512-o1+EOjvi/nFwKx5XamCXSr+GUr2ko8TH7+0wnWuZjE+lZwE+/VWCbE49HPHa3/V59M3bJ0dlK1yhogGQ15OVPg==}
|
||||
engines: {node: '>= 10'}
|
||||
cpu: [x64]
|
||||
os: [win32]
|
||||
|
||||
'@tauri-apps/cli@2.12.5':
|
||||
resolution: {integrity: sha512-Dm8s/4aiE52HsBh+Gz3uSrh+fEykRICA1VoAnQA80IqHoTRncPg+q4rGvuhmyNsHUPg3QrPjUrTUSfWmXLVVEw==}
|
||||
engines: {node: '>= 10'}
|
||||
hasBin: true
|
||||
|
||||
'@testing-library/dom@10.4.2':
|
||||
resolution: {integrity: sha512-yzr2S9HyAIdhz2/6qHgbs665Q7PKVcDF05vsOlHPxG1mo36gKVesdYVeDLnXgfjJ03CrKRk08knc6+E/9m8v2Q==}
|
||||
engines: {node: '>=18'}
|
||||
@@ -4596,6 +4685,53 @@ snapshots:
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@tauri-apps/cli-darwin-arm64@2.12.5':
|
||||
optional: true
|
||||
|
||||
'@tauri-apps/cli-darwin-x64@2.12.5':
|
||||
optional: true
|
||||
|
||||
'@tauri-apps/cli-linux-arm-gnueabihf@2.12.5':
|
||||
optional: true
|
||||
|
||||
'@tauri-apps/cli-linux-arm64-gnu@2.12.5':
|
||||
optional: true
|
||||
|
||||
'@tauri-apps/cli-linux-arm64-musl@2.12.5':
|
||||
optional: true
|
||||
|
||||
'@tauri-apps/cli-linux-riscv64-gnu@2.12.5':
|
||||
optional: true
|
||||
|
||||
'@tauri-apps/cli-linux-x64-gnu@2.12.5':
|
||||
optional: true
|
||||
|
||||
'@tauri-apps/cli-linux-x64-musl@2.12.5':
|
||||
optional: true
|
||||
|
||||
'@tauri-apps/cli-win32-arm64-msvc@2.12.5':
|
||||
optional: true
|
||||
|
||||
'@tauri-apps/cli-win32-ia32-msvc@2.12.5':
|
||||
optional: true
|
||||
|
||||
'@tauri-apps/cli-win32-x64-msvc@2.12.5':
|
||||
optional: true
|
||||
|
||||
'@tauri-apps/cli@2.12.5':
|
||||
optionalDependencies:
|
||||
'@tauri-apps/cli-darwin-arm64': 2.12.5
|
||||
'@tauri-apps/cli-darwin-x64': 2.12.5
|
||||
'@tauri-apps/cli-linux-arm-gnueabihf': 2.12.5
|
||||
'@tauri-apps/cli-linux-arm64-gnu': 2.12.5
|
||||
'@tauri-apps/cli-linux-arm64-musl': 2.12.5
|
||||
'@tauri-apps/cli-linux-riscv64-gnu': 2.12.5
|
||||
'@tauri-apps/cli-linux-x64-gnu': 2.12.5
|
||||
'@tauri-apps/cli-linux-x64-musl': 2.12.5
|
||||
'@tauri-apps/cli-win32-arm64-msvc': 2.12.5
|
||||
'@tauri-apps/cli-win32-ia32-msvc': 2.12.5
|
||||
'@tauri-apps/cli-win32-x64-msvc': 2.12.5
|
||||
|
||||
'@testing-library/dom@10.4.2':
|
||||
dependencies:
|
||||
'@babel/code-frame': 7.29.7
|
||||
|
||||
Reference in New Issue
Block a user