world_vcs.module
This package holds more than this page lists. See all of its files in its world.
README.md
world_vcs.dependencies
The dependency copies under /zero/source/deps/ and what uses them. What uses a dependency is the engine's answer (install.dependencyUse): an install record that lists it, a source of the world with a reference site that runs a copy in it, and a used dependency with such a site. A site runs one copy of what it names, so a recorded version's copy under versions/ is used only by the sites that run that version. Nothing here commits: a removed row leaves as a deletion in the next commit, and a changed install record is a change the next commit carries.
unused(ops, only?)answers the dependencies nothing in the world uses, sorted by path, held to the roots at or underonlywhen given.removeUnused(opts?, ops)removes those dependencies, or withdryRunlists them. A dependency an install placed is deleted from that install's record, and the record is taken out once it holds nothing; one the world holds as rows of its own is removed as files. It answers aRemoveUnusedReport:removed,failedand anote.uninstall(path, opts?, ops)removes the install whose root ispathtogether with the dependencies only it used. A dependency something else uses stays and is named inkeptwith what uses it, and the install's record then stays only to place it: the record names the install's root deleted, soworld.installs()no longer lists the install, and installing the asset again puts its files back. A file this world changed or wrote itself stays as a file of the world, listed inkept_modified. When another install's files run the install's root (ops.requirersnames their sites underruns), the root is handed to that install instead (handed_to): its record places the copy atmoved_to, the path a fresh install of it uses (ops.placementOf), with the dependencies the uninstalled install placed, and the uninstalled install's record leaves (ops.handOver); nothing is removed. It answers anUninstallReport.installHolding(summaries, source, skip?)answers the install whose filessourceis one of: the installed root above it, or the install whose record places the dependency holding it, a carried install answering its carrier.installsRunning(summaries, requirers, dest)answers the installs whose files run the root of the install atdest(a site of theirs runs a copy at or under it), and those files.isUninstalled(summary)answers whether an install record (one entry ofinstall.summaries) names its own root, or a folder holding it, deleted: such a record was uninstalled and stays only to place the dependencies something else uses.noticeFor(unused, lastKey?)answers the key of an unused set, whether it is a change from the last notice posted, and the notice's params.watch(ops, ready)posts theNOTICE_TEMPLATEnotice whenever the set of unused dependencies changes, looking again only when the engine's dependency stamp moved andready()answers true.installInto(world, opsOf)graftsworld.removeUnusedDepsandworld.uninstallonto theworldnamespace and, in the engine VM, starts the watch.world_vcs.installIntocalls it once at boot.canonical(path)andonlyPaths(only, fn)read a path, or theonlyoption, in the/zero/source/...spelling.
local listed = world.removeUnusedDeps({ dryRun = true })
for _, dep in ipairs(listed.removed) do print(dep.path, dep.files) end
local report = world.uninstall("/zero/source/skate_physics.package", { dryRun = true })
print(#report.removed, "go,", #report.kept, "stay")