Skip to content

Commit f0251d1

Browse files
committed
build
1 parent 61f1a27 commit f0251d1

2 files changed

Lines changed: 47 additions & 15 deletions

File tree

out/cli.cjs

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18660,7 +18660,11 @@ var validateConfig = (key, condition, validationMessage) => {
1866018660
};
1866118661
var configValidators = {
1866218662
["OCO_OPENAI_API_KEY" /* OCO_OPENAI_API_KEY */](value, config8 = {}) {
18663-
validateConfig("API_KEY", value || config8.OCO_AI_PROVIDER == "ollama", "You need to provide an API key");
18663+
validateConfig(
18664+
"API_KEY",
18665+
value || config8.OCO_AI_PROVIDER == "ollama",
18666+
"You need to provide an API key"
18667+
);
1866418668
validateConfig(
1866518669
"OCO_OPENAI_API_KEY" /* OCO_OPENAI_API_KEY */,
1866618670
value.startsWith("sk-"),
@@ -18742,12 +18746,13 @@ var configValidators = {
1874218746
"OCO_MODEL" /* OCO_MODEL */,
1874318747
[
1874418748
"gpt-3.5-turbo",
18749+
"gpt-3.5-turbo-0125",
1874518750
"gpt-4",
18746-
"gpt-3.5-turbo-16k",
18747-
"gpt-3.5-turbo-0613",
18748-
"gpt-4-1106-preview"
18751+
"gpt-4-1106-preview",
18752+
"gpt-4-turbo-preview",
18753+
"gpt-4-0125-preview"
1874918754
].includes(value),
18750-
`${value} is not supported yet, use 'gpt-4', 'gpt-3.5-turbo-16k' (default), 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo' or 'gpt-4-1106-preview'`
18755+
`${value} is not supported yet, use 'gpt-4', 'gpt-3.5-turbo' (default), 'gpt-3.5-turbo-0125', 'gpt-4-1106-preview', 'gpt-4-turbo-preview' or 'gpt-4-0125-preview'`
1875118756
);
1875218757
return value;
1875318758
},
@@ -18778,6 +18783,14 @@ var configValidators = {
1877818783
`${value} is not supported yet, use 'ollama' or 'openai' (default)`
1877918784
);
1878018785
return value;
18786+
},
18787+
["OCO_ONE_LINE_COMMIT" /* OCO_ONE_LINE_COMMIT */](value) {
18788+
validateConfig(
18789+
"OCO_ONE_LINE_COMMIT" /* OCO_ONE_LINE_COMMIT */,
18790+
typeof value === "boolean",
18791+
"Must be true or false"
18792+
);
18793+
return value;
1878118794
}
1878218795
};
1878318796
var configPath = (0, import_path.join)((0, import_os.homedir)(), ".opencommit");
@@ -18789,11 +18802,12 @@ var getConfig = () => {
1878918802
OCO_OPENAI_BASE_PATH: process.env.OCO_OPENAI_BASE_PATH,
1879018803
OCO_DESCRIPTION: process.env.OCO_DESCRIPTION === "true" ? true : false,
1879118804
OCO_EMOJI: process.env.OCO_EMOJI === "true" ? true : false,
18792-
OCO_MODEL: process.env.OCO_MODEL || "gpt-3.5-turbo-16k",
18805+
OCO_MODEL: process.env.OCO_MODEL || "gpt-3.5-turbo",
1879318806
OCO_LANGUAGE: process.env.OCO_LANGUAGE || "en",
1879418807
OCO_MESSAGE_TEMPLATE_PLACEHOLDER: process.env.OCO_MESSAGE_TEMPLATE_PLACEHOLDER || "$msg",
1879518808
OCO_PROMPT_MODULE: process.env.OCO_PROMPT_MODULE || "conventional-commit",
18796-
OCO_AI_PROVIDER: process.env.OCO_AI_PROVIDER || "openai"
18809+
OCO_AI_PROVIDER: process.env.OCO_AI_PROVIDER || "openai",
18810+
OCO_ONE_LINE_COMMIT: process.env.OCO_ONE_LINE_COMMIT === "true" ? true : false
1879718811
};
1879818812
const configExists = (0, import_fs.existsSync)(configPath);
1879918813
if (!configExists)
@@ -19013,6 +19027,7 @@ var INIT_MAIN_PROMPT = (language, prompts) => ({
1901319027
${config2?.OCO_EMOJI ? "Use GitMoji convention to preface the commit." : "Do not preface the commit with anything."}
1901419028
${config2?.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."}
1901519029
Use the present tense. Use ${language} to answer.
19030+
${config2?.OCO_ONE_LINE_COMMIT ? "Craft a concise commit message that encapsulates all changes made, with an emphasis on the primary updates. If the modifications share a common theme or scope, mention it succinctly; otherwise, leave the scope out to maintain focus. The goal is to provide a clear and unified overview of the changes in a one single message, without diverging into a list of commit per file change." : ""}
1901619031

1901719032
You will strictly follow the following conventions to generate the content of the commit message:
1901819033
- ${prompts.join("\n- ")}
@@ -22077,6 +22092,7 @@ var INIT_MAIN_PROMPT2 = (language, fullGitMojiSpec) => ({
2207722092
content: `${IDENTITY} Your mission is to create clean and comprehensive commit messages as per the ${fullGitMojiSpec ? "GitMoji specification" : "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.
2207822093
${config5?.OCO_EMOJI ? `Use GitMoji convention to preface the commit. Here are some help to choose the right emoji (emoji, description): \u{1F41B}, Fix a bug; \u2728, Introduce new features; \u{1F4DD}, Add or update documentation; \u{1F680}, Deploy stuff; \u2705, Add, update, or pass tests; \u267B\uFE0F, Refactor code; \u2B06\uFE0F, Upgrade dependencies; \u{1F527}, Add or update configuration files; \u{1F310}, Internationalization and localization; \u{1F4A1}, Add or update comments in source code; ${fullGitMojiSpec ? "\u{1F3A8}, Improve structure / format of the code; \u26A1\uFE0F, Improve performance; \u{1F525}, Remove code or files; \u{1F691}\uFE0F, Critical hotfix; \u{1F484}, Add or update the UI and style files; \u{1F389}, Begin a project; \u{1F512}\uFE0F, Fix security issues; \u{1F510}, Add or update secrets; \u{1F516}, Release / Version tags; \u{1F6A8}, Fix compiler / linter warnings; \u{1F6A7}, Work in progress; \u{1F49A}, Fix CI Build; \u2B07\uFE0F, Downgrade dependencies; \u{1F4CC}, Pin dependencies to specific versions; \u{1F477}, Add or update CI build system; \u{1F4C8}, Add or update analytics or track code; \u2795, Add a dependency; \u2796, Remove a dependency; \u{1F528}, Add or update development scripts; \u270F\uFE0F, Fix typos; \u{1F4A9}, Write bad code that needs to be improved; \u23EA\uFE0F, Revert changes; \u{1F500}, Merge branches; \u{1F4E6}\uFE0F, Add or update compiled files or packages; \u{1F47D}\uFE0F, Update code due to external API changes; \u{1F69A}, Move or rename resources (e.g.: files, paths, routes); \u{1F4C4}, Add or update license; \u{1F4A5}, Introduce breaking changes; \u{1F371}, Add or update assets; \u267F\uFE0F, Improve accessibility; \u{1F37B}, Write code drunkenly; \u{1F4AC}, Add or update text and literals; \u{1F5C3}\uFE0F, Perform database related changes; \u{1F50A}, Add or update logs; \u{1F507}, Remove logs; \u{1F465}, Add or update contributor(s); \u{1F6B8}, Improve user experience / usability; \u{1F3D7}\uFE0F, Make architectural changes; \u{1F4F1}, Work on responsive design; \u{1F921}, Mock things; \u{1F95A}, Add or update an easter egg; \u{1F648}, Add or update a .gitignore file; \u{1F4F8}, Add or update snapshots; \u2697\uFE0F, Perform experiments; \u{1F50D}\uFE0F, Improve SEO; \u{1F3F7}\uFE0F, Add or update types; \u{1F331}, Add or update seed files; \u{1F6A9}, Add, update, or remove feature flags; \u{1F945}, Catch errors; \u{1F4AB}, Add or update animations and transitions; \u{1F5D1}\uFE0F, Deprecate code that needs to be cleaned up; \u{1F6C2}, Work on code related to authorization, roles and permissions; \u{1FA79}, Simple fix for a non-critical issue; \u{1F9D0}, Data exploration/inspection; \u26B0\uFE0F, Remove dead code; \u{1F9EA}, Add a failing test; \u{1F454}, Add or update business logic; \u{1FA7A}, Add or update healthcheck; \u{1F9F1}, Infrastructure related changes; \u{1F9D1}\u200D\u{1F4BB}, Improve developer experience; \u{1F4B8}, Add sponsorships or money related infrastructure; \u{1F9F5}, Add or update code related to multithreading or concurrency; \u{1F9BA}, Add or update code related to validation." : ""}` : "Do not preface the commit with anything. Conventional commit keywords:fix, feat, build, chore, ci, docs, style, refactor, perf, test."}
2207922094
${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."}
22095+
${config5?.OCO_ONE_LINE_COMMIT ? "Craft a concise commit message that encapsulates all changes made, with an emphasis on the primary updates. If the modifications share a common theme or scope, mention it succinctly; otherwise, leave the scope out to maintain focus. The goal is to provide a clear and unified overview of the changes in a one single message, without diverging into a list of commit per file change." : ""}
2208022096
Use the present tense. Lines must not be longer than 74 characters. Use ${language} for the commit message.`
2208122097
});
2208222098
var INIT_DIFF_PROMPT = {
@@ -22765,7 +22781,7 @@ Z2(
2276522781
if (await isHookCalled()) {
2276622782
prepareCommitMessageHook();
2276722783
} else {
22768-
commit(extraArgs, flags.fgm);
22784+
commit(extraArgs, false, flags.fgm);
2276922785
}
2277022786
},
2277122787
extraArgs

out/github-action.cjs

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24155,7 +24155,11 @@ var validateConfig = (key, condition, validationMessage) => {
2415524155
};
2415624156
var configValidators = {
2415724157
["OCO_OPENAI_API_KEY" /* OCO_OPENAI_API_KEY */](value, config7 = {}) {
24158-
validateConfig("API_KEY", value || config7.OCO_AI_PROVIDER == "ollama", "You need to provide an API key");
24158+
validateConfig(
24159+
"API_KEY",
24160+
value || config7.OCO_AI_PROVIDER == "ollama",
24161+
"You need to provide an API key"
24162+
);
2415924163
validateConfig(
2416024164
"OCO_OPENAI_API_KEY" /* OCO_OPENAI_API_KEY */,
2416124165
value.startsWith("sk-"),
@@ -24237,12 +24241,13 @@ var configValidators = {
2423724241
"OCO_MODEL" /* OCO_MODEL */,
2423824242
[
2423924243
"gpt-3.5-turbo",
24244+
"gpt-3.5-turbo-0125",
2424024245
"gpt-4",
24241-
"gpt-3.5-turbo-16k",
24242-
"gpt-3.5-turbo-0613",
24243-
"gpt-4-1106-preview"
24246+
"gpt-4-1106-preview",
24247+
"gpt-4-turbo-preview",
24248+
"gpt-4-0125-preview"
2424424249
].includes(value),
24245-
`${value} is not supported yet, use 'gpt-4', 'gpt-3.5-turbo-16k' (default), 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo' or 'gpt-4-1106-preview'`
24250+
`${value} is not supported yet, use 'gpt-4', 'gpt-3.5-turbo' (default), 'gpt-3.5-turbo-0125', 'gpt-4-1106-preview', 'gpt-4-turbo-preview' or 'gpt-4-0125-preview'`
2424624251
);
2424724252
return value;
2424824253
},
@@ -24273,6 +24278,14 @@ var configValidators = {
2427324278
`${value} is not supported yet, use 'ollama' or 'openai' (default)`
2427424279
);
2427524280
return value;
24281+
},
24282+
["OCO_ONE_LINE_COMMIT" /* OCO_ONE_LINE_COMMIT */](value) {
24283+
validateConfig(
24284+
"OCO_ONE_LINE_COMMIT" /* OCO_ONE_LINE_COMMIT */,
24285+
typeof value === "boolean",
24286+
"Must be true or false"
24287+
);
24288+
return value;
2427624289
}
2427724290
};
2427824291
var configPath = (0, import_path.join)((0, import_os.homedir)(), ".opencommit");
@@ -24284,11 +24297,12 @@ var getConfig = () => {
2428424297
OCO_OPENAI_BASE_PATH: process.env.OCO_OPENAI_BASE_PATH,
2428524298
OCO_DESCRIPTION: process.env.OCO_DESCRIPTION === "true" ? true : false,
2428624299
OCO_EMOJI: process.env.OCO_EMOJI === "true" ? true : false,
24287-
OCO_MODEL: process.env.OCO_MODEL || "gpt-3.5-turbo-16k",
24300+
OCO_MODEL: process.env.OCO_MODEL || "gpt-3.5-turbo",
2428824301
OCO_LANGUAGE: process.env.OCO_LANGUAGE || "en",
2428924302
OCO_MESSAGE_TEMPLATE_PLACEHOLDER: process.env.OCO_MESSAGE_TEMPLATE_PLACEHOLDER || "$msg",
2429024303
OCO_PROMPT_MODULE: process.env.OCO_PROMPT_MODULE || "conventional-commit",
24291-
OCO_AI_PROVIDER: process.env.OCO_AI_PROVIDER || "openai"
24304+
OCO_AI_PROVIDER: process.env.OCO_AI_PROVIDER || "openai",
24305+
OCO_ONE_LINE_COMMIT: process.env.OCO_ONE_LINE_COMMIT === "true" ? true : false
2429224306
};
2429324307
const configExists = (0, import_fs.existsSync)(configPath);
2429424308
if (!configExists)
@@ -24508,6 +24522,7 @@ var INIT_MAIN_PROMPT = (language, prompts) => ({
2450824522
${config2?.OCO_EMOJI ? "Use GitMoji convention to preface the commit." : "Do not preface the commit with anything."}
2450924523
${config2?.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."}
2451024524
Use the present tense. Use ${language} to answer.
24525+
${config2?.OCO_ONE_LINE_COMMIT ? "Craft a concise commit message that encapsulates all changes made, with an emphasis on the primary updates. If the modifications share a common theme or scope, mention it succinctly; otherwise, leave the scope out to maintain focus. The goal is to provide a clear and unified overview of the changes in a one single message, without diverging into a list of commit per file change." : ""}
2451124526

2451224527
You will strictly follow the following conventions to generate the content of the commit message:
2451324528
- ${prompts.join("\n- ")}
@@ -27572,6 +27587,7 @@ var INIT_MAIN_PROMPT2 = (language, fullGitMojiSpec) => ({
2757227587
content: `${IDENTITY} Your mission is to create clean and comprehensive commit messages as per the ${fullGitMojiSpec ? "GitMoji specification" : "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.
2757327588
${config5?.OCO_EMOJI ? `Use GitMoji convention to preface the commit. Here are some help to choose the right emoji (emoji, description): \u{1F41B}, Fix a bug; \u2728, Introduce new features; \u{1F4DD}, Add or update documentation; \u{1F680}, Deploy stuff; \u2705, Add, update, or pass tests; \u267B\uFE0F, Refactor code; \u2B06\uFE0F, Upgrade dependencies; \u{1F527}, Add or update configuration files; \u{1F310}, Internationalization and localization; \u{1F4A1}, Add or update comments in source code; ${fullGitMojiSpec ? "\u{1F3A8}, Improve structure / format of the code; \u26A1\uFE0F, Improve performance; \u{1F525}, Remove code or files; \u{1F691}\uFE0F, Critical hotfix; \u{1F484}, Add or update the UI and style files; \u{1F389}, Begin a project; \u{1F512}\uFE0F, Fix security issues; \u{1F510}, Add or update secrets; \u{1F516}, Release / Version tags; \u{1F6A8}, Fix compiler / linter warnings; \u{1F6A7}, Work in progress; \u{1F49A}, Fix CI Build; \u2B07\uFE0F, Downgrade dependencies; \u{1F4CC}, Pin dependencies to specific versions; \u{1F477}, Add or update CI build system; \u{1F4C8}, Add or update analytics or track code; \u2795, Add a dependency; \u2796, Remove a dependency; \u{1F528}, Add or update development scripts; \u270F\uFE0F, Fix typos; \u{1F4A9}, Write bad code that needs to be improved; \u23EA\uFE0F, Revert changes; \u{1F500}, Merge branches; \u{1F4E6}\uFE0F, Add or update compiled files or packages; \u{1F47D}\uFE0F, Update code due to external API changes; \u{1F69A}, Move or rename resources (e.g.: files, paths, routes); \u{1F4C4}, Add or update license; \u{1F4A5}, Introduce breaking changes; \u{1F371}, Add or update assets; \u267F\uFE0F, Improve accessibility; \u{1F37B}, Write code drunkenly; \u{1F4AC}, Add or update text and literals; \u{1F5C3}\uFE0F, Perform database related changes; \u{1F50A}, Add or update logs; \u{1F507}, Remove logs; \u{1F465}, Add or update contributor(s); \u{1F6B8}, Improve user experience / usability; \u{1F3D7}\uFE0F, Make architectural changes; \u{1F4F1}, Work on responsive design; \u{1F921}, Mock things; \u{1F95A}, Add or update an easter egg; \u{1F648}, Add or update a .gitignore file; \u{1F4F8}, Add or update snapshots; \u2697\uFE0F, Perform experiments; \u{1F50D}\uFE0F, Improve SEO; \u{1F3F7}\uFE0F, Add or update types; \u{1F331}, Add or update seed files; \u{1F6A9}, Add, update, or remove feature flags; \u{1F945}, Catch errors; \u{1F4AB}, Add or update animations and transitions; \u{1F5D1}\uFE0F, Deprecate code that needs to be cleaned up; \u{1F6C2}, Work on code related to authorization, roles and permissions; \u{1FA79}, Simple fix for a non-critical issue; \u{1F9D0}, Data exploration/inspection; \u26B0\uFE0F, Remove dead code; \u{1F9EA}, Add a failing test; \u{1F454}, Add or update business logic; \u{1FA7A}, Add or update healthcheck; \u{1F9F1}, Infrastructure related changes; \u{1F9D1}\u200D\u{1F4BB}, Improve developer experience; \u{1F4B8}, Add sponsorships or money related infrastructure; \u{1F9F5}, Add or update code related to multithreading or concurrency; \u{1F9BA}, Add or update code related to validation." : ""}` : "Do not preface the commit with anything. Conventional commit keywords:fix, feat, build, chore, ci, docs, style, refactor, perf, test."}
2757427589
${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."}
27590+
${config5?.OCO_ONE_LINE_COMMIT ? "Craft a concise commit message that encapsulates all changes made, with an emphasis on the primary updates. If the modifications share a common theme or scope, mention it succinctly; otherwise, leave the scope out to maintain focus. The goal is to provide a clear and unified overview of the changes in a one single message, without diverging into a list of commit per file change." : ""}
2757527591
Use the present tense. Lines must not be longer than 74 characters. Use ${language} for the commit message.`
2757627592
});
2757727593
var INIT_DIFF_PROMPT = {

0 commit comments

Comments
 (0)