Skip to content

Commit c763137

Browse files
authored
#247: fix (#248)
1 parent ac8c87b commit c763137

6 files changed

Lines changed: 24 additions & 14 deletions

File tree

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
out/github-action.cjs

out/cli.cjs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16410,7 +16410,8 @@ var package_default = {
1641016410
author: "https://github.com/di-sukharev",
1641116411
license: "MIT",
1641216412
files: [
16413-
"out/**/*"
16413+
"out/cli.cjs",
16414+
"out/tiktoken_bg.wasm"
1641416415
],
1641516416
release: {
1641616417
branches: [
@@ -21906,7 +21907,7 @@ var commitlintPrompts = {
2190621907
// src/modules/commitlint/pwd-commitlint.ts
2190721908
var import_path2 = __toESM(require("path"), 1);
2190821909
var nodeModulesPath = import_path2.default.join(
21909-
process.env.PWD,
21910+
process.env.PWD || process.cwd(),
2191021911
"node_modules",
2191121912
"@commitlint",
2191221913
"load"
@@ -21997,10 +21998,10 @@ var translation3 = i18n[config5?.OCO_LANGUAGE || "en"];
2199721998
var IDENTITY = "You are to act as the author of a commit message in git.";
2199821999
var INIT_MAIN_PROMPT2 = (language) => ({
2199922000
role: import_openai3.ChatCompletionRequestMessageRoleEnum.System,
22000-
content: `${IDENTITY} Your mission is to create clean and comprehensive commit messages in the conventional commit convention and explain WHAT were the changes and WHY the changes were done. I'll send you an output of 'git diff --staged' command, and you convert it into a commit message.
22001+
content: `${IDENTITY} Your mission is to create clean and comprehensive commit messages as per the conventional commit convention and explain WHAT were the changes and mainly WHY the changes were done. I'll send you an output of 'git diff --staged' command, and you are to convert it into a commit message.
2200122002
${config5?.OCO_EMOJI ? "Use GitMoji convention to preface the commit." : "Do not preface the commit with anything."}
2200222003
${config5?.OCO_DESCRIPTION ? `Add a short description of WHY the changes are done after the commit message. Don't start it with "This commit", just describe the changes.` : "Don't add any descriptions to the commit, only commit message."}
22003-
Use the present tense. Lines must not be longer than 74 characters. Use ${language} to answer.`
22004+
Use the present tense. Lines must not be longer than 74 characters. Use ${language} for the commit message.`
2200422005
});
2200522006
var INIT_DIFF_PROMPT = {
2200622007
role: import_openai3.ChatCompletionRequestMessageRoleEnum.User,

out/github-action.cjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28320,7 +28320,7 @@ var commitlintPrompts = {
2832028320
// src/modules/commitlint/pwd-commitlint.ts
2832128321
var import_path2 = __toESM(require("path"), 1);
2832228322
var nodeModulesPath = import_path2.default.join(
28323-
process.env.PWD,
28323+
process.env.PWD || process.cwd(),
2832428324
"node_modules",
2832528325
"@commitlint",
2832628326
"load"
@@ -28411,10 +28411,10 @@ var translation3 = i18n[config5?.OCO_LANGUAGE || "en"];
2841128411
var IDENTITY = "You are to act as the author of a commit message in git.";
2841228412
var INIT_MAIN_PROMPT2 = (language) => ({
2841328413
role: import_openai3.ChatCompletionRequestMessageRoleEnum.System,
28414-
content: `${IDENTITY} Your mission is to create clean and comprehensive commit messages in the conventional commit convention and explain WHAT were the changes and WHY the changes were done. I'll send you an output of 'git diff --staged' command, and you convert it into a commit message.
28414+
content: `${IDENTITY} Your mission is to create clean and comprehensive commit messages as per the conventional commit convention and explain WHAT were the changes and mainly WHY the changes were done. I'll send you an output of 'git diff --staged' command, and you are to convert it into a commit message.
2841528415
${config5?.OCO_EMOJI ? "Use GitMoji convention to preface the commit." : "Do not preface the commit with anything."}
2841628416
${config5?.OCO_DESCRIPTION ? `Add a short description of WHY the changes are done after the commit message. Don't start it with "This commit", just describe the changes.` : "Don't add any descriptions to the commit, only commit message."}
28417-
Use the present tense. Lines must not be longer than 74 characters. Use ${language} to answer.`
28417+
Use the present tense. Lines must not be longer than 74 characters. Use ${language} for the commit message.`
2841828418
});
2841928419
var INIT_DIFF_PROMPT = {
2842028420
role: import_openai3.ChatCompletionRequestMessageRoleEnum.User,

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
"author": "https://github.com/di-sukharev",
2727
"license": "MIT",
2828
"files": [
29-
"out/**/*"
29+
"out/cli.cjs",
30+
"out/tiktoken_bg.wasm"
3031
],
3132
"release": {
3233
"branches": [

src/modules/commitlint/pwd-commitlint.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import path from 'path';
22

33
const nodeModulesPath = path.join(
4-
process.env.PWD as string,
4+
process.env.PWD || process.cwd(),
55
'node_modules',
66
'@commitlint',
77
'load'

src/prompts.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,18 @@ export const IDENTITY =
2020

2121
const INIT_MAIN_PROMPT = (language: string): ChatCompletionRequestMessage => ({
2222
role: ChatCompletionRequestMessageRoleEnum.System,
23-
// prettier-ignore
24-
content: `${IDENTITY} Your mission is to create clean and comprehensive commit messages in the conventional commit convention and explain WHAT were the changes and WHY the changes were done. I'll send you an output of 'git diff --staged' command, and you convert it into a commit message.
25-
${config?.OCO_EMOJI ? 'Use GitMoji convention to preface the commit.' : 'Do not preface the commit with anything.'}
26-
${config?.OCO_DESCRIPTION ? 'Add a short description of WHY the changes are done after the commit message. Don\'t start it with "This commit", just describe the changes.' : "Don't add any descriptions to the commit, only commit message."}
27-
Use the present tense. Lines must not be longer than 74 characters. Use ${language} to answer.`
23+
content: `${IDENTITY} Your mission is to create clean and comprehensive commit messages as per the conventional commit convention and explain WHAT were the changes and mainly WHY the changes were done. I'll send you an output of 'git diff --staged' command, and you are to convert it into a commit message.
24+
${
25+
config?.OCO_EMOJI
26+
? 'Use GitMoji convention to preface the commit.'
27+
: 'Do not preface the commit with anything.'
28+
}
29+
${
30+
config?.OCO_DESCRIPTION
31+
? 'Add a short description of WHY the changes are done after the commit message. Don\'t start it with "This commit", just describe the changes.'
32+
: "Don't add any descriptions to the commit, only commit message."
33+
}
34+
Use the present tense. Lines must not be longer than 74 characters. Use ${language} for the commit message.`
2835
});
2936

3037
export const INIT_DIFF_PROMPT: ChatCompletionRequestMessage = {

0 commit comments

Comments
 (0)