@antora/content-aggregator 3.1.0 → 3.1.1

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.
@@ -459,17 +459,16 @@ function readFilesFromWorktree (origin) {
459
459
  }
460
460
 
461
461
  function srcFs (cwd, origin) {
462
- const relpathStart = cwd.length + 1
463
- return new Promise((resolve, reject, cache = Object.create(null), files = []) =>
462
+ return new Promise((resolve, reject, cache = Object.create(null), files = [], relpathStart = cwd.length + 1) =>
464
463
  pipeline(
465
464
  globStream(CONTENT_SRC_GLOB, Object.assign({ cache, cwd }, CONTENT_SRC_OPTS)),
466
465
  forEach(({ path: abspathPosix }, _, done) => {
467
- if (Array.isArray(cache[abspathPosix])) return done() // detects some directories, but not all
466
+ if ((cache[abspathPosix] || {}).constructor === Array) return done() // detects some directories
468
467
  const abspath = posixify ? ospath.normalize(abspathPosix) : abspathPosix
469
468
  const relpath = abspath.substr(relpathStart)
470
469
  symlinkAwareStat(abspath).then(
471
470
  (stat) => {
472
- if (stat.isDirectory()) return done() // detects remaining directories
471
+ if (stat.isDirectory()) return done() // detects directories that slipped through cache check
473
472
  fsp.readFile(abspath).then(
474
473
  (contents) => {
475
474
  files.push(new File({ path: posixify ? posixify(relpath) : relpath, contents, stat, src: { abspath } }))
@@ -852,13 +851,9 @@ function resolveCredentials (credentialsFromUrlHolder, url, auth) {
852
851
  * @returns {String} The generated folder name.
853
852
  */
854
853
  function generateCloneFolderName (url) {
855
- let normalizedUrl = url.toLowerCase()
856
- if (posixify) normalizedUrl = posixify(normalizedUrl)
857
- normalizedUrl = removeGitSuffix(normalizedUrl)
854
+ const normalizedUrl = removeGitSuffix(posixify ? posixify(url.toLowerCase()) : url.toLowerCase())
858
855
  const basename = normalizedUrl.split(ANY_SEPARATOR_RX).pop()
859
- const hash = createHash('sha1')
860
- hash.update(normalizedUrl)
861
- return basename + '-' + hash.digest('hex') + '.git'
856
+ return basename + '-' + createHash('sha1').update(normalizedUrl).digest('hex') + '.git'
862
857
  }
863
858
 
864
859
  /**
package/lib/constants.js CHANGED
@@ -4,7 +4,7 @@ module.exports = Object.freeze({
4
4
  COMPONENT_DESC_FILENAME: 'antora.yml',
5
5
  CONTENT_CACHE_FOLDER: 'content',
6
6
  CONTENT_SRC_GLOB: '**/*[!~]',
7
- CONTENT_SRC_OPTS: { follow: true, nomount: true, nosort: true, nounique: true, strict: false, uniqueBy: (m) => m },
7
+ CONTENT_SRC_OPTS: { follow: true, nomount: true, nosort: true, nounique: true, strict: false },
8
8
  FILE_MODES: { 100644: 0o100666 & ~process.umask(), 100755: 0o100777 & ~process.umask() },
9
9
  GIT_CORE: 'antora',
10
10
  GIT_OPERATION_LABEL_LENGTH: 8,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antora/content-aggregator",
3
- "version": "3.1.0",
3
+ "version": "3.1.1",
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,7 +29,7 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@antora/expand-path-helper": "~2.0",
32
- "@antora/logger": "3.1.0",
32
+ "@antora/logger": "3.1.1",
33
33
  "@antora/user-require-helper": "~2.0",
34
34
  "braces": "~3.0",
35
35
  "cache-directory": "~2.0",