import { ChangelogSection } from './changelog-notes'; import { GitHub, GitHubRelease } from './github'; import { Version } from './version'; import { PullRequest } from './pull-request'; import { ReleasePullRequest } from './release-pull-request'; import { ReleaseType, VersioningStrategyType, ChangelogNotesType } from './factory'; import { Release } from './release'; /** * These are configurations provided to each strategy per-path. */ export interface ReleaserConfig { releaseType: ReleaseType; versioning?: VersioningStrategyType; bumpMinorPreMajor?: boolean; bumpPatchForMinorPreMajor?: boolean; releaseAs?: string; skipGithubRelease?: boolean; draft?: boolean; prerelease?: boolean; draftPullRequest?: boolean; component?: string; packageName?: string; includeComponentInTag?: boolean; pullRequestTitlePattern?: string; changelogSections?: ChangelogSection[]; changelogPath?: string; changelogType?: ChangelogNotesType; versionFile?: string; extraFiles?: string[]; } export interface CandidateReleasePullRequest { path: string; pullRequest: ReleasePullRequest; config: ReleaserConfig; } export interface CandidateRelease extends Release { pullRequest: PullRequest; path: string; draft?: boolean; prerelease?: boolean; } interface ReleaserConfigJson { 'release-type'?: ReleaseType; 'bump-minor-pre-major'?: boolean; 'bump-patch-for-minor-pre-major'?: boolean; 'changelog-sections'?: ChangelogSection[]; 'release-as'?: string; 'skip-github-release'?: boolean; draft?: boolean; prerelease?: boolean; 'draft-pull-request'?: boolean; label?: string; 'release-label'?: string; 'include-component-in-tag'?: boolean; 'changelog-type'?: ChangelogNotesType; 'pull-request-title-pattern'?: string; 'version-file'?: string; 'extra-files'?: string[]; } export interface ManifestOptions { bootstrapSha?: string; lastReleaseSha?: string; alwaysLinkLocal?: boolean; separatePullRequests?: boolean; plugins?: PluginType[]; fork?: boolean; signoff?: string; manifestPath?: string; labels?: string[]; releaseLabels?: string[]; draft?: boolean; prerelease?: boolean; draftPullRequest?: boolean; groupPullRequestTitlePattern?: string; } interface ReleaserPackageConfig extends ReleaserConfigJson { 'package-name'?: string; component?: string; 'changelog-path'?: string; } export declare type PluginType = 'node-workspace' | 'cargo-workspace'; /** * This is the schema of the manifest config json */ export interface ManifestConfig extends ReleaserConfigJson { packages: Record; 'bootstrap-sha'?: string; 'last-release-sha'?: string; 'always-link-local'?: boolean; plugins?: PluginType[]; 'separate-pull-requests'?: boolean; 'group-pull-request-title-pattern'?: string; } export declare type ReleasedVersions = Record; export declare type RepositoryConfig = Record; export declare const DEFAULT_RELEASE_PLEASE_CONFIG = "release-please-config.json"; export declare const DEFAULT_RELEASE_PLEASE_MANIFEST = ".release-please-manifest.json"; export declare const ROOT_PROJECT_PATH = "."; export declare const MANIFEST_PULL_REQUEST_TITLE_PATTERN = "chore: release ${branch}"; interface CreatedRelease extends GitHubRelease { path: string; version: string; major: number; minor: number; patch: number; } export declare class Manifest { private repository; private github; readonly repositoryConfig: RepositoryConfig; readonly releasedVersions: ReleasedVersions; private targetBranch; private separatePullRequests; readonly fork: boolean; private signoffUser?; private labels; private releaseLabels; private plugins; private _strategiesByPath?; private _pathsByComponent?; private manifestPath; private bootstrapSha?; private lastReleaseSha?; private draft?; private prerelease?; private draftPullRequest?; private groupPullRequestTitlePattern?; /** * Create a Manifest from explicit config in code. This assumes that the * repository has a single component at the root path. * * @param {GitHub} github GitHub client * @param {string} targetBranch The releaseable base branch * @param {RepositoryConfig} repositoryConfig Parsed configuration of path => release configuration * @param {ReleasedVersions} releasedVersions Parsed versions of path => latest release version * @param {ManifestOptions} manifestOptions Optional. Manifest options * @param {string} manifestOptions.bootstrapSha If provided, use this SHA * as the point to consider commits after * @param {boolean} manifestOptions.alwaysLinkLocal Option for the node-workspace * plugin * @param {boolean} manifestOptions.separatePullRequests If true, create separate pull * requests instead of a single manifest release pull request * @param {PluginType[]} manifestOptions.plugins Any plugins to use for this repository * @param {boolean} manifestOptions.fork If true, create pull requests from a fork. Defaults * to `false` * @param {string} manifestOptions.signoff Add a Signed-off-by annotation to the commit * @param {string} manifestOptions.manifestPath Path to the versions manifest * @param {string[]} manifestOptions.labels Labels that denote a pending, untagged release * pull request. Defaults to `[autorelease: pending]` * @param {string[]} manifestOptions.releaseLabels Labels to apply to a tagged release * pull request. Defaults to `[autorelease: tagged]` */ constructor(github: GitHub, targetBranch: string, repositoryConfig: RepositoryConfig, releasedVersions: ReleasedVersions, manifestOptions?: ManifestOptions); /** * Create a Manifest from config files in the repository. * * @param {GitHub} github GitHub client * @param {string} targetBranch The releaseable base branch * @param {string} configFile Optional. The path to the manifest config file * @param {string} manifestFile Optional. The path to the manifest versions file * @returns {Manifest} */ static fromManifest(github: GitHub, targetBranch: string, configFile?: string, manifestFile?: string, manifestOptionOverrides?: ManifestOptions): Promise; /** * Create a Manifest from explicit config in code. This assumes that the * repository has a single component at the root path. * * @param {GitHub} github GitHub client * @param {string} targetBranch The releaseable base branch * @param {ReleaserConfig} config Release strategy options * @param {ManifestOptions} manifestOptions Optional. Manifest options * @param {string} manifestOptions.bootstrapSha If provided, use this SHA * as the point to consider commits after * @param {boolean} manifestOptions.alwaysLinkLocal Option for the node-workspace * plugin * @param {boolean} manifestOptions.separatePullRequests If true, create separate pull * requests instead of a single manifest release pull request * @param {PluginType[]} manifestOptions.plugins Any plugins to use for this repository * @param {boolean} manifestOptions.fork If true, create pull requests from a fork. Defaults * to `false` * @param {string} manifestOptions.signoff Add a Signed-off-by annotation to the commit * @param {string} manifestOptions.manifestPath Path to the versions manifest * @param {string[]} manifestOptions.labels Labels that denote a pending, untagged release * pull request. Defaults to `[autorelease: pending]` * @param {string[]} manifestOptions.releaseLabels Labels to apply to a tagged release * pull request. Defaults to `[autorelease: tagged]` * @returns {Manifest} */ static fromConfig(github: GitHub, targetBranch: string, config: ReleaserConfig, manifestOptions?: ManifestOptions, path?: string): Promise; /** * Build all candidate pull requests for this repository. * * Iterates through each path and builds a candidate pull request for component. * Applies any configured plugins. * * @returns {ReleasePullRequest[]} The candidate pull requests to open or update. */ buildPullRequests(): Promise; /** * Opens/updates all candidate release pull requests for this repository. * * @returns {number[]} Pull request numbers of release pull requests */ createPullRequests(): Promise<(PullRequest | undefined)[]>; private createOrUpdatePullRequest; private findMergedReleasePullRequests; /** * Find merged, untagged releases and build candidate releases to tag. * * @returns {CandidateRelease[]} List of release candidates */ buildReleases(): Promise; /** * Find merged, untagged releases. For each release, create a GitHub release, * comment on the pull request used to generated it and update the pull request * labels. * * @returns {GitHubRelease[]} List of created GitHub releases */ createReleases(): Promise<(CreatedRelease | undefined)[]>; private createReleasesForPullRequest; private createRelease; private getStrategiesByPath; private getPathsByComponent; } export {};