fix(standalone): selectively enable vercel speed insights, add annotations for envvars#808
fix(standalone): selectively enable vercel speed insights, add annotations for envvars#808waleedlatif1 merged 5 commits intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
There was a problem hiding this comment.
Greptile Summary
This PR makes the SimStudio application more suitable for standalone deployments by addressing two key issues. First, it adds comprehensive inline documentation to all environment variables in apps/sim/lib/env.ts, transforming an undocumented configuration file into a well-organized reference. The variables are now grouped logically (Core Database & Authentication, Payment & Billing, AI/LLM Provider API Keys, etc.) with clear descriptions of their purpose and usage. This significantly improves the developer experience when setting up the application in different environments.
Second, the PR fixes issues with Vercel-specific analytics components by making them conditional in apps/sim/app/layout.tsx. A new shouldEnableAnalytics() function checks whether the application is running in a Docker build or outside of Vercel's infrastructure (VERCEL_ENV not set) and disables the SpeedInsights and Analytics components accordingly. This prevents errors and unnecessary network requests when deploying the application in non-Vercel environments.
The changes also include a minor refactoring of the getEnv function, removing its explicit return type annotation while maintaining the same functionality, and adding a biome-ignore comment to preserve the aligned formatting structure in the environment configuration.
Confidence score: 5/5
- This PR is very safe to merge and addresses legitimate deployment issues without breaking existing functionality.
- The changes are well-structured documentation improvements and defensive programming practices that prevent runtime errors in different deployment environments.
- All modified files (
apps/sim/lib/env.tsandapps/sim/app/layout.tsx) contain straightforward, low-risk changes that improve maintainability and deployment flexibility.
2 files reviewed, no comments
…tions for envvars (simstudioai#808) * add annotations for environment variables * selectively enable vercel speed insights * use DOCKER_BUILD flag to selectively disable vercel speed insights and analytics * lint * additional info --------- Co-authored-by: waleedlatif <waleedlatif@waleedlatifs-MacBook-Pro.local>
Description
Type of change
How Has This Been Tested?
N/A
Checklist:
bun run test)Security Considerations: