IF Commons GitHub

license

The license of the repository and of every library in it, written and checked from one place (commons 0035-licensing). One official text, the PolyForm Noncommercial License 1.0.0 (license/PolyForm-Noncommercial-1.0.0.md, held to the SHA-256 of its standard), and one Required Notice: line for the licensor make the LICENSE of the root and of each library folder; the third-party notices are made from the record of what is vendored.

bun commons/libraries/src/license.ts write every LICENSE and THIRD_PARTY_NOTICES.md again bun commons/libraries/src/license.ts --check write nothing and exit 1 where any file is not what the manifests and the official text make other flags: --repo DIR (the repository, the working folder by default)

What is written: LICENSE at the root and in each commons/<name>/ that holds a manifest (library.ts), and THIRD_PARTY_NOTICES.md. What is only checked, because a person writes it: LICENSING.md, COMMERCIAL.md, NOTICE, CONTRIBUTING.md, CITATION.cff, the License section of README.md and the license of the root package.json. A library with a folder and no LICENSE is a finding that names the command above, so a new library runs it once. The packer writes the same identifier into the package.json it publishes (licenseOf).

import { licenseFileText } from "./license.ts";
licenseFileText("TEXT\n").startsWith("Required Notice: Copyright Intellectual Frontiers LLC"); // true

Spec: 0001-libraries FR-019

Source: commons/libraries/src/license.ts

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

COMMANDconst
const COMMAND: "bun commons/libraries/src/license.ts"

The command that writes what the check finds wrong.

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

licenseOffunction
function licenseOf(library: Pick<Library, "license"> | undefined): "PolyForm-Noncommercial-1.0.0"

The license of a library: its manifest's license, else the default of the repository.

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

REQUIRED_NOTICEconst
const REQUIRED_NOTICE: "Required Notice: Copyright Intellectual Frontiers LLC (https://github.com/intellectual-frontiers/.github)"

The line every LICENSE begins with, as the license asks of its licensor (its section Notices).

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

licenseFileTextfunction
function licenseFileText(official: string): string

The text of a LICENSE: the required notice, a blank line and the official text exactly as it is.

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

sentencefunction
function sentence(f: Finding): string

The one sentence of a finding.

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

Madetypeno test imports it
type Made = { readonly path: string; readonly text: string };

A file this module writes: its path from the repository and its whole text.

officialTextfunction
function officialText(id: "PolyForm-Noncommercial-1.0.0", folder?: string): Promise<Result<string, Finding>>

The official text of a license, held to the SHA-256 of its standard.

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

thirdPartyNoticesfunction
function thirdPartyNotices(items: readonly ThirdPartyItem[]): string

THIRD_PARTY_NOTICES.md made from the items.

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

Judgedtypeno test imports it
type Judged = { readonly made: readonly Made[]; readonly findings: readonly Finding[] };

The result of looking at a repository: what it should hold and what is wrong.

judgefunction
function judge(repo: string, folder?: string | undefined): Promise<Judged>

The files this module makes for a repository and what is wrong with the rest, read from the files and the manifests; nothing is written.

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

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