Open History to see the last commit
1# Scripts
2
3- `bun run dev` — Starts contracts, server, and web in `turbo watch` mode.
4- `bun run dev:server` — Starts just the WebSocket server (uses Bun TypeScript execution).
5- `bun run dev:web` — Starts just the Vite dev server for the web app.
6- Dev commands default `V12_STATE_DIR` to `~/.v12/dev` to keep dev state isolated from desktop/prod state.
7- Override server CLI-equivalent flags from root dev commands with `--`, for example:
8 `bun run dev -- --base-dir ~/.v12-2`
9- `bun run start` — Runs the production server (serves built web app as static files).
10- `bun run build` — Builds contracts, web app, and server through Turbo.
11- `bun run typecheck` — Strict TypeScript checks for all packages.
12- `bun run test` — Runs workspace tests.
13- `bun run dist:desktop:artifact -- --platform <mac|linux|win> --target <target> --arch <arch>` — Builds a desktop artifact for a specific platform/target/arch.
14- `bun run dist:desktop:dmg` — Builds a shareable macOS `.dmg` into `./release`.
15- `bun run dist:desktop:dmg:x64` — Builds an Intel macOS `.dmg`.
16- `bun run dist:desktop:linux` — Builds a Linux AppImage into `./release`.
17- `bun run dist:desktop:win` — Builds a Windows NSIS installer into `./release`.
18
19## Desktop `.dmg` packaging notes
20
21- Default build is unsigned/not notarized for local sharing.
22- The DMG build uses `assets/macos-icon-1024.png` as the production app icon source.
23- Desktop production windows load the bundled UI from `v12://app/index.html` (not a `127.0.0.1` document URL).
24- Desktop packaging includes `apps/server/dist` (the `v12` backend) and starts it on loopback with an auth token for WebSocket/API traffic.
25- Your tester can still open it on macOS by right-clicking the app and choosing **Open** on first launch.
26- To keep staging files for debugging package contents, run: `bun run dist:desktop:dmg -- --keep-stage`
27- To allow code-signing/notarization when configured in CI/secrets, add: `--signed`.
28- Signed macOS builds also require `V12_APPLE_TEAM_ID` and
29 `V12_MACOS_PROVISIONING_PROFILE`. The passkey RP domain is derived from
30 `V12_CLERK_PUBLISHABLE_KEY` unless `V12_CLERK_PASSKEY_RP_DOMAINS` overrides it.
31- Windows `--signed` uses Azure Trusted Signing and expects:
32 `AZURE_TRUSTED_SIGNING_ENDPOINT`, `AZURE_TRUSTED_SIGNING_ACCOUNT_NAME`,
33 `AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE_NAME`, and `AZURE_TRUSTED_SIGNING_PUBLISHER_NAME`.
34- Azure authentication env vars are also required (for example service principal with secret):
35 `AZURE_TENANT_ID`, `AZURE_CLIENT_ID`, `AZURE_CLIENT_SECRET`.
36
37## Running multiple dev instances
38
39Set `V12_DEV_INSTANCE` to any value to deterministically shift all dev ports together.
40
41- Default ports: server `3773`, web `5733`
42- Shifted ports: `base + offset` (offset is hashed from `V12_DEV_INSTANCE`)
43- Example: `V12_DEV_INSTANCE=branch-a bun run dev:desktop`
44
45If you want full control instead of hashing, set `V12_PORT_OFFSET` to a numeric offset.