Log inGet started
Package

world_vcs.module

Newest version

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 under only when given.
  • removeUnused(opts?, ops) removes those dependencies, or with dryRun lists 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 a RemoveUnusedReport: removed, failed and a note.
  • uninstall(path, opts?, ops) removes the install whose root is path together with the dependencies only it used. A dependency something else uses stays and is named in kept with what uses it, and the install's record then stays only to place it: the record names the install's root deleted, so world.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 in kept_modified. When another install's files run the install's root (ops.requirers names their sites under runs), the root is handed to that install instead (handed_to): its record places the copy at moved_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 an UninstallReport.
  • installHolding(summaries, source, skip?) answers the install whose files source is 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 at dest (a site of theirs runs a copy at or under it), and those files.
  • isUninstalled(summary) answers whether an install record (one entry of install.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 the NOTICE_TEMPLATE notice whenever the set of unused dependencies changes, looking again only when the engine's dependency stamp moved and ready() answers true.
  • installInto(world, opsOf) grafts world.removeUnusedDeps and world.uninstall onto the world namespace and, in the engine VM, starts the watch. world_vcs.installInto calls it once at boot.
  • canonical(path) and onlyPaths(only, fn) read a path, or the only option, 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")