@antora/content-classifier
Advanced tools
Comparing version 3.1.7 to 3.1.8
@@ -5,2 +5,4 @@ 'use strict' | ||
const collateAsciiDocAttributes = require('@antora/asciidoc-loader/config/collate-asciidoc-attributes') | ||
const logger = require('./logger') | ||
const summarizeFileLocation = require('./util/summarize-file-location') | ||
@@ -38,4 +40,12 @@ /** | ||
const { files, nav, startPage } = componentVersionData | ||
const navResolved = nav && (nav.resolved = new Set()) | ||
componentVersionData.files = undefined // clean up memory | ||
files.forEach((file) => allocateSrc(file, name, version, nav) && contentCatalog.addFile(file)) | ||
if (navResolved && nav.length > navResolved.size && new Set(nav).size > navResolved.size) { | ||
const loc = summarizeFileLocation({ path: 'antora.yml', src: { origin: nav.origin } }) | ||
for (const filepath of nav) { | ||
if (navResolved.has(filepath)) continue | ||
logger.warn('Could not resolve nav entry for %s@%s defined in %s: %s', version, name, loc, filepath) | ||
} | ||
} | ||
contentCatalog.registerComponentVersionStartPage(name, componentVersion, startPage) | ||
@@ -50,5 +60,5 @@ }) | ||
const filepath = file.path | ||
const navInfo = nav && getNavInfo(filepath, nav) | ||
const pathSegments = filepath.split('/') | ||
if (navInfo) { | ||
let navInfo | ||
if (nav && (navInfo = getNavInfo(filepath, nav))) { | ||
if (extname !== '.adoc') return // ignore file | ||
@@ -63,3 +73,3 @@ file.nav = navInfo | ||
} else { | ||
// relative to root | ||
// relative to content source root | ||
file.src.relative = filepath | ||
@@ -71,3 +81,3 @@ } | ||
case 'pages': | ||
// pages/_partials location for partials is @deprecated; special designation scheduled to be removed in Antora 4 | ||
// pages/_partials location for partials is @deprecated; special designation scheduled for removal in Antora 4 | ||
if (pathSegments[3] === '_partials') { | ||
@@ -135,3 +145,3 @@ file.src.family = 'partial' | ||
const index = nav.findIndex((candidate) => candidate === filepath) | ||
if (~index) return { index } | ||
if (~index) return nav.resolved.add(filepath) && { index } | ||
} | ||
@@ -138,0 +148,0 @@ |
@@ -10,2 +10,3 @@ 'use strict' | ||
const resolveResource = require('./util/resolve-resource') | ||
const summarizeFileLocation = require('./util/summarize-file-location') | ||
const versionCompare = require('./util/version-compare-desc') | ||
@@ -76,2 +77,3 @@ | ||
} | ||
// NOTE if no AsciiDoc attributes are defined in the component descriptor, asciidoc is the siteAsciiDocConfig object | ||
if (asciidoc) componentVersion.asciidoc = asciidoc | ||
@@ -148,3 +150,3 @@ const component = this[$components].get(name) | ||
const details = [filesForFamily.get(key), file] | ||
.map((it, idx) => `${idx + 1}: ${getFileLocation(it)}`) | ||
.map((it, idx) => `${idx + 1}: ${summarizeFileLocation(it)}`) | ||
.join(LOG_WRAP) | ||
@@ -371,6 +373,6 @@ if (family === 'nav') { | ||
? `Page cannot define alias that references itself: ${generateResourceSpec(src)}` + | ||
` (specified as: ${spec})${LOG_WRAP}source: ${getFileLocation(existingPage)}` | ||
` (specified as: ${spec})${LOG_WRAP}source: ${summarizeFileLocation(existingPage)}` | ||
: `Page alias cannot reference an existing page: ${generateResourceSpec(src)} (specified as: ${spec})` + | ||
`${LOG_WRAP}source: ${getFileLocation(target)}` + | ||
`${LOG_WRAP}existing page: ${getFileLocation(existingPage)}` | ||
`${LOG_WRAP}source: ${summarizeFileLocation(target)}` + | ||
`${LOG_WRAP}existing page: ${summarizeFileLocation(existingPage)}` | ||
) | ||
@@ -387,3 +389,3 @@ } | ||
`Duplicate alias: ${generateResourceSpec(src)} (specified as: ${spec})` + | ||
`${LOG_WRAP}source: ${getFileLocation(target)}` | ||
`${LOG_WRAP}source: ${summarizeFileLocation(target)}` | ||
) | ||
@@ -606,11 +608,2 @@ } | ||
function getFileLocation ({ path: path_, src: { abspath, origin } }) { | ||
if (!origin) return abspath || path_ | ||
const { url, gitdir, worktree, refname, tag, reftype = tag ? 'tag' : 'branch', remote, startPath } = origin | ||
let details = `${reftype}: ${refname}` | ||
if ('worktree' in origin) details += worktree ? ' <worktree>' : remote ? ` <remotes/${remote}>` : '' | ||
if (startPath) details += ` | start path: ${startPath}` | ||
return `${abspath || path.join(startPath, path_)} in ${'worktree' in origin ? worktree || gitdir : url} (${details})` | ||
} | ||
module.exports = ContentCatalog |
{ | ||
"name": "@antora/content-classifier", | ||
"version": "3.1.7", | ||
"version": "3.1.8", | ||
"description": "Organizes aggregated content into a virtual file catalog for use in an Antora documentation pipeline.", | ||
@@ -30,6 +30,6 @@ "license": "MPL-2.0", | ||
"dependencies": { | ||
"@antora/asciidoc-loader": "3.1.7", | ||
"@antora/logger": "3.1.7", | ||
"@antora/asciidoc-loader": "3.1.8", | ||
"@antora/logger": "3.1.8", | ||
"mime-types": "~2.1", | ||
"vinyl": "~2.2" | ||
"vinyl": "~3.0" | ||
}, | ||
@@ -36,0 +36,0 @@ "engines": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
42965
13
948
+ Added@antora/asciidoc-loader@3.1.8(transitive)
+ Added@antora/logger@3.1.8(transitive)
+ Addedbare-events@2.5.0(transitive)
+ Addedfast-fifo@1.3.2(transitive)
+ Addedhelp-me@5.0.0(transitive)
+ Addedpino@9.2.0(transitive)
+ Addedpino-abstract-transport@1.2.0(transitive)
+ Addedpino-pretty@11.2.2(transitive)
+ Addedpino-std-serializers@7.0.0(transitive)
+ Addedprocess-warning@3.0.0(transitive)
+ Addedqueue-tick@1.0.1(transitive)
+ Addedreplace-ext@2.0.0(transitive)
+ Addedsonic-boom@4.0.1(transitive)
+ Addedsplit2@4.2.0(transitive)
+ Addedstreamx@2.20.2(transitive)
+ Addedteex@1.0.1(transitive)
+ Addedtext-decoder@1.2.1(transitive)
+ Addedthread-stream@3.1.0(transitive)
+ Addedvinyl@3.0.0(transitive)
- Removed@antora/asciidoc-loader@3.1.7(transitive)
- Removed@antora/logger@3.1.7(transitive)
- Removedbrace-expansion@2.0.1(transitive)
- Removedclone-buffer@1.0.0(transitive)
- Removedcloneable-readable@1.1.3(transitive)
- Removedcore-util-is@1.0.3(transitive)
- Removedglob@8.1.0(transitive)
- Removedhelp-me@4.2.0(transitive)
- Removedisarray@1.0.0(transitive)
- Removedminimatch@5.1.6(transitive)
- Removedpino@8.14.2(transitive)
- Removedpino-pretty@10.0.1(transitive)
- Removedpino-std-serializers@6.2.2(transitive)
- Removedprocess-nextick-args@2.0.1(transitive)
- Removedprocess-warning@2.3.2(transitive)
- Removedreadable-stream@2.3.83.6.2(transitive)
- Removedreplace-ext@1.0.1(transitive)
- Removedsafe-buffer@5.1.2(transitive)
- Removedsonic-boom@3.3.0(transitive)
- Removedstring_decoder@1.1.1(transitive)
- Removedthread-stream@2.7.0(transitive)
- Removedutil-deprecate@1.0.2(transitive)
- Removedvinyl@2.2.1(transitive)
Updated@antora/logger@3.1.8
Updatedvinyl@~3.0