Skip to content

v0.1.3

Choose a tag to compare

@markmals markmals released this 22 Apr 16:55
· 52 commits to main since this release

Fixes

  • Collection data types are no longer widened to any in downstream code. The generated sprinkles:content module referenced @standard-schema/spec directly, but that package is only a transitive dependency — consumers don't list it, so the import silently resolved to any and cascaded into DataEntry<any>. The generated module now references StandardSchemaV1 through @withsprinkles/content-layer (which every consumer already has) and inlines its own _InferSchemaOutput helper to read a schema's ~standard.types.output without a third-party import.
  • reference() now preserves the collection string literal. Previously reference("authors") returned a schema producing { collection: string; id: string }, which meant getEntry(post.data.author) widened to the union of all collections instead of resolving to the target collection's entry type. reference<C extends string>(collection: C) now returns ReferenceSchema<C>, so post.data.author.collection is "authors" and getEntry(post.data.author) returns CollectionEntry<"authors">.

Exports

  • StandardSchemaV1 is now re-exported as a type from the package root so generated types and advanced consumers can reference it without importing @standard-schema/spec directly.

Compatibility

No breaking runtime changes. Consumers who were relying on the old any-widened types may see new type errors surface — these were always real bugs being masked.