Skip to content

Commit

Permalink
chore: update readme api documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Miguel Ramos committed Jul 19, 2024
1 parent 3b725b2 commit 86dc3c6
Showing 1 changed file with 32 additions and 27 deletions.
59 changes: 32 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,38 @@ This package offer a set of functions to retrieve information about the monorepo

## API


| ###Function | ###Description |
|---|---|
| `getProjectRootPath(root?: string): string or undefined` | Get the root path of the project. |
| `getDefinedPackageManager(root?: string): string or undefined` | Get the package manager defined in the project. |
| `detectPackageManager(root: string): PackageManager or undefined` | Detect the package manager defined in the project. |
| `getPackages(cwd?: string): Array<PackageInfo>` | Get the list of packages in the monorepo. |
| `getChangedPackages(sha?: string, cwd: string): Array<PackageInfo>` | Get the list of packages that have changed since the given sha ('main'). |
| `gitFetchAll(cwd?: string, fetch_tags?: boolean): boolean` | Execute a `fetch` command to get the latest changes from the remote repository. You can also retrieve tags |
| `gitCommit(message: string, body?: string, footer?: string cwd?: string): boolean` | Commit the changes. |
| `gitTag(tag: string, message?: string, cwd?: string): boolean` | Tag the repository with the given tag. |
| `gitPush(cwd?: string, follow_tags?: boolean): boolean` | Push the changes to the remote repository, including optional tags. |
| `gitCurrentBranch(cwd?: string): string or undefined` | Get the current branch name. |
| `gitCurrentSha(cwd?: string): string` | Get's the current commit id. |
| `gitPreviousSha(cwd?: string): string or undefined` | Get's the previous commit id. |
| `gitFirstSha(cwd?: string, branch?: string): string or undefined` | Get's the first commit id in a branch. Compare is done between branch..Head, and it should be used as main..HEAD |
| `isWorkdirUnclean(cwd?: string): boolean` | Check if the workdir is unclean (uncommited changes). |
| `gitCommitBranchName(sha: string, cwd?: string): string or undefined` | Get the branch name for the commit id. |
| `gitAllFilesChangedSinceSha(sha: string, cwd?: string): Array<String>` | Get all files changed sinc branch, commit id etc. |
| `getDivergedCommit(sha: string, cwd?: string): string or undefined` | Get the diverged commit from the given sha (main). |
| `getCommitsSince(cwd?: string, since?: string, relative?: string): Array<Commit>` | Get the commits since the given sha (main) for a particular package. |
| `getAllFilesChangedSinceBranch(package_info: Array<PackageInfo>, branch: string, cwd?: string): Array<String>` | Get all the files changed for a branch (main). |
| `getLastKnownPublishTagInfoForPackage(package_info: PackageInfo, cwd?: string): Array<PublishTagInfo>` | Get the last known publish tag info for a particular package. |
| `getLastKnownPublishTagInfoForAllPackages(package_info: Array<PackageInfo>, cwd?: string): Array<PublishTagInfo>` | Get the last known publish tag info for all packages. |
| `getRemoteOrLocalTags(cwd?: string, local?: boolean): Array<RemoteTags>` | Get all the tags in the remote or local repository. |
| `getConventionalForPackage(package_info: PackageInfo, no_fetch_all?: boolean cwd?: string, conventional_options?: ConventionalPackageOptions): ConventionalPackage` | Get the conventional commits for a particular package, changelog output and package info. |
| `getBumps(options: BumpOptions): Array<BumpPackage>` | Output bumps version for packages and it's dependencies |
| Function | Description |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| `getProjectRootPath(root?: string): string or undefined` | Get the root path of the project. |
| `getDefinedPackageManager(root?: string): string or undefined` | Get the package manager defined in the project. |
| `detectPackageManager(root: string): PackageManager or undefined` | Detect the package manager defined in the project. |
| `getPackages(cwd?: string): Array<PackageInfo>` | Get the list of packages in the monorepo. |
| `getChangedPackages(sha?: string, cwd: string): Array<PackageInfo>` | Get the list of packages that have changed since the given sha ('main'). |
| `gitFetchAll(cwd?: string, fetch_tags?: boolean): boolean` | Execute a `fetch` command to get the latest changes from the remote repository. You can also retrieve tags |
| `gitCommit(message: string, body?: string, footer?: string cwd?: string): boolean` | Commit the changes. |
| `gitTag(tag: string, message?: string, cwd?: string): boolean` | Tag the repository with the given tag. |
| `gitPush(cwd?: string, follow_tags?: boolean): boolean` | Push the changes to the remote repository, including optional tags. |
| `gitCurrentBranch(cwd?: string): string or undefined` | Get the current branch name. |
| `gitCurrentSha(cwd?: string): string` | Get's the current commit id. |
| `gitPreviousSha(cwd?: string): string or undefined` | Get's the previous commit id. |
| `gitFirstSha(cwd?: string, branch?: string): string or undefined` | Get's the first commit id in a branch. Compare is done between branch..Head, and it should be used as main..HEAD |
| `isWorkdirUnclean(cwd?: string): boolean` | Check if the workdir is unclean (uncommited changes). |
| `gitCommitBranchName(sha: string, cwd?: string): string or undefined` | Get the branch name for the commit id. |
| `gitAllFilesChangedSinceSha(sha: string, cwd?: string): Array<String>` | Get all files changed sinc branch, commit id etc. |
| `getDivergedCommit(sha: string, cwd?: string): string or undefined` | Get the diverged commit from the given sha (main). |
| `getCommitsSince(cwd?: string, since?: string, relative?: string): Array<Commit>` | Get the commits since the given sha (main) for a particular package. |
| `getAllFilesChangedSinceBranch(package_info: Array<PackageInfo>, branch: string, cwd?: string): Array<String>` | Get all the files changed for a branch (main). |
| `getLastKnownPublishTagInfoForPackage(package_info: PackageInfo, cwd?: string): Array<PublishTagInfo>` | Get the last known publish tag info for a particular package. |
| `getLastKnownPublishTagInfoForAllPackages(package_info: Array<PackageInfo>, cwd?: string): Array<PublishTagInfo>` | Get the last known publish tag info for all packages. |
| `getRemoteOrLocalTags(cwd?: string, local?: boolean): Array<RemoteTags>` | Get all the tags in the remote or local repository. |
| `getConventionalForPackage(package_info: PackageInfo, no_fetch_all?: boolean cwd?: string, conventional_options?: ConventionalPackageOptions): ConventionalPackage` | Get the conventional commits for a particular package, changelog output and package info. |
| `getBumps(options: BumpOptions): Array<BumpPackage>` | Output bumps version for packages and it's dependencies |
| `initChanges(cwd?: string, change_options?: ChangesOptions): ChangesFileData` | Creat changes file or retrieve is data if already exist |
| `add_change(change: Change, cwd?: string): boolean` | Adds a new change to the change file |
| `remove_change(branch_name: String, cwd?: string): boolean` | Removes the change from the changes files. |
| `change_exist(branch_name: string, cwd?: string): boolean` | Check if change already exist. |
| `get_change(branch_name: string, cwd?: string): Array<Change>` | Get the list of changes for the branch. |
| `get_changes(cwd?: string): Changes` | Get all changes. |

## Develop requirements

Expand Down

0 comments on commit 86dc3c6

Please sign in to comment.