Skip to main content

Function: formatCompatibilityReport()

formatCompatibilityReport(report): string

Defined in: packages/core/src/formatCompatibilityReport.ts:27

Renders a report as the plain text a CI log or a terminal wants — one line when everything cleared, otherwise a counted heading followed by each broken route with its blocks indented beneath it. The count of pointers examined opens both forms, so a run that read an empty store cannot be mistaken for a run that cleared a full one.

Parameters

report

CompatibilityReport

A report from checkCompatibility, or any value of that shape.

Returns

string

The whole report as one string, newline-separated and with no trailing newline. Split it on \n for a logger that takes lines.

Example

import { checkCompatibility, formatCompatibilityReport } from "@nubbin/core";

formatCompatibilityReport(checkCompatibility(live, registry));
// 1 of 8 live route pointer(s) are incompatible with this registry:
// / (artifact 4a162726)
// Hero: page needs v1, no longer in the registry