Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0004-repoctl-status-release FR-001
repoctl status (commons repoctl 0004-repoctl-status-release FR-001 to FR-003 ): for each library of the repository, its version in the repository, the version npm shows and the version of its greatest tag, as rows (a table for a person, JSON for a program). What npm shows is reported as it shows it: a version that was published a short while ago may not be listed yet, and nothing here guesses that it is on its way. --offline asks no network: npm is not asked and the tags are those of the local clone.
import { tagsOf } from "./status.ts" ;
tagsOf ("abc \t refs/tags/core-v0.1.0 \n abc \t refs/tags/core-v0.1.0^{} \n " ).get ("core" ); // ["0.1.0"] Source: commons/repoctl/src/logical/status.ts
5 of 20 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.
logical.NpmCelltype no test imports it type NpmCell =
| { readonly kind : "skipped" }
| { readonly kind : "not-published" }
| { readonly kind : "absent" }
| { readonly kind : "unreachable" ; readonly why : string }
| { readonly kind : "found" ; readonly latest : string | undefined ; readonly hasRepoVersion : boolean };What npm shows of a library's package.
logical.TagCelltype no test imports it type TagCell =
| { readonly kind : "unreachable" ; readonly why : string }
| { readonly kind : "none" ; readonly source : "remote" | "local" }
| { readonly kind : "found" ; readonly latest : string ; readonly hasRepoVersion : boolean ; readonly source : "remote" | "local" };What the tags show of a library.
logical.Statetype no test imports it type State = "released" | "unpublished" | "untagged" | "unknown" | "held" ;Where a library stands, from the three versions.
logical.Rowtype no test imports it type Row = { readonly library : string ; readonly repo : string ; readonly npm : NpmCell ; readonly tag : TagCell ; readonly state : State };logical.StatusReporttype no test imports it type StatusReport = { readonly offline : boolean ; readonly rows : readonly Row [] };The status: its rows, in the order of the libraries' names.
logical.tagsOffunction no test imports it function tagsOf (text : string ): ReadonlyMap <string , readonly string []>The versions each library is tagged at, from the lines of git ls-remote --tags (a sha, a tab, the reference) or of git tag --list (the name alone).
logical.stateOffunction no test imports it function stateOf (lib : Pick <LibraryInfo , "held" | "npm" >, npm : NpmCell , tag : TagCell ): State Where a library stands: it is released when npm holds its repository version (or it is not on npm) and its tag is made; what is not known is unknown.
logical.runStatusfunction no test imports it function runStatus (w : World , options : { readonly offline : boolean ; }): Promise <Result <StatusReport , string >>Reads the status of every library. The error is why the libraries or the tags could not be read at all.
logical.findingsOfStatusfunction no test imports it function findingsOfStatus (r : StatusReport ): readonly Finding []The findings of a status: a registry or a tag list that could not be read, as warnings.
logical.tableOffunction no test imports it function tableOf (r : StatusReport ): string The table of a status for a person: one line for each library, columns aligned.
NpmCelltype no test imports it type NpmCell =
| { readonly kind : "skipped" }
| { readonly kind : "not-published" }
| { readonly kind : "absent" }
| { readonly kind : "unreachable" ; readonly why : string }
| { readonly kind : "found" ; readonly latest : string | undefined ; readonly hasRepoVersion : boolean };What npm shows of a library's package.
TagCelltype no test imports it type TagCell =
| { readonly kind : "unreachable" ; readonly why : string }
| { readonly kind : "none" ; readonly source : "remote" | "local" }
| { readonly kind : "found" ; readonly latest : string ; readonly hasRepoVersion : boolean ; readonly source : "remote" | "local" };What the tags show of a library.
Statetype no test imports it type State = "released" | "unpublished" | "untagged" | "unknown" | "held" ;Where a library stands, from the three versions.
Rowtype no test imports it type Row = { readonly library : string ; readonly repo : string ; readonly npm : NpmCell ; readonly tag : TagCell ; readonly state : State };StatusReporttype no test imports it type StatusReport = { readonly offline : boolean ; readonly rows : readonly Row [] };The status: its rows, in the order of the libraries' names.
function tagsOf (text : string ): ReadonlyMap <string , readonly string []>The versions each library is tagged at, from the lines of git ls-remote --tags (a sha, a tab, the reference) or of git tag --list (the name alone).
Imported by 14 tests of the run (14 passed, 0 failed): the library's results
function stateOf (lib : Pick <LibraryInfo , "held" | "npm" >, npm : NpmCell , tag : TagCell ): State Where a library stands: it is released when npm holds its repository version (or it is not on npm) and its tag is made; what is not known is unknown.
Imported by 14 tests of the run (14 passed, 0 failed): the library's results
function runStatus (w : World , options : { readonly offline : boolean ; }): Promise <Result <StatusReport , string >>Reads the status of every library. The error is why the libraries or the tags could not be read at all.
Imported by 21 tests of the run (21 passed, 0 failed): the library's results
function findingsOfStatus (r : StatusReport ): readonly Finding []The findings of a status: a registry or a tag list that could not be read, as warnings.
Imported by 14 tests of the run (14 passed, 0 failed): the library's results
function tableOf (r : StatusReport ): string The table of a status for a person: one line for each library, columns aligned.
Imported by 14 tests of the run (14 passed, 0 failed): the library's results