Skip to content

Commit 1f7bf85

Browse files
committed
chore: rename 'registerCommand' to 'extendCli'
1 parent 379ca9b commit 1f7bf85

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

packages/@vuepress/core/lib/plugin-api/constants.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const PLUGIN_OPTION_META_MAP = {
2020
GLOBAL_UI_COMPONENTS: { name: 'globalUIComponents', types: [String, Array] },
2121
DEFINE: { name: 'define', types: [Function, Object] },
2222
ALIAS: { name: 'alias', types: [Function, Object] },
23-
REGISTER_COMMAND: { name: 'registerCommand', types: [Function] }
23+
EXTEND_CLI: { name: 'extendCli', types: [Function] }
2424
}
2525

2626
const PLUGIN_OPTION_MAP = {}

packages/@vuepress/core/lib/plugin-api/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ module.exports = class PluginAPI {
207207
globalUIComponents,
208208
define,
209209
alias,
210-
registerCommand
210+
extendCli
211211
}) {
212212
const isInternalPlugin = pluginName.startsWith('@vuepress/internal-')
213213
logger[isInternalPlugin ? 'debug' : 'tip'](pluginLog(pluginName, shortcut))
@@ -230,7 +230,7 @@ module.exports = class PluginAPI {
230230
.registerOption(PLUGIN_OPTION_MAP.GLOBAL_UI_COMPONENTS.key, globalUIComponents, pluginName)
231231
.registerOption(PLUGIN_OPTION_MAP.DEFINE.key, define, pluginName)
232232
.registerOption(PLUGIN_OPTION_MAP.ALIAS.key, alias, pluginName)
233-
.registerOption(PLUGIN_OPTION_MAP.REGISTER_COMMAND.key, registerCommand, pluginName)
233+
.registerOption(PLUGIN_OPTION_MAP.EXTEND_CLI.key, extendCli, pluginName)
234234
}
235235
}
236236

packages/vuepress/lib/handleUnknownCommand.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ module.exports = async function (cli, options) {
3939

4040
if (sourceDir) {
4141
context = await prepare(sourceDir, options)
42-
context.pluginAPI.options.registerCommand.apply(cli)
42+
context.pluginAPI.options.extendCli.apply(cli)
4343
}
4444

4545
logger.setOptions({ logLevel: 3 })
@@ -107,7 +107,7 @@ function registerUnknownCommands (cli, options) {
107107
...options,
108108
...commandoptions
109109
}, false /* isProd */)
110-
await context.pluginAPI.options.registerCommand.apply(subCli)
110+
await context.pluginAPI.options.extendCli.apply(subCli)
111111
},
112112
async afterParse (subCli) {
113113
if (!subCli.matchedCommand) {

0 commit comments

Comments
 (0)