import type { VersioningSettings } from '@pnpm/types'; import type { Participant } from './participants.js'; import { type ProjectRefIndex } from './projectRefs.js'; /** * An epic resolved against the workspace: the lead's directory and the * directories of its member packages. The lead is never a member of its own * band. */ export interface ResolvedEpic { leadRef: string; leadDir: string; memberDirs: Set; } /** * Resolves each configured epic to its lead directory and the set of member * directories its selectors match. The lead (a single named package with a * semver version) is excluded from its own membership; a selector matching * it is a no-op. Membership selectors match name globs, `./`-prefixed * directory globs, and `!`-prefixed negations. */ export declare function resolveEpics(refs: ProjectRefIndex, participants: Map, versioning?: VersioningSettings): ResolvedEpic[]; /** * Rejects epic configurations that cannot be attributed unambiguously: a * package matched by two epics, and a fixed group that straddles an epic * boundary (a group must sit entirely inside or entirely outside an epic, so * its members never disagree on whether they are band-constrained). */ export declare function validateEpics(epics: ResolvedEpic[], fixedGroups: string[][]): void; /** * The band floor (`newMajor × 100`) an epic re-bases its members to, or null * when no re-base is due. A re-base fires only when the lead releases to a * new, higher *stable* major in this plan; a prerelease lead version (the lead * on a lane) defers the re-base until its stable release. */ export declare function epicRebaseFloor(epic: ResolvedEpic, participants: Map, newVersions: Map): number | null; export interface ApplyEpicBandVersionsOptions { participants: Map; /** The dirs the plan releases. */ state: ReadonlyMap; newVersions: Map; epics: ResolvedEpic[]; lanesByDir: Map; } /** * Overrides the computed version of every bumped epic member with the band * floor when its lead crosses to a new stable major. A member on a lane * re-bases to a prerelease of the floor; every other member to `floor.0.0`. */ export declare function applyEpicBandVersions(opts: ApplyEpicBandVersionsOptions): void; /** * The band of member majors an epic permits: `[leadMajor×100, leadMajor×100+99]`, * where `leadMajor` is the major the plan establishes for the lead: its * re-based major when the lead crosses to a new stable major, otherwise the * lead's current major (a prerelease lead does not open the next band). */ export interface EpicBand { major: number; low: number; high: number; contains: (memberMajor: number) => boolean; } export declare function epicBand(epic: ResolvedEpic, participants: Map, newVersions: Map): EpicBand; /** * Enforces that every released member's new major stays inside its epic's band. * The re-base already keeps members in band when the lead moves; this guards * the other direction: an ordinary `major` intent that would carry a member * over the band ceiling (`1199.x` → `1200.0.0` while the lead is still on 11) * is rejected rather than silently landing the member in the next band. */ export declare function enforceEpicBands(epics: ResolvedEpic[], participants: Map, newVersions: Map): void;