IF Commons GitHub

versions/notes

The impact a commit declares and the release notes made of the capabilities closed since the last tag (commons 0026-works-versioning FR-021, FR-023): a line Impact: major, Impact: minor or Impact: patch in a commit's message, and deterministic Markdown that lists each Closes #N line of the commits that touch a work's files, grouped by impact and ordered by issue number, so that the change log and the trace chain of 0020-ifccm are one thing.

Pure. The Closes lines are read by parseMessage of 0020-ifccm, which reads no Impact: trailer (0020-ifccm is not changed), so the trailer is read here: a line of its own, case of the word free, a quoted line (>) not read, and the greatest wins where a message has several. The notes hold no date, no author and no clock: the same commits give the same text.

import { impactOf } from "./notes.ts";
impactOf("Add a thing\n\nCloses #4\nImpact: minor\n"); // "minor"

Source: commons/mizan/src/versions/notes.ts

3 of 10 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

versions.impactOffunctionno test imports it
function impactOf(message: string): "major" | "minor" | "patch" | undefined

The impact a message declares by Impact: lines: the greatest of them, or undefined where it states none.

versions.impactOfCommitsfunctionno test imports it
function impactOfCommits(commits: readonly CommitFact[]): "major" | "minor" | "patch" | undefined

The greatest impact the commits state (the commits given are those that touch the work), or undefined where none does (FR-021: --impact auto then exits with 2).

versions.notesOffunctionno test imports it
function notesOf(input: NotesInput): string

The release notes as Markdown (FR-023): the capabilities closed, once each commit, grouped by impact (major, minor, patch, not stated) and ordered by issue number, and how many commits closed none.

versions.CommitFacttypeno test imports it
type CommitFact = {
  readonly sha: string;
  readonly subject: string;
  readonly message: string;
  readonly files: readonly string[];
};

A commit as the tools read it: its object name, its subject and whole message, and the paths it touched.

versions.NotesInputtypeno test imports it
type NotesInput = {
  readonly slug: string;
  readonly title: string;
  /** The version the notes are for: the record's. */
  readonly version: string | undefined;
  /** The tag the notes start after, or undefined for the whole history. */
  readonly from: string | undefined;
  /** The commits since it that touch the work's files, in any order. */
  readonly commits: readonly CommitFact[];
};

What notes are made of.

impactOffunction
function impactOf(message: string): "major" | "minor" | "patch" | undefined

The impact a message declares by Impact: lines: the greatest of them, or undefined where it states none.

Imported by 19 tests of the run (19 passed, 0 failed): the library's results

impactOfCommitsfunction
function impactOfCommits(commits: readonly CommitFact[]): "major" | "minor" | "patch" | undefined

The greatest impact the commits state (the commits given are those that touch the work), or undefined where none does (FR-021: --impact auto then exits with 2).

Imported by 19 tests of the run (19 passed, 0 failed): the library's results

notesOffunction
function notesOf(input: NotesInput): string

The release notes as Markdown (FR-023): the capabilities closed, once each commit, grouped by impact (major, minor, patch, not stated) and ordered by issue number, and how many commits closed none.

Imported by 19 tests of the run (19 passed, 0 failed): the library's results

CommitFacttypeno test imports it
type CommitFact = {
  readonly sha: string;
  readonly subject: string;
  readonly message: string;
  readonly files: readonly string[];
};

A commit as the tools read it: its object name, its subject and whole message, and the paths it touched.

NotesInputtypeno test imports it
type NotesInput = {
  readonly slug: string;
  readonly title: string;
  /** The version the notes are for: the record's. */
  readonly version: string | undefined;
  /** The tag the notes start after, or undefined for the whole history. */
  readonly from: string | undefined;
  /** The commits since it that touch the work's files, in any order. */
  readonly commits: readonly CommitFact[];
};

What notes are made of.

Titles, headings, exports, tables, columns and requirements. Esc closes.