IF Commons GitHub

physical/adapters

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0001-repoctl-layers FR-006

The adapters of the ports of the Logical layer (commons repoctl 0001-repoctl-layers FR-006): the one place where Repoctl runs a program, reads or writes a file, asks the registry of npm or reads the environment for a credential. Each is a record of functions that fills a port; a program that is not installed is a run that ended with 127 and says so, never a throw. The credential is read here and only here, and what is read is held as a Secret, whose text, JSON and inspected form are [redacted].

import { systemWorld } from "@intellectual-frontiers/repoctl/physical";
const world = systemWorld("/path/to/checkout", (name) => process.env[name], { libraries: undefined });
world.repo; // "/path/to/checkout"

Source: commons/repoctl/src/physical/adapters.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.

physical.NPM_TOKEN_VARIABLEconstno test imports it
const NPM_TOKEN_VARIABLE: "INFRO_NPMJS_TOKEN"

The variable that holds the token for npm.

physical.systemProcessconstno test imports it
const systemProcess: Process

Programs run through the system, with the environment this process has plus what a run adds.

physical.systemFilesconstno test imports it
const systemFiles: Files

Files on the system's disk.

physical.npmRegistryconstno test imports it
const npmRegistry: Registry

What the registry of npm says of a package: its latest version and the versions it lists.

physical.envCredentialsfunctionno test imports it
function envCredentials(env: (name: string) => string | undefined): Credentials

The credentials a host holds, read from its environment by name: the token for npm.

physical.manifestLibrariesfunctionno test imports it
function manifestLibraries(repo: string, configured: boolean): Libraries

The libraries of the repository, read from their manifests; none where its configuration has no libraries.

physical.DOCS_PACKAGEconstno test imports it
const DOCS_PACKAGE: "@intellectual-frontiers/docs"

The package of the documentation generator, which repoctl docs loads where it is installed.

physical.systemDocsconstno test imports it
const systemDocs: DocsPort

The documentation generator: the package found in the node_modules of the repository or above it (an optional peer of this program, never carried by it).

physical.serveFolderfunctionno test imports it
function serveFolder(folder: string, port: number): Promise<{ readonly url: string; readonly close: () => Promise<void>; }>

A folder served on a loopback port (0 asks the system for one): the address and the function that stops it. Nothing leaves the computer: the socket is bound to 127.0.0.1.

physical.systemWorldfunctionno test imports it
function systemWorld(repo: string, env: (name: string) => string | undefined, config: Pick<Config, "libraries">): World

The world of a repository on this system: every port filled.

NPM_TOKEN_VARIABLEconstno test imports it
const NPM_TOKEN_VARIABLE: "INFRO_NPMJS_TOKEN"

The variable that holds the token for npm.

systemProcessconst
const systemProcess: Process

Programs run through the system, with the environment this process has plus what a run adds.

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

systemFilesconst
const systemFiles: Files

Files on the system's disk.

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

npmRegistryconstno test imports it
const npmRegistry: Registry

What the registry of npm says of a package: its latest version and the versions it lists.

envCredentialsfunctionno test imports it
function envCredentials(env: (name: string) => string | undefined): Credentials

The credentials a host holds, read from its environment by name: the token for npm.

manifestLibrariesfunction
function manifestLibraries(repo: string, configured: boolean): Libraries

The libraries of the repository, read from their manifests; none where its configuration has no libraries.

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

DOCS_PACKAGEconstno test imports it
const DOCS_PACKAGE: "@intellectual-frontiers/docs"

The package of the documentation generator, which repoctl docs loads where it is installed.

systemDocsconstno test imports it
const systemDocs: DocsPort

The documentation generator: the package found in the node_modules of the repository or above it (an optional peer of this program, never carried by it).

serveFolderfunction
function serveFolder(folder: string, port: number): Promise<{ readonly url: string; readonly close: () => Promise<void>; }>

A folder served on a loopback port (0 asks the system for one): the address and the function that stops it. Nothing leaves the computer: the socket is bound to 127.0.0.1.

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

systemWorldfunction
function systemWorld(repo: string, env: (name: string) => string | undefined, config: Pick<Config, "libraries">): World

The world of a repository on this system: every port filled.

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

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