prCreate.tool
This package holds more than this page lists. See all of its files in its world.
README.md
zm.prCreate
Send your changes to installed content upstream, as zm pr create does. For each origin world your installed content came from, the files you changed are three-way merged against the origin's current content (a region the origin changed too becomes a local conflict to resolve first), pushed as a branch and opened as a pull request on the origin world, which stays open: merge is opt-in ({ merge = true } merges it as it opens when you may merge there; where you may not, it stays open and its outcome's detail names the refusal), and zm.prMerge merges.
Where the branch goes depends on your role on the origin. With a role that pushes a branch there (contributor or above), it goes into the origin. Without one, it goes to your own public or unlisted fork of the origin: the first call forks the origin into your worlds and later calls reuse that fork, and the pull request on the origin comes from <fork>:<branch>, so the origin is written to only when its maintainer merges. The outcome names the fork as source_world (forked = true when that call made it). A private fork is refused as SOURCE_PRIVATE with nothing sent; make it public or unlisted and send again. Each refusal ZeroMind answers a proposal from outside with is named by its code in detail, with what to do: CONTRIBUTOR_BLOCKED, PROPOSAL_LIMIT_REACHED (close one of your open pull requests there), PROPOSAL_TOO_LARGE (send fewer roots at a time), RATE_LIMITED (wait for the window).
A root has one pull request at a time: while it is open, a later call sends the root as it stands now to that pull request, moving its branch (in the origin, or in your fork for a pull request proposed from it) to that world's content with your changes laid over it; the outcome names that pull request (status = "open", pr_number, branch, and source_world for one from your fork) with updated = true, or updated = false when it already held the root as it stands and nothing was pushed. Once it is merged or closed, zm.prCreate opens a new one for the root.
It returns an array of outcomes: for each origin world, one for the roots sent as a new pull request, and one per distinct open pull request some of its roots were added to (each names its pull request and only its own paths). status is open unless merged.
A change to a dependency an install placed (under deps/<guid>/) goes with the install, to the world the install came from. { targets = { "<guid>" } } naming the world the dependency came from, the guid of its deps/<guid>/ folder, sends that dependency's change there instead: it lands at the dependency's own path in that world, the pull request is kept on the dependency's root, and a merge moves the dependency to that world's new release inside the install. While that pull request is open, a call naming no target sends the dependency's change to it too, since a root has one pull request at a time; a call whose targets leave that world out sends the change with the install. A target none of the changes go to is answered skipped, naming the worlds they go to.
zm.prCreate() sends every installed asset that is ahead of its upstream; zm.prCreate({ "/source/Doom.component" }) sends the named install roots. zm.status lists what is ahead and zm diff <root> upstream shows the changes. { dryRun = true } reports the plan without sending anything.