diff options
author | Ruy Adorno <ruyadorno@hotmail.com> | 2020-10-30 20:57:48 +0300 |
---|---|---|
committer | Ruy Adorno <ruyadorno@hotmail.com> | 2020-10-30 20:57:48 +0300 |
commit | 4156f053ee8712a4b53a210e62fba1e6562ba43a (patch) | |
tree | 7665a30910422e34f523348e406d50307670f24a | |
parent | f75db82140b5824fa53c80aa4d94aee9e91d4e2b (diff) |
@npmcli/run-script@1.7.4
-rw-r--r-- | node_modules/@npmcli/run-script/lib/is-server-package.js | 10 | ||||
-rw-r--r-- | node_modules/@npmcli/run-script/lib/run-script-pkg.js | 3 | ||||
-rw-r--r-- | node_modules/@npmcli/run-script/lib/signal-manager.js | 3 | ||||
-rw-r--r-- | node_modules/@npmcli/run-script/package.json | 2 | ||||
-rw-r--r-- | package-lock.json | 14 | ||||
-rw-r--r-- | package.json | 2 |
6 files changed, 23 insertions, 11 deletions
diff --git a/node_modules/@npmcli/run-script/lib/is-server-package.js b/node_modules/@npmcli/run-script/lib/is-server-package.js new file mode 100644 index 000000000..667a3c4f2 --- /dev/null +++ b/node_modules/@npmcli/run-script/lib/is-server-package.js @@ -0,0 +1,10 @@ +const { stat } = require('fs').promises +const { resolve } = require('path') +module.exports = async path => { + try { + const st = await stat(resolve(path, 'server.js')) + return st.isFile() + } catch (er) { + return false + } +} diff --git a/node_modules/@npmcli/run-script/lib/run-script-pkg.js b/node_modules/@npmcli/run-script/lib/run-script-pkg.js index e7d7368be..5980376f5 100644 --- a/node_modules/@npmcli/run-script/lib/run-script-pkg.js +++ b/node_modules/@npmcli/run-script/lib/run-script-pkg.js @@ -3,6 +3,7 @@ const promiseSpawn = require('@npmcli/promise-spawn') const packageEnvs = require('./package-envs.js') const { isNodeGypPackage, defaultGypInstallScript } = require('@npmcli/node-gyp') const signalManager = require('./signal-manager.js') +const isServerPackage = require('./is-server-package.js') // you wouldn't like me when I'm angry... const bruce = (id, event, cmd) => `\n> ${id ? id + ' ' : ''}${event}\n> ${cmd}\n` @@ -35,6 +36,8 @@ const runScriptPkg = async options => { await isNodeGypPackage(path) ) cmd = defaultGypInstallScript + else if (event === 'start' && await isServerPackage(path)) + cmd = 'node server.js' + args.map(a => ` ${JSON.stringify(a)}`).join('') if (!cmd) return { code: 0, signal: null } diff --git a/node_modules/@npmcli/run-script/lib/signal-manager.js b/node_modules/@npmcli/run-script/lib/signal-manager.js index 30627e5da..556e758c2 100644 --- a/node_modules/@npmcli/run-script/lib/signal-manager.js +++ b/node_modules/@npmcli/run-script/lib/signal-manager.js @@ -33,8 +33,7 @@ const add = proc => { if (!handlersInstalled) setupListeners() - proc.once('exit', ({ code }) => { - process.exitCode = process.exitCode || code + proc.once('exit', () => { runningProcs.delete(proc) cleanupListeners() }) diff --git a/node_modules/@npmcli/run-script/package.json b/node_modules/@npmcli/run-script/package.json index 3a1598fad..5ec3bb5b6 100644 --- a/node_modules/@npmcli/run-script/package.json +++ b/node_modules/@npmcli/run-script/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/run-script", - "version": "1.7.3", + "version": "1.7.4", "description": "Run a lifecycle script for a package (descendant of npm-lifecycle)", "author": "Isaac Z. Schlueter <i@izs.me> (https://izs.me)", "license": "ISC", diff --git a/package-lock.json b/package-lock.json index af5583e23..ef9dfa732 100644 --- a/package-lock.json +++ b/package-lock.json @@ -81,7 +81,7 @@ "@npmcli/arborist": "^1.0.4", "@npmcli/ci-detect": "^1.2.0", "@npmcli/config": "^1.2.1", - "@npmcli/run-script": "^1.7.0", + "@npmcli/run-script": "^1.7.4", "abbrev": "~1.1.1", "ansicolors": "~0.3.2", "ansistyles": "~0.1.3", @@ -524,9 +524,9 @@ } }, "node_modules/@npmcli/run-script": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-1.7.3.tgz", - "integrity": "sha512-kijsbIhpdai+DjZJ8NiHpAl/bQdJf0+hv2qy4pES7QuEXdfulB04HCMbgmmpwAulE88aOXjAj1zo1h8LVMKcWg==", + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-1.7.4.tgz", + "integrity": "sha512-GAeOB6P4/aYyvEbROVHXuSGPgy4wwQN/fGfXP993o9btyuCAOaz0T2cr5Y1y4nSeaBPfhk5W/E/AfFKDt6yG7w==", "inBundle": true, "dependencies": { "@npmcli/node-gyp": "^1.0.0", @@ -9166,9 +9166,9 @@ } }, "@npmcli/run-script": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-1.7.3.tgz", - "integrity": "sha512-kijsbIhpdai+DjZJ8NiHpAl/bQdJf0+hv2qy4pES7QuEXdfulB04HCMbgmmpwAulE88aOXjAj1zo1h8LVMKcWg==", + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-1.7.4.tgz", + "integrity": "sha512-GAeOB6P4/aYyvEbROVHXuSGPgy4wwQN/fGfXP993o9btyuCAOaz0T2cr5Y1y4nSeaBPfhk5W/E/AfFKDt6yG7w==", "requires": { "@npmcli/node-gyp": "^1.0.0", "@npmcli/promise-spawn": "^1.3.0", diff --git a/package.json b/package.json index 74e0e7a82..3709d26de 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "@npmcli/arborist": "^1.0.4", "@npmcli/ci-detect": "^1.2.0", "@npmcli/config": "^1.2.1", - "@npmcli/run-script": "^1.7.0", + "@npmcli/run-script": "^1.7.4", "abbrev": "~1.1.1", "ansicolors": "~0.3.2", "ansistyles": "~0.1.3", |