pacote 9.3.0 → 9.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
  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.
4
4
 
5
+ <a name="9.4.0"></a>
6
+ # [9.4.0](https://github.com/zkat/pacote/compare/v9.3.0...v9.4.0) (2019-01-14)
7
+
8
+
9
+ ### Features
10
+
11
+ * **registry:** fall back to fullfat if something might be wrong with corgis ([0e71d6b](https://github.com/zkat/pacote/commit/0e71d6b))
12
+
13
+
14
+
5
15
  <a name="9.3.0"></a>
6
16
  # [9.3.0](https://github.com/zkat/pacote/compare/v9.2.3...v9.3.0) (2018-12-21)
7
17
 
@@ -16,9 +16,10 @@ function manifest (spec, opts) {
16
16
  }
17
17
 
18
18
  function getManifest (spec, opts) {
19
- return fetchPackument(spec, opts.concat({
19
+ opts = opts.concat({
20
20
  fullMetadata: opts.enjoyBy ? true : opts.fullMetadata
21
- })).then(packument => {
21
+ })
22
+ return fetchPackument(spec, opts).then(packument => {
22
23
  try {
23
24
  return pickManifest(packument, spec.fetchSpec, {
24
25
  defaultTag: opts.defaultTag,
@@ -29,14 +30,15 @@ function getManifest (spec, opts) {
29
30
  if (err.code === 'ETARGET' && packument._cached && !opts.offline) {
30
31
  opts.log.silly(
31
32
  'registry:manifest',
32
- `no matching version for ${spec.name}@${spec.fetchSpec} in the cache. Forcing revalidation`
33
+ `no matching version for ${spec.name}@${spec.fetchSpec} in the cache. Forcing revalidation.`
33
34
  )
34
35
  opts = opts.concat({
35
36
  preferOffline: false,
36
37
  preferOnline: true
37
38
  })
38
39
  return fetchPackument(spec, opts.concat({
39
- fullMetadata: opts.enjoyBy ? true : opts.fullMetadata
40
+ // Fetch full metadata in case ETARGET was due to corgi delay
41
+ fullMetadata: true
40
42
  })).then(packument => {
41
43
  return pickManifest(packument, spec.fetchSpec, {
42
44
  defaultTag: opts.defaultTag,
@@ -59,7 +59,15 @@ function fetchPackument (uri, registry, spec, opts) {
59
59
  mem.set(memoKey, packument)
60
60
  }
61
61
  return packument
62
- }))
62
+ })).catch(err => {
63
+ if (err.code === 'E404' && !opts.fullMetadata) {
64
+ return fetchPackument(uri, registry, spec, opts.concat({
65
+ fullMetadata: true
66
+ }))
67
+ } else {
68
+ throw err
69
+ }
70
+ })
63
71
  }
64
72
 
65
73
  class ObjProxy {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pacote",
3
- "version": "9.3.0",
3
+ "version": "9.4.0",
4
4
  "description": "JavaScript package downloader",
5
5
  "main": "index.js",
6
6
  "files": [