@bitcobblers/wod-wiki-engine 0.36.2136 → 0.37.2137

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
@@ -647,13 +647,13 @@ function csvToSessionRows(csv) {
647
647
  }
648
648
 
649
649
  // src/version.ts
650
- var VERSION = "0.36.2136";
651
- var GIT_SHA = "ea2c980";
652
- var BUILD_TIME = "2026-10-16T16:23:51.969Z";
650
+ var VERSION = "0.37.2137";
651
+ var GIT_SHA = "b82a721";
652
+ var BUILD_TIME = "2026-10-16T20:56:02.597Z";
653
653
  var SEMVER = {
654
- version: "0.36.2136",
655
- gitSha: "ea2c980",
656
- buildTime: "2026-10-16T16:23:51.969Z"
654
+ version: "0.37.2137",
655
+ gitSha: "b82a721",
656
+ buildTime: "2026-10-16T20:56:02.597Z"
657
657
  };
658
658
  var SEED_SCHEMA = 8;
659
659
  var SEED_REGISTERED_WIDGETS = wodWikiCore.KNOWN_SECTION_WIDGETS;
@@ -839,7 +839,8 @@ function nonnegative(value) {
839
839
  function assertSeedManifest(value) {
840
840
  if (!object(value) || value.schema !== SEED_SCHEMA) throw new Error("Incompatible seed schema; rebuild seed artifacts");
841
841
  if (!nonnegative(value.version) || typeof value.builtAt !== "string" || !Number.isFinite(Date.parse(value.builtAt)) || !Array.isArray(value.chunks)) throw new Error("seed manifest failed shape validation");
842
- for (const key of ["versionLabel", "commit"]) if (value[key] !== void 0 && typeof value[key] !== "string") throw new Error("invalid seed manifest metadata");
842
+ for (const key of ["versionLabel", "commit", "name", "description"]) if (value[key] !== void 0 && typeof value[key] !== "string") throw new Error("invalid seed manifest metadata");
843
+ if (value.repositoryUrl !== void 0 && (typeof value.repositoryUrl !== "string" || !/^https:\/\//.test(value.repositoryUrl) || new URL(value.repositoryUrl).username || new URL(value.repositoryUrl).password)) throw new Error("invalid seed repository URL");
843
844
  if (value.dirty !== void 0 && typeof value.dirty !== "boolean") throw new Error("invalid seed manifest metadata");
844
845
  const ids = /* @__PURE__ */ new Set(), paths = /* @__PURE__ */ new Set();
845
846
  for (const chunk of value.chunks) {
@@ -1005,7 +1006,14 @@ async function applySeedChunk(storage, write) {
1005
1006
  const title = typeof fm["title"] === "string" && fm["title"].trim() ? fm["title"].trim() : titleFromPath(row.path);
1006
1007
  const sourceId = write.chunkId ? seedNoteSourceId(row.path, row.content, write.chunkId) : void 0;
1007
1008
  if (!sourceId) throw new Error(`Unknown seed source family ${write.chunkId}`);
1008
- const date = typeof fm["date"] === "string" && /^\d{4}-\d{2}-\d{2}$/.test(fm["date"]) ? Date.parse(`${fm["date"]}T12:00:00Z`) : void 0;
1009
+ const dateMatch = typeof fm["date"] === "string" ? fm["date"].match(/^(\d{4})-(\d{2})-(\d{2})$/) : null;
1010
+ let date;
1011
+ if (dateMatch) {
1012
+ const ts = Date.parse(`${fm["date"]}T12:00:00Z`);
1013
+ const real = Number.isFinite(ts) && new Date(ts).getUTCMonth() === Number(dateMatch[2]) - 1 && new Date(ts).getUTCDate() === Number(dateMatch[3]);
1014
+ if (!real) throw new Error(`invalid frontmatter date '${fm["date"]}' in '${row.path}' \u2014 expected a real calendar day (YYYY-MM-DD)`);
1015
+ date = ts;
1016
+ }
1009
1017
  const note = { ...existing, id, title, rawContent: row.content, sourceRevision, blocks: map, createdAt: write.manifest.version, ...date === void 0 ? {} : { date }, type: write.chunkId === DASHBOARDS_CHUNK_ID ? "dashboard" : "note", sourceId, catalog: catalogForChunkId(write.chunkId ?? ""), seedOrigin: "seed", seedVersion: write.manifest.version, seedChunkId: write.chunkId ?? void 0, sourcePath: row.path };
1010
1018
  if (date === void 0) delete note.date;
1011
1019
  if (!equal(note, existing)) changedNotes.push(note);