Skip to content

v0.1.4

Choose a tag to compare

@markmals markmals released this 22 Apr 17:57
· 44 commits to main since this release

Fixes

  • findImporter now resolves entries by their collection, not by scanning stores by ID. Previously findCollectionForEntry walked every store and returned the first one whose keys contained entry.id, so two collections sharing an entry ID would silently route render(entry) to the wrong MDX importer (or throw No content found for entry "..." if the wrongly-picked collection had no matching slot). The collection is already attached to every entry during store serialization, so findImporter now reads entry.collection directly. Fixes cl-b2h.

Additions

  • New type exports: InferSchemaOutput<S> and ResolveSchema<T>. These were previously inlined inside the generated sprinkles:content module; lifting them into the package's public types deduplicates the codegen template and lets consumers (and our own type tests) reference the helpers directly.
  • Type-level tests for schema propagation through getCollection / getEntry / getEntries / render / reference, wired via Vitest's typecheck mode. These guard against the class of regressions fixed in v0.1.2 and v0.1.3.

Compatibility

No breaking changes. Consumers whose collection IDs already don't collide see no runtime behavior change. The emitted sprinkles:content type declaration now imports InferSchemaOutput and ResolveSchema from @withsprinkles/content-layer — this regenerates automatically on the next vp dev / vp build, no manual action needed.