feat(builder): add Vercel as a deploy provider#905
feat(builder): add Vercel as a deploy provider#905HiMarioLopez wants to merge 1 commit intoTanStack:mainfrom
Conversation
👷 Deploy request for tanstack pending review.Visit the deploys page to approve it
|
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughThis PR adds Vercel as a deployment provider: extends provider types, adds PROVIDER_INFO for Vercel, wires provider resolution, adds Vercel project scaffolding (devDependency, vercel.json rewrite, build script, Vite Nitro plugin), and adds a "Deploy to Vercel" UI button. ChangesVercel Deployment Provider
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/utils/provider-config.server.ts (1)
117-134: ⚡ Quick winConsolidate duplicated Nitro-provider logic to reduce drift risk.
getVercelConfigand the VercelupdateViteConfigbranch currently duplicate Railway behavior; extracting a shared Nitro helper would make future edits safer.♻️ Suggested refactor sketch
+function isNitroProvider(provider: DeployProvider): boolean { + return provider === 'railway' || provider === 'vercel' +} + +function getNitroConfig(): ProviderConfigResult { + return { + files: {}, + devDependencies: { + nitro: 'npm:nitro-nightly@latest', + }, + } +} + function getRailwayConfig(): ProviderConfigResult { - return { - files: {}, - devDependencies: { - nitro: 'npm:nitro-nightly@latest', - }, - } + return getNitroConfig() } function getVercelConfig(): ProviderConfigResult { - return { - files: {}, - devDependencies: { - nitro: 'npm:nitro-nightly@latest', - }, - } + return getNitroConfig() }- case 'railway': { - // Add nitro import if not present - if (!result.includes('nitro/vite')) { - const lastImportIndex = findLastImportIndex(result) - const importStatement = `import { nitro } from 'nitro/vite'\n` - result = - result.slice(0, lastImportIndex) + - importStatement + - result.slice(lastImportIndex) - } - - // Add nitro() to plugins array - result = addPluginToConfig(result, 'nitro()') - break - } - - case 'vercel': { + case 'railway': + case 'vercel': { // Add nitro import if not present if (!result.includes('nitro/vite')) { const lastImportIndex = findLastImportIndex(result) const importStatement = `import { nitro } from 'nitro/vite'\n` result =Also applies to: 409-423
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/utils/provider-config.server.ts` around lines 117 - 134, getVercelConfig duplicates Nitro/provider setup that's also implemented in the Vercel branch of updateViteConfig (and the Railway logic); extract the common Nitro provider logic into a shared helper (e.g., createNitroProviderConfig or applyNitroViteConfig) and have getVercelConfig, the Vercel branch in updateViteConfig, and the Railway branch call that helper instead of repeating the nitro devDependencies/files setup; update function names referenced: getVercelConfig and updateViteConfig to use the new helper and remove the duplicated nitro-specific lines.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/utils/provider-config.server.ts`:
- Around line 117-134: getVercelConfig duplicates Nitro/provider setup that's
also implemented in the Vercel branch of updateViteConfig (and the Railway
logic); extract the common Nitro provider logic into a shared helper (e.g.,
createNitroProviderConfig or applyNitroViteConfig) and have getVercelConfig, the
Vercel branch in updateViteConfig, and the Railway branch call that helper
instead of repeating the nitro devDependencies/files setup; update function
names referenced: getVercelConfig and updateViteConfig to use the new helper and
remove the duplicated nitro-specific lines.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 0c2322c6-5433-4440-a5e6-ff49628638b5
📒 Files selected for processing (4)
src/components/ApplicationStarter.tsxsrc/components/application-builder/shared.tssrc/components/deploy/shared.tssrc/utils/provider-config.server.ts
c4ba489 to
9ce36dc
Compare
TanStack Start has first-party support on Vercel via the Nitro Vite plugin, so add Vercel alongside Cloudflare, Netlify, and Railway in the builder's deploy actions. Mirrors the Railway/Nitro path with one deviation: pins the nitro dep to the stable 'latest' tag (currently a beta) instead of nitro-nightly, because today's nightly hits a 508 INFINITE_LOOP_DETECTED on every request when deployed to Vercel. Verified end-to-end with a real TanStack Start app deployed via this exact config. Refs: https://vercel.com/docs/frameworks/full-stack/tanstack-start
9ce36dc to
26a586d
Compare
Adds Vercel to the builder's deploy actions, alongside Cloudflare, Netlify, and Railway. TanStack Start has first-party support on Vercel via the Nitro Vite plugin.
Changes
DeployProvider/StarterDeployProviderunions andPROVIDER_INFO(deploy URL:vercel.com/new/clone?repository-url=...)provider-config.server.tsmirrors the Railway/Nitro path, with one deviation: pinsnitrotolatest(stable beta) instead ofnitro-nightly. Today's nightly hits a 508 INFINITE_LOOP_DETECTED on Vercel; the stable beta works.Verified
Deployed a real TanStack Start app via this exact config — build succeeded, served HTTP 200. The
vercel.com/new/cloneURL renders the expected import page.Summary by CodeRabbit