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
readDistribution— what a distribution shipsinspectExtends— how it stands against its parentfindFloorViolations— compare two directly
assertExtends(root) throws on a violation, and describeViolations(report)
formats one for a human.
Submodules
submodules— the modules a repository shipsinspect— one module's version and what is newertarget— the version a bump would move to
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.