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

Commit

Permalink
beer: 🍻 move to ./themes/, no need for ./themes/default yet
Browse files Browse the repository at this point in the history
Also very sober just more testing of conventional-commits from gitmoji
  • Loading branch information
JeromeFitz committed Feb 28, 2021
1 parent f8ba905 commit 2227b00
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion lib/createState.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const createState = (config = {}) => {
// @todo _switch_ this up
if (state.config.theme && state.config.theme === 'gitmoji') {
// eslint-disable-next-line global-require
const {list, types} = require('./getGitmoji');
const {list, types} = require('./themes/gitmoji');
state.config.breakingChangePrefix = '💥️ ';
state.config.list = list;
state.config.types = types;
Expand Down
26 changes: 13 additions & 13 deletions lib/getGitmoji.js → lib/themes/gitmoji.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable object-property-newline */
// eslint-disable-next-line id-match
const _find = require('lodash/find');
const gitmojis = require('../data/gitmojis.json').gitmojis;
const items = require('../../data/gitmojis.json').gitmojis;

// @note pseudo-map to conventional-commits
const rewrites = [
Expand Down Expand Up @@ -87,27 +87,27 @@ const types = {
},
};

const getGitmoji = async () => {
const gitmoji = async () => {
// eslint-disable-next-line array-callback-return
await gitmojis.map((gitmoji) => {
const rewrite = _find(rewrites, {from: gitmoji.name});
await items.map((item) => {
const rewrite = _find(rewrites, {from: item.name});
list.push(rewrite.to);
types[rewrite.to] = {
code: gitmoji.code,
description: gitmoji.description,
emoji: gitmoji.emoji,
entity: gitmoji.entity,
code: item.code,
description: item.description,
emoji: item.emoji,
entity: item.entity,
hidden: false,
name: gitmoji.name,
release: gitmoji.semver || null,
section: gitmoji.description,
semver: gitmoji.semver,
name: item.name,
release: item.semver || null,
section: item.description,
semver: item.semver,
value: rewrite.to,
};
});
};

getGitmoji();
gitmoji();

module.exports = {
list,
Expand Down

0 comments on commit 2227b00

Please sign in to comment.