opencommit 2.0.0 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/out/cli.cjs +34 -5
  2. package/package.json +1 -1
package/out/cli.cjs CHANGED
@@ -16076,7 +16076,7 @@ function G3(t, e2) {
16076
16076
  // package.json
16077
16077
  var package_default = {
16078
16078
  name: "opencommit",
16079
- version: "1.1.50",
16079
+ version: "2.0.1",
16080
16080
  description: "GPT CLI to auto-generate impressive commits in 1 second. Killing lame commits with AI \u{1F92F}\u{1F52B}",
16081
16081
  keywords: [
16082
16082
  "git",
@@ -17195,11 +17195,19 @@ var source_default = chalk;
17195
17195
  // src/i18n/en.json
17196
17196
  var en_default = {
17197
17197
  localLanguage: "english",
17198
- commitFix: "fix(server.ts): change port variable case from lowercase port to uppercase PORT",
17199
- commitFeat: "feat(server.ts): add support for process.env.PORT environment variable",
17198
+ commitFix: "fix(server.ts): change port variable case from lowercase port to uppercase PORT to improve semantics",
17199
+ commitFeat: "feat(server.ts): add support for process.env.PORT environment variable to be able to run app on a configurable port",
17200
17200
  commitDescription: "The port variable is now named PORT, which improves consistency with the naming conventions as PORT is a constant. Support for an environment variable allows the application to be more flexible as it can now run on any available port specified via the process.env.PORT environment variable."
17201
17201
  };
17202
17202
 
17203
+ // src/i18n/cs.json
17204
+ var cs_default = {
17205
+ localLanguage: "\u010Desky",
17206
+ commitFix: "fix(server.ts): zlep\u0161en\xED velikosti prom\u011Bnn\xE9 port na velk\xE1 p\xEDsmena PORT",
17207
+ commitFeat: "feat(server.ts): p\u0159id\xE1n\xED podpory pro prom\u011Bnnou prost\u0159ed\xED process.env.PORT",
17208
+ commitDescription: "Prom\u011Bnn\xE1 port se nyn\xED jmenuje PORT, co\u017E odpov\xEDd\xE1 konvenci pojmenov\xE1n\xED, proto\u017Ee PORT je konstanta. Podpora prom\u011Bnn\xE9 prost\u0159ed\xED process.env.PORT umo\u017E\u0148uje snadn\u011Bj\u0161\xED spr\xE1vu nastaven\xED p\u0159i spu\u0161t\u011Bn\xED."
17209
+ };
17210
+
17203
17211
  // src/i18n/de.json
17204
17212
  var de_default = {
17205
17213
  localLanguage: "Deutsch",
@@ -17320,6 +17328,14 @@ var pl_default = {
17320
17328
  commitDescription: "Zmienna port jest teraz nazwana PORT, co jest zgodne z konwencj\u0105 nazewnicz\u0105 poniewa\u017C PORT jest sta\u0142\u0105. Obs\u0142uga zmiennej \u015Brodowiskowej process.env.PORT pozwala \u0142atwiej zarz\u0105dza\u0107 ustawieniami przy starcie."
17321
17329
  };
17322
17330
 
17331
+ // src/i18n/tr.json
17332
+ var tr_default = {
17333
+ localLanguage: "Turkish",
17334
+ commitFix: "fix(server.ts): port de\u011Fi\u015Fkeni k\xFC\xE7\xFCk harfli porttan b\xFCy\xFCk harfli PORT'a de\u011Fi\u015Ftirildi",
17335
+ commitFeat: "feat(server.ts): process.env.PORT ortam de\u011Fi\u015Fkeni i\xE7in destek eklendi.",
17336
+ commitDescription: "Ba\u011Flant\u0131 noktas\u0131 de\u011Fi\u015Fkeni art\u0131k PORT olarak adland\u0131r\u0131ld\u0131 ve PORT bir sabit de\u011Fi\u015Fken oldu\u011Fu i\xE7in bu adland\u0131rma tutarl\u0131l\u0131\u011F\u0131 art\u0131r\u0131r. Ortam de\u011Fi\u015Fkeni deste\u011Fi, art\u0131k process.env.PORT ortam de\u011Fi\u015Fkeni arac\u0131l\u0131\u011F\u0131yla belirtilen herhangi bir kullan\u0131labilir ba\u011Flant\u0131 noktas\u0131nda \xE7al\u0131\u015Fabilece\u011Finden uygulaman\u0131n daha esnek olmas\u0131n\u0131 sa\u011Flar."
17337
+ };
17338
+
17323
17339
  // src/i18n/th.json
17324
17340
  var th_default = {
17325
17341
  localLanguage: "\u0E44\u0E17\u0E22",
@@ -17334,6 +17350,7 @@ var i18n = {
17334
17350
  zh_CN: zh_CN_default,
17335
17351
  zh_TW: zh_TW_default,
17336
17352
  ja: ja_default,
17353
+ cs: cs_default,
17337
17354
  de: de_default,
17338
17355
  fr: fr_default,
17339
17356
  it: it_default,
@@ -17346,6 +17363,7 @@ var i18n = {
17346
17363
  nl: nl_default,
17347
17364
  ru: ru_default,
17348
17365
  pl: pl_default,
17366
+ tr: tr_default,
17349
17367
  th: th_default
17350
17368
  };
17351
17369
  var I18N_CONFIG_ALIAS = {
@@ -17353,6 +17371,7 @@ var I18N_CONFIG_ALIAS = {
17353
17371
  zh_TW: ["zh_TW", "\u7E41\u9AD4\u4E2D\u6587", "\u7E41\u9AD4"],
17354
17372
  ja: ["ja", "Japanese", "\u306B\u307B\u3093\u3054"],
17355
17373
  ko: ["ko", "Korean", "\uD55C\uAD6D\uC5B4"],
17374
+ cs: ["cs", "Czech", "\u010Desky"],
17356
17375
  de: ["de", "German", "Deutsch"],
17357
17376
  fr: ["fr", "French", "fran\xE7aise"],
17358
17377
  it: ["it", "Italian", "italiano"],
@@ -17365,6 +17384,7 @@ var I18N_CONFIG_ALIAS = {
17365
17384
  ru: ["ru", "Russian", "\u0440\u0443\u0441\u0441\u043A\u0438\u0439"],
17366
17385
  id_ID: ["id_ID", "Bahasa", "bahasa"],
17367
17386
  pl: ["pl", "Polish", "Polski"],
17387
+ tr: ["tr", "Turkish", "Turkish"],
17368
17388
  th: ["th", "Thai", "\u0E44\u0E17\u0E22"]
17369
17389
  };
17370
17390
  function getI18nLocal(value) {
@@ -17432,6 +17452,14 @@ var configValidators = {
17432
17452
  `${value} is not supported yet`
17433
17453
  );
17434
17454
  return value;
17455
+ },
17456
+ ["model" /* model */](value) {
17457
+ validateConfig(
17458
+ "OPENAI_BASE_PATH" /* OPENAI_BASE_PATH */,
17459
+ value === "gpt-3.5-turbo" || value === "gpt-4",
17460
+ `${value} is not supported yet, use 'gpt-4' or 'gpt-3.5-turbo' (default)`
17461
+ );
17462
+ return value;
17435
17463
  }
17436
17464
  };
17437
17465
  var configPath = (0, import_path.join)((0, import_os.homedir)(), ".opencommit");
@@ -21420,6 +21448,7 @@ if (!apiKey && command !== "config" && mode !== "set" /* set */) {
21420
21448
  );
21421
21449
  process.exit(1);
21422
21450
  }
21451
+ var MODEL = config?.model || "gpt-3.5-turbo";
21423
21452
  var OpenAi = class {
21424
21453
  openAiApiConfiguration = new import_openai.Configuration({
21425
21454
  apiKey
@@ -21434,7 +21463,7 @@ var OpenAi = class {
21434
21463
  generateCommitMessage = async (messages) => {
21435
21464
  try {
21436
21465
  const { data } = await this.openAI.createChatCompletion({
21437
- model: "gpt-3.5-turbo",
21466
+ model: MODEL,
21438
21467
  messages,
21439
21468
  temperature: 0,
21440
21469
  top_p: 0.1,
@@ -21498,7 +21527,7 @@ var translation = i18n[config2?.language || "en"];
21498
21527
  var INIT_MESSAGES_PROMPT = [
21499
21528
  {
21500
21529
  role: import_openai2.ChatCompletionRequestMessageRoleEnum.System,
21501
- content: `You are to act as the author of a commit message in git. Your mission is to create clean and comprehensive commit messages in the conventional commit convention and explain why a change was done. I'll send you an output of 'git diff --staged' command, and you convert it into a commit message.
21530
+ content: `You are to act as the author of a commit message in git. 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.
21502
21531
  ${config2?.emoji ? "Use GitMoji convention to preface the commit." : "Do not preface the commit with anything."}
21503
21532
  ${config2?.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."}
21504
21533
  Use the present tense. Lines must not be longer than 74 characters. Use ${translation.localLanguage} to answer.`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencommit",
3
- "version": "2.0.0",
3
+ "version": "2.0.2",
4
4
  "description": "GPT CLI to auto-generate impressive commits in 1 second. Killing lame commits with AI 🤯🔫",
5
5
  "keywords": [
6
6
  "git",