From ad793dab1fd2fd64bd8e9c55381679423b840236 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Linus=20Unneb=C3=A4ck?= Date: Wed, 29 Nov 2023 10:53:03 +0100 Subject: [PATCH] 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 --- .github/ISSUE_TEMPLATE.md | 2 +- .github/workflows/ci.yaml | 13 +++++++++---- .github/workflows/prebuild.yaml | 6 +++--- CHANGELOG.md | 2 ++ package.json | 2 +- 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 8828eac4d..10c0a04ab 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -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): diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 2d985cfc6..f0606175d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -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: @@ -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: @@ -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: @@ -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 @@ -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 diff --git a/.github/workflows/prebuild.yaml b/.github/workflows/prebuild.yaml index 784069e06..d1d30960f 100644 --- a/.github/workflows/prebuild.yaml +++ b/.github/workflows/prebuild.yaml @@ -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 @@ -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 @@ -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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 03d9d2732..52f66779b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/package.json b/package.json index 12b9be365..d9c6526d2 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,7 @@ "typescript": "^4.2.2" }, "engines": { - "node": ">=10.20.0" + "node": "^18.12.0 || >= 20.9.0" }, "license": "MIT" }