Skip to content

Commit

Permalink
feat: support Node.js v22 (#243)
Browse files Browse the repository at this point in the history
  • Loading branch information
fengmk2 committed Jun 5, 2024
1 parent 799f075 commit 2260972
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .autod.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = {
dep: [
'moment',
'nan',
'@xprofiler/node-pre-gyp',
'@mapbox/node-pre-gyp',
'uuid',
'yargs',
],
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
{os: "macos-latest", arch: "x64"},
{os: "ubuntu-latest", arch: "x64"},
]
node-version: [ 12, 14, 16, 18, 20, 21 ]
node-version: [ 12, 14, 16, 18, 20, 21, 22 ]
steps:
- name: Set up Python
uses: actions/setup-python@v4
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ xprofiler 插件支持三大主流操作系统:
- v19.x
- v20.x
- v21.x
- v22.x

更低的版本因为在此项目创建时已经不在官方 LTS 计划中,故正常情况下不再支持。

Expand All @@ -52,7 +53,7 @@ npm i xprofiler --save --xprofiler_binary_host_mirror=https://npmmirror.com/mirr
npm i xprofiler --save --xprofiler_binary_host_mirror=http://devtoolx.com/xprofiler
```

> 这里使用了 `@xprofiler/node-pre-gyp` 帮助开发者无需进行本地编译即可使用此插件,默认插件位于 [Github Release](https://github.com/X-Profiler/xprofiler/releases) 页面,国内访问可能较慢,你也可以自行镜像到其它位置加速安装。
> 这里使用了 `@mapbox/node-pre-gyp` 帮助开发者无需进行本地编译即可使用此插件,默认插件位于 [Github Release](https://github.com/X-Profiler/xprofiler/releases) 页面,国内访问可能较慢,你也可以自行镜像到其它位置加速安装。
### 嵌入项目

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
},
"homepage": "https://github.com/X-Profiler/xprofiler#readme",
"dependencies": {
"@xprofiler/node-pre-gyp": "^1.0.11",
"@mapbox/node-pre-gyp": "^1.0.11",
"moment": "^2.30.1",
"nan": "^2.18.0",
"uuid": "^9.0.1",
Expand Down
2 changes: 1 addition & 1 deletion scripts/copy.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const { promisify } = require('util');
const exists = promisify(fs.exists);
const mkdir = promisify(fs.mkdir);
const copyFile = promisify(fs.copyFile);
const versioning = require('@xprofiler/node-pre-gyp/lib/util/versioning.js');
const versioning = require('@mapbox/node-pre-gyp/lib/util/versioning.js');
const { staged_tarball: packagePath } = versioning.evaluate(require('../package.json'));

async function copy() {
Expand Down
1 change: 1 addition & 0 deletions scripts/versions.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ exports.os8u = [
'node-v19.9.0',
'node-v20.10.0',
'node-v21.5.0',
'node-v22.1.0',
];
2 changes: 1 addition & 1 deletion xprofiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const pkg = require('./package.json');
const workerThreads = require('./lib/worker_threads');

// xprofiler.node
const binary = require('@xprofiler/node-pre-gyp');
const binary = require('@mapbox/node-pre-gyp');
const bindingPath = binary.find(path.resolve(path.join(__dirname, './package.json')));
const xprofiler = require(bindingPath);
xprofiler.setup({
Expand Down

0 comments on commit 2260972

Please sign in to comment.