@antora/content-aggregator 3.0.0-beta.4 → 3.0.0-beta.5
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 +11 -7
- package/package.json +2 -6
package/lib/aggregate-content.js
CHANGED
|
@@ -428,9 +428,10 @@ function collectFilesFromStartPath (startPath, repo, authStatus, ref, worktreePa
|
|
|
428
428
|
return componentVersionBucket
|
|
429
429
|
})
|
|
430
430
|
.catch((err) => {
|
|
431
|
+
const msg = err.message
|
|
431
432
|
const refInfo = `ref: ${ref.fullname.replace(HEADS_DIR_RX, '')}${worktreePath ? ' <worktree>' : ''}`
|
|
432
|
-
const pathInfo = !startPath ||
|
|
433
|
-
throw Object.assign(err, { message:
|
|
433
|
+
const pathInfo = !startPath || msg.startsWith('the start path ') ? '' : ' | path: ' + startPath
|
|
434
|
+
throw Object.assign(err, { message: msg.replace(/$/m, ` in ${repo.url || repo.dir} (${refInfo}${pathInfo})`) })
|
|
434
435
|
})
|
|
435
436
|
}
|
|
436
437
|
|
|
@@ -652,7 +653,7 @@ function loadComponentDescriptor (files, ref, version) {
|
|
|
652
653
|
files.splice(descriptorFileIdx, 1)
|
|
653
654
|
let data
|
|
654
655
|
try {
|
|
655
|
-
data = yaml.load(descriptorFile.contents.toString())
|
|
656
|
+
data = yaml.load(descriptorFile.contents.toString(), { schema: yaml.CORE_SCHEMA })
|
|
656
657
|
} catch (err) {
|
|
657
658
|
throw Object.assign(err, { message: `${COMPONENT_DESC_FILENAME} has invalid syntax; ${err.message}` })
|
|
658
659
|
}
|
|
@@ -664,7 +665,8 @@ function loadComponentDescriptor (files, ref, version) {
|
|
|
664
665
|
if ('version' in data) version = data.version
|
|
665
666
|
if (!version) {
|
|
666
667
|
if (version === undefined) throw new Error(`${COMPONENT_DESC_FILENAME} is missing a version`)
|
|
667
|
-
version
|
|
668
|
+
if (version === false) throw new Error(`${COMPONENT_DESC_FILENAME} has an invalid version`)
|
|
669
|
+
version = '' + (typeof version === 'number' ? version : '')
|
|
668
670
|
} else if (version === true) {
|
|
669
671
|
version = ref.shortname.replace(PATH_SEPARATOR_RX, '-')
|
|
670
672
|
} else if (version.constructor === Object) {
|
|
@@ -686,7 +688,7 @@ function loadComponentDescriptor (files, ref, version) {
|
|
|
686
688
|
throw new Error(`version in ${COMPONENT_DESC_FILENAME} cannot have path segments: ${matched}`)
|
|
687
689
|
}
|
|
688
690
|
version = matched.replace(PATH_SEPARATOR_RX, '-')
|
|
689
|
-
} else if ((version =
|
|
691
|
+
} else if ((version = '' + version) === '.' || version === '..' || ~version.indexOf('/')) {
|
|
690
692
|
throw new Error(`version in ${COMPONENT_DESC_FILENAME} cannot have path segments: ${version}`)
|
|
691
693
|
}
|
|
692
694
|
data.version = version
|
|
@@ -702,7 +704,8 @@ function computeOrigin (url, authStatus, gitdir, ref, startPath, worktreePath =
|
|
|
702
704
|
} else {
|
|
703
705
|
if (worktreePath) {
|
|
704
706
|
origin.fileUriPattern =
|
|
705
|
-
(posixify ? 'file:///' + posixify(worktreePath) : 'file://' + worktreePath) +
|
|
707
|
+
(posixify ? 'file:///' + posixify(worktreePath) : 'file://' + worktreePath) +
|
|
708
|
+
(startPath ? '/' + startPath + '/%s' : '/%s')
|
|
706
709
|
} else {
|
|
707
710
|
origin.refhash = refhash
|
|
708
711
|
}
|
|
@@ -890,7 +893,8 @@ function resolveRemoteUrl (repo, remoteName) {
|
|
|
890
893
|
return 'https://' + url.substr(url.indexOf('@') + 1 || 6).replace(URL_PORT_CLEANER_RX, '$1')
|
|
891
894
|
}
|
|
892
895
|
}
|
|
893
|
-
|
|
896
|
+
url = posixify ? 'file:///' + posixify(repo.dir) : 'file://' + repo.dir
|
|
897
|
+
return ~url.indexOf(' ') ? url.replace(SPACE_RX, '%20') : url
|
|
894
898
|
})
|
|
895
899
|
}
|
|
896
900
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antora/content-aggregator",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.5",
|
|
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)",
|
|
@@ -33,9 +33,6 @@
|
|
|
33
33
|
"simple-get": "~4.0",
|
|
34
34
|
"vinyl": "~2.2"
|
|
35
35
|
},
|
|
36
|
-
"devDependencies": {
|
|
37
|
-
"node-git-server": "~0.6"
|
|
38
|
-
},
|
|
39
36
|
"engines": {
|
|
40
37
|
"node": ">=12.21.0"
|
|
41
38
|
},
|
|
@@ -52,6 +49,5 @@
|
|
|
52
49
|
"static site",
|
|
53
50
|
"web publishing"
|
|
54
51
|
],
|
|
55
|
-
"gitHead": "
|
|
56
|
-
"readmeFilename": "README.md"
|
|
52
|
+
"gitHead": "a13d03df41654d4deb78211a5a54953ce2a35fb8"
|
|
57
53
|
}
|