From 8a90d14ba604fcce967272d66c22e04a126929ff Mon Sep 17 00:00:00 2001 From: isaacs Date: Thu, 20 Feb 2020 20:02:12 -0800 Subject: deps: hoist hosted-git-info to top, remove extraneous deps --- node_modules/hosted-git-info/CHANGELOG.md | 32 +++++++++++++++++++++++++------ node_modules/hosted-git-info/git-host.js | 6 +++--- node_modules/hosted-git-info/index.js | 10 +++++----- node_modules/hosted-git-info/package.json | 31 +++++++++++++++--------------- 4 files changed, 50 insertions(+), 29 deletions(-) (limited to 'node_modules/hosted-git-info') diff --git a/node_modules/hosted-git-info/CHANGELOG.md b/node_modules/hosted-git-info/CHANGELOG.md index 479f24b64..9bc6cae2e 100644 --- a/node_modules/hosted-git-info/CHANGELOG.md +++ b/node_modules/hosted-git-info/CHANGELOG.md @@ -2,19 +2,39 @@ 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) + +## [3.0.2](https://github.com/npm/hosted-git-info/compare/v3.0.1...v3.0.2) (2019-10-08) ### 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)) +* do not encodeURIComponent the domain ([3e5fbec](https://github.com/npm/hosted-git-info/commit/3e5fbec)), closes [#53](https://github.com/npm/hosted-git-info/issues/53) - -## [2.8.4](https://github.com/npm/hosted-git-info/compare/v2.8.3...v2.8.4) (2019-08-12) + +## [3.0.1](https://github.com/npm/hosted-git-info/compare/v3.0.0...v3.0.1) (2019-10-07) + + +### Bug Fixes + +* update pathmatch for gitlab ([e3e3054](https://github.com/npm/hosted-git-info/commit/e3e3054)), closes [#52](https://github.com/npm/hosted-git-info/issues/52) +* updated pathmatch for gitlab ([fa87af7](https://github.com/npm/hosted-git-info/commit/fa87af7)) + + + + +# [3.0.0](https://github.com/npm/hosted-git-info/compare/v2.8.3...v3.0.0) (2019-08-12) + + +### Bug Fixes + +* **cache:** Switch to lru-cache to save ourselves from unlimited memory consumption ([37c2891](https://github.com/npm/hosted-git-info/commit/37c2891)), closes [#38](https://github.com/npm/hosted-git-info/issues/38) + + +### BREAKING CHANGES + +* **cache:** Drop support for node 0.x diff --git a/node_modules/hosted-git-info/git-host.js b/node_modules/hosted-git-info/git-host.js index 9616fbaa6..f9b1ec745 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 - var keys = Object.keys(source) - var i = keys.length + const keys = Object.keys(source) + let i = keys.length while (i--) { target[keys[i]] = source[keys[i]] } @@ -56,7 +56,7 @@ GitHost.prototype._fill = function (template, opts) { vars[key] = value.split('/').map(function (pathComponent) { return encodeURIComponent(pathComponent) }).join('/') - } else { + } else if (key !== 'domain') { vars[key] = encodeURIComponent(value) } }) diff --git a/node_modules/hosted-git-info/index.js b/node_modules/hosted-git-info/index.js index fc959cb04..2ccb1d69c 100644 --- a/node_modules/hosted-git-info/index.js +++ b/node_modules/hosted-git-info/index.js @@ -2,6 +2,8 @@ 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', @@ -22,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) { diff --git a/node_modules/hosted-git-info/package.json b/node_modules/hosted-git-info/package.json index 458b323a4..e78e48850 100644 --- a/node_modules/hosted-git-info/package.json +++ b/node_modules/hosted-git-info/package.json @@ -1,29 +1,27 @@ { - "_from": "hosted-git-info@2.8.5", - "_id": "hosted-git-info@2.8.5", + "_from": "hosted-git-info@latest", + "_id": "hosted-git-info@3.0.2", "_inBundle": false, - "_integrity": "sha512-kssjab8CvdXfcXMXVcvsXum4Hwdq9XGtRD3TteMEvEbq0LXyiNQr6AprqKqfeaDXze7SxWvRxdpwE6ku7ikLkg==", + "_integrity": "sha512-ezZMWtHXm7Eb7Rq4Mwnx2vs79WUx2QmRg3+ZqeGroKzfDO+EprOcgRPYghsOP9JuYBfK18VojmRTGCg8Ma+ktw==", "_location": "/hosted-git-info", "_phantomChildren": {}, "_requested": { - "type": "version", + "type": "tag", "registry": true, - "raw": "hosted-git-info@2.8.5", + "raw": "hosted-git-info@latest", "name": "hosted-git-info", "escapedName": "hosted-git-info", - "rawSpec": "2.8.5", + "rawSpec": "latest", "saveSpec": null, - "fetchSpec": "2.8.5" + "fetchSpec": "latest" }, "_requiredBy": [ "#USER", - "/", - "/normalize-package-data", - "/npm-package-arg" + "/" ], - "_resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.5.tgz", - "_shasum": "759cfcf2c4d156ade59b0b2dfabddc42a6b9c70c", - "_spec": "hosted-git-info@2.8.5", + "_resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-3.0.2.tgz", + "_shasum": "8b7e3bd114b59b51786f8bade0f39ddc80275a97", + "_spec": "hosted-git-info@latest", "_where": "/Users/isaacs/dev/npm/cli", "author": { "name": "Rebecca Turner", @@ -34,6 +32,9 @@ "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": { @@ -61,12 +62,12 @@ "url": "git+https://github.com/npm/hosted-git-info.git" }, "scripts": { - "postrelease": "npm publish --tag=ancient-legacy-fixes && git push --follow-tags", + "postrelease": "npm publish && git push --follow-tags", "prerelease": "npm t", "pretest": "standard", "release": "standard-version -s", "test": "tap -J --100 --no-esm test/*.js", "test:coverage": "tap --coverage-report=html -J --100 --no-esm test/*.js" }, - "version": "2.8.5" + "version": "3.0.2" } -- cgit v1.2.3