パッケージの詳細

mili

Scaffolding with continuous control over the development of the project.

mili, scaffold, template, templates

readme

logo

Mili

version downloads license dependencies coveralls

简体中文

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.

Usage

Init Project

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 git@github.com:mili-project-manager/mtpl-code-style.git

Upgrade

The upgrade operation is very simple to use. It will upgrade the template to the latest version.

npx run upgrade
This command maybe overwrite your files.

Check Before Commit

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:

mili check

Run npx mili upgrade command will auto modify code according to the diff.

Contributing & Development

If there is any doubt, it is very welcome to discuss the issue together. Please read Contributor Covenant Code of Conduct and CONTRIBUTING.

更新履歴

Changelog

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

4.8.0 (2023-02-22)

Features

  • add ramda helper for handlebars (eff77fd)

Bug Fixes

  • cannot require nanoid@4 (9d7c643)

4.7.5 (2022-03-23)

Performance Improvements

  • upgrade dependencies and fix build error (d72cdc6)

4.7.4 (2021-11-29)

Bug Fixes

  • cannot find module 'ajv/dist/compile/codegen' (7d22e84)

4.7.4 (2021-07-14)

4.7.3 (2021-07-14)

Bug Fixes

  • relative path repository not work (815f857)

4.7.2 (2021-07-13)

Performance Improvements

  • improve the running speed of the check command (29cb82c)

4.7.1 (2021-07-12)

Performance Improvements

  • improve the running speed of the check command (e9b5340)

4.7.0 (2021-06-19)

Features

4.6.0 (2021-05-31)

Features

4.5.2 (2021-05-31)

Bug Fixes

  • yaml handler invalid inconsistency prompt (d7df2c0)

4.5.1 (2021-05-31)

Performance Improvements

4.5.0 (2021-05-31)

Features

  • enable set up npm registry (3ef7a04)

4.4.2 (2021-05-30)

Bug Fixes

  • incorrect deletion of ignored issues (5ad25bf)

4.4.1 (2021-05-30)

Bug Fixes

  • cannot recognize ssh repo (8bbfc14)
  • migration not ignored (a6ccd77)
  • mili update unable delete files (8c007c1)
  • relative path not available (58bdf92)

Performance Improvements

  • not install deps for local repo (8aa9c46)

4.4.0 (2021-05-30)

Features

Bug Fixes

  • cached files are not deleted (cb998fb)
  • glob cannot match the dotfiles (f704102)

4.3.0 (2021-05-30)

Features

  • add eval option to delete handler and ignore handler (c4c062c)
  • add exist handler (8223c25)
  • add markdown-section loader (b07df94)
  • add repository stack to resource (d85e58c)
  • handlebars: add equals helper (44efaa8)
  • handlebars: add head helper (c7910f1)
  • template.path can be an array (89e4f1e)

Bug Fixes

  • unable auto create folder (cc53099)

4.2.5 (2021-05-28)

Bug Fixes

4.2.4 (2021-05-28)

Bug Fixes

4.2.3 (2021-05-28)

Bug Fixes

4.2.2 (2021-05-28)

Bug Fixes

  • cannot copy to a subdirectory of itself (1f931b9)
  • cannot download specify version template (eaf6551)

4.2.1 (2021-05-28)

Bug Fixes

4.2.0 (2021-05-28)

Features

  • enable progress bar for upgrade, update and check (0e2311d)

Bug Fixes

  • milirc.template missing 'npm:' prefix (eb65842)
  • missing extends.when() arguments (2b9bd20)

4.1.0 (2021-05-28)

Features

  • merge-json add spaces option (4291ec0)

4.0.1 (2021-05-28)

Bug Fixes

  • bad temporary directory path (3d7d9f1)
  • cannot run loader when run mili init (1b4bda9)
  • cannot run without hooks config (240e59b)
  • mili.extends cannot set as string (58da479)

Performance Improvements

  • increase the running speed and add the progress bar (f6c9281)

4.0.0 (2021-05-27)

⚠ BREAKING CHANGES

  • The template and handler of mili@3 is not compatible.
  • Node.js 12 LTS is now the minimum required version.

Features

  • bump Node.js version requirement to 12.13.0 (33f2271)

Code Refactoring

3.10.2 (2021-04-26)

Bug Fixes

3.10.1 (2021-04-25)

Bug Fixes

  • cannot find validate-npm-package-name (0213f7f)
  • schema warning (404c218)

3.10.0 (2021-04-24)

Bug Fixes

3.9.2 (2020-10-22)

Bug Fixes

  • .git isn't required for git url (c5421af), closes #89

3.9.1 (2020-07-18)

3.9.0 (2020-04-27)

Features

  • cache the templates in users home dir (59efb0a)

Bug Fixes

  • update version not support latest and default (8d1c9b1)

3.8.2 (2020-04-24)

Bug Fixes

  • git on a directory that does not exist (3008816)

3.8.1 (2020-03-07)

Bug Fixes

  • git error when run mili check in pre-commit hook (d527377), closes #87

3.8.0 (2020-03-01)

Features

  • support merge eslintignore (ace86ba)
  • warn user when template upgrade a major version (f8062a6)

3.7.0 (2019-07-25)

Features

  • warn user when template upgrade a major version (f8062a6)

3.6.0 (2019-07-19)

Bug Fixes

  • unable get ref from project repository (721017e)

Features

  • handler: support merge .babelrc (3dabcca)

Tests

  • extract area missing tag test (96b236a)
  • test for ejs handler (79c471a)
  • test for merge comment in ignore file (5349c4c)

3.5.0 (2019-07-08)

Features

Tests

  • add test from execte func in subproject (097e3f0)

3.4.0 (2019-07-05)

Bug Fixes

  • mili@1 error should before config valiator (56edb92)
  • missing validation of the handler field (2a23e53)
  • handler: misleading error message (5ffb22f)
  • question: old fields lost when incremental question (a391316)
  • npm outdated not work (c717cf5)

Features

  • handler: new handler used for rename file (12cb12b)
  • handler: support merge .npmrc (2af02f1)

Tests

3.3.0 (2019-07-05)

Bug Fixes

  • mili@1 error should before config valiator (56edb92)
  • missing validation of the handler field (2a23e53)
  • handler: misleading error message (5ffb22f)
  • question: old fields lost when incremental question (a391316)
  • npm outdated not work (c717cf5)

Features

  • handler: new handler used for rename file (12cb12b)
  • handler: support merge .npmrc (2af02f1)

Tests

3.2.0 (2019-07-04)

Bug Fixes

  • log of recursive execte only used for check (0a20d88)
  • template.path error when reload npm template config (cd7ed47)
  • unable recursive upgrade (79bd644)

Features

  • enable cache npm template (d9708e9)

3.1.0 (2019-07-04)

Bug Fixes

  • missing type when validate question.type (394af6b)
  • should exit when checkout an unexist version (08cb107)
  • the path error in error message of merge handler (7610ac9)
  • handler: difference between the merge results of init and upgrade (209a7ee)
  • handler: ignoreWhen running is reversed (59682a7)

Features

  • add default version used for template development (41c9614)

3.0.0 (2019-07-03)

Bug Fixes

  • different meanings of github repository shorthand (775356d), closes #66

Features

  • support for delete file (634c808), closes #29
  • support replace effect function to another (c66fe03), closes #71

refactor

  • rewrite code with typescript (c7d7cff), closes #70

BREAKING CHANGES

  • Never support github path like xxx/xxx.Please use github:xxx/xxx instead.
  • Rename milirc.interaction to milirc.question; Rename afterInit, afterUpgrade and afterUpdate to initialized, updated and upgraded; Change parameters of handler.

2.9.0 (2019-06-13)

Bug Fixes

  • different output when project file is same (94e6827)

Features

  • check for unsafe file changes (83753fa), closes #72

2.8.0 (2019-06-10)

Bug Fixes

Features

  • handler: merge handler support yaml/yml file (57c9dd9)
  • handlers: merge handler support .npmignore file (b673770), closes #75

2.7.3 (2019-06-10)

Bug Fixes

  • the npm template of organization cannot download (5342f63), closes #73

2.7.2 (2019-05-29)

2.7.1 (2019-05-26)

2.7.0 (2019-05-16)

Features

  • create dir or throw error when cwd unexisted (89db505), closes #67

2.6.1 (2019-05-15)

Bug Fixes

  • ./ is missing in relative path (806f14b), closes #65
  • cosmiconfig result should not be changed directly (99aa1f9), closes #65

2.6.0 (2019-05-13)

Features

2.5.0 (2019-05-05)

Bug Fixes

  • missing require('utils/log') (18ff879)

Features

  • --force needed only on the woking dir is not clean (d56225b), closes #46
  • hooks: use function to define hook (3ae83e7), closes #57

2.4.0 (2019-04-29)

Bug Fixes

  • npm: the path error when upgrade template from npm (c5d8882)

Features

  • add option to prevent install dependencies (69c3685), closes #43
  • new option to upgrade recursive (cd7321a), closes #47

2.3.0 (2019-04-25)

Bug Fixes

  • log is undefined (94d8afd), closes #45
  • relative path will be saved as absolute path in .milirc (e15c844), closes #48
  • throw error when main is unset at package.json (033abb4), closes #44

Features

  • could load template from npm (10d06f9), closes #37

2.2.0 (2019-04-14)

Bug Fixes

  • handler: field missing when merging .gitignore (93d1adc)

Features

  • handlers: add ejs handler (c6fb9ac)

2.1.1 (2019-03-03)

Bug Fixes

  • no require check-params (a821814)

2.1.0 (2019-03-03)

Bug Fixes

  • files that upgrade type is keep was covered when upgrade and update (c1987da)

Features

  • auto upgrade milirc file form v1 to v2 (a1e18e0)
  • check template engines and throw error (33bd1df)

2.0.0 (2019-03-03)

Bug Fixes

  • copy: reset repository after cpoyed (10d5118)
  • update: the log is printed as 'upgrade' (49d1a35)

Code Refactoring

  • split module functionality to reduce duplicate code (d56137b)

Features

  • clone: try clone if cannot pull repository (22ccbfb)
  • command: new command used to check template is outdated (e707f67), closes #38
  • merge-handler: support merge gitignore file (650ec83)
  • get information by interaction (5f3057c), closes #17

BREAKING CHANGES

  • View structure and milirc config structure was changed.Template need to be upgraded to support new view.And project need to change milirc manually.

1.10.0 (2018-12-11)

Features

  • install template dependencies (8ae909e)

1.9.0 (2018-12-03)

Features

  • use glob to match rule.path (bf52e6d), closes #23
  • relative path for template (f62fd86)

1.8.0 (2018-11-30)

Features

  • init: shorthand for the github repository uri (35cb74b)

1.7.0 (2018-11-29)

Bug Fixes

  • unable init empty folder (4242bed)

Features

  • access mili commands programmatically from javascript (0366505), closes #33

1.6.0 (2018-11-06)

Features

  • add project status check before init, upgrade, update (b42b1cb), closes #26
  • add template control option (de87d2d), closes #21

1.5.0 (2018-11-05)

Features

1.4.0 (2018-11-04)

Bug Fixes

  • get latest version of template when run update (5d74d50)

Features

  • add the command clean cache (4d7c6df), closes #25
  • check the mili version of template (b94cd59), closes #30

1.3.3 (2018-11-03)

Bug Fixes

  • extract unexpect string when cannot find tag (2c16b3c)

1.3.2 (2018-11-02)

Bug Fixes

  • throwError is undefined (77b6ec2)

1.3.1 (2018-10-30)

Bug Fixes

  • add 'exist' to enum of valid upgrade type (37385f4)

1.3.0 (2018-10-29)

Bug Fixes

  • encoding: encoding for binary file (a50482c)

Features

  • add new upgrade type 'exist' (4df7db6), closes #27

1.2.1 (2018-10-26)

Bug Fixes

  • clone: cannot get includes of undefined (ab72b32)
  • merge: missing a comma (b12d955)

1.2.0 (2018-10-25)

Bug Fixes

  • clone: version order error (c9ee866)
  • handler: unable to recognize functional handler (6b0000a)

Features

  • handler: new handler to get content area from project file (217267a), closes #22

1.1.4 (2018-10-25)

Bug Fixes

  • copy: commentator.extnames is undefined (28570d1), closes #24

1.1.3 (2018-10-23)

Bug Fixes

  • copy: comments affect the mrkdown file function (2e14ec6)

1.1.2 (2018-10-21)

Bug Fixes

  • template config sanitization is not effective (fcc0e79)

1.1.1 (2018-10-21)

Bug Fixes

  • compatible with the case where the repository field is a string (d28a3e4)
  • git link parse error (2528e96)

1.1.0 (2018-10-21)

Bug Fixes

  • merge: file merge handler unusable (a24b479), closes #19

Features

  • add a comment indicating the upgrade type of file (18d2cbd), closes #15
  • add update command (01b8fed), closes #16

1.0.1 (2018-10-18)

Bug Fixes

1.0.0 (2018-10-17)

Code Refactoring

  • separate the template from the scaffold (6de2212), closes #7

Features

  • template: constraint version number and change log (5500f8c)

BREAKING CHANGES

  • The option -t of mili init command is no long supported. And each template will become a independent project. If you want to upgrade the template, you need to manually configure .milirc, then run mili upgrade.

0.1.0 (2018-10-03)

Features

  • template: push after publish (031347d)

0.0.9 (2018-10-03)

0.0.8 (2018-10-03)

Bug Fixes

  • command: project upgrade did not get the community profile feature (06e3cf3)

0.0.7 (2018-10-03)

Features

  • commit: add commit message specification (fbea6d2)
  • template: add commit message specification (dcdacd4), closes #6
  • template: husky upgrade to ^1.0.1 (fc447c0)
  • template: support github community profile (96e6f08), closes #11
  • upgrade: upgrade will overwrite .czrc and .commitlintrc.yml (e179ba6)
  • upgrade: upgrade will overwrite .huskyrc.yml (17db781)

BREAKING CHANGES

  • upgrade: .czrc and .commitlintrc.yml will be override when upgrade mili
  • upgrade: .huskyrc.yml will be override when upgrade mili
  • template: husky hooks in "scripts" will no longer work

0.0.6 (2018-10-02)

Features

  • commit: add commit message specification (fbea6d2)
  • template: add commit message specification (dcdacd4), closes #6
  • template: husky upgrade to ^1.0.1 (fc447c0)

BREAKING CHANGES

  • template: husky hooks in "scripts" will no longer work