[PR #374] [MERGED] feat: vercel build script #921

Closed
opened 2026-02-26 19:31:03 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/documenso/documenso/pull/374
Author: @dguyen
Created: 9/14/2023
Status: Merged
Merged: 9/19/2023
Merged by: @Mythie

Base: feat/refreshHead: feat/vercel-build-script


📝 Commits (2)

  • 1be0b9e feat: add vercel build script
  • b411db4 chore: tidy unused code

📊 Changes

23 files changed (+389 additions, -51 deletions)

View changed files

📝 .env.example (+2 -2)
📝 .eslintignore (+1 -0)
📝 apps/marketing/process-env.d.ts (+2 -1)
📝 apps/marketing/src/app/(marketing)/claimed/page.tsx (+1 -1)
📝 apps/marketing/src/app/layout.tsx (+2 -2)
📝 apps/marketing/src/pages/api/claim-plan/index.ts (+3 -3)
📝 apps/web/process-env.d.ts (+2 -1)
📝 apps/web/src/app/(dashboard)/settings/billing/page.tsx (+1 -1)
📝 apps/web/src/app/layout.tsx (+2 -2)
📝 apps/web/src/helpers/get-feature-flag.ts (+2 -2)
📝 apps/web/src/pages/api/claim-plan/index.ts (+3 -3)
assets/example.pdf (+0 -0)
📝 package-lock.json (+20 -16)
📝 packages/lib/server-only/document/send-document.tsx (+2 -2)
📝 packages/lib/universal/get-base-url.ts (+2 -2)
packages/prisma/helper.ts (+52 -0)
📝 packages/prisma/index.ts (+8 -2)
📝 packages/prisma/package.json (+11 -3)
packages/prisma/seed-database.ts (+82 -0)
📝 packages/tsconfig/process-env.d.ts (+16 -1)

...and 3 more files

📄 Description

Changes:

  • Added a build script for Vercel preview deployments.
  • Removed NEXT_PUBLIC_SITE_URL environment variable
  • Refactored NEXT_PUBLIC_APP_URL to NEXT_PUBLIC_WEBAPP_URL
  • Added NEXT_PUBLIC_MARKETING_URL environment variable

Vercel build script

The objective of this script is to dynamically merge Vercel environment variables into the shared environment variables.

In this case:

  • NEXT_PUBLIC_WEBAPP_URL will be mapped to the Vercel preview URL
  • NEXT_PUBLIC_MARKETING_URL will be mapped to the Vercel preview URL

In addition we will also map the Supabase database environment variables if available, which should assist with integrating database branching in the near future.

Created a temporary Vercel project to demo:

Summary by CodeRabbit

Release Notes

  • New Feature: Introduced new environment variables NEXT_PUBLIC_WEBAPP_URL and NEXT_PUBLIC_MARKETING_URL to better manage different parts of the application.
  • Refactor: Updated all instances of NEXT_PUBLIC_SITE_URL and NEXT_PUBLIC_APP_URL in the codebase to use the new environment variables for more accurate URL management.
  • New Feature: Added a function getDatabaseUrl to dynamically generate the database URL based on various environment variables, improving flexibility and configuration options.
  • Chore: Implemented a new build script for different components of the web application based on the deployment target, enhancing the deployment process.
  • New Feature: Added a database seeding script to populate the database with example data, facilitating testing and development.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/documenso/documenso/pull/374 **Author:** [@dguyen](https://github.com/dguyen) **Created:** 9/14/2023 **Status:** ✅ Merged **Merged:** 9/19/2023 **Merged by:** [@Mythie](https://github.com/Mythie) **Base:** `feat/refresh` ← **Head:** `feat/vercel-build-script` --- ### 📝 Commits (2) - [`1be0b9e`](https://github.com/documenso/documenso/commit/1be0b9e01fc1e0703228bc1431488aa409afedec) feat: add vercel build script - [`b411db4`](https://github.com/documenso/documenso/commit/b411db40dac3311958f741f5cbd0a2c2b435c468) chore: tidy unused code ### 📊 Changes **23 files changed** (+389 additions, -51 deletions) <details> <summary>View changed files</summary> 📝 `.env.example` (+2 -2) 📝 `.eslintignore` (+1 -0) 📝 `apps/marketing/process-env.d.ts` (+2 -1) 📝 `apps/marketing/src/app/(marketing)/claimed/page.tsx` (+1 -1) 📝 `apps/marketing/src/app/layout.tsx` (+2 -2) 📝 `apps/marketing/src/pages/api/claim-plan/index.ts` (+3 -3) 📝 `apps/web/process-env.d.ts` (+2 -1) 📝 `apps/web/src/app/(dashboard)/settings/billing/page.tsx` (+1 -1) 📝 `apps/web/src/app/layout.tsx` (+2 -2) 📝 `apps/web/src/helpers/get-feature-flag.ts` (+2 -2) 📝 `apps/web/src/pages/api/claim-plan/index.ts` (+3 -3) ➕ `assets/example.pdf` (+0 -0) 📝 `package-lock.json` (+20 -16) 📝 `packages/lib/server-only/document/send-document.tsx` (+2 -2) 📝 `packages/lib/universal/get-base-url.ts` (+2 -2) ➕ `packages/prisma/helper.ts` (+52 -0) 📝 `packages/prisma/index.ts` (+8 -2) 📝 `packages/prisma/package.json` (+11 -3) ➕ `packages/prisma/seed-database.ts` (+82 -0) 📝 `packages/tsconfig/process-env.d.ts` (+16 -1) _...and 3 more files_ </details> ### 📄 Description **Changes:** - Added a build script for Vercel preview deployments. - Removed `NEXT_PUBLIC_SITE_URL` environment variable - Refactored `NEXT_PUBLIC_APP_URL` to `NEXT_PUBLIC_WEBAPP_URL` - Added `NEXT_PUBLIC_MARKETING_URL` environment variable **Vercel build script** The objective of this script is to dynamically merge Vercel environment variables into the shared environment variables. In this case: - `NEXT_PUBLIC_WEBAPP_URL` will be mapped to the Vercel preview URL - `NEXT_PUBLIC_MARKETING_URL` will be mapped to the Vercel preview URL In addition we will also map the Supabase database environment variables if available, which should assist with integrating database branching in the near future. Created a temporary Vercel project to demo: - https://vercel.com/documenso/temp-test-david/settings/general <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ### Summary by CodeRabbit **Release Notes** - New Feature: Introduced new environment variables `NEXT_PUBLIC_WEBAPP_URL` and `NEXT_PUBLIC_MARKETING_URL` to better manage different parts of the application. - Refactor: Updated all instances of `NEXT_PUBLIC_SITE_URL` and `NEXT_PUBLIC_APP_URL` in the codebase to use the new environment variables for more accurate URL management. - New Feature: Added a function `getDatabaseUrl` to dynamically generate the database URL based on various environment variables, improving flexibility and configuration options. - Chore: Implemented a new build script for different components of the web application based on the deployment target, enhancing the deployment process. - New Feature: Added a database seeding script to populate the database with example data, facilitating testing and development. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 19:31:03 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/documenso#921
No description provided.