/*! * Copyright (c) Microsoft Corporation and contributors. All rights reserved. * Licensed under the MIT License. */ import { type ReleaseVersion, type VersionBumpType, type VersionScheme } from "@fluid-tools/version-tools"; import type { ReleaseReportConfig } from "../config.js"; import type { ReleaseGroup } from "../releaseGroups.js"; /** * A map of package names to full release reports. This is the format of the "full" release report. */ export interface ReleaseReport { [packageName: string]: ReleaseDetails; } /** * Full details about a release. */ export interface ReleaseDetails { version: ReleaseVersion; previousVersion?: ReleaseVersion; versionScheme: VersionScheme; date?: Date; releaseType: VersionBumpType; isNewRelease: boolean; releaseGroup?: ReleaseGroup; ranges: ReleaseRanges; } /** * Version range strings. These strings are included in release reports so that partners can use the strings as-is in * package.json dependencies. * * @remarks * * "minor" and "caret" are equivalent, as are "patch" and "tilde." All five are included because both terms are commonly * used by partners, and having both eases confusion. */ export interface ReleaseRanges { /** * A minor version range. Equivalent to caret. */ minor: string; /** * A patch version range. Equivalent to tilde. */ patch: string; /** * A caret version range. Equivalent to minor. */ caret: string; /** * A tilde version range. Equivalent to patch. */ tilde: string; /** * A legacy compatibility range that is configurable per release group. * This range extends beyond standard version ranges and lies between major and minor versions. * Exceeding this range indicates compatibility differences. */ legacyCompat: string; } /** * Get the release ranges for a version string. * * @param version - The version. * @param legacyCompatInterval - The multiple of minor versions to use for calculating the next version in the range. * @param releaseGroupOrPackage - Release group or package name * @param scheme - If provided, this version scheme will be used. Otherwise the scheme will be detected from the * version. * @returns The {@link ReleaseRanges} for a version string */ export declare const getRanges: (version: ReleaseVersion, legacyCompatInterval: ReleaseReportConfig, releaseGroupOrPackage: ReleaseGroup | string, scheme?: VersionScheme) => ReleaseRanges; /** * An interface representing a mapping of package names to their corresponding version strings or ranges. */ interface PackageVersion { [packageName: string]: string; } /** * A type representing the different kinds of report formats we output. * * "full" corresponds to the {@link ReleaseReport} interface. It contains a lot of package metadata indexed by package * name. * * The "caret", "tilde", and "legacy-compat" correspond to the {@link PackageVersion} interface. * Each of these compatibility classes contains a map of package names to their respective * equivalent version range strings: * "caret": caret-equivalent version ranges. * "tilde": tilde-equivalent version ranges. * "legacy-compat": legacy compat equivalent version ranges. */ export type ReportKind = "full" | "caret" | "tilde" | "simple" | "legacy-compat"; /** * Converts a {@link ReleaseReport} into different formats based on the kind. */ export declare function toReportKind(report: ReleaseReport, kind: ReportKind): ReleaseReport | PackageVersion; /** * Generates a new version representing the next version in a legacy compatibility range for any release group. * Does not support Fluid internal schema or prerelease versions. * * @param version - A string representing the current version. * @param interval - The multiple of minor versions to use for calculating the next version. * * @returns A string representing the next version in the legacy compatibility range. */ export declare function getLegacyCompatRange(version: string, interval: number): string; export {}; //# sourceMappingURL=release.d.ts.map