diff --git a/node_modules/hosted-git-info/CHANGELOG.md b/node_modules/hosted-git-info/CHANGELOG.md
index 7a8d5df968da3..9eedbb80b1ecc 100644
--- a/node_modules/hosted-git-info/CHANGELOG.md
+++ b/node_modules/hosted-git-info/CHANGELOG.md
@@ -2,6 +2,46 @@
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
+
+## [2.8.2](https://github.com/npm/hosted-git-info/compare/v2.8.1...v2.8.2) (2019-08-05)
+
+
+### Bug Fixes
+
+* http protocol use sshurl by default ([3b1d629](https://github.com/npm/hosted-git-info/commit/3b1d629)), closes [#48](https://github.com/npm/hosted-git-info/issues/48)
+
+
+
+
+## [2.8.1](https://github.com/npm/hosted-git-info/compare/v2.8.0...v2.8.1) (2019-08-05)
+
+
+### Bug Fixes
+
+* ignore noCommittish on tarball url generation ([5d4a8d7](https://github.com/npm/hosted-git-info/commit/5d4a8d7))
+* use gist tarball url that works for anonymous gists ([1692435](https://github.com/npm/hosted-git-info/commit/1692435))
+
+
+
+
+# [2.8.0](https://github.com/npm/hosted-git-info/compare/v2.7.1...v2.8.0) (2019-08-05)
+
+
+### Bug Fixes
+
+* Allow slashes in gitlab project section ([bbcf7b2](https://github.com/npm/hosted-git-info/commit/bbcf7b2)), closes [#46](https://github.com/npm/hosted-git-info/issues/46) [#43](https://github.com/npm/hosted-git-info/issues/43)
+* **git-host:** disallow URI-encoded slash (%2F) in `path` ([3776fa5](https://github.com/npm/hosted-git-info/commit/3776fa5)), closes [#44](https://github.com/npm/hosted-git-info/issues/44)
+* **gitlab:** Do not URL encode slashes in project name for GitLab https URL ([cbf04f9](https://github.com/npm/hosted-git-info/commit/cbf04f9)), closes [#47](https://github.com/npm/hosted-git-info/issues/47)
+* do not allow invalid gist urls ([d5cf830](https://github.com/npm/hosted-git-info/commit/d5cf830))
+* **cache:** Switch to lru-cache to save ourselves from unlimited memory consumption ([e518222](https://github.com/npm/hosted-git-info/commit/e518222)), closes [#38](https://github.com/npm/hosted-git-info/issues/38)
+
+
+### Features
+
+* give these objects a name ([60abaea](https://github.com/npm/hosted-git-info/commit/60abaea))
+
+
+
## [2.7.1](https://github.com/npm/hosted-git-info/compare/v2.7.0...v2.7.1) (2018-07-07)
diff --git a/node_modules/hosted-git-info/git-host-info.js b/node_modules/hosted-git-info/git-host-info.js
index 090a23251fbd2..d81be2050cd56 100644
--- a/node_modules/hosted-git-info/git-host-info.js
+++ b/node_modules/hosted-git-info/git-host-info.js
@@ -23,12 +23,14 @@ var gitHosts = module.exports = {
'domain': 'gitlab.com',
'treepath': 'tree',
'bugstemplate': 'https://{domain}/{user}/{project}/issues',
- 'tarballtemplate': 'https://{domain}/{user}/{project}/repository/archive.tar.gz?ref={committish}'
+ 'httpstemplate': 'git+https://{auth@}{domain}/{user}/{projectPath}.git{#committish}',
+ 'tarballtemplate': 'https://{domain}/{user}/{project}/repository/archive.tar.gz?ref={committish}',
+ 'pathmatch': /^[/]([^/]+)[/](.+?)(?:[.]git|[/])?$/
},
gist: {
'protocols': [ 'git', 'git+ssh', 'git+https', 'ssh', 'https' ],
'domain': 'gist.github.com',
- 'pathmatch': /^[/](?:([^/]+)[/])?([a-z0-9]+)(?:[.]git)?$/,
+ 'pathmatch': /^[/](?:([^/]+)[/])?([a-z0-9]{32,})(?:[.]git)?$/,
'filetemplate': 'https://gist.githubusercontent.com/{user}/{project}/raw{/committish}/{path}',
'bugstemplate': 'https://{domain}/{project}',
'gittemplate': 'git://{domain}/{project}.git{#committish}',
@@ -40,7 +42,7 @@ var gitHosts = module.exports = {
'httpstemplate': 'git+https://{domain}/{project}.git{#committish}',
'shortcuttemplate': '{type}:{project}{#committish}',
'pathtemplate': '{project}{#committish}',
- 'tarballtemplate': 'https://{domain}/{user}/{project}/archive/{committish}.tar.gz',
+ 'tarballtemplate': 'https://codeload.github.com/gist/{project}/tar.gz/{committish}',
'hashformat': function (fragment) {
return 'file-' + formatHashFragment(fragment)
}
diff --git a/node_modules/hosted-git-info/git-host.js b/node_modules/hosted-git-info/git-host.js
index 733648d84b6c9..ee5bb1af0ae9e 100644
--- a/node_modules/hosted-git-info/git-host.js
+++ b/node_modules/hosted-git-info/git-host.js
@@ -1,9 +1,24 @@
'use strict'
var gitHosts = require('./git-host-info.js')
/* eslint-disable node/no-deprecated-api */
-var extend = Object.assign || require('util')._extend
-var GitHost = module.exports = function (type, user, auth, project, committish, defaultRepresentation, opts) {
+// copy-pasta util._extend from node's source, to avoid pulling
+// the whole util module into peoples' webpack bundles.
+/* istanbul ignore next */
+var extend = Object.assign || function _extend (target, source) {
+ // Don't do anything if source isn't an object
+ if (source === null || typeof source !== 'object') return target
+
+ const keys = Object.keys(source)
+ let i = keys.length
+ while (i--) {
+ target[keys[i]] = source[keys[i]]
+ }
+ return target
+}
+
+module.exports = GitHost
+function GitHost (type, user, auth, project, committish, defaultRepresentation, opts) {
var gitHostInfo = this
gitHostInfo.type = type
Object.keys(gitHosts[type]).forEach(function (key) {
@@ -16,7 +31,6 @@ var GitHost = module.exports = function (type, user, auth, project, committish,
gitHostInfo.default = defaultRepresentation
gitHostInfo.opts = opts || {}
}
-GitHost.prototype = {}
GitHost.prototype.hash = function () {
return this.committish ? '#' + this.committish : ''
@@ -32,24 +46,33 @@ GitHost.prototype._fill = function (template, opts) {
if (self[key] != null && vars[key] == null) vars[key] = self[key]
})
var rawAuth = vars.auth
- var rawComittish = vars.committish
+ var rawcommittish = vars.committish
var rawFragment = vars.fragment
var rawPath = vars.path
+ var rawProject = vars.project
Object.keys(vars).forEach(function (key) {
- vars[key] = encodeURIComponent(vars[key])
+ var value = vars[key]
+ if ((key === 'path' || key === 'project') && typeof value === 'string') {
+ vars[key] = value.split('/').map(function (pathComponent) {
+ return encodeURIComponent(pathComponent)
+ }).join('/')
+ } else {
+ vars[key] = encodeURIComponent(value)
+ }
})
vars['auth@'] = rawAuth ? rawAuth + '@' : ''
vars['#fragment'] = rawFragment ? '#' + this.hashformat(rawFragment) : ''
vars.fragment = vars.fragment ? vars.fragment : ''
vars['#path'] = rawPath ? '#' + this.hashformat(rawPath) : ''
vars['/path'] = vars.path ? '/' + vars.path : ''
+ vars.projectPath = rawProject.split('/').map(encodeURIComponent).join('/')
if (opts.noCommittish) {
vars['#committish'] = ''
vars['/tree/committish'] = ''
- vars['/comittish'] = ''
- vars.comittish = ''
+ vars['/committish'] = ''
+ vars.committish = ''
} else {
- vars['#committish'] = rawComittish ? '#' + rawComittish : ''
+ vars['#committish'] = rawcommittish ? '#' + rawcommittish : ''
vars['/tree/committish'] = vars.committish
? '/' + vars.treepath + '/' + vars.committish
: ''
@@ -114,7 +137,8 @@ GitHost.prototype.path = function (opts) {
return this._fill(this.pathtemplate, opts)
}
-GitHost.prototype.tarball = function (opts) {
+GitHost.prototype.tarball = function (opts_) {
+ var opts = extend({}, opts_, { noCommittish: false })
return this._fill(this.tarballtemplate, opts)
}
@@ -127,5 +151,6 @@ GitHost.prototype.getDefaultRepresentation = function () {
}
GitHost.prototype.toString = function (opts) {
- return (this[this.default] || this.sshurl).call(this, opts)
+ if (this.default && typeof this[this.default] === 'function') return this[this.default](opts)
+ return this.sshurl(opts)
}
diff --git a/node_modules/hosted-git-info/index.js b/node_modules/hosted-git-info/index.js
index c1c2cc8996b9a..adae4604c4dbd 100644
--- a/node_modules/hosted-git-info/index.js
+++ b/node_modules/hosted-git-info/index.js
@@ -2,17 +2,18 @@
var url = require('url')
var gitHosts = require('./git-host-info.js')
var GitHost = module.exports = require('./git-host.js')
+var LRU = require('lru-cache')
+var cache = new LRU({max: 1000})
var protocolToRepresentationMap = {
- 'git+ssh': 'sshurl',
- 'git+https': 'https',
- 'ssh': 'sshurl',
- 'git': 'git'
+ 'git+ssh:': 'sshurl',
+ 'git+https:': 'https',
+ 'ssh:': 'sshurl',
+ 'git:': 'git'
}
function protocolToRepresentation (protocol) {
- if (protocol.substr(-1) === ':') protocol = protocol.slice(0, -1)
- return protocolToRepresentationMap[protocol] || protocol
+ return protocolToRepresentationMap[protocol] || protocol.slice(0, -1)
}
var authProtocols = {
@@ -23,17 +24,15 @@ var authProtocols = {
'git+http:': true
}
-var cache = {}
-
module.exports.fromUrl = function (giturl, opts) {
if (typeof giturl !== 'string') return
var key = giturl + JSON.stringify(opts || {})
- if (!(key in cache)) {
- cache[key] = fromUrl(giturl, opts)
+ if (!cache.has(key)) {
+ cache.set(key, fromUrl(giturl, opts))
}
- return cache[key]
+ return cache.get(key)
}
function fromUrl (giturl, opts) {
@@ -65,13 +64,17 @@ function fromUrl (giturl, opts) {
var pathmatch = gitHostInfo.pathmatch
var matched = parsed.path.match(pathmatch)
if (!matched) return
- if (matched[1] != null) user = decodeURIComponent(matched[1].replace(/^:/, ''))
- if (matched[2] != null) project = decodeURIComponent(matched[2])
+ if (matched[1] !== null && matched[1] !== undefined) {
+ user = decodeURIComponent(matched[1].replace(/^:/, ''))
+ }
+ project = decodeURIComponent(matched[2])
defaultRepresentation = protocolToRepresentation(parsed.protocol)
}
return new GitHost(gitHostName, user, auth, project, committish, defaultRepresentation, opts)
} catch (ex) {
- if (!(ex instanceof URIError)) throw ex
+ /* istanbul ignore else */
+ if (ex instanceof URIError) {
+ } else throw ex
}
}).filter(function (gitHostInfo) { return gitHostInfo })
if (matches.length !== 1) return
@@ -101,7 +104,6 @@ function fixupUnqualifiedGist (giturl) {
}
function parseGitUrl (giturl) {
- if (typeof giturl !== 'string') giturl = '' + giturl
var matched = giturl.match(/^([^@]+)@([^:/]+):[/]?((?:[^/]+[/])?[^/]+?)(?:[.]git)?(#.*)?$/)
if (!matched) return url.parse(giturl)
return {
diff --git a/node_modules/hosted-git-info/package.json b/node_modules/hosted-git-info/package.json
index de1ee3d7f6422..86e7ba59a7c9c 100644
--- a/node_modules/hosted-git-info/package.json
+++ b/node_modules/hosted-git-info/package.json
@@ -1,19 +1,19 @@
{
- "_from": "hosted-git-info@latest",
- "_id": "hosted-git-info@2.7.1",
+ "_from": "hosted-git-info@2.8.2",
+ "_id": "hosted-git-info@2.8.2",
"_inBundle": false,
- "_integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==",
+ "_integrity": "sha512-CyjlXII6LMsPMyUzxpTt8fzh5QwzGqPmQXgY/Jyf4Zfp27t/FvfhwoE/8laaMUcMy816CkWF20I7NeQhwwY88w==",
"_location": "/hosted-git-info",
"_phantomChildren": {},
"_requested": {
- "type": "tag",
+ "type": "version",
"registry": true,
- "raw": "hosted-git-info@latest",
+ "raw": "hosted-git-info@2.8.2",
"name": "hosted-git-info",
"escapedName": "hosted-git-info",
- "rawSpec": "latest",
+ "rawSpec": "2.8.2",
"saveSpec": null,
- "fetchSpec": "latest"
+ "fetchSpec": "2.8.2"
},
"_requiredBy": [
"#USER",
@@ -21,10 +21,10 @@
"/normalize-package-data",
"/npm-package-arg"
],
- "_resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz",
- "_shasum": "97f236977bd6e125408930ff6de3eec6281ec047",
- "_spec": "hosted-git-info@latest",
- "_where": "/Users/zkat/Documents/code/work/npm",
+ "_resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.2.tgz",
+ "_shasum": "a35c3f355ac1249f1093c0c2a542ace8818c171a",
+ "_spec": "hosted-git-info@2.8.2",
+ "_where": "/Users/isaacs/dev/npm/cli",
"author": {
"name": "Rebecca Turner",
"email": "me@re-becca.org",
@@ -34,12 +34,15 @@
"url": "https://github.com/npm/hosted-git-info/issues"
},
"bundleDependencies": false,
+ "dependencies": {
+ "lru-cache": "^5.1.1"
+ },
"deprecated": false,
"description": "Provides metadata and conversions from repository urls for Github, Bitbucket and Gitlab",
"devDependencies": {
"standard": "^11.0.1",
- "standard-version": "^4.3.0",
- "tap": "^12.0.1"
+ "standard-version": "^4.4.0",
+ "tap": "^12.7.0"
},
"files": [
"index.js",
@@ -65,7 +68,7 @@
"prerelease": "npm t",
"pretest": "standard",
"release": "standard-version -s",
- "test": "tap -J --nyc-arg=--all --coverage test"
+ "test": "tap -J --100 --no-esm test/*.js"
},
- "version": "2.7.1"
+ "version": "2.8.2"
}
diff --git a/package-lock.json b/package-lock.json
index bca91e2e34205..e910fd1c1c82d 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -2464,9 +2464,12 @@
}
},
"hosted-git-info": {
- "version": "2.7.1",
- "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz",
- "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w=="
+ "version": "2.8.2",
+ "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.2.tgz",
+ "integrity": "sha512-CyjlXII6LMsPMyUzxpTt8fzh5QwzGqPmQXgY/Jyf4Zfp27t/FvfhwoE/8laaMUcMy816CkWF20I7NeQhwwY88w==",
+ "requires": {
+ "lru-cache": "^5.1.1"
+ }
},
"http-cache-semantics": {
"version": "3.8.1",
diff --git a/package.json b/package.json
index 6b802b7dbbc99..4a30cdd8eb565 100644
--- a/package.json
+++ b/package.json
@@ -63,7 +63,7 @@
"glob": "^7.1.4",
"graceful-fs": "^4.2.0",
"has-unicode": "~2.0.1",
- "hosted-git-info": "^2.7.1",
+ "hosted-git-info": "^2.8.2",
"iferr": "^1.0.2",
"infer-owner": "^1.0.4",
"inflight": "~1.0.6",