Rush StackShopBlogEvents
Skip to main content

Home > @microsoft/rush-lib > IInputsSnapshot

IInputsSnapshot interface

This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Represents a synchronously-queryable in-memory snapshot of the state of the inputs to a Rush repository.

The methods on this interface are idempotent and will return the same result regardless of when they are executed.

Signature:

export interface IInputsSnapshot 

Properties

Property

Modifiers

Type

Description

hashes

readonly

ReadonlyMap<string, string>

(BETA) The raw hashes of all tracked files in the repository.

hasUncommittedChanges

readonly

boolean

(BETA) Whether or not the repository has uncommitted changes.

rootDirectory

readonly

string

(BETA) The directory that all paths in hashes are relative to.

Methods

Method

Description

getOperationOwnStateHash(project, operationName)

(BETA) Gets the state hash for the files owned by this operation, including the resolutions of package.json dependencies. This will later be combined with the hash of the command being executed and the final hashes of the operation's dependencies to compute the final hash for the operation.

getTrackedFileHashesForOperation(project, operationName)

(BETA) Gets the map of file paths to Git hashes that will be used to compute the local state hash of the operation. Exposed separately from the final state hash to facilitate detailed change detection.