IF Commons GitHub

pins

Commons' pins as the tools read them (commons 0005-typescript-practice FR-026, 0002-packaging FR-019): the KEY=value lines of pins.auto.env, the suffix of a platform's variables, and the download of a pin on a platform (its version, address, SHA-256, format and folder), all taken from the file and written nowhere else.

Spec: 0001-libraries FR-006

Source: commons/libraries/src/pins.ts

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

pinSuffixfunction
function pinSuffix(os: string, arch: string): string | undefined

The suffix of commons' pin variables for a platform (by the names proc.build gives); undefined where commons pins no download for it.

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

readEnvFilefunction
function readEnvFile(text: string): ReadonlyMap<string, string>

The KEY=value lines of an env file; comments and blank lines left out.

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

PinFormattypeno test imports it
type PinFormat = "zip" | "tar" | "file";

The formats of what a pinned address gives.

PinDownloadtypeno test imports it
type PinDownload = {
  readonly version: string;
  readonly url: string;
  readonly sha256: string;
  readonly format: PinFormat;
  /** The folder of the programs inside the unpacked artifact; empty for the root. */
  readonly binPath: string;
};

What a download of a pin on a platform needs.

PinProblemtypeno test imports it
type PinProblem =
  | { readonly kind: "no-version"; readonly key: string }
  | { readonly kind: "not-pinned"; readonly key: string; readonly suffix: string }
  | { readonly kind: "bad-format"; readonly key: string; readonly suffix: string; readonly format: string };

Why a pin has no download on a platform.

describePinProblemfunction
function describePinProblem(p: PinProblem): string

The sentence a problem is told in.

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

pinDownloadfunction
function pinDownload(env: ReadonlyMap<string, string>, key: string, suffix: string): Result<PinDownload, PinProblem>

The download of the pin key (BUN) for the platform suffix (X86_64) as pins.auto.env states it, or why it has none.

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

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