convex-backend icon indicating copy to clipboard operation
convex-backend copied to clipboard

feat(cli): add detailed non-prod build environment check for Convex deploy (#28)

Open Aman1506-web opened this issue 1 month ago • 3 comments

Summary

Improved the isNonProdBuildEnvironment function and the related check inside deploy.ts to provide clearer and more specific messages when a non-production environment is detected.

Changes

  • Updated isNonProdBuildEnvironment() in envvars.ts to return a descriptive message instead of a boolean.
  • Enhanced deploy.ts to display that message when the CLI detects a non-production environment during deployment.
  • Now users can see exactly which environment variable caused the warning.

Example Output

Detected VERCEL because the VERCEL env var is set, but VERCEL_ENV is "preview" instead of "production".

Detected a non-production build environment and "CONVEX_DEPLOY_KEY" for a production Convex deployment. This is probably unintentional.

Closes

Fixes #28

Testing

Verified locally by simulating:

VERCEL=true VERCEL_ENV=preview node dist/cjs/cli/lib/envvars.js
NETLIFY=true CONTEXT=dev node dist/cjs/cli/lib/envvars.js
Confirmed correct descriptive messages for both environments.

Thanks for maintaining this great project!
Excited to contribute to improving developer experience.

Aman1506-web avatar Nov 02 '25 09:11 Aman1506-web

Fixed Prettier formatting and verified build locally. Ready for workflow approval.

Aman1506-web avatar Nov 03 '25 06:11 Aman1506-web

Hi @nipunn1313 @thomasballinger
Just following up after a week — this PR adds clearer CLI messages for non-production build detection and has been verified locally.
Would love your feedback whenever you get a chance.

Aman1506-web avatar Nov 10 '25 17:11 Aman1506-web

Hi! Thanks for the contribution. We're a little busy over here, so can't promise to get to it in a timely manner. We'll take a look when we get a chance!

nipunn1313 avatar Nov 14 '25 00:11 nipunn1313