def effects.of

ezx@1.11.0.0 · src/add/plan.bend:559

import ezx@1.11.0.0/src/add/plan.bend as Plan
import Base
import ezx@1.11.0.0/src/add/world.bend as A
import ezx@1.11.0.0/src/lock/plan.bend as P
import ezx@1.11.0.0/src/lock/world.bend as W
import ezx@1.11.0.0/src/ledger/manifest.bend as M
import ezx@1.11.0.0/src/ledger/render.bend as Rend
import ezx@1.11.0.0/src/ledger/ignore.bend as I
import ezx@1.11.0.0/src/pkg/pkg.bend as K

559# what an add that walked a package does: the tree laid, ez.toml written,
560# `.gitignore` when the allowlist changes, the old committed tree removed, and
561# what a person is told
562def effects.of(
563  +dep: M.Dep,
564  +hash: String,
565  +at: String,
566  fs: List<&2, K.Source>,
567  ss: List<&2, K.Item>,
568  +manifest: M.Manifest,
569  +world: A.World
570) -> List<&2, P.Effect>:
571  +old = M.find(A.deps.of(manifest), M.dep.name(dep))
572  +left = A.deps.of(Rend.add.keep(manifest, dep))
573  +next = I.sync(left, A.ignore(world))
574  P.Lay{place.of(M.source.vendor(M.source.dep(old))), hash,
575    List.append(&2, W.Source, srcs(fs), [W.Source{"manifest", K.manifest_of(ss)}])} <>
576    (P.Write{A.toml(), Rend.show(Rend.add.keep(manifest, dep))} <>
577      ignore.put(String.eq(next, A.ignore(world)), next,
578        P.drops.of(gone(old, hash, left), says(hash, at, world))))

Uses (28)

Used by (1)