-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 801fc72
Showing
14 changed files
with
418 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: write | ||
issues: write | ||
pull-requests: write | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: "lts/*" | ||
- id: setup-bun | ||
name: Setup Bun | ||
uses: oven-sh/setup-bun@v1 | ||
with: | ||
bun-version: latest | ||
- run: bun install | ||
- run: bun run build | ||
- name: Release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
run: npx semantic-release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.DS_Store | ||
*.log | ||
node_modules/ | ||
dist/ | ||
bin/ | ||
|
||
# VS Code settings | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"branches": [ | ||
"main" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2024 Adavize Hassan | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# gitmo | ||
|
||
> A cli tool that adds appropriate emoji to your commit messages based on conventional commits specification | ||
## About | ||
|
||
This cli was built as a simpler alternative to [gitmoji-cli](https://github.com/carloscuesta/gitmoji-cli). There is no step to pick an emoji, we simply determine the appropriate emoji to use based on your commit message and include it in your message | ||
|
||
## Install | ||
|
||
### npm | ||
|
||
```bash | ||
npm i -g gitmo | ||
``` | ||
|
||
## Usage | ||
|
||
```bash | ||
gitmo --help | ||
``` | ||
|
||
``` | ||
An cli tool that adds appropriate emoji | ||
to your commit message based on conventional commits specification | ||
Usage | ||
$ gitmo [option] [command] | ||
Options | ||
--commit, -c Add commit using the gitmo | ||
--version, -v Print current installed version | ||
--update, -u Update gitmo cli | ||
Examples | ||
$ gitmo -c | ||
``` | ||
|
||
## How to commit | ||
|
||
```bash | ||
# Note: This should be done after staging your changes | ||
gitmo -c | ||
``` | ||
|
||
You get this prompt: | ||
|
||
``` | ||
? commit message › ENTER COMMIT MESSAGE HERE | ||
``` | ||
|
||
--- | ||
|
||
### Resources used | ||
|
||
- [Conventional commit types](https://github.com/pvdlg/conventional-commit-types) | ||
- [gitmoji-cli](https://github.com/carloscuesta/gitmoji-cli) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
await Bun.build({ | ||
target: 'node', | ||
entrypoints: ['./src/cli.ts'], | ||
outdir: './dist', | ||
minify: true, | ||
external: ['shelljs'], | ||
}) |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"compilerOptions": { | ||
"baseUrl": ".", | ||
"paths": { | ||
"@/*": ["./src/*"] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"name": "gitmo", | ||
"version": "1.0.0", | ||
"description": "An cli tool that adds appropriate emoji to your commit message based on conventional commits specification", | ||
"bin": { | ||
"gitmo": "dist/cli.js" | ||
}, | ||
"type": "module", | ||
"scripts": { | ||
"build": "bun run build.mjs", | ||
"prepublishOnly": "bun run build", | ||
"clean": "rm -rf dist" | ||
}, | ||
"engines": { | ||
"node": ">=18" | ||
}, | ||
"files": [ | ||
"dist" | ||
], | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/ize-302/gitmo.git" | ||
}, | ||
"keywords": [ | ||
"emoji", | ||
"conventional commit" | ||
], | ||
"author": { | ||
"name": "ize-302", | ||
"email": "[email protected]", | ||
"url": "https://ize-302.dev" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/ize-302/gitmo/issues" | ||
}, | ||
"homepage": "https://github.com/ize-302/gitmo", | ||
"dependencies": { | ||
"meow": "^13.2.0", | ||
"prompts": "^2.4.2", | ||
"shelljs": "^0.8.5" | ||
}, | ||
"devDependencies": { | ||
"@types/bun": "latest", | ||
"@types/prompts": "^2.4.9", | ||
"@types/shelljs": "^0.8.15", | ||
"typescript": "^5.6.2" | ||
}, | ||
"module": "index.ts" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env node | ||
import meow from "meow"; | ||
import FLAGS from "@/constants/flags.js"; | ||
import { handleCommand } from "@/utils/handleCommand.js"; | ||
|
||
const cli = meow( | ||
` | ||
Usage | ||
$ gitmo [option] [command] | ||
Options | ||
--${FLAGS.COMMIT}, -c Add commit using the gitmo | ||
--${FLAGS.VERSION}, -v Print current installed version | ||
--${FLAGS.UPDATE}, -u Update gitmo cli | ||
Examples | ||
$ gitmo -c | ||
`, | ||
{ | ||
importMeta: import.meta, | ||
flags: { | ||
[FLAGS.COMMIT]: { type: "boolean", shortFlag: "c" }, | ||
[FLAGS.HELP]: { type: "boolean", shortFlag: "h" }, | ||
[FLAGS.UPDATE]: { type: "boolean", shortFlag: "u" }, | ||
[FLAGS.VERSION]: { type: "boolean", shortFlag: "v" }, | ||
}, | ||
} | ||
); | ||
|
||
handleCommand(cli); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
[ | ||
{ | ||
"name": "feat", | ||
"emoji": "✨", | ||
"description": "A new feature" | ||
}, | ||
{ | ||
"name": "fix", | ||
"emoji": "🐛", | ||
"description": "A bug Fix" | ||
}, | ||
{ | ||
"name": "docs", | ||
"emoji": "📚", | ||
"description": "Documentation only changes" | ||
}, | ||
{ | ||
"name": "style", | ||
"emoji": "💄", | ||
"description": "Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)" | ||
}, | ||
{ | ||
"name": "refactor", | ||
"emoji": "📦", | ||
"description": "A code change that neither fixes a bug nor adds a feature" | ||
}, | ||
{ | ||
"name": "perf", | ||
"emoji": "🚀", | ||
"description": "A code change that improves performance" | ||
}, | ||
{ | ||
"name": "test", | ||
"emoji": "🚨", | ||
"description": "Adding missing tests or correcting existing tests" | ||
}, | ||
{ | ||
"name": "ci", | ||
"emoji": "⚙️", | ||
"description": "Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)" | ||
}, | ||
{ | ||
"name": "build", | ||
"emoji": "🛠", | ||
"description": "Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)" | ||
}, | ||
{ | ||
"name": "chore", | ||
"emoji": "♻️", | ||
"description": "Other changes that don't modify src or test files" | ||
}, | ||
{ | ||
"name": "revert", | ||
"emoji": "🗑", | ||
"description": "Reverts a previous commit" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const FLAGS = Object.freeze({ | ||
COMMIT: 'commit', | ||
HELP: 'help', | ||
UPDATE: 'update', | ||
VERSION: 'version', | ||
}) | ||
|
||
export default FLAGS |
Oops, something went wrong.