Skip to content

Commit

Permalink
chore!: bump engines requirement to Node 22
Browse files Browse the repository at this point in the history
BREAKING CHANGE: bumps required Node.js version to >=22.0.0
  • Loading branch information
erickzhao committed Jan 10, 2025
1 parent 6db692b commit c776075
Show file tree
Hide file tree
Showing 5 changed files with 785 additions and 437 deletions.
15 changes: 2 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,18 @@ jobs:
strategy:
matrix:
node-version:
- '20.9'
- '18.17'
- '16.20'
- '14.16'
- '22.13'
runs-on: macos-latest
steps:
- name: Install Rosetta
if: ${{ matrix.node-version == '14.16' }}
run: /usr/sbin/softwareupdate --install-rosetta --agree-to-license
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Node.js
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: "${{ matrix.node-version }}"
cache: 'yarn'
architecture: ${{ matrix.node-version == '14.16' && 'x64' || env.RUNNER_ARCH }}
- name: Install (Node.js v16+)
if : ${{ matrix.node-version != '14.16' }}
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Install (Node.js < v16)
if : ${{ matrix.node-version == '14.16' }}
run: yarn install --frozen-lockfile --ignore-engines
- name: Lint
run: yarn lint
- name: Test
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22.13.0
8 changes: 3 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,27 +26,25 @@
"lib"
],
"engines": {
"node": ">= 10.0.0"
"node": ">= 22.0.0"
},
"publishConfig": {
"provenance": true
},
"devDependencies": {
"@types/debug": "^4.1.5",
"@types/fs-extra": "^9.0.1",
"@types/jest": "^29.0.0",
"@types/node": "^13.7.7",
"@types/node": "^22.10.5",
"@types/promise-retry": "^1.1.3",
"jest": "^29.0.0",
"prettier": "^3.4.2",
"ts-jest": "^29.0.0",
"typedoc": "~0.25.13",
"typedoc-plugin-missing-exports": "^2.2.0",
"typescript": "4.9.3"
"typescript": "~5.4.5"
},
"dependencies": {
"debug": "^4.1.1",
"fs-extra": "^9.0.1",
"promise-retry": "^2.0.1"
}
}
11 changes: 6 additions & 5 deletions src/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import debug from 'debug';
import * as fs from 'fs-extra';
import * as os from 'os';
import * as path from 'path';

import * as fs from 'node:fs/promises';
import * as os from 'node:os';
import * as path from 'node:path';

const d = debug('electron-notarize:helpers');

Expand All @@ -13,11 +14,11 @@ export async function withTempDir<T>(fn: (dir: string) => Promise<T>) {
result = await fn(dir);
} catch (err) {
d('work failed');
await fs.remove(dir);
await fs.rm(dir, { recursive: true });
throw err;
}
d('work succeeded');
await fs.remove(dir);
await fs.rm(dir, { recursive: true });
return result;
}

Expand Down
Loading

0 comments on commit c776075

Please sign in to comment.