File tree Expand file tree Collapse file tree 5 files changed +20
-14
lines changed 
node_modules/@npmcli/run-script Expand file tree Collapse file tree 5 files changed +20
-14
lines changed Original file line number Diff line number Diff line change @@ -94,7 +94,11 @@ const runScriptPkg = async options => {
9494  return  p . catch ( er  =>  { 
9595    const  {  signal }  =  er 
9696    if  ( stdio  ===  'inherit'  &&  signal )  { 
97+       // by the time we reach here, the child has already exited. we send the 
98+       // signal back to ourselves again so that npm will exit with the same 
99+       // status as the child 
97100      process . kill ( process . pid ,  signal ) 
101+ 
98102      // just in case we don't die, reject after 500ms 
99103      // this also keeps the node process open long enough to actually 
100104      // get the signal, rather than terminating gracefully. 
Original file line number Diff line number Diff line change 11const  runningProcs  =  new  Set ( ) 
22let  handlersInstalled  =  false 
33
4+ // NOTE: these signals aren't actually forwarded anywhere. they're trapped and 
5+ // ignored until all child processes have exited. in our next breaking change 
6+ // we should rename this 
47const  forwardedSignals  =  [ 
58  'SIGINT' , 
69  'SIGTERM' , 
710] 
811
9- const  handleSignal  =  signal  =>  { 
10-   for  ( const  proc  of  runningProcs )  { 
11-     proc . kill ( signal ) 
12-   } 
13- } 
14- 
12+ // no-op, this is so receiving the signal doesn't cause us to exit immediately 
13+ // instead, we exit after all children have exited when we re-send the signal 
14+ // to ourselves. see the catch handler at the bottom of run-script-pkg.js 
15+ // istanbul ignore next - this function does nothing 
16+ const  handleSignal  =  ( )  =>  { } 
1517const  setupListeners  =  ( )  =>  { 
1618  for  ( const  signal  of  forwardedSignals )  { 
1719    process . on ( signal ,  handleSignal ) 
Original file line number Diff line number Diff line change 11{
22  "name" : " @npmcli/run-script" 
3-   "version" : " 6.0.1 " 
3+   "version" : " 6.0.2 " 
44  "description" : " Run a lifecycle script for a package (descendant of npm-lifecycle)" 
55  "author" : " GitHub Inc." 
66  "license" : " ISC" 
1616  },
1717  "devDependencies" : {
1818    "@npmcli/eslint-config" : " ^4.0.0" 
19-     "@npmcli/template-oss" : " 4.14 .1" 
19+     "@npmcli/template-oss" : " 4.15 .1" 
2020    "require-inject" : " ^1.4.4" 
2121    "tap" : " ^16.0.1" 
2222  },
4141  },
4242  "templateOSS" : {
4343    "//@npmcli/template-oss" : " This file is partially managed by @npmcli/template-oss. Edits may be overwritten." 
44-     "version" : " 4.14 .1" 
44+     "version" : " 4.15 .1" 
4545    "publish" : " true" 
4646  },
4747  "tap" : {
Original file line number Diff line number Diff line change 8888        "@npmcli/config": "^6.1.6",
8989        "@npmcli/map-workspaces": "^3.0.4",
9090        "@npmcli/package-json": "^3.0.0",
91-         "@npmcli/run-script": "^6.0.1 ",
91+         "@npmcli/run-script": "^6.0.2 ",
9292        "abbrev": "^2.0.0",
9393        "archy": "~1.0.0",
9494        "cacache": "^17.1.0",
23462346      }
23472347    },
23482348    "node_modules/@npmcli/run-script": {
2349-       "version": "6.0.1 ",
2350-       "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-6.0.1 .tgz",
2351-       "integrity": "sha512-Yi04ZSold8jcbBJD/ahKMJSQCQifH8DAbMwkBvoLaTpGFxzHC3B/5ZyoVR69q/4xedz84tvi9DJOJjNe17h+LA ==",
2349+       "version": "6.0.2 ",
2350+       "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-6.0.2 .tgz",
2351+       "integrity": "sha512-NCcr1uQo1k5U+SYlnIrbAh3cxy+OQT1VtqiAbxdymSlptbzBb62AjH2xXgjNCoP073hoa1CfCAcwoZ8k96C4nA ==",
23522352      "inBundle": true,
23532353      "dependencies": {
23542354        "@npmcli/node-gyp": "^3.0.0",
Original file line number Diff line number Diff line change 5757    "@npmcli/config" : " ^6.1.6" 
5858    "@npmcli/map-workspaces" : " ^3.0.4" 
5959    "@npmcli/package-json" : " ^3.0.0" 
60-     "@npmcli/run-script" : " ^6.0.1 " 
60+     "@npmcli/run-script" : " ^6.0.2 " 
6161    "abbrev" : " ^2.0.0" 
6262    "archy" : " ~1.0.0" 
6363    "cacache" : " ^17.1.0" 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments