From 16b294b57758792c6bb8f9719f28d068f323b3c0 Mon Sep 17 00:00:00 2001 From: Anton Golub Date: Sat, 6 Apr 2024 19:52:24 +0300 Subject: [PATCH] perf: update zx to v8 --- package-lock.json | 18 +++++++++--------- package.json | 4 ++-- src/test/js/test.mjs | 15 +++++++++++---- 3 files changed, 22 insertions(+), 15 deletions(-) diff --git a/package-lock.json b/package-lock.json index b6f9588..2897dd1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "@qiwi/deep-proxy": "^3.0.0", "@types/ip": "^1.1.3", - "@types/node": "^20.11.30", + "@types/node": "^20.12.5", "@types/semver": "^7.5.8", "globby-cp": "^1.3.0", "ini": "^4.1.2", @@ -21,7 +21,7 @@ "semver": "^7.6.0", "ssri": "^10.0.5", "tempy": "^3.1.0", - "zx": "7.2.3-dev.0844b88" + "zx": "8.0.0" }, "bin": { "zx-extra": "src/main/js/cli.mjs" @@ -187,9 +187,9 @@ } }, "node_modules/@types/node": { - "version": "20.12.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.2.tgz", - "integrity": "sha512-zQ0NYO87hyN6Xrclcqp7f8ZbXNbRfoGWNcMvHTPQp9UUrwI0mI7XBz+cu7/W6/VClYo2g63B0cjull/srU7LgQ==", + "version": "20.12.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.5.tgz", + "integrity": "sha512-BD+BjQ9LS/D8ST9p5uqBxghlN+S42iuNxjsUGjeZobe/ciXzk2qb1B6IXc6AnRLS+yFJRpN2IPEHMzwspfDJNw==", "dependencies": { "undici-types": "~5.26.4" } @@ -1628,9 +1628,9 @@ } }, "node_modules/zx": { - "version": "7.2.3-dev.0844b88", - "resolved": "https://registry.npmjs.org/zx/-/zx-7.2.3-dev.0844b88.tgz", - "integrity": "sha512-+PpsWDmRV8CAhU29pFgFTSRdo9olhIJvrv5ItPIC4U+BsqdMrumIFXrMeoB8XEABlCJBi5DjH/nFxiBgVe+rpg==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/zx/-/zx-8.0.0.tgz", + "integrity": "sha512-td4Irxh+i+O8waolUHZyHLSMFALMBWTNVKBk1q5NsvP1vxRqj9JJRGPh6YjKZUTbZZ8uGD1mQLyU9mDr40wR6w==", "bin": { "zx": "build/cli.js" }, @@ -1639,7 +1639,7 @@ }, "optionalDependencies": { "@types/fs-extra": "^11.0.4", - "@types/node": ">=20.11.30" + "@types/node": ">=20.12.4" } } } diff --git a/package.json b/package.json index 928a2e0..f7f7391 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "dependencies": { "@qiwi/deep-proxy": "^3.0.0", "@types/ip": "^1.1.3", - "@types/node": "^20.11.30", + "@types/node": "^20.12.5", "@types/semver": "^7.5.8", "globby-cp": "^1.3.0", "ini": "^4.1.2", @@ -50,7 +50,7 @@ "semver": "^7.6.0", "ssri": "^10.0.5", "tempy": "^3.1.0", - "zx": "7.2.3-dev.0844b88" + "zx": "8.0.0" }, "devDependencies": { "c8": "^9.1.0" diff --git a/src/test/js/test.mjs b/src/test/js/test.mjs index 53669ce..b705a9a 100644 --- a/src/test/js/test.mjs +++ b/src/test/js/test.mjs @@ -12,7 +12,8 @@ import { fs, path, SSRI, - INI + INI, + ps } from '../../main/js/index.mjs' // $.verbose @@ -107,16 +108,22 @@ password = dbpassword // hooks { - const SIGNAL = 'SIGTERM' + const SIGNAL = 'SIGKILL' const nothrow = createHook({nothrow: true}, 'nothrow') - const quiet = createHook({ verbose: 0 }, 'quiet') + const quiet = createHook({ verbose: 0, quiet: true }, 'quiet') const debug = createHook({ verbose: 2 }, 'debug') const timeout = createHook( null, 'timeout', (p, t, signal) => { if (!t) return p - let timer = setTimeout(() => p.kill(signal), t) + let timer = setTimeout(() => { + console.log('p.pid', p.child.pid); + (async () => { + console.log('ps', await ps.tree({ pid: p.child.pid, recursive: true })) + })() + p.kill(signal) + }, t) p.finally(() => clearTimeout(timer))