~/bend-docscommunity

src/init/plan.bend fails

raw source on the hub · import ezx@1.7.0.0/src/init/plan.bend as Plan

init/plan: ez init as a pure planner. It asks nothing: its World is the name, entry and description asked for and four texts, each None when the file is not there: ez.toml, .gitignore, the entry file and src/lib.bend. The interpreter (init/run.bend) reads them, calls plan, and runs what it returns.

ez init starts a project and never writes over one. A ledger that is already there, whatever it holds, is refused with no effect at all, so its dependencies, tools and bin survive a second ez init. Otherwise the plan writes, in order: a new ledger naming the package and its entry; the ignore rules for what ez generates, added to .gitignore when it lacks them; src/lib.bend, when the stub below is written at the project's top and nothing is there yet; and a stub entry when there is none.

The layout is cargo's: the program at the top and a library under src/ that it imports, so the directory git would not keep empty holds a file. The stub opens with # <name>: <description>, since the hub describes a package by the first line of its first file by path (pub/blurb.bend), and the entry comes before anything under src/.

The Effect, Plan and Outcome types are the lock's (lock/plan.bend), which the add design moves to a shared plan/plan.bend later; see "Update (A1, A4)" in docs/rfc/ez-add-planner.md.

5 imports
import Base
import ../lock/plan.bend as P
import ../ledger/manifest.bend as M
import ../ledger/render.bend as Rend
import ../pub/blurb.bend as B