Githubã¯ãã»ãŒãã¹ãŠã®éçºè ã®ç掻ã«ãã£ãããšå ¥ã£ãäžå¯æ¬ ãªããŒã«ã§ãã
ç§ãã¡ã®å€ãã¯çµ¶ããããã䜿çšããŠããŸãããGitHubãšç·å¯ã«çµ±åããããã®æ©èœãæ¡åŒµããå€æ°ã®ãµãŒãããŒãã£ïŒããã³ç¡æïŒãµãŒãã¹ããã³ããŒã«ãããããšã誰ããç¥ã£ãŠããããã§ã¯ãããŸããã
ãã®èšäºã§ã¯ãäž»ã«npmã€ã³ãã©ã¹ãã©ã¯ãã£ã§åäœããããŒã«ã«çŠç¹ãåœãŠãŸãã githubãšçµ±åãããµãŒãã¹ã®å®å šãªãªã¹ãã¯ã github integrationsãã£ã¬ã¯ããªããŒãžã«ãããŸãã
ä»æ¥ã®åé¡ïŒ
- ç¶ç¶çã€ã³ãã°ã¬ãŒã·ã§ã³ã®æ§æc travis ci
- ã«ããŒãªãŒã«ã䜿çšããŠãã¹ãã«ãã¬ããžã¬ããŒããèšå®ãã
- davidã䜿çšããŠäŸåé¢ä¿ã®ç¶æ ãç£èŠãã
- greenkeeperã䜿çšããŠèªåäŸåé¢ä¿æŽæ°ãèšå®ãã
- commitizenã«ããã³ãããã¡ãã»ãŒãžã®æ¹å
- åŸæ¥ã®å€æŽãã°ã䜿çšããŠå€æŽãã°ãšãªãªãŒã¹ããŒããçæãã
- zubeã䜿çšããã¿ã¹ã¯ã®ç®¡ç
ã¬ãã¥ãŒããããµãŒãã¹ã®ã»ãšãã©ã¯ããããžã§ã¯ãããŒãžã«è¿œå ã§ããæ å ±ãããžãæäŸããŸãã ãããžã«ã€ããŠèšåãããã³ã«åãç»åã衚瀺ãããªãããã«ãèšäºã®åé ã§äžåºŠè¡šç€ºããŸãã
ãŸããããã€ãã®ã¹ã¯ãªãããèšè¿°ããå¿ èŠããããŸãã ãããè¡ãã«ã¯ãnuntã¹ã¯ãªããã䜿çšããŠãããªã声ãå£è«ãªã©ã®ããŒã«ãåé¿ãããããç¹å®ã®ã³ã¬ã¯ã¿ãŒãç¥ãå¿ èŠã¯ãããŸããã
ã¿ã¹ã¯ã©ã³ããŒã«é¢ããå°ãåæ
çãªäœè«
å°ãåãŸã§ãäœäººãã®è³¢ã人ã
ïŒããšãã°ãæªåé«ãCory House ïŒã¯ããããžã§ã¯ãããã«ãããã®ã«ã ããªã声ãå£è«ãªã©ã®ããŒã«ã䜿çšããå¿
èŠã¯ãªããšããèããè¡šæããŸããã ã»ãšãã©ã®å ŽåãåçŽãªnpmã¹ã¯ãªããã§ååã§ãã
ç§ãã¡ã¯å人çãªçµéšããããã®èããæ£ããããšãèŠãŠããŸããã
ããšãã°ãgulpã䜿çšããŠãããžã§ã¯ããæ§ç¯ããå Žåã䜿çšããããŒã«ããšã«ãã©ã°ã€ã³ãæ¢ãïŒãŸãã¯èªåã§èšè¿°ããïŒå¿ èŠããããŸãã ããšãã°ã typescriptãã³ã³ãã€ã«ããã«ã¯gulp -typescriptã䜿çšãã tslintãå®è¡ããã«ã¯gulp -tslintã ã typedocãå®è¡ããã«ã¯gulp -typedocã䜿çšããå¿ èŠããããŸãã ãŸããªã©ã
ããŒã«ã¯å®æçã«æŽæ°ããããªãªãŒã¹ãããæŽæ°ãæ¬åœã«æ¥œãã¿ã«ããŠããå ŽåããããŸãã ãã©ã°ã€ã³ãå°ãé ããŠæŽæ°ãããããšããããŸãã ãããŠããããã¯ãŸã£ããæŽæ°ãããªãããšãèµ·ãããŸãã
ããšãã°ãåŸ æã®typescript 2.xãªãªãŒã¹ã¯ããã»ã©åã§ã¯ãããŸããã§ããã tslintãštypedocã®æŽæ°ãåŸ ã€ã®ã«æéã¯ããããŸããã§ããã ãããããã©ã°ã€ã³ã®æ°ããããŒãžã§ã³ãæ¥ãã§ç»å Žããããšã¯ãããŸããã§ããã ãã®çµæãäžè¬çãªè£å©ããŒã«ã®gulpãã©ã°ã€ã³ã®å€ãããŒãžã§ã³ã®ããã«ããããžã§ã¯ãã¯typescriptã®æ°ããããŒãžã§ã³ã«è»¢éã§ããŸããã§ããã
ããã«ããã©ã°ã€ã³ã¯package.jsonã®è¿œå ã®äŸåé¢ä¿ã§ãããå€ãã®å ŽåãäŸåé¢ä¿ãªã©ããããŸãã ãããã¯ãã¹ãŠãtravisã§ãã«ããéå§ãããšããªã©ãã€ã³ã¹ããŒã«æéã«çŽæ¥åœ±é¿ããŸãã
äžè¬ã«ãç§ãã¡ã®çµéšã§ã¯ãã¢ã»ã³ããªãnpm-scriptsã«æžãæãããšãç掻ã楜ã«ãªãããšã瀺ãããŠããŸãã
ã°ããŒãã«ã€ã³ã¹ããŒã«ãå¿ èŠãšããããŒã«ã䜿çšããªãããšãçŽ æŽãããããšã§ãã ãããããã®ã¢ã€ãã¢ã«ã€ããŠã¯è©³ãã説æãããèå³ã®ãã人ã®ããã«è¯ãèšäºãžã®ãªã³ã¯ãå ±æããã ãã§ãã
ç§ãã¡ã¯å人çãªçµéšããããã®èããæ£ããããšãèŠãŠããŸããã
ããšãã°ãgulpã䜿çšããŠãããžã§ã¯ããæ§ç¯ããå Žåã䜿çšããããŒã«ããšã«ãã©ã°ã€ã³ãæ¢ãïŒãŸãã¯èªåã§èšè¿°ããïŒå¿ èŠããããŸãã ããšãã°ã typescriptãã³ã³ãã€ã«ããã«ã¯gulp -typescriptã䜿çšãã tslintãå®è¡ããã«ã¯gulp -tslintã ã typedocãå®è¡ããã«ã¯gulp -typedocã䜿çšããå¿ èŠããããŸãã ãŸããªã©ã
ããŒã«ã¯å®æçã«æŽæ°ããããªãªãŒã¹ãããæŽæ°ãæ¬åœã«æ¥œãã¿ã«ããŠããå ŽåããããŸãã ãã©ã°ã€ã³ãå°ãé ããŠæŽæ°ãããããšããããŸãã ãããŠããããã¯ãŸã£ããæŽæ°ãããªãããšãèµ·ãããŸãã
ããšãã°ãåŸ æã®typescript 2.xãªãªãŒã¹ã¯ããã»ã©åã§ã¯ãããŸããã§ããã tslintãštypedocã®æŽæ°ãåŸ ã€ã®ã«æéã¯ããããŸããã§ããã ãããããã©ã°ã€ã³ã®æ°ããããŒãžã§ã³ãæ¥ãã§ç»å Žããããšã¯ãããŸããã§ããã ãã®çµæãäžè¬çãªè£å©ããŒã«ã®gulpãã©ã°ã€ã³ã®å€ãããŒãžã§ã³ã®ããã«ããããžã§ã¯ãã¯typescriptã®æ°ããããŒãžã§ã³ã«è»¢éã§ããŸããã§ããã
ããã«ããã©ã°ã€ã³ã¯package.jsonã®è¿œå ã®äŸåé¢ä¿ã§ãããå€ãã®å ŽåãäŸåé¢ä¿ãªã©ããããŸãã ãããã¯ãã¹ãŠãtravisã§ãã«ããéå§ãããšããªã©ãã€ã³ã¹ããŒã«æéã«çŽæ¥åœ±é¿ããŸãã
äžè¬ã«ãç§ãã¡ã®çµéšã§ã¯ãã¢ã»ã³ããªãnpm-scriptsã«æžãæãããšãç掻ã楜ã«ãªãããšã瀺ãããŠããŸãã
ã°ããŒãã«ã€ã³ã¹ããŒã«ãå¿ èŠãšããããŒã«ã䜿çšããªãããšãçŽ æŽãããããšã§ãã ãããããã®ã¢ã€ãã¢ã«ã€ããŠã¯è©³ãã説æãããèå³ã®ãã人ã®ããã«è¯ãèšäºãžã®ãªã³ã¯ãå ±æããã ãã§ãã
説æãããµãŒãã¹ã®å®éã®äœ¿çšäŸã¯ã e2e4ã©ã€ãã©ãªã®ãªããžããªïŒåçŽãªãªãã·ã§ã³ïŒãŸãã¯è§åºŠã°ãªããã®çŽè§ã©ã€ãã©ãªïŒããèå³æ·±ããªãã·ã§ã³ïŒã«ãããŸãã
ç¶ç¶çã€ã³ãã°ã¬ãŒã·ã§ã³ã®æ§æc travis ci
æçœãªããšããå§ããŸããã-ãã¹ãŠã®ãããžã§ã¯ãã«ã¯ç¶ç¶çãªçµ±åãå¿ èŠã§ãã ããã§travis ciãç§ãã¡ãå©ããæºåãã§ããŸããã
travisã§ã®ãã«ãã®ã»ããã¢ããã¯éåžžã«ç°¡åã§ã次ã®æé ã§æ§æãããŠããŸãã
- githubã¢ã«ãŠã³ãã䜿çšããŠtravisã«ãã°ã€ã³ããŸãã
- èšå®ããŒãžã§ãtravisãç£èŠãããªããžããªãæå®ããŸãã
- ãã¡ã€ã«ã.travis.ymlãããªããžããªã®ã«ãŒããã£ã¬ã¯ããªã«è¿œå ããŸããããã¯ããã«ããèµ·åããããã®ç°å¢èšå®ãšã³ãã³ãã瀺ããŠããŸãã
ããšãã°ã次ã®ããã«ïŒ
language: node_js node_js: - "6" script: - npm run ci
ãããã£ãŠãnodejsããŒãžã§ã³6ã®ç°å¢ãå¿ èŠã§ããããšãtravisã«äŒããŸãã
ãã«ãããã»ã¹ã¯ãpackage.jsonãã¡ã€ã«ã®ãscriptsãã»ã¯ã·ã§ã³ãããciããšããã¹ã¯ãªãããå®è¡ãã1ã€ã®npmã³ãã³ãã§æ§æãããŸãã
ç§ãã¡ã®å Žåããã®ã³ãã³ãã¯ããããžã§ã¯ããtslintã§ãªã³ãã ã typescriptã§ãã«ããã karmaã§ãã¹ããå®è¡ããŸãã 詳现ã«èå³ãããå Žåã¯ã githubã®package.jsonã§è©³çŽ°ã確èªã§ããŸãã
ãŸãããã«ãã³ãã³ãã§ãnpm installããæå®ããªãã£ãããšã«ã泚æããŠãã ããã Travisèªèº«ã¯ãnpmã䜿çšããŠäŸåé¢ä¿ãã€ã³ã¹ããŒã«ããå¿ èŠãããããšãç解ããŠå®è¡ããŸãã
ããã«ã糞ã䜿çšããå Žåãtravisã¯ãããç解ãã 糞ãã€ã³ã¹ããŒã«ããããã䜿çšããŠäŸåé¢ä¿ãã€ã³ã¹ããŒã«ããŸãã
Travisã«ã¯ãäžå¿ èŠãªã¢ã¯ã·ã§ã³ããç§ãã¡ãæããããªãã³ãã¬ãŒãããããããããŸãã
次ã«ãããtravis.ymlããã¡ã€ã«ã®ããã·ã¥ãå®è¡ããŸãããã®åŸãæåã®ãã«ããå®è¡ãããŸãã ãã«ãããã»ã¹ã¯ãtravisããŒãžã§ãªã¢ã«ã¿ã€ã ã«ç¢ºèªã§ããŸãã
ä»ã«äœ
- ããè€éãªã·ããªãªãä»ã®ãã©ãããã©ãŒã ã«èå³ãããå Žåã¯ã travisã®ããã¥ã¡ã³ããã芧ã«ãªãããšããå§ãããŸãã ããã¥ã¡ã³ãã®å質ã¯å°è±¡çã§ãã
- ãã«ãã倱æããå Žåãtravisã¯githubã¢ã«ãŠã³ãã§æå®ãããã¡ãŒã«ã¢ãã¬ã¹ã«ããã«ã€ããŠæžã蟌ã¿ãŸãã ã¹ã©ãã¯ãšã®çµ±åãæ§æããããšãã§ããŸãã
- ã¿ã°ãäœæãããšããtravisã¯ãã«ããæåããå Žåã«ãçµæãå ±åããŸãã
- ã³ãããã«å ããŠãtravisã¯ãã«ãªã¯ãšã¹ãããšã«ãã«ããå®è¡ããŸãã ãã«ããå®äºãããšãçµæã«é¢ããæ å ±ããã«ãªã¯ãšã¹ãããŒãžã«è¡šç€ºãããŸãã ããŒãžã®å®è¡åŸãtravisã¯ãã«ããå床å®è¡ãããã«ãªã¯ãšã¹ãããŒãžã§çµæãååºŠå ±åããŸãã
- ãã«ãã®çŸåšã®ã¹ããŒã¿ã¹ã衚瀺ããç¹å¥ãªãããžãreadmeãã¡ã€ã«ã«è¿œå ã§ããŸãã çµã¿åãããŠãããã¯travisã®ææ°ãã«ãã«é¢ããæ å ±ãžã®ãªã³ã¯ã§ãã ãããžã䜿çšãããšããã«ãã§ãã¹ãŠãæ£åžžã§ããããšãã³ãã¥ããã£ã«ç€ºãããšãã§ããŸãã ãŸãã¯ãã¹ãŠãæªãã§ãã 2çªç®ã®ã±ãŒã¹ã§ã¯ããã®ãããªãããžã¯ãç¶æ³ãå¯èœãªéãè¿ éã«ä¿®æ£ããããåæ©ä»ããããŸãã
- å ¬éãªããžããªã®å Žåããã«ãã«é¢ããæ å ±ã¯èª°ã§ãå©çšã§ããŸãã 圌ãã¯ããã®ããã«travisã«ãã°ã€ã³ããå¿ èŠãããããŸããã
- ãããŠæåŸã å±¥æŽãããã«ããåé€ããããšã¯ã§ããŸããã ã§ããæ倧ã®ããšã¯ããã°ãã«ããåé€ããããšã§ãã ããšãã°ããã®äžã®æ©å¯æ å ±ããæããã«ãããå Žåã ãããããã«ãèªäœã¯æ°žé ã«æŽå²ã«æ®ãã§ãããã
ã«ããŒãªãŒã«ã䜿çšããŠãã¹ãã«ãã¬ããžã¬ããŒããèšå®ãã
次ã®ãµãŒãã¹ã¯ã«ããŒãªãŒã«ã§ãã
äžè¬çãªèãæ¹ã¯ããã¹ããå®è¡ãããšãlcov圢åŒã®ã«ãã¬ããžã¬ããŒããçæããåæã®ããã«ã«ããŒãªãŒã«ãµãŒãã¹ã«éä¿¡ããããšã§ãã ãµãŒãã¹ã¯ãããåŠçãã次ã®æ©èœãæäŸããŸãã
- READMEã«ãã¹ãã«ãã¬ããžçã®ãããžãè¿œå ã§ããŸãã ã ãããããªãã¯ããªãã®ã³ãã¥ããã£ã«ããªããçå£ã«ãã¹ãŠãæã£ãŠããããšãäŒããŸãã
- ãã«ãªã¯ãšã¹ããäœæãããšããã«ããŒãªãŒã«ã¯ãã¹ãã«ãã¬ããžããã«ãªã¯ãšã¹ãã«ã©ã®ããã«å€åãããã«é¢ããæ å ±ãè¿œå ããŸãã
- ãã¹ãã®ã«ãã¬ããžç¯å²ã®å¶éãèšå®ã§ããŸãã ãŸãããã«ãªã¯ãšã¹ãã®å€æŽã«ããã«ãã¬ããžã®å²åãæå®ãããå€ãäžåããšããã«ãªã¯ãšã¹ãã®ãã§ãã¯ã¯å€±æããŸãã
- ãã®ãµãŒãã¹ã¯ãtravisãªã©ã®ci-servicesãšçµ±åããããã«ãå±¥æŽãä¿åãããã«ããããã«ããŸã§ã®ãã¹ãã«ãã¬ããžã®ãã€ããã¯ã¹ãèŠãããšãã§ããŸãã ããšãã°ãçŽè§ã©ã€ãã©ãªã®ã¬ããŒãã¯æ¬¡ã®ãšããã§ãã
ã«ããŒãªãŒã«ããããžã§ã¯ãã«æ¥ç¶ããã«ã¯ã次ã®æé ãå®è¡ããå¿ èŠããããŸãã
- githubã¢ã«ãŠã³ãã䜿çšããŠã«ããŒãªãŒã«ã«ãã°ã€ã³ããŸãã
- æ å ±ã®åéãæå¹ã«ãããªããžããªãéžæããŸãã
- coveralls npmããã±ãŒãžããªããžããªã«ã€ã³ã¹ããŒã«ããŸãã
- ãã¹ãå®è¡äžã«ã«ãã¬ããžã¬ããŒãã®çæãæ§æããŸãã
ã«ãã¬ããžã¬ããŒãã®çææ¹æ³ã¯è©³çŽ°ã«æ€èšããŸããããã¹ãã®äœæ察象ã䜿çšããããŒã«ããã¹ãã®å®è¡æ¹æ³ã«ãã¹ãŠäŸåããããã§ãã ããã«ãããšãã°ãtypescriptã®å Žåãã«ãã¬ããžã¬ããŒãçæããŒã«ã¯ãããŸãããããã¯ãå®è¡ãããã®ã¯typescriptã§ã¯ãªãjavascriptã§ããããã§ãã ãŸããã¿ã€ãã¹ã¯ãªããã³ãŒãã®ã«ãã¬ããžãæ£ç¢ºã«è¡šç€ºããå Žåã¯ãjsã³ãŒãã®ã«ãã¬ããžã«é¢ããã¬ããŒããã¿ã€ãã¹ã¯ãªããã³ãŒãã«åãããã³ã°ããããã®ããŒã«ãå¿ èŠã«ãªããŸãã ããã¯ãã¹ãŠäžå¿ èŠãªç¹ç°æ§ã§ããããã®èšäºã§ã¯é¿ããããšããŸãã githubã®coveralls npmããã±ãŒãžããŒãžããå¯èœãªãªãã·ã§ã³ã®èª¿æ»ãéå§ã§ããŸãã
- npmã¹ã¯ãªãããè¿œå ããŠãçæãããã¬ããŒããã«ããŒãªãŒã«ãµãŒãã¹ã«è»¢éããŸãã
"scripts": { "coveralls": "cat ./coverage/lcov.info | ./node_modules/.bin/coveralls", ... }
- travisã§ãã«ããå®è¡ããåŸãè¿œå ãããã¹ã¯ãªãããå®è¡ããŸãã ãããè¡ãã«ã¯ãtravis.ymlãã¡ã€ã«ã®after_successã»ã¯ã·ã§ã³ã䜿çšããŸãã ããã§ãtravis.ymlã¯æ¬¡ã®ããã«ãªããŸãã
language: node_js node_js: - "6" script: - npm run ci after_success: - npm run coveralls
ä»ã«äœ
githubã«å ããŠãã«ããŒãªãŒã«ã¯bitbucketãšçµ±åããgitlabã®ç·æ¥ãµããŒããçŽæããŸããã ãŸããè€æ°ã®ç¶ç¶ççµ±åãµãŒãã¹ããã³è€æ°ã®éçºãã©ãããã©ãŒã ãšã®çµ±åããµããŒãããŠããŸãã
davidã䜿çšããŠäŸåé¢ä¿ã®ç¶æ ãç£èŠãã
davidäŸåé¢ä¿ç£èŠãµãŒãã¹ã¯ããã®èšäºã§èª¬æãããã®ã®äžã§æãåçŽã§ãã
ãµãŒãã¹ã®ã¢ã€ãã¢ã¯ã·ã³ãã«ã§ãããããžã§ã¯ãã®äŸåé¢ä¿ã®ç¶æ ã瀺ããããžããããžã§ã¯ãããŒãžã«è¿œå ããŸãã ãŸãããããžã§ã¯ãã®äŸåé¢ä¿åæããŒãžãžã®ãªã³ã¯ã§ãã
davidããããžã§ã¯ãã«æ¥ç¶ããã«ã¯ã次ã®ãã³ãã¬ãŒãã«åŸã£ãŠãã©ãŠã¶ãŒã«ã¢ãã¬ã¹ãå ¥åããŸãã
https://david-dm.org/< >/< >
ãããžã§ã¯ãå ã®äŸåé¢ä¿ã®ã¿ã€ãã«å¿ããŠãéããããŒãžã«ãäŸåé¢ä¿ãããäŸåé¢ä¿ããããã¢äŸåé¢ä¿ããããã³ããªãã·ã§ã³ã®äŸåé¢ä¿ãã¿ãã衚瀺ãããŸãã
åã¿ãã«ã¯ãç¹å®ã®ã¿ã€ããšãããžã®äŸåé¢ä¿ã®ãªã¹ããå«ãŸããŠããŸããã¯ãªãã¯ãããšãããŒã¯ããŠã³ãŸãã¯HTML圢åŒã§ãªã³ã¯ãã³ããŒããreadmeãã¡ã€ã«ãŸãã¯githubããŒãžã®ãããžã§ã¯ãããŒãžã«é 眮ã§ããŸãã
ä»ã«äœ
ãŸãããã·ã³ã®äŸåé¢ä¿ãæŽæ°ããã®ã«åœ¹ç«ã€david cliãŠãŒãã£ãªãã£ããããŸãã 確ãã«ãçµã¿èŸŒã¿ã®npmæéåãã³ãã³ãããã³npmæŽæ°ã³ãã³ããšæ¯èŒããå Žåã®å©ç¹ãç解ã§ããŸããã§ããã
greenkeeperã䜿çšããŠèªåäŸåé¢ä¿æŽæ°ãèšå®ãã
greenkeeperãµãŒãã¹ã¯ ãäŸåé¢ä¿ãæŽæ°ãããšããå°é£ãªã¿ã¹ã¯ãæ¯æŽããããã«ãèšèšãããŠããŸãããããé«ãã¬ãã«ã§ãããè¡ããŸãã 圌ã®ä»äºã¯ãå¯èœãªéãäŸåé¢ä¿ã®åŠçãå®å šã«è»œæžããããšã§ãã
greenkeeperããããžã§ã¯ãã«æ¥ç¶ããã«ã¯ã githubã®å ¬éçµ±åã»ã¯ã·ã§ã³ã®greenkeeperããŒãžã«ç§»åããå¿ èŠãªãªããžããªã«ã¢ããªã±ãŒã·ã§ã³ãã€ã³ã¹ããŒã«ããå¿ èŠããããŸãã
ããã1åã§ãgreenkeeperã¯ãã«ãªã¯ãšã¹ããäœæãããããžã§ã¯ãã®ãã¹ãŠã®äŸåé¢ä¿ãæŽæ°ããgreenkeeperã®ã¹ããŒã¿ã¹ã衚瀺ããreadmeãããžã«è¿œå ããŸãã
ãã®ãã«ãªã¯ãšã¹ããããŒãžããå Žåã®ã¿ãgreenkeeperã¯ãããžã§ã¯ãã®ç£èŠãéå§ããŸãã
ããã«ãäŸåé¢ä¿ã®æ°ããããŒãžã§ã³ã衚瀺ããããšãgreenkeeperã¯ãã«ãªã¯ãšã¹ããäœæããŸããããã¯ãæŽæ°ãããå 容ã®è©³çŽ°ãªèª¬æãæäŸããå¯èœã§ããã°ãæ°ããããŒãžã§ã³ã®å€æŽã®ãªã¹ããæäŸããŸãã ããŒãžããã ãã§ãã
åœç¶ãgreenkeeperã®æ¥ç¶ã¯ãèªåãã«ããæ§æãããŠãããæŽæ°åŸã«ãããžã§ã¯ããåäœç¶æ ã«ããããšãå°ãªããšãåç®äžç¢ºèªããããã«äœ¿çšã§ãããã¹ããããå Žåã«ã®ã¿æå³ããããŸãã Greenkeeperã¯ããªããžããªã«ãã«ããšãã¹ãããããã©ãããèªèããã©ã¡ãããæ€åºãããªãå Žåã¯ãã«ãªã¯ãšã¹ãããã¹ãã«èŠåãæžã蟌ã¿ãŸãã
ä»ã«äœ
- ãã«ãªã¯ãšã¹ããéããåŸãgreenkeeperã¯äœæããããã©ã³ãèªäœãåé€ããŸãã
- æŽæ°ãããäŸåé¢ä¿ã次ã®ããŒãžã§ã³ãéåžžã«è¿ éã«ãªãªãŒã¹ããå ŽåïŒã¯ã€ãã¯ãã£ãã¯ã¹ã®çºè¡ãšåæ§ïŒãgreenkeeperã¯æ°ãããã©ã³ããäœæããå ã®ãã«ãªã¯ãšã¹ããžã®ã³ã¡ã³ãã«ããã«ã€ããŠæžã蟌ã¿ãŸãã
- ã°ãªãŒã³ããŒããŒããã©ã³ããäœæãããã«ãªã¯ãšã¹ããè¡ããã«ããã«åé€ããããšããããŸãã ãããã£ãŠãã°ãªãŒã³ããŒããŒã¯ãããã±ãŒãžã§æå®ãããpackage.json ããŒãžã§ã³ç¯å²ã«é©åããäŸåé¢ä¿ã®æŽæ°ããªãªãŒã¹ãããå Žåã«æ©èœããŸãã ã€ãŸãããã®ããŒãžã§ã³ã®äŸåé¢ä¿ã¯ãäŸåé¢ä¿ãåã€ã³ã¹ããŒã«ãããšãã«å±ããŸãã ãã®ããã«ããŠãGreenkeeperã¯ãããŒãžã§ã³ç¯å²ã«å ¥ã£ãããŒãžã§ã³ã§ãããã«ããå£ããªãããšããã§ãã¯ãããããå®è¡ããåŸãåã«ãã©ã³ããåé€ããŸãã ãšã©ãŒãçºçããå Žåãgreenkeeperã¯åé¡ãäœæããŸãã
- ãããžã§ã¯ãã®ç¹å®ã®äŸåé¢ä¿ãgreenkeeperã§æŽæ°ããããªãå Žåã¯ãpackage.jsonãã¡ã€ã«ã«æ¬¡ã®ã»ã¯ã·ã§ã³ãè¿œå ã§ããŸãã
"greenkeeper": { "ignore": [ââ, ââ, ââ, â â, ââ] }
- ãŸããã°ãªãŒã³ããŒããŒã¯çŸåšã€ãŒã³ã䜿çšããŠããªãããšãç¥ã£ãŠããå¿ èŠããããŸãã ãã®åé¡ãåé¿ããæ¹æ³ã¯ãããŸãããããããè¯ããšåŒã¶ã®ã¯é£ããã§ãã ãã®ä»¶ã«é¢ãããã¹ãŠã®æ å ±ã¯ãgithubã®åé¡ã«èšèŒãããŠããŸãã
- ãããŠæåŸã®ç¬éã ãããžã§ã¯ããåæã«æŽæ°ããå¿ èŠãããè€æ°ã®äŸåé¢ä¿ã䜿çšããå ŽåããããŸãã ããšãã°ã angularã¯ã¢ãžã¥ãŒã«ã«åå²ãããŠããããããžã§ã¯ãã§è€æ°ã®ã¢ãžã¥ãŒã«ãå¿ èŠã«ãªãå¯èœæ§ãé«ããªããŸãã åæã«ãããããæŽæ°ããããšã¯ãã¹ãŠçã«ããªã£ãŠããŸãã Greenkeeperã¯ãŸã ãã®ãããªã¿ã¹ã¯ã«å¯ŸåŠããããšãã§ããŸããã
commitizenã«ããã³ãããã¡ãã»ãŒãžã®æ¹å
Commitizenã¯ãæå³ã®ããã³ãããã¡ãã»ãŒãžã®äœæãæ¯æŽããããŒã«ã¹ã€ãŒãã§ãã
ãªããžããªã«èå³ã®ãã人ã ã«ãšã£ãŠããæçã§ããããšã«å ããŠãcommitizenã®äœ¿çšã«ã¯ãã1ã€ã®å©ç¹ããããŸãã çæãããã³ãããæžã¿ã¡ãã»ãŒãžãããå€æŽãã°ãšãªãªãŒã¹ããŒããç°¡åã«ã³ã³ãã€ã«ã§ããŸãã ãŸããã³ãããã®å±¥æŽãåæãã semverã®èŠåã«æºæ ããããã«æ¬¡ã®ããŒãžã§ã³çªå·ãæããŠããããŠãŒãã£ãªãã£ããããŸãã ããããããã«ã€ããŠã¯æ¬¡ã®ã»ã¯ã·ã§ã³ã§è©³ãã説æããŸãã
ãããŠãæãåçŽãªãã®ããå§ããŸãã cz-cliãã€ã³ã¹ããŒã«ããŸãã ã€ã³ã¹ããŒã«åŸããgit commitãã®ä»£ããã«ãgit czãã³ãã³ãã䜿çšã§ããŸãã ãã®ã³ãã³ãã¯ãçŸåšã®ã³ãããã§æ£ç¢ºã«äœãå€æŽãããã«ã€ããŠã®äžé£ã®è³ªåãã¬ã€ããããŠã£ã¶ãŒããèµ·åãã人éãç°¡åã«èªã¿åã£ãŠããŸããŸãªããŒã«ã§è§£æã§ãã圢åŒã§ã³ãããã¡ãã»ãŒãžãçæããŸãã
ã ããïŒ
- commitizenãã°ããŒãã«ã«ã€ã³ã¹ããŒã«ããŸãã
npm install commitizen -g
- ã³ããããããããªããžããªãäœæããŸãã ãããè¡ãã«ã¯ããªããžããªãã©ã«ããŒã§æ¬¡ã®ã³ãã³ããå®è¡ããŸãã
commitizen init < > --save-dev --save-exact
<adapter name>ã®ä»£ããã«ãå¯èœãªã¢ããã¿ã®1ã€ãæå®ããå¿ èŠããããŸãã ããã³ããšã³ãéçºã®äžçã§æã人æ°ãããã®ã¯ãcz-conventional-changelogã§ããããã¯ãè§åºŠã®ããããŒã ãéçºãã次ã®ã¡ãã»ãŒãžè¡šèšã§ãã
ãã®ã³ãã³ãã¯å¿ èŠãªäŸåé¢ä¿ãã€ã³ã¹ããŒã«ããpackage.jsonãã¡ã€ã«ã®devDependenciesã»ã¯ã·ã§ã³ã«ä¿åããããã«å¿ èŠãªèšå®ãæžã蟌ã¿ãŸãã
ä»ã«äœ
- ã³ãã³ãã©ã€ã³ã§ã®äœæ¥ã«å ããŠãã³ãŒããšãã£ã¿ãŒçšã®æ¡åŒµæ©èœããããŸãã ããšãã°ã vscodeã®å Žå ã åãvscodeã«å¯ŸããŠã¿ãŒããã«ã§ãgit czãã䜿çšããããšãšåºæ¬çãªéãã¯ãããŸããããããããããªãã«ãšã£ãŠã¯ãã䟿å©ã§ãããã
- git czãçæããã¡ãã»ãŒãžãç°¡åã«äœæã§ããããšã«æ³šæããŠãã ããã äžéšã®éçºè ã¯ãããè¡ããŸãã ããã§åœ¢åŒã®å®å šãªèª¬æãèŠã€ããããšãã§ããŸã ã
- ReadmeããŒãžã«ãããžãè¿œå ããŠããªããžããªã®èšªåè ã«ãã³ããããããèŠçŽã«åŸã£ãŠããããšãç¥ãããããšãã§ããŸãã
åŸæ¥ã®å€æŽãã°ã䜿çšããŠå€æŽãã°ãšãªãªãŒã¹ããŒããçæãã
commitizenãæå¹ã«ããåŸãå¥ã®ãªãã·ã§ã³-å€æŽãã°ãšãªãªãŒã¹ããŒãã®èªåçæãèšå®ããæ©èœããããŸãã
ãã®åŸæ¥ã®changelogã§åœ¹ç«ã¡ãŸãã
åŸæ¥ã®å€æŽãã°ã¯ãæ¢è£œã®ãã³ãã¬ãŒãã«åŸã£ãŠé«ã¬ãã«ã®ããŒã«ã䜿çšããŠãªãªãŒã¹ã®ãªãªãŒã¹ãæ§ç¯ããããåå¥ã®ããŒã«ããå ·äœçã«å¿ èŠãªãã®ãçµã¿ç«ãŠããããããšãã§ããããŒã«ã®ãã¡ããªãŒå šäœã§ãã
éçºè èªèº«ããæ¯èŒçé«ã¬ãã«ã®ããŒã«ã§ããstandard-versionã®äœ¿çšãæšå¥šããŠããŸãã
ããã«é«ãã¬ãã«ã¯ã semantic-releaseã§ãã ãã®ããŒã«ã¯ããã·ã¥å€æŽãè¡ããnpmã§ããŒãžã§ã³ãå ¬éããŸãã
ç§ãã¡ã®çµéšãã-äž¡æ¹ã®ãªãã·ã§ã³ãè©ŠããåŸãäœã¬ãã«ã®ããŒã«ã䜿çšããããšã«æ±ºããŸããã
ãã®éžæã®çç±ã¯ãããšãã°ãæšæºããŒãžã§ã³ãå€æŽãããã·ã¥ãããgithubã«ãªãªãŒã¹ã®èª¬æãçæããªãããã§ãã ãªãªãŒã¹ããã»ã¹ã«ãã®ãããªãã®ãè¿œå ãããã«ããèµ·åããããããŸãã¯ããã¥ã¡ã³ããçæããããã«æšæºããŒãžã§ã³ãªãã·ã§ã³ã䜿çšããŠæ§æããã«ã¯ã npm versionã³ãã³ãã«åºã¥ããŠå ¬éããã»ã¹ãæåã§èšå®ããã®ãšåããããè€éãªèšå®ãå¿ èŠã§ãã
äžæ¹ãã»ãã³ãã£ãã¯ãªãªãŒã¹ã¯ãããã»ã¹å šäœãèªååããããšããŠãããããéåžžã«çµ±å¶ã®ãšããéçºã¢ãããŒãããšãå¿ èŠããããŸãã æ§æã®è€éãã¯ãããã»ã¹ã®æåæ§æã«å¹æµââããŸãã ãããŠæåŸã Semantic-releaseã¯npm publishãè¡ããŸããããã¯ãnpmãä»ããŠé åžãããã©ã€ãã©ãªã®ã¿ã«äœ¿çšãå¶éããã©ã€ãã©ãªã ãã§ãªãããŒãžã§ã³ã®çºè¡ãå¯èœã§ãã
ãã®ãããnpmããŒãžã§ã³ã«åºã¥ããŠãªãªãŒã¹ããã»ã¹ãæ§ç¯ããŸãã ãŸããããŒãžã§ã³npmã¹ã¯ãªãããå®è¡ãããšãpreversionã¹ã¯ãªãããšpostversionã¹ã¯ãªãããããã°å®è¡ãããŸãã äž¡æ¹ã䜿çšããŸãã ãªãªãŒã¹ããã»ã¹ã¯ã次ã®æé ã§æ§æãããŸãã
ããªããŒãžã§ã³ãã§ãŒãºïŒ
- rimrafã䜿çšããŠã以åã®ãã«ãã®çµæã§ãã£ã¬ã¯ããªãã¯ãªã¢ããŸã ã
- tslintãå®è¡ããŸãã
- ã³ã³ãã€ã«ã¿ã€ãã¹ã¯ãªããã
- karmaã§ãã¹ããå®è¡ããŸãã
e2e4ãªããžããªãäŸãšããŠäœ¿çšãããšããããã®æé ã¯precommitããã¯ã§å®è¡ãããæé ãšåãã§ãããããåãã¹ã¯ãªããã䜿çšããŸãã
{ "preversion": "npm run precommit", "precommit": "npm run rimraf -- esm coverage && npm run clean:src && npm run clean:tests && npm run lint && npm run build && npm run test" }
ãã§ãŒãºããŒãžã§ã³ïŒ
- githubããŒãžã§å ¬éããããã®ããã¥ã¡ã³ããçæããŸãã ç§ãã¡ã®å Žåã ããã«ã¯typedocã䜿çšãããŸãã githubããŒãžã«ã€ããŠ-æè¿ãgh-pagesãšããååã®ãã©ã³ããäœæããå¿ èŠããªããªã£ãããããµã€ããšããŠäœ¿çšãããgithubèšå®ã§ãããžã§ã¯ãã®ãã©ã«ããŒãæå®ããã ãã§ãã ããã©ã«ãã§ã¯ãããã¯ãdocsããã©ã«ããŒã§ãã ãããã£ãŠãããã¥ã¡ã³ããã©ã«ããŒã«ããã¥ã¡ã³ããçæããã ãã§ãã
- çæãããããã¥ã¡ã³ããgitã«è¿œå ããŠã³ãããããŸãã
- changelog.mdã«å€æŽã«é¢ããæ å ±ãè¿œå ããŸãã ãã®ããã«ã åŸæ¥ã®changelog-cliã䜿çšããŸãã ãã©ã¡ãŒã¿ãŒãšããŠããã¡ã€ã«åãšã¡ãã»ãŒãžè§£æã®èŠåãæž¡ããŸãã ç§ãã¡ã®å Žåãããã¯ãè§åºŠãã§ãã
- ã³ãããçšã®æŽæ°ãããå€æŽãã°ãè¿œå ããŸãã
- package.jsonã®ããŒãžã§ã³ãæŽæ°ããã³ãããçšã«è¿œå ããŸãã ãã®npmã圹ã«ç«ã¡ãŸãã
- ããŒãžã§ã³ã®ã¿ã°ãçæããå¿ èŠã«å¿ããŠãã¬ãªãªãŒã¹ãŸãã¯ææ°ã®ã©ãã«ãä»ããŸãã ãã®npmãç§ãã¡ã«åœ¹ç«ã¡ãŸãã ã©ãã«ãä»ãããšã semverã®èŠåã«åŸã£ãŠããŒãžã§ã³çªå·ãããããŸãã
åèšã§ã次ã®äžé£ã®ã¹ã¯ãªãããååŸãããŸãã
{ "version": "npm run docs && git add -A docs && npm run changelog && git add CHANGELOG.md", "changelog": "npm run conventional-changelog -- -p angular -i CHANGELOG.md -s", "docs": "npm run rimraf -- docs && typedoc --options typedoc.json src/" }
ãã¹ãããŒãžã§ã³ãã§ãŒãºïŒ
- å€æŽãããpackage.jsonãchangelog.mdãããã¥ã¡ã³ãã®ããã·ã¥ãå®è¡ããŸãã
- äœæããã¿ã°ã®ããã·ã¥ãå®è¡ããŸãã
- å€æŽã®èª¬æãgithubãªãªãŒã¹ã«è¿œå ããŸãã ãããè¡ãã«ã¯ãåŸæ¥ã®github-releaserã䜿çšããŠãã¡ãã»ãŒãžè¡šèšããã©ã¡ãŒã¿ãŒãšããŠæž¡ããŸãã ç§ãã¡ã®å Žåãããã¯ãè§åºŠãã§ãã æ å ±ãèšé²ããã«ã¯é©åãªã¢ã¯ã»ã¹æš©ãå¿ èŠãªã®ã§ãåŸæ¥ã®github-releaserãèªèšŒã«äœ¿çšããã¢ã¯ã»ã¹ããŒã¯ã³ãçæããå¿ èŠããããŸãã ãããã©ã®ããã«è¡ããããã¯ããããžã§ã¯ãã®èª¬æã«èšèŒãããŠããŸãã
ããŒãžã§ã³ã®ã¹ã¯ãªããïŒ
{ "postversion": "git push && git push --tags && conventional-github-releaser -p angular", }
ãªãªãŒã¹ããã»ã¹ã®æºåãã§ããŸããã
次ã®ã³ãã³ãã䜿çšããŠã¹ã¯ãªãããå®è¡ããŸãã
npm version < major/minor/patch>
çæããããªãªãŒã¹ããŒãã¯æ¬¡ã®ããã«ãªããŸãã
changelog.mdã®å 容ã¯ã»ãŒåãã§ãããããåŒçšããŸããã
ä»ã«äœ
- åŸæ¥ã®changelogããŒã«ã䜿çšã§ããã®ã¯ãgithubã ãã§ã¯ãããŸããã åŸæ¥ã®changelog-cliã¯ã©ã®gitãªããžããªã§ãåäœããŸãããåŸæ¥ã®github- releaserã«ã¯gitlabã§åäœããããã®å åŒã©ã€ãã©ãªããããŸã ã
- 2ã€ã®å Žæã«åãæ å ±ãæçš¿ããçç±ãçåã«æã£ãŠãããããããŸããã ãªãªãŒã¹ã®èª¬æã¯ããŠãŒã¶ãŒãåã«æ°ããããŒãžã§ã³ã«èå³ãããå Žåã«äŸ¿å©ã§ãã ãŸããå€æŽãã°ã¯npmããã±ãŒãžã§æäŸããããŠãŒã¶ãŒãæ¢ã«ããŒãžã§ã³ãæŽæ°ããŠãããé倧ãªå€æŽã«å¿ããŠã³ãŒãã調æŽããããæ°ããã©ã€ãã©ãªæ©èœã䜿çšããããã«ãªãªãŒã¹æ å ±ãå¿ èŠãªå Žåã«åœ¹ç«ã¡ãŸãã ãŸãããã®æ å ±ãã³ãŒããšãã£ã¿ãŒã§çŽæ¥ç¢ºèªãããšãgithubã®ãªãªãŒã¹ã®èª¬æããã䟿å©ã§ãã
zubeã䜿çšããã¿ã¹ã¯ã®ç®¡ç
zube.ioã«ã€ããŠã¯ããŸã説æããŸããã ç§ãã¡ã¯ããããã¿ã¹ã¯ãã©ãã«ãŒã䜿çšããŸããããzubeã¯ãããã®å€ããšã»ãšãã©å€ãããŸããã
ãã®å©ç¹ã®2ã€ã ããæããŸãããã®ããããã®èšäºã§èšåããããšã«ããŸããã
- ããã¯ãgithubãšçµ±åããããããžã§ã¯ã管çããŒã«ã§ã¯çãããªãŒãã³ãœãŒã¹ãããžã§ã¯ãã§ã¯ç¡æã§ãã
- zubeã䜿çšãããšãè€æ°ã®githubãªããžããªã®ã¿ã¹ã¯ã1ã€ã®ãããžã§ã¯ãã«çµåããåæã«äœæ¥ã§ããŸãã
ããã§ã¬ãã¥ãŒã¯çµäºã§ãã githubã§äœæ¥ããããã®ãã®ä»ã®èå³æ·±ããµãŒãã¹ãŸãã¯ããŒã«ãç¥ã£ãŠããå Žåã¯ãã³ã¡ã³ãã§ç¥èãå ±æããŠãã ããã
ãæž èŽããããšãããããŸããã
èšäºã®è¡šçŽç»å-cameronmcefeeã«ããBenevocatsã