* refactor(cli.ts): call isHookCalled function asynchronously
feat(githook.ts): add support for git core hooks path and fallback to default symlink url if not found
feat(utils/git.ts): add getCoreHooksPath function to retrieve the path of the core hooks directory.
* refactor(githook.ts): remove console.log statement from hookCommand function
* feat(prepare-commit-msg-hook.ts): add isStageAllFlag parameter to prepareCommitMessageHook function to stage all changes if flag is true
* refactor(githook.ts): use path.join to join path segments instead of string concatenation
style(githook.ts): format code with prettier
Updated the Japanese translation for commit messages to reflect the changes made in the previous commit. The commitFix message now correctly states that the port variable was changed from lowercase 'port' to uppercase 'PORT'. The commitFeat message now correctly states that support for the 'process.env.PORT' environment variable was added. The commitDescription message explains that the use of the constant 'PORT' for the port variable provides consistency in naming conventions, and that the support for the 'process.env.PORT' environment variable allows the application to be more flexible and run on any available port specified by the environment variable.
* 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.