Skip to content

Commit

Permalink
deps: @npmcli/run-script@6.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
wraithgar committed May 17, 2023
1 parent 7751dd4 commit 35e2e9a
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 14 deletions.
4 changes: 4 additions & 0 deletions node_modules/@npmcli/run-script/lib/run-script-pkg.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,11 @@ const runScriptPkg = async options => {
return p.catch(er => {
const { signal } = er
if (stdio === 'inherit' && signal) {
// by the time we reach here, the child has already exited. we send the
// signal back to ourselves again so that npm will exit with the same
// status as the child
process.kill(process.pid, signal)

// just in case we don't die, reject after 500ms
// this also keeps the node process open long enough to actually
// get the signal, rather than terminating gracefully.
Expand Down
14 changes: 8 additions & 6 deletions node_modules/@npmcli/run-script/lib/signal-manager.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
const runningProcs = new Set()
let handlersInstalled = false

// NOTE: these signals aren't actually forwarded anywhere. they're trapped and
// ignored until all child processes have exited. in our next breaking change
// we should rename this
const forwardedSignals = [
'SIGINT',
'SIGTERM',
]

const handleSignal = signal => {
for (const proc of runningProcs) {
proc.kill(signal)
}
}

// no-op, this is so receiving the signal doesn't cause us to exit immediately
// instead, we exit after all children have exited when we re-send the signal
// to ourselves. see the catch handler at the bottom of run-script-pkg.js
// istanbul ignore next - this function does nothing
const handleSignal = () => {}
const setupListeners = () => {
for (const signal of forwardedSignals) {
process.on(signal, handleSignal)
Expand Down
6 changes: 3 additions & 3 deletions node_modules/@npmcli/run-script/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@npmcli/run-script",
"version": "6.0.1",
"version": "6.0.2",
"description": "Run a lifecycle script for a package (descendant of npm-lifecycle)",
"author": "GitHub Inc.",
"license": "ISC",
Expand All @@ -16,7 +16,7 @@
},
"devDependencies": {
"@npmcli/eslint-config": "^4.0.0",
"@npmcli/template-oss": "4.14.1",
"@npmcli/template-oss": "4.15.1",
"require-inject": "^1.4.4",
"tap": "^16.0.1"
},
Expand All @@ -41,7 +41,7 @@
},
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"version": "4.14.1",
"version": "4.15.1",
"publish": "true"
},
"tap": {
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"@npmcli/config": "^6.1.6",
"@npmcli/map-workspaces": "^3.0.4",
"@npmcli/package-json": "^3.0.0",
"@npmcli/run-script": "^6.0.1",
"@npmcli/run-script": "^6.0.2",
"abbrev": "^2.0.0",
"archy": "~1.0.0",
"cacache": "^17.1.0",
Expand Down Expand Up @@ -2346,9 +2346,9 @@
}
},
"node_modules/@npmcli/run-script": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-6.0.1.tgz",
"integrity": "sha512-Yi04ZSold8jcbBJD/ahKMJSQCQifH8DAbMwkBvoLaTpGFxzHC3B/5ZyoVR69q/4xedz84tvi9DJOJjNe17h+LA==",
"version": "6.0.2",
"resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-6.0.2.tgz",
"integrity": "sha512-NCcr1uQo1k5U+SYlnIrbAh3cxy+OQT1VtqiAbxdymSlptbzBb62AjH2xXgjNCoP073hoa1CfCAcwoZ8k96C4nA==",
"inBundle": true,
"dependencies": {
"@npmcli/node-gyp": "^3.0.0",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"@npmcli/config": "^6.1.6",
"@npmcli/map-workspaces": "^3.0.4",
"@npmcli/package-json": "^3.0.0",
"@npmcli/run-script": "^6.0.1",
"@npmcli/run-script": "^6.0.2",
"abbrev": "^2.0.0",
"archy": "~1.0.0",
"cacache": "^17.1.0",
Expand Down

0 comments on commit 35e2e9a

Please sign in to comment.