Skip to content
This repository has been archived by the owner on Jun 16, 2021. It is now read-only.

Commit

Permalink
fix: 🐛 hack for gitflow branch to be feature
Browse files Browse the repository at this point in the history
refactor: ♻️ ensure branch name is lowercase

refactor: ♻️ alter branchType to go off of `gitflow`

Instead of attempting to mutate these objects and re-use value, just use
the key/value pairs for what they are.
  • Loading branch information
JeromeFitz authored and kodiakhq[bot] committed Apr 21, 2021
1 parent 7a4fbe0 commit 0fa817e
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 28 deletions.
2 changes: 1 addition & 1 deletion data/gitmoji/index.json

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions data/gitmoji/init.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"semver": "patch"
},
{
"emoji": "🚑",
"emoji": "🚑",
"entity": "🚑",
"code": ":ambulance:",
"description": "Critical hotfix.",
Expand Down Expand Up @@ -89,7 +89,7 @@
"semver": null
},
{
"emoji": "🔒",
"emoji": "🔒",
"entity": "🔒",
"code": ":lock:",
"description": "Fix security issues.",
Expand Down Expand Up @@ -233,7 +233,7 @@
"semver": null
},
{
"emoji": "",
"emoji": "",
"entity": "⏪",
"code": ":rewind:",
"description": "Revert changes.",
Expand All @@ -249,15 +249,15 @@
"semver": null
},
{
"emoji": "📦",
"emoji": "📦",
"entity": "&#1F4E6;",
"code": ":package:",
"description": "Add or update compiled files or packages.",
"name": "package",
"semver": "patch"
},
{
"emoji": "👽",
"emoji": "👽",
"entity": "&#1F47D;",
"code": ":alien:",
"description": "Update code due to external API changes.",
Expand Down Expand Up @@ -329,7 +329,7 @@
"semver": "patch"
},
{
"emoji": "🗃",
"emoji": "🗃",
"entity": "🗃",
"code": ":card_file_box:",
"description": "Perform database related changes.",
Expand Down Expand Up @@ -369,7 +369,7 @@
"semver": "patch"
},
{
"emoji": "🏗",
"emoji": "🏗",
"entity": "&#1f3d7;",
"code": ":building_construction:",
"description": "Make architectural changes.",
Expand Down Expand Up @@ -417,15 +417,15 @@
"semver": null
},
{
"emoji": "",
"emoji": "",
"entity": "📸",
"code": ":alembic:",
"description": "Perform experiments.",
"name": "alembic",
"semver": "patch"
},
{
"emoji": "🔍",
"emoji": "🔍",
"entity": "🔍",
"code": ":mag:",
"description": "Improve SEO.",
Expand Down Expand Up @@ -473,7 +473,7 @@
"semver": "patch"
},
{
"emoji": "🗑",
"emoji": "🗑",
"entity": "🗑",
"code": ":wastebasket:",
"description": "Deprecate code that needs to be cleaned up.",
Expand Down
3 changes: 2 additions & 1 deletion lib/createBranch.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ const formatBranchName = (state) => {
.replace(
/\{branchType\}/g,
Boolean(branchPrefix) ? branchType + (formatLength > 1 ? '/' : '') : '',
);
)
.toLowerCase();

// const branchName = getBranchName().split('/').slice(-1)[0];
// const scope = answers.scope ? '(' + answers.scope.trim() + ')' : '';
Expand Down
6 changes: 3 additions & 3 deletions lib/questions/branchType.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
const fuzzy = require('fuzzy');

const typeToListItem = ({branchTypes, disableEmoji}, type) => {
const {description, emoji, value} = branchTypes[type];
const {description, emoji, gitflow} = branchTypes[type];
const prefix = emoji && !disableEmoji ? emoji + ' ' : '';

return {
name: prefix + (value + ':').padEnd(12, ' ') + description,
value,
name: prefix + (gitflow + ':').padEnd(12, ' ') + description,
value: gitflow,
};
};

Expand Down
37 changes: 25 additions & 12 deletions lib/themes/gitmoji.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,23 @@ module.exports = {
semver: 'minor',
value: 'feat',
},
fix: {
code: ':bug:',
description: 'Fix a bug.',
emoji: '🐛',
entity: '🐛',
gitflow: 'fix',
hidden: false,
name: 'bug',
release: 'patch',
section: 'Fix a bug.',
semver: 'patch',
value: 'fix',
},
hotfix: {
code: ':ambulance:',
description: 'Critical hotfix.',
emoji: '🚑',
emoji: '🚑',
entity: '🚑',
gitflow: 'hotfix',
hidden: false,
Expand Down Expand Up @@ -152,7 +165,7 @@ module.exports = {
arch: {
code: ':building_construction:',
description: 'Make architectural changes.',
emoji: '🏗',
emoji: '🏗',
entity: '&#1f3d7;',
gitflow: false,
hidden: false,
Expand Down Expand Up @@ -256,7 +269,7 @@ module.exports = {
clean: {
code: ':wastebasket:',
description: 'Deprecate code that needs to be cleaned up.',
emoji: '🗑',
emoji: '🗑',
entity: '🗑',
gitflow: false,
hidden: false,
Expand All @@ -269,7 +282,7 @@ module.exports = {
compat: {
code: ':alien:',
description: 'Update code due to external API changes.',
emoji: '👽',
emoji: '👽',
entity: '&#1F47D;',
gitflow: false,
hidden: false,
Expand Down Expand Up @@ -321,7 +334,7 @@ module.exports = {
db: {
code: ':card_file_box:',
description: 'Perform database related changes.',
emoji: '🗃',
emoji: '🗃',
entity: '🗃',
gitflow: false,
hidden: false,
Expand Down Expand Up @@ -360,7 +373,7 @@ module.exports = {
'dep-up': {
code: ':package:',
description: 'Add or update compiled files or packages.',
emoji: '📦',
emoji: '📦',
entity: '&#1F4E6;',
gitflow: false,
hidden: false,
Expand Down Expand Up @@ -438,7 +451,7 @@ module.exports = {
experiment: {
code: ':alembic:',
description: 'Perform experiments.',
emoji: '⚗',
emoji: '⚗',
entity: '📸',
gitflow: false,
hidden: false,
Expand Down Expand Up @@ -466,7 +479,7 @@ module.exports = {
description: 'Fix a bug.',
emoji: '🐛',
entity: '🐛',
gitflow: false,
gitflow: 'fix',
hidden: false,
name: 'bug',
release: 'patch',
Expand Down Expand Up @@ -503,7 +516,7 @@ module.exports = {
hotfix: {
code: ':ambulance:',
description: 'Critical hotfix.',
emoji: '🚑',
emoji: '🚑',
entity: '🚑',
gitflow: 'hotfix',
hidden: false,
Expand Down Expand Up @@ -750,7 +763,7 @@ module.exports = {
revert: {
code: ':rewind:',
description: 'Revert changes.',
emoji: '⏪',
emoji: '⏪',
entity: '⏪',
gitflow: false,
hidden: false,
Expand Down Expand Up @@ -789,7 +802,7 @@ module.exports = {
security: {
code: ':lock:',
description: 'Fix security issues.',
emoji: '🔒',
emoji: '🔒',
entity: '🔒',
gitflow: false,
hidden: false,
Expand All @@ -815,7 +828,7 @@ module.exports = {
seo: {
code: ':mag:',
description: 'Improve SEO.',
emoji: '🔍',
emoji: '🔍',
entity: '🔍',
gitflow: false,
hidden: false,
Expand Down
2 changes: 1 addition & 1 deletion scripts/gitmoji/gitmojiRewrite.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const rewrites = [
{from: 'art', to: 'style'},
{from: 'zap', to: 'perf'},
{from: 'fire', to: 'prune'},
{from: 'bug', to: 'fix'},
{from: 'bug', to: 'fix', gitflow: 'fix'},
{from: 'ambulance', to: 'hotfix', gitflow: 'hotfix'},
{from: 'sparkles', to: 'feat', gitflow: 'feature'},
{from: 'memo', to: 'docs'},
Expand Down

0 comments on commit 0fa817e

Please sign in to comment.