mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #49] [MERGED] feat(deploy): add --env support with security and parsing improvements #269
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#269
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/cloudflare/vinext/pull/49
Author: @southpolesteve
Created: 2/25/2026
Status: ✅ Merged
Merged: 2/25/2026
Merged by: @southpolesteve
Base:
main← Head:feat/deploy-env-improved📝 Commits (2)
9c5d53cfeat(deploy): add --env support for wrangler deploy2971da2fix(deploy): use execFileSync and util.parseArgs for --env support📊 Changes
4 files changed (+180 additions, -56 deletions)
View changed files
📝
README.md(+4 -1)📝
packages/vinext/src/cli.ts(+14 -47)📝
packages/vinext/src/deploy.ts(+66 -8)📝
tests/deploy.test.ts(+96 -0)📄 Description
Summary
Adds
--env <name>flag tovinext deployfor targeting wrangler environments (addresses #33). Builds on #44 by @liuxiaopai-ai — their commit is preserved as the first commit to retain authorship credit.This PR layers three improvements on top of the original:
execSync(shell string)toexecFileSync(binary, argsArray)so user-supplied--env/--namevalues are never interpolated into a shell commandutil.parseArgs— replace hand-rolledparseStringFlag,parseNumericFlag, andrawArgs.includes()with Node.js built-inparseArgs({ strict: true }). This catches typos (--preivew), errors on missing values (--envwith no argument), and handles--flag=valueautomaticallybuildWranglerDeployArgsreturns{ args, env }directly instead of the caller re-parsing the args array to extract the env nameTest coverage
buildWranglerDeployArgs: production default,--preview, explicit env, env-over-preview precedence, empty string envparseDeployArgs: all flag forms (--env staging,--env=staging), boolean flags, numeric TPR flags, whitespace trimming, strict mode rejection of unknown flagsTypecheck, lint, and all 132 deploy tests pass.
Closes #33
Supersedes #44
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.