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

@antora/ui-loader

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/ui-loader - npm Package Compare versions

Comparing version 3.0.0-alpha.1 to 3.0.0-alpha.2

53

lib/load-ui.js

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

: fsp
.access(cachePath)
.then(() => cachePath)
.stat(cachePath)
.then((stat) => new File({ path: cachePath, stat }))
.catch(() => downloadBundle(bundleUrl, cachePath))

@@ -81,24 +81,35 @@ })

resolveBundle = fsp
.access(localPath)
.then(() => localPath)
.stat(localPath)
.then((stat) => new File({ path: localPath, stat }))
.catch(() => {
throw new Error('Specified UI bundle does not exist: ' + bundleUrl)
throw new Error(
`Specified UI ${path.extname(localPath) ? 'bundle' : 'directory'} does not exist: ` +
(bundleUrl === localPath ? bundleUrl : `${localPath} (resolved from url: ${bundleUrl})`)
)
})
}
const files = await Promise.all([
resolveBundle.then((bundlePath) =>
resolveBundle.then((bundleFile) =>
new Promise((resolve, reject) =>
vzip
.src(bundlePath)
.on('error', (err) => {
err.message = `not a valid zip file; ${err.message}`
reject(err)
})
.pipe(selectFilesStartingFrom(bundle.startPath))
.pipe(bufferizeContents())
.on('error', reject)
.pipe(collectFiles(resolve))
bundleFile.isDirectory()
? vfs
.src('**/*', { cwd: bundleFile.path, removeBOM: false })
.on('error', reject)
.pipe(relativizeFiles())
.pipe(collectFiles(resolve))
: vzip
.src(bundleFile.path)
.on('error', (err) => {
err.message = `not a valid zip file; ${err.message}`
reject(err)
})
.pipe(selectFilesStartingFrom(bundle.startPath))
.pipe(bufferizeContents())
.on('error', reject)
.pipe(collectFiles(resolve))
).catch((err) => {
const wrapped = new Error(`Failed to read UI bundle: ${bundlePath} (resolved from url: ${bundleUrl})`)
const wrapped = new Error(
`Failed to read UI ${bundleFile.isDirectory() ? 'directory' : 'bundle'}: ` +
(bundleUrl === bundleFile.path ? bundleUrl : `${bundleFile.path} (resolved from url: ${bundleUrl})`)
)
wrapped.stack += '\nCaused by: ' + (err.stack || 'unknown')

@@ -110,5 +121,3 @@ throw wrapped

]).then(([bundleFiles, supplementalFiles]) => mergeFiles(bundleFiles, supplementalFiles))
const config = loadConfig(files, outputDir)
const catalog = new UiCatalog()

@@ -170,3 +179,3 @@ files.forEach((file) => classifyFile(file, config) && catalog.addFile(file))

.then(() => fsp.writeFile(to, body))
.then(() => resolve(to))
.then(() => resolve(new File({ path: to, stat: { isDirectory: () => false } })))
)

@@ -308,3 +317,3 @@ )

files.delete(UI_DESC_FILENAME)
const config = camelCaseKeys(yaml.safeLoad(configFile.contents.toString()), { deep: true })
const config = camelCaseKeys(yaml.load(configFile.contents.toString()), { deep: true })
if (outputDir !== undefined) config.outputDir = outputDir

@@ -311,0 +320,0 @@ const staticFiles = config.staticFiles

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

@@ -10,3 +10,4 @@ "license": "MPL-2.0",

"Sarah White <sarah@opendevise.com>",
"Hubert SABLONNIÈRE <hubert.sablonniere@gmail.com>"
"Hubert SABLONNIÈRE <hubert.sablonniere@gmail.com>",
"Guillaume Grossetie <g.grossetie@gmail.com>"
],

@@ -21,8 +22,8 @@ "homepage": "https://antora.org",

"@antora/expand-path-helper": "~1.0",
"bl": "~4.0",
"bl": "~5.0",
"cache-directory": "~2.0",
"camelcase-keys": "~6.2",
"got": "~11.7",
"got": "~11.8",
"gulp-vinyl-zip": "~2.2",
"js-yaml": "~3.14",
"js-yaml": "~4.0",
"minimatch-all": "~1.1",

@@ -47,3 +48,3 @@ "vinyl": "~2.2",

],
"gitHead": "337ff6d2ed11e1f4d0a8ef993ddc8eaac7a73e9f"
"gitHead": "997231474334311f3e5ff55d68534f5ae6e5d7ee"
}

@@ -11,4 +11,4 @@ # Antora UI Loader

Copyright (C) 2017-2020 [OpenDevise Inc.](https://opendevise.com) and the [Antora Project](https://antora.org).
Copyright (C) 2017-present [OpenDevise Inc.](https://opendevise.com) and the [Antora Project](https://antora.org).
Use of this software is granted under the terms of the [Mozilla Public License Version 2.0](https://www.mozilla.org/en-US/MPL/2.0/) (MPL-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