@forsakringskassan/commitlint-config 3.3.6 → 3.3.8
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 +5897 -34068
- package/dist/install.js +34 -17
- package/dist/parser.js +81 -33
- package/package.json +2 -2
- package/dist/templates/commit.hbs +0 -30
- package/dist/templates/footer.hbs +0 -0
- package/dist/templates/header.hbs +0 -9
- package/dist/templates/template.hbs +0 -22
package/dist/install.js
CHANGED
|
@@ -48,6 +48,11 @@ var require_vendors = __commonJS({
|
|
|
48
48
|
env: "AGOLA_GIT_REF",
|
|
49
49
|
pr: "AGOLA_PULL_REQUEST_ID"
|
|
50
50
|
},
|
|
51
|
+
{
|
|
52
|
+
name: "Alpic",
|
|
53
|
+
constant: "ALPIC",
|
|
54
|
+
env: "ALPIC_HOST"
|
|
55
|
+
},
|
|
51
56
|
{
|
|
52
57
|
name: "Appcircle",
|
|
53
58
|
constant: "APPCIRCLE",
|
|
@@ -128,6 +133,16 @@ var require_vendors = __commonJS({
|
|
|
128
133
|
env: "CIRRUS_CI",
|
|
129
134
|
pr: "CIRRUS_PR"
|
|
130
135
|
},
|
|
136
|
+
{
|
|
137
|
+
name: "Cloudflare Pages",
|
|
138
|
+
constant: "CLOUDFLARE_PAGES",
|
|
139
|
+
env: "CF_PAGES"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
name: "Cloudflare Workers",
|
|
143
|
+
constant: "CLOUDFLARE_WORKERS",
|
|
144
|
+
env: "WORKERS_CI"
|
|
145
|
+
},
|
|
131
146
|
{
|
|
132
147
|
name: "Codefresh",
|
|
133
148
|
constant: "CODEFRESH",
|
|
@@ -406,23 +421,25 @@ var require_ci_info = __commonJS({
|
|
|
406
421
|
exports.name = null;
|
|
407
422
|
exports.isPR = null;
|
|
408
423
|
exports.id = null;
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
424
|
+
if (env.CI !== "false") {
|
|
425
|
+
vendors.forEach(function(vendor) {
|
|
426
|
+
const envs = Array.isArray(vendor.env) ? vendor.env : [vendor.env];
|
|
427
|
+
const isCI2 = envs.every(function(obj) {
|
|
428
|
+
return checkEnv(obj);
|
|
429
|
+
});
|
|
430
|
+
exports[vendor.constant] = isCI2;
|
|
431
|
+
if (!isCI2) {
|
|
432
|
+
return;
|
|
433
|
+
}
|
|
434
|
+
exports.name = vendor.name;
|
|
435
|
+
exports.isPR = checkPR(vendor);
|
|
436
|
+
exports.id = vendor.constant;
|
|
413
437
|
});
|
|
414
|
-
|
|
415
|
-
if (!isCI2) {
|
|
416
|
-
return;
|
|
417
|
-
}
|
|
418
|
-
exports.name = vendor.name;
|
|
419
|
-
exports.isPR = checkPR(vendor);
|
|
420
|
-
exports.id = vendor.constant;
|
|
421
|
-
});
|
|
438
|
+
}
|
|
422
439
|
exports.isCI = !!(env.CI !== "false" && // Bypass all checks if CI env is explicitly set to 'false'
|
|
423
440
|
(env.BUILD_ID || // Jenkins, Cloudbees
|
|
424
441
|
env.BUILD_NUMBER || // Jenkins, TeamCity
|
|
425
|
-
env.CI || // Travis CI, CircleCI, Cirrus CI, Gitlab CI, Appveyor, CodeShip, dsari
|
|
442
|
+
env.CI || // Travis CI, CircleCI, Cirrus CI, Gitlab CI, Appveyor, CodeShip, dsari, Cloudflare Pages/Workers
|
|
426
443
|
env.CI_APP_ID || // Appflow
|
|
427
444
|
env.CI_BUILD_ID || // Appflow
|
|
428
445
|
env.CI_BUILD_NUMBER || // Appflow
|
|
@@ -2153,7 +2170,7 @@ var te = class extends Mt {
|
|
|
2153
2170
|
this.src.removeListener("error", this.proxyErrors), super.unpipe();
|
|
2154
2171
|
}
|
|
2155
2172
|
constructor(t, e, s) {
|
|
2156
|
-
super(t, e, s), this.proxyErrors = (i) =>
|
|
2173
|
+
super(t, e, s), this.proxyErrors = (i) => this.dest.emit("error", i), t.on("error", this.proxyErrors);
|
|
2157
2174
|
}
|
|
2158
2175
|
};
|
|
2159
2176
|
var di = (n7) => !!n7.objectMode;
|
|
@@ -2405,6 +2422,7 @@ var V = class extends ee {
|
|
|
2405
2422
|
});
|
|
2406
2423
|
}, throw: e, return: e, [Symbol.asyncIterator]() {
|
|
2407
2424
|
return this;
|
|
2425
|
+
}, [Symbol.asyncDispose]: async () => {
|
|
2408
2426
|
} };
|
|
2409
2427
|
}
|
|
2410
2428
|
[Symbol.iterator]() {
|
|
@@ -2416,6 +2434,7 @@ var V = class extends ee {
|
|
|
2416
2434
|
};
|
|
2417
2435
|
return this.once("end", e), this.once(Xt, e), this.once(x, e), { next: s, throw: e, return: e, [Symbol.iterator]() {
|
|
2418
2436
|
return this;
|
|
2437
|
+
}, [Symbol.dispose]: () => {
|
|
2419
2438
|
} };
|
|
2420
2439
|
}
|
|
2421
2440
|
destroy(t) {
|
|
@@ -3879,9 +3898,7 @@ async function setupGitHooks() {
|
|
|
3879
3898
|
[
|
|
3880
3899
|
"exec",
|
|
3881
3900
|
"simple-git-hooks",
|
|
3882
|
-
__require.resolve(
|
|
3883
|
-
"@forsakringskassan/commitlint-config/hooks.js"
|
|
3884
|
-
)
|
|
3901
|
+
__require.resolve("@forsakringskassan/commitlint-config/hooks.js")
|
|
3885
3902
|
],
|
|
3886
3903
|
{ cwd: process.env["INIT_CWD"] }
|
|
3887
3904
|
);
|
package/dist/parser.js
CHANGED
|
@@ -280,9 +280,6 @@ function createParserOpts(config) {
|
|
|
280
280
|
|
|
281
281
|
// node_modules/conventional-changelog-conventionalcommits/src/writer.js
|
|
282
282
|
var import_compare_func = __toESM(require_compare_func(), 1);
|
|
283
|
-
import { readFile } from "fs/promises";
|
|
284
|
-
import { resolve } from "path";
|
|
285
|
-
import { fileURLToPath } from "url";
|
|
286
283
|
|
|
287
284
|
// node_modules/conventional-changelog-conventionalcommits/src/utils.js
|
|
288
285
|
function hasIntersection(a, b) {
|
|
@@ -311,14 +308,80 @@ function matchScope(config = {}, commit) {
|
|
|
311
308
|
return !targetScope || scopeOnly && includesScope || !scopeOnly && (!commit.scope || includesScope);
|
|
312
309
|
}
|
|
313
310
|
|
|
311
|
+
// node_modules/conventional-changelog-conventionalcommits/src/templates.js
|
|
312
|
+
var mainTemplate = `{{> header}}
|
|
313
|
+
{{#if noteGroups}}
|
|
314
|
+
{{#each noteGroups}}
|
|
315
|
+
|
|
316
|
+
### \u26A0 {{title}}
|
|
317
|
+
|
|
318
|
+
{{#each notes}}
|
|
319
|
+
* {{#if commit.scope}}**{{commit.scope}}:** {{/if}}{{text}}
|
|
320
|
+
{{/each}}
|
|
321
|
+
{{/each}}
|
|
322
|
+
{{/if}}
|
|
323
|
+
{{#each commitGroups}}
|
|
324
|
+
|
|
325
|
+
{{#if title}}
|
|
326
|
+
### {{title}}
|
|
327
|
+
|
|
328
|
+
{{/if}}
|
|
329
|
+
{{#each commits}}
|
|
330
|
+
{{> commit root=@root}}
|
|
331
|
+
{{/each}}
|
|
332
|
+
{{/each}}
|
|
333
|
+
{{> footer}}
|
|
334
|
+
`;
|
|
335
|
+
var headerPartial = `## {{#if @root.linkCompare~}}
|
|
336
|
+
[{{version}}]({{compareUrlFormat}})
|
|
337
|
+
{{~else}}
|
|
338
|
+
{{~version}}
|
|
339
|
+
{{~/if}}
|
|
340
|
+
{{~#if title}} "{{title}}"
|
|
341
|
+
{{~/if}}
|
|
342
|
+
{{~#if date}} ({{date}})
|
|
343
|
+
{{/if}}
|
|
344
|
+
`;
|
|
345
|
+
var commitPartial = `*{{#if scope}} **{{scope}}:**
|
|
346
|
+
{{~/if}} {{#if subject}}
|
|
347
|
+
{{~subject}}
|
|
348
|
+
{{~else}}
|
|
349
|
+
{{~header}}
|
|
350
|
+
{{~/if}}
|
|
351
|
+
|
|
352
|
+
{{~!-- commit link --}}{{~#if hash}} {{#if @root.linkReferences~}}
|
|
353
|
+
([{{shortHash}}]({{commitUrlFormat}}))
|
|
354
|
+
{{~else}}
|
|
355
|
+
{{~shortHash}}
|
|
356
|
+
{{~/if}}{{~/if}}
|
|
357
|
+
|
|
358
|
+
{{~!-- commit references --}}
|
|
359
|
+
{{~#if references~}}
|
|
360
|
+
, closes
|
|
361
|
+
{{~#each references}} {{#if @root.linkReferences~}}
|
|
362
|
+
[
|
|
363
|
+
{{~#if this.owner}}
|
|
364
|
+
{{~this.owner}}/
|
|
365
|
+
{{~/if}}
|
|
366
|
+
{{~this.repository}}{{this.prefix}}{{this.issue}}]({{issueUrlFormat}})
|
|
367
|
+
{{~else}}
|
|
368
|
+
{{~#if this.owner}}
|
|
369
|
+
{{~this.owner}}/
|
|
370
|
+
{{~/if}}
|
|
371
|
+
{{~this.repository}}{{this.prefix}}{{this.issue}}
|
|
372
|
+
{{~/if}}{{/each}}
|
|
373
|
+
{{~/if}}
|
|
374
|
+
|
|
375
|
+
`;
|
|
376
|
+
var footerPartial = ``;
|
|
377
|
+
|
|
314
378
|
// node_modules/conventional-changelog-conventionalcommits/src/writer.js
|
|
315
|
-
var dirname = fileURLToPath(new URL(".", import.meta.url));
|
|
316
379
|
var COMMIT_HASH_LENGTH = 7;
|
|
317
380
|
var releaseAsRegex = /release-as:\s*\w*@?([0-9]+\.[0-9]+\.[0-9a-z]+(-[0-9a-z.]+)?)\s*/i;
|
|
318
381
|
var owner = "{{#if this.owner}}{{~this.owner}}{{else}}{{~@root.owner}}{{/if}}";
|
|
319
382
|
var host = "{{~@root.host}}";
|
|
320
383
|
var repository = "{{#if this.repository}}{{~this.repository}}{{else}}{{~@root.repository}}{{/if}}";
|
|
321
|
-
|
|
384
|
+
function createWriterOpts(config) {
|
|
322
385
|
const finalConfig = {
|
|
323
386
|
types: DEFAULT_COMMIT_TYPES,
|
|
324
387
|
issueUrlFormat: "{{host}}/{{owner}}/{{repository}}/issues/{{id}}",
|
|
@@ -345,31 +408,16 @@ async function createWriterOpts(config) {
|
|
|
345
408
|
id: "{{this.issue}}",
|
|
346
409
|
prefix: "{{this.prefix}}"
|
|
347
410
|
});
|
|
348
|
-
const
|
|
349
|
-
template,
|
|
350
|
-
header,
|
|
351
|
-
commit,
|
|
352
|
-
footer
|
|
353
|
-
] = await Promise.all([
|
|
354
|
-
readFile(resolve(dirname, "./templates/template.hbs"), "utf-8"),
|
|
355
|
-
readFile(resolve(dirname, "./templates/header.hbs"), "utf-8"),
|
|
356
|
-
readFile(resolve(dirname, "./templates/commit.hbs"), "utf-8"),
|
|
357
|
-
readFile(resolve(dirname, "./templates/footer.hbs"), "utf-8")
|
|
358
|
-
]);
|
|
359
|
-
const writerOpts = getWriterOpts(finalConfig);
|
|
360
|
-
writerOpts.mainTemplate = template;
|
|
361
|
-
writerOpts.headerPartial = header.replace(/{{compareUrlFormat}}/g, compareUrlFormat);
|
|
362
|
-
writerOpts.commitPartial = commit.replace(/{{commitUrlFormat}}/g, commitUrlFormat).replace(/{{issueUrlFormat}}/g, issueUrlFormat);
|
|
363
|
-
writerOpts.footerPartial = footer;
|
|
364
|
-
return writerOpts;
|
|
365
|
-
}
|
|
366
|
-
function getWriterOpts(config) {
|
|
367
|
-
const commitGroupOrder = config.types.flatMap((t) => t.section).filter((t) => t);
|
|
411
|
+
const commitGroupOrder = finalConfig.types.flatMap((t) => t.section).filter((t) => t);
|
|
368
412
|
return {
|
|
413
|
+
mainTemplate,
|
|
414
|
+
headerPartial: headerPartial.replace(/{{compareUrlFormat}}/g, compareUrlFormat),
|
|
415
|
+
commitPartial: commitPartial.replace(/{{commitUrlFormat}}/g, commitUrlFormat).replace(/{{issueUrlFormat}}/g, issueUrlFormat),
|
|
416
|
+
footerPartial,
|
|
369
417
|
transform: (commit, context) => {
|
|
370
418
|
let discard = true;
|
|
371
419
|
const issues = [];
|
|
372
|
-
const entry = findTypeEntry(
|
|
420
|
+
const entry = findTypeEntry(finalConfig.types, commit);
|
|
373
421
|
if (commit.footer && releaseAsRegex.test(commit.footer) || commit.body && releaseAsRegex.test(commit.body)) {
|
|
374
422
|
discard = false;
|
|
375
423
|
}
|
|
@@ -382,20 +430,20 @@ function getWriterOpts(config) {
|
|
|
382
430
|
});
|
|
383
431
|
if (
|
|
384
432
|
// breaking changes attached to any type are still displayed.
|
|
385
|
-
discard && (entry === void 0 || entry.hidden) || !matchScope(
|
|
433
|
+
discard && (entry === void 0 || entry.hidden) || !matchScope(finalConfig, commit)
|
|
386
434
|
) {
|
|
387
435
|
return void 0;
|
|
388
436
|
}
|
|
389
437
|
const type = entry ? entry.section : commit.type;
|
|
390
|
-
const scope = commit.scope === "*" ||
|
|
438
|
+
const scope = commit.scope === "*" || finalConfig.scope ? "" : commit.scope;
|
|
391
439
|
const shortHash = typeof commit.hash === "string" ? commit.hash.substring(0, COMMIT_HASH_LENGTH) : commit.shortHash;
|
|
392
440
|
let { subject } = commit;
|
|
393
441
|
if (typeof subject === "string") {
|
|
394
|
-
const issueRegEx = `(${
|
|
442
|
+
const issueRegEx = `(${finalConfig.issuePrefixes.join("|")})([a-z0-9]+)`;
|
|
395
443
|
const re = new RegExp(issueRegEx, "g");
|
|
396
444
|
subject = subject.replace(re, (_, prefix, issue) => {
|
|
397
445
|
issues.push(prefix + issue);
|
|
398
|
-
const url = expandTemplate(
|
|
446
|
+
const url = expandTemplate(finalConfig.issueUrlFormat, {
|
|
399
447
|
host: context.host,
|
|
400
448
|
owner: context.owner,
|
|
401
449
|
repository: context.repository,
|
|
@@ -408,7 +456,7 @@ function getWriterOpts(config) {
|
|
|
408
456
|
if (user.includes("/")) {
|
|
409
457
|
return `@${user}`;
|
|
410
458
|
}
|
|
411
|
-
const usernameUrl = expandTemplate(
|
|
459
|
+
const usernameUrl = expandTemplate(finalConfig.userUrlFormat, {
|
|
412
460
|
host: context.host,
|
|
413
461
|
owner: context.owner,
|
|
414
462
|
repository: context.repository,
|
|
@@ -506,14 +554,14 @@ function createWhatBump(config = {}) {
|
|
|
506
554
|
}
|
|
507
555
|
|
|
508
556
|
// node_modules/conventional-changelog-conventionalcommits/src/index.js
|
|
509
|
-
|
|
557
|
+
function createPreset(config) {
|
|
510
558
|
return {
|
|
511
559
|
commits: {
|
|
512
560
|
ignore: config?.ignoreCommits,
|
|
513
561
|
merges: false
|
|
514
562
|
},
|
|
515
563
|
parser: createParserOpts(config),
|
|
516
|
-
writer:
|
|
564
|
+
writer: createWriterOpts(config),
|
|
517
565
|
whatBump: createWhatBump(config)
|
|
518
566
|
};
|
|
519
567
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forsakringskassan/commitlint-config",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.8",
|
|
4
4
|
"description": "FK commitlint shareable config",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"commitlint"
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"scripts": {
|
|
38
38
|
"prebuild": "rimraf dist",
|
|
39
39
|
"build": "tsc && node build.js ",
|
|
40
|
-
"postbuild": "cp -R node_modules
|
|
40
|
+
"postbuild": "cp -R node_modules/@commitlint/config-validator/lib/commitlint.schema.json dist/",
|
|
41
41
|
"prepack": "run-s pkg:mangle",
|
|
42
42
|
"postpack": "run-s pkg:restore",
|
|
43
43
|
"prepublishOnly": "run-s pkg:mangle",
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
*{{#if scope}} **{{scope}}:**
|
|
2
|
-
{{~/if}} {{#if subject}}
|
|
3
|
-
{{~subject}}
|
|
4
|
-
{{~else}}
|
|
5
|
-
{{~header}}
|
|
6
|
-
{{~/if}}
|
|
7
|
-
|
|
8
|
-
{{~!-- commit link --}}{{~#if hash}} {{#if @root.linkReferences~}}
|
|
9
|
-
([{{shortHash}}]({{commitUrlFormat}}))
|
|
10
|
-
{{~else}}
|
|
11
|
-
{{~shortHash}}
|
|
12
|
-
{{~/if}}{{~/if}}
|
|
13
|
-
|
|
14
|
-
{{~!-- commit references --}}
|
|
15
|
-
{{~#if references~}}
|
|
16
|
-
, closes
|
|
17
|
-
{{~#each references}} {{#if @root.linkReferences~}}
|
|
18
|
-
[
|
|
19
|
-
{{~#if this.owner}}
|
|
20
|
-
{{~this.owner}}/
|
|
21
|
-
{{~/if}}
|
|
22
|
-
{{~this.repository}}{{this.prefix}}{{this.issue}}]({{issueUrlFormat}})
|
|
23
|
-
{{~else}}
|
|
24
|
-
{{~#if this.owner}}
|
|
25
|
-
{{~this.owner}}/
|
|
26
|
-
{{~/if}}
|
|
27
|
-
{{~this.repository}}{{this.prefix}}{{this.issue}}
|
|
28
|
-
{{~/if}}{{/each}}
|
|
29
|
-
{{~/if}}
|
|
30
|
-
|
|
File without changes
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
{{> header}}
|
|
2
|
-
{{#if noteGroups}}
|
|
3
|
-
{{#each noteGroups}}
|
|
4
|
-
|
|
5
|
-
### ⚠ {{title}}
|
|
6
|
-
|
|
7
|
-
{{#each notes}}
|
|
8
|
-
* {{#if commit.scope}}**{{commit.scope}}:** {{/if}}{{text}}
|
|
9
|
-
{{/each}}
|
|
10
|
-
{{/each}}
|
|
11
|
-
{{/if}}
|
|
12
|
-
{{#each commitGroups}}
|
|
13
|
-
|
|
14
|
-
{{#if title}}
|
|
15
|
-
### {{title}}
|
|
16
|
-
|
|
17
|
-
{{/if}}
|
|
18
|
-
{{#each commits}}
|
|
19
|
-
{{> commit root=@root}}
|
|
20
|
-
{{/each}}
|
|
21
|
-
{{/each}}
|
|
22
|
-
{{> footer}}
|