diff options
Diffstat (limited to 'deps/npm/node_modules/hosted-git-info')
-rw-r--r-- | deps/npm/node_modules/hosted-git-info/CHANGELOG.md | 17 | ||||
-rw-r--r-- | deps/npm/node_modules/hosted-git-info/README.md | 7 | ||||
-rw-r--r-- | deps/npm/node_modules/hosted-git-info/git-host-info.js | 14 | ||||
-rw-r--r-- | deps/npm/node_modules/hosted-git-info/git-host.js | 31 | ||||
-rw-r--r-- | deps/npm/node_modules/hosted-git-info/package.json | 34 |
5 files changed, 78 insertions, 25 deletions
diff --git a/deps/npm/node_modules/hosted-git-info/CHANGELOG.md b/deps/npm/node_modules/hosted-git-info/CHANGELOG.md new file mode 100644 index 0000000000..d450f74a92 --- /dev/null +++ b/deps/npm/node_modules/hosted-git-info/CHANGELOG.md @@ -0,0 +1,17 @@ +# Change Log + +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. + +<a name="2.6.0"></a> +# [2.6.0](https://github.com/npm/hosted-git-info/compare/v2.5.0...v2.6.0) (2018-03-07) + + +### Bug Fixes + +* **compat:** remove Object.assign fallback ([#25](https://github.com/npm/hosted-git-info/issues/25)) ([627ab55](https://github.com/npm/hosted-git-info/commit/627ab55)) +* **git-host:** fix forgotten extend() ([eba1f7b](https://github.com/npm/hosted-git-info/commit/eba1f7b)) + + +### Features + +* **browse:** fragment support for browse() ([#28](https://github.com/npm/hosted-git-info/issues/28)) ([cd5e5bb](https://github.com/npm/hosted-git-info/commit/cd5e5bb)) diff --git a/deps/npm/node_modules/hosted-git-info/README.md b/deps/npm/node_modules/hosted-git-info/README.md index f9db5dd959..7b723f6b9e 100644 --- a/deps/npm/node_modules/hosted-git-info/README.md +++ b/deps/npm/node_modules/hosted-git-info/README.md @@ -77,9 +77,11 @@ would return `https://raw.githubusercontent.com/npm/hosted-git-info/v1.0.0/packa eg, `github:npm/hosted-git-info` -* info.browse(opts) +* info.browse(path, fragment, opts) -eg, `https://github.com/npm/hosted-git-info/tree/v1.2.0` +eg, `https://github.com/npm/hosted-git-info/tree/v1.2.0`, +`https://github.com/npm/hosted-git-info/tree/v1.2.0/package.json`, +`https://github.com/npm/hosted-git-info/tree/v1.2.0/REAMDE.md#supported-hosts` * info.bugs(opts) @@ -129,4 +131,3 @@ SSH connect strings will be normalized into `git+ssh` URLs. Currently this supports Github, Bitbucket and Gitlab. Pull requests for additional hosts welcome. - diff --git a/deps/npm/node_modules/hosted-git-info/git-host-info.js b/deps/npm/node_modules/hosted-git-info/git-host-info.js index 93cf617440..6d6c109de7 100644 --- a/deps/npm/node_modules/hosted-git-info/git-host-info.js +++ b/deps/npm/node_modules/hosted-git-info/git-host-info.js @@ -36,11 +36,15 @@ var gitHosts = module.exports = { 'sshtemplate': 'git@{domain}:/{project}.git{#committish}', 'sshurltemplate': 'git+ssh://git@{domain}/{project}.git{#committish}', 'browsetemplate': 'https://{domain}/{project}{/committish}', + 'browsefiletemplate': 'https://{domain}/{project}{/committish}{#path}', 'docstemplate': 'https://{domain}/{project}{/committish}', '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://{domain}/{user}/{project}/archive/{committish}.tar.gz', + 'hashformat': function (fragment) { + return 'file-' + formatHashFragment(fragment) + } } } @@ -48,12 +52,14 @@ var gitHostDefaults = { 'sshtemplate': 'git@{domain}:{user}/{project}.git{#committish}', 'sshurltemplate': 'git+ssh://git@{domain}/{user}/{project}.git{#committish}', 'browsetemplate': 'https://{domain}/{user}/{project}{/tree/committish}', + 'browsefiletemplate': 'https://{domain}/{user}/{project}/{treepath}/{committish}/{path}{#fragment}', 'docstemplate': 'https://{domain}/{user}/{project}{/tree/committish}#readme', 'httpstemplate': 'git+https://{auth@}{domain}/{user}/{project}.git{#committish}', 'filetemplate': 'https://{domain}/{user}/{project}/raw/{committish}/{path}', 'shortcuttemplate': '{type}:{user}/{project}{#committish}', 'pathtemplate': '{user}/{project}{#committish}', - 'pathmatch': /^[/]([^/]+)[/]([^/]+?)(?:[.]git|[/])?$/ + 'pathmatch': /^[/]([^/]+)[/]([^/]+?)(?:[.]git|[/])?$/, + 'hashformat': formatHashFragment } Object.keys(gitHosts).forEach(function (name) { @@ -66,3 +72,7 @@ Object.keys(gitHosts).forEach(function (name) { return protocol.replace(/([\\+*{}()[\]$^|])/g, '\\$1') }).join('|') + '):$') }) + +function formatHashFragment (fragment) { + return fragment.toLowerCase().replace(/^\W+|\/|\W+$/g, '').replace(/\W+/g, '-') +} diff --git a/deps/npm/node_modules/hosted-git-info/git-host.js b/deps/npm/node_modules/hosted-git-info/git-host.js index 4c6641bbf7..6b97531ad6 100644 --- a/deps/npm/node_modules/hosted-git-info/git-host.js +++ b/deps/npm/node_modules/hosted-git-info/git-host.js @@ -1,6 +1,5 @@ 'use strict' var gitHosts = require('./git-host-info.js') -var extend = Object.assign || require('util')._extend var GitHost = module.exports = function (type, user, auth, project, committish, defaultRepresentation, opts) { var gitHostInfo = this @@ -23,18 +22,25 @@ GitHost.prototype.hash = function () { GitHost.prototype._fill = function (template, opts) { if (!template) return - var vars = extend({}, opts) - opts = extend(extend({}, this.opts), opts) + var vars = Object.assign({}, opts) + vars.path = vars.path ? vars.path.replace(/^[/]+/g, '') : '' + opts = Object.assign({}, this.opts, opts) var self = this Object.keys(this).forEach(function (key) { if (self[key] != null && vars[key] == null) vars[key] = self[key] }) var rawAuth = vars.auth var rawComittish = vars.committish + var rawFragment = vars.fragment + var rawPath = vars.path Object.keys(vars).forEach(function (key) { vars[key] = encodeURIComponent(vars[key]) }) 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 : '' if (opts.noCommittish) { vars['#committish'] = '' vars['/tree/committish'] = '' @@ -67,8 +73,19 @@ GitHost.prototype.sshurl = function (opts) { return this._fill(this.sshurltemplate, opts) } -GitHost.prototype.browse = function (opts) { - return this._fill(this.browsetemplate, opts) +GitHost.prototype.browse = function (P, F, opts) { + if (typeof P === 'string') { + if (typeof F !== 'string') { + opts = F + F = null + } + return this._fill(this.browsefiletemplate, Object.assign({ + fragment: F, + path: P + }, opts)) + } else { + return this._fill(this.browsetemplate, P) + } } GitHost.prototype.docs = function (opts) { @@ -100,9 +117,7 @@ GitHost.prototype.tarball = function (opts) { } GitHost.prototype.file = function (P, opts) { - return this._fill(this.filetemplate, extend({ - path: P.replace(/^[/]+/g, '') - }, opts)) + return this._fill(this.filetemplate, Object.assign({ path: P }, opts)) } GitHost.prototype.getDefaultRepresentation = function () { diff --git a/deps/npm/node_modules/hosted-git-info/package.json b/deps/npm/node_modules/hosted-git-info/package.json index de691a86c0..e991eaa698 100644 --- a/deps/npm/node_modules/hosted-git-info/package.json +++ b/deps/npm/node_modules/hosted-git-info/package.json @@ -1,30 +1,32 @@ { - "_from": "hosted-git-info@2.5.0", - "_id": "hosted-git-info@2.5.0", + "_from": "hosted-git-info@2.6.0", + "_id": "hosted-git-info@2.6.0", "_inBundle": false, - "_integrity": "sha512-pNgbURSuab90KbTqvRPsseaTxOJCZBD0a7t+haSN33piP9cCM4l0CqdzAif2hUqm716UovKB2ROmiabGAKVXyg==", + "_integrity": "sha512-lIbgIIQA3lz5XaB6vxakj6sDHADJiZadYEJB+FgA+C4nubM1NwcuvUr9EJPmnH1skZqpqUzWborWo8EIUi0Sdw==", "_location": "/hosted-git-info", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, - "raw": "hosted-git-info@2.5.0", + "raw": "hosted-git-info@2.6.0", "name": "hosted-git-info", "escapedName": "hosted-git-info", - "rawSpec": "2.5.0", + "rawSpec": "2.6.0", "saveSpec": null, - "fetchSpec": "2.5.0" + "fetchSpec": "2.6.0" }, "_requiredBy": [ "#USER", "/", + "/libcipm/lock-verify/npm-package-arg", + "/libnpx/npm-package-arg", "/normalize-package-data", "/npm-package-arg" ], - "_resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.5.0.tgz", - "_shasum": "6d60e34b3abbc8313062c3b798ef8d901a07af3c", - "_spec": "hosted-git-info@2.5.0", - "_where": "/Users/rebecca/code/npm", + "_resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.6.0.tgz", + "_shasum": "23235b29ab230c576aab0d4f13fc046b0b038222", + "_spec": "hosted-git-info@2.6.0", + "_where": "/Users/zkat/Documents/code/npm", "author": { "name": "Rebecca Turner", "email": "me@re-becca.org", @@ -38,8 +40,12 @@ "description": "Provides metadata and conversions from repository urls for Github, Bitbucket and Gitlab", "devDependencies": { "standard": "^9.0.2", + "standard-version": "^4.3.0", "tap": "^10.3.0" }, + "engines": { + "node": ">=4" + }, "files": [ "index.js", "git-host.js", @@ -60,7 +66,11 @@ "url": "git+https://github.com/npm/hosted-git-info.git" }, "scripts": { - "test": "standard && tap -J --coverage test/*.js" + "postrelease": "npm publish && git push --follow-tags", + "prerelease": "npm t", + "pretest": "standard", + "release": "standard-version -s", + "test": "tap -J --nyc-arg=--all --coverage test" }, - "version": "2.5.0" + "version": "2.6.0" } |