@hadl-labs/changelog-github 0.4.6 → 0.5.0

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.
Files changed (2) hide show
  1. package/dist/index.js +37 -16
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -4,39 +4,60 @@ var __defProp = Object.defineProperty;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ function __accessProp(key) {
8
+ return this[key];
9
+ }
10
+ var __toESMCache_node;
11
+ var __toESMCache_esm;
7
12
  var __toESM = (mod, isNodeMode, target) => {
13
+ var canCache = mod != null && typeof mod === "object";
14
+ if (canCache) {
15
+ var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
16
+ var cached = cache.get(mod);
17
+ if (cached)
18
+ return cached;
19
+ }
8
20
  target = mod != null ? __create(__getProtoOf(mod)) : {};
9
21
  const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
10
22
  for (let key of __getOwnPropNames(mod))
11
23
  if (!__hasOwnProp.call(to, key))
12
24
  __defProp(to, key, {
13
- get: () => mod[key],
25
+ get: __accessProp.bind(mod, key),
14
26
  enumerable: true
15
27
  });
28
+ if (canCache)
29
+ cache.set(mod, to);
16
30
  return to;
17
31
  };
18
- var __moduleCache = /* @__PURE__ */ new WeakMap;
19
32
  var __toCommonJS = (from) => {
20
- var entry = __moduleCache.get(from), desc;
33
+ var entry = (__moduleCache ??= new WeakMap).get(from), desc;
21
34
  if (entry)
22
35
  return entry;
23
36
  entry = __defProp({}, "__esModule", { value: true });
24
- if (from && typeof from === "object" || typeof from === "function")
25
- __getOwnPropNames(from).map((key) => !__hasOwnProp.call(entry, key) && __defProp(entry, key, {
26
- get: () => from[key],
27
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
28
- }));
37
+ if (from && typeof from === "object" || typeof from === "function") {
38
+ for (var key of __getOwnPropNames(from))
39
+ if (!__hasOwnProp.call(entry, key))
40
+ __defProp(entry, key, {
41
+ get: __accessProp.bind(from, key),
42
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
43
+ });
44
+ }
29
45
  __moduleCache.set(from, entry);
30
46
  return entry;
31
47
  };
48
+ var __moduleCache;
32
49
  var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
50
+ var __returnValue = (v) => v;
51
+ function __exportSetter(name, newValue) {
52
+ this[name] = __returnValue.bind(null, newValue);
53
+ }
33
54
  var __export = (target, all) => {
34
55
  for (var name in all)
35
56
  __defProp(target, name, {
36
57
  get: all[name],
37
58
  enumerable: true,
38
59
  configurable: true,
39
- set: (newValue) => all[name] = () => newValue
60
+ set: __exportSetter.bind(all, name)
40
61
  });
41
62
  };
42
63
 
@@ -493,7 +514,7 @@ var changelogFunctions = {
493
514
  let prFromSummary;
494
515
  let commitFromSummary;
495
516
  let usersFromSummary = [];
496
- let clickupLinks = [];
517
+ let cardLinks = [];
497
518
  const replacedChangelog = changeset.summary.replace(/^\s*(?:pr|pull|pull\s+request):\s*#?(\d+)/im, (_, pr) => {
498
519
  let num = Number(pr);
499
520
  if (!isNaN(num))
@@ -505,8 +526,8 @@ var changelogFunctions = {
505
526
  }).replace(/^\s*(?:author|user):\s*@?([^\s]+)/gim, (_, user) => {
506
527
  usersFromSummary.push(user);
507
528
  return "";
508
- }).replace(/^\s*clickup:\s*(https:\/\/app\.clickup\.com\/t\/[^\s]+)/gim, (_, link) => {
509
- clickupLinks.push(link);
529
+ }).replace(/^\s*card:\s*(https?:\/\/[^\s]+)/gim, (_, link) => {
530
+ cardLinks.push(link);
510
531
  return "";
511
532
  }).trim();
512
533
  const [firstLine, ...futureLines] = replacedChangelog.split(`
@@ -541,15 +562,15 @@ var changelogFunctions = {
541
562
  };
542
563
  })();
543
564
  const users = usersFromSummary.length ? usersFromSummary.map((userFromSummary) => `[@${userFromSummary}](https://github.com/${userFromSummary})`).join(", ") : links.user;
544
- const clickupPart = clickupLinks.length > 0 ? ` ClickUp: ${clickupLinks.map((link) => {
545
- const taskId = link.split("/").pop();
546
- return `[${taskId}](${link})`;
565
+ const cardPart = cardLinks.length > 0 ? ` Card: ${cardLinks.map((link) => {
566
+ const slug = link.split("/").filter(Boolean).pop();
567
+ return `[${slug}](${link})`;
547
568
  }).join(", ")}` : "";
548
569
  const prefix = [
549
570
  links.pull === null ? "" : ` ${links.pull}`,
550
571
  links.commit === null ? "" : ` ${links.commit}`,
551
572
  users === null ? "" : ` Thanks ${users}!`,
552
- clickupPart
573
+ cardPart
553
574
  ].join("");
554
575
  return `
555
576
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hadl-labs/changelog-github",
3
- "version": "0.4.6",
3
+ "version": "0.5.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [