Skip to content

build: add engines field for bundlers and devEngines field for root#1705

Open
Mister-Hope wants to merge 2 commits into
mainfrom
engine
Open

build: add engines field for bundlers and devEngines field for root#1705
Mister-Hope wants to merge 2 commits into
mainfrom
engine

Conversation

@Mister-Hope
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings May 15, 2026 06:36
@coveralls
Copy link
Copy Markdown

coveralls commented May 15, 2026

Coverage Report for CI Build 25954509750

Warning

Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes.
Quick fix: rebase this PR. Learn more →

Coverage remained the same at 72.961%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 1058
Covered Lines: 767
Line Coverage: 72.5%
Relevant Branches: 536
Covered Branches: 396
Branch Coverage: 73.88%
Branches in Coverage %: Yes
Coverage Strength: 45.84 hits per line

💛 - Coveralls

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates runtime/tooling constraints across the monorepo by tightening Node.js version requirements for published bundler packages and switching the root project to a devEngines-based declaration for Node/pnpm requirements.

Changes:

  • Update @vuepress/vuepress Node engine range to a major-version allowlist (22/24/26).
  • Add matching engines.node constraints to @vuepress/bundler-vite and @vuepress/bundler-webpack.
  • Replace the root packageManager pin with a devEngines declaration for pnpm + Node.

Reviewed changes

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

File Description
packages/vuepress/package.json Changes the engines.node range from a broad >= requirement to a major allowlist.
packages/bundler-webpack/package.json Adds engines.node to constrain supported Node majors for the webpack bundler package.
packages/bundler-vite/package.json Adds engines.node to constrain supported Node majors for the vite bundler package.
package.json Removes top-level packageManager pin and adds devEngines for Node + pnpm.

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

Comment thread package.json
Comment on lines +56 to +61
"devEngines": {
"packageManager": {
"name": "pnpm",
"version": "11.1.2",
"onFail": "download"
},
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We do not, npm v11 stops with this field.

Comment thread package.json Outdated
},
"runtime": {
"name": "node",
"version": "^22.18.0 || ^24.0.0 || ^26.0.0",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The purpose of the root package.json changes are different. Let's split it to a separate PR. Also this comment is valid

Copy link
Copy Markdown
Member Author

@Mister-Hope Mister-Hope May 16, 2026

Choose a reason for hiding this comment

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

No, this is invalid. If you want node e2e test, then runtime MUST be allowed to use v22 and v26. And we do have such tests.

pnpm v11 will throw error if it find itself running on node22 with strict runtime setting.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Got it. But then why do we need this field? We'll always use .node-version for locking dev env?

Copy link
Copy Markdown
Member Author

@Mister-Hope Mister-Hope May 18, 2026

Choose a reason for hiding this comment

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

.node-version file is not standard.

A GitHub user now will receive error msg if he is not running on these versions. This ensures any developers using correct node version to develop.

Copy link
Copy Markdown
Member

@meteorlxy meteorlxy May 18, 2026

Choose a reason for hiding this comment

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

What we want is consistent node version instead of 'correct' node version, just like the lock file. That's the purpose of .node-version and why Copilot left this comment

Copy link
Copy Markdown
Member Author

@Mister-Hope Mister-Hope May 18, 2026

Choose a reason for hiding this comment

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

Yes, that's the purpose of .node-version. I can change back the default behavior for reading a constant version at .node-version.

But as we are not a project that interacts with V8 engine's apis, so we should trust node's semver. Testing on the latest patch of a major is better at testing. We ensure our project is runable on latest patch, and since we are runable on previous versions, then we are likely not breaking anything.

Unlike pure javascript pkgs, our project is a node-based tool, so letting our e2e test running on real, latest node versions is better. That fits our users' env.

Only if we are developing a pure javascript package, fixing the node version could then be a better way. In this cases, we trust our packing tool and a stable testing env is our major concern.

Comment thread packages/vuepress/package.json Outdated
@Mister-Hope
Copy link
Copy Markdown
Member Author

@meteorlxy Changed to "^22.18.0 || ^24 || >=26", a better ranger covering LTS and and future latest version. 23 and 25 are already EOL so we should not let users running on it. (node 23 breaks)

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.

4 participants