163 Commits

Author SHA1 Message Date
di-sukharev
af457473be 1.1.38 v1.1.38 2023-04-01 13:24:33 +08:00
di-sukharev
33b418e399 1.1.37 v1.1.37 2023-04-01 13:24:28 +08:00
di-sukharev
7e5ed6de0b refactor(commit.ts): add push command when no remotes are found
refactor(githook.ts): simplify switch statement by removing comments and adding inline comments
2023-04-01 13:24:15 +08:00
di-sukharev
e2f68b7256 refactor(githook.ts): replace comments with line breaks for switch cases in platform switch statement 2023-03-30 19:53:14 +08:00
di-sukharev
eacc750952 1.1.36 v1.1.36 2023-03-30 15:15:03 +08:00
di-sukharev
3fe57537ad 1.1.35 v1.1.35 2023-03-30 15:15:00 +08:00
di-sukharev
db9cff1ae1 refactor(githook.ts): add switch statement to determine path separator based on platform
fix(githook.ts): change path separator to use the determined separator variable
2023-03-30 15:14:43 +08:00
di-sukharev
1c29b91408 1.1.34 v1.1.34 2023-03-30 15:01:20 +08:00
di-sukharev
425eeef732 1.1.33 v1.1.33 2023-03-30 15:01:15 +08:00
di-sukharev
52c396eb16 feat(commit.ts): add support for aborting git push command if user chooses to do so 2023-03-30 15:00:46 +08:00
di-sukharev
f5bcf58f7b refactor(commit.ts): replace filter callback with Boolean function call
docs(commit.ts): remove unnecessary empty line
2023-03-30 14:57:22 +08:00
di-sukharev
4b53a08653 refactor(git.ts): change double quotes to single quotes in git commands and remove unnecessary whitespace 2023-03-30 14:53:18 +08:00
di-sukharev
95d3d8b6c9 chore(commit.ts, es_ES.json, id_ID.json, index.ts): remove unnecessary comments and fix typos in commit messages and translations 2023-03-30 14:52:01 +08:00
kakandavorever
2c79bf22df Add support for indonesia language (id_ID) (#94)
* Add support for indonesia language (id_ID)
2023-03-30 14:47:57 +08:00
Jeroen Smink
e8c1a75a46 Feat(i18n): Add Dutch translations (#85)
* 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>
2023-03-30 14:43:12 +08:00
Maik Stegemann
5d064ac873 fix(githook.ts): fix SYMLINK_URL for Windows (#88)
* 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>
2023-03-30 14:42:02 +08:00
Alex Cáceres Gómez
8d01829a9b 🔥 refactor(githook.ts): remove unused import (#93)
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.
2023-03-30 14:41:08 +08:00
di-sukharev
e9c66ae168 1.1.32 v1.1.32 2023-03-29 18:24:18 +08:00
di-sukharev
18b0004b81 1.1.31 v1.1.31 2023-03-29 18:24:14 +08:00
di-sukharev
4d4157087e Merge branch 'dev' of github.com:di-sukharev/opencommit into dev 2023-03-29 18:23:46 +08:00
di-sukharev
3edb6e2fc1 chore(generateCommitMessageFromGitDiff.ts): fix typo in GitMoji convention 2023-03-29 18:23:25 +08:00
Andrew
d428102a67 [FEAT](i18n): Add support for Russian language (ru) (#75) 2023-03-29 14:11:18 +08:00
di-sukharev
9404f5d410 1.1.30 v1.1.30 2023-03-29 11:31:38 +08:00
di-sukharev
8c1eb4a5ad 1.1.29 v1.1.29 2023-03-29 11:31:35 +08:00
di-sukharev
bafe7e9ede refactor(prepare-commit-msg-hook.ts): simplify conditional statements
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.
2023-03-29 11:31:27 +08:00
di-sukharev
a4716b35a4 1.1.28 v1.1.28 2023-03-29 11:26:59 +08:00
di-sukharev
c1e9062ce0 1.1.27 v1.1.27 2023-03-29 11:26:51 +08:00
di-sukharev
c7efa6f935 refactor: remove @dqbd/tiktoken dependency
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.
2023-03-29 11:26:19 +08:00
di-sukharev
1b70de1d20 fix(githook.ts): capitalize OpenCommit in console output
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.
2023-03-29 11:26:05 +08:00
di-sukharev
853662acc4 refactor(tokenCount.ts): format code with consistent indentation and quotes
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.
2023-03-29 11:25:48 +08:00
di-sukharev
0e1ad33179 1.1.26 v1.1.26 2023-03-29 10:45:35 +08:00
di-sukharev
e7eaa5425e 1.1.25 v1.1.25 2023-03-29 10:45:30 +08:00
di-sukharev
4b96670374 Merge branch 'dev' 2023-03-29 10:45:17 +08:00
di-sukharev
e128cdece1 refactor(generateCommitMessageFromGitDiff.ts): rename mergeStrings to mergeDiffs and add maxDiffLength parameter
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.
2023-03-29 10:44:45 +08:00
di-sukharev
4cc73208cd chore(.gitignore): add test.ts to the list of ignored files
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.
2023-03-29 10:43:27 +08:00
di-sukharev
ea864d18f4 refactor(generateCommitMessageFromGitDiff.ts): update INIT_MESSAGES_PROMPT to improve readability and remove unnecessary line breaks 2023-03-29 09:35:35 +08:00
di-sukharev
5d131e66fa Merge branch 'master' into dev 2023-03-29 09:34:38 +08:00
di-sukharev
bf24be92a1 chore(generateCommitMessageFromGitDiff.ts): update INIT_MESSAGES_PROMPT to clarify commit message conventions and instructions 2023-03-29 09:32:15 +08:00
Raymond
3103ae18b8 Count file diff by token, not by length of string (#63)
* 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>
2023-03-28 18:43:02 +08:00
R4V3N
7c9feba3ba Added Swedish Translation (#68)
* 1.1.23

* 1.1.24

* Added Swedish langauge

---------

Co-authored-by: di-sukharev <dim.sukharev@gmail.com>
2023-03-28 18:38:49 +08:00
di-sukharev
58369e4df9 1.1.24 v1.1.24 2023-03-28 11:32:17 +08:00
di-sukharev
3d50a67ece 1.1.23 v1.1.23 2023-03-28 11:32:13 +08:00
di-sukharev
a2d03e054c 🔀 chore(CommandsEnum.ts): reorder COMMANDS enum values
🐛 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.
2023-03-28 11:31:42 +08:00
di-sukharev
1c113c2901 style(commit.ts): add question mark to confirm message
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
2023-03-28 11:22:57 +08:00
di-sukharev
18dcb8e8c2 docs(CONTRIBUTING.md): fix typo in Contacts section
chore(package.json): change license from ISC to MIT
2023-03-28 11:20:09 +08:00
jessicakuijer
8b17b5e906 fix(commit.ts): add --verbose flag to git push command (#43)
* 🐛 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.
2023-03-28 11:18:34 +08:00
Dang Quang Linh
284604f6a4 feat(i18n): add support for Vietnamese (Vietnam) language (vi_VN) (#51)
Co-authored-by: Sukharev <57486732+di-sukharev@users.noreply.github.com>
2023-03-28 11:16:17 +08:00
Esmerlin Joel Mieses
bdce94f2ac [FEAT](i18n): Add support for Spanish language (es_ES) (#58)
<3
2023-03-28 11:15:17 +08:00
Moret84
a3fade4d42 refactor(git.ts): use git rev-parse to get the root directory of the repository (#46)
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.
2023-03-24 10:11:50 +08:00
di-sukharev
83906fc704 docs(CONTRIBUTING.md): update branch name in step 6 from master to dev 2023-03-21 18:23:38 +08:00