git-coco 0.22.0 → 0.22.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.
@@ -40,7 +40,6 @@ import { minimatch } from 'minimatch';
40
40
  import { encoding_for_model } from 'tiktoken';
41
41
  import { exec } from 'child_process';
42
42
  import * as readline from 'readline';
43
- import { lint, load } from '@commitlint/core';
44
43
  import { pathToFileURL } from 'url';
45
44
 
46
45
  // This file is auto-generated - DO NOT EDIT
@@ -48,7 +47,7 @@ import { pathToFileURL } from 'url';
48
47
  /**
49
48
  * Current build version from package.json
50
49
  */
51
- const BUILD_VERSION = "0.22.0";
50
+ const BUILD_VERSION = "0.22.2";
52
51
 
53
52
  const isInteractive = (config) => {
54
53
  return config?.mode === 'interactive' || !!config?.interactive;
@@ -1020,12 +1019,7 @@ const schema$1 = {
1020
1019
  "description": "API key to use when making requests to OpenAI. Defaults to the value of `OPENAI_API_KEY` environment variable."
1021
1020
  },
1022
1021
  "verbosity": {
1023
- "type": "string",
1024
- "enum": [
1025
- "low",
1026
- "medium",
1027
- "high"
1028
- ],
1022
+ "$ref": "#/definitions/OpenAIVerbosityParam",
1029
1023
  "description": "The verbosity of the model's response."
1030
1024
  }
1031
1025
  }
@@ -1599,6 +1593,18 @@ const schema$1 = {
1599
1593
  "gpt-3.5-turbo-16k-0613"
1600
1594
  ]
1601
1595
  },
1596
+ "OpenAIVerbosityParam": {
1597
+ "type": [
1598
+ "string",
1599
+ "null"
1600
+ ],
1601
+ "enum": [
1602
+ "low",
1603
+ "medium",
1604
+ "high",
1605
+ null
1606
+ ]
1607
+ },
1602
1608
  "OllamaLLMService": {
1603
1609
  "type": "object",
1604
1610
  "additionalProperties": false,
@@ -11430,7 +11436,7 @@ const handler$3 = async (argv, logger) => {
11430
11436
  const schema = USE_CONVENTIONAL_COMMITS
11431
11437
  ? ConventionalCommitMessageResponseSchema
11432
11438
  : CommitMessageResponseSchema;
11433
- const formatInstructions = `You must always return valid JSON fenced by a markdown code block. Do not return any additional text. The JSON object you return should match the following schema:
11439
+ const formatInstructions = `You must always return a valid JSON object. Do not return any additional text. The JSON object you return should match the following schema:
11434
11440
  ${schema.description}
11435
11441
  {
11436
11442
  "title": "The commit title",
@@ -12784,6 +12790,7 @@ class CommitlintValidationError extends Error {
12784
12790
  * Load commitlint configuration
12785
12791
  */
12786
12792
  async function loadCommitlintConfig() {
12793
+ const { load } = await import('@commitlint/core');
12787
12794
  const projectRoot = findProjectRoot(process.cwd());
12788
12795
  const cwd = projectRoot || process.cwd();
12789
12796
  // @commitlint/load has issues with ESM configs (e.g. commitlint.config.js with `export default`).
@@ -12920,6 +12927,7 @@ async function getCommitlintRulesContext() {
12920
12927
  */
12921
12928
  async function validateCommitMessage(message, options = {}) {
12922
12929
  try {
12930
+ const { lint } = await import('@commitlint/core');
12923
12931
  const config = await loadCommitlintConfig();
12924
12932
  const result = await lint(message, config.rules, options);
12925
12933
  return {
package/dist/index.js CHANGED
@@ -39,7 +39,6 @@ var minimatch = require('minimatch');
39
39
  var tiktoken = require('tiktoken');
40
40
  var child_process = require('child_process');
41
41
  var readline = require('readline');
42
- var core$1 = require('@commitlint/core');
43
42
  var url = require('url');
44
43
 
45
44
  function _interopNamespaceDefault(e) {
@@ -70,7 +69,7 @@ var readline__namespace = /*#__PURE__*/_interopNamespaceDefault(readline);
70
69
  /**
71
70
  * Current build version from package.json
72
71
  */
73
- const BUILD_VERSION = "0.22.0";
72
+ const BUILD_VERSION = "0.22.2";
74
73
 
75
74
  const isInteractive = (config) => {
76
75
  return config?.mode === 'interactive' || !!config?.interactive;
@@ -1042,12 +1041,7 @@ const schema$1 = {
1042
1041
  "description": "API key to use when making requests to OpenAI. Defaults to the value of `OPENAI_API_KEY` environment variable."
1043
1042
  },
1044
1043
  "verbosity": {
1045
- "type": "string",
1046
- "enum": [
1047
- "low",
1048
- "medium",
1049
- "high"
1050
- ],
1044
+ "$ref": "#/definitions/OpenAIVerbosityParam",
1051
1045
  "description": "The verbosity of the model's response."
1052
1046
  }
1053
1047
  }
@@ -1621,6 +1615,18 @@ const schema$1 = {
1621
1615
  "gpt-3.5-turbo-16k-0613"
1622
1616
  ]
1623
1617
  },
1618
+ "OpenAIVerbosityParam": {
1619
+ "type": [
1620
+ "string",
1621
+ "null"
1622
+ ],
1623
+ "enum": [
1624
+ "low",
1625
+ "medium",
1626
+ "high",
1627
+ null
1628
+ ]
1629
+ },
1624
1630
  "OllamaLLMService": {
1625
1631
  "type": "object",
1626
1632
  "additionalProperties": false,
@@ -11452,7 +11458,7 @@ const handler$3 = async (argv, logger) => {
11452
11458
  const schema = USE_CONVENTIONAL_COMMITS
11453
11459
  ? ConventionalCommitMessageResponseSchema
11454
11460
  : CommitMessageResponseSchema;
11455
- const formatInstructions = `You must always return valid JSON fenced by a markdown code block. Do not return any additional text. The JSON object you return should match the following schema:
11461
+ const formatInstructions = `You must always return a valid JSON object. Do not return any additional text. The JSON object you return should match the following schema:
11456
11462
  ${schema.description}
11457
11463
  {
11458
11464
  "title": "The commit title",
@@ -12806,6 +12812,7 @@ class CommitlintValidationError extends Error {
12806
12812
  * Load commitlint configuration
12807
12813
  */
12808
12814
  async function loadCommitlintConfig() {
12815
+ const { load } = await import('@commitlint/core');
12809
12816
  const projectRoot = findProjectRoot(process.cwd());
12810
12817
  const cwd = projectRoot || process.cwd();
12811
12818
  // @commitlint/load has issues with ESM configs (e.g. commitlint.config.js with `export default`).
@@ -12820,7 +12827,7 @@ async function loadCommitlintConfig() {
12820
12827
  (Object.keys(module.default.rules || {}).length > 0 ||
12821
12828
  (module.default.extends && module.default.extends.length > 0))) {
12822
12829
  // We found a config, now let commitlint process it (for extends etc)
12823
- return await core$1.load(module.default, { cwd });
12830
+ return await load(module.default, { cwd });
12824
12831
  }
12825
12832
  }
12826
12833
  catch (error) {
@@ -12831,7 +12838,7 @@ async function loadCommitlintConfig() {
12831
12838
  }
12832
12839
  try {
12833
12840
  // Let @commitlint/load try to find the config. This works for CJS, JSON, and YAML.
12834
- const config = await core$1.load({}, { cwd });
12841
+ const config = await load({}, { cwd });
12835
12842
  // Check if a real config was loaded.
12836
12843
  if (config.extends.length > 0 || Object.keys(config.rules).length > 0) {
12837
12844
  return config;
@@ -12841,7 +12848,7 @@ async function loadCommitlintConfig() {
12841
12848
  // Could be an error parsing, or just not found. Fall through to default.
12842
12849
  }
12843
12850
  // If nothing worked, fallback to conventional config
12844
- return core$1.load({
12851
+ return load({
12845
12852
  extends: ['@commitlint/config-conventional'],
12846
12853
  });
12847
12854
  }
@@ -12942,8 +12949,9 @@ async function getCommitlintRulesContext() {
12942
12949
  */
12943
12950
  async function validateCommitMessage(message, options = {}) {
12944
12951
  try {
12952
+ const { lint } = await import('@commitlint/core');
12945
12953
  const config = await loadCommitlintConfig();
12946
- const result = await core$1.lint(message, config.rules, options);
12954
+ const result = await lint(message, config.rules, options);
12947
12955
  return {
12948
12956
  valid: result.valid,
12949
12957
  errors: result.errors.map((error) => error.message),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-coco",
3
- "version": "0.22.0",
3
+ "version": "0.22.2",
4
4
  "description": "zero-effort git commits with coco.",
5
5
  "author": "gfargo <ghfargo@gmail.com>",
6
6
  "license": "MIT",