New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@antora/ui-loader

Package Overview
Dependencies
Maintainers
0
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@antora/ui-loader - npm Package Compare versions

Comparing version 3.2.0-alpha.6 to 3.2.0-alpha.8

75

lib/load-ui.js

@@ -87,5 +87,5 @@ 'use strict'

: fsp.stat(cachePath).then(
(stat) => new File({ path: cachePath, stat }),
() => downloadBundle(bundleUrl, cachePath, createAgent(bundleUrl, playbook.network || {}))
)
(stat) => new File({ path: cachePath, stat }),
() => downloadBundle(bundleUrl, cachePath, createAgent(bundleUrl, playbook.network || {}))
)
})

@@ -110,5 +110,5 @@ } else {

: srcZip(bundleFile.path, { startPath: bundle.startPath })
.on('error', (err) => reject(Object.assign(err, { message: `not a valid zip file; ${err.message}` })))
.pipe(bufferizeContentsAndCollectFiles(resolve))
.on('error', reject)
.on('error', (err) => reject(Object.assign(err, { message: `not a valid zip file; ${err.message}` })))
.pipe(bufferizeContentsAndCollectFiles(resolve))
.on('error', reject)
).catch((err) => {

@@ -208,24 +208,23 @@ const msg =

? Promise.all(
filesSpec.reduce((accum, { path: path_, contents: contents_ }) => {
if (!path_) {
return accum
} else if (contents_) {
if (~contents_.indexOf('\n') || !EXT_RX.test(contents_)) {
accum.push(new MemoryFile({ path: path_, contents: Buffer.from(contents_) }))
filesSpec.reduce((accum, { path: path_, contents: contents_ }) => {
if (!path_) return accum
if (contents_) {
if (~contents_.indexOf('\n') || !EXT_RX.test(contents_)) {
accum.push(new MemoryFile({ path: path_, contents: Buffer.from(contents_) }))
} else {
contents_ = expandPath(contents_, { dot: startDir })
accum.push(
fsp
.stat(contents_)
.then((stat) =>
fsp.readFile(contents_).then((contents) => new File({ path: path_, contents, stat }))
)
)
}
} else {
contents_ = expandPath(contents_, { dot: startDir })
accum.push(
fsp
.stat(contents_)
.then((stat) =>
fsp.readFile(contents_).then((contents) => new File({ path: path_, contents, stat }))
)
)
accum.push(new MemoryFile({ path: path_ }))
}
} else {
accum.push(new MemoryFile({ path: path_ }))
}
return accum
}, [])
).then((files) => files.reduce((accum, file) => accum.set(file.path, file) && accum, new Map()))
return accum
}, [])
).then((files) => files.reduce((accum, file) => accum.set(file.path, file) && accum, new Map()))
: fsp.access((cwd = expandPath(filesSpec, { dot: startDir }))).then(() => srcFs(cwd))

@@ -236,5 +235,4 @@ ).catch((err) => {

throw new Error(`Specified ui.supplemental_files directory does not exist: ${dir}`)
} else {
throw transformError(err, `Failed to read ui.supplemental_files ${cwd ? `directory: ${dir}` : 'entry'}`)
}
throw transformError(err, `Failed to read ui.supplemental_files ${cwd ? `directory: ${dir}` : 'entry'}`)
})

@@ -254,8 +252,7 @@ }

const staticFiles = config.staticFiles
if (staticFiles && staticFiles.length) config.isStaticFile = picomatch(staticFiles, STATIC_FILE_MATCHER_OPTS)
if (staticFiles?.length) config.isStaticFile = picomatch(staticFiles, STATIC_FILE_MATCHER_OPTS)
if (outputDir !== undefined) config.outputDir = outputDir
return config
} else {
return { outputDir }
}
return { outputDir }
}

@@ -274,3 +271,3 @@

function classifyFile (file, config) {
if (config.isStaticFile && config.isStaticFile(file.path)) {
if (typeof config.isStaticFile === 'function' && config.isStaticFile(file.path)) {
file.type = 'static'

@@ -324,10 +321,10 @@ file.out = resolveOut(file, '')

? fsp
.readlink(abspath)
.then(
(symlink) =>
(statErr.code === 'ELOOP' ? 'ELOOP: symbolic link cycle, ' : 'ENOENT: broken symbolic link, ') +
.readlink(abspath)
.then(
(symlink) =>
(statErr.code === 'ELOOP' ? 'ELOOP: symbolic link cycle, ' : 'ENOENT: broken symbolic link, ') +
`${relpath} -> ${symlink}`,
() => statErr.message.replace(`'${abspath}'`, relpath)
)
.then((message) => done(Object.assign(statErr, { message })))
() => statErr.message.replace(`'${abspath}'`, relpath)
)
.then((message) => done(Object.assign(statErr, { message })))
: done(Object.assign(statErr, { message: statErr.message.replace(`'${abspath}'`, relpath) }))

@@ -334,0 +331,0 @@ )

{
"name": "@antora/ui-loader",
"version": "3.2.0-alpha.6",
"version": "3.2.0-alpha.8",
"description": "Downloads a UI bundle, if necessary, and loads the files into a UI catalog for use in an Antora documentation pipeline.",

@@ -14,3 +14,7 @@ "license": "MPL-2.0",

"homepage": "https://antora.org",
"repository": "gitlab:antora/antora",
"repository": {
"type": "git",
"url": "git+https://gitlab.com/antora/antora.git",
"directory": "packages/ui-loader"
},
"bugs": {

@@ -29,3 +33,3 @@ "url": "https://gitlab.com/antora/antora/issues"

"dependencies": {
"@antora/expand-path-helper": "~2.0",
"@antora/expand-path-helper": "~3.0",
"braces": "~3.0",

@@ -32,0 +36,0 @@ "cache-directory": "~2.0",

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