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

@antora/content-classifier

Package Overview
Dependencies
Maintainers
2
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 2.3.0-alpha.2 to 2.3.0-beta.1

2

lib/classify-content.js

@@ -26,4 +26,4 @@ 'use strict'

delete descriptor.files
descriptor.asciidoc = resolveAsciiDocConfig(siteAsciiDocConfig, descriptor)
files.forEach((file) => allocateSrc(file, name, version, nav) && catalog.addFile(file))
descriptor.asciidocConfig = resolveAsciiDocConfig(siteAsciiDocConfig, descriptor)
catalog.registerComponentVersion(name, version, descriptor)

@@ -30,0 +30,0 @@ return catalog

@@ -24,3 +24,3 @@ 'use strict'

registerComponentVersion (name, version, descriptor = {}) {
const { asciidocConfig, displayVersion, prerelease, title, startPage: startPageSpec } = descriptor
const { asciidoc, displayVersion, prerelease, title, startPage: startPageSpec } = descriptor
let startPage = this.resolvePage(startPageSpec || 'index.adoc', { component: name, version, module: 'ROOT' })

@@ -51,4 +51,4 @@ if (!startPage) {

}
if (asciidocConfig) componentVersion.asciidocConfig = asciidocConfig
const component = this.getComponent(name)
if (asciidoc) componentVersion.asciidoc = asciidoc
const component = this[$components].get(name)
if (component) {

@@ -72,2 +72,7 @@ const componentVersions = component.versions

{
asciidoc: {
get: function () {
return this.latest.asciidoc
},
},
// NOTE alias latestVersion to latest for backwards compatibility

@@ -93,2 +98,3 @@ latestVersion: {

}
return componentVersion
}

@@ -108,2 +114,4 @@

publishable = true
} else if ('out' in file) {
delete file.out
} else if (

@@ -120,2 +128,3 @@ (actingFamily === 'page' || actingFamily === 'image' || actingFamily === 'attachment') &&

this[$files].set(key, file)
return file
}

@@ -126,4 +135,3 @@

const accum = []
for (const entry of this[$files]) {
const candidate = entry[1]
for (const candidate of this[$files].values()) {
const candidateSrc = candidate.src

@@ -140,4 +148,3 @@ if (criteriaEntries.every(([key, val]) => candidateSrc[key] === val)) accum.push(candidate)

getByPath ({ component, version, path: path_ }) {
for (const entry of this[$files]) {
const candidate = entry[1]
for (const candidate of this[$files].values()) {
if (candidate.path === path_ && candidate.src.component === component && candidate.src.version === version) {

@@ -183,7 +190,12 @@ return candidate

getPages () {
getPages (filter) {
const accum = []
for (const entry of this[$files]) {
const candidate = entry[1]
if (candidate.src.family === 'page') accum.push(candidate)
if (filter) {
for (const candidate of this[$files].values()) {
if (candidate.src.family === 'page' && filter(candidate)) accum.push(candidate)
}
} else {
for (const candidate of this[$files].values()) {
if (candidate.src.family === 'page') accum.push(candidate)
}
}

@@ -217,3 +229,3 @@ return accum

} else if (!src.version) {
// QUESTION is this correct to assume?
// QUESTION should we skip registering alias in this case?
src.version = 'master'

@@ -249,3 +261,3 @@ }

resolvePage (spec, context = {}) {
return resolveResource(spec, this, context, 'page', ['page'])
return this.resolveResource(spec, context, 'page', ['page'])
}

@@ -276,2 +288,6 @@

getComponentVersion (component, version) {
return target.getComponentVersion(component, version)
}
getComponents () {

@@ -278,0 +294,0 @@ return target.getComponents()

@@ -52,3 +52,3 @@ 'use strict'

}
if (family === 'page' && !relative.endsWith('.adoc')) relative += '.adoc'
if ((family === 'page' || family === 'alias') && !relative.endsWith('.adoc')) relative += '.adoc'

@@ -55,0 +55,0 @@ if (component) {

@@ -38,5 +38,8 @@ 'use strict'

return catalog.getById(id)
return (
catalog.getById(id) ||
(id.family === 'page' ? (catalog.getById(Object.assign({}, id, { family: 'alias' })) || {}).rel : undefined)
)
}
module.exports = resolveResource
{
"name": "@antora/content-classifier",
"version": "2.3.0-alpha.2",
"version": "2.3.0-beta.1",
"description": "Organizes aggregated content into a virtual file catalog for use in an Antora documentation pipeline.",

@@ -19,6 +19,7 @@ "license": "MPL-2.0",

"dependencies": {
"@antora/asciidoc-loader": "2.3.0-beta.1",
"vinyl": "~2.2"
},
"devDependencies": {
"@antora/content-aggregator": "2.3.0-alpha.2"
"@antora/content-aggregator": "2.3.0-beta.1"
},

@@ -25,0 +26,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