diff --git a/node_modules/hosted-git-info/CHANGELOG.md b/node_modules/hosted-git-info/CHANGELOG.md index 9eedbb80b1ecc..479f24b6414eb 100644 --- a/node_modules/hosted-git-info/CHANGELOG.md +++ b/node_modules/hosted-git-info/CHANGELOG.md @@ -2,6 +2,27 @@ 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.5](https://github.com/npm/hosted-git-info/compare/v2.8.4...v2.8.5) (2019-10-07) + + +### Bug Fixes + +* updated pathmatch for gitlab ([e8325b5](https://github.com/npm/hosted-git-info/commit/e8325b5)), closes [#51](https://github.com/npm/hosted-git-info/issues/51) +* updated pathmatch for gitlab ([ffe056f](https://github.com/npm/hosted-git-info/commit/ffe056f)) + + + + +## [2.8.4](https://github.com/npm/hosted-git-info/compare/v2.8.3...v2.8.4) (2019-08-12) + + + + +## [2.8.3](https://github.com/npm/hosted-git-info/compare/v2.8.2...v2.8.3) (2019-08-12) + + + ## [2.8.2](https://github.com/npm/hosted-git-info/compare/v2.8.1...v2.8.2) (2019-08-05) diff --git a/node_modules/hosted-git-info/git-host-info.js b/node_modules/hosted-git-info/git-host-info.js index d81be2050cd56..8147e3348f5e8 100644 --- a/node_modules/hosted-git-info/git-host-info.js +++ b/node_modules/hosted-git-info/git-host-info.js @@ -25,7 +25,7 @@ var gitHosts = module.exports = { 'bugstemplate': 'https://{domain}/{user}/{project}/issues', 'httpstemplate': 'git+https://{auth@}{domain}/{user}/{projectPath}.git{#committish}', 'tarballtemplate': 'https://{domain}/{user}/{project}/repository/archive.tar.gz?ref={committish}', - 'pathmatch': /^[/]([^/]+)[/](.+?)(?:[.]git|[/])?$/ + 'pathmatch': /^[/]([^/]+)[/]((?!.*(\/-\/|\/repository\/archive\.tar\.gz\?=.*|\/repository\/[^/]+\/archive.tar.gz$)).*?)(?:[.]git|[/])?$/ }, gist: { 'protocols': [ 'git', 'git+ssh', 'git+https', 'ssh', 'https' ], diff --git a/node_modules/hosted-git-info/git-host.js b/node_modules/hosted-git-info/git-host.js index ee5bb1af0ae9e..9616fbaa6b4af 100644 --- a/node_modules/hosted-git-info/git-host.js +++ b/node_modules/hosted-git-info/git-host.js @@ -9,8 +9,8 @@ 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 + var keys = Object.keys(source) + var i = keys.length while (i--) { target[keys[i]] = source[keys[i]] } diff --git a/node_modules/hosted-git-info/index.js b/node_modules/hosted-git-info/index.js index adae4604c4dbd..fc959cb0434c8 100644 --- a/node_modules/hosted-git-info/index.js +++ b/node_modules/hosted-git-info/index.js @@ -2,8 +2,6 @@ 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', @@ -24,15 +22,17 @@ 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 (!cache.has(key)) { - cache.set(key, fromUrl(giturl, opts)) + if (!(key in cache)) { + cache[key] = fromUrl(giturl, opts) } - return cache.get(key) + return cache[key] } function fromUrl (giturl, opts) { @@ -64,6 +64,7 @@ function fromUrl (giturl, opts) { var pathmatch = gitHostInfo.pathmatch var matched = parsed.path.match(pathmatch) if (!matched) return + /* istanbul ignore else */ if (matched[1] !== null && matched[1] !== undefined) { user = decodeURIComponent(matched[1].replace(/^:/, '')) } diff --git a/node_modules/hosted-git-info/package.json b/node_modules/hosted-git-info/package.json index 86e7ba59a7c9c..458b323a40518 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@2.8.2", - "_id": "hosted-git-info@2.8.2", + "_from": "hosted-git-info@2.8.5", + "_id": "hosted-git-info@2.8.5", "_inBundle": false, - "_integrity": "sha512-CyjlXII6LMsPMyUzxpTt8fzh5QwzGqPmQXgY/Jyf4Zfp27t/FvfhwoE/8laaMUcMy816CkWF20I7NeQhwwY88w==", + "_integrity": "sha512-kssjab8CvdXfcXMXVcvsXum4Hwdq9XGtRD3TteMEvEbq0LXyiNQr6AprqKqfeaDXze7SxWvRxdpwE6ku7ikLkg==", "_location": "/hosted-git-info", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, - "raw": "hosted-git-info@2.8.2", + "raw": "hosted-git-info@2.8.5", "name": "hosted-git-info", "escapedName": "hosted-git-info", - "rawSpec": "2.8.2", + "rawSpec": "2.8.5", "saveSpec": null, - "fetchSpec": "2.8.2" + "fetchSpec": "2.8.5" }, "_requiredBy": [ "#USER", @@ -21,9 +21,9 @@ "/normalize-package-data", "/npm-package-arg" ], - "_resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.2.tgz", - "_shasum": "a35c3f355ac1249f1093c0c2a542ace8818c171a", - "_spec": "hosted-git-info@2.8.2", + "_resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.5.tgz", + "_shasum": "759cfcf2c4d156ade59b0b2dfabddc42a6b9c70c", + "_spec": "hosted-git-info@2.8.5", "_where": "/Users/isaacs/dev/npm/cli", "author": { "name": "Rebecca Turner", @@ -34,9 +34,6 @@ "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": { @@ -64,11 +61,12 @@ "url": "git+https://github.com/npm/hosted-git-info.git" }, "scripts": { - "postrelease": "npm publish && git push --follow-tags", + "postrelease": "npm publish --tag=ancient-legacy-fixes && git push --follow-tags", "prerelease": "npm t", "pretest": "standard", "release": "standard-version -s", - "test": "tap -J --100 --no-esm test/*.js" + "test": "tap -J --100 --no-esm test/*.js", + "test:coverage": "tap --coverage-report=html -J --100 --no-esm test/*.js" }, - "version": "2.8.2" + "version": "2.8.5" } diff --git a/package-lock.json b/package-lock.json index 9edc5d9e4ac9a..7350b6bf7eaba 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2477,12 +2477,9 @@ } }, "hosted-git-info": { - "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" - } + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.5.tgz", + "integrity": "sha512-kssjab8CvdXfcXMXVcvsXum4Hwdq9XGtRD3TteMEvEbq0LXyiNQr6AprqKqfeaDXze7SxWvRxdpwE6ku7ikLkg==" }, "http-cache-semantics": { "version": "3.8.1", diff --git a/package.json b/package.json index 7a1e8cefc334c..3a8435c64bd98 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "glob": "^7.1.4", "graceful-fs": "^4.2.2", "has-unicode": "~2.0.1", - "hosted-git-info": "^2.8.2", + "hosted-git-info": "^2.8.5", "iferr": "^1.0.2", "infer-owner": "^1.0.4", "inflight": "~1.0.6",