Skip to content

Commit

Permalink
Drop support for older versions of Node.js (#2310)
Browse files Browse the repository at this point in the history
* Drop support for older versions of Node.js

* Install python setuptools on macOS

* Temporarily disable tests on Windows + Node.js 20
  • Loading branch information
LinusU committed Nov 29, 2023
1 parent 7132087 commit ad793da
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE.md
Expand Up @@ -14,4 +14,4 @@ var ctx = canvas.getContext('2d');

## Your Environment
* Version of node-canvas (output of `npm list canvas` or `yarn list canvas`):
* Environment (e.g. node 4.2.0 on Mac OS X 10.8):
* Environment (e.g. node 20.9.0 on macOS 14.1.1):
13 changes: 9 additions & 4 deletions .github/workflows/ci.yaml
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [10, 12, 14, 16, 18, 20]
node: [18.12.0, 20.9.0]
steps:
- uses: actions/setup-node@v3
with:
Expand All @@ -33,7 +33,11 @@ jobs:
runs-on: windows-2019
strategy:
matrix:
node: [10, 12, 14, 16, 18, 20]
# FIXME: Node.js 20.9.0 is currently broken on Windows, in the `registerFont` test:
# ENOENT: no such file or directory, lstat 'D:\a\node-canvas\node-canvas\examples\pfennigFont\pfennigMultiByte🚀.ttf'
# ref: https://github.com/nodejs/node/issues/48673
# ref: https://github.com/nodejs/node/pull/50650
node: [18.12.0]
steps:
- uses: actions/setup-node@v3
with:
Expand All @@ -57,7 +61,7 @@ jobs:
runs-on: macos-latest
strategy:
matrix:
node: [10, 12, 14, 16, 18, 20]
node: [18.12.0, 20.9.0]
steps:
- uses: actions/setup-node@v3
with:
Expand All @@ -68,6 +72,7 @@ jobs:
brew update
brew install python3 || : # python doesn't need to be linked
brew install pkg-config cairo pango libpng jpeg giflib librsvg
pip install setuptools
- name: Install
run: npm install --build-from-source
- name: Test
Expand All @@ -79,7 +84,7 @@ jobs:
steps:
- uses: actions/setup-node@v3
with:
node-version: 14
node-version: 20.9.0
- uses: actions/checkout@v3
- name: Install
run: npm install --ignore-scripts
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/prebuild.yaml
Expand Up @@ -24,7 +24,7 @@ jobs:
Linux:
strategy:
matrix:
node: [8, 9, 10, 11, 12, 13, 14, 16, 18, 20]
node: [18.12.0, 20.9.0]
canvas_tag: [] # e.g. "v2.6.1"
name: ${{ matrix.canvas_tag}}, Node.js ${{ matrix.node }}, Linux
runs-on: ubuntu-latest
Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:
macOS:
strategy:
matrix:
node: [8, 9, 10, 11, 12, 13, 14, 16, 18, 20]
node: [18.12.0, 20.9.0]
canvas_tag: [] # e.g. "v2.6.1"
name: ${{ matrix.canvas_tag}}, Node.js ${{ matrix.node }}, macOS
runs-on: macos-latest
Expand Down Expand Up @@ -163,7 +163,7 @@ jobs:
Win:
strategy:
matrix:
node: [8, 9, 10, 11, 12, 13, 14, 16, 18, 20]
node: [18.12.0, 20.9.0]
canvas_tag: [] # e.g. "v2.6.1"
name: ${{ matrix.canvas_tag}}, Node.js ${{ matrix.node }}, Windows
runs-on: windows-latest
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -16,6 +16,8 @@ project adheres to [Semantic Versioning](http://semver.org/).

This release notably changes to using N-API. 🎉

### Breaking
* Dropped support for Node.js 16.x and below.
### Changed
* Migrated to N-API (by way of node-addon-api) and removed libuv and v8 dependencies
* Defer the initialization of the `op` variable to the `default` switch case to avoid a compiler warning. (#2229)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -68,7 +68,7 @@
"typescript": "^4.2.2"
},
"engines": {
"node": ">=10.20.0"
"node": "^18.12.0 || >= 20.9.0"
},
"license": "MIT"
}

0 comments on commit ad793da

Please sign in to comment.