Skip to content

Commit 6b612ff

Browse files
authored
Merge pull request #413 from per1234/engines-node
Use `engines.node` as source of version data for "actions/setup-node" action
2 parents bc7a888 + b4950e9 commit 6b612ff

File tree

6 files changed

+12
-16
lines changed

6 files changed

+12
-16
lines changed

Diff for: .github/CONTRIBUTING.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
Follow the installation instructions here:<br />
1010
https://nodejs.dev/download
1111

12-
Node.js 20.x is used for development of this project. [nvm](https://github.com/nvm-sh/nvm) is recommended to easily switch between Node.js versions.
12+
The **Node.js** version in use is defined in the `engines.node` field of [`package.json`](../package.json).
13+
14+
[nvm](https://github.com/nvm-sh/nvm) is recommended to easily switch between Node.js versions.
1315

1416
### 2. Install dependencies
1517

Diff for: .github/workflows/check-npm.yml

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
name: Check npm
22

3-
env:
4-
# See: https://github.com/actions/setup-node/#readme
5-
NODE_VERSION: 20.x
6-
73
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
84
on:
95
push:
@@ -162,7 +158,7 @@ jobs:
162158
- name: Setup Node.js
163159
uses: actions/setup-node@v4
164160
with:
165-
node-version: ${{ env.NODE_VERSION }}
161+
node-version-file: package.json
166162

167163
- name: Install dependencies
168164
run: npm install

Diff for: .github/workflows/check-packaging-ncc-typescript-npm.yml

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
name: Check Packaging
22

3-
env:
4-
# See: https://github.com/actions/setup-node/#readme
5-
NODE_VERSION: 20.x
6-
73
on:
84
push:
95
paths:
@@ -35,7 +31,7 @@ jobs:
3531
- name: Setup Node.js
3632
uses: actions/setup-node@v4
3733
with:
38-
node-version: ${{ env.NODE_VERSION }}
34+
node-version-file: package.json
3935

4036
- name: Install dependencies
4137
run: npm install

Diff for: .github/workflows/test.yml

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
name: Test Action
22

3-
env:
4-
# See: https://github.com/actions/setup-node/#readme
5-
NODE_VERSION: 20.x
6-
73
on:
84
push:
95
pull_request:
@@ -31,7 +27,7 @@ jobs:
3127
- name: Setup Node.js
3228
uses: actions/setup-node@v4
3329
with:
34-
node-version: ${{ env.NODE_VERSION }}
30+
node-version-file: package.json
3531

3632
- name: npm install
3733
run: npm install

Diff for: package-lock.json

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+3
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,8 @@
3939
"prettier": "^3.3.3",
4040
"ts-jest": "^28.0.8",
4141
"typescript": "^5.6.2"
42+
},
43+
"engines": {
44+
"node": "20.x"
4245
}
4346
}

0 commit comments

Comments
 (0)