Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(dev): Make t3 code dev instances shareable over Tailscale #4556

Mergedt3dotgg(GitHub profile, opens in a new tab)merged 24 commits intomain fromrefs/pull/4556/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

Showing 29 changed files with 25 additions and 2 deletions (loading 25).

x
0 of 29 viewed, 29 left
5 additions and 1 deletion.agents/skills/test-t3-app/SKILL.mdModified
View file
@@ -13,13 +13,17 @@
2. Choose a base directory that belongs only to the current worktree or test:
- Use the repository's ignored `.t3` directory for reusable worktree-local state.
- Use `mktemp -d /tmp/t3code-test.XXXXXX` for disposable state and retain the printed absolute path.
-3. Start the full web stack with `vp run dev`. In a linked worktree it defaults to that worktree's gitignored `.t3`; pass `--home-dir <base-dir>` only when the test needs a different isolated directory.
+3. Start the full web stack with `vp run dev`. Add `--share` when the user needs to open it from another tailnet device. In a linked worktree it defaults to that worktree's gitignored `.t3`; pass `--home-dir <base-dir>` only when the test needs a different isolated directory.
4. Keep the terminal session alive and read the selected server port, web port, base directory, and pairing URL from its output.
​
Treat a base directory as disposable only when it was created or deliberately selected for the current test. Never delete or directly seed the shared `~/.t3` directory. Prefer starting with a new temporary base directory over clearing state of uncertain ownership.
​
The worktree-local default deliberately outranks an ambient `T3CODE_HOME`; do not pass the shared home through to a worktree dev server.
​
+Ports are derived from the worktree path but can shift when occupied. Always read the actual values from the `[dev-runner]` line.
+​
+Shared browser dev is single-origin: Vite proxies the backend paths, so never set `VITE_HTTP_URL` or `VITE_WS_URL` for `dev`/`dev:web`.
+​
The dev runner disables browser auto-open by default. Do not pass `--browser` during automated testing: an automatically opened page can consume the one-time bootstrap token before the controlled browser uses it.
​
## Preserve the environment while iterating
15 additions and 1 deletionapps/server/src/auth/EnvironmentAuth.test.tsModified
View file
@@ -8,9 +8,13 @@
import { SqlitePersistenceMemory } from "../persistence/Layers/Sqlite.ts";
import * as PairingGrantStore from "./PairingGrantStore.ts";
import * as EnvironmentAuth from "./EnvironmentAuth.ts";
+import { resolveSessionCookieName } from "./utils.ts";
​
import * as ServerSecretStore from "./ServerSecretStore.ts";