From e6fa32bbe5b0c1acd8462a433f2066216143e0d8 Mon Sep 17 00:00:00 2001 From: "anthropic-code-agent[bot]" <242468646+Claude@users.noreply.github.com> Date: Thu, 16 Apr 2026 08:32:17 +0000 Subject: [PATCH 1/2] feat: deploy studio to /_studio path in Vercel Agent-Logs-Url: https://github.com/objectstack-ai/framework/sessions/c3e7d4a1-2f6f-49da-9c2b-064f55111697 Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com> --- apps/server/scripts/build-vercel.sh | 14 +++++++------- apps/server/vercel.json | 8 +++++--- apps/studio/vite.config.ts | 2 +- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/apps/server/scripts/build-vercel.sh b/apps/server/scripts/build-vercel.sh index 64754b48d..476980d73 100755 --- a/apps/server/scripts/build-vercel.sh +++ b/apps/server/scripts/build-vercel.sh @@ -13,7 +13,7 @@ set -euo pipefail # Steps: # 1. Build the project with turbo (includes studio) # 2. Bundle the API serverless function (→ api/_handler.js) -# 3. Copy studio dist files to public/ for UI serving +# 3. Copy studio dist files to public/_studio/ for UI serving at /_studio path # 4. Install external deps in api/node_modules/ (resolve pnpm symlinks) echo "[build-vercel] Starting server build..." @@ -27,13 +27,13 @@ cd apps/server # 2. Bundle API serverless function node scripts/bundle-api.mjs -# 3. Copy studio dist files to public/ for UI serving -echo "[build-vercel] Copying studio dist to public/..." +# 3. Copy studio dist files to public/_studio/ for UI serving at /_studio path +echo "[build-vercel] Copying studio dist to public/_studio/..." rm -rf public -mkdir -p public +mkdir -p public/_studio if [ -d "../studio/dist" ]; then - cp -r ../studio/dist/* public/ - echo "[build-vercel] ✓ Copied studio dist to public/" + cp -r ../studio/dist/* public/_studio/ + echo "[build-vercel] ✓ Copied studio dist to public/_studio/" else echo "[build-vercel] ⚠ Studio dist not found (skipped)" fi @@ -60,4 +60,4 @@ rm package.json cd .. echo "[build-vercel] ✓ External dependencies installed in api/node_modules/" -echo "[build-vercel] Done. Static files in public/, serverless function in api/[[...route]].js → api/_handler.js" +echo "[build-vercel] Done. Static files in public/_studio/, serverless function in api/[[...route]].js → api/_handler.js" diff --git a/apps/server/vercel.json b/apps/server/vercel.json index 84811d0b0..583b078de 100644 --- a/apps/server/vercel.json +++ b/apps/server/vercel.json @@ -6,7 +6,8 @@ "build": { "env": { "VITE_RUNTIME_MODE": "server", - "VITE_SERVER_URL": "" + "VITE_SERVER_URL": "", + "VERCEL": "true" } }, "functions": { @@ -17,7 +18,7 @@ }, "headers": [ { - "source": "/assets/(.*)", + "source": "/_studio/assets/(.*)", "headers": [ { "key": "Cache-Control", "value": "public, max-age=31536000, immutable" } ] @@ -25,6 +26,7 @@ ], "rewrites": [ { "source": "/api/:path*", "destination": "/api/[[...route]]" }, - { "source": "/((?!api/).*)", "destination": "/index.html" } + { "source": "/_studio/(.*)", "destination": "/_studio/$1" }, + { "source": "/_studio", "destination": "/_studio/index.html" } ] } diff --git a/apps/studio/vite.config.ts b/apps/studio/vite.config.ts index 319bb8117..98ca625e9 100644 --- a/apps/studio/vite.config.ts +++ b/apps/studio/vite.config.ts @@ -9,7 +9,7 @@ const hmrConfig = process.env.VITE_HMR_PORT // https://vitejs.dev/config/ export default defineConfig({ - base: process.env.VITE_BASE || './', // Relative base for sub-path mounting (e.g. /_studio/) + base: process.env.VITE_BASE || (process.env.VERCEL ? '/_studio/' : './'), // Use /_studio/ for Vercel, relative base for other sub-path mounting resolve: { dedupe: ['react', 'react-dom'], alias: { From eca74a0c5da54e10deb91daa37db3e251c2e7944 Mon Sep 17 00:00:00 2001 From: "anthropic-code-agent[bot]" <242468646+Claude@users.noreply.github.com> Date: Thu, 16 Apr 2026 08:40:14 +0000 Subject: [PATCH 2/2] feat: add root redirect to /_studio Agent-Logs-Url: https://github.com/objectstack-ai/framework/sessions/654bbb65-8c26-44b9-9053-6cc317b8aceb Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com> --- apps/server/vercel.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/server/vercel.json b/apps/server/vercel.json index 583b078de..8a3a9b245 100644 --- a/apps/server/vercel.json +++ b/apps/server/vercel.json @@ -24,6 +24,9 @@ ] } ], + "redirects": [ + { "source": "/", "destination": "/_studio", "permanent": false } + ], "rewrites": [ { "source": "/api/:path*", "destination": "/api/[[...route]]" }, { "source": "/_studio/(.*)", "destination": "/_studio/$1" },