[bldr]docs
Build APIbldr

Member

A workspace member, as seen from build code.

type in bldr

A workspace member, as seen from build code.

A discriminated union on kind, so the typed accessor a member actually has is the only one reachable: rootDirectory exists on a directory member and nowhere else, container on an image member and nowhere else. Narrow first:

if (dep.kind !== "directory") throw new Error(`${dep.name} is not a directory`);
pod.mount(dep.rootDirectory, "/src");   // available only after narrowing

That is deliberate. Previously a consumer wrote Directory.fromCid(x.cid) against any member and found out at build time that it was an image; now the mismatch is a compile error.

type Member = DirectoryMember | ContainerImageMember | DagMember | OtherMember

See ContainerImageMember, DagMember, DirectoryMember, OtherMember.