IF Commons GitHub

extensions

Written to: 2 requirements: 2 proved, 0 partly, 0 failing, 0 with no test recorded. 0001-kanon-checker FR-012, 0001-kanon-checker FR-006

The check of a package that extends a host (commons 0033-kanon FR-019, FR-020, FR-021): a dialect or a plugin, a package of its own, reaches the host only through the host's public exports, and reaches no other member of the host's family but a declared dependency. Given the host's table and exports, the extension's table, files and exports, it returns findings in the form of the import check, so that one baseline holds all of them.

Pure. What the extension is comes from the host's table, never from the extension: a package is a dialect where the host declares an instance of package placement with its name, a plugin where the host declares it, and neither is family/name. A dialect may reach the units of the host that its instance's unit may import (the layers above it, and what that unit's row lists, which is the dialect port); a plugin may reach any unit of the host that its exports names, and the plugin contract where the family has one. An import of the extension's own files by a relative path that leaves the package is layers/relative, as in any library.

import { extensionFindings } from "@intellectual-frontiers/kanon";

Source: commons/kanon/src/extensions.ts

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

extensionFindingsfunction
function extensionFindings(host: Table, hostExports: Readonly<Record<string, string | { readonly [condition: string]: string; }>>, ext: Table, files: readonly SourceFile[], exportsMap: Readonly<Record<string, string | { readonly [condition: string]: string; }>>): readonly Finding[]

Every finding of a package that extends a host: the import check over its own table, and the rules of an extension.

ParameterWhat it is
hostthe host library's table
hostExportsthe exports of the host's package
extthe extension's table, which names the host it extends
filesthe extension's files, from its root with /
exportsMapthe exports of the extension's package

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

roleOffunction
function roleOf(host: Table, packageName: string): Role | undefined

The role the host's table gives a package, or undefined where the host declares it as nothing.

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

roleOfForeignfunctionno test imports it
function roleOfForeign(host: Table, ext: Table): Role | undefined

The role of an extension of another scope, from its own table (0033-kanon FR-027): the role it declares, where it is the one its package name reads as by the host's rule and, for a dialect, where the unit it is an instance of is a layered unit of the host. undefined where it declares none or one that its name does not bear out.

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