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

希望插件的使用可以更加灵活(pipeline化) #111

Closed
Tingglelaoo opened this issue Sep 4, 2019 · 2 comments
Closed

希望插件的使用可以更加灵活(pipeline化) #111

Tingglelaoo opened this issue Sep 4, 2019 · 2 comments

Comments

@Tingglelaoo
Copy link
Contributor

通过这个项目的接入体验之后,个人感觉最大的痛点是目前一个插件一个命令,导致操作分散,缺乏 pipeline 的概念。

在目前的版本看来,现在一个插件对应为一个命令,这就导致了如果我引入多个插件时需要运行多个插件命令才能完成固化的某个阶段性任务。例如,在发布阶段,自动化部署 => 接口文档更新(插件) => 发布 changelog (插件),需要手工对应地运行多个插件命令,而不是直接通过拓展 npm run build 命令来自动化串联任务。

所以,基于以上,对此的诉求是:希望插件的引入可以 pipeline 化,通过指定某个命令执行就可以完成多个插件命令的串联执行。

@Tingglelaoo Tingglelaoo changed the title 特性增强:插件的使用可以更加灵活(pipeline化) 希望插件的使用可以更加灵活(pipeline化) Sep 4, 2019
@cpselvis
Copy link
Collaborator

这里通过支持命令配置的构建器为一个数组的方式来进行支持:

image

@cpselvis
Copy link
Collaborator

已经支持,使用案例:
修改 devkit.json, serve-build 的 implementation 传递一个数组即可

{
  "builders": {
    "dev": {
      "implementation": "./src/builder/dev",
      "description": "项目本地开发模式"
    },
    "build": {
      "implementation": "./src/builder/build",
      "description": "本地构建"
    },
    "lint": {
      "implementation": "./lib/lint",
      "description": "eslint"
    },
    "changelog": {
      "implementation": "./lib/changelog",
      "description": "根据git commit信息生成changelog"
    },
    "serve-build": {
        "implementation": ["./src/builder/build", "./lib/changelog"],
        "description": "multiple"
    }
  }
}

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