diff --git a/node_modules/@npmcli/run-script/lib/make-spawn-args.js b/node_modules/@npmcli/run-script/lib/make-spawn-args.js index ba3f11102fa18..181be8493f334 100644 --- a/node_modules/@npmcli/run-script/lib/make-spawn-args.js +++ b/node_modules/@npmcli/run-script/lib/make-spawn-args.js @@ -1,3 +1,4 @@ +/* eslint camelcase: "off" */ const isWindows = require('./is-windows.js') const setPATH = require('./set-path.js') const {resolve} = require('path') 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 434b7362a659c..841ed4db32e3d 100644 --- a/node_modules/@npmcli/run-script/lib/run-script-pkg.js +++ b/node_modules/@npmcli/run-script/lib/run-script-pkg.js @@ -4,7 +4,7 @@ const packageEnvs = require('./package-envs.js') const { isNodeGypPackage, defaultGypInstallScript } = require('@npmcli/node-gyp') // you wouldn't like me when I'm angry... -const bruce = (id, event, cmd) =>`\n> ${id ? id + ' ' : ''}${event}\n> ${cmd}\n` +const bruce = (id, event, cmd) => `\n> ${id ? id + ' ' : ''}${event}\n> ${cmd}\n` const runScriptPkg = async options => { const { @@ -20,20 +20,20 @@ const runScriptPkg = async options => { banner = true, } = options + const {scripts = {}, gypfile} = pkg let cmd = null - if (options.cmd) { + if (options.cmd) cmd = options.cmd - } else if (pkg.scripts && pkg.scripts[event]) { + else if (pkg.scripts && pkg.scripts[event]) cmd = pkg.scripts[event] + args.map(a => ` ${JSON.stringify(a)}`).join('') - } else if ( // If there is no preinstall or install script, default to rebuilding node-gyp packages. + else if ( // If there is no preinstall or install script, default to rebuilding node-gyp packages. event === 'install' && - ! pkg.scripts.install && - ! pkg.scripts.preinstall && - pkg.gypfile !== false && + !scripts.install && + !scripts.preinstall && + gypfile !== false && await isNodeGypPackage(path) - ) { + ) cmd = defaultGypInstallScript - } if (!cmd) return { code: 0, signal: null } diff --git a/node_modules/@npmcli/run-script/lib/validate-options.js b/node_modules/@npmcli/run-script/lib/validate-options.js index 1aa1652dacaa5..48ac5c5d9e399 100644 --- a/node_modules/@npmcli/run-script/lib/validate-options.js +++ b/node_modules/@npmcli/run-script/lib/validate-options.js @@ -8,7 +8,6 @@ const validateOptions = options => { scriptShell, env = {}, stdio = 'pipe', - pkg, args = [], cmd, } = options diff --git a/node_modules/@npmcli/run-script/package.json b/node_modules/@npmcli/run-script/package.json index 3f17fed218ceb..2481066cbf3cd 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.1", + "version": "1.7.2", "description": "Run a lifecycle script for a package (descendant of npm-lifecycle)", "author": "Isaac Z. Schlueter (https://izs.me)", "license": "ISC", @@ -8,13 +8,21 @@ "test": "tap", "preversion": "npm test", "postversion": "npm publish", - "prepublishOnly": "git push origin --follow-tags" + "prepublishOnly": "git push origin --follow-tags", + "eslint": "eslint", + "lint": "npm run eslint -- \"lib/**/*.js\"", + "lintfix": "npm run lint -- --fix" }, "tap": { "check-coverage": true, "coverage-map": "map.js" }, "devDependencies": { + "eslint": "^7.10.0", + "eslint-plugin-import": "^2.22.1", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^4.2.1", + "eslint-plugin-standard": "^4.0.1", "minipass": "^3.1.1", "require-inject": "^1.4.4", "tap": "^14.10.6" diff --git a/package-lock.json b/package-lock.json index 0282c7157cf9f..89dfe43e6590c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -526,9 +526,9 @@ } }, "node_modules/@npmcli/run-script": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-1.7.1.tgz", - "integrity": "sha512-16GKM0Zyw1cSfQPbBN7cwrLMneM0QhAYYiamae5w8802VKK7HT7Gd5AkJHVljsL/BYLxhTV3I5FxAjwJa7S+RA==", + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-1.7.2.tgz", + "integrity": "sha512-EZO9uXrZrfzdIJsNi/WwrP2jt1P0lbFSxOq15ljgYn1/rr4UyQXUKBZRURioFVbUb7Z1BJDEKswnWrtRybZPzw==", "inBundle": true, "dependencies": { "@npmcli/node-gyp": "^1.0.0", @@ -8632,9 +8632,9 @@ } }, "@npmcli/run-script": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-1.7.1.tgz", - "integrity": "sha512-16GKM0Zyw1cSfQPbBN7cwrLMneM0QhAYYiamae5w8802VKK7HT7Gd5AkJHVljsL/BYLxhTV3I5FxAjwJa7S+RA==", + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-1.7.2.tgz", + "integrity": "sha512-EZO9uXrZrfzdIJsNi/WwrP2jt1P0lbFSxOq15ljgYn1/rr4UyQXUKBZRURioFVbUb7Z1BJDEKswnWrtRybZPzw==", "requires": { "@npmcli/node-gyp": "^1.0.0", "@npmcli/promise-spawn": "^1.2.0",