~/bend-docscommunity

src/add/world.bend checks

raw source on the hub · import 0x886223f5c47e4983fe57d887c034bc7f/src/add/world.bend as World

add/world: what ez add reads. The arguments it was given; the directory it runs in (here), which every git question anchors a relative path to; HOME, which a ~/ target is expanded against; the ledger's text, None when there is no ez.toml; .gitignore's text, "" when there is none; and the answers to the questions the planner (add/plan.bend) asked. The questions and answers are the upgrade's (lock/up.bend), which the lock's interpreter answers: Tags, Head and Refs for what a ref names, and Clone for the checkout at the rev, with its NAR hash and every file's text. A hub package added by its <name>@<version> (add/hub.bend) asks the lock's own questions instead (lock/world.bend), which the lock's interpreter answers too: Name for the hash the hub says the name names, and Pkg for the package's manifest and files, served by the hub. Those answers are hubs.

Everything here is a projection: what a World says, read one way. The planner is written over these, so each law about the plan is a law about them.

7 imports
import Base
import ../lock/up.bend as Up
import ../lock/world.bend as W
import ../ledger/manifest.bend as M
import ../pkg/path.bend as P
import ../ez/target.bend as Tgt
import ../ez/named.bend as Named

Types

type Args source · line 27 · raw

Data

what ez add <target> [ref] [entry.bend] [--rename NAME] was given, each "" when it was not

type World source · line 31 · raw

Data

everything ez add reads

Definitions

def toml source · line 36 · raw

String

the ledger's path, which is fixed

def ignore.file source · line 40 · raw

String

the ignore file's path, which is fixed

def args source · line 44 · raw

@world:World -> Args

the arguments

def args.target source · line 48 · raw

@given:Args -> String

def args.ref source · line 52 · raw

@given:Args -> String

def args.entry source · line 56 · raw

@given:Args -> String

def args.rename source · line 60 · raw

@given:Args -> String

def target source · line 65 · raw

@world:World -> String

the target asked for

def ref source · line 69 · raw

@world:World -> String

the ref asked for, "" for none

def entry.arg source · line 72 · raw

@world:World -> String

def rename source · line 76 · raw

@world:World -> String

the --rename asked for, "" for none

def here source · line 80 · raw

@world:World -> String

the directory ez runs in, which is the project root

def home source · line 85 · raw

@world:World -> String

HOME, which a ~/ target is expanded against

def ledger source · line 90 · raw

@world:World -> Maybe<&2, String>

the ledger's text, None when there is no ez.toml

def ignore source · line 95 · raw

@world:World -> String

.gitignore's text, "" when there is none

def replies source · line 100 · raw

@world:World -> List<&2, 0x886223f5c47e4983fe57d887c034bc7f/src/lock/up.Reply>

every question answered so far

def hubs source · line 105 · raw

@world:World -> List<&2, 0x886223f5c47e4983fe57d887c034bc7f/src/lock/world.Reply>

every hub question answered so far

def read.of source · line 111 · raw

@got:Maybe<&2, String> -> 0x886223f5c47e4983fe57d887c034bc7f/src/ledger/manifest.Read

the ledger as read: what the file says, or, with no file, a read that did not parse and says why. A missing ledger is not an empty one to write back.

def read source · line 120 · raw

@world:World -> 0x886223f5c47e4983fe57d887c034bc7f/src/ledger/manifest.Read

the ledger, read

def manifest.of source · line 125 · raw

@led:0x886223f5c47e4983fe57d887c034bc7f/src/ledger/manifest.Read -> 0x886223f5c47e4983fe57d887c034bc7f/src/ledger/manifest.Manifest

the model of a ledger that read; an empty one otherwise, which nothing writes, since a ledger that did not read is refused

def deps.of source · line 133 · raw

@manifest:0x886223f5c47e4983fe57d887c034bc7f/src/ledger/manifest.Manifest -> List<&2, 0x886223f5c47e4983fe57d887c034bc7f/src/ledger/manifest.Dep>

the dependencies of a ledger that was read

def deps source · line 138 · raw

@world:World -> List<&2, 0x886223f5c47e4983fe57d887c034bc7f/src/ledger/manifest.Dep>

the ledger's dependencies, none when it did not read

def place source · line 142 · raw

@world:World -> 0x886223f5c47e4983fe57d887c034bc7f/src/ez/target.Place

where the target names

def url.of source · line 148 · raw

@place:0x886223f5c47e4983fe57d887c034bc7f/src/ez/target.Place -> @+home:String -> String

the source a place records: a URL as it is, a path as it was given with a leading ~/ expanded against HOME, and nothing for a target that names nothing

def url source · line 158 · raw

@+world:World -> String

the source the ledger records (EZ-LED-8)

def from source · line 163 · raw

@+world:World -> String

the source as git is to read it: a relative path taken from where ez runs, which is the project root. Every question the planner asks carries this.

def fresh source · line 168 · raw

@+world:World -> String

the name the source gives itself: a repository's, or the directory's the path resolves to

def aim source · line 172 · raw

@world:World -> 0x886223f5c47e4983fe57d887c034bc7f/src/ez/target.Aim

what the target names: a hub package by its <name>@<version>, or a place

def named source · line 176 · raw

@world:World -> Bool

whether the target is a hub package's <name>@<version>

def hub source · line 180 · raw

@world:World -> String

the hub the ledger names, which a name and its package are asked of