l-build-tauri
Build Tauri apps and install to /Applications/. Supports --all, --wrappers, --standalone, or individual apps (--doc, --keyword, --mercari, --zmdpreview, --preorder-prev, --preorder-prod, --addac, --im...
Build Tauri Apps
Build one or more Tauri apps and install to /Applications/.
Arguments
Parse $ARGUMENTS for flags. If no flags provided, default to --all (build every app).
Flags
| Flag | Description |
|---|---|
--all | Build all 10 apps |
--wrappers | Build all 6 wrapper apps |
--standalone | Build all 4 self-contained apps |
--doc | tauri-doc (zmoddoc.app) |
--keyword | tauri-keyword-viewer (zkeywordviewer.app) |
--mercari | tauri-mercari-viewer (zmercariviewer.app) |
--zmdpreview | tauri-zmdpreview (zmdpreview.app) |
--preorder-prev | tauri-zpreorder-prev (zpreorder-prev.app) |
--preorder-prod | tauri-zpreorder-prod (zpreorder-prod.app) |
--addac | addac-order (addac-order.app) |
--imgs | imgs-viewer (imgs-viewer.app) |
--image-stash | image-stash-viewer (image-stash-viewer.app) |
--photo-manager | photo-manager (Photo Manager.app) |
Multiple flags can be combined: --addac --imgs --doc
App Registry
Wrapper Apps (thin WebView wrappers around dev servers)
| Flag | Sub-package | Build Command | Bundle Path | App Name |
|---|---|---|---|---|
--doc | sub-packages/tauri-doc | pnpm build | target/release/bundle/macos/zmoddoc.app | zmoddoc |
--keyword | sub-packages/tauri-keyword-viewer | pnpm build | target/release/bundle/macos/zkeywordviewer.app | zkeywordviewer |
--mercari | sub-packages/tauri-mercari-viewer | pnpm build | target/release/bundle/macos/zmercariviewer.app | zmercariviewer |
--zmdpreview | sub-packages/tauri-zmdpreview | pnpm build | target/release/bundle/macos/zmdpreview.app | zmdpreview |
--preorder-prev | sub-packages/tauri-zpreorder-prev | pnpm build | target/release/bundle/macos/zpreorder-prev.app | zpreorder-prev |
--preorder-prod | sub-packages/tauri-zpreorder-prod | pnpm build | target/release/bundle/macos/zpreorder-prod.app | zpreorder-prod |
Self-Contained Apps (embedded Rust backend + Vite frontend)
| Flag | Sub-package | Build Command | Bundle Path | App Name |
|---|---|---|---|---|
--addac | sub-packages/addac-order | pnpm tauri:build | src-tauri/target/release/bundle/macos/addac-order.app | addac-order |
--imgs | sub-packages/imgs-viewer | pnpm tauri:build | src-tauri/target/release/bundle/macos/imgs-viewer.app | imgs-viewer |
--image-stash | sub-packages/image-stash-viewer | pnpm tauri:build | src-tauri/target/release/bundle/macos/image-stash-viewer.app | image-stash-viewer |
--photo-manager | sub-packages/photo-manager | pnpm tauri:build | src-tauri/target/release/bundle/macos/Photo Manager.app | Photo Manager (Cargo crate: photo-manager) |
Note on --photo-manager: the bundle dir, installed .app name, and binary inside Contents/MacOS/ all contain a literal space (Photo Manager). Quote every path that references it ("/Applications/Photo Manager.app", mv "src-tauri/.../Photo Manager.app" ...). For the cargo clean -p step use the Cargo crate name photo-manager (no space, hyphenated — from Cargo.toml’s [package].name), not the productName. For killall, use killall "Photo Manager" 2>/dev/null (quoted, with the space).
Build Procedure (per app)
Build apps sequentially (parallel builds compete for CPU/memory).
For each selected app:
Step 1: Clean Cargo cache (self-contained apps only)
Cargo can cache stale frontend assets even after Vite rebuilds. Always clean the crate before building self-contained apps:
cd <sub-package>/src-tauri && cargo clean -p <app-name> --release
This forces Cargo to re-link with the fresh dist/ assets. Skip this step for wrapper apps (they don’t embed frontend assets).
Step 2: Build
cd <sub-package> && <build-command>
beforeBuildCommandintauri.conf.jsonautomatically runspnpm build(Vite) for self-contained apps- Verify the build time is reasonable (~30s+ for self-contained, ~20s+ for wrappers). If it finishes in under 5s, Cargo likely skipped recompilation — the clean step above prevents this
Read stdout/stderr carefully. If the build fails, report the error and skip to the next app.
Step 2: Kill running instance, remove old, install fresh
CRITICAL: cp -rf does NOT reliably update macOS .app bundles. The binary inside Contents/MacOS/ can stay stale. Always move the old bundle away first.
killall <app-name> 2>/dev/null; sleep 1
mv /Applications/<app-name>.app /tmp/<app-name>-old-$$.app 2>/dev/null
cp -R <sub-package>/<bundle-path> /Applications/<app-name>.app
Step 3: Verify binary timestamp
stat -f "%Sm" /Applications/<app-name>.app/Contents/MacOS/*
Confirm the timestamp is from just now (within the last few minutes).
Step 4: Clean up build artifacts
# Wrapper apps
rm -rf ./<sub-package>/target/release/bundle/
# Self-contained apps
rm -rf ./<sub-package>/src-tauri/target/release/bundle/
Step 5: Report
Report the app name, install path, and binary timestamp. Move to the next app.
After All Builds
Print a summary table:
| App | Status | Timestamp |
|---|---|---|
| zmoddoc | OK | Apr 11 15:30 2026 |
| … | … | … |
Include any failures with error details.