Skip to content
Source
Sign inSign up
pingdotgg/t3code

Add deterministic dev port runner for multi-instance local workflows #20

Mergedjuliusmarmingemerged 1 commit intomain fromcodething/6df7db48merged by juliusmarminge View on GitHub

Showing 5 changed files with 138 additions and 1 deletion (loading 2).

x
0 of 5 viewed, 5 left
1 addition and 1 deletionapps/server/package.jsonModified
View file
@@ -10,7 +10,7 @@
"type": "module",
"main": "./dist/index.mjs",
"scripts": {
- "dev": "VITE_DEV_SERVER_URL=http://localhost:5173 bun run src/index.ts",
+ "dev": "VITE_DEV_SERVER_URL=${VITE_DEV_SERVER_URL:-http://localhost:5173} bun run src/index.ts",
"build": "tsdown && node scripts/bundle-client.mjs",
"start": "node dist/index.mjs",
"typecheck": "tsc --noEmit",
124 additions and 0 deletionsscripts/dev-runner.mjsAdded
View file
@@ -0,0 +1,124 @@
+import { spawn } from "node:child_process";
+​
+const BASE_SERVER_PORT = 3773;
+const BASE_WEB_PORT = 5173;
+const MAX_HASH_OFFSET = 3000;
+const MODE_ARGS = {
+ dev: [
+ "run",
+ "dev",
+ "--ui=tui",
+ "--filter=@t3tools/contracts",
+ "--filter=@t3tools/web",
+ "--filter=t3",
+ "--parallel",
+ ],
+ "dev:server": ["run", "dev", "--filter=t3"],
+ "dev:web": ["run", "dev", "--filter=@t3tools/web"],