Skip to content

Commit 4324afb

Browse files
tabrindlehaoqunjiang
authored andcommitted
feat: add envinfo package via vue info in cli (#2863)
* feat: add envinfo package via `vue info` in cli * fix: update `vue info` npm global packages
1 parent 076c365 commit 4324afb

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

packages/@vue/cli/bin/vue.js

+21
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,27 @@ program
155155
loadCommand('upgrade', '@vue/cli-upgrade')(semverLevel, cleanArgs(cmd))
156156
})
157157

158+
program
159+
.command('info')
160+
.description('print debugging information about your environment')
161+
.action((cmd) => {
162+
console.log(chalk.bold('\nEnvironment Info:'))
163+
require('envinfo').run(
164+
{
165+
System: ['OS', 'CPU'],
166+
Binaries: ['Node', 'Yarn', 'npm'],
167+
Browsers: ['Chrome', 'Edge', 'Firefox', 'Safari'],
168+
npmPackages: '/**/{*vue*,@vue/*/}',
169+
npmGlobalPackages: ['@vue/cli']
170+
},
171+
{
172+
showNotFound: true,
173+
duplicates: true,
174+
fullTree: true
175+
}
176+
).then(console.log)
177+
})
178+
158179
// output help information on unknown commands
159180
program
160181
.arguments('<command>')

packages/@vue/cli/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"deepmerge": "^2.1.1",
3535
"download-git-repo": "^1.0.2",
3636
"ejs": "^2.6.1",
37+
"envinfo": "^5.11.1",
3738
"execa": "^1.0.0",
3839
"fs-extra": "^6.0.1",
3940
"globby": "^8.0.1",

0 commit comments

Comments
 (0)