tcmts.cli.contributions

Types

ContributionError typeof ContributionError
ContributionView type
Mergeable type
Whether a contribution can be merged as it stands. `asText`: names both sides edited, apart, which the merge merges as text (if that typechecks, which merging finds).

Server

STATUS Record<"closed" | "merged" | "open", (s: string) => string>
author () => string
Who's commenting or merging: $TCM_AUTHOR, else the OS user. A server takes it from its maintainer's token as given; a contributor's token signs as its handle, whatever this says.
mergeContribution (cb: Codebase, id: number, by: string) => { mergedAs: string; todo: number; }
Merge a contribution into its target, by history: a fast-forward, or a three-way merge with no conflicts. With conflicts it's refused, saying how to bring the target in first.
mergeable (cb: Codebase, c: Contribution) => Mergeable
Whether a contribution merges into its target, settled as the merge settles it: a name both sides edited where the edits are apart is merged as text, not a conflict.
printContribution (v: ContributionView) => void
printContributions (list: Contribution[], where: string) => void
typeProblems (cb: Codebase, c: Contribution) => string[]
The type errors in what a contribution brings: the code its branch reaches (its names and everything they use) that the target didn't where the two parted, typechecked here, each definition under the options it was checked under. A server checks that what it receives is what it claims, not that it typechecks (a client could post code no tcm would save): merging is where a contribution's types are judged.
viewContribution (cb: Codebase, id: number) => ContributionView

Shared

closeContribution (cb: Codebase, id: number, by: string, reopen?: boolean) => void
commentOn (cb: Codebase, id: number, c: { author: string; body: string; about?: string | null | undefined; })…
find (cb: Codebase, id: number) => Contribution
onBranch <T>(cb: Codebase, branch: string, fn: () => T) => T
Run `fn` with `branch` current, then go back to the branch that was.
openContribution (cb: Codebase, c: { title: string; description: string; source: string; target: string; author: str…
Open a contribution of `source` into `target` (both branches here), or find the open one there already is.
quietly <T>(fn: () => T) => T
Run `fn` without its console output: a merge made for a remote client reports through the result, not here.
when (ts: number) => string