-
Notifications
You must be signed in to change notification settings - Fork 8
Added Commitlint and Changelog #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/** | ||
* @license Copyright 2017 Google Inc. All Rights Reserved. | ||
* 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 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. | ||
*/ | ||
// Based on https://github.com/GoogleChrome/lighthouse/blob/master/.cz-config.js | ||
|
||
module.exports = { | ||
allowCustomScopes: true, | ||
scopes: [], | ||
types: [ | ||
{ value: "feat", name: "feat: A new feature" }, | ||
{ value: "tests", name: "tests: Tests" }, | ||
{ value: "docs", name: "docs: Documentation" }, | ||
{ value: "misc", name: "misc: Other formats like tweaks and such" }, | ||
{ value: "chore", name: "chore: Updating docs, linting etc" }, | ||
{ value: "fix", name: "fix: Bugfix"}, | ||
{ value: "refactor", name: "refactor: Refactored the code"} | ||
] | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
build | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
<a name="1.0.0"></a> | ||
# 1.0.0 (2018-03-10) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why it is shown as 1.0.0 ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, 1.0.0 is the version specified in package.json. Do I increase the version in package.json? @sendilkumarn |
||
|
||
|
||
## New Features | ||
|
||
* add circle ci batch ([626fa2f](https://github.com/sendilkumarn/webpack-addons-pwa/commit/626fa2f)) | ||
* add circle ci ([c4f468f](https://github.com/sendilkumarn/webpack-addons-pwa/commit/c4f468f)) | ||
* add ava testing ([8620af2](https://github.com/sendilkumarn/webpack-addons-pwa/commit/8620af2)) | ||
* add eslint ([faa1178](https://github.com/sendilkumarn/webpack-addons-pwa/commit/faa1178)) | ||
* adding favicon plugin ([0f97685](https://github.com/sendilkumarn/webpack-addons-pwa/commit/0f97685)) | ||
|
||
## Chore | ||
|
||
* added commitlint ([a3d4ceb](https://github.com/sendilkumarn/webpack-addons-pwa/commit/a3d4ceb)) | ||
|
||
## Ci | ||
|
||
* node version ([d4fcee5](https://github.com/sendilkumarn/webpack-addons-pwa/commit/d4fcee5)) | ||
* node version ([7299911](https://github.com/sendilkumarn/webpack-addons-pwa/commit/7299911)) | ||
|
||
## Misc | ||
|
||
* Update eslintrc ([51bdb35](https://github.com/sendilkumarn/webpack-addons-pwa/commit/51bdb35)) | ||
* Fixes #16: Added Entry and Output fields in generated config ([1770f03](https://github.com/sendilkumarn/webpack-addons-pwa/commit/1770f03)) | ||
* Fixes issue #13: Prettified generated manifest file ([af481db](https://github.com/sendilkumarn/webpack-addons-pwa/commit/af481db)) | ||
* Copy existing or created manifest file to build directory and added tests ([437fe89](https://github.com/sendilkumarn/webpack-addons-pwa/commit/437fe89)) | ||
* Added Manifest Creator Plugin ([8e08995](https://github.com/sendilkumarn/webpack-addons-pwa/commit/8e08995)) | ||
* fix issue with chaining the promises ([d170a6d](https://github.com/sendilkumarn/webpack-addons-pwa/commit/d170a6d)) | ||
* use latest webpack workbox plugin ([e143077](https://github.com/sendilkumarn/webpack-addons-pwa/commit/e143077)) | ||
* remove no-sync rules ([485f6d8](https://github.com/sendilkumarn/webpack-addons-pwa/commit/485f6d8)) | ||
* Update tests syntax ([135a795](https://github.com/sendilkumarn/webpack-addons-pwa/commit/135a795)) | ||
* Fixes #12: npm dependencies install after init ([4846b70](https://github.com/sendilkumarn/webpack-addons-pwa/commit/4846b70)) | ||
* Fix answer property name ([a1c3ff8](https://github.com/sendilkumarn/webpack-addons-pwa/commit/a1c3ff8)) | ||
* Add promise chaining for prompts ([2c9912e](https://github.com/sendilkumarn/webpack-addons-pwa/commit/2c9912e)) | ||
* Fix linting ([5935a20](https://github.com/sendilkumarn/webpack-addons-pwa/commit/5935a20)) | ||
* Add editorconfig ([3028dda](https://github.com/sendilkumarn/webpack-addons-pwa/commit/3028dda)) | ||
* Update package.json test command ([82c3d94](https://github.com/sendilkumarn/webpack-addons-pwa/commit/82c3d94)) | ||
* Update README.md ([5b78270](https://github.com/sendilkumarn/webpack-addons-pwa/commit/5b78270)) | ||
* Add Gitter badge ([b53471c](https://github.com/sendilkumarn/webpack-addons-pwa/commit/b53471c)) | ||
* Create README.md ([fbbe081](https://github.com/sendilkumarn/webpack-addons-pwa/commit/fbbe081)) | ||
* Initial commit ([17c4177](https://github.com/sendilkumarn/webpack-addons-pwa/commit/17c4177)) | ||
|
||
<a name="1.0.0"></a> | ||
# 1.0.0 (2018-03-10) | ||
|
||
|
||
## New Features | ||
|
||
* add circle ci batch ([626fa2f](https://github.com/sendilkumarn/webpack-addons-pwa/commit/626fa2f)) | ||
* add circle ci ([c4f468f](https://github.com/sendilkumarn/webpack-addons-pwa/commit/c4f468f)) | ||
* add ava testing ([8620af2](https://github.com/sendilkumarn/webpack-addons-pwa/commit/8620af2)) | ||
* add eslint ([faa1178](https://github.com/sendilkumarn/webpack-addons-pwa/commit/faa1178)) | ||
* adding favicon plugin ([0f97685](https://github.com/sendilkumarn/webpack-addons-pwa/commit/0f97685)) | ||
|
||
## Chore | ||
|
||
* added commitlint ([a3d4ceb](https://github.com/sendilkumarn/webpack-addons-pwa/commit/a3d4ceb)) | ||
|
||
## Ci | ||
|
||
* node version ([d4fcee5](https://github.com/sendilkumarn/webpack-addons-pwa/commit/d4fcee5)) | ||
* node version ([7299911](https://github.com/sendilkumarn/webpack-addons-pwa/commit/7299911)) | ||
|
||
## Misc | ||
|
||
* Update eslintrc ([51bdb35](https://github.com/sendilkumarn/webpack-addons-pwa/commit/51bdb35)) | ||
* Fixes #16: Added Entry and Output fields in generated config ([1770f03](https://github.com/sendilkumarn/webpack-addons-pwa/commit/1770f03)) | ||
* Fixes issue #13: Prettified generated manifest file ([af481db](https://github.com/sendilkumarn/webpack-addons-pwa/commit/af481db)) | ||
* Copy existing or created manifest file to build directory and added tests ([437fe89](https://github.com/sendilkumarn/webpack-addons-pwa/commit/437fe89)) | ||
* Added Manifest Creator Plugin ([8e08995](https://github.com/sendilkumarn/webpack-addons-pwa/commit/8e08995)) | ||
* fix issue with chaining the promises ([d170a6d](https://github.com/sendilkumarn/webpack-addons-pwa/commit/d170a6d)) | ||
* use latest webpack workbox plugin ([e143077](https://github.com/sendilkumarn/webpack-addons-pwa/commit/e143077)) | ||
* remove no-sync rules ([485f6d8](https://github.com/sendilkumarn/webpack-addons-pwa/commit/485f6d8)) | ||
* Update tests syntax ([135a795](https://github.com/sendilkumarn/webpack-addons-pwa/commit/135a795)) | ||
* Fixes #12: npm dependencies install after init ([4846b70](https://github.com/sendilkumarn/webpack-addons-pwa/commit/4846b70)) | ||
* Fix answer property name ([a1c3ff8](https://github.com/sendilkumarn/webpack-addons-pwa/commit/a1c3ff8)) | ||
* Add promise chaining for prompts ([2c9912e](https://github.com/sendilkumarn/webpack-addons-pwa/commit/2c9912e)) | ||
* Fix linting ([5935a20](https://github.com/sendilkumarn/webpack-addons-pwa/commit/5935a20)) | ||
* Add editorconfig ([3028dda](https://github.com/sendilkumarn/webpack-addons-pwa/commit/3028dda)) | ||
* Update package.json test command ([82c3d94](https://github.com/sendilkumarn/webpack-addons-pwa/commit/82c3d94)) | ||
* Update README.md ([5b78270](https://github.com/sendilkumarn/webpack-addons-pwa/commit/5b78270)) | ||
* Add Gitter badge ([b53471c](https://github.com/sendilkumarn/webpack-addons-pwa/commit/b53471c)) | ||
* Create README.md ([fbbe081](https://github.com/sendilkumarn/webpack-addons-pwa/commit/fbbe081)) | ||
* Initial commit ([17c4177](https://github.com/sendilkumarn/webpack-addons-pwa/commit/17c4177)) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
/** | ||
* @license Copyright 2017 Google Inc. All Rights Reserved. | ||
* 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 | ||
* 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. | ||
* Based on: https://github.com/GoogleChrome/lighthouse/blob/master/build/changelog-generator/ | ||
*/ | ||
|
||
const readFileSync = require("fs").readFileSync; | ||
const resolve = require("path").resolve; | ||
const mainTemplate = readFileSync( | ||
resolve(__dirname, "templates/template.hbs") | ||
).toString(); | ||
const headerPartial = readFileSync( | ||
resolve(__dirname, "templates/header.hbs") | ||
).toString(); | ||
const commitPartial = readFileSync( | ||
resolve(__dirname, "templates/commit.hbs") | ||
).toString(); | ||
|
||
const pullRequestRegex = /\(#(\d+)\)$/; | ||
const parserOpts = { | ||
headerCorrespondence: ["type", "scope", "message"], | ||
headerPattern: /^(\w*)(?:\((.*)\))?: (.*)$/ | ||
}; | ||
|
||
process.stderr.write(` | ||
> Be sure to have the latest git tags locally: | ||
git fetch --tags | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove this extra line There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Got it |
||
`); | ||
|
||
const writerOpts = { | ||
mainTemplate, | ||
headerPartial, | ||
commitPartial, | ||
transform: commit => { | ||
if (typeof commit.hash === "string") { | ||
commit.hash = commit.hash.substring(0, 7); | ||
} | ||
|
||
if (commit.type === "test") { | ||
commit.type = "tests"; | ||
} else if (commit.type === "new_feature" || commit.type === "feat") { | ||
commit.type = "New Features"; | ||
} | ||
|
||
if (commit.type) { | ||
commit.type = commit.type.replace(/_/g, " "); | ||
commit.type = | ||
commit.type.substring(0, 1).toUpperCase() + commit.type.substring(1); | ||
} else { | ||
commit.type = "Misc"; | ||
} | ||
|
||
let pullRequestMatch = commit.header.match(pullRequestRegex); | ||
// If header does not provide a PR we try the message | ||
if (!pullRequestMatch && commit.message) { | ||
pullRequestMatch = commit.message.match(pullRequestRegex); | ||
} | ||
|
||
if (pullRequestMatch) { | ||
commit.header = commit.header.replace(pullRequestMatch[0], "").trim(); | ||
if (commit.message) { | ||
commit.message = commit.message.replace(pullRequestMatch[0], "").trim(); | ||
} | ||
|
||
commit.PR = pullRequestMatch[1]; | ||
} | ||
|
||
return commit; | ||
}, | ||
groupBy: "type", | ||
commitGroupsSort: (a, b) => { | ||
// Put new feature on the top | ||
if (a.title === "New Features") { | ||
return -1; | ||
} | ||
if (b.title === "New Features") { | ||
return 1; | ||
} | ||
|
||
// Put misc on the bottom | ||
if (a.title === "Misc") { | ||
return 1; | ||
} | ||
if (b.title === "Misc") { | ||
return -1; | ||
} | ||
|
||
return a.title.localeCompare(b.title); | ||
}, | ||
commitsSort: ["type", "scope"] | ||
}; | ||
|
||
module.exports = { | ||
parserOpts, | ||
writerOpts | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{{!-- | ||
/** | ||
* @license Copyright 2017 Google Inc. All Rights Reserved. | ||
* 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 | ||
* 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. | ||
*/ | ||
From: https://github.com/GoogleChrome/lighthouse/blob/master/build/changelog-generator/ | ||
--}} | ||
* {{#if scope}}{{scope}}: {{/if~}} | ||
{{#if message ~}} | ||
{{~message~}} | ||
{{~else~}} | ||
{{~header~}} | ||
{{~/if ~}} | ||
{{~!-- PR number/commit hash --}} | ||
{{~#if @root.linkReferences~}} | ||
{{~#if PR}} ([#{{PR}}]( | ||
{{~#if @root.host}}{{[email protected]}}/{{/if~}} | ||
{{~#if @root.owner ~}}{{@root.owner}}/{{/if~}} | ||
{{[email protected]}}/pull/{{PR}})) | ||
{{~else}} ([{{hash}}]( | ||
{{~#if @root.host}}{{[email protected]}}/{{/if~}} | ||
{{~#if @root.owner ~}}{{@root.owner}}/{{/if~}} | ||
{{[email protected]}}/{{@root.commit}}/{{hash}})) | ||
{{~/if~}} | ||
{{~else~}} | ||
{{~hash~}} | ||
{{~/if~}} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{{!-- | ||
/** | ||
* @license Copyright 2017 Google Inc. All Rights Reserved. | ||
* 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 | ||
* 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. | ||
*/ | ||
From: https://github.com/GoogleChrome/lighthouse/blob/master/build/changelog-generator/ | ||
--}} | ||
<a name="{{version}}"></a> | ||
# {{version}} ({{date}}) | ||
{{#if @root.linkCompare~}} | ||
[Full Changelog]({{[email protected]}}/compare/{{previousTag}}...{{currentTag}}) | ||
{{~/if}} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{{!-- | ||
/** | ||
* @license Copyright 2017 Google Inc. All Rights Reserved. | ||
* 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 | ||
* 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. | ||
*/ | ||
From: https://github.com/GoogleChrome/lighthouse/blob/master/build/changelog-generator/ | ||
--}} | ||
{{> header}} | ||
|
||
{{#each commitGroups}} | ||
|
||
{{#if title~}} | ||
## {{title}} | ||
|
||
{{/if}} | ||
{{#each commits}} | ||
{{~> commit root=@root}} | ||
|
||
{{/each}} | ||
{{/each}} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
module.exports = { | ||
extends: ["cz"], | ||
rules: { | ||
'body-leading-blank': [1, 'always'], | ||
'footer-leading-blank': [1, 'always'], | ||
'header-max-length': [2, 'always', 72], | ||
'scope-case': [2, 'always', 'lower-case'], | ||
'subject-case': [ | ||
2, | ||
'never', | ||
['sentence-case', 'start-case', 'pascal-case', 'upper-case'] | ||
], | ||
'subject-empty': [2, 'never'], | ||
'subject-full-stop': [2, 'never', '.'], | ||
"subject-tense": [1, "always", ["present-imperative"]], | ||
'type-case': [2, 'always', 'lower-case'], | ||
'type-empty': [2, 'never'] | ||
} | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add one more blank line here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it