Projects that derived from the same scaffolding, have evolved over time and become different. Scaffolding lost control of the subsequent development of the project. When we need to improve some of the basic functions of scaffolding(e.g. eslint rules), we need to modify each project, and even have to design a customized solution for some old projects.
Therefore, in order to improve the control ability of scaffolding for the subsequent development of the project,template can modified some files and release new template version, then project can upgrade the template version.
It is useful for team project management.
mkdir my_project
cd my_project
# template in npm
npx mili init npm:@mtpl/code-style
# template in github
npx mili init github:mili-project-manager/mtpl-code-style
# template in private git repository
npx mili init https://github.com/mili-project-manager/mtpl-code-style
# ssh is also support
npx mili init [email protected]:mili-project-manager/mtpl-code-style.git
The upgrade operation is very simple to use. It will upgrade the template to the latest version.
npx run upgrade
With husky, it is easy to verify whether the project file meets the template before commit. Thereby ensuring the specification of the project code.
Run in terminal:
npx mili check --diff --fold
The example stdout:
Run npx mili upgrade
command will auto modify code according to the diff.
If there is any doubt, it is very welcome to discuss the issue together. Please read Contributor Covenant Code of Conduct and CONTRIBUTING.