The manifest of a library of commons (commons 0027-commons-librariesFR-011 to FR-014) and the requirements it makes: a library is a folder commons/<name>/ that holds library.ts, an object literal read as data and never run, and this repository knows it from that file alone. The decoder of the manifest, the check that a manifest and its folder agree, and the generator of the section "The libraries" of 0027-commons-libraries and of its rows of enforcement.tsv.
bun commons/libraries/src/libraries.ts write the section and the rows again from the manifests bun commons/libraries/src/libraries.ts --check write nothing and exit 1 where a file is not what the manifests make, or where a manifest and its folder disagree other flags: --repo DIR (the repository, the working folder by default)
A manifest declares the library's name (its folder), its conformance level (L1 where it declares none, 0028-conformance-levels), the path of its spec kit, its verify command, its version, its exports (the keys of the package's exports) its family (a host and a role in a family of libraries, FR-023) and its distribution (the registries it is published to: github, the default, and npm as well where a decision about that package has made it so; FR-015 to FR-018). The section "The libraries" of the specification is between the markers <!-- libraries:begin --> and <!-- libraries:end -->, one requirement for each library numbered from FR-101, an id kept for the life of the library; the rows of those requirements are in enforcement.tsv. Adding a library is adding a folder with a manifest and running this command.
The manifest read from the text of its file: export const library = { ... } and no other export, read as data and never run (0027-commons-librariesFR-012).
type Library = {
/** The folder's name, and the package's: `@intellectual-frontiers/<name>`. */
readonly name: strin…(2473 characters)
typeLibrary= {
/** The folder's name, and the package's: `@intellectual-frontiers/<name>`. */readonlyname:string;
/** The conformance level the library is held to (`L1` where the manifest declares none). */readonlylevel:LevelKey;
/** The path of its spec kit from its folder; none at L0. */readonlyspecKit?:string;
/** The command that proves it, run from its folder with no argument. */readonlyverify:string;
/** Its version: the package's. */readonlyversion:string;
/** The keys of the package's `exports`. */readonlyexports:readonlystring[];
/** What it is, in a sentence, for the requirement made of it. */readonlysummary?:string;
/** Where it is published: always `github` (the GitHub package registry of the organization), and `npm` as well where a decision about that package has made it so (FR-015 and FR-016). */readonlydistribution:readonlyRegistry[];
/** The table of its layers where it is built to Kanon (commons 0033-kanon FR-010); none where it is not. */readonlykanon?:Table;
/** Its host and its role where it is of a family (a host, a dialect of it or a plugin of it; 0033-kanon FR-021, 0027-commons-libraries FR-023). */readonlyfamily?:LibraryFamily;
/** The license its `LICENSE` and its packed `package.json` carry, where it is not the default of the repository (`license/standard.ts`; commons 0035-licensing FR-003). */readonlylicense?:SpdxId;
/** The constants of its sources that say its own version (`ERGONEX_VERSION`), each a file from the library's folder and the name of the constant: the release rewrites them with the version, and a check finds one that disagrees. */readonlyversionConstants?:readonlyVersionConstant[];
/** The package the library publishes where it is not `@intellectual-frontiers/<name>` (the `data` library publishes `@intellectual-frontiers/arcactl`; commons 0036-distribution FR-009). */readonlypublishes?:PackageName;
/** The typed reason the library is not released, where there is one: a library with none is released (0001-libraries FR-024); a held library is verified and packed like any other, and has no release record entry, no tag, no set and no registry. */readonlyheld?:Hold;
/** The set the library is, where it is a metapackage: a folder with no code of its own whose package depends on the libraries of the set at exact versions (commons 0036-distribution FR-005). */readonlybundle?:BundleName;
};
What is wrong where a manifest and its folder disagree (0027-commons-librariesFR-013), one sentence each: a folder with a spec kit and no manifest, a manifest that cannot be read, that names another folder, a level above L0 with no spec kit, a spec kit that is not there, a package of another name, a version that is not the package's, exports that are not the package's, and a verify that is no script of the package.
The reason a library is not released (0001-librariesFR-024): a library is released unless its manifest carries one, and every one has its text. A library that is tests-only is a tool of tests that nothing depends on at run time; an unfinished one names what is missing and the condition that lifts the hold; an owner-blocked one is held by a decision of the owner that the text states.
The sets that a metapackage is: the whole of commons, and the four roles of the libraries; a closed union, and the name of the folder and of the package of each.
The libraries with a spec kit that the configuration of the site does not name (0001-librariesFR-025), one sentence each with the fix: a spec kit that commons/docs.config.ts does not list is a section of the site and of the books that is missing, which has turned the site and the tests red after a push. Read as text, never run; where the repository has no such file nothing is asked.
The id each library has: the one it had, or the next number after the greatest. A number belongs to the first library that holds it in the specification: where a second one holds it (two branches each gave the next number to a library, and a merge kept both), the second is given the next number after the greatest, so that the generator makes the section again with one number for each library.