From 9303cfff351cb7b6974403aa3d15e8ae43b2ac85 Mon Sep 17 00:00:00 2001 From: Tyler Butler Date: Tue, 22 Oct 2024 10:13:45 -0700 Subject: [PATCH] export git APIs --- .../api-report/build-infrastructure.api.md | 27 +++++++++++++++++++ .../build-infrastructure/src/index.ts | 20 ++++++-------- 2 files changed, 35 insertions(+), 12 deletions(-) diff --git a/build-tools/packages/build-infrastructure/api-report/build-infrastructure.api.md b/build-tools/packages/build-infrastructure/api-report/build-infrastructure.api.md index edc65c45b46a0..02bdcfc97b371 100644 --- a/build-tools/packages/build-infrastructure/api-report/build-infrastructure.api.md +++ b/build-tools/packages/build-infrastructure/api-report/build-infrastructure.api.md @@ -32,6 +32,9 @@ export interface FilterablePackage { // @public export function filterPackages(packages: T[], filters: PackageFilterOptions): Promise; +// @public +export function findGitRootSync(cwd?: string): string; + // @public export interface FluidPackageJsonFields { pnpm?: { @@ -67,12 +70,30 @@ export function getAllDependenciesInRepo(repo: IFluidRepo, packages: IPackage[]) workspaces: IWorkspace[]; }; +// @public +export function getChangedSinceRef

(fluidRepo: IFluidRepo

, ref: string, remote?: string): Promise<{ + files: string[]; + dirs: string[]; + workspaces: IWorkspace[]; + releaseGroups: IReleaseGroup[]; + packages: IPackage[]; +}>; + +// @public +export function getFiles(git: SimpleGit, directory: string): Promise; + // @public export function getFluidRepoLayout(searchPath: string, noCache?: boolean): { config: IFluidRepoLayout; configFilePath: string; }; +// @public +export function getMergeBaseRemote(git: SimpleGit, branch: string, remote?: string, localRef?: string): Promise; + +// @public +export function getRemote(git: SimpleGit, partialUrl: string | undefined): Promise; + // @public export type GlobString = string; @@ -278,6 +299,12 @@ export function selectAndFilterPackages

(fluidRepo: IFluidRep filtered: P[]; }>; +// @public +export function updatePackageJsonFile(packagePath: string, packageTransformer: (json: J) => void): void; + +// @public +export function updatePackageJsonFileAsync(packagePath: string, packageTransformer: (json: J) => Promise): Promise; + // @public export interface WorkspaceDefinition { directory: string; diff --git a/build-tools/packages/build-infrastructure/src/index.ts b/build-tools/packages/build-infrastructure/src/index.ts index 97b1a64f28da9..a0b377059de16 100644 --- a/build-tools/packages/build-infrastructure/src/index.ts +++ b/build-tools/packages/build-infrastructure/src/index.ts @@ -30,7 +30,15 @@ export { getAllDependenciesInRepo, loadFluidRepo, } from "./fluidRepo.js"; +export { + getFiles, + findGitRootSync, + getMergeBaseRemote, + getRemote, + getChangedSinceRef, +} from "./git.js"; export { PackageBase } from "./package.js"; +export { updatePackageJsonFile, updatePackageJsonFileAsync } from "./packageJsonUtils.js"; export { createPackageManager } from "./packageManagers.js"; export type { AdditionalPackageProps, @@ -60,15 +68,3 @@ export { type PackageSelectionCriteria, type PackageFilterOptions, } from "./filter.js"; - -// export { -// getFiles, -// findGitRootSync, -// getMergeBaseRemote, -// getRemote, -// getChangedSinceRef, -// } from "./git.js"; -// export { PackageBase } from "./package.js"; -// export { updatePackageJsonFile, updatePackageJsonFileAsync } from "./packageJsonUtils.js"; -// export { createPackageManager } from "./packageManagers.js"; -// export { setVersion } from "./versions.js";