diff --git a/node_modules/libnpmversion/lib/version.js b/node_modules/libnpmversion/lib/version.js index 309b9c2b9504f..31e6023f017a5 100644 --- a/node_modules/libnpmversion/lib/version.js +++ b/node_modules/libnpmversion/lib/version.js @@ -10,11 +10,6 @@ const commit = require('./commit.js') const tag = require('./tag.js') const runScript = require('@npmcli/run-script') -const runner = opts => event => runScript({ - ...opts, - stdio: 'inherit', - event, -}) module.exports = async (newversion, opts) => { const { @@ -64,17 +59,19 @@ module.exports = async (newversion, opts) => { // returns false if we should not keep doing git stuff const doGit = gitTagVersion && isGitDir && await enforceClean(opts) - const runScript = ignoreScripts ? () => {} : runner({ - ...opts, - pkg, - env: { - npm_old_version: current, - npm_new_version: newV, - }, - }) - - - await runScript('preversion') + if (!ignoreScripts) { + await runScript({ + ...opts, + pkg, + stdio: 'inherit', + event: 'preversion', + banner: log.level !== 'silent', + env: { + npm_old_version: current, + npm_new_version: newV, + }, + }) + } // - update the files pkg.version = newV @@ -96,7 +93,19 @@ module.exports = async (newversion, opts) => { } catch (er) {} } - await runScript('version') + if (!ignoreScripts) { + await runScript({ + ...opts, + pkg, + stdio: 'inherit', + event: 'version', + banner: log.level !== 'silent', + env: { + npm_old_version: current, + npm_new_version: newV, + }, + }) + } if (doGit) { // - git add, git commit, git tag @@ -110,7 +119,19 @@ module.exports = async (newversion, opts) => { } else log.verbose('version', 'Not tagging: not in a git repo or no git cmd') - await runScript('postversion') + if (!ignoreScripts) { + await runScript({ + ...opts, + pkg, + stdio: 'inherit', + event: 'postversion', + banner: log.level !== 'silent', + env: { + npm_old_version: current, + npm_new_version: newV, + }, + }) + } return newV } diff --git a/node_modules/libnpmversion/package.json b/node_modules/libnpmversion/package.json index 8930d69a43f10..3d15bbc2f7f72 100644 --- a/node_modules/libnpmversion/package.json +++ b/node_modules/libnpmversion/package.json @@ -1,6 +1,6 @@ { "name": "libnpmversion", - "version": "1.0.10", + "version": "1.0.11", "main": "lib/index.js", "files": [ "lib/*.js" @@ -29,7 +29,7 @@ }, "dependencies": { "@npmcli/git": "^2.0.6", - "@npmcli/run-script": "^1.8.2", + "@npmcli/run-script": "^1.8.3", "read-package-json-fast": "^2.0.1", "semver": "^7.3.4", "stringify-package": "^1.0.1" diff --git a/package-lock.json b/package-lock.json index a145fd4cec3a5..a0562456942f6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -284,7 +284,7 @@ "libnpmpublish": "^4.0.0", "libnpmsearch": "^3.1.0", "libnpmteam": "^2.0.2", - "libnpmversion": "^1.0.10", + "libnpmversion": "^1.0.11", "make-fetch-happen": "^8.0.14", "minipass": "^3.1.3", "minipass-pipeline": "^1.2.4", @@ -4867,13 +4867,13 @@ } }, "node_modules/libnpmversion": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/libnpmversion/-/libnpmversion-1.0.10.tgz", - "integrity": "sha512-2+HLMyCISKLkGndy2JpEDR8bzcYP+J16IA4PF7XBmwczlJXCPNWzAVsK8i0vVHDZWofdfcfzWuUwFqijkgojLw==", + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/libnpmversion/-/libnpmversion-1.0.11.tgz", + "integrity": "sha512-HKbfJ0wwx+W9Br4bvbHUMN/YIe7B8qmFtdaLZnXEUozaaTD6gGpIEf1aH1xRlGfNPocT6YBz3O6+RAgSndAgbA==", "inBundle": true, "dependencies": { "@npmcli/git": "^2.0.6", - "@npmcli/run-script": "^1.8.2", + "@npmcli/run-script": "^1.8.3", "read-package-json-fast": "^2.0.1", "semver": "^7.3.4", "stringify-package": "^1.0.1" @@ -14245,12 +14245,12 @@ } }, "libnpmversion": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/libnpmversion/-/libnpmversion-1.0.10.tgz", - "integrity": "sha512-2+HLMyCISKLkGndy2JpEDR8bzcYP+J16IA4PF7XBmwczlJXCPNWzAVsK8i0vVHDZWofdfcfzWuUwFqijkgojLw==", + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/libnpmversion/-/libnpmversion-1.0.11.tgz", + "integrity": "sha512-HKbfJ0wwx+W9Br4bvbHUMN/YIe7B8qmFtdaLZnXEUozaaTD6gGpIEf1aH1xRlGfNPocT6YBz3O6+RAgSndAgbA==", "requires": { "@npmcli/git": "^2.0.6", - "@npmcli/run-script": "^1.8.2", + "@npmcli/run-script": "^1.8.3", "read-package-json-fast": "^2.0.1", "semver": "^7.3.4", "stringify-package": "^1.0.1" diff --git a/package.json b/package.json index 37bc0db4416a5..726b2991727ee 100644 --- a/package.json +++ b/package.json @@ -74,7 +74,7 @@ "libnpmpublish": "^4.0.0", "libnpmsearch": "^3.1.0", "libnpmteam": "^2.0.2", - "libnpmversion": "^1.0.10", + "libnpmversion": "^1.0.11", "make-fetch-happen": "^8.0.14", "minipass": "^3.1.3", "minipass-pipeline": "^1.2.4",