@antora/content-aggregator 3.1.6 → 3.1.7
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/lib/aggregate-content.js
CHANGED
|
@@ -16,6 +16,7 @@ const GitCredentialManagerStore = require('./git-credential-manager-store')
|
|
|
16
16
|
const git = require('./git')
|
|
17
17
|
const { NotFoundError, ObjectTypeError, UnknownTransportError, UrlParseError } = git.Errors
|
|
18
18
|
const globStream = require('glob-stream')
|
|
19
|
+
const { inspect } = require('util')
|
|
19
20
|
const invariably = require('./invariably')
|
|
20
21
|
const logger = require('./logger')
|
|
21
22
|
const { makeMatcherRx, versionMatcherOpts: VERSION_MATCHER_OPTS } = require('./matcher')
|
|
@@ -118,11 +119,11 @@ async function collectFiles (sourcesByUrl, loadOpts, concurrency, fetchedUrls) {
|
|
|
118
119
|
})
|
|
119
120
|
return gracefulPromiseAllWithLimit(loadTasks, concurrency.fetch).then(([results, rejections]) => {
|
|
120
121
|
if (rejections.length) {
|
|
121
|
-
if (concurrency.fetch > 1 && rejections.every(({ recoverable }) => recoverable)) {
|
|
122
|
+
if (concurrency.fetch > 1 && results.length > 1 && rejections.every(({ recoverable }) => recoverable)) {
|
|
122
123
|
if (loadOpts.progress) loadOpts.progress.terminate() // reset cursor position and allow it be reused
|
|
123
|
-
const msg0 = 'An unexpected error occurred while
|
|
124
|
+
const msg0 = 'An unexpected error occurred while fetching content sources concurrently.'
|
|
124
125
|
const msg1 = 'Retrying with git.fetch_concurrency value of 1.'
|
|
125
|
-
logger.warn(msg0 + ' ' + msg1)
|
|
126
|
+
logger.warn(rejections[0], msg0 + ' ' + msg1)
|
|
126
127
|
const fulfilledUrls = results.map((it) => it && it.repo.url && it.url).filter((it) => it)
|
|
127
128
|
return collectFiles(sourcesByUrl, loadOpts, Object.assign(concurrency, { fetch: 1 }), fulfilledUrls)
|
|
128
129
|
}
|
|
@@ -986,15 +987,14 @@ function transformGitCloneError (err, displayUrl, authRequested) {
|
|
|
986
987
|
} else if (err.code === 'ENOTFOUND') {
|
|
987
988
|
wrappedMsg = `Content repository host could not be resolved: ${err.hostname}`
|
|
988
989
|
} else {
|
|
989
|
-
wrappedMsg =
|
|
990
|
+
wrappedMsg = err.message || String(err)
|
|
990
991
|
recoverable = trimMessage = true
|
|
991
992
|
}
|
|
992
|
-
if (trimMessage)
|
|
993
|
-
wrappedMsg = ~(wrappedMsg = wrappedMsg.trimEnd()).indexOf('. ') ? wrappedMsg : wrappedMsg.replace(/\.$/, '')
|
|
994
|
-
}
|
|
993
|
+
if (trimMessage && !~(wrappedMsg = wrappedMsg.trimEnd()).indexOf('. ')) wrappedMsg = wrappedMsg.replace(/\.$/, '')
|
|
995
994
|
const errWrapper = new Error(`${wrappedMsg} (url: ${displayUrl})`)
|
|
996
|
-
errWrapper.stack += `\nCaused by: ${err.stack
|
|
997
|
-
|
|
995
|
+
errWrapper.stack += `\nCaused by: ${err.stack ? inspect(err).replace(/^Error \[(.+?)\](?=: )/, '$1') : err}`
|
|
996
|
+
if (recoverable) Object.defineProperty(errWrapper, 'recoverable', { value: true })
|
|
997
|
+
return errWrapper
|
|
998
998
|
}
|
|
999
999
|
|
|
1000
1000
|
function splitRefPatterns (str) {
|
package/lib/git-plugin-http.js
CHANGED
|
@@ -49,11 +49,12 @@ module.exports = ({ headers: extraHeaders, httpProxy, httpsProxy, noProxy } = {}
|
|
|
49
49
|
}
|
|
50
50
|
return {
|
|
51
51
|
async request ({ url, method, headers, body }) {
|
|
52
|
-
headers = mergeHeaders(headers, extraHeaders)
|
|
52
|
+
headers = Object.assign(mergeHeaders(headers, extraHeaders), { connection: 'close' })
|
|
53
53
|
body = await mergeBuffers(body)
|
|
54
|
-
return new Promise((resolve, reject) =>
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
return new Promise((resolve, reject) => {
|
|
55
|
+
const opts = { url, method, headers, body, timeout: 0, keepAlive: false }
|
|
56
|
+
return get(opts, (err, res) => (err ? reject(err) : resolve(distillResponse(res))))
|
|
57
|
+
})
|
|
57
58
|
},
|
|
58
59
|
}
|
|
59
60
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antora/content-aggregator",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.7",
|
|
4
4
|
"description": "Fetches and aggregates content from distributed sources for use in an Antora documentation pipeline.",
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
6
|
"author": "OpenDevise Inc. (https://opendevise.com)",
|
|
@@ -29,13 +29,13 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@antora/expand-path-helper": "~2.0",
|
|
32
|
-
"@antora/logger": "3.1.
|
|
32
|
+
"@antora/logger": "3.1.7",
|
|
33
33
|
"@antora/user-require-helper": "~2.0",
|
|
34
34
|
"braces": "~3.0",
|
|
35
35
|
"cache-directory": "~2.0",
|
|
36
36
|
"glob-stream": "~7.0",
|
|
37
37
|
"hpagent": "~1.2",
|
|
38
|
-
"isomorphic-git": "~1.
|
|
38
|
+
"isomorphic-git": "~1.25",
|
|
39
39
|
"js-yaml": "~4.1",
|
|
40
40
|
"multi-progress": "~4.0",
|
|
41
41
|
"picomatch": "~2.3",
|