@forsakringskassan/commitlint-config 1.2.1 → 1.3.1

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.
package/dist/install.js CHANGED
@@ -1,13 +1,41 @@
1
- #!/usr/bin/env node
1
+
2
+ import { dirname as _$_dirname } from "node:path";
3
+ import { createRequire as _$_createRequire } from "node:module";
4
+ import { fileURLToPath as _$_fileURLToPath } from "node:url";
5
+
6
+ const require = _$_createRequire(import.meta.url);
7
+ const __dirname = _$_dirname(_$_fileURLToPath(import.meta.url));
8
+
9
+ var __create = Object.create;
10
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
2
12
  var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __getProtoOf = Object.getPrototypeOf;
14
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
3
15
  var __commonJS = (cb, mod) => function __require() {
4
16
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
5
17
  };
18
+ var __copyProps = (to, from, except, desc) => {
19
+ if (from && typeof from === "object" || typeof from === "function") {
20
+ for (let key of __getOwnPropNames(from))
21
+ if (!__hasOwnProp.call(to, key) && key !== except)
22
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
+ }
24
+ return to;
25
+ };
26
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
27
+ // If the importer is in node compatibility mode or this is not an ESM
28
+ // file that has been converted to a CommonJS file using a Babel-
29
+ // compatible transform (i.e. "__esModule" has not been set), then set
30
+ // "default" to the CommonJS "module.exports" for node compatibility.
31
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
32
+ mod
33
+ ));
6
34
 
7
35
  // node_modules/ci-info/vendors.json
8
36
  var require_vendors = __commonJS({
9
- "node_modules/ci-info/vendors.json"(exports2, module2) {
10
- module2.exports = [
37
+ "node_modules/ci-info/vendors.json"(exports, module) {
38
+ module.exports = [
11
39
  {
12
40
  name: "AppVeyor",
13
41
  constant: "APPVEYOR",
@@ -217,50 +245,50 @@ var require_vendors = __commonJS({
217
245
 
218
246
  // node_modules/ci-info/index.js
219
247
  var require_ci_info = __commonJS({
220
- "node_modules/ci-info/index.js"(exports2) {
248
+ "node_modules/ci-info/index.js"(exports) {
221
249
  "use strict";
222
250
  var vendors = require_vendors();
223
251
  var env = process.env;
224
- Object.defineProperty(exports2, "_vendors", {
252
+ Object.defineProperty(exports, "_vendors", {
225
253
  value: vendors.map(function(v) {
226
254
  return v.constant;
227
255
  })
228
256
  });
229
- exports2.name = null;
230
- exports2.isPR = null;
257
+ exports.name = null;
258
+ exports.isPR = null;
231
259
  vendors.forEach(function(vendor) {
232
260
  const envs = Array.isArray(vendor.env) ? vendor.env : [vendor.env];
233
261
  const isCI2 = envs.every(function(obj) {
234
262
  return checkEnv(obj);
235
263
  });
236
- exports2[vendor.constant] = isCI2;
264
+ exports[vendor.constant] = isCI2;
237
265
  if (isCI2) {
238
- exports2.name = vendor.name;
266
+ exports.name = vendor.name;
239
267
  switch (typeof vendor.pr) {
240
268
  case "string":
241
- exports2.isPR = !!env[vendor.pr];
269
+ exports.isPR = !!env[vendor.pr];
242
270
  break;
243
271
  case "object":
244
272
  if ("env" in vendor.pr) {
245
- exports2.isPR = vendor.pr.env in env && env[vendor.pr.env] !== vendor.pr.ne;
273
+ exports.isPR = vendor.pr.env in env && env[vendor.pr.env] !== vendor.pr.ne;
246
274
  } else if ("any" in vendor.pr) {
247
- exports2.isPR = vendor.pr.any.some(function(key) {
275
+ exports.isPR = vendor.pr.any.some(function(key) {
248
276
  return !!env[key];
249
277
  });
250
278
  } else {
251
- exports2.isPR = checkEnv(vendor.pr);
279
+ exports.isPR = checkEnv(vendor.pr);
252
280
  }
253
281
  break;
254
282
  default:
255
- exports2.isPR = null;
283
+ exports.isPR = null;
256
284
  }
257
285
  }
258
286
  });
259
- exports2.isCI = !!(env.CI || // Travis CI, CircleCI, Cirrus CI, Gitlab CI, Appveyor, CodeShip, dsari
287
+ exports.isCI = !!(env.CI || // Travis CI, CircleCI, Cirrus CI, Gitlab CI, Appveyor, CodeShip, dsari
260
288
  env.CONTINUOUS_INTEGRATION || // Travis CI, Cirrus CI
261
289
  env.BUILD_NUMBER || // Jenkins, TeamCity
262
290
  env.RUN_ID || // TaskCluster, dsari
263
- exports2.name || false);
291
+ exports.name || false);
264
292
  function checkEnv(obj) {
265
293
  if (typeof obj === "string")
266
294
  return !!env[obj];
@@ -273,17 +301,17 @@ var require_ci_info = __commonJS({
273
301
 
274
302
  // node_modules/is-ci/index.js
275
303
  var require_is_ci = __commonJS({
276
- "node_modules/is-ci/index.js"(exports2, module2) {
304
+ "node_modules/is-ci/index.js"(exports, module) {
277
305
  "use strict";
278
- module2.exports = require_ci_info().isCI;
306
+ module.exports = require_ci_info().isCI;
279
307
  }
280
308
  });
281
309
 
282
- // src/install.js
283
- var fs = require("fs");
284
- var path = require("path");
285
- var { spawnSync } = require("child_process");
286
- var isCI = require_is_ci();
310
+ // src/install.ts
311
+ var import_is_ci = __toESM(require_is_ci(), 1);
312
+ import fs from "node:fs";
313
+ import path from "node:path";
314
+ import { spawnSync } from "node:child_process";
287
315
  function findGit(cwd) {
288
316
  let current = cwd;
289
317
  while (true) {
@@ -311,6 +339,6 @@ function configureCommitTemplate() {
311
339
  console.info(`git ${args.join(" ")}`);
312
340
  spawnSync("git", args);
313
341
  }
314
- if (!isCI) {
342
+ if (!import_is_ci.default) {
315
343
  configureCommitTemplate();
316
344
  }
package/dist/parser.js CHANGED
@@ -1,17 +1,93 @@
1
+
2
+ import { dirname as _$_dirname } from "node:path";
3
+ import { createRequire as _$_createRequire } from "node:module";
4
+ import { fileURLToPath as _$_fileURLToPath } from "node:url";
5
+
6
+ const require = _$_createRequire(import.meta.url);
7
+ const __dirname = _$_dirname(_$_fileURLToPath(import.meta.url));
8
+
9
+ var __create = Object.create;
10
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
1
12
  var __getOwnPropNames = Object.getOwnPropertyNames;
2
- var __commonJS = (cb, mod) => function __require() {
13
+ var __getProtoOf = Object.getPrototypeOf;
14
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
15
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
16
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
17
+ }) : x)(function(x) {
18
+ if (typeof require !== "undefined")
19
+ return require.apply(this, arguments);
20
+ throw Error('Dynamic require of "' + x + '" is not supported');
21
+ });
22
+ var __commonJS = (cb, mod) => function __require2() {
3
23
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
4
24
  };
25
+ var __copyProps = (to, from, except, desc) => {
26
+ if (from && typeof from === "object" || typeof from === "function") {
27
+ for (let key of __getOwnPropNames(from))
28
+ if (!__hasOwnProp.call(to, key) && key !== except)
29
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
30
+ }
31
+ return to;
32
+ };
33
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
34
+ // If the importer is in node compatibility mode or this is not an ESM
35
+ // file that has been converted to a CommonJS file using a Babel-
36
+ // compatible transform (i.e. "__esModule" has not been set), then set
37
+ // "default" to the CommonJS "module.exports" for node compatibility.
38
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
39
+ mod
40
+ ));
41
+
42
+ // node_modules/conventional-changelog-conventionalcommits/constants.js
43
+ var require_constants = __commonJS({
44
+ "node_modules/conventional-changelog-conventionalcommits/constants.js"(exports) {
45
+ "use strict";
46
+ var DEFAULT_COMMIT_TYPES = Object.freeze([
47
+ { type: "feat", section: "Features" },
48
+ { type: "feature", section: "Features" },
49
+ { type: "fix", section: "Bug Fixes" },
50
+ { type: "perf", section: "Performance Improvements" },
51
+ { type: "revert", section: "Reverts" },
52
+ { type: "docs", section: "Documentation", hidden: true },
53
+ { type: "style", section: "Styles", hidden: true },
54
+ { type: "chore", section: "Miscellaneous Chores", hidden: true },
55
+ { type: "refactor", section: "Code Refactoring", hidden: true },
56
+ { type: "test", section: "Tests", hidden: true },
57
+ { type: "build", section: "Build System", hidden: true },
58
+ { type: "ci", section: "Continuous Integration", hidden: true }
59
+ ].map(Object.freeze));
60
+ exports.DEFAULT_COMMIT_TYPES = DEFAULT_COMMIT_TYPES;
61
+ }
62
+ });
63
+
64
+ // node_modules/conventional-changelog-conventionalcommits/utils.js
65
+ var require_utils = __commonJS({
66
+ "node_modules/conventional-changelog-conventionalcommits/utils.js"(exports, module) {
67
+ var breakingHeaderPattern = /^(\w*)(?:\((.*)\))?!: (.*)$/;
68
+ module.exports.breakingHeaderPattern = breakingHeaderPattern;
69
+ function addBangNotes(commit) {
70
+ const match = commit.header.match(breakingHeaderPattern);
71
+ if (match && commit.notes.length === 0) {
72
+ const noteText = match[3];
73
+ commit.notes.push({
74
+ text: noteText
75
+ });
76
+ }
77
+ }
78
+ module.exports.addBangNotes = addBangNotes;
79
+ }
80
+ });
5
81
 
6
- // node_modules/conventional-changelog-conventionalcommits/parser-opts.js
7
- var require_parser_opts = __commonJS({
8
- "node_modules/conventional-changelog-conventionalcommits/parser-opts.js"(exports2, module2) {
82
+ // node_modules/conventional-changelog-conventionalcommits/parserOpts.js
83
+ var require_parserOpts = __commonJS({
84
+ "node_modules/conventional-changelog-conventionalcommits/parserOpts.js"(exports, module) {
9
85
  "use strict";
10
- module2.exports = function(config) {
11
- config = defaultConfig(config);
86
+ var { breakingHeaderPattern } = require_utils();
87
+ function createParserOpts(config) {
12
88
  return {
13
89
  headerPattern: /^(\w*)(?:\((.*)\))?!?: (.*)$/,
14
- breakingHeaderPattern: /^(\w*)(?:\((.*)\))?!: (.*)$/,
90
+ breakingHeaderPattern,
15
91
  headerCorrespondence: [
16
92
  "type",
17
93
  "scope",
@@ -20,38 +96,18 @@ var require_parser_opts = __commonJS({
20
96
  noteKeywords: ["BREAKING CHANGE", "BREAKING-CHANGE"],
21
97
  revertPattern: /^(?:Revert|revert:)\s"?([\s\S]+?)"?\s*This reverts commit (\w*)\./i,
22
98
  revertCorrespondence: ["header", "hash"],
23
- issuePrefixes: config.issuePrefixes
99
+ issuePrefixes: config?.issuePrefixes || ["#"]
24
100
  };
25
- };
26
- function defaultConfig(config) {
27
- config = config || {};
28
- config.issuePrefixes = config.issuePrefixes || ["#"];
29
- return config;
30
101
  }
31
- }
32
- });
33
-
34
- // node_modules/conventional-changelog-conventionalcommits/add-bang-notes.js
35
- var require_add_bang_notes = __commonJS({
36
- "node_modules/conventional-changelog-conventionalcommits/add-bang-notes.js"(exports2, module2) {
37
- var { breakingHeaderPattern } = require_parser_opts()();
38
- module2.exports = (commit) => {
39
- const match = commit.header.match(breakingHeaderPattern);
40
- if (match && commit.notes.length === 0) {
41
- const noteText = match[3];
42
- commit.notes.push({
43
- text: noteText
44
- });
45
- }
46
- };
102
+ module.exports.createParserOpts = createParserOpts;
47
103
  }
48
104
  });
49
105
 
50
106
  // node_modules/array-ify/index.js
51
107
  var require_array_ify = __commonJS({
52
- "node_modules/array-ify/index.js"(exports2, module2) {
108
+ "node_modules/array-ify/index.js"(exports, module) {
53
109
  "use strict";
54
- module2.exports = function(val) {
110
+ module.exports = function(val) {
55
111
  return Array.isArray(val) ? val : [val];
56
112
  };
57
113
  }
@@ -59,9 +115,9 @@ var require_array_ify = __commonJS({
59
115
 
60
116
  // node_modules/is-obj/index.js
61
117
  var require_is_obj = __commonJS({
62
- "node_modules/is-obj/index.js"(exports2, module2) {
118
+ "node_modules/is-obj/index.js"(exports, module) {
63
119
  "use strict";
64
- module2.exports = (value) => {
120
+ module.exports = (value) => {
65
121
  const type = typeof value;
66
122
  return value !== null && (type === "object" || type === "function");
67
123
  };
@@ -70,7 +126,7 @@ var require_is_obj = __commonJS({
70
126
 
71
127
  // node_modules/dot-prop/index.js
72
128
  var require_dot_prop = __commonJS({
73
- "node_modules/dot-prop/index.js"(exports2, module2) {
129
+ "node_modules/dot-prop/index.js"(exports, module) {
74
130
  "use strict";
75
131
  var isObj = require_is_obj();
76
132
  var disallowedKeys = [
@@ -95,7 +151,7 @@ var require_dot_prop = __commonJS({
95
151
  }
96
152
  return parts;
97
153
  }
98
- module2.exports = {
154
+ module.exports = {
99
155
  get(object, path, value) {
100
156
  if (!isObj(object) || typeof path !== "string") {
101
157
  return value === void 0 ? object : value;
@@ -179,7 +235,7 @@ var require_dot_prop = __commonJS({
179
235
 
180
236
  // node_modules/compare-func/index.js
181
237
  var require_compare_func = __commonJS({
182
- "node_modules/compare-func/index.js"(exports2, module2) {
238
+ "node_modules/compare-func/index.js"(exports, module) {
183
239
  "use strict";
184
240
  var arrayify = require_array_ify();
185
241
  var dotPropGet = require_dot_prop().get;
@@ -213,35 +269,44 @@ var require_compare_func = __commonJS({
213
269
  return ret;
214
270
  };
215
271
  }
216
- module2.exports = compareFunc;
272
+ module.exports = compareFunc;
217
273
  }
218
274
  });
219
275
 
220
- // node_modules/conventional-changelog-conventionalcommits/writer-opts.js
221
- var require_writer_opts = __commonJS({
222
- "node_modules/conventional-changelog-conventionalcommits/writer-opts.js"(exports2, module2) {
276
+ // node_modules/conventional-changelog-conventionalcommits/writerOpts.js
277
+ var require_writerOpts = __commonJS({
278
+ "node_modules/conventional-changelog-conventionalcommits/writerOpts.js"(exports, module) {
223
279
  "use strict";
224
- var addBangNotes = require_add_bang_notes();
225
280
  var compareFunc = require_compare_func();
226
- var { readFile } = require("fs").promises;
227
- var { resolve } = require("path");
228
- var releaseAsRe = /release-as:\s*\w*@?([0-9]+\.[0-9]+\.[0-9a-z]+(-[0-9a-z.]+)?)\s*/i;
281
+ var { readFile } = __require("fs").promises;
282
+ var { resolve } = __require("path");
283
+ var { DEFAULT_COMMIT_TYPES } = require_constants();
284
+ var { addBangNotes } = require_utils();
285
+ var releaseAsRegex = /release-as:\s*\w*@?([0-9]+\.[0-9]+\.[0-9a-z]+(-[0-9a-z.]+)?)\s*/i;
229
286
  var owner = "{{#if this.owner}}{{~this.owner}}{{else}}{{~@root.owner}}{{/if}}";
230
287
  var host = "{{~@root.host}}";
231
288
  var repository = "{{#if this.repository}}{{~this.repository}}{{else}}{{~@root.repository}}{{/if}}";
232
- module2.exports = async (config) => {
233
- config = defaultConfig(config);
234
- const commitUrlFormat = expandTemplate(config.commitUrlFormat, {
289
+ async function createWriterOpts(config) {
290
+ const finalConfig = {
291
+ types: DEFAULT_COMMIT_TYPES,
292
+ issueUrlFormat: "{{host}}/{{owner}}/{{repository}}/issues/{{id}}",
293
+ commitUrlFormat: "{{host}}/{{owner}}/{{repository}}/commit/{{hash}}",
294
+ compareUrlFormat: "{{host}}/{{owner}}/{{repository}}/compare/{{previousTag}}...{{currentTag}}",
295
+ userUrlFormat: "{{host}}/{{user}}",
296
+ issuePrefixes: ["#"],
297
+ ...config
298
+ };
299
+ const commitUrlFormat = expandTemplate(finalConfig.commitUrlFormat, {
235
300
  host,
236
301
  owner,
237
302
  repository
238
303
  });
239
- const compareUrlFormat = expandTemplate(config.compareUrlFormat, {
304
+ const compareUrlFormat = expandTemplate(finalConfig.compareUrlFormat, {
240
305
  host,
241
306
  owner,
242
307
  repository
243
308
  });
244
- const issueUrlFormat = expandTemplate(config.issueUrlFormat, {
309
+ const issueUrlFormat = expandTemplate(finalConfig.issueUrlFormat, {
245
310
  host,
246
311
  owner,
247
312
  repository,
@@ -259,27 +324,15 @@ var require_writer_opts = __commonJS({
259
324
  readFile(resolve(__dirname, "./templates/commit.hbs"), "utf-8"),
260
325
  readFile(resolve(__dirname, "./templates/footer.hbs"), "utf-8")
261
326
  ]);
262
- const writerOpts = getWriterOpts(config);
327
+ const writerOpts = getWriterOpts(finalConfig);
263
328
  writerOpts.mainTemplate = template;
264
329
  writerOpts.headerPartial = header.replace(/{{compareUrlFormat}}/g, compareUrlFormat);
265
330
  writerOpts.commitPartial = commit.replace(/{{commitUrlFormat}}/g, commitUrlFormat).replace(/{{issueUrlFormat}}/g, issueUrlFormat);
266
331
  writerOpts.footerPartial = footer;
267
332
  return writerOpts;
268
- };
269
- function findTypeEntry(types, commit) {
270
- const typeKey = (commit.revert ? "revert" : commit.type || "").toLowerCase();
271
- return types.find((entry) => {
272
- if (entry.type !== typeKey) {
273
- return false;
274
- }
275
- if (entry.scope && entry.scope !== commit.scope) {
276
- return false;
277
- }
278
- return true;
279
- });
280
333
  }
334
+ module.exports.createWriterOpts = createWriterOpts;
281
335
  function getWriterOpts(config) {
282
- config = defaultConfig(config);
283
336
  const commitGroupOrder = config.types.flatMap((t) => t.section).filter((t) => t);
284
337
  return {
285
338
  transform: (commit, context) => {
@@ -287,7 +340,7 @@ var require_writer_opts = __commonJS({
287
340
  const issues = [];
288
341
  const entry = findTypeEntry(config.types, commit);
289
342
  addBangNotes(commit);
290
- if (commit.footer && releaseAsRe.test(commit.footer) || commit.body && releaseAsRe.test(commit.body)) {
343
+ if (commit.footer && releaseAsRegex.test(commit.footer) || commit.body && releaseAsRegex.test(commit.body)) {
291
344
  discard = false;
292
345
  }
293
346
  commit.notes.forEach((note) => {
@@ -306,7 +359,7 @@ var require_writer_opts = __commonJS({
306
359
  }
307
360
  if (typeof commit.subject === "string") {
308
361
  config.issuePrefixes.join("|");
309
- const issueRegEx = "(" + config.issuePrefixes.join("|") + ")([0-9]+)";
362
+ const issueRegEx = "(" + config.issuePrefixes.join("|") + ")([a-z0-9]+)";
310
363
  const re = new RegExp(issueRegEx, "g");
311
364
  commit.subject = commit.subject.replace(re, (_, prefix, issue) => {
312
365
  issues.push(prefix + issue);
@@ -353,28 +406,17 @@ var require_writer_opts = __commonJS({
353
406
  notesSort: compareFunc
354
407
  };
355
408
  }
356
- function defaultConfig(config) {
357
- config = config || {};
358
- config.types = config.types || [
359
- { type: "feat", section: "Features" },
360
- { type: "feature", section: "Features" },
361
- { type: "fix", section: "Bug Fixes" },
362
- { type: "perf", section: "Performance Improvements" },
363
- { type: "revert", section: "Reverts" },
364
- { type: "docs", section: "Documentation", hidden: true },
365
- { type: "style", section: "Styles", hidden: true },
366
- { type: "chore", section: "Miscellaneous Chores", hidden: true },
367
- { type: "refactor", section: "Code Refactoring", hidden: true },
368
- { type: "test", section: "Tests", hidden: true },
369
- { type: "build", section: "Build System", hidden: true },
370
- { type: "ci", section: "Continuous Integration", hidden: true }
371
- ];
372
- config.issueUrlFormat = config.issueUrlFormat || "{{host}}/{{owner}}/{{repository}}/issues/{{id}}";
373
- config.commitUrlFormat = config.commitUrlFormat || "{{host}}/{{owner}}/{{repository}}/commit/{{hash}}";
374
- config.compareUrlFormat = config.compareUrlFormat || "{{host}}/{{owner}}/{{repository}}/compare/{{previousTag}}...{{currentTag}}";
375
- config.userUrlFormat = config.userUrlFormat || "{{host}}/{{user}}";
376
- config.issuePrefixes = config.issuePrefixes || ["#"];
377
- return config;
409
+ function findTypeEntry(types, commit) {
410
+ const typeKey = (commit.revert ? "revert" : commit.type || "").toLowerCase();
411
+ return types.find((entry) => {
412
+ if (entry.type !== typeKey) {
413
+ return false;
414
+ }
415
+ if (entry.scope && entry.scope !== commit.scope) {
416
+ return false;
417
+ }
418
+ return true;
419
+ });
378
420
  }
379
421
  function expandTemplate(template, context) {
380
422
  let expanded = template;
@@ -386,31 +428,29 @@ var require_writer_opts = __commonJS({
386
428
  }
387
429
  });
388
430
 
389
- // node_modules/conventional-changelog-conventionalcommits/conventional-changelog.js
390
- var require_conventional_changelog = __commonJS({
391
- "node_modules/conventional-changelog-conventionalcommits/conventional-changelog.js"(exports2, module2) {
431
+ // node_modules/conventional-changelog-conventionalcommits/conventionalChangelog.js
432
+ var require_conventionalChangelog = __commonJS({
433
+ "node_modules/conventional-changelog-conventionalcommits/conventionalChangelog.js"(exports, module) {
392
434
  "use strict";
393
- var parserOpts = require_parser_opts();
394
- var writerOpts = require_writer_opts();
395
- module2.exports = function(config) {
396
- return Promise.all([parserOpts(config), writerOpts(config)]).then(([parserOpts2, writerOpts2]) => ({
397
- parserOpts: parserOpts2,
398
- writerOpts: writerOpts2
399
- }));
400
- };
435
+ function createConventionalChangelogOpts(parserOpts, writerOpts) {
436
+ return {
437
+ parserOpts,
438
+ writerOpts
439
+ };
440
+ }
441
+ module.exports.createConventionalChangelogOpts = createConventionalChangelogOpts;
401
442
  }
402
443
  });
403
444
 
404
- // node_modules/conventional-changelog-conventionalcommits/conventional-recommended-bump.js
405
- var require_conventional_recommended_bump = __commonJS({
406
- "node_modules/conventional-changelog-conventionalcommits/conventional-recommended-bump.js"(exports2, module2) {
445
+ // node_modules/conventional-changelog-conventionalcommits/conventionalRecommendedBump.js
446
+ var require_conventionalRecommendedBump = __commonJS({
447
+ "node_modules/conventional-changelog-conventionalcommits/conventionalRecommendedBump.js"(exports, module) {
407
448
  "use strict";
408
- var addBangNotes = require_add_bang_notes();
409
- var parserOpts = require_parser_opts();
410
- module2.exports = function(config) {
449
+ var { addBangNotes } = require_utils();
450
+ function createConventionalRecommendedBumpOpts(config, parserOpts) {
411
451
  return {
412
- parserOpts: parserOpts(config),
413
- whatBump: (commits) => {
452
+ parserOpts,
453
+ whatBump(commits) {
414
454
  let level = 2;
415
455
  let breakings = 0;
416
456
  let features = 0;
@@ -426,7 +466,7 @@ var require_conventional_recommended_bump = __commonJS({
426
466
  }
427
467
  }
428
468
  });
429
- if (config.preMajor && level < 2) {
469
+ if (config?.preMajor && level < 2) {
430
470
  level++;
431
471
  }
432
472
  return {
@@ -435,57 +475,44 @@ var require_conventional_recommended_bump = __commonJS({
435
475
  };
436
476
  }
437
477
  };
438
- };
478
+ }
479
+ module.exports.createConventionalRecommendedBumpOpts = createConventionalRecommendedBumpOpts;
439
480
  }
440
481
  });
441
482
 
442
483
  // node_modules/conventional-changelog-conventionalcommits/index.js
443
484
  var require_conventional_changelog_conventionalcommits = __commonJS({
444
- "node_modules/conventional-changelog-conventionalcommits/index.js"(exports2, module2) {
485
+ "node_modules/conventional-changelog-conventionalcommits/index.js"(exports, module) {
445
486
  "use strict";
446
- var conventionalChangelog = require_conventional_changelog();
447
- var parserOpts = require_parser_opts();
448
- var recommendedBumpOpts = require_conventional_recommended_bump();
449
- var writerOpts = require_writer_opts();
450
- module2.exports = function(parameter) {
451
- if (typeof parameter === "function") {
452
- const config = {};
453
- Promise.all([
454
- conventionalChangelog(config),
455
- parserOpts(config),
456
- recommendedBumpOpts(config),
457
- writerOpts(config)
458
- ]).then(([conventionalChangelog2, parserOpts2, recommendedBumpOpts2, writerOpts2]) => {
459
- parameter(null, {
460
- gitRawCommitsOpts: {
461
- noMerges: null
462
- },
463
- conventionalChangelog: conventionalChangelog2,
464
- parserOpts: parserOpts2,
465
- recommendedBumpOpts: recommendedBumpOpts2,
466
- writerOpts: writerOpts2
467
- });
468
- });
469
- } else {
470
- const config = parameter || {};
471
- return presetOpts(config);
472
- }
473
- };
474
- function presetOpts(config) {
475
- return Promise.all([
476
- conventionalChangelog(config),
477
- parserOpts(config),
478
- recommendedBumpOpts(config),
479
- writerOpts(config)
480
- ]).then(([conventionalChangelog2, parserOpts2, recommendedBumpOpts2, writerOpts2]) => ({
481
- conventionalChangelog: conventionalChangelog2,
482
- parserOpts: parserOpts2,
483
- recommendedBumpOpts: recommendedBumpOpts2,
484
- writerOpts: writerOpts2
485
- }));
487
+ var { DEFAULT_COMMIT_TYPES } = require_constants();
488
+ var { createParserOpts } = require_parserOpts();
489
+ var { createWriterOpts } = require_writerOpts();
490
+ var { createConventionalChangelogOpts } = require_conventionalChangelog();
491
+ var { createConventionalRecommendedBumpOpts } = require_conventionalRecommendedBump();
492
+ async function createPreset(config) {
493
+ const parserOpts = createParserOpts(config);
494
+ const writerOpts = await createWriterOpts(config);
495
+ const recommendedBumpOpts = createConventionalRecommendedBumpOpts(config, parserOpts);
496
+ const conventionalChangelog = createConventionalChangelogOpts(parserOpts, writerOpts);
497
+ return {
498
+ gitRawCommitsOpts: {
499
+ ignore: config?.ignoreCommits,
500
+ noMerges: null
501
+ },
502
+ parserOpts,
503
+ writerOpts,
504
+ recommendedBumpOpts,
505
+ conventionalChangelog
506
+ };
486
507
  }
508
+ module.exports = createPreset;
509
+ module.exports.DEFAULT_COMMIT_TYPES = DEFAULT_COMMIT_TYPES;
487
510
  }
488
511
  });
489
512
 
490
- // src/parser.js
491
- module.exports = require_conventional_changelog_conventionalcommits();
513
+ // src/parser.ts
514
+ var import_conventional_changelog_conventionalcommits = __toESM(require_conventional_changelog_conventionalcommits(), 1);
515
+ var parser_default = (0, import_conventional_changelog_conventionalcommits.default)({});
516
+ export {
517
+ parser_default as default
518
+ };