From 277c49bfd06bfacb4f18211fb0a3c1803cd33701 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Thu, 5 Oct 2023 20:33:57 +0200 Subject: [PATCH] feat: remove Node.js 16.x support MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- .github/workflows/ci.yml | 8 +- .github/workflows/generate-documentation.yml | 2 +- .github/workflows/internal-benchmark.yml | 2 +- .github/workflows/publish-package.yml | 6 +- CHANGELOG.md | 4 + README.md | 2 +- package.json | 4 +- pnpm-lock.yaml | 149 +++++++++++++++---- src/worker/utils.ts | 3 - src/worker/worker-options.ts | 7 - 10 files changed, 140 insertions(+), 47 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9f28cc57..7d70b1d2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: strategy: matrix: os: [windows-latest, macos-latest, ubuntu-latest] - node: ['16.x', '18.x', '20.x'] + node: ['18.x', '20.x'] name: Node.js ${{ matrix.node }} on ${{ matrix.os }} @@ -47,14 +47,14 @@ jobs: run: pnpm build - name: Lint - if: ${{ matrix.os == 'ubuntu-latest' && matrix.node == '18.x' }} + if: ${{ matrix.os == 'ubuntu-latest' && matrix.node == '20.x' }} run: pnpm lint - name: Tests run: pnpm test - name: Coverage Report - if: ${{ matrix.os == 'ubuntu-latest' && matrix.node == '18.x' }} + if: ${{ matrix.os == 'ubuntu-latest' && matrix.node == '20.x' }} run: pnpm coverage - name: Check for SonarCloud Token Availability @@ -68,7 +68,7 @@ jobs: fi - name: SonarCloud Code Analysis - if: ${{ steps.sonar-token.outputs.available == 'true' && github.repository == 'poolifier/poolifier' && matrix.os == 'ubuntu-latest' && matrix.node == '18.x' }} + if: ${{ steps.sonar-token.outputs.available == 'true' && github.repository == 'poolifier/poolifier' && matrix.os == 'ubuntu-latest' && matrix.node == '20.x' }} uses: sonarsource/sonarcloud-github-action@v2.0.2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/generate-documentation.yml b/.github/workflows/generate-documentation.yml index f8cf8e73..fa52d0b8 100644 --- a/.github/workflows/generate-documentation.yml +++ b/.github/workflows/generate-documentation.yml @@ -19,7 +19,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v3 with: - node-version: '18.x' + node-version: '20.x' cache: 'pnpm' - name: Generate documentation diff --git a/.github/workflows/internal-benchmark.yml b/.github/workflows/internal-benchmark.yml index 884bb3f8..c4d47cd3 100644 --- a/.github/workflows/internal-benchmark.yml +++ b/.github/workflows/internal-benchmark.yml @@ -24,7 +24,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v3 with: - node-version: '18.x' + node-version: '20.x' cache: 'pnpm' - name: Install dependencies run: pnpm install --ignore-scripts --frozen-lockfile diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index 58adce74..23a9b609 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -20,7 +20,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v3 with: - node-version: '18.x' + node-version: '20.x' cache: 'pnpm' - name: Install Dependencies @@ -53,7 +53,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v3 with: - node-version: '18.x' + node-version: '20.x' registry-url: https://registry.npmjs.org/ cache: 'pnpm' @@ -101,7 +101,7 @@ jobs: # - name: Setup Node.js # uses: actions/setup-node@v3 # with: - # node-version: '18.x' + # node-version: '20.x' # registry-url: https://npm.pkg.github.com # cache: 'pnpm' diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ea96221..39672a25 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- Remove Node.js 16.x.x (EOL) support. + ## [2.7.5] - 2023-10-03 ### Changed diff --git a/README.md b/README.md index 660152cf..6db467fd 100644 --- a/README.md +++ b/README.md @@ -165,7 +165,7 @@ Remember that workers can only send and receive structured-cloneable data. ## Node.js versions -Node.js versions >= 16.14.x are supported. +Node.js versions >= 18.x.x are supported. ## [API](./docs/api.md) diff --git a/package.json b/package.json index e6bb6e0f..001940bc 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "globals": ["describe", "it", "after", "before", "afterEach", "beforeEach"] }, "engines": { - "node": ">=16.14.0", + "node": ">=18.0.0", "pnpm": ">=8.6.0" }, "volta": { @@ -132,7 +132,7 @@ "mochawesome": "^7.1.3", "prettier": "^3.0.3", "release-it": "^16.2.1", - "rollup": "^3.29.4", + "rollup": "^4.0.0", "rollup-plugin-analyzer": "^4.0.0", "rollup-plugin-command": "^1.1.3", "rollup-plugin-delete": "^2.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cf21b4fa..5db4e56e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -25,10 +25,10 @@ devDependencies: version: 4.0.0(release-it@16.2.1) '@rollup/plugin-terser': specifier: ^0.4.4 - version: 0.4.4(rollup@3.29.4) + version: 0.4.4(rollup@4.0.0) '@rollup/plugin-typescript': specifier: ^11.1.5 - version: 11.1.5(rollup@3.29.4)(typescript@5.2.2) + version: 11.1.5(rollup@4.0.0)(typescript@5.2.2) '@types/node': specifier: ^20.8.2 version: 20.8.2 @@ -102,8 +102,8 @@ devDependencies: specifier: ^16.2.1 version: 16.2.1(typescript@5.2.2) rollup: - specifier: ^3.29.4 - version: 3.29.4 + specifier: ^4.0.0 + version: 4.0.0 rollup-plugin-analyzer: specifier: ^4.0.0 version: 4.0.0 @@ -115,7 +115,7 @@ devDependencies: version: 2.0.0 rollup-plugin-dts: specifier: ^6.0.2 - version: 6.0.2(rollup@3.29.4)(typescript@5.2.2) + version: 6.0.2(rollup@4.0.0)(typescript@5.2.2) sinon: specifier: ^16.1.0 version: 16.1.0 @@ -766,7 +766,7 @@ packages: string-template: 1.0.0 dev: true - /@rollup/plugin-terser@0.4.4(rollup@3.29.4): + /@rollup/plugin-terser@0.4.4(rollup@4.0.0): resolution: {integrity: sha512-XHeJC5Bgvs8LfukDwWZp7yeqin6ns8RTl2B9avbejt6tZqsqvVoWI7ZTQrcNsfKEDWBTnTxM8nMDkO2IFFbd0A==} engines: {node: '>=14.0.0'} peerDependencies: @@ -775,13 +775,13 @@ packages: rollup: optional: true dependencies: - rollup: 3.29.4 + rollup: 4.0.0 serialize-javascript: 6.0.1 smob: 1.4.1 terser: 5.21.0 dev: true - /@rollup/plugin-typescript@11.1.5(rollup@3.29.4)(typescript@5.2.2): + /@rollup/plugin-typescript@11.1.5(rollup@4.0.0)(typescript@5.2.2): resolution: {integrity: sha512-rnMHrGBB0IUEv69Q8/JGRD/n4/n6b3nfpufUu26axhUcboUzv/twfZU8fIBbTOphRAe0v8EyxzeDpKXqGHfyDA==} engines: {node: '>=14.0.0'} peerDependencies: @@ -794,13 +794,13 @@ packages: tslib: optional: true dependencies: - '@rollup/pluginutils': 5.0.5(rollup@3.29.4) + '@rollup/pluginutils': 5.0.5(rollup@4.0.0) resolve: 1.22.6 - rollup: 3.29.4 + rollup: 4.0.0 typescript: 5.2.2 dev: true - /@rollup/pluginutils@5.0.5(rollup@3.29.4): + /@rollup/pluginutils@5.0.5(rollup@4.0.0): resolution: {integrity: sha512-6aEYR910NyP73oHiJglti74iRyOwgFU4x3meH/H8OJx6Ry0j6cOVZ5X/wTvub7G7Ao6qaHBEaNsV3GLJkSsF+Q==} engines: {node: '>=14.0.0'} peerDependencies: @@ -812,8 +812,96 @@ packages: '@types/estree': 1.0.2 estree-walker: 2.0.2 picomatch: 2.3.1 - rollup: 3.29.4 + rollup: 4.0.0 + dev: true + + /@rollup/rollup-android-arm-eabi@4.0.0: + resolution: {integrity: sha512-rN3qt1JzOx0v7JWyK68zkb3yf1k1f1OhhHR0i7vLlGlediTtM3FKsOkestQN6HwJ9nEaP3KxPHxH5Xv7yr6f4w==} + cpu: [arm] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-android-arm64@4.0.0: + resolution: {integrity: sha512-dcdg6Zp2bqIS/+2FHhdSS+lbcySufP2fYYoXkDa4W6uHE22L15psftdQZtFhxvvqRWPD1HsK0xIj5f07zuujkg==} + cpu: [arm64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-darwin-arm64@4.0.0: + resolution: {integrity: sha512-mOz75DpOOHGk4+xYbh1E23vmSOrOqskTwq9s/e2Z46eYbTZ0+s/UVoS42cLG8dUe6enF2Xh3hTtiIEzLhO9kmA==} + cpu: [arm64] + os: [darwin] + requiresBuild: true dev: true + optional: true + + /@rollup/rollup-darwin-x64@4.0.0: + resolution: {integrity: sha512-rEBuHQ2ejl9gb0//19F88gR7Z9HY2kcCX8jT5LhCHqGqAvlloETXO1FD7DKEdqGz98UtJy6pVAxxeVBN4tlWag==} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-arm-gnueabihf@4.0.0: + resolution: {integrity: sha512-W4Elp0SGWqWOkdgoYniOp6ERrhHYRfMPikUZmnU/kAdLXQ9p0M0meF648Z6Y7ClHJr8pIQpcCdmr7E2h8Kn7Fw==} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-arm64-gnu@4.0.0: + resolution: {integrity: sha512-/BTevM/UKprMJgFse0nm+YXQ83iDqArru+k3kZtQlvaNMWdkLcyscOP8SwWPpR0CJuLlXr8Gtpps+EgH3TUqLA==} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-x64-gnu@4.0.0: + resolution: {integrity: sha512-Pz2FD/4FUZM98+rcpuGAJgatW5/dW/pXXrbanjtir38EYqqmdVc0odHwqlQ+KFY2C5P+B6PJO5vom8PmJQLdug==} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-x64-musl@4.0.0: + resolution: {integrity: sha512-Xs2tOshU5MD7nK5WnaSBUwiFdBlMtyKdXOOnBno4IRbDIyrjLtx9lnSIO47FNP0LtpGfyOcsK/lE/ZsLlnXyIg==} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-win32-arm64-msvc@4.0.0: + resolution: {integrity: sha512-h2r04SsqVMbmaIRSMN3HKQLYpKewJ7rWQx1SwEZQMeXRkecWFBBNOfoB3iMlvvUfc3VUOonR/3Dm/Op6yOD2Lg==} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-win32-ia32-msvc@4.0.0: + resolution: {integrity: sha512-1pl05L51RbVLnqZTEpbgG2RxeS7VLysF7vhU8v1EOAMqbLzko64r8+S2SxsNDKODsgusFqHO8rc3w+G9VUjodw==} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-win32-x64-msvc@4.0.0: + resolution: {integrity: sha512-GDi4TkL95/J0ven1wt+q2cfdg1k9UEIQiF58lSC36KUdA0xtlqgLPEDlNAhu6NTXJ491eiZ71lQbLu1D7hlz9w==} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true /@sinclair/typebox@0.27.8: resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} @@ -1642,8 +1730,8 @@ packages: engines: {node: '>=14.16'} dev: true - /cacheable-request@10.2.13: - resolution: {integrity: sha512-3SD4rrMu1msNGEtNSt8Od6enwdo//U9s4ykmXfA2TD58kcLkCobtCDiby7kNyj7a/Q7lz/mAesAFI54rTdnvBA==} + /cacheable-request@10.2.14: + resolution: {integrity: sha512-zkDT5WAF4hSSoUgyfg5tFIxz8XQK+25W/TLVojJTMKBaxevLBBtLxgqguAuVQB8PVW79FVjHcU+GJ9tVbDZ9mQ==} engines: {node: '>=14.16'} dependencies: '@types/http-cache-semantics': 4.0.2 @@ -3316,7 +3404,7 @@ packages: '@sindresorhus/is': 5.6.0 '@szmarczak/http-timer': 5.0.1 cacheable-lookup: 7.0.0 - cacheable-request: 10.2.13 + cacheable-request: 10.2.14 decompress-response: 6.0.0 form-data-encoder: 2.1.4 get-stream: 6.0.1 @@ -3333,7 +3421,7 @@ packages: '@sindresorhus/is': 5.6.0 '@szmarczak/http-timer': 5.0.1 cacheable-lookup: 7.0.0 - cacheable-request: 10.2.13 + cacheable-request: 10.2.14 decompress-response: 6.0.0 form-data-encoder: 2.1.4 get-stream: 6.0.1 @@ -5445,7 +5533,7 @@ packages: del: 5.1.0 dev: true - /rollup-plugin-dts@6.0.2(rollup@3.29.4)(typescript@5.2.2): + /rollup-plugin-dts@6.0.2(rollup@4.0.0)(typescript@5.2.2): resolution: {integrity: sha512-GYCCy9DyE5csSuUObktJBpjNpW2iLZMabNDIiAqzQWBl7l/WHzjvtAXevf8Lftk8EA920tuxeB/g8dM8MVMR6A==} engines: {node: '>=v16'} peerDependencies: @@ -5453,17 +5541,28 @@ packages: typescript: ^4.5 || ^5.0 dependencies: magic-string: 0.30.4 - rollup: 3.29.4 + rollup: 4.0.0 typescript: 5.2.2 optionalDependencies: '@babel/code-frame': 7.22.13 dev: true - /rollup@3.29.4: - resolution: {integrity: sha512-oWzmBZwvYrU0iJHtDmhsm662rC15FRXmcjCk1xD771dFDx5jJ02ufAQQTn0etB2emNk4J9EZg/yWKpsn9BWGRw==} - engines: {node: '>=14.18.0', npm: '>=8.0.0'} + /rollup@4.0.0: + resolution: {integrity: sha512-dtlkoIdp/g2glVlQb6FzhMAMzhMYVIJ3KLGjhWKkwz/ambEuHeVZ7Eg6GALhHZOsDRD+ZWSjnUikZXPyb22puQ==} + engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true optionalDependencies: + '@rollup/rollup-android-arm-eabi': 4.0.0 + '@rollup/rollup-android-arm64': 4.0.0 + '@rollup/rollup-darwin-arm64': 4.0.0 + '@rollup/rollup-darwin-x64': 4.0.0 + '@rollup/rollup-linux-arm-gnueabihf': 4.0.0 + '@rollup/rollup-linux-arm64-gnu': 4.0.0 + '@rollup/rollup-linux-x64-gnu': 4.0.0 + '@rollup/rollup-linux-x64-musl': 4.0.0 + '@rollup/rollup-win32-arm64-msvc': 4.0.0 + '@rollup/rollup-win32-ia32-msvc': 4.0.0 + '@rollup/rollup-win32-x64-msvc': 4.0.0 fsevents: 2.3.3 dev: true @@ -5669,7 +5768,7 @@ packages: resolution: {integrity: sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==} dependencies: spdx-expression-parse: 3.0.1 - spdx-license-ids: 3.0.15 + spdx-license-ids: 3.0.16 dev: true /spdx-exceptions@2.3.0: @@ -5680,11 +5779,11 @@ packages: resolution: {integrity: sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==} dependencies: spdx-exceptions: 2.3.0 - spdx-license-ids: 3.0.15 + spdx-license-ids: 3.0.16 dev: true - /spdx-license-ids@3.0.15: - resolution: {integrity: sha512-lpT8hSQp9jAKp9mhtBU4Xjon8LPGBvLIuBiSVhMEtmLecTh2mO0tlqrAMp47tBXzMr13NJMQ2lf7RpQGLJ3HsQ==} + /spdx-license-ids@3.0.16: + resolution: {integrity: sha512-eWN+LnM3GR6gPu35WxNgbGl8rmY1AEmoMDvL/QD6zYmPWgywxWqJWNdLGT+ke8dKNWrcYgYjPpG5gbTfghP8rw==} dev: true /split2@3.2.2: diff --git a/src/worker/utils.ts b/src/worker/utils.ts index f88ead7d..e023cc37 100644 --- a/src/worker/utils.ts +++ b/src/worker/utils.ts @@ -28,9 +28,6 @@ export const checkValidWorkerOptions = (opts: WorkerOptions): void => { if (opts?.killHandler != null && typeof opts.killHandler !== 'function') { throw new TypeError('killHandler option is not a function') } - if (opts?.async != null) { - throw new Error('async option is deprecated') - } } export const checkValidTaskFunctionEntry = ( diff --git a/src/worker/worker-options.ts b/src/worker/worker-options.ts index b2efb7ac..a6af1ec0 100644 --- a/src/worker/worker-options.ts +++ b/src/worker/worker-options.ts @@ -56,11 +56,4 @@ export interface WorkerOptions { * @defaultValue `() => {}` */ killHandler?: KillHandler - /** - * Whether your worker will perform asynchronous or not. - * - * @defaultValue false - * @deprecated This option will be removed in the next major version. - */ - async?: boolean } -- 2.34.1