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

@antora/playbook-builder

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/playbook-builder - npm Package Compare versions

Comparing version 3.0.0-alpha.5 to 3.0.0-alpha.6

3

lib/build-playbook.js
'use strict'
const camelCaseKeys = require('camelcase-keys')
const { configureLogger } = require('@antora/logger')
const convict = require('./solitary-convict')

@@ -90,2 +91,4 @@ const fs = require('fs')

delete playbook.playbook
const log = (playbook.runtime || {}).log
if (log) configureLogger(playbook.runtime.silent ? (log.level = 'silent') && log : log)
return freeze(playbook)

@@ -92,0 +95,0 @@ }

@@ -145,2 +145,25 @@ 'use strict'

},
network: {
http_proxy: {
doc: 'The URL of the proxy to use for HTTP URLs.',
format: 'url',
default: undefined,
arg: 'http-proxy',
env: 'http_proxy',
},
https_proxy: {
doc: 'The URL of the proxy to use for HTTPS URLs.',
format: 'url',
default: undefined,
arg: 'https-proxy',
env: 'https_proxy',
},
no_proxy: {
doc: 'A comma-separated list of domains and IPs that should not be proxied.',
format: String,
default: undefined,
arg: 'noproxy',
env: 'no_proxy',
},
},
runtime: {

@@ -172,2 +195,36 @@ cache_dir: {

},
log: {
level: {
doc: 'Set the minimum log level of messages that get logged.',
format: ['all', 'debug', 'info', 'warn', 'error', 'fatal', 'silent'],
default: 'warn',
arg: 'log-level',
env: 'ANTORA_LOG_LEVEL',
},
failure_level: {
doc: 'Set the log level tolerance that, when exceeded, will cause the application to fail on exit.',
format: ['all', 'debug', 'info', 'warn', 'error', 'fatal', 'silent'],
default: undefined,
arg: 'failure-level',
env: 'ANTORA_LOG_FAILURE_LEVEL',
},
format: new Proxy(
{
doc: 'Set the format of log messages. (default: structured if CI=true, pretty otherwise)',
format: ['pretty', 'structured', 'json'],
default: undefined,
arg: 'log-format',
env: 'ANTORA_LOG_FORMAT',
},
{
get (target, property) {
return property === 'default'
? process.env.CI === 'true' || process.env.NODE_ENV === 'test'
? 'structured'
: 'pretty'
: target[property]
},
}
),
},
},

@@ -174,0 +231,0 @@ urls: {

40

lib/solitary-convict.js

@@ -105,22 +105,30 @@ 'use strict'

convict.addFormat({
name: 'url',
validate: (val) => {
if (val == null) return
if (val.constructor !== String) throw new Error('must be a string')
let protocol
try {
protocol = new URL(val).protocol
} catch {
throw new Error('must be a valid URL')
}
if (!(protocol === 'https:' || protocol === 'http:')) throw new Error('must be an HTTP or HTTPS URL')
},
})
convict.addFormat({
name: 'url-or-pathname',
validate: (val) => {
if (val == null) return
if (val.constructor === String) {
if (val.charAt() === '/') val = 'https://example.org' + val
let protocol
let pathname
try {
;({ protocol, pathname } = new URL(val))
} catch {
throw new Error('must be an absolute URL or a pathname (i.e., root-relative path)')
}
if (protocol !== 'https:' && protocol !== 'http:') {
throw new Error('must be an absolute URL or a pathname (i.e., root-relative path)')
} else if (~pathname.indexOf('%20')) {
throw new Error('must not contain spaces')
}
} else {
throw new Error('must be an absolute URL or a pathname (i.e., root-relative path)')
if (val.constructor !== String) throw new Error('must be a string')
let parsedUrl
try {
parsedUrl = new URL((val.charAt() === '/' ? 'https://example.org' : '') + val)
} catch {
throw new Error('must be a valid URL or a pathname (i.e., root-relative path)')
}
if (parsedUrl.protocol !== 'https:' && parsedUrl.protocol !== 'http:') {
throw new Error('must be an HTTP or HTTPS URL or a pathname (i.e., root-relative path)')
}
if (~parsedUrl.pathname.indexOf('%20')) throw new Error('pathname segment must not contain spaces')
},

@@ -127,0 +135,0 @@ })

{
"name": "@antora/playbook-builder",
"version": "3.0.0-alpha.5",
"version": "3.0.0-alpha.6",
"description": "Builds a playbook object from user input for configuring successive documentation components in an Antora pipeline.",

@@ -19,2 +19,3 @@ "license": "MPL-2.0",

"dependencies": {
"@antora/logger": "3.0.0-alpha.6",
"@iarna/toml": "~2.2",

@@ -40,3 +41,3 @@ "camelcase-keys": "~6.2",

],
"gitHead": "433242dd89b2859355cf6a5ea045337f527a3415"
"gitHead": "38ec002e88eede3ce5c401a6e226d1a0356945c5"
}
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