fix(context): ignore non-string frontmatter title/description#91
Merged
Conversation
Some docs (e.g. Svelte 5's template-syntax pages) have unquoted YAML
frontmatter titles like `{@render ...}` or `{let/const ...}` that the
YAML parser reads as a flow-mapping object rather than a string. That
object propagated into a section's docTitle and was then passed to a
better-sqlite3 prepared statement as a positional argument, where it was
interpreted as a named-parameters bind object — leaving fewer values
than `?` placeholders and crashing the build with "Too few parameter
values were provided".
extractFrontmatter now keeps title/description only when they are
strings, falling back to the filename-derived title otherwise. This
unblocks publishing svelte@5.56.0 (and similarly-formatted docs).
https://claude.ai/code/session_01Dk6cdQKeX3Lr1eDoL1uTXM
🦋 Changeset detectedLatest commit: cdd9a7d The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The scheduled
publish-alljob failed fornpm/svelte@5.56.0with:All other packages built/published fine.
Root cause
Too few parameter values were providedis a better-sqlite3 error: when a positional argument to a prepared statement's.run()is a plain JS object, better-sqlite3 interprets it as a named-parameters bind map, consuming one slot — leaving fewer anonymous values than?placeholders.The offending object originated in one Svelte 5.56.0 doc file,
documentation/docs/03-template-syntax/11-declaration-tags.md, whose frontmatter is:{let/const ...}is unquoted and is valid YAML flow-mapping syntax, so the parser produced the object{ "let/const ...": null }instead of a string.extractFrontmatterblind-cast the parsed YAML, andparseMarkdownthen used that truthy object asdocTitle, which flowed intoinsertChunk.run(...)(6 placeholders) atpackage-builder.ts:117and crashed the build.Other svelte titles like
{#if ...}/{@render ...}start with{#/{@, which YAML rejects as flow maps and keeps as strings — which is why only this one package failed.Fix
extractFrontmatternow keepstitle/descriptiononly when they are actually strings, otherwise drops them sodocTitlefalls back to the filename-derived title.Validation
registry build svelte 5.56.0→ Built: 284 sections, 68643 tokens (exit 0).@neuledge/contexttests: 158 passed (added a regression test that fails on old code, passes on fix).@neuledge/context.@neuledge/contextpatch).https://claude.ai/code/session_01Dk6cdQKeX3Lr1eDoL1uTXM
Generated by Claude Code