mirror of
https://github.com/wahyd4/vuepress.git
synced 2026-08-09 05:16:23 +10:00
feat($core): info command (#1573)
This commit is contained in:
@@ -46,6 +46,10 @@ do not clear screen when dev server is ready.
|
||||
|
||||
Copy the default theme into `.vuepress/theme` for customization.
|
||||
|
||||
## info
|
||||
|
||||
Shows debugging information about the local environment.
|
||||
|
||||
## more commands
|
||||
|
||||
You can create a custom command with [extendCli](../plugin/option-api.md#extendcli).
|
||||
|
||||
@@ -4,6 +4,9 @@
|
||||
* Module dependencies.
|
||||
*/
|
||||
|
||||
const { chalk } = require('@vuepress/shared-utils')
|
||||
const envinfo = require('envinfo')
|
||||
|
||||
const { dev, build, eject } = require('@vuepress/core')
|
||||
const { path, logger, env } = require('@vuepress/shared-utils')
|
||||
const { wrapCommand } = require('./util')
|
||||
@@ -69,4 +72,23 @@ module.exports = function (cli, options) {
|
||||
.action((dir = '.') => {
|
||||
wrapCommand(eject)(path.resolve(dir))
|
||||
})
|
||||
|
||||
cli
|
||||
.command('info', 'Shows debugging information about the local environment')
|
||||
.action(() => {
|
||||
console.log(chalk.bold('\nEnvironment Info:'))
|
||||
envinfo.run(
|
||||
{
|
||||
System: ['OS', 'CPU'],
|
||||
Binaries: ['Node', 'Yarn', 'npm'],
|
||||
Browsers: ['Chrome', 'Edge', 'Firefox', 'Safari'],
|
||||
npmPackages: ['/**/{@vuepress/*/}']
|
||||
},
|
||||
{
|
||||
showNotFound: true,
|
||||
duplicates: true,
|
||||
fullTree: true
|
||||
}
|
||||
).then(console.log)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -31,7 +31,8 @@
|
||||
"dependencies": {
|
||||
"@vuepress/core": "^1.0.0-alpha.47",
|
||||
"@vuepress/theme-default": "^1.0.0-alpha.47",
|
||||
"cac": "^6.3.9"
|
||||
"cac": "^6.3.9",
|
||||
"envinfo": "^7.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8.6"
|
||||
|
||||
Reference in New Issue
Block a user