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(cli): 支持自定义模板 #68

Closed
3 tasks done
BuptStEve opened this issue Feb 28, 2019 · 0 comments
Closed
3 tasks done

feat(cli): 支持自定义模板 #68

BuptStEve opened this issue Feb 28, 2019 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@BuptStEve
Copy link
Member

BuptStEve commented Feb 28, 2019

问题
当前虽然已有默认模板,但是假如升级模板就必须升级包。

方案
因此打算支持项目级别的自定义模板功能。在没有配置文件时,使用内置默认模板。

  • 为了保持多端的通用性,决定以后优先读取 tua.config.js,没有时再找 tua-mp.config.js
  • 可配置的选项有 templateDir,即所有模板文件夹的路径,默认值为 .templates
module.exports = {
    templateDir: 'some/path',
}
  • 新增 eject 命令将默认模板导出
$ tuamp eject
# OR
$ tuamp e

指定模板下次再做吧...

  • [ ] 对于所有 add 命令新增 -t, --template 选项,用于指定模板
$ tuamp add api --template=<template> <name>
$ tuamp add page -t=<template> <name>
$ tuamp add comp -t=<template> <name>
$ tuamp add comp -t=<template> -g <name>
@BuptStEve BuptStEve changed the title feat: cli 支持自定义模板 feat(cli): 支持自定义模板 Mar 1, 2019
@BuptStEve BuptStEve self-assigned this Mar 1, 2019
@BuptStEve BuptStEve added the enhancement New feature or request label Mar 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant