cz-mand-mobile-changelog
Advanced tools
Comparing version 1.0.2 to 2.0.0
@@ -20,10 +20,16 @@ "format cjs"; | ||
var types = options.types; | ||
var packages = options.packages; | ||
var length = longest(Object.keys(types)).length + 1; | ||
var choices = map(types, function (type, key) { | ||
var choices0 = map(types, function (type, key) { | ||
return { | ||
name: rightPad(key + ':', length) + ' ' + type.description, | ||
name: `${type.icon} ${rightPad(key + ':', longest(Object.keys(types)).length + 1)} ${type.description}`, | ||
value: key | ||
}; | ||
}); | ||
var choices1 = map(packages, function (key) { | ||
return { | ||
name: key, | ||
value: key | ||
}; | ||
}); | ||
@@ -57,7 +63,13 @@ return { | ||
message: 'Select the type of change that you\'re committing:', | ||
choices: choices | ||
choices: choices0 | ||
}, { | ||
type: 'list', | ||
name: 'package', | ||
message: 'Select the package of change that you\'re committing: (press enter to skip)', | ||
choices: choices1, | ||
default: 'none' | ||
}, { | ||
type: 'input', | ||
name: 'scope', | ||
message: 'What is the component name of this change (e.g. button, picker, style, util)? (press enter to skip)\n' | ||
message: 'What is the scope of this change (e.g. component or file name, button/uniapp): (press enter to skip)\n' | ||
}, { | ||
@@ -108,7 +120,13 @@ type: 'input', | ||
// parentheses are only needed when a scope is present | ||
var type = answers.type; | ||
var icon = types[answers.type].icon; | ||
icon = icon ? icon + ' ' : '' | ||
var package = answers.package !== 'none' ? answers.package : ''; | ||
var scope = answers.scope.trim(); | ||
scope = scope ? '(' + answers.scope.trim() + ')' : ''; | ||
scope = [package, scope].filter(t => !!t).join('/'); | ||
scope = scope ? `(${scope})` : ''; | ||
// Hard limit this line | ||
var head = (answers.type + scope + ': ' + answers.subject.trim()).slice(0, maxLineWidth); | ||
var head = (icon + type + scope + ': ' + answers.subject.trim()).slice(0, maxLineWidth); | ||
@@ -126,3 +144,3 @@ // Wrap these lines at 100 characters | ||
var footer = filter([ breaking, issues ]).join('\n\n'); | ||
commit(head + '\n\n' + body + '\n\n' + footer); | ||
@@ -129,0 +147,0 @@ }); |
@@ -7,3 +7,4 @@ "format cjs"; | ||
module.exports = engine({ | ||
types: conventionalCommitTypes.types | ||
types: conventionalCommitTypes.types, | ||
packages: conventionalCommitTypes.packages | ||
}); |
{ | ||
"name": "cz-mand-mobile-changelog", | ||
"version": "1.0.2", | ||
"version": "2.0.0", | ||
"description": "Commitizen adapter following the conventional-changelog format.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -5,37 +5,42 @@ { | ||
"description": "A new feature", | ||
"title": "Features" | ||
"title": "Features", | ||
"icon": "🎸" | ||
}, | ||
"fix": { | ||
"description": "A bug fix", | ||
"title": "Bug Fixes" | ||
"title": "Bug Fixes", | ||
"icon": "🐛" | ||
}, | ||
"chore": { | ||
"description": "Other changes that don't modify src or test files", | ||
"title": "Chores" | ||
"title": "Chores", | ||
"icon": "🤖" | ||
}, | ||
"refactor": { | ||
"description": "A code change that neither fixes a bug nor adds a feature", | ||
"title": "Code Refactoring" | ||
"title": "Code Refactoring", | ||
"icon": "💡" | ||
}, | ||
"code-style": { | ||
"description": "Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)", | ||
"title": "Code Styles" | ||
}, | ||
"doc": { | ||
"description": "Documentation only changes", | ||
"title": "Documentation" | ||
"title": "Documentation", | ||
"icon": "✏️ " | ||
}, | ||
"test": { | ||
"description": "Adding missing tests or correcting existing tests", | ||
"title": "Tests" | ||
"title": "Tests", | ||
"icon": "💍" | ||
}, | ||
"build": { | ||
"description": "Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)", | ||
"title": "Builds" | ||
}, | ||
"example": { | ||
"description": "Changes of examples or components' demos", | ||
"title": "Examples" | ||
"title": "Examples", | ||
"icon": "🍭" | ||
}, | ||
"code-style": { | ||
"description": "Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)", | ||
"title": "Code Styles", | ||
"icon": "💄" | ||
} | ||
} | ||
}, | ||
"packages": ["none", "components", "platform", "shared", "scroller", "builder"] | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7644
181