blog
blog copied to clipboard
Project Templates: generator tools
related:
- [x] #247
- [x] #208
项目模板生成器:
- 项目脚手架.
- 日常开发, 各种项目初始化工具.
说明:
- 我个人常用 cookiecutter, 因为对 Python 非常熟悉.
- 其他脚手架工具, 也很难有 cookiecutter 完备.
- cookiecutter 本身功能非常强大, 支持非常灵活的定制.
我定制的一些脚手架:
- https://github.com/better-go/go-template
- https://github.com/better-dart/flutter-template
- https://github.com/better-rs/rs-template
工具: 项目脚手架的脚手架(生成器)
Python 方案:
- https://github.com/cookiecutter/cookiecutter
- ⭐⭐⭐⭐⭐
- 最广泛使用. 基于 Python.
- https://github.com/copier-org/copier
JS 方案:
- https://github.com/yeoman/yeoman
- ⭐⭐⭐⭐⭐
- https://github.com/yeoman/generator
- https://github.com/jondot/hygen
- https://github.com/plopjs/plop
- ⭐⭐⭐⭐⭐
- https://github.com/slushjs/slush
数据对比:
- https://www.npmtrends.com/hygen-vs-plop-vs-slush-vs-yeoman-generator
Cookiecutter 使用:
基本使用:
- 安装:
brew install cookiecutter
sudo apt-get install cookiecutter
pip3 install --user cookiecutter
获取项目模板:
- 示例: https://github.com/cookiecutter/cookiecutter-django
$ cookiecutter https://github.com/cookiecutter/cookiecutter-django
awesome:
- https://github.com/topics/cookiecutter
开发一个脚手架:
- https://cookiecutter.readthedocs.io/en/stable/
Yeoman 使用:
- https://github.com/yeoman/yeoman
- https://yeoman.io/learning/index.html
docs:
- https://yeoman.io/learning/index.html
- https://static.kancloud.cn/cyyspring/webpack/1992161
搜索:
- https://yeoman.io/generators/
- 官方整理
示例:
- https://github.com/frankgreco/gomicro/blob/master/app/templates/cmd/start.go#L5
1
1