og-image/test
saberzero1 d81079740c
refactor: rename LocalQuartzPluginData to SocialImageFileData and export it
The type was a deliberate narrowing of QuartzPluginData that documents
which fields the og-image emitter populates before invoking a user's
imageStructure callback (including the plugin-synthesised 'text'
field). The old name implied accidental duplication, inviting
'helpful' future refactors that would inline it into QuartzPluginData
and silently widen the public API.

Rename to SocialImageFileData, export it from the package entry, and
add a docstring explaining why it must stay narrow. The type was
already visible in the generated .d.ts through ImageOptions, so making
the export explicit matches what consumers already see in their IDE.

Also adds a test suite (og-image previously had no tests):
- SocialImageFileData contract tests locking in the documented shape
- imageStructure callback signature compatibility
- defaultImage called with populated / minimal / readingTimeText
  override payloads returns a valid preact VNode
2026-04-16 15:45:18 +02:00
..
socialImageFileData.test.ts refactor: rename LocalQuartzPluginData to SocialImageFileData and export it 2026-04-16 15:45:18 +02:00