Git Mob Core library to manage co-authoring
npm install git-mob-core> Beta
The core API for managing Git Mob co-authors.
Shared between Git Mob CLI and Git Mob VS code.
```
npm i git-mob-core
- process.env.GITMOB_MESSAGE_PATH set the primary path to Git message templateprocess.env.GITMOB_COAUTHORS_PATH
- set the primary path to coauthors file
`TS
// Write actions
saveNewCoAuthors(authors: Author[]):
createCoAuthorsFile(authors: Author[]):
updateGitTemplate(selectedAuthors?: Author[]): void
solo():
setCoAuthors(keys: string[]):
messageFormatter(txt: string, authors: Author[]): string
// Read actions
getAllAuthors():
getPrimaryAuthor():
getSelectedCoAuthors(allAuthors):
setPrimaryAuthor(author: Author): void
repoAuthorList(authorFilter?: string): Promise
pathToCoAuthors():
// GitHub
fetchGitHubAuthors(userNames: string[], userAgent: string):
searchGitHubAuthors(query: string, userAgent: string):
gitRevParse = {
insideWorkTree():
topLevelDirectory():
};
`
`TS
// Config manager for library
// supported prop: "processCwd" = set the directory to exec commands
getConfig(prop: string): string | undefined
updateConfig(prop: string, value: string): void
// Read GitMob properties from Git config file
gitMobConfig = {
localTemplate():
fetchFromGitHub():
};
// Read Git properties from Git config
gitConfig = {
getLocalCommitTemplate():
getGlobalCommitTemplate():
};
`
Do not change the structure of the class.
`TS
class Author;
// Properties
Author.key: string
Author.name: string
Author.email: string
Author.trailer: AuthorTrailers // defaults to AuthorTrailers.CoAuthorBy
//Methods
Author.format(): string
Author.toString(): string
``