/*! * Copyright (c) Microsoft Corporation and contributors. All rights reserved. * Licensed under the MIT License. */ import { type VersionBumpType } from "@fluid-tools/version-tools"; import { type Command } from "@oclif/core"; import { BaseCommand, type Context, type VersionDetails } from "../../library/index.js"; import { type ReleaseGroup, type ReleasePackage } from "../../releaseGroups.js"; /** * Controls behavior when there is a list of releases and one needs to be selected. */ export type ReleaseSelectionMode = /** * The release should be selected interactively from a list of possible releases. */ "interactive" /** * The most recent release by date should be selected. */ | "date" /** * The highest version release should be selected. */ | "version" /** * The version of the package or release group in the repo should be selected. */ | "inRepo"; /** * A base class for release reporting commands. It contains some shared properties and methods and are used by * subclasses, which implement the individual command logic. */ export declare abstract class ReleaseReportBaseCommand extends BaseCommand { protected releaseData: PackageReleaseData | undefined; /** * The default {@link ReleaseSelectionMode} that the command uses. */ protected abstract readonly defaultMode: ReleaseSelectionMode; /** * The number of business days for which to consider releases recent. `undefined` means there is no limit. * Subclasses use this value to filter releases, format recent releases differently, etc. */ protected numberBusinessDaysToConsiderRecent: number | undefined; /** * The release group or package that is being reported on. */ protected abstract releaseGroupName: ReleaseGroup | ReleasePackage | undefined; /** * Returns true if the `date` is within `days` days of the current date. */ protected isRecentReleaseByDate(date?: Date): boolean; /** * Collect release data from the repo. Subclasses should call this in their init or run methods. * * @param context - The {@link Context}. * @param mode - The {@link ReleaseSelectionMode} to use to determine the release to report on. * @param releaseGroup - If provided, the release data collected will be limited to only the pakages in this release * group and its direct Fluid dependencies. * @param includeDependencies - If true, the release data will include the Fluid dependencies of the release group. */ protected collectReleaseData(context: Context, mode?: ReleaseSelectionMode, releaseGroupOrPackage?: ReleaseGroup | ReleasePackage, includeDependencies?: boolean): Promise; /** * Collects the releases of a given release group or package. * * @param context - The {@link Context}. * @param releaseGroupOrPackage - The release group or package to collect release data for. * @param repoVersion - The version of the release group or package in the repo. * @param latestReleaseChooseMode - Controls which release is considered the latest. * @returns The collected release data. */ private collectRawReleaseData; } export default class ReleaseReportCommand extends ReleaseReportBaseCommand { static readonly description = "Generates a report of Fluid Framework releases.\n\n The release report command is used to produce a report of all the packages that were released and their version. After a release, it is useful to generate this report to provide to customers, so they can update their dependencies to the most recent version.\n\n The command operates in two modes: \"whole repo\" or \"release group.\" The default mode is \"whole repo.\" In this mode, the command will look at the git tags in the repo to determine the versions, and will include all release groups and packages in the repo. You can control which version of each package and release group is included in the report using the --interactive, --mostRecent, and --highest flags.\n\n The \"release group\" mode can be activated by passing a --releaseGroup flag. In this mode, the specified release group's version will be loaded from the repo, and its immediate Fluid dependencies will be included in the report. This is useful when we want to include only the dependency versions that the release group depends on in the report."; static readonly examples: { description: string; command: string; }[]; static readonly enableJsonFlag = true; static readonly flags: { interactive: import("@oclif/core/interfaces").BooleanFlag; highest: import("@oclif/core/interfaces").BooleanFlag; mostRecent: import("@oclif/core/interfaces").BooleanFlag; releaseGroup: import("@oclif/core/interfaces").OptionFlag<"client" | "server" | "build-tools" | "gitrest" | "historian" | undefined, import("@oclif/core/interfaces").CustomOptions>; output: import("@oclif/core/interfaces").OptionFlag; baseFileName: import("@oclif/core/interfaces").OptionFlag; }; readonly defaultMode: ReleaseSelectionMode; releaseGroupName: ReleaseGroup | ReleasePackage | undefined; run(): Promise; private generateReleaseReport; private generateReleaseTable; } interface PackageReleaseData { [packageName: string]: RawReleaseData; } export interface RawReleaseData { repoVersion: VersionDetails; latestReleasedVersion: VersionDetails; latestReleaseType?: VersionBumpType; previousReleasedVersion?: VersionDetails; versions: readonly VersionDetails[]; } export {}; //# sourceMappingURL=report.d.ts.map