@bitcobblers/wod-wiki-core 0.45.2167 → 0.47.2169

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
@@ -20,7 +20,8 @@ var LEGACY_ORIGIN_TO_OWNERSHIP_LAYER = {
20
20
  "analyzed-estimated": "runtime",
21
21
  execution: "runtime",
22
22
  user: "user-entry",
23
- collected: "user-entry"
23
+ collected: "user-entry",
24
+ diagnostic: "runtime"
24
25
  };
25
26
  function getMetricOwnershipLayer(origin) {
26
27
  return LEGACY_ORIGIN_TO_OWNERSHIP_LAYER[origin ?? "parser"] ?? "parser";
@@ -63,6 +64,7 @@ var MetricType = /* @__PURE__ */ ((MetricType2) => {
63
64
  MetricType2["METScore"] = "met-score";
64
65
  MetricType2["TIS"] = "tis";
65
66
  MetricType2["Calculated"] = "calculated";
67
+ MetricType2["Diagnostic"] = "diagnostic";
66
68
  MetricType2["Choice"] = "choice";
67
69
  return MetricType2;
68
70
  })(MetricType || {});
@@ -1162,7 +1164,7 @@ function frontmatterSubtype(properties) {
1162
1164
  if (host === "youtu.be" || host === "youtube.com" || host.endsWith(".youtube.com")) return "youtube";
1163
1165
  if (host === "strava.com" || host.endsWith(".strava.com")) return "strava";
1164
1166
  if (host === "amzn.to" || host === "amazon.com" || host.endsWith(".amazon.com")) return "amazon";
1165
- if (["baseAttributes", "discipline", "effortType", "targetRPE", "equipment", "aliases", "derivation"].some((key) => key in properties)) return "effort";
1167
+ if (["baseAttributes", "metrics.met", "discipline", "effortType", "targetRPE", "equipment", "aliases", "derivation"].some((key) => key in properties)) return "effort";
1166
1168
  if (["slug", "label", "registrySource", "ownerNoteId", "sourcePath"].some((key) => key in properties)) return "equipment";
1167
1169
  return "default";
1168
1170
  }
@@ -1255,7 +1257,7 @@ function parseDocumentSections(content, options = {}) {
1255
1257
  let close = line + 1;
1256
1258
  while (close < lines.length && lines[close].trim() !== "---" && !/^(`{3,}|~{3,})/.test(lines[close].trim())) close++;
1257
1259
  const inner = lines.slice(line + 1, close);
1258
- if (lines[close]?.trim() === "---" && inner.some((value) => /^[A-Za-z_][\w-]*\s*:/.test(value.trim()))) {
1260
+ if (lines[close]?.trim() === "---" && inner.some((value) => /^[A-Za-z_][\w.-]*\s*:/.test(value.trim()))) {
1259
1261
  const section2 = make("frontmatter", line, close);
1260
1262
  section2.contentFrom = offsets[line + 1];
1261
1263
  section2.contentTo = offsets[close];
@@ -1479,14 +1481,22 @@ function patchFrontmatterProperty(raw, path, value) {
1479
1481
  return raw.length ? block + raw : block;
1480
1482
  }
1481
1483
  const lines = m[1] === "" ? [] : m[1].split(/\r?\n/);
1484
+ let effectivePath = path;
1485
+ if (path.length === 1 && path[0].includes(".") && findProperty(lines, path[0], 0, 0, lines.length) === -1) {
1486
+ const split = path[0].split(".");
1487
+ const rootIdx = findProperty(lines, split[0], 0, 0, lines.length);
1488
+ if (rootIdx !== -1 && propertyExtent(lines, rootIdx, 0).length > 1) {
1489
+ effectivePath = split;
1490
+ }
1491
+ }
1482
1492
  let searchStart = 0;
1483
1493
  let searchEnd = lines.length;
1484
1494
  let foundDepth = -1;
1485
1495
  let foundIdx = -1;
1486
1496
  let foundExtent = [];
1487
- for (let d = 0; d < path.length; d++) {
1497
+ for (let d = 0; d < effectivePath.length; d++) {
1488
1498
  const indent = d * 2;
1489
- const idx = findProperty(lines, path[d], indent, searchStart, searchEnd);
1499
+ const idx = findProperty(lines, effectivePath[d], indent, searchStart, searchEnd);
1490
1500
  if (idx === -1) break;
1491
1501
  foundDepth = d;
1492
1502
  foundIdx = idx;
@@ -1495,11 +1505,11 @@ function patchFrontmatterProperty(raw, path, value) {
1495
1505
  searchEnd = foundExtent[foundExtent.length - 1] + 1;
1496
1506
  }
1497
1507
  if (value === null) {
1498
- if (foundDepth !== path.length - 1) return raw;
1508
+ if (foundDepth !== effectivePath.length - 1) return raw;
1499
1509
  const doomed = new Set(foundExtent);
1500
1510
  for (let d = foundDepth - 1; d >= 0; d--) {
1501
1511
  const indent = d * 2;
1502
- const idx = findProperty(lines, path[d], indent, 0, lines.length);
1512
+ const idx = findProperty(lines, effectivePath[d], indent, 0, lines.length);
1503
1513
  if (idx === -1 || doomed.has(idx)) break;
1504
1514
  let hasChild = false;
1505
1515
  for (let j = idx + 1; j < lines.length; j++) {
@@ -1518,8 +1528,8 @@ function patchFrontmatterProperty(raw, path, value) {
1518
1528
  let spliceIndex;
1519
1529
  let removeCount;
1520
1530
  let replacement;
1521
- if (foundDepth === path.length - 1) {
1522
- replacement = propertyLines(foundDepth * 2, path[foundDepth], value);
1531
+ if (foundDepth === effectivePath.length - 1) {
1532
+ replacement = propertyLines(foundDepth * 2, effectivePath[foundDepth], value);
1523
1533
  if (!isList(value)) {
1524
1534
  const ci = inlineCommentIndex(lines[foundIdx]);
1525
1535
  if (ci !== -1) {
@@ -1532,7 +1542,7 @@ function patchFrontmatterProperty(raw, path, value) {
1532
1542
  } else {
1533
1543
  spliceIndex = foundDepth === -1 ? lines.length : searchEnd;
1534
1544
  removeCount = 0;
1535
- replacement = missingChainLines(path, foundDepth + 1, value, (foundDepth + 1) * 2);
1545
+ replacement = missingChainLines(effectivePath, foundDepth + 1, value, (foundDepth + 1) * 2);
1536
1546
  }
1537
1547
  const next = [...lines];
1538
1548
  next.splice(spliceIndex, removeCount, ...replacement);
@@ -1540,13 +1550,13 @@ function patchFrontmatterProperty(raw, path, value) {
1540
1550
  }
1541
1551
 
1542
1552
  // src/version.ts
1543
- var VERSION = "0.45.2167";
1544
- var GIT_SHA = "d9859fd";
1545
- var BUILD_TIME = "2026-10-26T20:26:47.975Z";
1553
+ var VERSION = "0.47.2169";
1554
+ var GIT_SHA = "388d659";
1555
+ var BUILD_TIME = "2026-10-26T23:06:14.030Z";
1546
1556
  var SEMVER = {
1547
- version: "0.45.2167",
1548
- gitSha: "d9859fd",
1549
- buildTime: "2026-10-26T20:26:47.975Z"
1557
+ version: "0.47.2169",
1558
+ gitSha: "388d659",
1559
+ buildTime: "2026-10-26T23:06:14.030Z"
1550
1560
  };
1551
1561
 
1552
1562
  exports.BUILD_TIME = BUILD_TIME;