Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| dc49209e17 | |||
| 56f266a5b9 | |||
| b947ac3723 | |||
| 1cb1ffb8c8 | |||
| 666c78f5fe | |||
| 6f1920e91b | |||
| 578aa44f23 | |||
| 2b1ac99fbe |
@@ -96,6 +96,8 @@ Svelte codebase, the apps through a Tauri 2 shell. Analysis:
|
|||||||
| ~~G-F5~~ | ~~The `phone` target has not run~~ | **Closed 2026-11-21:** `fabrica tests run --target phone` through the hub's queue, run `20261121-101158-uckm` 1 passed 0 failed on the Wave 10 (debug APK `bd59ff908125…`, commit f5d8d2c); the planted-fault drill `20261121-102500-crkf` failed as it must. The e2e pipeline's `phone` step still waits for the hub's e2e runner (Mark). Earlier: narrowed 2026-11-21 (`android-release-apk.md`): `reset: uninstall`, `maxMinutes: 20`, and the e2e pipeline's `phone` step (`device: Wave 10`) puts it in the hub's queue. **Still open:** the Wave 10 is not paired in Fabrica (`fabrica devices list`: *connected (not paired in Fabrica)*), so the step cannot get its phone; pairing is the Fabrica session's. |
|
| ~~G-F5~~ | ~~The `phone` target has not run~~ | **Closed 2026-11-21:** `fabrica tests run --target phone` through the hub's queue, run `20261121-101158-uckm` 1 passed 0 failed on the Wave 10 (debug APK `bd59ff908125…`, commit f5d8d2c); the planted-fault drill `20261121-102500-crkf` failed as it must. The e2e pipeline's `phone` step still waits for the hub's e2e runner (Mark). Earlier: narrowed 2026-11-21 (`android-release-apk.md`): `reset: uninstall`, `maxMinutes: 20`, and the e2e pipeline's `phone` step (`device: Wave 10`) puts it in the hub's queue. **Still open:** the Wave 10 is not paired in Fabrica (`fabrica devices list`: *connected (not paired in Fabrica)*), so the step cannot get its phone; pairing is the Fabrica session's. |
|
||||||
| ~~G-F7~~ | ~~No key signs the APK~~ | **Closed 2026-12-02:** Mark made `rosea-domi-android` in Custos (PR #11 named it in the code and the pipeline). The v0.1.1 run `r59y647cfcpw9` signed `rosea-domi-0.1.1-arm64.apk` with it, and its `apk` step passed (custos-sign verifies with apksig). This key is Rosea on Android for good. |
|
| ~~G-F7~~ | ~~No key signs the APK~~ | **Closed 2026-12-02:** Mark made `rosea-domi-android` in Custos (PR #11 named it in the code and the pipeline). The v0.1.1 run `r59y647cfcpw9` signed `rosea-domi-0.1.1-arm64.apk` with it, and its `apk` step passed (custos-sign verifies with apksig). This key is Rosea on Android for good. |
|
||||||
| G-F6 | PWA updates have no host | Open with G0.13: the service worker and *Refresh* are built; nothing serves the PWA. |
|
| G-F6 | PWA updates have no host | Open with G0.13: the service worker and *Refresh* are built; nothing serves the PWA. |
|
||||||
|
| ~~G-F8~~ | ~~Aula does not list the Windows installer~~ | **Closed 2026-12-02:** Aula lists only `[A-Za-z0-9._-]+-setup.exe`, and v0.1.1's was `Rosea Domi_0.1.1_x64-setup.exe`. PR #13 renames it after `tauri build`; v0.1.3 (run `r9v6601at1pc5`) published `RoseaDomi_0.1.3_x64-setup.exe`, signed. Aula showing it is not verified here. |
|
||||||
|
| G-F9 | Notes lose an unpublished tag's changes | Open: `fabrica notes` counts from the highest earlier tag. `v0.1.2` was deleted for that reason (HANDOVER); `v0.1.0` still makes v0.1.1's notes omit PRs #8 and #9. Delete a tag whose release fails, or teach Fabrica to count from the last published release. |
|
||||||
|
|
||||||
## Atrium Domi — adoption (`atrium-adoption.md`)
|
## Atrium Domi — adoption (`atrium-adoption.md`)
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
# Review — `docs/release-0-1-3`
|
||||||
|
|
||||||
|
**What:** the record of v0.1.3: HANDOVER's latest section, plus GAP rows G-F8 (closed: Aula can list the installer)
|
||||||
|
and G-F9 (open: release notes lose an unpublished tag's changes).
|
||||||
|
|
||||||
|
## Findings
|
||||||
|
|
||||||
|
1. **Every claim names its evidence:** the run id `r9v6601at1pc5`, the published file names and sizes read from
|
||||||
|
the Gitea release, the desktop step's `installer:` log line, the published notes, and the SHA256SUMS lines.
|
||||||
|
2. **G-F9 is new, found while preparing v0.1.3:** the generated notes would have listed only PR #14. The v0.1.0
|
||||||
|
tag already did this to v0.1.1's notes. It stays open: the fix belongs in a habit (delete a tag whose release
|
||||||
|
fails) or in Fabrica, not in this repository.
|
||||||
|
3. **What I did not verify,** as stated in HANDOVER: the downloaded files against SHA256SUMS, and Aula showing the
|
||||||
|
installer.
|
||||||
|
4. **Soul, privacy, reachability, offline:** documents only.
|
||||||
|
|
||||||
|
**Gate:** lint:copy 29 files, 0 problems. No code changed, so no tests were rerun.
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
# Review — `fix/board-test-timeout`
|
||||||
|
|
||||||
|
**What:** the v0.1.2 release runs `r1ahwf1m23cdr` and `rm56nbzfchx5d` both stopped at the `test` step, on one
|
||||||
|
test: `art-prep` *art/placeholders/ holds exactly what the generator makes* timed out at vitest's default 5 s
|
||||||
|
(8.7 s in the first run, 5.4 s in the second). Every assertion that ran passed; the work was only slow. The test
|
||||||
|
reads the 169 SVG stand-ins in `art/placeholders/` and compares each with what the generator makes, while turbo
|
||||||
|
runs nine other suites on the same runner, in a checkout it has just fetched, so every file is read for the first
|
||||||
|
time. Run alone on D:, it takes 230 ms.
|
||||||
|
|
||||||
|
**How:** that one test gets `{ timeout: 30_000 }`, as `tools/release` already does for its slow suites
|
||||||
|
(`copy.test.ts` 60 s, `version.test.ts` 30 s), with a comment giving the measured times.
|
||||||
|
|
||||||
|
## Findings
|
||||||
|
|
||||||
|
1. **Is a longer timeout hiding a real slowdown?** No assertion changed. The test still fails when one stand-in
|
||||||
|
differs from the generator's output (drill below). 30 s is about three times the slowest time measured on the
|
||||||
|
runner. A test that takes that long would be a new finding.
|
||||||
|
2. **Why not a global `testTimeout`?** That would loosen every test in the package, including ones that should
|
||||||
|
stay fast. Only the test that reads files gets the longer limit.
|
||||||
|
3. **Why not just dispatch again?** That was tried: the second run failed on the same test. Under the runner's
|
||||||
|
load, the time sits around the limit, so a retry is a coin toss.
|
||||||
|
4. **The release:** tag `v0.1.2` points at `666c78f`, which does not have this fix. Nothing was signed or
|
||||||
|
published from either run. Which tag carries the release is the author's call (HANDOVER).
|
||||||
|
5. **Soul, privacy, reachability, offline:** a test file only. Nothing a player sees changed, and the bundle is
|
||||||
|
not rebuilt by this change.
|
||||||
|
|
||||||
|
**Test honesty:** with `app-icon-maskable.svg` changed (an attribute added), the test fails in 64 ms on the
|
||||||
|
content comparison (`expected '<svg data-drill="1"…' to be '<svg xmlns=…'`), not on time. The drill ran on D:
|
||||||
|
and was reverted.
|
||||||
|
|
||||||
|
**Gate (D:, 2026-12-02):** lint 0, typecheck 0, lint:copy 0 problems; `pnpm test` 653 passed (schema 19, identity 5,
|
||||||
|
release 8, cpu-guard 13, storage 70, content 88, art-prep 80, tauri 99, ui 92, engine 179).
|
||||||
|
|
||||||
|
**Not verified:** the test's time on the hub runner with this change. The next release run measures it.
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
# Review — `fix/installer-name`
|
||||||
|
|
||||||
|
**What:** the Windows installer is published as `RoseaDomi_<version>_x64-setup.exe`, not
|
||||||
|
`Rosea Domi_<version>_x64-setup.exe`. Aula makes an installer public only when its name matches
|
||||||
|
`[A-Za-z0-9._-]+-setup.exe` (Aula docs/14_feed.md), which is also the form Atrium Domi expects. So v0.1.1's
|
||||||
|
installer never appeared on Aula, while its APK did (reported by Aula, 2026-12-02).
|
||||||
|
|
||||||
|
**How:** `tauri build` still names the file after `productName`. Then `scripts/installer-name.ts` renames it,
|
||||||
|
in the same `build:desktop` command, before the release's `desktop` step collects `*-setup.exe`. The names and the
|
||||||
|
pattern live in `src/installer-name.ts`, where the test can reach them without a build.
|
||||||
|
|
||||||
|
## Findings
|
||||||
|
|
||||||
|
1. **Why not change `productName`?** It is also the window title, the install folder and the uninstall
|
||||||
|
entry Atrium finds her by. A new `productName` would make the next installer a second app beside the
|
||||||
|
first, and a player who updates would have two roses. Only the file is renamed. *Not done:* the
|
||||||
|
installer's own wizard text still says "Rosea Domi", which is right.
|
||||||
|
2. **An older installer left in the folder.** The release step publishes every `*-setup.exe` in
|
||||||
|
`bundle/nsis/`. The rename deletes any other installer there (build output only) and fails unless exactly
|
||||||
|
one remains with an accepted name. Tested with an old Tauri-named file and an old renamed one beside the
|
||||||
|
new one.
|
||||||
|
3. **The signing steps** (`sign`, `minisign`, `publish`) match `**/*-setup.exe`, so they find the renamed
|
||||||
|
file. *Not verified until the v0.1.2 hub run.*
|
||||||
|
4. **Test honesty:** with the space put back (`${PRODUCT_NAME}` unchanged), 4 of the 7 new tests fail
|
||||||
|
(drill run on D:, then reverted). The `build:desktop` order is pinned by a test, and `domi-app.test.ts` was
|
||||||
|
loosened only to allow what follows `tauri build`.
|
||||||
|
5. **AULA.md** names the new file, so a player following the page finds it.
|
||||||
|
6. **Soul, privacy, reachability, offline:** nothing a player sees inside the game changed.
|
||||||
|
|
||||||
|
**Not verified:** a real `tauri build` here (it is the hub's step), and Aula showing the installer once v0.1.2
|
||||||
|
is published.
|
||||||
|
|
||||||
|
**Gate (D:, 2026-12-02):** lint 0, typecheck 0, lint:copy 0 problems; `pnpm test` 653 passed (schema 19, identity 5,
|
||||||
|
release 8, cpu-guard 13, storage 70, content 88, art-prep 80, tauri 99, ui 92, engine 179).
|
||||||
@@ -30,7 +30,7 @@ does not even ask for the permission to use the internet.
|
|||||||
|
|
||||||
## Installing
|
## Installing
|
||||||
|
|
||||||
- **Windows:** run `Rosea Domi_<version>_x64-setup.exe`. It installs for you alone, with no
|
- **Windows:** run `RoseaDomi_<version>_x64-setup.exe`. It installs for you alone, with no
|
||||||
administrator rights.
|
administrator rights.
|
||||||
- **Android:** install the `.apk` (Android 7 or newer). Your phone will ask you to allow installing
|
- **Android:** install the `.apk` (Android 7 or newer). Your phone will ask you to allow installing
|
||||||
apps from where you downloaded it.
|
apps from where you downloaded it.
|
||||||
|
|||||||
+20
-1
@@ -2,7 +2,26 @@
|
|||||||
|
|
||||||
Rewritten at the end of each session (CLAUDE.md §5.1).
|
Rewritten at the end of each session (CLAUDE.md §5.1).
|
||||||
|
|
||||||
## Latest — 2026-12-02: v0.1.1, the first release
|
## Latest — 2026-12-02: v0.1.3, the installer Aula can list
|
||||||
|
|
||||||
|
- **Published:** https://gitea.marek-novak.cz/mnovak/Rosea/releases/tag/v0.1.3, by the hub's run `r9v6601at1pc5` at
|
||||||
|
`56f266a`.
|
||||||
|
- Windows: **`RoseaDomi_0.1.3_x64-setup.exe`**, with no space. Aula lists only `[A-Za-z0-9._-]+-setup.exe`, so
|
||||||
|
v0.1.1's `Rosea Domi_…` never appeared there. `tauri build` still names it after `productName`, then
|
||||||
|
`scripts/installer-name.ts` renames it in the same `build:desktop` (PR #13). `productName` stays "Rosea Domi": it is
|
||||||
|
also the window title, the install folder and the uninstall entry.
|
||||||
|
- Android: `rosea-domi-0.1.3-arm64.apk`, signed with `rosea-domi-android`. Minisigs and SHA256SUMS signed with
|
||||||
|
`domi-release`; the notes and the Aula pictures are attached.
|
||||||
|
- Mark's card: code 053 785 for `minisign`. `approve`, `sign` and `apk` raised none.
|
||||||
|
- **v0.1.2 does not exist.** It was tagged on `666c78f`, and both of its runs (`r1ahwf1m23cdr`, `rm56nbzfchx5d`)
|
||||||
|
stopped at `test`: art-prep's placeholder comparison timed out at 5 s on the runner (8.7 s, then 5.4 s; 230 ms run
|
||||||
|
alone). That test now has 30 s (PR #14). Mark chose v0.1.3 and had the `v0.1.2` tag deleted, because `fabrica notes`
|
||||||
|
counts from the highest earlier tag and would otherwise have left PR #13 out of the notes. **Lesson:** a tag that
|
||||||
|
is never published should be deleted, or the next release's notes lose its changes. `v0.1.0` still has this
|
||||||
|
problem: v0.1.1's notes omit PRs #8 and #9.
|
||||||
|
- **Not verified:** the published files against SHA256SUMS (only the list was read), and Aula listing the installer.
|
||||||
|
|
||||||
|
## Earlier — 2026-12-02: v0.1.1, the first release
|
||||||
|
|
||||||
- **Published:** https://gitea.marek-novak.cz/mnovak/Rosea/releases/tag/v0.1.1, by the hub's release run `r59y647cfcpw9` at `18b6c81`.
|
- **Published:** https://gitea.marek-novak.cz/mnovak/Rosea/releases/tag/v0.1.1, by the hub's release run `r59y647cfcpw9` at `18b6c81`.
|
||||||
- Windows: `Rosea Domi_0.1.1_x64-setup.exe`, Authenticode with `domi-code-signing`.
|
- Windows: `Rosea Domi_0.1.1_x64-setup.exe`, Authenticode with `domi-code-signing`.
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
{
|
{
|
||||||
"name": "@rosea/tauri",
|
"name": "@rosea/tauri",
|
||||||
"version": "0.1.1",
|
"version": "0.1.3",
|
||||||
"private": true,
|
"private": true,
|
||||||
"license": "CPAL-1.0",
|
"license": "CPAL-1.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "The Tauri 2 shell: the Android, iOS and desktop apps around apps/rosea's built game (dist-tauri/). Imports no package.",
|
"description": "The Tauri 2 shell: the Android, iOS and desktop apps around apps/rosea's built game (dist-tauri/). Imports no package.",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "tsx scripts/icons.ts && tsx scripts/domi-app.ts && tauri dev",
|
"dev": "tsx scripts/icons.ts && tsx scripts/domi-app.ts && tauri dev",
|
||||||
"build:desktop": "tsx scripts/icons.ts && tsx scripts/domi-app.ts && tauri build",
|
"build:desktop": "tsx scripts/icons.ts && tsx scripts/domi-app.ts && tauri build && tsx scripts/installer-name.ts",
|
||||||
"build:android": "tsx scripts/android.ts prepare && tauri android build --debug --apk --target aarch64 && tsx scripts/android.ts verify",
|
"build:android": "tsx scripts/android.ts prepare && tauri android build --debug --apk --target aarch64 && tsx scripts/android.ts verify",
|
||||||
"build:android-release": "tsx scripts/android.ts prepare && tauri android build --apk --target aarch64 && tsx scripts/android.ts verify src-tauri/gen/android/app/build/outputs/apk/universal/release/app-universal-release-unsigned.apk",
|
"build:android-release": "tsx scripts/android.ts prepare && tauri android build --apk --target aarch64 && tsx scripts/android.ts verify src-tauri/gen/android/app/build/outputs/apk/universal/release/app-universal-release-unsigned.apk",
|
||||||
"sign:apk": "tsx scripts/sign-apk.ts",
|
"sign:apk": "tsx scripts/sign-apk.ts",
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
/**
|
||||||
|
* After `tauri build`: renames the NSIS installer to its published name (src/installer-name.ts), so
|
||||||
|
* the release step's `*-setup.exe` finds one file, and its name has no space.
|
||||||
|
*
|
||||||
|
* tsx scripts/installer-name.ts in src-tauri/target/release/bundle/nsis/
|
||||||
|
*/
|
||||||
|
import { existsSync, readdirSync, renameSync, rmSync } from 'node:fs';
|
||||||
|
import { join, resolve } from 'node:path';
|
||||||
|
import { fileURLToPath } from 'node:url';
|
||||||
|
import { INSTALLER_PATTERN, installerName, tauriInstallerName } from '../src/installer-name.js';
|
||||||
|
import { gameVersion } from './domi-app.js';
|
||||||
|
import { SRC_TAURI } from './tauri.js';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renames the version's installer in `dir` and removes any other installer there (an older build's,
|
||||||
|
* which the release's `*-setup.exe` would otherwise publish too). Returns the new path. Fails if the
|
||||||
|
* built file is missing, or if anything but the one accepted installer is left.
|
||||||
|
*/
|
||||||
|
export function renameInstaller(dir: string, version: string): string {
|
||||||
|
const from = join(dir, tauriInstallerName(version));
|
||||||
|
const name = installerName(version);
|
||||||
|
const to = join(dir, name);
|
||||||
|
if (!existsSync(from)) throw new Error(`no installer to rename: ${from}`);
|
||||||
|
for (const f of readdirSync(dir)) {
|
||||||
|
if (f.endsWith('-setup.exe') && f !== tauriInstallerName(version)) rmSync(join(dir, f));
|
||||||
|
}
|
||||||
|
renameSync(from, to);
|
||||||
|
const left = readdirSync(dir).filter((f) => f.endsWith('-setup.exe'));
|
||||||
|
if (left.length !== 1 || left[0] !== name || !INSTALLER_PATTERN.test(name)) {
|
||||||
|
throw new Error(`expected only ${name}, found: ${left.join(', ')}`);
|
||||||
|
}
|
||||||
|
return to;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (process.argv[1] && resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
|
||||||
|
const to = renameInstaller(join(SRC_TAURI, 'target', 'release', 'bundle', 'nsis'), gameVersion());
|
||||||
|
console.log(`installer: ${to}`);
|
||||||
|
}
|
||||||
Generated
+1
-1
@@ -2614,7 +2614,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rosea-shell"
|
name = "rosea-shell"
|
||||||
version = "0.1.1"
|
version = "0.1.3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"tauri",
|
"tauri",
|
||||||
"tauri-build",
|
"tauri-build",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "rosea-shell"
|
name = "rosea-shell"
|
||||||
version = "0.1.1"
|
version = "0.1.3"
|
||||||
license = "CPAL-1.0"
|
license = "CPAL-1.0"
|
||||||
description = "The Tauri 2 shell of Rosea Domi: a window around the built game, and nothing else."
|
description = "The Tauri 2 shell of Rosea Domi: a window around the built game, and nothing else."
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
/**
|
||||||
|
* The Windows installer's published file name. Tauri's NSIS bundler names it after `productName`
|
||||||
|
* (`Rosea Domi_<version>_x64-setup.exe`), and the space keeps it off Aula: Aula makes an installer
|
||||||
|
* public only when its name matches `[A-Za-z0-9._-]+-setup.exe` (Aula docs/14_feed.md), the
|
||||||
|
* `<Name>_<version>_x64-setup.exe` form Atrium Domi expects as well.
|
||||||
|
*
|
||||||
|
* Only the file is renamed after the build. `productName` stays "Rosea Domi": it is also the window
|
||||||
|
* title, the install folder and the uninstall entry Atrium finds her by, and changing it would make
|
||||||
|
* the next installer a second app beside the first.
|
||||||
|
*/
|
||||||
|
import { PRODUCT_NAME } from '../../../packages/schema/src/constants.js';
|
||||||
|
|
||||||
|
/** What Aula and Atrium accept as an installer's name. */
|
||||||
|
export const INSTALLER_PATTERN = /^[A-Za-z0-9._-]+-setup\.exe$/;
|
||||||
|
|
||||||
|
/** Tauri's own name for the installer of a version. */
|
||||||
|
export const tauriInstallerName = (version: string): string => `${PRODUCT_NAME}_${version}_x64-setup.exe`;
|
||||||
|
|
||||||
|
/** The published name: the product name without spaces, e.g. `RoseaDomi_0.1.2_x64-setup.exe`. */
|
||||||
|
export function installerName(version: string): string {
|
||||||
|
if (!/^\d+\.\d+\.\d+$/.test(version)) throw new Error(`not a version: ${version}`);
|
||||||
|
const name = `${PRODUCT_NAME.replace(/\s+/g, '')}_${version}_x64-setup.exe`;
|
||||||
|
if (!INSTALLER_PATTERN.test(name)) throw new Error(`the installer's name would not be accepted: ${name}`);
|
||||||
|
return name;
|
||||||
|
}
|
||||||
@@ -51,7 +51,7 @@ describe('domi-app.toml', () => {
|
|||||||
|
|
||||||
it('is made before every desktop build and never committed', () => {
|
it('is made before every desktop build and never committed', () => {
|
||||||
const pkg = JSON.parse(readFileSync(join(HERE, '..', 'package.json'), 'utf8')) as { scripts: Record<string, string> };
|
const pkg = JSON.parse(readFileSync(join(HERE, '..', 'package.json'), 'utf8')) as { scripts: Record<string, string> };
|
||||||
expect(pkg.scripts['build:desktop']).toMatch(/tsx scripts\/domi-app\.ts && tauri build$/);
|
expect(pkg.scripts['build:desktop']).toMatch(/tsx scripts\/domi-app\.ts && tauri build( |$)/);
|
||||||
expect(pkg.scripts['dev']).toContain('tsx scripts/domi-app.ts');
|
expect(pkg.scripts['dev']).toContain('tsx scripts/domi-app.ts');
|
||||||
const ignore = readFileSync(join(HERE, '..', '..', '..', '.gitignore'), 'utf8');
|
const ignore = readFileSync(join(HERE, '..', '..', '..', '.gitignore'), 'utf8');
|
||||||
expect(ignore).toContain('apps/rosea-tauri/src-tauri/atrium/');
|
expect(ignore).toContain('apps/rosea-tauri/src-tauri/atrium/');
|
||||||
|
|||||||
@@ -0,0 +1,63 @@
|
|||||||
|
import { mkdtempSync, readdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
|
||||||
|
import { tmpdir } from 'node:os';
|
||||||
|
import { dirname, join } from 'node:path';
|
||||||
|
import { fileURLToPath } from 'node:url';
|
||||||
|
import { afterEach, describe, expect, it } from 'vitest';
|
||||||
|
import { renameInstaller } from '../scripts/installer-name.js';
|
||||||
|
import { INSTALLER_PATTERN, installerName, tauriInstallerName } from '../src/installer-name.js';
|
||||||
|
|
||||||
|
describe('installerName', () => {
|
||||||
|
it('has no space, and matches what Aula and Atrium accept', () => {
|
||||||
|
expect(installerName('0.1.2')).toBe('RoseaDomi_0.1.2_x64-setup.exe');
|
||||||
|
expect(installerName('0.1.2')).toMatch(INSTALLER_PATTERN);
|
||||||
|
expect(installerName('12.0.31')).toMatch(INSTALLER_PATTERN);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("knows Tauri's own name has a space, which Aula refuses", () => {
|
||||||
|
expect(tauriInstallerName('0.1.2')).toBe('Rosea Domi_0.1.2_x64-setup.exe');
|
||||||
|
expect(tauriInstallerName('0.1.2')).not.toMatch(INSTALLER_PATTERN);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('refuses something that is not a version', () => {
|
||||||
|
expect(() => installerName('0.1')).toThrow(/not a version/);
|
||||||
|
expect(() => installerName('0.1.2 x')).toThrow(/not a version/);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('the desktop build', () => {
|
||||||
|
it('renames the installer right after tauri build, so the release never sees the name with a space', () => {
|
||||||
|
const pkg = JSON.parse(readFileSync(join(dirname(fileURLToPath(import.meta.url)), '..', 'package.json'), 'utf8')) as { scripts: Record<string, string> };
|
||||||
|
expect(pkg.scripts['build:desktop']).toMatch(/&& tauri build && tsx scripts\/installer-name\.ts$/);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('renameInstaller', () => {
|
||||||
|
let dir = '';
|
||||||
|
afterEach(() => {
|
||||||
|
if (dir) rmSync(dir, { recursive: true, force: true });
|
||||||
|
dir = '';
|
||||||
|
});
|
||||||
|
|
||||||
|
it("renames the built installer, and leaves only names Aula accepts", () => {
|
||||||
|
dir = mkdtempSync(join(tmpdir(), 'rosea-nsis-'));
|
||||||
|
writeFileSync(join(dir, 'Rosea Domi_0.1.2_x64-setup.exe'), 'exe');
|
||||||
|
const to = renameInstaller(dir, '0.1.2');
|
||||||
|
expect(to).toBe(join(dir, 'RoseaDomi_0.1.2_x64-setup.exe'));
|
||||||
|
expect(readdirSync(dir)).toEqual(['RoseaDomi_0.1.2_x64-setup.exe']);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('fails when the build left no installer', () => {
|
||||||
|
dir = mkdtempSync(join(tmpdir(), 'rosea-nsis-'));
|
||||||
|
expect(() => renameInstaller(dir, '0.1.2')).toThrow(/no installer to rename/);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("removes an older build's installers, so the release publishes only this one", () => {
|
||||||
|
dir = mkdtempSync(join(tmpdir(), 'rosea-nsis-'));
|
||||||
|
writeFileSync(join(dir, 'Rosea Domi_0.1.2_x64-setup.exe'), 'exe');
|
||||||
|
writeFileSync(join(dir, 'Rosea Domi_0.1.1_x64-setup.exe'), 'old');
|
||||||
|
writeFileSync(join(dir, 'RoseaDomi_0.1.1_x64-setup.exe'), 'old');
|
||||||
|
writeFileSync(join(dir, 'notes.txt'), 'kept');
|
||||||
|
renameInstaller(dir, '0.1.2');
|
||||||
|
expect(readdirSync(dir).sort()).toEqual(['RoseaDomi_0.1.2_x64-setup.exe', 'notes.txt']);
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@rosea/app",
|
"name": "@rosea/app",
|
||||||
"version": "0.1.1",
|
"version": "0.1.3",
|
||||||
"private": true,
|
"private": true,
|
||||||
"license": "CPAL-1.0",
|
"license": "CPAL-1.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
"name": "rosea",
|
"name": "rosea",
|
||||||
"private": true,
|
"private": true,
|
||||||
"license": "CPAL-1.0",
|
"license": "CPAL-1.0",
|
||||||
"version": "0.1.1",
|
"version": "0.1.3",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"packageManager": "pnpm@9.12.3",
|
"packageManager": "pnpm@9.12.3",
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|||||||
@@ -67,7 +67,8 @@ describe('the stand-ins', () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
it('art/placeholders/ holds exactly what the generator makes (run pnpm art:board after changing the manifest)', () => {
|
// 169 files read and compared one by one: 5.4 s and 8.7 s on the release runner, beside nine other suites.
|
||||||
|
it('art/placeholders/ holds exactly what the generator makes (run pnpm art:board after changing the manifest)', { timeout: 30_000 }, () => {
|
||||||
const dir = `${root}art/placeholders/`;
|
const dir = `${root}art/placeholders/`;
|
||||||
const files = readdirSync(dir).filter((f) => f.endsWith('.svg'));
|
const files = readdirSync(dir).filter((f) => f.endsWith('.svg'));
|
||||||
expect(files.map((f) => f.slice(0, -4)).sort()).toEqual([...stand.keys()].sort());
|
expect(files.map((f) => f.slice(0, -4)).sort()).toEqual([...stand.keys()].sort());
|
||||||
|
|||||||
Reference in New Issue
Block a user