Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

scripts.md

47 lines3.5 KB

1# Scripts
2​
3- `vp run dev` — Starts contracts, server, and web in watch mode.
4- `vp run dev:server` — Starts just the WebSocket server. The server process runs on Bun (`@effect/platform-bun` + `BunPtyAdapter`), but task running uses `vp run`.
5- `vp run dev:web` — Starts just the Vite dev server for the web app.
6- Dev commands implicitly use `~/.t3/dev`, keeping development state separate from `~/.t3/userdata`. An explicit `--home-dir <path>` stores state under `<path>/userdata`; the base directory remains available for caches, worktrees, and other shared data.
7- Web dev commands do not auto-open a browser. Open the one-time pairing URL printed by the server so the first browser navigation is authenticated. Set `T3CODE_NO_BROWSER=0` only when interactive auto-open is intentional.
8- Pass dev-runner flags directly after the root task name, for example:
9 `vp run dev --home-dir /tmp/t3code-dev`
10- `vp run start` — Runs the production server (serves built web app as static files).
11- `vp run build` — Builds contracts, web app, and server.
12- `vp run typecheck` — Strict TypeScript checks for all packages.
13- `vp run test` — Runs workspace tests.
14- `node apps/server/scripts/t3-sqlite-state.ts <query|exec> --base-dir <path> ...` — Inspects or seeds an isolated T3 SQLite database; writes create a private backup first.
15- `vp run dist:desktop:artifact -- --platform <mac|linux|win> --target <target> --arch <arch>` — Builds a desktop artifact for a specific platform/target/arch.
16- `vp run dist:desktop:dmg` — Builds a shareable macOS `.dmg` into `./release`.
17- `vp run dist:desktop:dmg:x64` — Builds an Intel macOS `.dmg`.
18- `vp run dist:desktop:linux` — Builds a Linux AppImage into `./release`.
19- `vp run dist:desktop:win` — Builds a Windows NSIS installer into `./release`.
20​
21## Desktop `.dmg` packaging notes
22​
23- Default build is unsigned/not notarized for local sharing.
24- The DMG build uses `assets/prod/black-macos-1024.png` as the production app icon source.
25- Desktop production windows load the bundled UI from `t3code://app/index.html` (not a `127.0.0.1` document URL).
26- Desktop packaging includes `apps/server/dist` (the `t3` backend) and starts it on loopback with an auth token for WebSocket/API traffic.
27- Your tester can still open it on macOS by right-clicking the app and choosing **Open** on first launch.
28- To keep staging files for debugging package contents, run: `vp run dist:desktop:dmg -- --keep-stage`
29- To allow code-signing/notarization when configured in CI/secrets, add: `--signed`.
30- Signed macOS builds also require `T3CODE_APPLE_TEAM_ID` and
31 `T3CODE_MACOS_PROVISIONING_PROFILE`. The passkey RP domain is derived from
32 `T3CODE_CLERK_PUBLISHABLE_KEY` unless `T3CODE_CLERK_PASSKEY_RP_DOMAINS` overrides it.
33- Windows `--signed` uses Azure Trusted Signing and expects:
34 `AZURE_TRUSTED_SIGNING_ENDPOINT`, `AZURE_TRUSTED_SIGNING_ACCOUNT_NAME`,
35 `AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE_NAME`, and `AZURE_TRUSTED_SIGNING_PUBLISHER_NAME`.
36- Azure authentication env vars are also required (for example service principal with secret):
37 `AZURE_TENANT_ID`, `AZURE_CLIENT_ID`, `AZURE_CLIENT_SECRET`.
38​
39## Running multiple dev instances
40​
41Set `T3CODE_DEV_INSTANCE` to any value to deterministically shift all dev ports together.
42​
43- Default ports: server `13773`, web `5733`
44- Shifted ports: `base + offset` (offset is hashed from `T3CODE_DEV_INSTANCE`)
45- Example: `T3CODE_DEV_INSTANCE=branch-a vp run dev:desktop`
46​
47If you want full control instead of hashing, set `T3CODE_PORT_OFFSET` to a numeric offset.