Skip to content

Commit c4e4902

Browse files
authored
build: set recommended nodejs version for dev (google#1012)
* feat: add recommended Node.js version * chore: update contribution doc * chore: update contribution doc v2
1 parent 264590b commit c4e4902

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

.node_version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22

docs/contribution.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,16 @@ again.
2929

3030
## How to Contribute
3131
Before proposing changes, look for similar ones in the project's [issues](https://github.com/google/zx/issues) and [pull requests](https://github.com/google/zx/pulls). If you can't decide, create a new [discussion](https://github.com/google/zx/discussions) topic, and we will help you figure it out. When ready to move on:
32+
3233
* Prepare your development environment.
33-
* Ensure you have Node.js 20+ installed.
34+
* Switch to the recommended version of Node.js
35+
* Install manually `Node.js >= 22`.
36+
* Delegate the routine to any version manager, that [supports .node_version config](https://stackoverflow.com/questions/27425852/what-uses-respects-the-node-version-file)
37+
* Use [Volta](https://volta.sh/), the target version will be set automatically from the `package.json`
3438
* Bash is essential for running zx scripts. Linux and macOS users usually have it installed by default. Consider using [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install) or [Git Bash](https://git-scm.com/downloads) if you are on Windows.
3539
* Fork [the repository](https://github.com/google/zx).
3640
* Create a new branch.
41+
3742
* Make your changes.
3843
* If you are adding a new feature, please include additional tests. The coverage threshold is 98%.
3944
* Create a [conventional-commits](https://www.conventionalcommits.org/en/v1.0.0/) compliant messages.

package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -163,5 +163,8 @@
163163
},
164164
"homepage": "https://google.github.io/zx/",
165165
"author": "Anton Medvedev <anton@medv.io>",
166-
"license": "Apache-2.0"
166+
"license": "Apache-2.0",
167+
"volta": {
168+
"node": "22.12.0"
169+
}
167170
}

test/it/clean-package-json.test.js

+1
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,6 @@ describe('package.json artifact', () => {
5050
assert.equal(pkgJson.description, 'A tool for writing better scripts')
5151
assert.equal(pkgJson.prettier, undefined)
5252
assert.equal(pkgJson.scripts, undefined)
53+
assert.equal(pkgJson.volta, undefined)
5354
})
5455
})

0 commit comments

Comments
 (0)