printCheck

tcmts.cli.main.printCheck · #6pin3pos · term · runs on the server

uses tcmts.cli.style.bold, which uses node:util

tcm release check: the next version, and every finding behind it.

import { printFindings } from "#codebase/tcmts/cli/main";
import type { Plan } from "#codebase/tcmts/cli/releases";
import { bold, dim, red, yellow } from "#codebase/tcmts/cli/style";

export function printCheck(plan: Plan) {
  if (!plan.prev)
    return console.log(
      `${plan.pkg.name}'s first release: ${bold(plan.computed)} ${dim(`(${plan.now.exported.size} definition(s))`)}`,
    );
  const level = plan.level
    ? {
        major: red("breaking changes"),
        minor: yellow("additions"),
        patch: "changes with the same API",
      }[plan.level]
    : dim("no API changes");
  console.log(
    `${plan.pkg.name}'s next release: ${bold(plan.computed)} ${dim(`(after ${plan.prev.version})`)}: ${level}`,
  );
  printFindings(plan.report!);
}

uses

used by