Functions

Everything the CLI does is available programmatically, for a build script or a test that would rather assert than parse output.

import { inspectExtends, submodules } from '@fairgarden/distribution'

Distributions

assertExtends(root) throws on a violation, and describeViolations(report) formats one for a human.

Submodules

moveTo(submodule, tag) moves a checkout, setUrl(root, submodule, url) records a different url, and isPublic(url) asks whether a remote can be read without credentials.

Scaffolding and git

distributionRepo, monolithRepo and moduleRepo return the files a init writes, as a map of path to contents; write(root, files) writes them. addModule and extractModule are the add-module and extract commands.

toHttps(url) and isSsh(url) are the url rewriting, and addMount(source, mount, module) is the Next config edit.