alex-c-line 2.12.0 → 2.12.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/index.cjs CHANGED
@@ -1131,7 +1131,9 @@ function replaceMarkdownPlaceholders(rawContent, templateVariables) {
1131
1131
  let finalContent = content;
1132
1132
  for (const placeholder of placeholders) {
1133
1133
  if (!(placeholder in templateVariables)) throw new _alextheman_utility_v6.DataError({ placeholder }, "INVALID_PLACEHOLDER", "The placeholder found in frontmatter can not be found in the metadata.");
1134
- finalContent = finalContent.replaceAll(`{{${placeholder}}}`, templateVariables[placeholder]);
1134
+ finalContent = finalContent.replaceAll(`{{${placeholder}}}`, () => {
1135
+ return templateVariables[placeholder];
1136
+ });
1135
1137
  }
1136
1138
  return finalContent;
1137
1139
  }
@@ -1485,7 +1487,7 @@ function template(program) {
1485
1487
  //#endregion
1486
1488
  //#region package.json
1487
1489
  var name = "alex-c-line";
1488
- var version$1 = "2.12.0";
1490
+ var version$1 = "2.12.2";
1489
1491
  var description = "Command-line tool with commands to streamline the developer workflow.";
1490
1492
  //#endregion
1491
1493
  //#region src/cli/notifications/updates/checkUpdate.ts
@@ -1751,40 +1753,42 @@ async function sendBirthdayNotification(message) {
1751
1753
  }
1752
1754
  //#endregion
1753
1755
  //#region src/cli/notifications/helpers/birthdays.ts
1754
- const birthdays = [{
1755
- id: "alex",
1756
- date: /* @__PURE__ */ new Date("2003-07-16T00:00:00.000Z"),
1757
- getMessage: (age) => {
1758
- return _alextheman_utility.normaliseIndents`
1756
+ const birthdays = {
1757
+ alex: {
1758
+ date: /* @__PURE__ */ new Date("2003-07-16T00:00:00.000Z"),
1759
+ getMessage: (age) => {
1760
+ return _alextheman_utility.normaliseIndents`
1759
1761
  Happy birthday to AlexMan123456, my creator! 🎉
1760
1762
  He has turned ${age} years old today!
1761
1763
  `;
1762
- }
1763
- }, {
1764
- id: "alex-c-line",
1765
- date: /* @__PURE__ */ new Date("2025-07-20T00:00:00.000Z"),
1766
- getMessage: (age) => {
1767
- return _alextheman_utility.normaliseIndents`
1764
+ }
1765
+ },
1766
+ "alex-c-line": {
1767
+ date: /* @__PURE__ */ new Date("2025-07-20T00:00:00.000Z"),
1768
+ getMessage: (age) => {
1769
+ return _alextheman_utility.normaliseIndents`
1768
1770
  Happy birthday to me, alex-c-line! 🎉
1769
1771
  I have turned ${age} years old today!
1770
1772
  `;
1773
+ }
1771
1774
  }
1772
- }];
1775
+ };
1773
1776
  //#endregion
1774
1777
  //#region src/cli/notifications/birthday/maybeSendBirthdayNotification.ts
1775
1778
  async function maybeSendBirthdayNotification() {
1776
1779
  try {
1777
1780
  const cacheData = await loadAlexCLineGlobalCache();
1778
1781
  const currentDate = /* @__PURE__ */ new Date();
1779
- for (const birthday of birthdays) {
1780
- const lastChecked = cacheData?.birthdayChecks?.[birthday.id] ? new Date(cacheData.birthdayChecks[birthday.id]) : void 0;
1781
- if ((lastChecked === void 0 || lastChecked.getFullYear() !== currentDate.getFullYear()) && (0, _alextheman_utility.isAnniversary)(currentDate, birthday.date)) {
1782
- await sendBirthdayNotification(birthday.getMessage(currentDate.getFullYear() - birthday.date.getFullYear()));
1782
+ for (const [birthdayId, birthdayData] of Object.entries(birthdays)) {
1783
+ const cacheKey = `${version$1}_${birthdayId}`;
1784
+ const lastChecked = cacheData?.birthdayChecks?.[cacheKey] ? new Date(cacheData.birthdayChecks[cacheKey]) : void 0;
1785
+ if ((lastChecked === void 0 || lastChecked.getFullYear() !== currentDate.getFullYear()) && (0, _alextheman_utility.isAnniversary)(currentDate, birthdayData.date)) {
1786
+ await sendBirthdayNotification(birthdayData.getMessage(currentDate.getFullYear() - birthdayData.date.getFullYear()));
1783
1787
  await createAlexCLineGlobalCache({
1784
1788
  ...cacheData ?? {},
1785
1789
  birthdayChecks: {
1786
1790
  ...cacheData?.birthdayChecks ?? {},
1787
- [birthday.id]: currentDate.toISOString()
1791
+ [cacheKey]: currentDate.toISOString()
1788
1792
  }
1789
1793
  });
1790
1794
  }
package/dist/index.js CHANGED
@@ -1100,7 +1100,9 @@ function replaceMarkdownPlaceholders(rawContent, templateVariables) {
1100
1100
  let finalContent = content;
1101
1101
  for (const placeholder of placeholders) {
1102
1102
  if (!(placeholder in templateVariables)) throw new DataError({ placeholder }, "INVALID_PLACEHOLDER", "The placeholder found in frontmatter can not be found in the metadata.");
1103
- finalContent = finalContent.replaceAll(`{{${placeholder}}}`, templateVariables[placeholder]);
1103
+ finalContent = finalContent.replaceAll(`{{${placeholder}}}`, () => {
1104
+ return templateVariables[placeholder];
1105
+ });
1104
1106
  }
1105
1107
  return finalContent;
1106
1108
  }
@@ -1454,7 +1456,7 @@ function template(program) {
1454
1456
  //#endregion
1455
1457
  //#region package.json
1456
1458
  var name = "alex-c-line";
1457
- var version$1 = "2.12.0";
1459
+ var version$1 = "2.12.2";
1458
1460
  var description = "Command-line tool with commands to streamline the developer workflow.";
1459
1461
  //#endregion
1460
1462
  //#region src/cli/notifications/updates/checkUpdate.ts
@@ -1720,40 +1722,42 @@ async function sendBirthdayNotification(message) {
1720
1722
  }
1721
1723
  //#endregion
1722
1724
  //#region src/cli/notifications/helpers/birthdays.ts
1723
- const birthdays = [{
1724
- id: "alex",
1725
- date: /* @__PURE__ */ new Date("2003-07-16T00:00:00.000Z"),
1726
- getMessage: (age) => {
1727
- return normaliseIndents`
1725
+ const birthdays = {
1726
+ alex: {
1727
+ date: /* @__PURE__ */ new Date("2003-07-16T00:00:00.000Z"),
1728
+ getMessage: (age) => {
1729
+ return normaliseIndents`
1728
1730
  Happy birthday to AlexMan123456, my creator! 🎉
1729
1731
  He has turned ${age} years old today!
1730
1732
  `;
1731
- }
1732
- }, {
1733
- id: "alex-c-line",
1734
- date: /* @__PURE__ */ new Date("2025-07-20T00:00:00.000Z"),
1735
- getMessage: (age) => {
1736
- return normaliseIndents`
1733
+ }
1734
+ },
1735
+ "alex-c-line": {
1736
+ date: /* @__PURE__ */ new Date("2025-07-20T00:00:00.000Z"),
1737
+ getMessage: (age) => {
1738
+ return normaliseIndents`
1737
1739
  Happy birthday to me, alex-c-line! 🎉
1738
1740
  I have turned ${age} years old today!
1739
1741
  `;
1742
+ }
1740
1743
  }
1741
- }];
1744
+ };
1742
1745
  //#endregion
1743
1746
  //#region src/cli/notifications/birthday/maybeSendBirthdayNotification.ts
1744
1747
  async function maybeSendBirthdayNotification() {
1745
1748
  try {
1746
1749
  const cacheData = await loadAlexCLineGlobalCache();
1747
1750
  const currentDate = /* @__PURE__ */ new Date();
1748
- for (const birthday of birthdays) {
1749
- const lastChecked = cacheData?.birthdayChecks?.[birthday.id] ? new Date(cacheData.birthdayChecks[birthday.id]) : void 0;
1750
- if ((lastChecked === void 0 || lastChecked.getFullYear() !== currentDate.getFullYear()) && isAnniversary(currentDate, birthday.date)) {
1751
- await sendBirthdayNotification(birthday.getMessage(currentDate.getFullYear() - birthday.date.getFullYear()));
1751
+ for (const [birthdayId, birthdayData] of Object.entries(birthdays)) {
1752
+ const cacheKey = `${version$1}_${birthdayId}`;
1753
+ const lastChecked = cacheData?.birthdayChecks?.[cacheKey] ? new Date(cacheData.birthdayChecks[cacheKey]) : void 0;
1754
+ if ((lastChecked === void 0 || lastChecked.getFullYear() !== currentDate.getFullYear()) && isAnniversary(currentDate, birthdayData.date)) {
1755
+ await sendBirthdayNotification(birthdayData.getMessage(currentDate.getFullYear() - birthdayData.date.getFullYear()));
1752
1756
  await createAlexCLineGlobalCache({
1753
1757
  ...cacheData ?? {},
1754
1758
  birthdayChecks: {
1755
1759
  ...cacheData?.birthdayChecks ?? {},
1756
- [birthday.id]: currentDate.toISOString()
1760
+ [cacheKey]: currentDate.toISOString()
1757
1761
  }
1758
1762
  });
1759
1763
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "alex-c-line",
3
- "version": "2.12.0",
3
+ "version": "2.12.2",
4
4
  "description": "Command-line tool with commands to streamline the developer workflow.",
5
5
  "repository": {
6
6
  "type": "git",