Skip to content

Conversation

@Aman1506-web
Copy link

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

isNonProdBuildEnvironment check should print more precise info

1 participant