Skip to content

Commit

Permalink
build: update commitizen configuration for API
Browse files Browse the repository at this point in the history
Updates @m-scott-lassiter/semantic-release-github-npm-config to version 2.0.0 which causes API types
to trigger patches. Also upgrades the commitizen script with a more customized scope list to assist
other developers.
  • Loading branch information
M-Scott-Lassiter committed May 23, 2022
1 parent c375161 commit f40be7f
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 23 deletions.
45 changes: 30 additions & 15 deletions .cz-config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
const encoderMethods = [
{ name: 'dictionary' },
{ name: 'allowLowerCaseDictionary' },
{ name: 'resetDefaultDictionary' },
{ name: 'encode' },
{ name: 'decode' },
{ name: 'deconstruct' }
]

const documentation = [
{ name: 'contributing' },
{ name: 'code of conduct' },
{ name: 'license' },
{ name: 'readme' },
{ name: 'security' }
]

module.exports = {
types: [
{
value: 'api',
name: 'api: Non-functional changes to code API documentation that help other developers understand how to use a tool or feature (i.e. intellisense)'
},
{
value: 'build',
name: 'build: Changes that affect the build system configuration, package scripts, or dev dependencies (i.e. adds/remove/modify/update)'
Expand All @@ -26,30 +47,24 @@ module.exports = {
{ value: 'test', name: 'test: Add missing tests or correct existing tests' }
],

scopes: [
{ name: 'api' },
{ name: 'contributing' },
{ name: 'license' },
{ name: 'readme' },
{ name: 'security' }
],
scopes: [...encoderMethods, ...documentation],

allowTicketNumber: false,
isTicketNumberRequired: false,
ticketNumberPrefix: 'TICKET-',
ticketNumberRegExp: '\\d{1,5}',

// it needs to match the value for field type. Eg.: 'fix'
/*
scopeOverrides: {
fix: [
{name: 'merge'},
{name: 'style'},
{name: 'e2eTest'},
{name: 'unitTest'}
]
api: encoderMethods,
ci: [{ name: 'publish' }, { name: 'test' }, { name: 'hooks' }],
docs: documentation,
fix: encoderMethods,
perf: encoderMethods,
refactor: encoderMethods,
test: encoderMethods
},
*/

// override the messages, defaults are as follows
messages: {
type: "Select the type of change that you're committing:",
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
}
},
"devDependencies": {
"@m-scott-lassiter/semantic-release-github-npm-config": "^1.0.4",
"@m-scott-lassiter/semantic-release-github-npm-config": "^2.0.0",
"@types/jest": "^27.4.1",
"commitizen": "^4.2.4",
"cz-customizable": "^6.3.0",
Expand Down

0 comments on commit f40be7f

Please sign in to comment.