tcmts.cli.releases

Types

ApiReport type
PackageState type
A package as it is in some namespace state: its manifest, and what it exports from where.
Plan type
ReleaseError typeof ReleaseError

Server

apiReport (cb: Codebase, before: PackageState, after: PackageState) => ApiReport
What changed in a package's API from one state of it to another, lint by lint.
contributionsIn (cb: Codebase, list: Contribution[], plan: Plan) => Contribution[]
The merged contributions a release brings: whose merge is in its history and not the previous release's, and that changed something of the package's.
contributionsOn (cb: Codebase, remote: string | undefined) => Promise<Contribution[]>
The merged contributions a remote knows (where a release's are, when it's made off the server); none if it can't say.
draftFile (cb: Codebase, pkg: string) => string
The draft of a package's next release (its version is only settled when it's made).
generatedNotes (cb: Codebase, plan: Plan, contributions: Contribution[]) => string
The generated part of a release's notes.
packPackage (cb: Codebase, name: string | undefined, version: string | undefined, out: string | undefined, at?:…
Pack a package: a release of it (`version`), the branch as it was at a history entry (`at`, its hash: what `tcm builds make` packs), or the branch as it is. What it exports and its commands come from its manifest; what it uses of the codebase's other packages comes from their releases, as dependencies (but a tcm library's, `npm: false`, which it carries). A tcm library isn't packed.
packageState (cb: Codebase, rows: NameRow[], name: string) => PackageState | undefined
A package in a namespace state, if it's there.
planRelease (cb: Codebase, name: string | undefined, version: string | undefined, force: boolean) => Plan
The next release of a package on this branch: its version from the API's changes since its previous release (or as given, if that's at least as far).
releasePackage (cb: Codebase, o: { name?: string | undefined; version?: string | undefined; notesFile?: string | u…
Release a package: plan it, write its notes (the words from `notesFile`, or its draft if there is one; the changes from the codebase), record it. A draft whose words were used is removed: they're in the release now.
writeDraft (cb: Codebase, plan: Plan, generated: string) => string
Write the draft: a heading and room for a summary, then the generated part (regenerated when the release is made).

Shared

MARKER "<!-- tcm: the changes below are generated from the codebase when the release is made -->"
Where people's words end and the generated list of changes begins, in a draft and in the notes.
PLACEHOLDER "<!-- what this release is about, for the people who use it -->"
blockers (cb: Codebase, pkg: Pkg, all: Pkg[], rows: NameRow[]) => string | undefined
Why a package can't be released as it stands (work left in `tcm todo`; for a tcm library, code it uses from outside itself), if so.
changelog (cb: Codebase, pkg: string, upTo?: string | undefined) => string
A package's changelog: its releases' notes, newest first (up to `upTo`, if given).
code (s: string) => string
nextVersion (prev: string | undefined, level: Level | undefined) => string
The version a level of change calls for after `prev`: from 1.0, a major for breaking changes, a minor for additions, a patch otherwise; before 1.0, a minor for breaking changes and a patch for anything else (as npm and Cargo read 0.x versions).
notesOf (version: string, date: number, written: string, generated: string) => string
A release's notes in full: a heading, what people wrote, then what's generated.
outsideUses (cb: Codebase, pkg: Pkg, all: Pkg[], rows: NameRow[]) => string[]
What a package's code uses from outside it: definitions of the codebase that aren't the package's own (by their names here, or `#hash` for ones with none), its tests' included (they come with its namespace), not its manifest's. A tcm library (`npm: false`) mustn't use any: a codebase that adds it mounts its names, and what it uses outside them would arrive unnamed.
parseSpec (spec: string) => { name: string; version?: string | undefined; }
`name@1.2.3` (or `@scope/name@1.2.3`), or a bare name.
previousRelease (cb: Codebase, pkg: string, head?: string) => Release | undefined
The release of `pkg` this one follows: its newest one in this branch's history.
publish (cb: Codebase, plan: Plan, written: string, generated: string, author: string) => Release
Make the release: its notes are what was written (a draft, or a file), then the generated part.
reasonFor (plan: Plan) => string
Why a release has the version it has, in a few words.
rowsAt (cb: Codebase, causal: string) => NameRow[]
summaryOf (doc: string | undefined) => string | undefined
The first sentence of a definition's documentation.
writtenPart (text: string) => string
What people wrote in a draft (or a notes file): everything above the marker, without the heading tcm writes.