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

plugin 类型统一 #104

Open
ClarkXia opened this issue Jun 15, 2022 · 1 comment
Open

plugin 类型统一 #104

ClarkXia opened this issue Jun 15, 2022 · 1 comment

Comments

@ClarkXia
Copy link
Collaborator

ClarkXia commented Jun 15, 2022

在 build-scripts 2.0 设计中支持的 plugin 设置包括以下两种:

  • PluginOption { name, plugin, runtime}
  • Plugin

PluginOption 的类型名称定位上不够清晰,跟其内部的 plugin 关系有重叠

备选方案:

统一导出 plugins 配置类型: type Plugin = PluginOption | PluginLegacy | [string, object]
PluginOption 包含 { name, setup, runtime } / { name, config, runtime }

@wssgcg1213
Copy link

type Plugin = _Plugin | PluginLegacy;

interface _Plugin {
  name: string;
  setup?: Setup;
  runtime?: string;
}

PluginLegacy 就是兼容之前各种类型, 但是不推荐的

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

No branches or pull requests

2 participants