@antora/cli
Advanced tools
Comparing version 1.0.0-alpha.4 to 1.0.0-alpha.5
@@ -8,3 +8,2 @@ #!/usr/bin/env node | ||
const configSchema = require('@antora/playbook-builder/lib/config/schema') | ||
const fs = require('fs') | ||
const ospath = require('path') | ||
@@ -22,5 +21,9 @@ const solitaryConvict = require('@antora/playbook-builder/lib/solitary-convict') | ||
function requireSiteGenerator (name) { | ||
const localPath = ospath.resolve('node_modules', name) | ||
return require(fs.existsSync(ospath.join(localPath, 'package.json')) ? localPath : name) | ||
function requireSiteGenerator (name, playbookDir) { | ||
try { | ||
// QUESTION should we remove the leading ./ ? (makes it a broader search) | ||
const searchPath = '.' + ospath.sep + ospath.relative('.', ospath.join(playbookDir, 'node_modules')) | ||
name = require.resolve(name, { paths: [searchPath] }) | ||
} catch (e) {} | ||
return require(name) | ||
} | ||
@@ -43,3 +46,3 @@ | ||
// TODO honor --generator option (or auto-detect) | ||
generateSite = requireSiteGenerator('@antora/site-generator-default') | ||
generateSite = requireSiteGenerator('@antora/site-generator-default', ospath.resolve(playbookFile, '..')) | ||
} catch (e) { | ||
@@ -46,0 +49,0 @@ console.error('error: No site generator found. Try installing @antora/site-generator-default.') |
{ | ||
"name": "@antora/cli", | ||
"version": "1.0.0-alpha.4", | ||
"version": "1.0.0-alpha.5", | ||
"description": "The command line interface for Antora.", | ||
@@ -21,3 +21,3 @@ "license": "MPL-2.0", | ||
"dependencies": { | ||
"@antora/playbook-builder": "1.0.0-alpha.4", | ||
"@antora/playbook-builder": "1.0.0-alpha.5", | ||
"commander": "^2.13.0" | ||
@@ -24,0 +24,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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
9064
161
+ Added@antora/playbook-builder@1.0.0-alpha.5(transitive)
- Removed@antora/playbook-builder@1.0.0-alpha.4(transitive)