diff options
author | nlf <quitlahok@gmail.com> | 2021-02-22 20:16:35 +0300 |
---|---|---|
committer | nlf <quitlahok@gmail.com> | 2021-02-22 20:16:35 +0300 |
commit | 8b6bf0db49a3378bd85a0d1ffdd19fbdd68a944a (patch) | |
tree | 2ed3457a46b2e3bbef0bf0a96efd220fec786038 /node_modules | |
parent | e606953e5795803a7c4eddb4ea993735ef65ec95 (diff) |
pacote@11.2.7
Diffstat (limited to 'node_modules')
-rw-r--r-- | node_modules/pacote/lib/dir.js | 9 | ||||
-rw-r--r-- | node_modules/pacote/lib/git.js | 12 | ||||
-rw-r--r-- | node_modules/pacote/lib/util/add-git-sha.js | 15 | ||||
-rw-r--r-- | node_modules/pacote/package.json | 2 |
4 files changed, 27 insertions, 11 deletions
diff --git a/node_modules/pacote/lib/dir.js b/node_modules/pacote/lib/dir.js index 16660d982..4a89348b9 100644 --- a/node_modules/pacote/lib/dir.js +++ b/node_modules/pacote/lib/dir.js @@ -33,11 +33,20 @@ class DirFetcher extends Fetcher { // we *only* run prepare. // pre/post-pack is run by the npm CLI for publish and pack, // but this function is *also* run when installing git deps + const stdio = this.opts.foregroundScripts ? 'inherit' : 'pipe' + + // hide the banner if loglevel is silent, or if prepare running + // in the background. + const banner = this.opts.log && this.opts.log.level === 'silent' ? false + : stdio === 'inherit' + return runScript({ pkg: mani, event: 'prepare', path: this.resolved, stdioString: true, + stdio, + banner, env: { npm_package_resolved: this.resolved, npm_package_integrity: this.integrity, diff --git a/node_modules/pacote/lib/git.js b/node_modules/pacote/lib/git.js index 14d8a8336..973e13ea9 100644 --- a/node_modules/pacote/lib/git.js +++ b/node_modules/pacote/lib/git.js @@ -18,6 +18,7 @@ const _resolvedFromHosted = Symbol('_resolvedFromHosted') const _resolvedFromClone = Symbol('_resolvedFromClone') const _tarballFromResolved = Symbol.for('pacote.Fetcher._tarballFromResolved') const _addGitSha = Symbol('_addGitSha') +const addGitSha = require('./util/add-git-sha.js') const _clone = Symbol('_clone') const _cloneHosted = Symbol('_cloneHosted') const _cloneRepo = Symbol('_cloneRepo') @@ -131,16 +132,7 @@ class GitFetcher extends Fetcher { // when we get the git sha, we affix it to our spec to build up // either a git url with a hash, or a tarball download URL [_addGitSha] (sha) { - if (this.spec.hosted) { - const h = this.spec.hosted - const opt = { noCommittish: true } - const base = h.https && h.auth ? h.https(opt) : h.shortcut(opt) - - this[_setResolvedWithSha](`${base}#${sha}`) - } else { - const u = url.format(new url.URL(`#${sha}`, this.spec.rawSpec)) - this[_setResolvedWithSha](url.format(u)) - } + this[_setResolvedWithSha](addGitSha(this.spec, sha)) } [_resolvedFromClone] () { diff --git a/node_modules/pacote/lib/util/add-git-sha.js b/node_modules/pacote/lib/util/add-git-sha.js new file mode 100644 index 000000000..843fe5b60 --- /dev/null +++ b/node_modules/pacote/lib/util/add-git-sha.js @@ -0,0 +1,15 @@ +// add a sha to a git remote url spec +const addGitSha = (spec, sha) => { + if (spec.hosted) { + const h = spec.hosted + const opt = { noCommittish: true } + const base = h.https && h.auth ? h.https(opt) : h.shortcut(opt) + + return `${base}#${sha}` + } else { + // don't use new URL for this, because it doesn't handle scp urls + return spec.rawSpec.replace(/#.*$/, '') + `#${sha}` + } +} + +module.exports = addGitSha diff --git a/node_modules/pacote/package.json b/node_modules/pacote/package.json index 8c25e6833..a1668056f 100644 --- a/node_modules/pacote/package.json +++ b/node_modules/pacote/package.json @@ -1,6 +1,6 @@ { "name": "pacote", - "version": "11.2.6", + "version": "11.2.7", "description": "JavaScript package downloader", "author": "Isaac Z. Schlueter <i@izs.me> (https://izs.me)", "bin": { |