Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@antora/content-classifier

Package Overview
Dependencies
Maintainers
0
Versions
86
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@antora/content-classifier - npm Package Compare versions

Comparing version 3.1.7 to 3.1.8

lib/util/summarize-file-location.js

20

lib/classify-content.js

@@ -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": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc