Skip to content

Commit

Permalink
export git APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerbutler committed Oct 23, 2024
1 parent 1025ca6 commit 9303cff
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ export interface FilterablePackage {
// @public
export function filterPackages<T extends FilterablePackage>(packages: T[], filters: PackageFilterOptions): Promise<T[]>;

// @public
export function findGitRootSync(cwd?: string): string;

// @public
export interface FluidPackageJsonFields {
pnpm?: {
Expand Down Expand Up @@ -67,12 +70,30 @@ export function getAllDependenciesInRepo(repo: IFluidRepo, packages: IPackage[])
workspaces: IWorkspace[];
};

// @public
export function getChangedSinceRef<P extends IPackage>(fluidRepo: IFluidRepo<P>, ref: string, remote?: string): Promise<{
files: string[];
dirs: string[];
workspaces: IWorkspace[];
releaseGroups: IReleaseGroup[];
packages: IPackage[];
}>;

// @public
export function getFiles(git: SimpleGit, directory: string): Promise<string[]>;

// @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<string>;

// @public
export function getRemote(git: SimpleGit, partialUrl: string | undefined): Promise<string | undefined>;

// @public
export type GlobString = string;

Expand Down Expand Up @@ -278,6 +299,12 @@ export function selectAndFilterPackages<P extends IPackage>(fluidRepo: IFluidRep
filtered: P[];
}>;

// @public
export function updatePackageJsonFile<J extends PackageJson = PackageJson>(packagePath: string, packageTransformer: (json: J) => void): void;

// @public
export function updatePackageJsonFileAsync<J extends PackageJson = PackageJson>(packagePath: string, packageTransformer: (json: J) => Promise<void>): Promise<void>;

// @public
export interface WorkspaceDefinition {
directory: string;
Expand Down
20 changes: 8 additions & 12 deletions build-tools/packages/build-infrastructure/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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";

0 comments on commit 9303cff

Please sign in to comment.