diff --git a/node_modules/hosted-git-info/CHANGELOG.md b/node_modules/hosted-git-info/CHANGELOG.md index d450f74a9236e..7a8d5df968da3 100644 --- a/node_modules/hosted-git-info/CHANGELOG.md +++ b/node_modules/hosted-git-info/CHANGELOG.md @@ -2,6 +2,43 @@ 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.7.1](https://github.com/npm/hosted-git-info/compare/v2.7.0...v2.7.1) (2018-07-07) + + +### Bug Fixes + +* **index:** Guard against non-string types ([5bc580d](https://github.com/npm/hosted-git-info/commit/5bc580d)) +* **parse:** Crash on strings that parse to having no host ([c931482](https://github.com/npm/hosted-git-info/commit/c931482)), closes [#35](https://github.com/npm/hosted-git-info/issues/35) + + + + +# [2.7.0](https://github.com/npm/hosted-git-info/compare/v2.6.1...v2.7.0) (2018-07-06) + + +### Bug Fixes + +* **github tarball:** update github tarballtemplate ([6efd582](https://github.com/npm/hosted-git-info/commit/6efd582)), closes [#34](https://github.com/npm/hosted-git-info/issues/34) +* **gitlab docs:** switched to lowercase anchors for readmes ([701bcd1](https://github.com/npm/hosted-git-info/commit/701bcd1)) + + +### Features + +* **all:** Support www. prefixes on hostnames ([3349575](https://github.com/npm/hosted-git-info/commit/3349575)), closes [#32](https://github.com/npm/hosted-git-info/issues/32) + + + + +## [2.6.1](https://github.com/npm/hosted-git-info/compare/v2.6.0...v2.6.1) (2018-06-25) + +### Bug Fixes + +* **Revert:** "compat: remove Object.assign fallback ([#25](https://github.com/npm/hosted-git-info/issues/25))" ([cce5a62](https://github.com/npm/hosted-git-info/commit/cce5a62)) +* **Revert:** "git-host: fix forgotten extend()" ([a815ec9](https://github.com/npm/hosted-git-info/commit/a815ec9)) + + + # [2.6.0](https://github.com/npm/hosted-git-info/compare/v2.5.0...v2.6.0) (2018-03-07) diff --git a/node_modules/hosted-git-info/git-host-info.js b/node_modules/hosted-git-info/git-host-info.js index 6d6c109de71d4..090a23251fbd2 100644 --- a/node_modules/hosted-git-info/git-host-info.js +++ b/node_modules/hosted-git-info/git-host-info.js @@ -10,7 +10,7 @@ var gitHosts = module.exports = { 'filetemplate': 'https://{auth@}raw.githubusercontent.com/{user}/{project}/{committish}/{path}', 'bugstemplate': 'https://{domain}/{user}/{project}/issues', 'gittemplate': 'git://{auth@}{domain}/{user}/{project}.git{#committish}', - 'tarballtemplate': 'https://{domain}/{user}/{project}/archive/{committish}.tar.gz' + 'tarballtemplate': 'https://codeload.{domain}/{user}/{project}/tar.gz/{committish}' }, bitbucket: { 'protocols': [ 'git+ssh', 'git+https', 'ssh', 'https' ], @@ -22,7 +22,6 @@ var gitHosts = module.exports = { 'protocols': [ 'git+ssh', 'git+https', 'ssh', 'https' ], 'domain': 'gitlab.com', 'treepath': 'tree', - 'docstemplate': 'https://{domain}/{user}/{project}{/tree/committish}#README', 'bugstemplate': 'https://{domain}/{user}/{project}/issues', 'tarballtemplate': 'https://{domain}/{user}/{project}/repository/archive.tar.gz?ref={committish}' }, diff --git a/node_modules/hosted-git-info/git-host.js b/node_modules/hosted-git-info/git-host.js index 6b97531ad6886..733648d84b6c9 100644 --- a/node_modules/hosted-git-info/git-host.js +++ b/node_modules/hosted-git-info/git-host.js @@ -1,5 +1,7 @@ '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) { var gitHostInfo = this @@ -22,9 +24,9 @@ GitHost.prototype.hash = function () { GitHost.prototype._fill = function (template, opts) { if (!template) return - var vars = Object.assign({}, opts) + var vars = extend({}, opts) vars.path = vars.path ? vars.path.replace(/^[/]+/g, '') : '' - opts = Object.assign({}, this.opts, opts) + opts = extend(extend({}, this.opts), opts) var self = this Object.keys(this).forEach(function (key) { if (self[key] != null && vars[key] == null) vars[key] = self[key] @@ -49,8 +51,8 @@ GitHost.prototype._fill = function (template, opts) { } else { vars['#committish'] = rawComittish ? '#' + rawComittish : '' vars['/tree/committish'] = vars.committish - ? '/' + vars.treepath + '/' + vars.committish - : '' + ? '/' + vars.treepath + '/' + vars.committish + : '' vars['/committish'] = vars.committish ? '/' + vars.committish : '' vars.committish = vars.committish || 'master' } @@ -79,7 +81,7 @@ GitHost.prototype.browse = function (P, F, opts) { opts = F F = null } - return this._fill(this.browsefiletemplate, Object.assign({ + return this._fill(this.browsefiletemplate, extend({ fragment: F, path: P }, opts)) @@ -117,7 +119,7 @@ GitHost.prototype.tarball = function (opts) { } GitHost.prototype.file = function (P, opts) { - return this._fill(this.filetemplate, Object.assign({ path: P }, opts)) + return this._fill(this.filetemplate, extend({ path: P }, opts)) } GitHost.prototype.getDefaultRepresentation = function () { diff --git a/node_modules/hosted-git-info/index.js b/node_modules/hosted-git-info/index.js index 9055ab1853de7..c1c2cc8996b9a 100644 --- a/node_modules/hosted-git-info/index.js +++ b/node_modules/hosted-git-info/index.js @@ -26,6 +26,7 @@ var authProtocols = { var cache = {} module.exports.fromUrl = function (giturl, opts) { + if (typeof giturl !== 'string') return var key = giturl + JSON.stringify(opts || {}) if (!(key in cache)) { @@ -58,7 +59,7 @@ function fromUrl (giturl, opts) { project = decodeURIComponent(shortcutMatch[3]) defaultRepresentation = 'shortcut' } else { - if (parsed.host !== gitHostInfo.domain) return + if (parsed.host && parsed.host !== gitHostInfo.domain && parsed.host.replace(/^www[.]/, '') !== gitHostInfo.domain) return if (!gitHostInfo.protocols_re.test(parsed.protocol)) return if (!parsed.path) return var pathmatch = gitHostInfo.pathmatch diff --git a/node_modules/hosted-git-info/package.json b/node_modules/hosted-git-info/package.json index d176266cca3fe..de1ee3d7f6422 100644 --- a/node_modules/hosted-git-info/package.json +++ b/node_modules/hosted-git-info/package.json @@ -1,34 +1,30 @@ { - "_args": [ - [ - "hosted-git-info@2.6.0", - "/Users/rebecca/code/npm" - ] - ], - "_from": "hosted-git-info@2.6.0", - "_id": "hosted-git-info@2.6.0", + "_from": "hosted-git-info@latest", + "_id": "hosted-git-info@2.7.1", "_inBundle": false, - "_integrity": "sha512-lIbgIIQA3lz5XaB6vxakj6sDHADJiZadYEJB+FgA+C4nubM1NwcuvUr9EJPmnH1skZqpqUzWborWo8EIUi0Sdw==", + "_integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==", "_location": "/hosted-git-info", "_phantomChildren": {}, "_requested": { - "type": "version", + "type": "tag", "registry": true, - "raw": "hosted-git-info@2.6.0", + "raw": "hosted-git-info@latest", "name": "hosted-git-info", "escapedName": "hosted-git-info", - "rawSpec": "2.6.0", + "rawSpec": "latest", "saveSpec": null, - "fetchSpec": "2.6.0" + "fetchSpec": "latest" }, "_requiredBy": [ + "#USER", "/", "/normalize-package-data", "/npm-package-arg" ], - "_resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.6.0.tgz", - "_spec": "2.6.0", - "_where": "/Users/rebecca/code/npm", + "_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", "author": { "name": "Rebecca Turner", "email": "me@re-becca.org", @@ -37,14 +33,13 @@ "bugs": { "url": "https://github.com/npm/hosted-git-info/issues" }, + "bundleDependencies": false, + "deprecated": false, "description": "Provides metadata and conversions from repository urls for Github, Bitbucket and Gitlab", "devDependencies": { - "standard": "^9.0.2", + "standard": "^11.0.1", "standard-version": "^4.3.0", - "tap": "^10.3.0" - }, - "engines": { - "node": ">=4" + "tap": "^12.0.1" }, "files": [ "index.js", @@ -72,5 +67,5 @@ "release": "standard-version -s", "test": "tap -J --nyc-arg=--all --coverage test" }, - "version": "2.6.0" + "version": "2.7.1" } diff --git a/package-lock.json b/package-lock.json index 46b6ad68eea1b..1fe8270de8234 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2021,9 +2021,9 @@ "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=" }, "hosted-git-info": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.6.0.tgz", - "integrity": "sha512-lIbgIIQA3lz5XaB6vxakj6sDHADJiZadYEJB+FgA+C4nubM1NwcuvUr9EJPmnH1skZqpqUzWborWo8EIUi0Sdw==" + "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==" }, "http-cache-semantics": { "version": "3.8.1", diff --git a/package.json b/package.json index 50b62de6df8ca..405194157688f 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,7 @@ "glob": "~7.1.2", "graceful-fs": "~4.1.11", "has-unicode": "~2.0.1", - "hosted-git-info": "^2.6.0", + "hosted-git-info": "^2.7.1", "iferr": "^1.0.2", "inflight": "~1.0.6", "inherits": "~2.0.3",