-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add conventional commit enforcement and conventional changelog…
… generation
- Loading branch information
Showing
6 changed files
with
1,925 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
## 0.0.1 (2024-08-09) | ||
|
||
### Documentation | ||
|
||
* docs: update readme ([f3adc58a9b39a4170f4c686dde07bfc1c5dcb6b0](https://github.com/PAYONE-GmbH/PCP-server-nodeJS-SDK/commit/f3adc58a9b39a4170f4c686dde07bfc1c5dcb6b0)) | ||
* docs: update readme ([4d596a66f3007e3d96e0ef39cacd3f278f507fdc](https://github.com/PAYONE-GmbH/PCP-server-nodeJS-SDK/commit/4d596a66f3007e3d96e0ef39cacd3f278f507fdc)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
/* eslint-disable */ | ||
const fs = require('fs'); | ||
|
||
const customTransform = (commit, context) => { | ||
const transformedCommit = { ...commit }; | ||
|
||
switch (transformedCommit.type) { | ||
case 'feat': | ||
transformedCommit.customGroup = 'Features'; | ||
break; | ||
case 'feature': | ||
transformedCommit.customGroup = 'Features'; | ||
break; | ||
case 'fix': | ||
transformedCommit.customGroup = 'Bug Fixes'; | ||
break; | ||
case 'docs': | ||
transformedCommit.customGroup = 'Documentation'; | ||
break; | ||
default: | ||
transformedCommit.customGroup = null; | ||
} | ||
|
||
return transformedCommit; | ||
}; | ||
|
||
module.exports = { | ||
writerOpts: { | ||
transform: customTransform, | ||
groupBy: 'customGroup', | ||
commitGroupsSort: 'title', | ||
commitsSort: ['scope', 'subject'], | ||
mainTemplate: `{{> header}} | ||
{{#each commitGroups}} | ||
{{#if title}} | ||
### {{title}} | ||
{{#each commits}} | ||
{{> commit root=@root}} | ||
{{/each}} | ||
{{/if}} | ||
{{/each}} | ||
{{> footer}} | ||
`, | ||
headerPartial: `{{#if isPatch~}} | ||
## | ||
{{~else~}} | ||
# | ||
{{~/if}} {{#if @root.linkCompare~}} | ||
[{{version}}]( | ||
{{~#if @root.repository~}} | ||
{{~#if @root.host}} | ||
{{[email protected]}}/ | ||
{{~/if}} | ||
{{~#if @root.owner}} | ||
{{[email protected]}}/ | ||
{{~/if}} | ||
{{[email protected]}} | ||
{{~else}} | ||
{{[email protected]}} | ||
{{~/if~}} | ||
/compare/{{previousTag}}...{{currentTag}}) | ||
{{~else}} | ||
{{~version}} | ||
{{~/if}} | ||
{{~#if title}} "{{title}}" | ||
{{~/if}} | ||
{{~#if date}} ({{date}}) | ||
{{/if}} | ||
`, | ||
}, | ||
hooks: { | ||
postbump: () => { | ||
const path = 'CHANGELOG.md'; | ||
if (!fs.existsSync(path)) { | ||
fs.writeFileSync(path, '', 'utf8'); | ||
} | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default { extends: ['@commitlint/config-conventional'] }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# EXAMPLE USAGE: | ||
# | ||
# Refer for explanation to following link: | ||
# https://github.com/evilmartians/lefthook/blob/master/docs/configuration.md | ||
# | ||
# pre-push: | ||
# commands: | ||
# packages-audit: | ||
# tags: frontend security | ||
# run: yarn audit | ||
# gems-audit: | ||
# tags: backend security | ||
# run: bundle audit | ||
# | ||
# pre-commit: | ||
# parallel: true | ||
# commands: | ||
# eslint: | ||
# glob: "*.{js,ts,jsx,tsx}" | ||
# run: yarn eslint {staged_files} | ||
# rubocop: | ||
# tags: backend style | ||
# glob: "*.rb" | ||
# exclude: '(^|/)(application|routes)\.rb$' | ||
# run: bundle exec rubocop --force-exclusion {all_files} | ||
# govet: | ||
# tags: backend style | ||
# files: git ls-files -m | ||
# glob: "*.go" | ||
# run: go vet {files} | ||
# scripts: | ||
# "hello.js": | ||
# runner: node | ||
# "any.go": | ||
# runner: go run | ||
|
||
pre-commit: | ||
parallel: true | ||
commands: | ||
lint: | ||
run: npm run lint | ||
glob: "*.{js,ts}" | ||
|
||
commit-msg: | ||
parallel: true | ||
commands: | ||
commitlint: | ||
run: npx commitlint --edit $1 |
Oops, something went wrong.