Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKat Marchán <kzm@sykosomatic.org>2017-05-16 03:04:40 +0300
committerRebecca Turner <me@re-becca.org>2017-05-26 04:55:22 +0300
commit42531d6a2d752fee2349bf1c6eecf5f26312175a (patch)
treee9359543ed0a05fab686323ab7019e080ee6e481 /node_modules
parentc0a02aae63e15fc80f2490483ebb6391e5a56c4f (diff)
pacote@2.7.12
Diffstat (limited to 'node_modules')
-rw-r--r--node_modules/pacote/CHANGELOG.md12
-rw-r--r--node_modules/pacote/lib/fetchers/registry/fetch.js23
-rw-r--r--node_modules/pacote/lib/fetchers/registry/tarball.js6
-rw-r--r--node_modules/pacote/lib/util/opt-check.js2
-rw-r--r--node_modules/pacote/package.json22
5 files changed, 42 insertions, 23 deletions
diff --git a/node_modules/pacote/CHANGELOG.md b/node_modules/pacote/CHANGELOG.md
index 1ac57e0dd..4c24dd4be 100644
--- a/node_modules/pacote/CHANGELOG.md
+++ b/node_modules/pacote/CHANGELOG.md
@@ -2,6 +2,18 @@
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.7.12"></a>
+## [2.7.12](https://github.com/zkat/pacote/compare/v2.7.11...v2.7.12) (2017-05-16)
+
+
+### Bug Fixes
+
+* **fetch:** fix default userAgent ([4b9d344](https://github.com/zkat/pacote/commit/4b9d344))
+* **registry:** log failed requests too ([0f23f06](https://github.com/zkat/pacote/commit/0f23f06))
+* **remote:** send a useful pkg id header for remote tarballs ([ac13356](https://github.com/zkat/pacote/commit/ac13356))
+
+
+
<a name="2.7.11"></a>
## [2.7.11](https://github.com/zkat/pacote/compare/v2.7.10...v2.7.11) (2017-05-12)
diff --git a/node_modules/pacote/lib/fetchers/registry/fetch.js b/node_modules/pacote/lib/fetchers/registry/fetch.js
index b2697fca6..914053c79 100644
--- a/node_modules/pacote/lib/fetchers/registry/fetch.js
+++ b/node_modules/pacote/lib/fetchers/registry/fetch.js
@@ -28,16 +28,6 @@ function regFetch (uri, registry, opts) {
opts.log.warn('notice', res.headers.get('npm-notice'))
}
checkWarnings(res, registry, opts)
- res.body.on('end', () => {
- const elapsedTime = Date.now() - startTime
- const attempt = res.headers.get('x-fetch-attempts')
- const attemptStr = attempt && attempt > 1 ? ` attempt #${attempt}` : ''
- const cacheStr = res.headers.get('x-local-cache') ? ' (from cache)' : ''
- opts.log.http(
- 'fetch',
- `GET ${res.status} ${uri} ${elapsedTime}ms${attemptStr}${cacheStr}`
- )
- })
if (res.status >= 400) {
const err = new Error(`${res.status} ${res.statusText}: ${
opts.spec ? opts.spec : uri
@@ -46,13 +36,26 @@ function regFetch (uri, registry, opts) {
err.uri = uri
err.response = res
err.spec = opts.spec
+ logRequest(uri, res, startTime, opts)
throw err
} else {
+ res.body.on('end', () => logRequest(uri, res, startTime, opts))
return res
}
})
}
+function logRequest (uri, res, startTime, opts) {
+ const elapsedTime = Date.now() - startTime
+ const attempt = res.headers.get('x-fetch-attempts')
+ const attemptStr = attempt && attempt > 1 ? ` attempt #${attempt}` : ''
+ const cacheStr = res.headers.get('x-local-cache') ? ' (from cache)' : ''
+ opts.log.http(
+ 'fetch',
+ `GET ${res.status} ${uri} ${elapsedTime}ms${attemptStr}${cacheStr}`
+ )
+}
+
function getCacheMode (opts) {
return opts.offline
? 'only-if-cached'
diff --git a/node_modules/pacote/lib/fetchers/registry/tarball.js b/node_modules/pacote/lib/fetchers/registry/tarball.js
index a35bc21d7..8ad2b6860 100644
--- a/node_modules/pacote/lib/fetchers/registry/tarball.js
+++ b/node_modules/pacote/lib/fetchers/registry/tarball.js
@@ -37,7 +37,11 @@ function fromManifest (manifest, spec, opts) {
fetch(uri, registry, Object.assign({
headers: {
'pacote-req-type': 'tarball',
- 'pacote-pkg-id': `registry:${manifest.name}@${manifest.version}`
+ 'pacote-pkg-id': `registry:${
+ spec.type === 'remote'
+ ? spec
+ : `${manifest.name}@${manifest.version}`
+ }`
},
integrity: manifest._integrity,
algorithms: [
diff --git a/node_modules/pacote/lib/util/opt-check.js b/node_modules/pacote/lib/util/opt-check.js
index 938ffc7da..dd8aa518d 100644
--- a/node_modules/pacote/lib/util/opt-check.js
+++ b/node_modules/pacote/lib/util/opt-check.js
@@ -23,7 +23,7 @@ function PacoteOptions (opts) {
this.registry = opts.registry || 'https://registry.npmjs.org'
this.retry = opts.retry // for npm-registry-client
this.scope = opts.scope
- this.userAgent = opts.userAgent || `${pkg.name}@${pkg.version}/node@{process.version}+${process.arch} (${process.platform})`
+ this.userAgent = opts.userAgent || `${pkg.name}@${pkg.version}/node@${process.version}+${process.arch} (${process.platform})`
this.where = opts.where
this.preferOnline = opts.preferOnline
this.isFromCI = !!(
diff --git a/node_modules/pacote/package.json b/node_modules/pacote/package.json
index bf665a524..578b7c868 100644
--- a/node_modules/pacote/package.json
+++ b/node_modules/pacote/package.json
@@ -1,8 +1,8 @@
{
- "_from": "pacote@~2.7.10",
- "_id": "pacote@2.7.11",
+ "_from": "pacote@latest",
+ "_id": "pacote@2.7.12",
"_inBundle": false,
- "_integrity": "sha512-A7FBCn2+/cVzlNEh7Sxushos7ay6+OsoC8Z57m/CTxKDI+/oJoRu3opx1Z8mLrCCe6lTk7DqPCjgQAoymyWgDA==",
+ "_integrity": "sha512-HkAuFF2tUtXFqgmweU5eVNia1cUl4/1gYYmm1+eLOIuGPUlCLqvO0wtsKgUgoHbStFToTNh13JgDSgOaMz7REg==",
"_location": "/pacote",
"_phantomChildren": {
"cacache": "9.0.0",
@@ -18,22 +18,22 @@
"ssri": "4.1.2"
},
"_requested": {
- "type": "range",
+ "type": "tag",
"registry": true,
- "raw": "pacote@~2.7.10",
+ "raw": "pacote@latest",
"name": "pacote",
"escapedName": "pacote",
- "rawSpec": "~2.7.10",
+ "rawSpec": "latest",
"saveSpec": null,
- "fetchSpec": "~2.7.10"
+ "fetchSpec": "latest"
},
"_requiredBy": [
"#USER",
"/"
],
- "_resolved": "https://registry.npmjs.org/pacote/-/pacote-2.7.11.tgz",
- "_shasum": "39c06028e2a697f0c4ef8095c893bb503dd0f9fa",
- "_spec": "pacote@~2.7.10",
+ "_resolved": "https://registry.npmjs.org/pacote/-/pacote-2.7.12.tgz",
+ "_shasum": "36bced5b5fe29defff827b8da893245d9fb0789f",
+ "_spec": "pacote@latest",
"_where": "/Users/zkat/Documents/code/npm",
"author": {
"name": "Kat Marchán",
@@ -119,5 +119,5 @@
"update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'",
"update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'"
},
- "version": "2.7.11"
+ "version": "2.7.12"
}