Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add checkVSCodePlugins webtools #7

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

CwRv07
Copy link
Contributor

@CwRv07 CwRv07 commented Jun 24, 2023

新增webtools:checkVSCodePlugins
额外新增.doctor文件配置项字段:”vscodePlugins“

description: `You are missing the following plugins: ${chalk.red(
lackPlugins
)}`,
doctorLevel: "error",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doctorLevel 不能直接写死 需要给用户自定义 doctorLevel 的能力 直接 error 不可取

@vercel
Copy link

vercel bot commented Jun 26, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
doctor ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 26, 2023 5:38pm

Copy link
Member

@BoyYangzai BoyYangzai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good Work 👍

vscode: {
morePlugins: (
| string
| { name: string; desc: string; version?: string }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里可以抽出来一个

type ExtraPlugin = 

@@ -1,5 +1,6 @@
export default [
require.resolve("./checkNode"),
require.resolve("./checkChrome"),
require.resolve("./checkVSCodePlugins"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

按照到类型放在一起比较合适一点
这样通过 api.addDoctorWebToolsCheckBefore 可以做类别区分
such as:

api.addDoctorWebToolsCheckBefore(()=>{
    console.log('以下是对常用 VsCodePlugin 进行检测') // 当然 ui 可以随意diy
})

/**
* Get local VSCode plugins
*/
async function getLocalPlugins() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

提取 通用 utils 到 @dodctors/utils 这个包

export default (api: IApi) => {
api.addDoctorWebToolsCheck(async () => {
const vscodePlugins: VSCodePluginsConfig = [
...BASIC_VSCODE_PLUGINS,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以写几个最通用的先
Auto Rename Tag Chinese (Simplified) (简体中文) Language Pack for Visual Studi. Code Spell Checker Error Lens Live Server One Dark Pro Prettier - Code formatter
description 按照功能随意发挥

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants