Skip to content

feat: support disabling Vite+'s Node.js management with node-manager: false - #115

Merged
fengmk2 merged 3 commits into
voidzero-dev:mainfrom
KTrain5169:vp-env-off
Aug 6, 2026
Merged

feat: support disabling Vite+'s Node.js management with node-manager: false#115
fengmk2 merged 3 commits into
voidzero-dev:mainfrom
KTrain5169:vp-env-off

Conversation

@KTrain5169

@KTrain5169 KTrain5169 commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Adds a tri-state node-manager input to GitHub, GitLab, and Azure. Unset keeps the installer's auto-detection (enabled on CI). false keeps the Node.js already on the runner: the install script skips node/npm/npx/corepack shims (VP_NODE_MANAGER=no) and the action runs vp env off so vp commands prefer the system Node.js. true force-enables the managed Node.js.

node-manager: false fails fast when combined with node-version or node-version-file. Supersedes the earlier node-version: off approach, which broke under YAML 1.1 parsers (GitLab) and mixed a mode into a version input.

Usage:

- uses: actions/setup-node@v5
  with:
    node-version: 24
- uses: voidzero-dev/setup-vp@v1.17.0
  with:
    node-manager: false

Closes the request from Discord for Flox and other external Node.js managers.

Copilot AI review requested due to automatic review settings August 1, 2026 02:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds support for explicitly disabling Vite+ Node.js version management via the action input node-version: off, aimed at users who manage Node.js through other tooling.

Changes:

  • Update main action flow to treat node-version: off as a request to run vp env off.
  • Update action.yml input documentation to mention the off option.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/index.ts Adds nodeVersion !== "off" guard and an else if branch to run vp env off.
action.yml Updates node-version input description to mention off.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/index.ts Outdated
Comment thread action.yml
@fengmk2

fengmk2 commented Aug 3, 2026

Copy link
Copy Markdown
Member

@codex review

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

Copy link
Copy Markdown

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: 3376754c01

ℹ️ 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".

Comment thread action.yml Outdated
Copilot AI review requested due to automatic review settings August 3, 2026 04:07
@KTrain5169

Copy link
Copy Markdown
Contributor Author

turns out I forgot to push my packed dist/index.mjs

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 3 changed files in this pull request and generated no new comments.

Suppressed comments (1)

action.yml:25

  • The node-version input description still claims it "Defaults to Node.js latest LTS version", but there is no default: for this input and the action only manages Node when node-version (or node-version-file) is provided. Since this PR updates the description, it should accurately document the three states: unset (no Node management unless node-version-file is set), a version (runs vp env use), and off (runs vp env off).
    description: "Node.js version to install via `vp env use`. Defaults to Node.js latest LTS version. Pass `off` to disable."

@KTrain5169

Copy link
Copy Markdown
Contributor Author

waiting for merge ig

@fengmk2

fengmk2 commented Aug 3, 2026

Copy link
Copy Markdown
Member

@KTrain5169 Could you try this environment variable? It should be able to disable the Node.js version manager.

- uses: voidzero-dev/setup-vp@v1
  env:
    VP_NODE_MANAGER: "no"

@KTrain5169

Copy link
Copy Markdown
Contributor Author

@KTrain5169 Could you try this environment variable? It should be able to disable the Node.js version manager.

- uses: voidzero-dev/setup-vp@v1
  env:
    VP_NODE_MANAGER: "no"

will check later

@KTrain5169

Copy link
Copy Markdown
Contributor Author

@fengmk2 the env variable doesn't seem to work

Copilot AI review requested due to automatic review settings August 5, 2026 06:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 3 changed files in this pull request and generated no new comments.

Suppressed comments (2)

action.yml:25

  • The node-version input description still claims it defaults to the latest LTS, but there is no default: for this input and the action only runs vp env use when a value is provided. This is misleading, especially now that off is a supported explicit value. Reword to document the three states: unset (no Node management), version (env use), and off (env off).
    description: "Node.js version to install via `vp env use`. Defaults to Node.js latest LTS version. Pass `off` to disable."

src/index.ts:38

  • "off" is now a reserved sentinel value for the node-version input, but this logic also triggers when nodeVersion comes from node-version-file. If a version file accidentally contains off, the action will run vp env off (or silently skip Node setup) instead of failing fast, which can mask a bad version file. Gate the vp env off branch on the explicit node-version input, and consider throwing if node-version-file resolves to the reserved value.
    info(`Setting up Node.js ${nodeVersion} via vp env use...`);
    await exec("vp", ["env", "use", nodeVersion]);
  } else if (nodeVersion === "off") {
    info("Disabling Node.js version management with vp env off...");
    await exec("vp", ["env", "off"]);

@fengmk2 fengmk2 self-assigned this Aug 6, 2026
@fengmk2

fengmk2 commented Aug 6, 2026

Copy link
Copy Markdown
Member

@KTrain5169 I will take over this pr and try to improve it in all ci envs.

KTrain5169 and others added 2 commits August 6, 2026 14:05
…on GitHub, GitLab, and Azure

Replace the node-version: off sentinel with a tri-state node-manager input,
wired through all three runtimes. Unset keeps the installer's auto-detection
(enabled on CI). false passes VP_NODE_MANAGER=no to the install script (skips
node/npm/npx/corepack shims) and runs vp env off after install so vp commands
prefer the system Node.js. true force-enables the managed Node.js.

node-manager: false fails fast when combined with node-version or
node-version-file. The parser accepts YAML 1.2 boolean forms because Azure
serializes booleans passed to string parameters as True/False.
Copilot AI review requested due to automatic review settings August 6, 2026 06:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 22 out of 25 changed files in this pull request and generated no new comments.

Suppressed comments (3)

action.yml:32

  • The node-version input description currently implies the action will run vp env use by default ("Defaults to Node.js latest LTS"), but src/index.ts only runs vp env use when node-version/node-version-file is provided. This makes the input docs misleading, especially now that node-manager controls whether Vite+'s own manager is used. Consider rewording node-version to describe the conditional behavior (and optionally mention how node-manager interacts).
  node-manager:
    description: "Control Vite+'s Node.js version manager. When unset, the Vite+ installer decides (enabled on CI). Set to `false` to keep the Node.js already on the runner (e.g. from actions/setup-node or the runner image): shim creation is skipped and vp commands prefer the system Node.js. Set to `true` to force-enable the managed Node.js. Cannot be `false` together with node-version or node-version-file."
    required: false

src/inputs.ts:13

  • The PR title/description calls out disabling Node management via node-version: off, but the implementation introduces a separate node-manager input and does not recognize node-version=off (no matches in the codebase). This mismatch may confuse users following the PR title. Consider either supporting node-version: off as an alias for node-manager: false, or updating the PR title/docs to consistently refer to node-manager: false.
  const nodeVersion = getInput("node-version") || undefined;
  const nodeVersionFile = getInput("node-version-file") || undefined;
  const nodeManager = parseNodeManager(getInput("node-manager"));
  if (nodeManager === false && (nodeVersion || nodeVersionFile)) {
    throw new Error(

README.md:63

  • This section documents opting out via node-manager: false, while the PR title mentions node-version: off. If node-version: off is no longer the intended UX, consider updating the PR title (and any related docs) to avoid conflicting guidance; otherwise, document/support the node-version: off alias explicitly.
### Keep the Runner's Node.js

The Vite+ installer enables its own Node.js version manager on CI. When
Node.js is managed elsewhere (`actions/setup-node`, Flox, mise, or the runner
image), disable it so `vp` and its shims use that Node.js:

@fengmk2 fengmk2 changed the title feat: allow explicitly disabling Vite+'s Node.js version management with node-version: off feat: support disabling Vite+'s Node.js management with node-manager: false Aug 6, 2026
…ger-off

The Vite+ installer always downloads a managed Node.js LTS into
$VP_HOME/js_runtime to install its own production dependencies with a
deterministic runtime, independent of VP_NODE_MANAGER, so asserting an
empty js_runtime cache was wrong. Assert observable behavior instead:
vp exec node --version must match the runner's preinstalled Node.js.
Copilot AI review requested due to automatic review settings August 6, 2026 06:22
@fengmk2

fengmk2 commented Aug 6, 2026

Copy link
Copy Markdown
Member

@codex review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 22 out of 25 changed files in this pull request and generated no new comments.

Suppressed comments (3)

README.md:71

  • This example uses voidzero-dev/setup-vp@v1.16.1, but node-manager is introduced by this PR; users following the docs on v1.16.1 won't have that input available. Update the tag in this snippet to a version that includes node-manager (or use @v1).
  - uses: voidzero-dev/setup-vp@v1.16.1

gitlab/setup-vp.yml:18

  • node-manager is wired through this template, but the default setup-ref still points at v1.16.1. That ref determines which bootstrap.sh/runtime bundle is downloaded; with the older default, node-manager won't be applied unless users also override setup-ref. Bump the default setup-ref to the release that includes this feature.
    node-manager:
      description: 'Control Vite+''s Node.js version manager. This is a string input: empty (default) lets the Vite+ installer decide (enabled on CI); "false" keeps the runner image''s Node.js (skips shim creation and makes vp commands prefer the system Node.js); "true" force-enables the managed Node.js.'
      default: ""

azure/setup-vp.yml:28

  • This template adds the nodeManager parameter and exports SETUP_VP_NODE_MANAGER, but setupRef still defaults to v1.16.1 (the ref used to download azure/bootstrap.* and dist/azure/index.mjs). With that older default, nodeManager won't take effect unless users also bump setupRef. Update the default to the version that contains this feature.
  - name: nodeManager
    type: string
    default: ""

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: 602d6ef780

ℹ️ 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".

@fengmk2
fengmk2 merged commit 6559b71 into voidzero-dev:main Aug 6, 2026
45 checks passed
@fengmk2 fengmk2 mentioned this pull request Aug 6, 2026
fengmk2 added a commit that referenced this pull request Aug 6, 2026
Bump the version to v1.17.0 in package.json, the README examples, and
the setup-ref / setupRef defaults in the GitLab and Azure templates.

Changes since v1.16.1:

- feat: support disabling Vite+'s Node.js management with node-manager:
false (#115)
- fix: retry sfw vp install when sfw misreports vp as not found on
Windows (#120)
- chore(deps): update vite-plus to v0.2.8 (#119)
- ci: re-run bundle rebuild when Renovate pushes to a labeled PR (#122)
- chore: align Renovate release age for the whole vite-plus group (#121)

After merge, tag the merge commit as v1.17.0 and push the tag.
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.

3 participants