From 30bcdd1fa4454f68b7350352d79520d4270f99f5 Mon Sep 17 00:00:00 2001 From: hyj1991 Date: Mon, 10 May 2021 14:24:54 +0800 Subject: [PATCH] feat: support node-v16.x PR-URL: https://github.com/X-Profiler/xprofiler/pull/97 Reviewed-BY: hyj1991 --- .github/workflows/nodejs.yml | 6 +++--- README.md | 1 + appveyor.yml | 3 ++- package.json | 6 +++--- scripts/7u.js | 1 + scripts/common.js | 1 + test/start.test.js | 8 ++++---- 7 files changed, 15 insertions(+), 11 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 64f6e0f..5bd5df1 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -12,8 +12,8 @@ jobs: strategy: fail-fast: false matrix: - os: [ ubuntu-latest, macOS-latest ] - node-version: [ 8, 9, 10, 11, 12, 13, 14, 15 ] + os: [ ubuntu-latest, macos-latest ] + node-version: [ 8, 9, 10, 11, 12, 13, 14, 15, 16 ] steps: - name: Checkout Git Source uses: actions/checkout@master @@ -27,4 +27,4 @@ jobs: run: npm i -g npminstall && npminstall - name: Continuous integration - run: npm run ci \ No newline at end of file + run: npm run ci diff --git a/README.md b/README.md index 228f29d..fb9b114 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ xprofiler 插件支持三大主流操作系统: - v13.x - v14.x - v15.x +- v16.x 更低的版本因为已经不在官方 LTS 计划中,故正常情况下不再支持。 diff --git a/appveyor.yml b/appveyor.yml index d325640..2c592a9 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -14,11 +14,12 @@ environment: - nodejs_version: "13" - nodejs_version: "14" - nodejs_version: "15" + - nodejs_version: "16" # Install scripts. (runs after repo cloning) install: # Get the latest stable version of Node.js or io.js - - ps: Install-Product node $env:nodejs_version x64 + - ps: Update-NodeJsInstallation (Get-NodeJsLatestBuild $env:nodejs_version) $env:PLATFORM # install modules - npm install diff --git a/package.json b/package.json index 5f7b765..89eae8f 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ }, "homepage": "https://github.com/X-Profiler/xprofiler#readme", "dependencies": { - "@mapbox/node-pre-gyp": "^1.0.3", + "@mapbox/node-pre-gyp": "^1.0.4", "moment": "^2.29.1", "nan": "^2.14.2", "uuid": "^8.3.2", @@ -73,11 +73,11 @@ "mocha": "^7.2.0", "nyc": "^15.1.0", "tunnel-agent": "^0.6.0", - "urllib": "^2.37.0" + "urllib": "^2.37.1" }, "xctlIpcPath": { "unix": "xprofiler-ctl-uds-path.sock", "win32": "xprofiler-ctl" }, "blurryTag": "__" -} \ No newline at end of file +} diff --git a/scripts/7u.js b/scripts/7u.js index 2d0d2c2..9d6fe41 100644 --- a/scripts/7u.js +++ b/scripts/7u.js @@ -7,6 +7,7 @@ const nodeVersions = [ 'node-v13.14.0', 'node-v14.6.0', 'node-v15.1.0', + 'node-v16.0.0', ]; build(nodeVersions); \ No newline at end of file diff --git a/scripts/common.js b/scripts/common.js index 3b26a6f..ae3c04e 100644 --- a/scripts/common.js +++ b/scripts/common.js @@ -11,6 +11,7 @@ const nodeVersions = [ 'node-v13.14.0', 'node-v14.6.0', 'node-v15.1.0', + 'node-v16.0.0', ]; build(nodeVersions); \ No newline at end of file diff --git a/test/start.test.js b/test/start.test.js index 8259bf5..60fa8a2 100644 --- a/test/start.test.js +++ b/test/start.test.js @@ -53,8 +53,8 @@ describe(`xprofiler starting`, function () { expect(aliveProcess[1]).to.be(logdir); }); - it(`.xprofiler cwd: ${aliveProcess[2]} should be ${/^([.\w()/\\:-]+|)$/}`, function () { - expect(/^([.\w()/\\:-]+|)$/.test(aliveProcess[2])).to.be.ok(); + it(`.xprofiler cwd: ${aliveProcess[2]} should be ${/^([.\w()/\\:-@]+|)$/}`, function () { + expect(/^([.\w()/\\:-@]+|)$/.test(aliveProcess[2])).to.be.ok(); }); it(`.xprofiler executable: ${aliveProcess[3]} should be node-${process.version}`, function () { @@ -66,8 +66,8 @@ describe(`xprofiler starting`, function () { expect(version).to.be(process.version); }); - it(`.xprofiler file: ${aliveProcess[4]} should be ${/^([.\w()/\\:-]+|)$/}`, function () { - expect(/^([.\w()/\\:-]+|)$/.test(aliveProcess[4])).to.be.ok(); + it(`.xprofiler file: ${aliveProcess[4]} should be ${/^([.\w()/\\:-@]+|)$/}`, function () { + expect(/^([.\w()/\\:-@]+|)$/.test(aliveProcess[4])).to.be.ok(); }); it(`.xprofiler module path: ${aliveProcess[5]} should be ${path.join(__dirname, '..')}`, function () {