Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: ✨ add conventional commits, and gitmoji cli flags #163

Closed
wants to merge 35 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
f41f2ca
feat: WIP
ThijSlim Mar 16, 2023
b7f4e8c
feat: enable conventional commits standard as configuration option
ThijSlim Mar 17, 2023
6dac8fa
refactor: use a different way of adding conventional commits to the s…
ThijSlim Mar 18, 2023
43f5ee5
test: make sure that tests run independant of eachother
ThijSlim Mar 18, 2023
ee63321
test: remove duplication and noise from tests
ThijSlim Mar 18, 2023
7285399
test: grouping of related function calls
ThijSlim Mar 18, 2023
3fd4ddd
feat: Make conventional commits more context aware
ThijSlim Mar 18, 2023
89385e8
feat: make conventional commits even more context away based on a Med…
ThijSlim Mar 18, 2023
3e41b75
test: add test for not translating conventional commit to locale
ThijSlim Mar 18, 2023
94eab2b
feat: 🎉 add gitmoji as config setting
ThijSlim Mar 18, 2023
8f21a57
🔧 build: Add support for Gitmoji and Conventional CommitsThis commit …
NorkzYT Mar 20, 2023
b7563d1
🔧 build: add support for gitmoji and conventional commit options in a…
NorkzYT Mar 20, 2023
1b4eda5
🔧 build: refactor openai.ts to change the order of commit format parts
NorkzYT Mar 20, 2023
1d913fa
🐛 fix: Remove unnecessary whitespace in commit message prompt
NorkzYT Mar 20, 2023
e3858fe
🔧 chore: increase timeout to 20s
NorkzYT Mar 20, 2023
313034a
style: 💄 Use single quotes for strings in .editorconfig
NorkzYT Mar 20, 2023
03de3e0
feat: ✨ Add function to retrieve gitmojis
NorkzYT Mar 20, 2023
a26f2f0
chore: ⚙️ Update httpsPost timeout and add new gitmoji to prompt
NorkzYT Mar 20, 2023
9be263d
chore: 🚧 Update openai.ts file
ThijSlim Mar 21, 2023
a4ec849
refactor(openai.ts): ♻️ Update getExtraContextForConventionalCommits …
ThijSlim Mar 21, 2023
99cdd5b
change(utils/openai.ts): 🎨 Generate multiple commit messages}
ThijSlim Mar 22, 2023
27ca7b2
feat: use the openai npm package to do the completion api call and us…
ThijSlim Mar 22, 2023
3aa82e5
fix: 🐛 Fix Gitmoji API connection error}
ThijSlim Mar 22, 2023
53430f6
refactor: openai.ts 🔧}
ThijSlim Mar 22, 2023
6d8404c
fix: fix typo in AI commit messages
ThijSlim Mar 22, 2023
0f13c97
refactor: 🔧 Update getCommitTitleFormatPrompt in openai.ts
ThijSlim Mar 22, 2023
9211252
docs: 📝 Update aicommits README
ThijSlim Mar 22, 2023
5c3ebf2
refactor: ✨ Improve wording in conventional commit descriptions
ThijSlim Mar 22, 2023
e414cff
refactor(tests): 🔧 Rename test files
ThijSlim Mar 22, 2023
9182111
Generate openai tests with diff being generated by AI
ThijSlim Mar 22, 2023
a86fbbf
test: Add test case for generateCommitMessage function
ThijSlim Mar 22, 2023
f5ba38b
test: Should use "test:" conventional commit when change relate to te…
ThijSlim Mar 23, 2023
1fecc55
feat: use vitest for testing which enables concurrent running of tests
ThijSlim Mar 23, 2023
d1c8550
refactor: ♻️ Update test timeout
ThijSlim Mar 23, 2023
decdb10
test: add README for generating git diffs for testing
ThijSlim Mar 23, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
quote_type = single

[*.yml]
indent_style = space
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"typescript.tsdk": "node_modules/typescript/lib"
}
}
49 changes: 48 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,53 @@ aicommits --dry-run

> 👉 **Tip:** Use the `aic` alias if `aicommits` is too long for you.

### Flags

#### `--generate <number>` (or `--g <number>`)

Generate multiple commit messages at once.

```sh
aicommits --generate 3
```

#### `--gitmoji` (or `--m`)

(Experimental) Generate a commit message with a gitmoji: https://gitmoji.dev/.

```sh
aicommits --gitmoji
aicommits --m
```

#### `--conventional` (or `--c`)

(Experimental) Generate a commit message based on the conventional commit standard: https://www.conventionalcommits.org/en/v1.0.0/.

```sh
aicommits --conventional
aicommits --c
```

### Combine flags

You can combine flags to generate a commit message with a gitmoji and a conventional commit.

```sh
aicommits --gitmoji --conventional --generate 3
aicommits --m --c --g 3
```

### Configure default flags

You can configure default flags to be used every time you run `aicommits` by running:


```sh
aicommits config set gitmoji=true
aicommits config set conventional=true
```

### Git hook

You can also integrate _aicommits_ with Git via the [`prepare-commit-msg`](https://git-scm.com/docs/githooks#_prepare_commit_msg) hook. This lets you use Git like you normally would, and edit the commit message before committing.
Expand Down Expand Up @@ -125,4 +172,4 @@ Video coming soon where I rebuild it from scratch to show you how to easily buil

## Contributing

If you want to help fix a bug or implement a feature in [Issues](https://github.com/Nutlope/aicommits/issues), checkout the [Contribution Guide](CONTRIBUTING.md) to learn how to setup and test the project.
If you want to help fix a bug or implement a feature in [Issues](https://github.com/Nutlope/aicommits/issues), checkout the [Contribution Guide](CONTRIBUTING.md) to learn how to setup and test the project.
9 changes: 3 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"build": "pkgroll --minify",
"lint": "eslint --cache .",
"type-check": "tsc",
"test": "tsx tests",
"test": "vitest",
"prepack": "pnpm build && clean-pkg-json"
},
"simple-git-hooks": {
Expand All @@ -32,9 +32,6 @@
"lint-staged": {
"*.ts": "eslint --cache"
},
"dependencies": {
"@dqbd/tiktoken": "^0.4.0"
},
"devDependencies": {
"@clack/prompts": "^0.6.1",
"@pvtnbr/eslint-config": "^0.33.0",
Expand All @@ -49,12 +46,12 @@
"ini": "^3.0.1",
"kolorist": "^1.7.0",
"lint-staged": "^13.1.2",
"manten": "^0.7.0",
"openai": "^3.2.1",
"pkgroll": "^1.9.0",
"simple-git-hooks": "^2.8.1",
"tsx": "^3.12.3",
"typescript": "^4.9.5"
"typescript": "^4.9.5",
"vitest": "^0.29.7"
},
"eslintConfig": {
"extends": "@pvtnbr",
Expand Down
Loading