Rush StackShopBlogEvents
Skip to main content

Home > @rushstack/package-deps-hash

package-deps-hash package

This package builds a JSON object containing the git hashes of all files used to produce a given NPM package. The Rush tool uses this library to implement incremental build detection.

Remarks

For more info, please see the package README.

Functions

Function

Description

ensureGitMinimumVersion(gitPath)

Checks the git version and throws an error if it is less than the minimum required version.

getDetailedRepoStateAsync(rootDirectory, additionalRelativePathsToHash, gitPath, filterPath)

(BETA) Gets the object hashes for all files in the Git repo, combining the current commit with working tree state. Uses async operations and runs all primary Git calls in parallel.

getGitHashForFiles(filesToHash, packagePath, gitPath)

Takes a list of files and returns the current git hashes for them

getPackageDeps(packagePath, excludedPaths, gitPath)

Builds an object containing hashes for the files under the specified packagePath folder.

getRepoChanges(currentWorkingDirectory, revision, gitPath)

(BETA) Find all changed files tracked by Git, their current hashes, and the nature of the change. Only useful if all changes are staged or committed.

getRepoRoot(currentWorkingDirectory, gitPath)

(BETA) Finds the root of the current Git repository

getRepoStateAsync(rootDirectory, additionalRelativePathsToHash, gitPath, filterPath)

(BETA) Gets the object hashes for all files in the Git repo, combining the current commit with working tree state. Uses async operations and runs all primary Git calls in parallel.

hashFilesAsync(rootDirectory, filesToHash, gitPath)

(BETA) Uses git hash-object to hash the provided files. Unlike getGitHashForFiles, this API is asynchronous, and also allows for the input file paths to be specified as an async iterable.

Interfaces

Interface

Description

IDetailedRepoState

(BETA) Information about the detailed state of the Git repository.

IFileDiffStatus

(BETA) Information about the changes to a file.