* feat(i18n): add support for Dutch language (nl) and translations for commit messages in Dutch
* chore(i18n): update Dutch translation of commit messages in nl.json file
---------
Co-authored-by: Jeroen Smink [TRES] <jeroensmink@TRES.local>
Co-authored-by: Sukharev <57486732+di-sukharev@users.noreply.github.com>
* fix(githook.ts): fix SYMLINK_URL for Windows
* refactor(githook.ts): use path.join to create SYMLINK_URL
The SYMLINK_URL variable is now created using the path.join method, which is more platform-independent and ensures that the correct path separator is used. This improves the reliability of the code and makes it easier to maintain.
---------
Co-authored-by: Maik Stegemann <ms@lis-gmbh.com>
The import statement for the fileURLToPath function from the url module is not used in the file. Therefore, it has been removed to improve code readability and maintainability.
The conditional statements in the prepareCommitMessageHook function have been simplified to improve readability. The first conditional statement now checks if there are no staged files and no changed files, and if so, it will output a message and exit the process. The second conditional statement now checks if there are no staged files but there are changed files, and if so, it will add the changed files to the staging area.
chore(tsconfig.json): change target to ESNext
The @dqbd/tiktoken dependency was removed from the package.json file. This dependency was not being used in the project and was therefore removed to reduce the size of the project. The target in the tsconfig.json file was changed from ES2020 to ESNext to allow for the use of the latest ECMAScript features.
chore(githook.ts): remove unused import
refactor(tokenCount.ts): simplify token count calculation
The console output now correctly capitalizes OpenCommit for consistency with the project name. The unused import of fileURLToPath is removed. The tokenCount function is refactored to simplify the calculation of the token count. The Tiktoken library is no longer used, and the token count is now calculated based on the length of the content divided by an average token length of 2.7 characters.
The code has been reformatted to use consistent indentation and quotes. This improves the readability and maintainability of the code. No functionality has been changed.
feat(generateCommitMessageFromGitDiff.ts): split file diffs into changes in files if they exceed the maximum token count
The mergeStrings function was renamed to mergeDiffs to better reflect its purpose. The function now takes an additional parameter, maxDiffLength, which is used to split file diffs into changes in files if they exceed the maximum token count. This change improves the efficiency of the function and reduces the number of tokens used.
fix(prepare-commit-msg-hook.ts): add missing await keyword to getStagedFiles() function call
feat(prepare-commit-msg-hook.ts): add spinner to indicate commit message generation progress
feat(utils/mergeDiffs.ts): add mergeDiffs function to merge array of strings into an array of strings with a maximum length
The test.ts file is now ignored by git. The missing await keyword has been added to the getStagedFiles() function call. A spinner has been added to indicate the progress of commit message generation. The mergeDiffs function has been added to merge an array of strings into an array of strings with a maximum length.
* 1.1.23
* 1.1.24
* feat(package.json): add @dqbd/tiktoken dependency
refactor(generateCommitMessageFromGitDiff.ts): add tokenCount function to count the number of tokens in a string
refactor(generateCommitMessageFromGitDiff.ts): change the way the length of INIT_MESSAGES_PROMPT is calculated to use tokenCount function
refactor(generateCommitMessageFromGitDiff.ts): change the way the length of diff is calculated to use tokenCount function
refactor(generateCommitMessageFromGitDiff.ts): rename function parameter from diff to fileDiff and update function calls accordingly
feat(generateCommitMessageFromGitDiff.ts): add tokenCount function to count tokens in fileDiff and use it to check if fileDiff is bigger than MAX_REQ_TOKENS
feat(utils): add tokenCount function to count the number of tokens in a string
refactor(utils/mergeStrings.ts): use tokenCount function to count the number of tokens in a string instead of checking the length of the concatenated string
---------
Co-authored-by: di-sukharev <dim.sukharev@gmail.com>
🐛 fix(config.ts): add missing new lines
🐛 fix(githook.ts): capitalize OpenCommit and fix grammar
The COMMANDS enum values were reordered to improve readability and consistency. In config.ts, missing new lines were added to improve code readability. In githook.ts, OpenCommit was capitalized and grammar was fixed to improve clarity.
feat(commit.ts): add support for pushing to selected remote instead of default remote
refactor(commit.ts): extract push command to a function and reuse it for both default and selected remote
* 🐛 fix(commit.ts): add --verbose flag to git push command
The --verbose flag is added to the git push command to provide more detailed output. This helps with debugging and identifying any issues that may arise during the push process.
The function getStagedFiles has been refactored to use git rev-parse to
get the root directory of the repository. This improves the reliability
of the function as it will work regardless of the current working
directory. The root directory is then passed to the git diff command to
get the list of staged files. With only the --relative flag, staged
diff(s) on files in a different same level directory as the current
working one would not be found by the command.