Skip to content

Commit c90e962

Browse files
committed
chore: added Changelog
1 parent a3d4ceb commit c90e962

File tree

8 files changed

+252
-2
lines changed

8 files changed

+252
-2
lines changed

.commitlintrc.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ module.exports = {
1717
2,
1818
'always',
1919
[
20-
'build',
2120
'chore',
2221
'ci',
2322
'docs',

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
build

CHANGELOG.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<a name="1.0.0"></a>
2+
# 1.0.0 (2018-03-10)
3+
4+
5+
## New Features
6+
7+
* add circle ci batch ([626fa2f](https://github.com/Symphoria/webpack-addons-pwa/commit/626fa2f))
8+
* add circle ci ([c4f468f](https://github.com/Symphoria/webpack-addons-pwa/commit/c4f468f))
9+
* add ava testing ([8620af2](https://github.com/Symphoria/webpack-addons-pwa/commit/8620af2))
10+
* add eslint ([faa1178](https://github.com/Symphoria/webpack-addons-pwa/commit/faa1178))
11+
* adding favicon plugin ([0f97685](https://github.com/Symphoria/webpack-addons-pwa/commit/0f97685))
12+
13+
## Chore
14+
15+
* added commitlint ([a3d4ceb](https://github.com/Symphoria/webpack-addons-pwa/commit/a3d4ceb))
16+
17+
## Ci
18+
19+
* node version ([d4fcee5](https://github.com/Symphoria/webpack-addons-pwa/commit/d4fcee5))
20+
* node version ([7299911](https://github.com/Symphoria/webpack-addons-pwa/commit/7299911))
21+
22+
## Misc
23+
24+
* Update eslintrc ([51bdb35](https://github.com/Symphoria/webpack-addons-pwa/commit/51bdb35))
25+
* Fixes #16: Added Entry and Output fields in generated config ([1770f03](https://github.com/Symphoria/webpack-addons-pwa/commit/1770f03))
26+
* Fixes issue #13: Prettified generated manifest file ([af481db](https://github.com/Symphoria/webpack-addons-pwa/commit/af481db))
27+
* Copy existing or created manifest file to build directory and added tests ([437fe89](https://github.com/Symphoria/webpack-addons-pwa/commit/437fe89))
28+
* Added Manifest Creator Plugin ([8e08995](https://github.com/Symphoria/webpack-addons-pwa/commit/8e08995))
29+
* fix issue with chaining the promises ([d170a6d](https://github.com/Symphoria/webpack-addons-pwa/commit/d170a6d))
30+
* use latest webpack workbox plugin ([e143077](https://github.com/Symphoria/webpack-addons-pwa/commit/e143077))
31+
* remove no-sync rules ([485f6d8](https://github.com/Symphoria/webpack-addons-pwa/commit/485f6d8))
32+
* Update tests syntax ([135a795](https://github.com/Symphoria/webpack-addons-pwa/commit/135a795))
33+
* Fixes #12: npm dependencies install after init ([4846b70](https://github.com/Symphoria/webpack-addons-pwa/commit/4846b70))
34+
* Fix answer property name ([a1c3ff8](https://github.com/Symphoria/webpack-addons-pwa/commit/a1c3ff8))
35+
* Add promise chaining for prompts ([2c9912e](https://github.com/Symphoria/webpack-addons-pwa/commit/2c9912e))
36+
* Fix linting ([5935a20](https://github.com/Symphoria/webpack-addons-pwa/commit/5935a20))
37+
* Add editorconfig ([3028dda](https://github.com/Symphoria/webpack-addons-pwa/commit/3028dda))
38+
* Update package.json test command ([82c3d94](https://github.com/Symphoria/webpack-addons-pwa/commit/82c3d94))
39+
* Update README.md ([5b78270](https://github.com/Symphoria/webpack-addons-pwa/commit/5b78270))
40+
* Add Gitter badge ([b53471c](https://github.com/Symphoria/webpack-addons-pwa/commit/b53471c))
41+
* Create README.md ([fbbe081](https://github.com/Symphoria/webpack-addons-pwa/commit/fbbe081))
42+
* Initial commit ([17c4177](https://github.com/Symphoria/webpack-addons-pwa/commit/17c4177))
43+
44+
<a name="1.0.0"></a>
45+
# 1.0.0 (2018-03-10)
46+
47+
48+
## New Features
49+
50+
* add circle ci batch ([626fa2f](https://github.com/Symphoria/webpack-addons-pwa/commit/626fa2f))
51+
* add circle ci ([c4f468f](https://github.com/Symphoria/webpack-addons-pwa/commit/c4f468f))
52+
* add ava testing ([8620af2](https://github.com/Symphoria/webpack-addons-pwa/commit/8620af2))
53+
* add eslint ([faa1178](https://github.com/Symphoria/webpack-addons-pwa/commit/faa1178))
54+
* adding favicon plugin ([0f97685](https://github.com/Symphoria/webpack-addons-pwa/commit/0f97685))
55+
56+
## Chore
57+
58+
* added commitlint ([a3d4ceb](https://github.com/Symphoria/webpack-addons-pwa/commit/a3d4ceb))
59+
60+
## Ci
61+
62+
* node version ([d4fcee5](https://github.com/Symphoria/webpack-addons-pwa/commit/d4fcee5))
63+
* node version ([7299911](https://github.com/Symphoria/webpack-addons-pwa/commit/7299911))
64+
65+
## Misc
66+
67+
* Update eslintrc ([51bdb35](https://github.com/Symphoria/webpack-addons-pwa/commit/51bdb35))
68+
* Fixes #16: Added Entry and Output fields in generated config ([1770f03](https://github.com/Symphoria/webpack-addons-pwa/commit/1770f03))
69+
* Fixes issue #13: Prettified generated manifest file ([af481db](https://github.com/Symphoria/webpack-addons-pwa/commit/af481db))
70+
* Copy existing or created manifest file to build directory and added tests ([437fe89](https://github.com/Symphoria/webpack-addons-pwa/commit/437fe89))
71+
* Added Manifest Creator Plugin ([8e08995](https://github.com/Symphoria/webpack-addons-pwa/commit/8e08995))
72+
* fix issue with chaining the promises ([d170a6d](https://github.com/Symphoria/webpack-addons-pwa/commit/d170a6d))
73+
* use latest webpack workbox plugin ([e143077](https://github.com/Symphoria/webpack-addons-pwa/commit/e143077))
74+
* remove no-sync rules ([485f6d8](https://github.com/Symphoria/webpack-addons-pwa/commit/485f6d8))
75+
* Update tests syntax ([135a795](https://github.com/Symphoria/webpack-addons-pwa/commit/135a795))
76+
* Fixes #12: npm dependencies install after init ([4846b70](https://github.com/Symphoria/webpack-addons-pwa/commit/4846b70))
77+
* Fix answer property name ([a1c3ff8](https://github.com/Symphoria/webpack-addons-pwa/commit/a1c3ff8))
78+
* Add promise chaining for prompts ([2c9912e](https://github.com/Symphoria/webpack-addons-pwa/commit/2c9912e))
79+
* Fix linting ([5935a20](https://github.com/Symphoria/webpack-addons-pwa/commit/5935a20))
80+
* Add editorconfig ([3028dda](https://github.com/Symphoria/webpack-addons-pwa/commit/3028dda))
81+
* Update package.json test command ([82c3d94](https://github.com/Symphoria/webpack-addons-pwa/commit/82c3d94))
82+
* Update README.md ([5b78270](https://github.com/Symphoria/webpack-addons-pwa/commit/5b78270))
83+
* Add Gitter badge ([b53471c](https://github.com/Symphoria/webpack-addons-pwa/commit/b53471c))
84+
* Create README.md ([fbbe081](https://github.com/Symphoria/webpack-addons-pwa/commit/fbbe081))
85+
* Initial commit ([17c4177](https://github.com/Symphoria/webpack-addons-pwa/commit/17c4177))
86+

build/changelog-generator/index.js

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
/**
2+
* @license Copyright 2017 Google Inc. All Rights Reserved.
3+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
4+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
5+
* Based on: https://github.com/GoogleChrome/lighthouse/blob/master/build/changelog-generator/
6+
*/
7+
8+
const readFileSync = require("fs").readFileSync;
9+
const resolve = require("path").resolve;
10+
const mainTemplate = readFileSync(
11+
resolve(__dirname, "templates/template.hbs")
12+
).toString();
13+
const headerPartial = readFileSync(
14+
resolve(__dirname, "templates/header.hbs")
15+
).toString();
16+
const commitPartial = readFileSync(
17+
resolve(__dirname, "templates/commit.hbs")
18+
).toString();
19+
20+
const pullRequestRegex = /\(#(\d+)\)$/;
21+
const parserOpts = {
22+
headerCorrespondence: ["type", "scope", "message"],
23+
headerPattern: /^(\w*)(?:\((.*)\))?: (.*)$/
24+
};
25+
26+
process.stderr.write(`
27+
> Be sure to have the latest git tags locally:
28+
git fetch --tags
29+
30+
`);
31+
32+
const writerOpts = {
33+
mainTemplate,
34+
headerPartial,
35+
commitPartial,
36+
transform: commit => {
37+
if (typeof commit.hash === "string") {
38+
commit.hash = commit.hash.substring(0, 7);
39+
}
40+
41+
if (commit.type === "test") {
42+
commit.type = "tests";
43+
} else if (commit.type === "new_feature" || commit.type === "feat") {
44+
commit.type = "New Features";
45+
}
46+
47+
if (commit.type) {
48+
commit.type = commit.type.replace(/_/g, " ");
49+
commit.type =
50+
commit.type.substring(0, 1).toUpperCase() + commit.type.substring(1);
51+
} else {
52+
commit.type = "Misc";
53+
}
54+
55+
let pullRequestMatch = commit.header.match(pullRequestRegex);
56+
// If header does not provide a PR we try the message
57+
if (!pullRequestMatch && commit.message) {
58+
pullRequestMatch = commit.message.match(pullRequestRegex);
59+
}
60+
61+
if (pullRequestMatch) {
62+
commit.header = commit.header.replace(pullRequestMatch[0], "").trim();
63+
if (commit.message) {
64+
commit.message = commit.message.replace(pullRequestMatch[0], "").trim();
65+
}
66+
67+
commit.PR = pullRequestMatch[1];
68+
}
69+
70+
return commit;
71+
},
72+
groupBy: "type",
73+
commitGroupsSort: (a, b) => {
74+
// Put new feature on the top
75+
if (a.title === "New Features") {
76+
return -1;
77+
}
78+
if (b.title === "New Features") {
79+
return 1;
80+
}
81+
82+
// Put misc on the bottom
83+
if (a.title === "Misc") {
84+
return 1;
85+
}
86+
if (b.title === "Misc") {
87+
return -1;
88+
}
89+
90+
return a.title.localeCompare(b.title);
91+
},
92+
commitsSort: ["type", "scope"]
93+
};
94+
95+
module.exports = {
96+
parserOpts,
97+
writerOpts
98+
};
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{{!--
2+
/**
3+
* @license Copyright 2017 Google Inc. All Rights Reserved.
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
5+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
6+
*/
7+
From: https://github.com/GoogleChrome/lighthouse/blob/master/build/changelog-generator/
8+
--}}
9+
* {{#if scope}}{{scope}}: {{/if~}}
10+
{{#if message ~}}
11+
{{~message~}}
12+
{{~else~}}
13+
{{~header~}}
14+
{{~/if ~}}
15+
{{~!-- PR number/commit hash --}}
16+
{{~#if @root.linkReferences~}}
17+
{{~#if PR}} ([#{{PR}}](
18+
{{~#if @root.host}}{{~@root.host}}/{{/if~}}
19+
{{~#if @root.owner ~}}{{@root.owner}}/{{/if~}}
20+
{{~@root.repository}}/pull/{{PR}}))
21+
{{~else}} ([{{hash}}](
22+
{{~#if @root.host}}{{~@root.host}}/{{/if~}}
23+
{{~#if @root.owner ~}}{{@root.owner}}/{{/if~}}
24+
{{~@root.repository}}/{{@root.commit}}/{{hash}}))
25+
{{~/if~}}
26+
{{~else~}}
27+
{{~hash~}}
28+
{{~/if~}}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{{!--
2+
/**
3+
* @license Copyright 2017 Google Inc. All Rights Reserved.
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
5+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
6+
*/
7+
From: https://github.com/GoogleChrome/lighthouse/blob/master/build/changelog-generator/
8+
--}}
9+
<a name="{{version}}"></a>
10+
# {{version}} ({{date}})
11+
{{#if @root.linkCompare~}}
12+
[Full Changelog]({{~@root.repoUrl}}/compare/{{previousTag}}...{{currentTag}})
13+
{{~/if}}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{{!--
2+
/**
3+
* @license Copyright 2017 Google Inc. All Rights Reserved.
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
5+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
6+
*/
7+
From: https://github.com/GoogleChrome/lighthouse/blob/master/build/changelog-generator/
8+
--}}
9+
{{> header}}
10+
11+
{{#each commitGroups}}
12+
13+
{{#if title~}}
14+
## {{title}}
15+
16+
{{/if}}
17+
{{#each commits}}
18+
{{~> commit root=@root}}
19+
20+
{{/each}}
21+
{{/each}}
22+

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"scripts": {
88
"lint": "eslint *.js",
99
"test": "ava --verbose",
10-
"commitmsg": "commitlint -e $GIT_PARAMS"
10+
"commitmsg": "commitlint -e $GIT_PARAMS",
11+
"changelog": "conventional-changelog --config ./build/changelog-generator/index.js --infile CHANGELOG.md --same-file"
1112
},
1213
"dependencies": {
1314
"cross-spawn": "^6.0.5",
@@ -19,6 +20,8 @@
1920
"@commitlint/config-conventional": "^6.1.3",
2021
"ava": "^1.0.0-beta.3",
2122
"babel-eslint": "^8.2.1",
23+
"commitizen": "^2.9.6",
24+
"conventional-changelog-cli": "^1.3.15",
2225
"eslint": "^4.18.1",
2326
"husky": "^0.14.3"
2427
}

0 commit comments

Comments
 (0)