Builtin Library
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 or pins it, a source whose reference table depends on it, and a used dependency that depends on it. 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. It answers anUninstallReport.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")