Skip to content

Commit 4c4a021

Browse files
authored
Require Node 16+ while building/testing on Node 20 (#596)
* Use canonical encoding/readFile command to take advantage of fast path in Node 20 Fast path doesn't appear to check encoding options case insensitive, 'utf8' seems more canonical. Signed-off-by: Chad Wilson <chadw@thoughtworks.com> * Apply workaround for mock-fs Node 20 issue See tschaub/mock-fs#377 Signed-off-by: Chad Wilson <chadw@thoughtworks.com> * Migrate build to Node 20 Node 16 is nearly EOL, and Node 20 is nearly LTS, so let's go straight there. This remove use of a deprecated npm flag, replacing with alternative compatible with npm 7/NodeJS 16 onwards (2021+, Node 16 recently went EOL in Sep 2023). The package-lock is also now only compatible with Node 16/npm 7 onwards. Since this is technically a breaking change in npm/node compatibility, bumps the major version and updates the documentation as such. Signed-off-by: Chad Wilson <chadw@thoughtworks.com> --------- Signed-off-by: Chad Wilson <chadw@thoughtworks.com>
1 parent b1151ab commit 4c4a021

File tree

13 files changed

+313
-1934
lines changed

13 files changed

+313
-1934
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Set up Nodejs
2222
uses: actions/setup-node@v3
2323
with:
24-
node-version: 16
24+
node-version: 20
2525

2626
- name: Setup submodule
2727
run: |
@@ -51,7 +51,7 @@ jobs:
5151
- name: Set up Nodejs
5252
uses: actions/setup-node@v3
5353
with:
54-
node-version: 16
54+
node-version: 20
5555

5656
- name: Setup java
5757
uses: actions/setup-java@v3
@@ -99,7 +99,7 @@ jobs:
9999
- name: Use Node.js
100100
uses: actions/setup-node@v3
101101
with:
102-
node-version: 16
102+
node-version: 20
103103

104104
- name: Setup go 1.20.x
105105
uses: actions/setup-go@v4

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Set up Nodejs
1616
uses: actions/setup-node@v3
1717
with:
18-
node-version: 16
18+
node-version: 20
1919

2020
- name: Setup git
2121
run: |

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ The plugin is authored in [Javascript](https://en.wikipedia.org/wiki/JavaScript)
6767
Gauge is authored in golang. These are independent processes talking to each other over TCP on port GAUGE_INTERNAL_PORT (env variable) using [Protobuf](https://github.com/getgauge/gauge-proto).
6868

6969
##### Pre-Requisites
70-
* [Node.js](https://nodejs.org/en/) - Version >= 12
70+
* [Node.js](https://nodejs.org/en/) - Version >= 16
7171
* [Npm](https://www.npmjs.com/get-npm)
7272

7373
##### Compiling

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#! /usr/bin/env node
22

33
var version = process.versions.node.split(".");
4-
if (parseInt(version[0]) === 0 && parseInt(version[1]) < 12) {
5-
throw new Error("gauge-js requires Node.js version 0.12+. Current version: " + process.versions.node);
4+
if (parseInt(version[0]) < 16) {
5+
throw new Error("gauge-js requires Node.js version 16+. Current version: " + process.versions.node);
66
}
77

88
var fs = require("fs"),

js.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@
1919
"windows": [
2020
"npm",
2121
"install",
22-
"--production",
22+
"--omit=dev",
2323
"--silent"
2424
],
2525
"darwin": [
2626
"npm",
2727
"install",
28-
"--production",
28+
"--omit=dev",
2929
"--silent"
3030
],
3131
"linux": [
3232
"npm",
3333
"install",
34-
"--production",
34+
"--omit=dev",
3535
"--silent"
3636
]
3737
},
@@ -51,7 +51,7 @@
5151
"--init"
5252
]
5353
},
54-
"version": "3.0.1",
54+
"version": "4.0.0",
5555
"gaugeVersionSupport": {
5656
"minimum": "1.0.7",
5757
"maximum": ""

0 commit comments

Comments
 (0)