Skip to content

Commit ad793da

Browse files
authored
Drop support for older versions of Node.js (#2310)
* Drop support for older versions of Node.js * Install python setuptools on macOS * Temporarily disable tests on Windows + Node.js 20
1 parent 7132087 commit ad793da

File tree

5 files changed

+16
-9
lines changed

5 files changed

+16
-9
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ var ctx = canvas.getContext('2d');
1414

1515
## Your Environment
1616
* Version of node-canvas (output of `npm list canvas` or `yarn list canvas`):
17-
* Environment (e.g. node 4.2.0 on Mac OS X 10.8):
17+
* Environment (e.g. node 20.9.0 on macOS 14.1.1):

.github/workflows/ci.yaml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ubuntu-latest
1414
strategy:
1515
matrix:
16-
node: [10, 12, 14, 16, 18, 20]
16+
node: [18.12.0, 20.9.0]
1717
steps:
1818
- uses: actions/setup-node@v3
1919
with:
@@ -33,7 +33,11 @@ jobs:
3333
runs-on: windows-2019
3434
strategy:
3535
matrix:
36-
node: [10, 12, 14, 16, 18, 20]
36+
# FIXME: Node.js 20.9.0 is currently broken on Windows, in the `registerFont` test:
37+
# ENOENT: no such file or directory, lstat 'D:\a\node-canvas\node-canvas\examples\pfennigFont\pfennigMultiByte🚀.ttf'
38+
# ref: https://github.com/nodejs/node/issues/48673
39+
# ref: https://github.com/nodejs/node/pull/50650
40+
node: [18.12.0]
3741
steps:
3842
- uses: actions/setup-node@v3
3943
with:
@@ -57,7 +61,7 @@ jobs:
5761
runs-on: macos-latest
5862
strategy:
5963
matrix:
60-
node: [10, 12, 14, 16, 18, 20]
64+
node: [18.12.0, 20.9.0]
6165
steps:
6266
- uses: actions/setup-node@v3
6367
with:
@@ -68,6 +72,7 @@ jobs:
6872
brew update
6973
brew install python3 || : # python doesn't need to be linked
7074
brew install pkg-config cairo pango libpng jpeg giflib librsvg
75+
pip install setuptools
7176
- name: Install
7277
run: npm install --build-from-source
7378
- name: Test
@@ -79,7 +84,7 @@ jobs:
7984
steps:
8085
- uses: actions/setup-node@v3
8186
with:
82-
node-version: 14
87+
node-version: 20.9.0
8388
- uses: actions/checkout@v3
8489
- name: Install
8590
run: npm install --ignore-scripts

.github/workflows/prebuild.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
Linux:
2525
strategy:
2626
matrix:
27-
node: [8, 9, 10, 11, 12, 13, 14, 16, 18, 20]
27+
node: [18.12.0, 20.9.0]
2828
canvas_tag: [] # e.g. "v2.6.1"
2929
name: ${{ matrix.canvas_tag}}, Node.js ${{ matrix.node }}, Linux
3030
runs-on: ubuntu-latest
@@ -97,7 +97,7 @@ jobs:
9797
macOS:
9898
strategy:
9999
matrix:
100-
node: [8, 9, 10, 11, 12, 13, 14, 16, 18, 20]
100+
node: [18.12.0, 20.9.0]
101101
canvas_tag: [] # e.g. "v2.6.1"
102102
name: ${{ matrix.canvas_tag}}, Node.js ${{ matrix.node }}, macOS
103103
runs-on: macos-latest
@@ -163,7 +163,7 @@ jobs:
163163
Win:
164164
strategy:
165165
matrix:
166-
node: [8, 9, 10, 11, 12, 13, 14, 16, 18, 20]
166+
node: [18.12.0, 20.9.0]
167167
canvas_tag: [] # e.g. "v2.6.1"
168168
name: ${{ matrix.canvas_tag}}, Node.js ${{ matrix.node }}, Windows
169169
runs-on: windows-latest

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ project adheres to [Semantic Versioning](http://semver.org/).
1616

1717
This release notably changes to using N-API. 🎉
1818

19+
### Breaking
20+
* Dropped support for Node.js 16.x and below.
1921
### Changed
2022
* Migrated to N-API (by way of node-addon-api) and removed libuv and v8 dependencies
2123
* Defer the initialization of the `op` variable to the `default` switch case to avoid a compiler warning. (#2229)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"typescript": "^4.2.2"
6969
},
7070
"engines": {
71-
"node": ">=10.20.0"
71+
"node": "^18.12.0 || >= 20.9.0"
7272
},
7373
"license": "MIT"
7474
}

0 commit comments

Comments
 (0)