@antora/playbook-builder
Advanced tools
Comparing version 3.1.1 to 3.1.2
@@ -69,3 +69,3 @@ 'use strict' | ||
doc: 'The default branch pattern to use when no specific pattern is provided.', | ||
format: Array, | ||
format: 'array-or-string', | ||
default: ['HEAD', 'v{0..9}*'], | ||
@@ -86,3 +86,3 @@ }, | ||
doc: 'The default tag pattern to use when no specific pattern is provided.', | ||
format: Array, | ||
format: 'array-or-string', | ||
default: undefined, | ||
@@ -258,19 +258,9 @@ }, | ||
}, | ||
format: new Proxy( | ||
{ | ||
doc: 'Set the format of log messages. Defaults to pretty if CI=true or stdout is a TTY, json otherwise.', | ||
format: ['json', 'pretty'], | ||
default: undefined, | ||
arg: 'log-format', | ||
env: 'ANTORA_LOG_FORMAT', | ||
}, | ||
{ | ||
get (target, property) { | ||
if (property !== 'default') return target[property] | ||
return process.env.CI === 'true' || (process.env.IS_TTY || String(process.stdout.isTTY)) === 'true' | ||
? 'pretty' | ||
: 'json' | ||
}, | ||
} | ||
), | ||
format: { | ||
doc: 'Set the format of log messages. Defaults to pretty if CI=true or stdout is a TTY, json otherwise.', | ||
format: ['json', 'pretty'], | ||
default: 'auto', | ||
arg: 'log-format', | ||
env: 'ANTORA_LOG_FORMAT', | ||
}, | ||
destination: { | ||
@@ -350,4 +340,9 @@ file: { | ||
}, | ||
[Symbol.for('convict.beforeValidate')]: ({ _schema: schema, _instance: data }) => { | ||
[Symbol.for('convict.beforeValidate')]: ({ getEnv, _instance: data, _schema: schema }) => { | ||
const runtime = data.runtime | ||
const log = runtime.log | ||
if (log.format === 'auto') { | ||
const env = getEnv() | ||
log.format = env.CI === 'true' || (env.IS_TTY || String(process.stdout.isTTY)) === 'true' ? 'pretty' : 'json' | ||
} | ||
if (runtime.silent) { | ||
@@ -354,0 +349,0 @@ if (runtime.quiet === false) runtime.quiet = true |
@@ -39,2 +39,10 @@ 'use strict' | ||
convict.addFormat({ | ||
name: 'array-or-string', | ||
validate: (val) => { | ||
if (!(val == null || val.constructor === String || Array.isArray(val))) { | ||
throw new Error('must be an array, string, or null') | ||
} | ||
}, | ||
}) | ||
convict.addFormat({ | ||
name: 'map', | ||
@@ -41,0 +49,0 @@ validate: (val) => { |
{ | ||
"name": "@antora/playbook-builder", | ||
"version": "3.1.1", | ||
"version": "3.1.2", | ||
"description": "Builds a playbook object from user input for configuring successive documentation components in an Antora pipeline.", | ||
@@ -5,0 +5,0 @@ "license": "MPL-2.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23971
632