* chore(package.json): add `--tag latest` flag to `npm publish` command in `deploy` script
* refactor(cli.ts): add async/await to `prepareCommitMessageHook` and `commit` functions, and check for new version of `opencommit` after commit is made
* chore(TODO.md): set prepare-commit-msg hook
* chore(cli.ts): remove async/await from commit and prepareCommitMessageHook calls
* feat(cli.ts): add check for new version available after commit
* refactor(api.ts): use CONFIG_MODES enum from config.ts
* refactor(config.ts): use COMMANDS and CONFIG_MODES enums, extract validateConfig function
* feat(config.ts): add CONFIG_MODES enum and refactor configCommand function to use it
* refactor(githook.ts): import COMMANDS enum from CommandsEnum.js file
* chore(README.md): update OPENAI_API_KEY config key to use 'your_api_key' instead of 'your token'
* chore(README.md): update description of where the api key is stored
* feat(commit.ts): add spinner to show progress of `git push` command
* feat(commit.ts): show success message after successful `git push` command execution
* 🐛 fix(generateCommitMessageFromGitDiff.ts): remove unnecessary separator variable
* 🐛 fix: split file diffs by files
* ✨ feat: add support for generating commit messages by file diffs
* ✨ feat(generateCommitMessageFromGitDiff.ts): add mergeStrings utility function to merge string arrays
* 🐛 fix(generateCommitMessageFromGitDiff.ts): reduce MAX_REQ_TOKENS to 1000
* ✨ feat(generateCommitMessageFromGitDiff.ts): add support for generating commit messages for large diffs by splitting them into smaller chunks and generating commit messages for each chunk using OpenAI's GPT-3 model.
* ♻️ refactor: extract getCommitMsgsPromisesFromFileDiffs function from generateCommitMessage function
* ♻️ refactor: extract getMessagesPromisesByLines function from getCommitMsgsPromisesFromFileDiffs function
* ✨ feat: add support for merging file diffs into one commit message if it exceeds MAX_REQ_TOKENS limit
* ✨ feat(mergeStrings.ts): add mergeStrings function to merge strings in an array based on maxStringLength
* 🚀 chore(generateCommitMessageFromGitDiff.ts): filter out null promises and update TODO comment
* 🚀 chore(tsconfig.json): update target to ES2020 and remove ES5 from lib
The assert statement was added to ensure that the imported packageJSON is of type JSON. This prevents any potential runtime errors that may occur if the imported file is not of the expected type.
* 🐛 fix(generateCommitMessageFromGitDiff.ts): adjust MAX_REQ_TOKENS to account for INIT_MESSAGES_PROMPT_LENGTH
* 💄 style(generateCommitMessageFromGitDiff.ts): remove unnecessary separator variable
The MAX_REQ_TOKENS constant was not accounting for the length of the INIT_MESSAGES_PROMPT, which caused the function to fail when the diff length was close to the limit. This has been fixed by adjusting the constant to include the prompt length. The separator variable was not being used and has been removed for clarity.
* 🚀 chore(tsconfig.json): update compiler options
The target compiler option has been updated to ESNext to allow for the use of the latest ECMAScript features. The lib compiler option has been updated to include ES6 in addition to ES5. The module compiler option has been updated to ESNext to allow for the use of the latest module syntax.
The console.log statement is removed as it is not needed. A TODO comment is added to remind the developer to change the code to read file and write file with commitMessage.