@antora/cli 3.0.3 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +2 -2
- package/lib/commander/options-from-convict.js +4 -2
- package/package.json +13 -6
package/lib/cli.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const buildPlaybook = require('@antora/playbook-builder')
|
|
4
4
|
const cli = require('./commander')
|
|
5
|
-
const convict = require('@antora/playbook-builder/lib/solitary-convict')
|
|
5
|
+
const convict = require('@antora/playbook-builder/lib/solitary-convict') // drop lib segment in Antora 4
|
|
6
6
|
const ospath = require('path')
|
|
7
7
|
const userRequire = require('@antora/user-require-helper')
|
|
8
8
|
|
|
@@ -152,7 +152,7 @@ cli.command('help [command]', { hidden: true }).action((name, options, command)
|
|
|
152
152
|
helpCommand.help()
|
|
153
153
|
} else {
|
|
154
154
|
const message = `error: unknown command '${name}'. See '${cli.name()} --help' for a list of commands.`
|
|
155
|
-
cli.
|
|
155
|
+
cli.error(message, { code: 'commander.unknownCommand', exitCode: 1 })
|
|
156
156
|
}
|
|
157
157
|
} else {
|
|
158
158
|
cli.help()
|
|
@@ -27,10 +27,12 @@ function collectOptions (props, context = undefined) {
|
|
|
27
27
|
accum.push(...collectOptions(value._cvtProperties, context ? `${context}.${key}` : key))
|
|
28
28
|
} else if ('arg' in value) {
|
|
29
29
|
const { arg, format, default: default_ } = value
|
|
30
|
-
const option = { name: arg, form: `--${arg}`, description: value.doc, format
|
|
30
|
+
const option = { name: arg, form: `--${arg}`, description: value.doc, format }
|
|
31
31
|
if (Array.isArray(format)) {
|
|
32
32
|
option.form += ' <choice>'
|
|
33
|
-
|
|
33
|
+
const choices = format.slice()
|
|
34
|
+
const value = () => choices
|
|
35
|
+
Object.defineProperties((option.choices = choices), { map: { value }, slice: { value } })
|
|
34
36
|
} else if (format !== 'boolean') {
|
|
35
37
|
option.form += ` <${arg.substr(arg.lastIndexOf('-') + 1, arg.length)}>`
|
|
36
38
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antora/cli",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "The command line interface for Antora.",
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
6
|
"author": "OpenDevise Inc. (https://opendevise.com)",
|
|
@@ -14,23 +14,30 @@
|
|
|
14
14
|
"url": "https://gitlab.com/antora/antora/issues"
|
|
15
15
|
},
|
|
16
16
|
"main": "lib/index.js",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": "./lib/index.js",
|
|
19
|
+
"./package.json": "./package.json"
|
|
20
|
+
},
|
|
21
|
+
"imports": {
|
|
22
|
+
"#commander": "./lib/commander.js"
|
|
23
|
+
},
|
|
17
24
|
"bin": {
|
|
18
25
|
"antora": "bin/antora"
|
|
19
26
|
},
|
|
20
27
|
"dependencies": {
|
|
21
|
-
"@antora/logger": "3.0
|
|
22
|
-
"@antora/playbook-builder": "3.0
|
|
28
|
+
"@antora/logger": "3.1.0",
|
|
29
|
+
"@antora/playbook-builder": "3.1.0",
|
|
23
30
|
"@antora/user-require-helper": "~2.0",
|
|
24
|
-
"commander": "~
|
|
31
|
+
"commander": "~9.4"
|
|
25
32
|
},
|
|
26
33
|
"devDependencies": {
|
|
27
|
-
"@antora/site-publisher": "3.0
|
|
34
|
+
"@antora/site-publisher": "3.1.0",
|
|
28
35
|
"@asciidoctor/core": "~2.2",
|
|
29
36
|
"convict": "~6.2",
|
|
30
37
|
"kapok-js": "~0.10"
|
|
31
38
|
},
|
|
32
39
|
"engines": {
|
|
33
|
-
"node": ">=
|
|
40
|
+
"node": ">=16.0.0"
|
|
34
41
|
},
|
|
35
42
|
"files": [
|
|
36
43
|
"bin/",
|