Skip to content

feat: add Node.js and package manager version outputs - #199

Merged
fengmk2 merged 1 commit into
voidzero-dev:mainfrom
everton-dgn:feat/resolved-version-outputs
Oct 15, 2026
Merged

fengmk2 merged 1 commit into
voidzero-dev:mainfrom
everton-dgn:feat/resolved-version-outputs

Conversation

@everton-dgn

@everton-dgn everton-dgn commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Closes #198

At the end of setup, all three integrations run vp env current --json in the project directory and publish what Vite+ resolved:

GitHub output GitLab variable Azure job variable and named output
node-version SETUP_VP_INSTALLED_NODE_VERSION SETUP_VP_INSTALLED_NODE_VERSION, nodeVersion
package-manager SETUP_VP_PACKAGE_MANAGER_NAME SETUP_VP_PACKAGE_MANAGER_NAME, packageManager
package-manager-version SETUP_VP_PACKAGE_MANAGER_VERSION SETUP_VP_PACKAGE_MANAGER_VERSION, packageManagerVersion

On GitLab they also go into .setup-vp-outputs.env, next to SETUP_VP_INSTALLED_VERSION.

The command only runs when the installed Vite+ is 0.3.1 or newer, using the same supportsScopedEnv check as the package-manager input. Before 0.3.1 the JSON kept the Node.js version at the top level, and vp env current ignored vp env off, so with node-manager: false it would have reported the managed version instead of the one on PATH. On older versions the outputs are unknown, like version. If the command fails or doesn't print JSON, they are unknown too and each integration logs a warning. Values that aren't a plain name or version also become unknown, since they end up in a GitLab dotenv file.

The version check, the command call and the parsing live in src/ci/env-current.ts, shared by the three integrations. The dist/ bundles are rebuilt, and the variable lists in the GitLab and Azure RFCs include the new names.

The GitLab E2E fixture update is in setup-vp-gitlab-test!5. It accepts either the two legacy dotenv keys or all five keys and validates the new values against the exported environment. All 26 local fixture tests pass. The full GitLab suite passed in the fork against this PR's commit f2c452ab1c34c245dd085f47a3ac1d7b23fb78a5, including the dotenv producer and consumer jobs. Windows jobs remain disabled in the existing GitLab CI configuration. The fixture MR still needs to merge before the upstream GitLab E2E workflow can use the updated assertion.

How I tested it:

  • New tests for the version check, the parser and the warnings, plus GitHub, GitLab and Azure tests for the 0.3.1+ path, the fallback on 0.3.0, a failing vp env current, and the order of the call after vp env use, the package-manager commands and the install. Without the source changes, the new tests fail (11 failures, and the helper's test file can't load).
  • vp run check, vp run build, vp run typecheck and vp run test pass locally on macOS: 1004 passed, 146 skipped. The skipped ones are Windows or PowerShell-only, plus one that needs a case-sensitive volume.
  • I fed real vp env current --json output from vp 1.0.0-rc.0 to the parser (the JSON layout in current.rs is the same in v1.1.0). A Bun project with devEngines.runtime 24.20.0 gives 24.20.0, bun, 1.4.2. This repo, whose .node-version is lts/*, gives 24.21.0, pnpm, 12.7.0. In a project without a local vite-plus, stdout is still plain JSON.
  • In test.yml, test-node-version, test-auto-node-version and test-node-manager-off now check node-version against node --version or the expected version, and test-node-version also checks the package manager against packageManager in this repo's package.json. I replayed those three jobs on macOS with a small script that runs their steps against dist/index.mjs in an isolated HOME. They pass for node-version: 22 (output 22.23.3), lts (24.21.0), devEngines.runtime 22.18.0, and node-manager: false with a system Node.js 22.19.0, where the managed version would have been 24.21.0. They haven't run on real runners, Linux or Windows yet.

After setup, read `vp env current --json` in the project directory and
publish the Node.js version, package manager, and package manager version
that Vite+ resolved.

GitHub sets the node-version, package-manager, and package-manager-version
outputs. GitLab exports SETUP_VP_INSTALLED_NODE_VERSION,
SETUP_VP_PACKAGE_MANAGER_NAME, and SETUP_VP_PACKAGE_MANAGER_VERSION and
writes them to .setup-vp-outputs.env. Azure sets the same job variables
plus the nodeVersion, packageManager, and packageManagerVersion named
outputs.

The command only runs on Vite+ 0.3.1 or newer. Older releases keep the
Node.js version at the top level of the JSON and ignore `vp env off`, so
setup-vp reports unknown for them. A failed command or output that is not
JSON also reports unknown, with a warning in each integration. A value that
is not a plain name or version reports unknown as well.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@fengmk2

fengmk2 commented Oct 14, 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: f2c452ab1c

ℹ️ 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 src/gitlab/index.ts
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-14T14:00:13.885226Z f2c452a Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@fengmk2 fengmk2 self-assigned this Oct 14, 2026
@fengmk2 fengmk2 added the run-e2e Request GitLab E2E for the reviewed fork PR commit (requires write access). label Oct 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

✅ GitLab E2E passed

Commit: f2c452ab1c34c245dd085f47a3ac1d7b23fb78a5
Suite: full · Vite+ version: latest

GitLab pipeline · GitHub Actions run

@fengmk2

fengmk2 commented Oct 15, 2026

Copy link
Copy Markdown
Member

@everton-dgn Thanks!

@fengmk2
fengmk2 merged commit d2bd646 into voidzero-dev:main Oct 15, 2026
83 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-e2e Request GitLab E2E for the reviewed fork PR commit (requires write access).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose the resolved Node.js and package manager versions as outputs

2 participants