Skip to content

Metaplate v0.7.0

Choose a tag to compare

@github-actions github-actions released this 08 Sep 20:11
· 359 commits to main since this release

Metaplate v0.7.0

Metaplate 0.7 makes deployed social images verifiable end to end: the bytes a route serves, the metadata a page publishes, the headers a provider forwards, and the dependency tree behind the package are now checked by the same executable contracts, locally and in CI.

Upgrade recommendation: Recommended for every 0.6 user. Callers who configure Content-Type, Content-Length, Content-Encoding, or ETag through headers on createNodeOg, or who pass a custom output.contentType, must review the breaking changes below.

Why upgrade

Deploying an Open Graph route used to mean trusting that the image a function rendered matched the descriptor the page advertised and that the provider did not rewrite the response. Version 0.7 turns those assumptions into checks. verifySocialImage verifies encoded bytes against the published descriptor and the platform profiles in one report, artifact() returns bytes and metadata from the same copy so they cannot drift, and Node responses own their representation headers and can carry deterministic strong ETags.

The release also adds provider-neutral Fetchable route handlers, corrects the Vercel and Netlify examples against their documented conventions, verifies GIF files structurally, and ships an auditable supply-chain baseline: a dependency inventory derived from the lockfile, a Socket score artifact with dispositions for every high or critical alert, pinned CI actions, and release evidence bound to the commit that produced it.

Highlights

One verification contract for bytes and metadata

  • verifySocialImage(bytes, descriptor, { targets, maxFileSize }) from the root entry checks dimensions, media type, byte length, and every selected compatibility profile together. Structural image failures still throw; metadata and compatibility findings are returned for CI reporting.
  • metaplate verify gains --json for one stable report per file, repeatable --target profiles, --url and --alt descriptor fields, --max-file-size, and --format gif. File-level validity is reported separately from per-target compatibility, and metadata flags are rejected without a target rather than silently ignored.
  • GIF87a and GIF89a files are walked block by block: global and local color tables, graphic control, application, comment, and plain-text extensions, image data sub-blocks, and the trailer.
  • socialImageCompatibility accepts descriptors without a URL or alt text through checkUrl/checkAlt, and LinkedIn checks warn when an image drifts from the documented 1.91:1 aspect ratio.

Deployment contracts that match provider conventions

  • fetchable(copy) and fetchableFrom(resolve) on both createNodeOg and createNextOg return the { fetch } shape that Fetch-style providers consume directly. See the deployment routes guide, which now ships in the npm package.
  • The Vercel example consumes a Web Request per the Vercel Node.js runtime reference; the Netlify example reads params from the second context argument per the Netlify Functions configuration reference. Both forms, plus an Express service in the shape Railway documents, are exercised against the packed tarball, rendering two slugs per route to prove the request reached the copy resolver.
  • artifact(route, copy) returns bytes, byte length, format, content type, dimensions, descriptor metadata, and an optional ETag from one render.
  • Node responses now set Content-Length, never set Content-Encoding, and with etag: "sha256" (or etag: true) carry a strong ETag computed from the final encoded bytes.
  • Edge runtimes remain explicitly unsupported for the native renderer, and hosted provider certification is not claimed: the shipped evidence is local packed-contract evidence only.

Reliability and safety

  • Empty custom encoder output and syntactically invalid custom media types fail at definition or render time instead of becoming HTTP responses.
  • Content-Type, Content-Length, and Content-Encoding can no longer be configured through headers; previously a caller Content-Type was silently overwritten.
  • The CLI usage line, README, and CHANGELOG document every new flag and export.

Supply-chain and release evidence

  • npm run check:dependencies derives a reachability inventory from package-lock.json (regular, peer, optional-peer, optional, and development edges), requires every package to resolve to the npm registry with a sha512 integrity, forbids git, URL, and file dependencies, and takes hasInstallScript only from the lockfile so the inventory is identical on every platform. The published runtime dependency count is zero.
  • The official Socket baseline for metaplate@0.6.0 is committed as a hash-bound score artifact. Every high or critical alert must match exactly one disposition by type, package, version, and dependency path; critical alerts block release. The single high alert (a maintenance upgrade signal in a transitive Satori dependency) is an expiring, evidence-backed exception.
  • npm run check:workflows requires every GitHub Actions reference to be pinned to a full commit SHA, and CI runs npm audit signatures so every installed package carries a valid registry signature and, where published with provenance, a verifiable attestation.
  • npm run release:evidence re-runs the build, packed-artifact, inventory, deployment, Socket, and workflow checks, records each result with captured output, and writes a report bound to the commit and version. CI retains the bundle even when a check fails, and the bundle verifier rejects failed, foreign, or incomplete reports.

Breaking changes

  • createNodeOg throws a TypeError at definition time when headers contains Content-Type, Content-Length, or Content-Encoding, or contains ETag while automatic etag generation is enabled. Remove those headers; Metaplate sets the first two itself and never sets encoding. A caller ETag still passes through when etag is off.
  • A custom output.contentType must be a syntactically valid media type.
  • socialImageCompatibility throws a TypeError when the descriptor lacks width or height.

Install or upgrade

npm install metaplate@0.7.0

That single command includes the framework-neutral SVG and PNG renderer. Next
applications continue to supply their own compatible next dependency.

Verification

  • npm run check passes lint, a zero-tolerance duplication scan, workflow pin policy, dependency inventory and Socket disposition policy, deployment evidence policy, release-note validation, source and example type checks, 377 tests, build, and a 34-file package dry run.
  • npm run check:package passes against the exact local tarball: lean and standalone consumers, offline Next static export, Astro static build, Express service, React Router resource route, and the Vercel handlerFrom, Vercel Fetchable, and Netlify context.params deployment fixtures with image and response-header evidence.
  • npm run release:evidence records six passed release checks and a verified evidence bundle; CI uploads the bundle on every run.
  • The Socket score artifact is historical 0.6.0 evidence captured on 2026-08-25 and is not presented as a fresh scan of this release; refreshing it requires an authenticated Socket export.
  • npm registry signature and SLSA provenance verification run automatically after publication and remain the final release check because they cannot execute before the public artifact exists.

Documentation and support

Full changelog