git-coco 0.22.1 → 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.1";
50
+ const BUILD_VERSION = "0.22.2";
52
51
 
53
52
  const isInteractive = (config) => {
54
53
  return config?.mode === 'interactive' || !!config?.interactive;
@@ -12791,6 +12790,7 @@ class CommitlintValidationError extends Error {
12791
12790
  * Load commitlint configuration
12792
12791
  */
12793
12792
  async function loadCommitlintConfig() {
12793
+ const { load } = await import('@commitlint/core');
12794
12794
  const projectRoot = findProjectRoot(process.cwd());
12795
12795
  const cwd = projectRoot || process.cwd();
12796
12796
  // @commitlint/load has issues with ESM configs (e.g. commitlint.config.js with `export default`).
@@ -12927,6 +12927,7 @@ async function getCommitlintRulesContext() {
12927
12927
  */
12928
12928
  async function validateCommitMessage(message, options = {}) {
12929
12929
  try {
12930
+ const { lint } = await import('@commitlint/core');
12930
12931
  const config = await loadCommitlintConfig();
12931
12932
  const result = await lint(message, config.rules, options);
12932
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.1";
72
+ const BUILD_VERSION = "0.22.2";
74
73
 
75
74
  const isInteractive = (config) => {
76
75
  return config?.mode === 'interactive' || !!config?.interactive;
@@ -12813,6 +12812,7 @@ class CommitlintValidationError extends Error {
12813
12812
  * Load commitlint configuration
12814
12813
  */
12815
12814
  async function loadCommitlintConfig() {
12815
+ const { load } = await import('@commitlint/core');
12816
12816
  const projectRoot = findProjectRoot(process.cwd());
12817
12817
  const cwd = projectRoot || process.cwd();
12818
12818
  // @commitlint/load has issues with ESM configs (e.g. commitlint.config.js with `export default`).
@@ -12827,7 +12827,7 @@ async function loadCommitlintConfig() {
12827
12827
  (Object.keys(module.default.rules || {}).length > 0 ||
12828
12828
  (module.default.extends && module.default.extends.length > 0))) {
12829
12829
  // We found a config, now let commitlint process it (for extends etc)
12830
- return await core$1.load(module.default, { cwd });
12830
+ return await load(module.default, { cwd });
12831
12831
  }
12832
12832
  }
12833
12833
  catch (error) {
@@ -12838,7 +12838,7 @@ async function loadCommitlintConfig() {
12838
12838
  }
12839
12839
  try {
12840
12840
  // Let @commitlint/load try to find the config. This works for CJS, JSON, and YAML.
12841
- const config = await core$1.load({}, { cwd });
12841
+ const config = await load({}, { cwd });
12842
12842
  // Check if a real config was loaded.
12843
12843
  if (config.extends.length > 0 || Object.keys(config.rules).length > 0) {
12844
12844
  return config;
@@ -12848,7 +12848,7 @@ async function loadCommitlintConfig() {
12848
12848
  // Could be an error parsing, or just not found. Fall through to default.
12849
12849
  }
12850
12850
  // If nothing worked, fallback to conventional config
12851
- return core$1.load({
12851
+ return load({
12852
12852
  extends: ['@commitlint/config-conventional'],
12853
12853
  });
12854
12854
  }
@@ -12949,8 +12949,9 @@ async function getCommitlintRulesContext() {
12949
12949
  */
12950
12950
  async function validateCommitMessage(message, options = {}) {
12951
12951
  try {
12952
+ const { lint } = await import('@commitlint/core');
12952
12953
  const config = await loadCommitlintConfig();
12953
- const result = await core$1.lint(message, config.rules, options);
12954
+ const result = await lint(message, config.rules, options);
12954
12955
  return {
12955
12956
  valid: result.valid,
12956
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.1",
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",