Skip to content
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

feat: Add support of commitlint #22

Merged
merged 2 commits into from
Feb 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ jobs:
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -m "feat: build documentation" -a
git add -A
git commit -m "feat(docs): re-build documentation"

- name: push
uses: ad-m/github-push-action@master
Expand Down
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install commitlint --edit "$1"
38 changes: 38 additions & 0 deletions .versionrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"types": [
{
"type": "feat",
"section": "Features"
},
{
"type": "fix",
"section": "Bug Fixes"
},
{
"type": "chore",
"hidden": true
},
{
"type": "docs",
"hidden": true
},
{
"type": "style",
"hidden": true
},
{
"type": "refactor",
"hidden": true
},
{
"type": "perf",
"hidden": true
},
{
"type": "test",
"hidden": true
}
],
"commitUrlFormat": "https://github.com/adrien2p/medusa-extender/commits/{{hash}}",
"compareUrlFormat": "https://github.com/adrien2p/medusa-extender/compare/{{previousTag}}...{{currentTag}}"
}
4 changes: 4 additions & 0 deletions assets/coverage/badge-functions.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions assets/coverage/badge-lines.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
129 changes: 129 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
module.exports = {
extends: ['@commitlint/config-angular'],
parserPreset: 'conventional-changelog-conventionalcommits',
rules: {
'body-max-line-length': [2, 'always', 100],
'footer-max-line-length': [2, 'always', 100],
'header-max-length': [2, 'always', 100],
'subject-empty': [2, 'never'],
'subject-full-stop': [2, 'never', '.'],
'type-case': [2, 'always', 'lower-case'],
'type-empty': [2, 'never'],
'type-enum': [
2,
'always',
[
'build',
'chore',
'ci',
'docs',
'feat',
'fix',
'perf',
'refactor',
'revert',
'style',
'test',
],
],
},
prompt: {
questions: {
type: {
description: "Select the type of change that you're committing",
enum: {
feat: {
description: 'A new feature',
title: 'Features',
emoji: '✨',
},
fix: {
description: 'A bug fix',
title: 'Bug Fixes',
emoji: '🐛',
},
docs: {
description: 'Documentation only changes',
title: 'Documentation',
emoji: '📚',
},
style: {
description:
'Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)',
title: 'Styles',
emoji: '💎',
},
refactor: {
description:
'A code change that neither fixes a bug nor adds a feature',
title: 'Code Refactoring',
emoji: '📦',
},
perf: {
description: 'A code change that improves performance',
title: 'Performance Improvements',
emoji: '🚀',
},
test: {
description: 'Adding missing tests or correcting existing tests',
title: 'Tests',
emoji: '🚨',
},
build: {
description:
'Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)',
title: 'Builds',
emoji: '🛠',
},
ci: {
description:
'Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)',
title: 'Continuous Integrations',
emoji: '⚙️',
},
chore: {
description: "Other changes that don't modify src or test files",
title: 'Chores',
emoji: '♻️',
},
revert: {
description: 'Reverts a previous commit',
title: 'Reverts',
emoji: '🗑',
},
},
},
scope: {
description:
'What is the scope of this change (e.g. component or file name)',
},
subject: {
description:
'Write a short, imperative tense description of the change',
},
body: {
description: 'Provide a longer description of the change',
},
isBreaking: {
description: 'Are there any breaking changes?',
},
breakingBody: {
description:
'A BREAKING CHANGE commit requires a body. Please enter a longer description of the commit itself',
},
breaking: {
description: 'Describe the breaking changes',
},
isIssueAffected: {
description: 'Does this change affect any open issues?',
},
issuesBody: {
description:
'If issues are closed, the commit requires a body. Please enter a longer description of the commit itself',
},
issues: {
description: 'Add issue references (e.g. "fix #123", "re #123".)',
},
},
},
};
8 changes: 4 additions & 4 deletions docs/classes/Medusa.Medusa-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ internal container and database connection.

#### Defined in

[src/Medusa.ts:37](https://github.com/adrien2p/medusa-extender/blob/6bd2587/src/Medusa.ts#L37)
[src/Medusa.ts:37](https://github.com/adrien2p/medusa-extender/blob/6176cb6/src/Medusa.ts#L37)

## Properties

Expand All @@ -47,7 +47,7 @@ internal container and database connection.

#### Defined in

[src/Medusa.ts:30](https://github.com/adrien2p/medusa-extender/blob/6bd2587/src/Medusa.ts#L30)
[src/Medusa.ts:30](https://github.com/adrien2p/medusa-extender/blob/6176cb6/src/Medusa.ts#L30)

___

Expand All @@ -57,7 +57,7 @@ ___

#### Defined in

[src/Medusa.ts:31](https://github.com/adrien2p/medusa-extender/blob/6bd2587/src/Medusa.ts#L31)
[src/Medusa.ts:31](https://github.com/adrien2p/medusa-extender/blob/6176cb6/src/Medusa.ts#L31)

## Methods

Expand All @@ -77,4 +77,4 @@ ___

#### Defined in

[src/Medusa.ts:45](https://github.com/adrien2p/medusa-extender/blob/6bd2587/src/Medusa.ts#L45)
[src/Medusa.ts:45](https://github.com/adrien2p/medusa-extender/blob/6176cb6/src/Medusa.ts#L45)
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

#### Defined in

[src/decorators/onMedusaEntityEvent.decorator.ts:42](https://github.com/adrien2p/medusa-extender/blob/6bd2587/src/decorators/onMedusaEntityEvent.decorator.ts#L42)
[src/decorators/onMedusaEntityEvent.decorator.ts:42](https://github.com/adrien2p/medusa-extender/blob/6176cb6/src/decorators/onMedusaEntityEvent.decorator.ts#L42)

## Properties

Expand All @@ -55,7 +55,7 @@

#### Defined in

[src/decorators/onMedusaEntityEvent.decorator.ts:40](https://github.com/adrien2p/medusa-extender/blob/6bd2587/src/decorators/onMedusaEntityEvent.decorator.ts#L40)
[src/decorators/onMedusaEntityEvent.decorator.ts:40](https://github.com/adrien2p/medusa-extender/blob/6176cb6/src/decorators/onMedusaEntityEvent.decorator.ts#L40)

___

Expand All @@ -65,7 +65,7 @@ ___

#### Defined in

[src/decorators/onMedusaEntityEvent.decorator.ts:39](https://github.com/adrien2p/medusa-extender/blob/6bd2587/src/decorators/onMedusaEntityEvent.decorator.ts#L39)
[src/decorators/onMedusaEntityEvent.decorator.ts:39](https://github.com/adrien2p/medusa-extender/blob/6176cb6/src/decorators/onMedusaEntityEvent.decorator.ts#L39)

## Accessors

Expand All @@ -79,7 +79,7 @@ ___

#### Defined in

[src/decorators/onMedusaEntityEvent.decorator.ts:50](https://github.com/adrien2p/medusa-extender/blob/6bd2587/src/decorators/onMedusaEntityEvent.decorator.ts#L50)
[src/decorators/onMedusaEntityEvent.decorator.ts:50](https://github.com/adrien2p/medusa-extender/blob/6176cb6/src/decorators/onMedusaEntityEvent.decorator.ts#L50)

___

Expand All @@ -93,7 +93,7 @@ ___

#### Defined in

[src/decorators/onMedusaEntityEvent.decorator.ts:46](https://github.com/adrien2p/medusa-extender/blob/6bd2587/src/decorators/onMedusaEntityEvent.decorator.ts#L46)
[src/decorators/onMedusaEntityEvent.decorator.ts:46](https://github.com/adrien2p/medusa-extender/blob/6176cb6/src/decorators/onMedusaEntityEvent.decorator.ts#L46)

## Methods

Expand All @@ -120,7 +120,7 @@ ___

#### Defined in

[src/decorators/onMedusaEntityEvent.decorator.ts:70](https://github.com/adrien2p/medusa-extender/blob/6bd2587/src/decorators/onMedusaEntityEvent.decorator.ts#L70)
[src/decorators/onMedusaEntityEvent.decorator.ts:70](https://github.com/adrien2p/medusa-extender/blob/6176cb6/src/decorators/onMedusaEntityEvent.decorator.ts#L70)

___

Expand All @@ -146,7 +146,7 @@ ___

#### Defined in

[src/decorators/onMedusaEntityEvent.decorator.ts:58](https://github.com/adrien2p/medusa-extender/blob/6bd2587/src/decorators/onMedusaEntityEvent.decorator.ts#L58)
[src/decorators/onMedusaEntityEvent.decorator.ts:58](https://github.com/adrien2p/medusa-extender/blob/6176cb6/src/decorators/onMedusaEntityEvent.decorator.ts#L58)

___

Expand All @@ -173,7 +173,7 @@ ___

#### Defined in

[src/decorators/onMedusaEntityEvent.decorator.ts:84](https://github.com/adrien2p/medusa-extender/blob/6bd2587/src/decorators/onMedusaEntityEvent.decorator.ts#L84)
[src/decorators/onMedusaEntityEvent.decorator.ts:84](https://github.com/adrien2p/medusa-extender/blob/6176cb6/src/decorators/onMedusaEntityEvent.decorator.ts#L84)

___

Expand All @@ -199,7 +199,7 @@ ___

#### Defined in

[src/decorators/onMedusaEntityEvent.decorator.ts:66](https://github.com/adrien2p/medusa-extender/blob/6bd2587/src/decorators/onMedusaEntityEvent.decorator.ts#L66)
[src/decorators/onMedusaEntityEvent.decorator.ts:66](https://github.com/adrien2p/medusa-extender/blob/6176cb6/src/decorators/onMedusaEntityEvent.decorator.ts#L66)

___

Expand All @@ -226,7 +226,7 @@ ___

#### Defined in

[src/decorators/onMedusaEntityEvent.decorator.ts:77](https://github.com/adrien2p/medusa-extender/blob/6bd2587/src/decorators/onMedusaEntityEvent.decorator.ts#L77)
[src/decorators/onMedusaEntityEvent.decorator.ts:77](https://github.com/adrien2p/medusa-extender/blob/6176cb6/src/decorators/onMedusaEntityEvent.decorator.ts#L77)

___

Expand All @@ -252,7 +252,7 @@ ___

#### Defined in

[src/decorators/onMedusaEntityEvent.decorator.ts:62](https://github.com/adrien2p/medusa-extender/blob/6bd2587/src/decorators/onMedusaEntityEvent.decorator.ts#L62)
[src/decorators/onMedusaEntityEvent.decorator.ts:62](https://github.com/adrien2p/medusa-extender/blob/6176cb6/src/decorators/onMedusaEntityEvent.decorator.ts#L62)

___

Expand Down Expand Up @@ -280,7 +280,7 @@ ___

#### Defined in

[src/decorators/onMedusaEntityEvent.decorator.ts:91](https://github.com/adrien2p/medusa-extender/blob/6bd2587/src/decorators/onMedusaEntityEvent.decorator.ts#L91)
[src/decorators/onMedusaEntityEvent.decorator.ts:91](https://github.com/adrien2p/medusa-extender/blob/6176cb6/src/decorators/onMedusaEntityEvent.decorator.ts#L91)

___

Expand All @@ -300,4 +300,4 @@ ___

#### Defined in

[src/decorators/onMedusaEntityEvent.decorator.ts:54](https://github.com/adrien2p/medusa-extender/blob/6bd2587/src/decorators/onMedusaEntityEvent.decorator.ts#L54)
[src/decorators/onMedusaEntityEvent.decorator.ts:54](https://github.com/adrien2p/medusa-extender/blob/6176cb6/src/decorators/onMedusaEntityEvent.decorator.ts#L54)
Loading