Commit c4e4902

Mikhail Avdeev <39246971+easymikey@users.noreply.github.com>
2024-12-21 09:47:52
build: set recommended nodejs version for dev (#1012)
* feat: add recommended Node.js version * chore: update contribution doc * chore: update contribution doc v2
1 parent 264590b
docs/contribution.md
@@ -29,11 +29,16 @@ again.
 
 ## How to Contribute
 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:
+
 * Prepare your development environment.
-  * Ensure you have Node.js 20+ installed.
+  * Switch to the recommended version of Node.js
+    * Install manually `Node.js >= 22`.
+    * Delegate the routine to any version manager, that [supports .node_version config](https://stackoverflow.com/questions/27425852/what-uses-respects-the-node-version-file)
+    * Use [Volta](https://volta.sh/), the target version will be set automatically from the `package.json`
   * 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.
 * Fork [the repository](https://github.com/google/zx).
 * Create a new branch.
+
 * Make your changes.
   * If you are adding a new feature, please include additional tests. The coverage threshold is 98%.
   * Create a [conventional-commits](https://www.conventionalcommits.org/en/v1.0.0/) compliant messages.
test/it/clean-package-json.test.js
@@ -50,5 +50,6 @@ describe('package.json artifact', () => {
     assert.equal(pkgJson.description, 'A tool for writing better scripts')
     assert.equal(pkgJson.prettier, undefined)
     assert.equal(pkgJson.scripts, undefined)
+    assert.equal(pkgJson.volta, undefined)
   })
 })
.node_version
@@ -0,0 +1,1 @@
+22
\ No newline at end of file
package.json
@@ -163,5 +163,8 @@
   },
   "homepage": "https://google.github.io/zx/",
   "author": "Anton Medvedev <anton@medv.io>",
-  "license": "Apache-2.0"
+  "license": "Apache-2.0",
+  "volta": {
+    "node": "22.12.0"
+  }
 }