Skip to content

Metaplate v0.8.1

Choose a tag to compare

@github-actions github-actions released this 04 Nov 02:09

Metaplate v0.8.1

Metaplate 0.8.1 closes the gaps found by putting 0.8.0 into production on a real Next.js static export. Three new render guards catch text that sits in a crop strip, crowds other text, or runs under a photo. --require-content now checks JPEG cards. verify takes directories and globs, so it works in npm scripts on Windows, and runCli runs any command from a script without a shell. verify-page reads the twitter:image type and size that Next.js emits, and stops warning about formats it has already measured.

Upgrade recommendation: Recommended for every 0.8.0 user. The satori peer floor rises to 0.38.2: if your project pins an older Satori, upgrade it first (see Breaking changes).

Why upgrade

  • Catch broken cards that stay inside the canvas. overflow only sees text that leaves the image. The new safeArea, textOverlap, and avoid guards fail a footer pushed into the strip X's 2:1 crop removes, a line crowding the one below it, and a headline running under a photo.
  • Check JPEG cards after the build. The rendering guide recommends JPEG for photographic cards, and --require-content now decodes JPEG as well as PNG, so a blank JPEG card fails the build.
  • See what a dependency upgrade changed. Guards say nothing is broken, not that nothing moved. metaplate verify --baseline compares every card with a saved copy and fails the ones that changed, with a picture of each change, so a Satori, Resvg, or font upgrade cannot quietly shift every card.
  • Verify every card from any shell, or from code. metaplate verify out/og and metaplate verify "out/og/*/og-image.jpg" work in npm scripts on Windows, where cmd.exe expands nothing. runCli from metaplate/cli runs the same commands in-process.

Highlights

Render guards

  • safeArea reports text outside the area that the centered 2:1 crop (X summary_large_image) and the 1.91:1 crop (Open Graph) both keep. For 1200x630 that removes 15px from the top and bottom, the same crops metaplate preview overlays. { level, inset } sets your own margin instead.
  • textOverlap reports two text elements whose boxes intersect.
  • avoid: { level, keys, gap } reports text within gap pixels of an element whose React key is listed, such as key="photo" on an <img>.
  • All three run in createSvgOg, createNodeOg, and createEdgeOg, and each issue lists the text and its box. See Render guards.
  • metaplate/node and metaplate/edge now export the SatoriOptions and SatoriLayoutNode types, so satori: { onNodeDetected } no longer needs a cast to Satori's own SatoriOptions, which requires width, height, and fonts.

Image and page checks

  • verify --baseline DIR compares cards with a baseline. Each PNG or JPEG is matched with the file at the same relative path in DIR. A card fails when more of its pixels changed than --max-diff allows (default 0), when it has no baseline, or when a baseline file has no card. --threshold sets how far a channel may move before a pixel counts as changed: 0 for PNG by default, and 16 when either side is a JPEG, so re-encoding noise does not count. --write-diff DIR writes the baseline, the current card, and the changed pixels in red side by side, and --update-baseline rewrites the baseline after review. compareImages from metaplate/node runs the same comparison in tests. JPEGs are fully decoded with no new dependency, within a few levels of libjpeg. See Compare against a baseline.
  • --require-content decodes JPEG. Baseline and progressive Huffman JPEGs are supported, with any chroma subsampling, restart markers, grayscale, and Adobe CMYK, and no new dependency. A JPEG fails only when every 8x8 block of every channel holds the same flat value, so a card with any detail never fails. WebP and GIF still fail with the flag, and that error now points to the plate's guards: { blank: "error" }. See Require visible content.
  • verify takes directories and globs. A directory stands for every image file below it (limited to --format when given). Globs support *, ?, **, [...], and {a,b}. Files are checked in sorted order, once each. See Directories and globs.
  • metaplate/cli (new entry) exports runCli(args, { stdout, stderr }). It resolves to the exit code, leaves process.exitCode alone, and keeps concurrent calls apart. See Run the CLI from a script.
  • verify-page reads twitter:image:type, :width, and :height. Next.js metadata emits them for a JPEG plate, and they are now checked against the fetched bytes like the og:image:* properties. When a page declares no type, target format rules read the fetched bytes instead of warning that compatibility "cannot be confirmed". See Page audits.

Breaking changes

  • The satori peer range is now >=0.38.2 <1 (was >=0.33.3 <1). Releases below 0.38.2 drop content without an error, and no guard can see it:

    • before 0.38.2, inset is ignored, so an inset: 0 overlay collapses to 0x0;
    • through 0.35.1, color: "transparent" text, the usual way to draw outline type with WebkitTextStroke, draws nothing;
    • 0.35.2 to 0.37.0 fail on import under Node ESM;
    • before 0.38.2, a fragment is laid out as a box of its own.

    Each was checked on Satori 0.33.5 through 0.63.2. This is a peer contract change in a patch release; a project on an older Satori gets a peer-dependency warning (or an ERESOLVE error under strict peers) until it upgrades.

  • verify-page target format results change for undeclared types. A page with no og:image:type now passes universal when the fetched image is PNG or JPEG (it was an error), and x now fails an undeclared SVG (it was a warning). socialImageCompatibility and verifySocialImage are unchanged.

Upgrade advice: run npm install satori@0.63 if npm ls satori shows a release below 0.38.2. Then re-run your verify-page --target checks once.

Install or upgrade

npm install metaplate@0.8.1

That single command still includes the framework-neutral SVG and PNG renderer: npm 7+ and pnpm 8+ install the satori, @resvg/resvg-js, and react peers. Yarn needs them added explicitly. Node.js 20 or newer is required.

Peer changes: satori rises to >=0.38.2 <1 (audited release 0.63.2). @resvg/resvg-wasm and next stay optional and unchanged.

New entry point: metaplate/cli.

Verification

  • npm run check passes: lint, the duplication scan, workflow pin policy, dependency inventory and Socket disposition policy, deployment evidence policy, release-note validation, source and example type checks, 1,341 tests, the build, and the package dry run.
  • npm run check:package installs the exact local tarball into clean consumers and builds, serves, and fetches images from every framework fixture.
  • The full JPEG decode behind --baseline was compared with libjpeg (Pillow) on baseline 4:2:0, progressive 4:2:2, 4:4:4, and grayscale images: every channel of every pixel was within 4 levels, and the test suite checks two of those against libjpeg's own output.
  • The JPEG content check was compared with libjpeg (Pillow) on 400 random JPEGs: baseline and progressive, every chroma subsampling, grayscale, CMYK, and restart intervals, flat and with one changed pixel. It agreed on every file.
  • Socket baseline. It is the Socket CLI deep score of the published metaplate@0.8.0, captured 2026-11-03. The package scores 78 overall; its own alerts are recentlyPublished (medium) and urlStrings (low). The same two high dependency alerts as 0.8.0 carry time-bounded dispositions that expire 2027-04-30: string.prototype.codepointat, under the Satori peer, and tslib@2.9.1's ownership change, reached only through optional and development dependencies. Socket scores only published packages, so 0.8.1 is scored after publication.
  • Hosted deployments. After publication, the Vercel, Netlify, and Deno Deploy fixtures are redeployed with the published 0.8.1 and checked for status, media type, dimensions, response headers, distinct bytes per slug, and non-blank content. That evidence is recorded in .planning/hosted-evidence/.
  • npm registry signature and SLSA provenance verification run after publication, against the published artifact.

Documentation and support

Full changelog