From 14f53fc0c28be4084778785aeace3763ed0d827f Mon Sep 17 00:00:00 2001 From: vince Date: Tue, 23 Jan 2018 15:09:53 +0100 Subject: [PATCH 1/3] feat add changelog generation support --- .changelogrc | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++ .gitignore | 2 +- template.md | 13 +++++++++++++ 3 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 .changelogrc create mode 100644 template.md diff --git a/.changelogrc b/.changelogrc new file mode 100644 index 000000000..67e6dcb29 --- /dev/null +++ b/.changelogrc @@ -0,0 +1,53 @@ +{ + "app_name": "", + "logo": "", + "intro": "", + "branch" : "master", + "repo_url": "https://github.com/Unitech/pm2", + "version_name" : "v2.9.2", + "tag": "2.9.1", + "file": "currentTagChangelog.md", + "template": "template.md", + "sections": [ + { + "title": "Bug Fixes", + "grep": "^fix" + }, + { + "title": "Features", + "grep": "^feat" + }, + { + "title": "Documentation", + "grep": "^docs" + }, + { + "title": "Breaking changes", + "grep": "BREAKING" + }, + { + "title": "Refactor", + "grep": "^refactor" + }, + { + "title": "Style", + "grep": "^style" + }, + { + "title": "Test", + "grep": "^test" + }, + { + "title": "Chore", + "grep": "^chore" + }, + { + "title": "Branchs merged", + "grep": "^Merge branch" + }, + { + "title" : "Pull requests merged", + "grep": "^Merge pull request" + } + ] +} diff --git a/.gitignore b/.gitignore index 7903de4bc..31e1bf66d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ /node_modules *.log -*.log *.pid test/child *.iml @@ -15,3 +14,4 @@ package-lock.json .DS_Store *.swp *.swo +currentTagChangelog.md diff --git a/template.md b/template.md new file mode 100644 index 000000000..b82e71d2c --- /dev/null +++ b/template.md @@ -0,0 +1,13 @@ +<% if(logo) { %>pm2 logo <% } %> +<% if(logo) { %># <%= title %> <% } %> +<% if(intro) { %><%= '\n' %><%= intro %><%= '\n' %><% } %> +<% if(version && (version.name || version.number)) { %>##<% if(version.name){%> <%= version.name %><% } %> <% if(version.date){ %>( <%= version.date %> )<% } %><%= '\n' %><% } %> +<% _.forEach(sections, function(section){ + if(section.commitsCount > 0) { %> +## <%= section.title %> +<% _.forEach(section.commits, function(commit){ %> - <%= printCommit(commit, true) %><% }) %> +<% _.forEach(section.components, function(component){ %> - **<%= component.name %>** +<% _.forEach(component.commits, function(commit){ %> - <%= printCommit(commit, true) %><% }) %> +<% }) %> +<% } %> +<% }) %> From d18d7d0f9ebc5fd1d2e6ae2b224cab0567e316b5 Mon Sep 17 00:00:00 2001 From: vince Date: Tue, 23 Jan 2018 15:19:44 +0100 Subject: [PATCH 2/3] refactor : rename template's file for changelog generation --- .changelogrc | 2 +- template.md => changelogTemplate.md | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename template.md => changelogTemplate.md (100%) diff --git a/.changelogrc b/.changelogrc index 67e6dcb29..52b406f96 100644 --- a/.changelogrc +++ b/.changelogrc @@ -7,7 +7,7 @@ "version_name" : "v2.9.2", "tag": "2.9.1", "file": "currentTagChangelog.md", - "template": "template.md", + "template": "changelogTemplate.md", "sections": [ { "title": "Bug Fixes", diff --git a/template.md b/changelogTemplate.md similarity index 100% rename from template.md rename to changelogTemplate.md From 6da85a7699edea276b189cb513ba25239185eed3 Mon Sep 17 00:00:00 2001 From: vince Date: Tue, 23 Jan 2018 16:03:22 +0100 Subject: [PATCH 3/3] chore : add perf and hotfix prefix and update contributing file --- .changelogrc | 8 ++++++++ CONTRIBUTING.md | 23 +++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/.changelogrc b/.changelogrc index 52b406f96..e1a840525 100644 --- a/.changelogrc +++ b/.changelogrc @@ -13,6 +13,10 @@ "title": "Bug Fixes", "grep": "^fix" }, + { + "title": "Hot Fixes", + "grep": "^hotfix" + }, { "title": "Features", "grep": "^feat" @@ -29,6 +33,10 @@ "title": "Refactor", "grep": "^refactor" }, + { + "title": "Performance improvement", + "grep": "^perf" + }, { "title": "Style", "grep": "^style" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cc70eea70..83fa8beac 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -43,6 +43,29 @@ When you modify the Daemon (lib/Daemon.js, lib/God.js, lib/God/*, lib/Watcher.js $ pm2 update ``` +## Commit rules + +### Commit message + +A good commit message should describe what changed and why. + +It should : + * contain a short description of the change (preferably 50 characters or less) + * be entirely in lowercase with the exception of proper nouns, acronyms, and the words that refer to code, like function/variable names + * be prefixed with one of the following word + * fix : bug fix + * hotfix : urgent bug fix + * feat : new or updated feature + * docs : documentation updates + * BREAKING : if commit is a breaking change + * refactor : code refactoring (no functional change) + * perf : performance improvement + * style : UX and display updates + * test : tests and CI updates + * chore : updates on build, tools, configuration ... + * Merge branch : when merging branch + * Merge pull request : when merging PR + ## Tests There are two tests type. Programmatic and Behavioral.