libraryReport

tcmts.cli.libraries.libraryReport · #ctdr5ozx · term · runs on the server

uses tcmts.cli.manifests.packagesIn, which uses tcmts.cli.config.configValue, which uses node:path

How a library's API changed between two versions, as a release says it, if both are packages (a manifest).

import type { Codebase } from "#codebase/tcmts/cli/codebase";
import { packagesIn } from "#codebase/tcmts/cli/manifests";
import { apiReport, packageState } from "#codebase/tcmts/cli/releases";
import type { ApiReport } from "#codebase/tcmts/cli/releases";
import type { NameRow } from "#codebase/tcmts/store";

export function libraryReport(
  cb: Codebase,
  before: NameRow[],
  after: NameRow[],
): ApiReport | undefined {
  const pkgOf = (rows: NameRow[]) => packagesIn(cb, rows).find((p) => p.namespace === "");
  const [b, a] = [pkgOf(before), pkgOf(after)];
  const was = b && packageState(cb, before, b.name);
  const now = a && packageState(cb, after, a.name);
  return was && now ? apiReport(cb, was, now) : undefined;
}

uses

used by