import type { LookupByPath } from '@rushstack/lookup-by-path'; import { type IPackageJson } from '@rushstack/node-core-library'; import { type IFileDiffStatus } from '@rushstack/package-deps-hash'; import type { ITerminal } from '@rushstack/terminal'; import type { RushConfiguration } from '../api/RushConfiguration'; import { RushProjectConfiguration } from '../api/RushProjectConfiguration'; import type { RushConfigurationProject } from '../api/RushConfigurationProject'; import { type GetInputsSnapshotAsyncFn } from './incremental/InputsSnapshot'; /** * @beta */ export interface IGetChangedProjectsOptions { targetBranchName: string; terminal: ITerminal; shouldFetch?: boolean; variant?: string; /** * If set to `true`, consider a project's external dependency installation layout as defined in the * package manager lockfile when determining if it has changed. */ includeExternalDependencies: boolean; /** * If set to `true` apply the `incrementalBuildIgnoredGlobs` property in a project's `rush-project.json` * and exclude matched files from change detection. */ enableFiltering: boolean; /** Optional request-owned configuration source, avoiding shared project/rig caches. */ getIncrementalBuildIgnoredGlobsAsync?: (project: RushConfigurationProject) => Promise | undefined>; /** * If set to `true`, excludes projects where the only changes are: * - A version change to `package.json`, optionally accompanied by changes to `peerDependencies` * - Changes to `CHANGELOG.md` and/or `CHANGELOG.json` files * * This prevents `rush version --bump` from triggering `rush change --verify` to request change files * for the version bumps and changelog updates it creates. */ excludeVersionOnlyChanges?: boolean; } /** * @internal */ export interface IRawRepoState { projectState: Map> | undefined; rootDir: string; rawHashes: Map; } /** * @beta */ export declare class ProjectChangeAnalyzer { #private; constructor(rushConfiguration: RushConfiguration); /** * Gets a list of projects that have changed in the current state of the repo * when compared to the specified branch, optionally taking the shrinkwrap and settings in * the rush-project.json file into consideration. */ getChangedProjectsAsync(options: IGetChangedProjectsOptions): Promise>; protected getChangesByProject(lookup: LookupByPath, changedFiles: Map): Map>; /** * Gets a snapshot of the input state of the Rush workspace that can be queried for incremental * build operations and use by the build cache. * * @remarks * If the state cannot be calculated, this writes a warning and continues without a snapshot. With * `throwOnMissingProjectShrinkwrapFile`, a missing project dependency file (shrinkwrap-deps.json) instead * throws its error, whether it is detected when the provider is created or when a snapshot fails. A host that * cannot continue without a snapshot can then report that actionable cause. * * With `reuseUnchangedInputs`, the provider keeps the state of the Git repository between snapshots, and * returns its previous snapshot while the inputs are unchanged. This suits a long-lived host, such as the Rush * daemon, that takes a snapshot for each request. * @internal */ _tryGetSnapshotProviderAsync(projectConfigurations: ReadonlyMap, terminal: ITerminal, projectSelection?: ReadonlySet, options?: { readonly throwOnMissingProjectShrinkwrapFile?: boolean; readonly reuseUnchangedInputs?: boolean; }): Promise; /** * @internal */ _filterProjectDataAsync(project: RushConfigurationProject, unfilteredProjectData: Map, rootDir: string, terminal: ITerminal, getIgnoreGlobsAsync?: IGetChangedProjectsOptions['getIncrementalBuildIgnoredGlobsAsync']): Promise>; } /** * Returns the error that {@link ProjectChangeAnalyzer._tryGetSnapshotProviderAsync} reports for a missing * project dependency file, if any is missing. This happens when a project is added before "rush install". */ export declare function tryGetMissingProjectShrinkwrapFileErrorAsync(rushConfiguration: RushConfiguration): Promise; /** * Compares two package.json file contents and determines whether the package's version changed and * all other changes are limited to peerDependencies. * @param oldPackageJsonContent - The old package.json content as a string * @param newPackageJsonContent - The new package.json content as a string * @returns true if the package version changed and every other field except peerDependencies is unchanged */ export declare function isPackageJsonVersionOnlyChange(oldPackageJsonContent: string, newPackageJsonContent: string): boolean; /** * Determines whether a package.json differs only by its version and peerDependencies. */ export declare function isPackageJsonVersionBumpChange(oldPackageJson: IPackageJson, newPackageJson: IPackageJson): boolean; //# sourceMappingURL=ProjectChangeAnalyzer.d.ts.map