Files
VoiceStudio/package.json
T
Palash DebnathandClaude Opus 5 8f9f778307 fix(scripts): desktop-prod:run wiped the data it was documented to preserve (#1333) (#1339)
* fix(scripts): desktop-prod:run wiped the data it was documented to preserve (#1333)

`scripts/desktop-prod.sh` emulates a first install, so wiping is its default: it
removes the app data dir, `~/.omnivoice` (the SQLite database, every voice
profile, all outputs), the Tauri logs and the WebKit profile. `--keep-data` is
the only thing that suppresses that block.

`--skip-build` is an independent flag that only skips the cargo compile, and
`desktop-prod:run` passed it alone — while the script's own header calls that
command "re-launch last build (skip compile)" and its closing banner tells you
to use it that way. So "just start it again without recompiling" silently
deleted the developer's voice profiles and project database, every time.

The fix is in the package scripts rather than the flag parsing: making
--skip-build imply --keep-data would remove a legitimate combination (fresh
data without paying for a recompile). The two stay independent, and the help
text now says so.

desktop-fresh:run is deliberately untouched — that script is a stricter
new-user emulation, so wiping is the point of its name.

Tests pin all three rules, and were confirmed fail-before by reverting the
desktop-prod:run line.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix(scripts): kill the live instance before every launch, not only before a wipe

Greptile P1 on this PR, and it was a regression I introduced.

The app registers tauri_plugin_single_instance, and that callback ignores the
incoming argv — it just refocuses the window the RUNNING process already owns.
So starting a second copy over a live one does nothing visible.

That was previously masked: kill_running_instances sat inside the
`KEEP_DATA = false` branch, so every run happened to kill first *because*
every run wiped. Adding --keep-data to the re-launch aliases removed the wipe
and would have taken the kill with it — `desktop-prod:run:pill` would have left
the user in studio mode with --pill silently discarded, and plain
`desktop-prod:run` would have refocused the OLD build instead of the one just
compiled, which is the entire point of that command.

The kill is now unconditional, before the wipe branch. Its two reasons are
independent — zombie-backend-after-wipe, and single-instance-swallows-argv —
and only the first was ever about wiping. Adjusted its closing line, which
said "safe to wipe" and now also runs when nothing is being wiped.

New test asserts the call is not nested inside the KEEP_DATA branch;
confirmed fail-before by moving it back.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix(scripts): scope the kill to this checkout, warn about an installed app

Making kill_running_instances unconditional (so --keep-data re-launches
still get past single-instance) widened the blast radius of its pgrep:
"OmniVoice Studio.app" also matches an installed /Applications copy, so
desktop-prod:run would kill the shipped app a developer was using and take
their unsaved work with it. That was previously masked — the kill only ran
on wipe runs, where a clean slate had been asked for explicitly.

Scope the pattern to ${TAURI_DIR}/target/debug/, which covers both launch
shapes and nothing else. An installed instance still gets named rather than
ignored: single-instance keys on the bundle id, so it swallows this launch
too, and silence would just trade one confusing failure for another.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-04 10:44:22 +05:30

47 lines
2.1 KiB
JSON

{
"name": "omnivoice-studio-monorepo",
"version": "1.0.0",
"license": "AGPL-3.0-only",
"private": true,
"packageManager": "bun@1.3.11",
"scripts": {
"setup:api": "uv sync && uv run python scripts/setup.py",
"dev:api": "bun scripts/dev-backend.mjs",
"dev:frontend": "bun run --cwd frontend dev",
"dev:desktop": "TAURI_SKIP_BACKEND=1 bun run --cwd frontend desktop",
"wait:api": "wait-on -t 300000 http-get://localhost:3900/system/info",
"wait:frontend": "wait-on -t 120000 http://localhost:5173",
"predev": "bun install && (kill-port 3900 3901 || true)",
"dev": "bun run setup:api && concurrently -n api,fe -c green,cyan --kill-others-on-fail \"bun run dev:api\" \"bun run dev:frontend\"",
"predesktop": "bun install && (kill-port 3900 3901 || true)",
"desktop": "bun run setup:api && concurrently -n api,app -c green,magenta --kill-others-on-fail \"bun run dev:api\" \"bun run dev:desktop\"",
"desktop-prod": "bun scripts/desktop-prod.mjs",
"desktop-prod:run": "bun scripts/desktop-prod.mjs --skip-build --keep-data",
"desktop-prod:upgrade": "bun scripts/desktop-prod.mjs --keep-data",
"desktop-prod:keep-models": "bun scripts/desktop-prod.mjs --keep-models",
"desktop-prod:pill": "bun scripts/desktop-prod.mjs --pill",
"desktop-prod:run:pill": "bun scripts/desktop-prod.mjs --skip-build --keep-data --pill",
"desktop-fresh": "bun scripts/desktop-fresh.mjs",
"desktop-fresh:run": "bun scripts/desktop-fresh.mjs --skip-build",
"build": "turbo run build",
"start": "turbo run start",
"test:frontend": "node --test tests/frontend/*.test.mjs",
"smoke-test": "bash scripts/smoke-test.sh",
"smoke-test:quick": "bash scripts/smoke-test.sh --skip-build --skip-model",
"smoke-test:upgrade": "bash scripts/smoke-test.sh --keep-data --skip-build",
"deps:check": "taze -r --maturity-period 7"
},
"workspaces": [
"frontend"
],
"devDependencies": {
"concurrently": "^9.2.1",
"kill-port-process": "^4.0.2",
"playwright": "^1.60.0",
"taze": "^19.14.1",
"turbo": "^2.9.18",
"typescript": "^6.0.3",
"wait-on": "^9.0.10"
}
}