๐ŸŽฉ You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP โ†’
Sign In

gimmit

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gimmit - npm Package Compare versions

Comparing version
0.0.7
to
0.0.8
+0
-4
config.js
exports.options = [
{
label: 'Random',
emoji: '๐Ÿ”€',
},
{
label: 'New beginnings',

@@ -8,0 +4,0 @@ emoji: '๐ŸŒˆ',

+40
-2

@@ -5,7 +5,45 @@ const Git = require('simple-git')();

const random = require('random');
const fs = require('fs');
let options = [
{
label: 'Random',
emoji: '๐Ÿ”€',
},
];
let emojiPool = config.emojiPool;
try {
if (fs.existsSync('.gimmitrc.json')) {
const customConfig = JSON.parse(fs.readFileSync('.gimmitrc.json', 'utf8'));
if (customConfig.options) {
options = [
...options,
...customConfig.options,
].map((option, index) => {
const key = index === 0 ? 'Key ' : '';
return {
...option,
label: `${option.label} [${key}${index}]`,
};
});
}
if (customConfig.emojiPool) {
if (customConfig.emojiPool.length < 2) {
throw 'Your custom emoji pool for random option length is less than 2. Please add more.';
}
emojiPool = customConfig.emojiPool;
}
}
} catch (err) {
console.error(err);
}
const promptSelectType = new Select({
name: 'type',
message: 'Select commit flavor',
choices: config.options.map(option => {
choices: options.map(option => {
return `${option.emoji} ${option.label}`;

@@ -17,3 +55,3 @@ }),

const randIndex = random.int(0, config.emojiPool.length);
return config.emojiPool[randIndex];
return emojiPool[randIndex];
};

@@ -20,0 +58,0 @@

{
"name": "gimmit",
"version": "0.0.7",
"version": "0.0.8",
"description": "Git commit but cuter",

@@ -28,2 +28,3 @@ "main": "gimmit.js",

"enquirer": "^2.3.2",
"fs": "^0.0.1-security",
"random": "^2.1.1",

@@ -30,0 +31,0 @@ "simple-git": "^1.128.0"

@@ -20,12 +20,59 @@ # Gimmit

Simply install globally via `npm instal -g gimmit` or `yarn global add gimmit`.
Assuming you already have `git` cli installed on your machine: simply install globally via `npm instal -g gimmit` or `yarn global add gimmit`.
Once installed, You can now simply type `gimmit` when you want to make a commit to your repo and just follow the prompts.
## Custom configuration
Just make a `.gimmitrc.json` in your root directory.
You can pass in your own options for both `commit flavors` and the `pool` of emoji the random function selects from.
*Note:* The random option is always the first option even though you pass in your own set.
```json
// .gimmitrc.json
{
"options": [
{
"label": "Custom option",
"emoji": "๐Ÿฆ„"
}
],
"emojiPool": [
"๐Ÿ™",
"๐ŸŒป"
]
}
```
You can have fun with this! You can replace the `emoji` with anything: say, you want to have consistent "labeled" commits in your team, or just for yourself, then you can do something like:
```json
// .gimmitrc.json
{
"options": [
{
"label": "Visual Design",
"emoji": "[VISUAL]"
}, {
"label": "Final final",
"emoji": "[FINALFINALv3]",
}
],
"emojiPool": [
"[I ATE BANANA]",
"[GIMME BURGER]"
]
}
```
Have fun!
## Plans
- Override configuration and customize the selects via a .gimmitconfig
- Add the possibility for validations for commit messages
- [x] Override configuration and customize the selects via a .gimmitconfig
- [ ] Add the possibility for validations for commit messages
### P.S.
Peace and love ๐Ÿ’–