feat(cli): add detailed non-prod build environment check for Convex deploy (#28)
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()inenvvars.tsto return a descriptive message instead of a boolean. - Enhanced
deploy.tsto 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.
Fixed Prettier formatting and verified build locally. Ready for workflow approval.
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.
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!