@html-validate/commitlint-config 3.6.7 → 3.6.9

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/config.js CHANGED
@@ -168,7 +168,7 @@ var config = {
168
168
  "header-max-length": [2, "always", 120]
169
169
  }
170
170
  };
171
- if (process.argv[1] === fileURLToPath(import.meta.url)) {
171
+ if (process.argv[1] === import.meta.filename) {
172
172
  const prettyConfig = inspect(config, {
173
173
  colors: process.stdout.isTTY,
174
174
  depth: 8
package/dist/formatter.js CHANGED
@@ -166,9 +166,6 @@ function selectColor(result) {
166
166
  }
167
167
  return (result.warnings || []).length ? "yellow" : "green";
168
168
  }
169
-
170
- // src/formatter.ts
171
- var formatter_default = format;
172
169
  export {
173
- formatter_default as default
170
+ format as default
174
171
  };
@@ -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
- async function createWriterOpts(config) {
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(config.types, commit);
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(config, commit)
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 === "*" || config.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 = `(${config.issuePrefixes.join("|")})([a-z0-9]+)`;
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(config.issueUrlFormat, {
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(config.userUrlFormat, {
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
- async function createPreset(config) {
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: await createWriterOpts(config),
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": "@html-validate/commitlint-config",
3
- "version": "3.6.7",
3
+ "version": "3.6.9",
4
4
  "description": "Commitlint sharable config used by the various HTML-validate packages",
5
5
  "keywords": [
6
6
  "commitlint"
@@ -29,7 +29,7 @@
29
29
  "scripts": {
30
30
  "prebuild": "tsc",
31
31
  "build": "node build.js ",
32
- "postbuild": "cp -R node_modules/conventional-changelog-conventionalcommits/src/templates/ node_modules/@commitlint/config-validator/lib/commitlint.schema.json dist/",
32
+ "postbuild": "cp -R node_modules/@commitlint/config-validator/lib/commitlint.schema.json dist/",
33
33
  "eslint": "eslint --cache .",
34
34
  "eslint:fix": "eslint --cache --fix .",
35
35
  "prepack": "release-prepack --bundle --retain-scripts && npm pkg set scripts.postinstall=\"node bin/install.js\"",
@@ -44,7 +44,7 @@
44
44
  "postinstall": "node bin/install.js"
45
45
  },
46
46
  "engines": {
47
- "node": ">= 20"
47
+ "node": "^20.11 || >= 22.16"
48
48
  },
49
49
  "publishConfig": {
50
50
  "access": "public"
@@ -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,9 +0,0 @@
1
- ## {{#if @root.linkCompare~}}
2
- [{{version}}]({{compareUrlFormat}})
3
- {{~else}}
4
- {{~version}}
5
- {{~/if}}
6
- {{~#if title}} "{{title}}"
7
- {{~/if}}
8
- {{~#if date}} ({{date}})
9
- {{/if}}
@@ -1,21 +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}}