@forsakringskassan/commitlint-config 1.4.1 → 1.4.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.
- package/dist/commitlint.js +51 -46
- package/dist/format.js +2 -2
- package/package.json +1 -1
package/dist/commitlint.js
CHANGED
|
@@ -98,6 +98,7 @@ var require_re = __commonJS({
|
|
|
98
98
|
var re = exports.re = [];
|
|
99
99
|
var safeRe = exports.safeRe = [];
|
|
100
100
|
var src = exports.src = [];
|
|
101
|
+
var safeSrc = exports.safeSrc = [];
|
|
101
102
|
var t = exports.t = {};
|
|
102
103
|
var R2 = 0;
|
|
103
104
|
var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
|
|
@@ -118,6 +119,7 @@ var require_re = __commonJS({
|
|
|
118
119
|
debug(name, index, value2);
|
|
119
120
|
t[name] = index;
|
|
120
121
|
src[index] = value2;
|
|
122
|
+
safeSrc[index] = safe;
|
|
121
123
|
re[index] = new RegExp(value2, isGlobal ? "g" : void 0);
|
|
122
124
|
safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
|
|
123
125
|
};
|
|
@@ -214,7 +216,7 @@ var require_semver = __commonJS({
|
|
|
214
216
|
"node_modules/semver/classes/semver.js"(exports, module) {
|
|
215
217
|
var debug = require_debug();
|
|
216
218
|
var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
|
|
217
|
-
var { safeRe: re, t } = require_re();
|
|
219
|
+
var { safeRe: re, safeSrc: src, t } = require_re();
|
|
218
220
|
var parseOptions = require_parse_options();
|
|
219
221
|
var { compareIdentifiers } = require_identifiers();
|
|
220
222
|
var SemVer = class _SemVer {
|
|
@@ -354,6 +356,18 @@ var require_semver = __commonJS({
|
|
|
354
356
|
// preminor will bump the version up to the next minor release, and immediately
|
|
355
357
|
// down to pre-release. premajor and prepatch work the same way.
|
|
356
358
|
inc(release, identifier, identifierBase) {
|
|
359
|
+
if (release.startsWith("pre")) {
|
|
360
|
+
if (!identifier && identifierBase === false) {
|
|
361
|
+
throw new Error("invalid increment argument: identifier is empty");
|
|
362
|
+
}
|
|
363
|
+
if (identifier) {
|
|
364
|
+
const r = new RegExp(`^${this.options.loose ? src[t.PRERELEASELOOSE] : src[t.PRERELEASE]}$`);
|
|
365
|
+
const match2 = `-${identifier}`.match(r);
|
|
366
|
+
if (!match2 || match2[1] !== identifier) {
|
|
367
|
+
throw new Error(`invalid identifier: ${identifier}`);
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
}
|
|
357
371
|
switch (release) {
|
|
358
372
|
case "premajor":
|
|
359
373
|
this.prerelease.length = 0;
|
|
@@ -381,6 +395,12 @@ var require_semver = __commonJS({
|
|
|
381
395
|
}
|
|
382
396
|
this.inc("pre", identifier, identifierBase);
|
|
383
397
|
break;
|
|
398
|
+
case "release":
|
|
399
|
+
if (this.prerelease.length === 0) {
|
|
400
|
+
throw new Error(`version ${this.raw} is not a prerelease`);
|
|
401
|
+
}
|
|
402
|
+
this.prerelease.length = 0;
|
|
403
|
+
break;
|
|
384
404
|
case "major":
|
|
385
405
|
if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
|
|
386
406
|
this.major++;
|
|
@@ -406,9 +426,6 @@ var require_semver = __commonJS({
|
|
|
406
426
|
// 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
|
|
407
427
|
case "pre": {
|
|
408
428
|
const base = Number(identifierBase) ? 1 : 0;
|
|
409
|
-
if (!identifier && identifierBase === false) {
|
|
410
|
-
throw new Error("invalid increment argument: identifier is empty");
|
|
411
|
-
}
|
|
412
429
|
if (this.prerelease.length === 0) {
|
|
413
430
|
this.prerelease = [base];
|
|
414
431
|
} else {
|
|
@@ -543,13 +560,12 @@ var require_diff = __commonJS({
|
|
|
543
560
|
if (!lowVersion.patch && !lowVersion.minor) {
|
|
544
561
|
return "major";
|
|
545
562
|
}
|
|
546
|
-
if (highVersion
|
|
563
|
+
if (lowVersion.compareMain(highVersion) === 0) {
|
|
564
|
+
if (lowVersion.minor && !lowVersion.patch) {
|
|
565
|
+
return "minor";
|
|
566
|
+
}
|
|
547
567
|
return "patch";
|
|
548
568
|
}
|
|
549
|
-
if (highVersion.minor) {
|
|
550
|
-
return "minor";
|
|
551
|
-
}
|
|
552
|
-
return "major";
|
|
553
569
|
}
|
|
554
570
|
const prefix2 = highHasPre ? "pre" : "";
|
|
555
571
|
if (v1.major !== v2.major) {
|
|
@@ -256355,13 +256371,13 @@ var require_git_raw_commits = __commonJS({
|
|
|
256355
256371
|
});
|
|
256356
256372
|
|
|
256357
256373
|
// node_modules/@commitlint/cli/lib/cli.js
|
|
256358
|
-
import { createRequire as createRequire4 } from "module";
|
|
256359
|
-
import path13 from "path";
|
|
256360
|
-
import { fileURLToPath as fileURLToPath10, pathToFileURL as pathToFileURL4 } from "url";
|
|
256361
|
-
import util2 from "util";
|
|
256374
|
+
import { createRequire as createRequire4 } from "node:module";
|
|
256375
|
+
import path13 from "node:path";
|
|
256376
|
+
import { fileURLToPath as fileURLToPath10, pathToFileURL as pathToFileURL4 } from "node:url";
|
|
256377
|
+
import util2 from "node:util";
|
|
256362
256378
|
|
|
256363
256379
|
// node_modules/@commitlint/lint/lib/lint.js
|
|
256364
|
-
import util from "util";
|
|
256380
|
+
import util from "node:util";
|
|
256365
256381
|
|
|
256366
256382
|
// node_modules/@commitlint/is-ignored/lib/defaults.js
|
|
256367
256383
|
var import_semver = __toESM(require_semver2(), 1);
|
|
@@ -256387,35 +256403,18 @@ var wildcards = [
|
|
|
256387
256403
|
test(/^Auto-merged (.*?) into (.*)/)
|
|
256388
256404
|
];
|
|
256389
256405
|
|
|
256390
|
-
// node_modules/@commitlint/is-ignored/lib/validate-ignore-func.js
|
|
256391
|
-
function validateIgnoreFunction(fn) {
|
|
256392
|
-
const fnString = fn.toString();
|
|
256393
|
-
const dangerousPattern = /(?:process|require|import|eval|fetch|XMLHttpRequest|fs|child_process)(?:\s*\.|\s*\()|(?:exec|execFile|spawn)\s*\(/;
|
|
256394
|
-
if (dangerousPattern.test(fnString)) {
|
|
256395
|
-
const match2 = fnString.match(dangerousPattern);
|
|
256396
|
-
throw new Error(`Ignore function contains forbidden pattern: ${match2?.[0].trim()}`);
|
|
256397
|
-
}
|
|
256398
|
-
}
|
|
256399
|
-
|
|
256400
256406
|
// node_modules/@commitlint/is-ignored/lib/is-ignored.js
|
|
256401
256407
|
function isIgnored(commit = "", opts = {}) {
|
|
256402
256408
|
const ignores = typeof opts.ignores === "undefined" ? [] : opts.ignores;
|
|
256403
256409
|
if (!Array.isArray(ignores)) {
|
|
256404
256410
|
throw new Error(`ignores must be of type array, received ${ignores} of type ${typeof ignores}`);
|
|
256405
256411
|
}
|
|
256406
|
-
ignores.forEach(validateIgnoreFunction);
|
|
256407
256412
|
const invalids = ignores.filter((c) => typeof c !== "function");
|
|
256408
256413
|
if (invalids.length > 0) {
|
|
256409
256414
|
throw new Error(`ignores must be array of type function, received items of type: ${invalids.map((i) => typeof i).join(", ")}`);
|
|
256410
256415
|
}
|
|
256411
256416
|
const base = opts.defaults === false ? [] : wildcards;
|
|
256412
|
-
return [...base, ...ignores].some((w) =>
|
|
256413
|
-
const result = w(commit);
|
|
256414
|
-
if (typeof result !== "boolean") {
|
|
256415
|
-
throw new Error(`Ignore function must return a boolean, received ${typeof result}`);
|
|
256416
|
-
}
|
|
256417
|
-
return result;
|
|
256418
|
-
});
|
|
256417
|
+
return [...base, ...ignores].some((w) => w(commit));
|
|
256419
256418
|
}
|
|
256420
256419
|
|
|
256421
256420
|
// node_modules/@commitlint/parse/lib/index.js
|
|
@@ -256968,7 +256967,7 @@ var subjectExclamationMark = (parsed, when = "always") => {
|
|
|
256968
256967
|
};
|
|
256969
256968
|
|
|
256970
256969
|
// node_modules/@commitlint/rules/lib/trailer-exists.js
|
|
256971
|
-
import { spawnSync } from "child_process";
|
|
256970
|
+
import { spawnSync } from "node:child_process";
|
|
256972
256971
|
var trailerExists = (parsed, when = "always", value2 = "") => {
|
|
256973
256972
|
const trailers = spawnSync("git", ["interpret-trailers", "--parse"], {
|
|
256974
256973
|
input: parsed.raw || ""
|
|
@@ -257225,11 +257224,11 @@ async function lint(message2, rawRulesConfig, rawOpts) {
|
|
|
257225
257224
|
}
|
|
257226
257225
|
|
|
257227
257226
|
// node_modules/@commitlint/load/lib/load.js
|
|
257228
|
-
import path8 from "path";
|
|
257227
|
+
import path8 from "node:path";
|
|
257229
257228
|
|
|
257230
257229
|
// node_modules/@commitlint/config-validator/lib/validate.js
|
|
257231
257230
|
var import_ajv = __toESM(require_ajv(), 1);
|
|
257232
|
-
import { createRequire } from "module";
|
|
257231
|
+
import { createRequire } from "node:module";
|
|
257233
257232
|
|
|
257234
257233
|
// node_modules/@commitlint/config-validator/lib/formatErrors.js
|
|
257235
257234
|
function formatErrors(errors) {
|
|
@@ -257306,9 +257305,9 @@ function executable(config) {
|
|
|
257306
257305
|
}
|
|
257307
257306
|
|
|
257308
257307
|
// node_modules/@commitlint/resolve-extends/lib/index.js
|
|
257309
|
-
import fs3 from "fs";
|
|
257310
|
-
import path4 from "path";
|
|
257311
|
-
import { pathToFileURL as pathToFileURL2, fileURLToPath as fileURLToPath5 } from "url";
|
|
257308
|
+
import fs3 from "node:fs";
|
|
257309
|
+
import path4 from "node:path";
|
|
257310
|
+
import { pathToFileURL as pathToFileURL2, fileURLToPath as fileURLToPath5 } from "node:url";
|
|
257312
257311
|
|
|
257313
257312
|
// node_modules/global-directory/index.js
|
|
257314
257313
|
var import_ini = __toESM(require_ini(), 1);
|
|
@@ -258790,8 +258789,8 @@ var import_lodash9 = __toESM(require_lodash9(), 1);
|
|
|
258790
258789
|
|
|
258791
258790
|
// node_modules/@commitlint/load/lib/utils/load-config.js
|
|
258792
258791
|
var import_cosmiconfig = __toESM(require_dist2(), 1);
|
|
258793
|
-
import { existsSync, readFileSync } from "fs";
|
|
258794
|
-
import path5 from "path";
|
|
258792
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
258793
|
+
import path5 from "node:path";
|
|
258795
258794
|
|
|
258796
258795
|
// node_modules/jiti/lib/jiti.mjs
|
|
258797
258796
|
var import_jiti = __toESM(require_jiti(), 1);
|
|
@@ -258956,9 +258955,9 @@ async function loadParserOpts(pendingParser) {
|
|
|
258956
258955
|
}
|
|
258957
258956
|
|
|
258958
258957
|
// node_modules/@commitlint/load/lib/utils/load-plugin.js
|
|
258959
|
-
import { createRequire as createRequire3 } from "module";
|
|
258960
|
-
import path7 from "path";
|
|
258961
|
-
import { fileURLToPath as fileURLToPath6, pathToFileURL as pathToFileURL3 } from "url";
|
|
258958
|
+
import { createRequire as createRequire3 } from "node:module";
|
|
258959
|
+
import path7 from "node:path";
|
|
258960
|
+
import { fileURLToPath as fileURLToPath6, pathToFileURL as pathToFileURL3 } from "node:url";
|
|
258962
258961
|
|
|
258963
258962
|
// node_modules/@commitlint/load/node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
258964
258963
|
var ANSI_BACKGROUND_OFFSET = 10;
|
|
@@ -259450,7 +259449,7 @@ var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
|
259450
259449
|
var source_default = chalk;
|
|
259451
259450
|
|
|
259452
259451
|
// node_modules/@commitlint/load/lib/utils/plugin-naming.js
|
|
259453
|
-
import path6 from "path";
|
|
259452
|
+
import path6 from "node:path";
|
|
259454
259453
|
var prefix = "commitlint-plugin";
|
|
259455
259454
|
function convertPathToPosix(filepath) {
|
|
259456
259455
|
const normalizedFilepath = path6.normalize(filepath);
|
|
@@ -259648,7 +259647,7 @@ async function getHistoryCommits(options, opts = {}) {
|
|
|
259648
259647
|
}
|
|
259649
259648
|
|
|
259650
259649
|
// node_modules/@commitlint/top-level/lib/index.js
|
|
259651
|
-
import path11 from "path";
|
|
259650
|
+
import path11 from "node:path";
|
|
259652
259651
|
|
|
259653
259652
|
// node_modules/@commitlint/top-level/node_modules/find-up/index.js
|
|
259654
259653
|
import path10 from "node:path";
|
|
@@ -259715,6 +259714,12 @@ var Queue = class {
|
|
|
259715
259714
|
current = current.next;
|
|
259716
259715
|
}
|
|
259717
259716
|
}
|
|
259717
|
+
*drain() {
|
|
259718
|
+
let current;
|
|
259719
|
+
while ((current = this.dequeue()) !== void 0) {
|
|
259720
|
+
yield current;
|
|
259721
|
+
}
|
|
259722
|
+
}
|
|
259718
259723
|
};
|
|
259719
259724
|
|
|
259720
259725
|
// node_modules/@commitlint/top-level/node_modules/p-limit/index.js
|
|
@@ -259897,7 +259902,7 @@ async function searchDotGit(cwd) {
|
|
|
259897
259902
|
import fs6 from "fs/promises";
|
|
259898
259903
|
|
|
259899
259904
|
// node_modules/@commitlint/read/lib/get-edit-file-path.js
|
|
259900
|
-
import path12 from "path";
|
|
259905
|
+
import path12 from "node:path";
|
|
259901
259906
|
import fs5 from "fs/promises";
|
|
259902
259907
|
async function getEditFilePath(top2, edit) {
|
|
259903
259908
|
if (typeof edit === "string") {
|
package/dist/format.js
CHANGED
|
@@ -267,10 +267,10 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
|
267
267
|
return 1;
|
|
268
268
|
}
|
|
269
269
|
if ("CI" in env) {
|
|
270
|
-
if ("GITHUB_ACTIONS"
|
|
270
|
+
if (["GITHUB_ACTIONS", "GITEA_ACTIONS", "CIRCLECI"].some((key) => key in env)) {
|
|
271
271
|
return 3;
|
|
272
272
|
}
|
|
273
|
-
if (["TRAVIS", "
|
|
273
|
+
if (["TRAVIS", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
|
|
274
274
|
return 1;
|
|
275
275
|
}
|
|
276
276
|
return min;
|