-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat!: bump engines
requirement to Node 22
#1167
base: main
Are you sure you want to change the base?
Changes from all commits
a532b6d
ff49df9
b773b05
bc19e91
237656d
6890b55
a757ac2
3830c5d
8ec9d56
b40e0f3
ee3a1e3
5e5336d
7f79c47
b23b540
5499331
e247cd9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*.d.ts | ||
/node_modules |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
module.exports = { | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
ecmaVersion: 2025, | ||
sourceType: 'module', | ||
}, | ||
plugins: ['mocha', '@typescript-eslint'], | ||
env: { | ||
es6: true, | ||
mocha: true, | ||
node: true, | ||
}, | ||
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'], | ||
rules: { | ||
'mocha/no-exclusive-tests': 'error', | ||
'no-unused-vars': 'off', | ||
'@typescript-eslint/no-unused-vars': [ | ||
'error', | ||
{ | ||
args: 'after-used', | ||
argsIgnorePattern: '^_', | ||
ignoreRestSiblings: true, | ||
vars: 'all', | ||
}, | ||
], | ||
semi: 'off', | ||
'@typescript-eslint/semi': 'error', | ||
'no-unexpected-multiline': 'error', | ||
}, | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// See also: https://github.com/mochajs/mocha/blob/b720ec1b3ca630a90f80311da391b2a0cdfead4e/example/config/.mocharc.js | ||
{ | ||
"$schema": "https://json.schemastore.org/mocharc", | ||
"color": false, | ||
"extensions": [ | ||
"ts" | ||
], | ||
"import": "tsx", | ||
"spec": ["test/*.ts"] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
22.12 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,7 +44,7 @@ npm run rebuild | |
|
||
### What are the requirements? | ||
|
||
Node v12.13.0 or higher is required. Building native modules from source uses | ||
Node v22.12.0 or higher is required. Building native modules from source uses | ||
[`node-gyp`](https://github.com/nodejs/node-gyp#installation), refer to the link for its | ||
installation/runtime requirements. | ||
|
||
|
@@ -102,7 +102,7 @@ for Electron Packager. For example: | |
|
||
```javascript | ||
import packager from '@electron/packager'; | ||
import rebuild from '@electron/rebuild'; | ||
import { rebuild } from '@electron/rebuild'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👏 |
||
|
||
packager({ | ||
// … other options | ||
|
@@ -128,7 +128,7 @@ electron-rebuild is also a library that you can require into your app or | |
build process. It has a very simple API: | ||
|
||
```javascript | ||
import rebuild from '@electron/rebuild'; | ||
import { rebuild } from '@electron/rebuild'; | ||
|
||
// Public: Rebuilds a node_modules directory with the given Electron version. | ||
// | ||
|
@@ -155,7 +155,7 @@ const childProcess = require('child_process'); | |
const pathToElectron = require('electron'); | ||
|
||
rebuild({ | ||
buildPath: __dirname, | ||
buildPath: import.meta.dirname, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if we should document both here, I know that the __dirname vs import.meta.dirname thing keeps tripping people up quite a bit. |
||
electronVersion: '1.4.12' | ||
}) | ||
.then(() => console.info('Rebuild Successful')) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,17 +2,17 @@ | |
"name": "@electron/rebuild", | ||
"version": "0.0.0-development", | ||
"description": "Electron supporting package to rebuild native node modules against the currently installed electron", | ||
"main": "lib/main.js", | ||
"type": "module", | ||
"exports": "./lib/main.js", | ||
"typings": "lib/main.d.ts", | ||
"scripts": { | ||
"compile": "tsc", | ||
"build": "tsc", | ||
"coverage": "npm run prewarm-headers && nyc npm run spec", | ||
"coverage:report": "nyc report --reporter=text-lcov > coverage.lcov", | ||
"watch": "tsc -w", | ||
"prepare": "npm run compile", | ||
"mocha": "cross-env TS_NODE_FILES=true mocha", | ||
"prepare": "npm run build", | ||
"lint": "eslint --ext .ts .", | ||
"spec": "tsc && npm run mocha -- test/*.ts", | ||
"spec": "tsc && mocha", | ||
"test": "npm run prewarm-headers && npm run lint && npm run spec", | ||
"prewarm-headers": "node-gyp install --ensure" | ||
}, | ||
|
@@ -39,7 +39,7 @@ | |
}, | ||
"homepage": "https://github.com/electron/rebuild", | ||
"engines": { | ||
"node": ">=12.13.0" | ||
"node": ">=22.12.0" | ||
}, | ||
"publishConfig": { | ||
"provenance": true | ||
|
@@ -50,8 +50,8 @@ | |
"chalk": "^4.0.0", | ||
"debug": "^4.1.1", | ||
"detect-libc": "^2.0.1", | ||
"fs-extra": "^10.0.0", | ||
"got": "^11.7.0", | ||
"graceful-fs": "^4.2.11", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Appreciate it, thank you |
||
"node-abi": "^3.45.0", | ||
"node-api-version": "^0.2.0", | ||
"ora": "^5.1.0", | ||
|
@@ -62,74 +62,28 @@ | |
}, | ||
"devDependencies": { | ||
"@istanbuljs/nyc-config-typescript": "^1.0.1", | ||
"@tsconfig/node22": "^22.0.0", | ||
"@types/chai": "^4.2.12", | ||
"@types/chai-as-promised": "^7.1.3", | ||
"@types/debug": "^4.1.5", | ||
"@types/fs-extra": "^9.0.1", | ||
"@types/graceful-fs": "^4.1.9", | ||
"@types/mocha": "^10.0.10", | ||
"@types/node": "^17.0.8", | ||
"@types/node": "~22.10.7", | ||
"@types/node-abi": "^3.0.0", | ||
"@types/semver": "^7.3.9", | ||
"@types/tar": "^6.1.0", | ||
"@types/yargs": "^17.0.2", | ||
"@typescript-eslint/eslint-plugin": "^4.0.1", | ||
"@typescript-eslint/parser": "^4.0.1", | ||
"@typescript-eslint/eslint-plugin": "^6.21.0", | ||
"@typescript-eslint/parser": "^6.21.0", | ||
"chai": "^4.2.0", | ||
"chai-as-promised": "^7.1.1", | ||
"cross-env": "^7.0.2", | ||
"electron": "^22.0.0", | ||
"eslint": "^7.7.0", | ||
"eslint-plugin-mocha": "^9.0.0", | ||
"mocha": "^10.8.2", | ||
"mocha": "^11.1.0", | ||
"nyc": "^15.1.0", | ||
"ts-node": "^10.0.0", | ||
"typescript": "^4.0.2" | ||
}, | ||
"eslintConfig": { | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaVersion": 2019, | ||
"sourceType": "module" | ||
}, | ||
"plugins": [ | ||
"mocha", | ||
"@typescript-eslint" | ||
], | ||
"env": { | ||
"es6": true, | ||
"mocha": true, | ||
"node": true | ||
}, | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended" | ||
], | ||
"rules": { | ||
"mocha/no-exclusive-tests": "error", | ||
"no-unused-vars": "off", | ||
"@typescript-eslint/no-unused-vars": [ | ||
"error", | ||
{ | ||
"args": "after-used", | ||
"argsIgnorePattern": "^_", | ||
"ignoreRestSiblings": true, | ||
"vars": "all" | ||
} | ||
], | ||
"semi": "off", | ||
"@typescript-eslint/semi": "error", | ||
"no-unexpected-multiline": "error" | ||
} | ||
}, | ||
"eslintIgnore": [ | ||
"*.d.ts", | ||
"node_modules" | ||
], | ||
"mocha": { | ||
"extensions": [ | ||
"ts" | ||
], | ||
"require": "ts-node/register" | ||
"tsx": "^4.19.3", | ||
"typescript": "~5.4.5" | ||
}, | ||
"nyc": { | ||
"extends": "@istanbuljs/nyc-config-typescript" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting! I'm not against it, just surprised that eslint can't handle d.ts files.