Skip to content

refactor(env)!: rename VITE_PLUS_* env vars to VP_* prefix#1166

Merged
fengmk2 merged 5 commits intovoidzero-dev:mainfrom
hamsurang:refactor/rename-env-vars-vite-plus-to-vp
Mar 29, 2026
Merged

refactor(env)!: rename VITE_PLUS_* env vars to VP_* prefix#1166
fengmk2 merged 5 commits intovoidzero-dev:mainfrom
hamsurang:refactor/rename-env-vars-vite-plus-to-vp

Conversation

@jong-kyung
Copy link
Copy Markdown
Contributor

Summary

Closes #1074

Rename all internal VITE_PLUS_* environment variables to VP_* prefix to avoid Vite's default envPrefix: "VITE_" from exposing them in bundled applications via import.meta.env.

  • Rename 25 env vars across Rust, TypeScript, shell scripts, CI workflows, and snap tests
  • Rename Rust constant identifiers and get_vite_plus_home()get_vp_home() to match
  • Update all code comments and user-facing docs (docs/guide/env.md)
  • Env vars not renamed: VITE_LOG, VITE_NODE_DIST_MIRROR, VITE_UPDATE_TASK_TYPES, VITE_GLOBAL_CLI_JS_SCRIPTS_DIR — these use the VITE_ prefix (not VITE_PLUS_) and are intentionally kept

Prerequisite (merged)

  • vite-task: voidzero-dev/vite-task#297 — Add VP_* to DEFAULT_UNTRACKED_ENV so internal vars pass through to child processes without affecting cache keys

Please let me know if I missed anything — I'll fix it.

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 27, 2026

Deploy Preview for viteplus-preview canceled.

Name Link
🔨 Latest commit 7e5ec7e
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/69c931fb4786c80008a05739

else
INSTALL_BASH="curl -fsSL https://vite.plus | VITE_PLUS_VERSION=${{ env.VERSION }} bash"
INSTALL_PS1="\\\$env:VITE_PLUS_VERSION=\\\"${{ env.VERSION }}\\\"; irm https://vite.plus/ps1 | iex"
INSTALL_BASH="curl -fsSL https://vite.plus | VP_VERSION=${{ env.VERSION }} bash"

Check notice

Code scanning / zizmor

code injection via template expansion Note

code injection via template expansion
INSTALL_BASH="curl -fsSL https://vite.plus | VITE_PLUS_VERSION=${{ env.VERSION }} bash"
INSTALL_PS1="\\\$env:VITE_PLUS_VERSION=\\\"${{ env.VERSION }}\\\"; irm https://vite.plus/ps1 | iex"
INSTALL_BASH="curl -fsSL https://vite.plus | VP_VERSION=${{ env.VERSION }} bash"
INSTALL_PS1="\\\$env:VP_VERSION=\\\"${{ env.VERSION }}\\\"; irm https://vite.plus/ps1 | iex"

Check notice

Code scanning / zizmor

code injection via template expansion Note

code injection via template expansion
@jong-kyung
Copy link
Copy Markdown
Contributor Author

@codex review

@jong-kyung jong-kyung force-pushed the refactor/rename-env-vars-vite-plus-to-vp branch from 8adb819 to 194e940 Compare March 27, 2026 08:41
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8adb8192e5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@jong-kyung jong-kyung force-pushed the refactor/rename-env-vars-vite-plus-to-vp branch from 194e940 to ae89367 Compare March 27, 2026 08:57
@fengmk2 fengmk2 changed the title refactor(env): rename VITE_PLUS_* env vars to VP_* prefix refactor(env)!: rename VITE_PLUS_* env vars to VP_* prefix Mar 27, 2026
@jong-kyung
Copy link
Copy Markdown
Contributor Author

There's currently a merge conflict with main. If there are no further changes needed, I'll squash the fixup commits and resolve the conflict.

@jong-kyung
Copy link
Copy Markdown
Contributor Author

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9057048a3f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown
Member

@fengmk2 fengmk2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jong-kyung good job! Please resolve the conflicts, I will manually verifying and then merge on Monday.

@fengmk2 fengmk2 self-assigned this Mar 28, 2026
@jong-kyung jong-kyung force-pushed the refactor/rename-env-vars-vite-plus-to-vp branch from 9057048 to e5b2f05 Compare March 28, 2026 16:26
@jong-kyung jong-kyung force-pushed the refactor/rename-env-vars-vite-plus-to-vp branch from 7ef75ea to e78b07c Compare March 28, 2026 17:58
@fengmk2
Copy link
Copy Markdown
Member

fengmk2 commented Mar 29, 2026

@jong-kyung After I merged the main branch code, CI fails now. Could you help me take a look?

@jong-kyung
Copy link
Copy Markdown
Contributor Author

@jong-kyung After I merged the main branch code, CI fails now. Could you help me take a look?

Sure, I will check It

@jong-kyung
Copy link
Copy Markdown
Contributor Author

@fengmk2 Fixed in 7e5ec7e.

The CI failure was caused by #1185 (fix: get vite_plus_home from node wrapper's path) which was merged into main after our last merge. That PR added a new test (test_get_vite_plus_without_home) in crates/vite_shared/src/home.rs that calls get_vite_plus_home(), but this PR renamed it to get_vp_home(). When GitHub CI auto-merged the latest main with our branch, the old function name no longer existed → compile error.

Updated the test to use the renamed get_vp_home().

fengmk2 added a commit to voidzero-dev/setup-vp that referenced this pull request Mar 29, 2026
Set both VP_VERSION (new) and VITE_PLUS_VERSION (legacy) when invoking
the install script, so the action works with vite-plus versions before
and after the VP_* env var rename.

Ref: voidzero-dev/vite-plus#1166
@fengmk2 fengmk2 merged commit 97c7571 into voidzero-dev:main Mar 29, 2026
65 checks passed
fengmk2 added a commit to voidzero-dev/setup-vp that referenced this pull request Mar 29, 2026
## Summary

- Set both `VP_VERSION` (new) and `VITE_PLUS_VERSION` (legacy) env vars
when invoking the vite-plus install script
- Ensures the action works with vite-plus versions before and after the
`VP_*` env var rename (voidzero-dev/vite-plus#1166)
- Includes a TODO comment to remove `VITE_PLUS_VERSION` once old
versions are no longer supported

## Test plan

- [x] CI passes with current vite-plus release (reads
`VITE_PLUS_VERSION`)
- [x] After voidzero-dev/vite-plus#1166 merges, verify install still
works (reads `VP_VERSION`)

🤖 Generated with [Claude Code](https://claude.ai/claude-code)

---------

Signed-off-by: MK (fengmk2) <fengmk2@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

Avoid exposing internal Vite+ env vars via Vite env prefix

2 participants