import type { PlanSetup } from "../app/setup.js"; import type { RepoGit } from "../git/reader.js"; import type { Session } from "../session.js"; import type { Plan, ReadonlyFs, Workspace } from "@tallyrelease/core"; /** Workspace, files and plan of a commit. */ interface PlannedCommit { workspace: Workspace; plan: Plan; fs: ReadonlyFs; } /** Head branch prefix of the prerelease PRs of every base branch. */ export declare const CUT_PREFIX = "tallyrelease/prerelease/"; /** Workspace, files and plan (`all`) at `sha`, read through `git`. */ export declare const planAtCommit: (session: Session, { git, opts, sha }: { git: RepoGit; opts: PlanSetup["opts"]; sha: string; }) => Promise; /** Workspace and plan at the first parent of `mergeSha`, undefined without one. */ export declare const planAtParent: (session: Session, { git, opts, mergeSha, }: { git: RepoGit; opts: PlanSetup["opts"]; mergeSha: string; }) => Promise<{ parent: string; plan: PlannedCommit | undefined; }>; /** * True when `head` descends from the previous cut tag (on `at.plan.head`'s * chain) of each unit in `ids`. */ export declare const descendsFromCuts: (at: Pick, { git, head, ids }: { git: RepoGit; head: string; ids: ReadonlySet; }) => Promise; /** `git` with `local` tags on top; dry runs tag here instead of the repository. */ export declare const withTags: (git: RepoGit, local: ReadonlyMap) => RepoGit; export interface ReleaseFlags { branch?: string; dryRun?: boolean; } /** A merged release PR tagged by `reconcile`, with its version tags. */ export interface Reconciled { number: number; /** Web URL of the PR. */ url: string; tags: string[]; /** Forge release URL by tag of the released units; null when not created in a dry run. */ releases: Map; /** Merge commit the tags point at. */ sha: string; /** Plan units at the first parent of `sha`. */ units: Plan["units"]; } /** * Tags merged release PRs labelled `tallyrelease: pending` on the branch, * oldest merge first: a PR whose marker matches its head and the plan at the * first parent of its merge gets its version, group release and floating tags * at the merge (one atomic push), a GitHub release per release tag and the * `released` label; any other PR is labelled `stale` with a comment. Merges * that are not in HEAD stay pending. Returns the tagged PRs, including those * whose tags existed, or undefined when `command` (`release` or `run`) is * skipped. `ready` runs after the skip checks and before any effect. */ export declare const reconcile: (session: Session, flags: ReleaseFlags, { command, ready }: { command: string; ready: () => Promise; }) => Promise; export {};