@antora/ui-loader 3.2.0-alpha.2 → 3.2.0-alpha.3

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/README.md CHANGED
@@ -10,4 +10,4 @@ Its site generator aggregates documents from versioned content repositories and
10
10
 
11
11
  Copyright (C) 2017-present [OpenDevise Inc.](https://opendevise.com) and the [Antora Project](https://antora.org).
12
12
 
13
- Use of this software is granted under the terms of the [Mozilla Public License Version 2.0](https://www.mozilla.org/en-US/MPL/2.0/) (MPL-2.0).
13
+ Use of this software is granted under the terms of the [Mozilla Public License Version 2.0](https://www.mozilla.org/en-US/MPL/2.0/) (MPL-2.0).
package/lib/load-ui.js CHANGED
@@ -17,7 +17,7 @@ const forEach = (write, final) => new Writable({ objectMode: true, write, final
17
17
  const map = (transform) => new Transform({ objectMode: true, transform })
18
18
  const UiCatalog = require('./ui-catalog')
19
19
  const yaml = require('js-yaml')
20
- const vzip = require('gulp-vinyl-zip')
20
+ const vzip = require('@vscode/gulp-vinyl-zip')
21
21
 
22
22
  const STATIC_FILE_MATCHER_OPTS = {
23
23
  expandRange: (begin, end, step, opts) => bracesToGroup(opts ? `{${begin}..${end}..${step}}` : `{${begin}..${end}}`),
@@ -175,7 +175,7 @@ function createAgent (url, { httpProxy, httpsProxy, noProxy }) {
175
175
  function downloadBundle (url, to, agent) {
176
176
  return new Promise((resolve, reject) => {
177
177
  get({ url, agent }, (err, response, contents) => {
178
- if (err) reject(err)
178
+ if (err) return reject(err)
179
179
  if (response.statusCode !== 200) {
180
180
  const message = `Response code ${response.statusCode} (${response.statusMessage})`
181
181
  return reject(Object.assign(new Error(message), { name: 'HTTPError' }))
@@ -194,8 +194,10 @@ function downloadBundle (url, to, agent) {
194
194
  })
195
195
  }).catch((err) => {
196
196
  const errWrapper = new Error(`${err.summary || 'Failed to download UI bundle'}: ${url}`)
197
- errWrapper.stack += `\nCaused by: ${err.stack || 'unknown'}`
198
- throw errWrapper
197
+ if (err.code === 'ECONNRESET' || (err.message || '').toLowerCase() === 'request timed out') {
198
+ errWrapper.recoverable = true
199
+ }
200
+ throw Object.assign(errWrapper, { stack: `${errWrapper.stack}\nCaused by: ${err.stack || 'unknown'}` })
199
201
  })
200
202
  }
201
203
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antora/ui-loader",
3
- "version": "3.2.0-alpha.2",
3
+ "version": "3.2.0-alpha.3",
4
4
  "description": "Downloads a UI bundle, if necessary, and loads the files into a UI catalog for use in an Antora documentation pipeline.",
5
5
  "license": "MPL-2.0",
6
6
  "author": "OpenDevise Inc. (https://opendevise.com)",
@@ -26,10 +26,10 @@
26
26
  },
27
27
  "dependencies": {
28
28
  "@antora/expand-path-helper": "~2.0",
29
+ "@vscode/gulp-vinyl-zip": "~2.5",
29
30
  "braces": "~3.0",
30
31
  "cache-directory": "~2.0",
31
32
  "glob-stream": "~7.0",
32
- "gulp-vinyl-zip": "~2.5",
33
33
  "hpagent": "~1.2",
34
34
  "js-yaml": "~4.1",
35
35
  "picomatch": "~2.3",
@@ -54,7 +54,7 @@
54
54
  ],
55
55
  "scripts": {
56
56
  "test": "_mocha",
57
- "prepublishOnly": "node $npm_config_local_prefix/npm/prepublishOnly.js",
58
- "postpublish": "node $npm_config_local_prefix/npm/postpublish.js"
57
+ "prepublishOnly": "npx -y downdoc@latest --prepublish",
58
+ "postpublish": "npx -y downdoc@latest --postpublish"
59
59
  }
60
60
  }