You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
validate: list and boolean fields are never type-checked; a trailing # comment turns tags into a string and the template ships one #79
Why it matters
The validator is the catalog's only guard. It checks list fields for emptiness but never that they are lists, and never that commercial / attribution_required are booleans. The frontmatter parser has no trailing-comment handling, so tags: [a, b] # note parses to the string "[a, b] # note". catalog/TEMPLATE.md ships exactly that line, and the scaffold only strips comments from verified and status, so every new entry created with npm run new-entry that keeps the comment starts with a string tags. Every downstream check does Array.isArray(x) ? x : [], so the entry passes validation and is built with no tags (search and the chip filters miss it). Likewise commercial: "true" passes the enum check as the string "true" and renders on the card as "commercial ?".
catalog/TEMPLATE.md:14tags: [low-poly, modular] # describe the content; never the licence or the publisher (V19, V21).
site/lib/scaffold.mjs:~136newEntryText strips comments only from verified/status.
site/validate.mjs:269 list fields checked for emptiness only; site/checks.mjs:292, 334, 447 fall back to [] on non-arrays; site/build.mjs:98-99 ships the fallback; build.mjs:84-91 maps a non-boolean commercial to "unknown".
site/validate.mjs:286-302enumKey accepts the string "true" because it is in the allowed set.
Today no committed entry is affected (checked all 414), so this is a trap for the next contributor rather than live damage.
Suggested approach
parseScalar: strip #... outside quotes (or report a line error), with tests for inline lists, quoted strings containing #, and bare scalars.
validate.mjs: require Array.isArray for subcategories, formats, tags (and hardware_tags, ue_versions); require typeof v === "boolean" or the literal varies/unknown for commercial and attribution_required; reject quoted booleans with a message that names the fix.
Drop the inline comments from TEMPLATE.md (move the guidance to the comment lines above) or make newEntryText strip them from every field.
Add fixtures to checks.test.mjs for each case.
Done when
A string tags or a quoted boolean fails npm run validate with a clear message, the template round-trips through the scaffold to a valid entry, and the parser tests cover trailing comments.
Activity
Open issues sweep: validation types, incremental build, added dates, …