0.9.2 • Published 2 days ago

git-mob-core v0.9.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 days ago

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

API

Environment variables

  • process.env.GITMOB_MESSAGE_PATH set the primary path to Git message template
  • process.env.GITMOB_COAUTHORS_PATH set the primary path to coauthors file
// Write actions
saveNewCoAuthors(authors: Author[]): <Promise<Author[]>>
createCoAuthorsFile(authors: Author[]): <Promise<boolean>>
updateGitTemplate(selectedAuthors?: Author[]): void
solo(): <Promise<void>>
setCoAuthors(keys: string[]): <Promise<Author[]>>

// Read actions
getAllAuthors(): <Promise<Author[]>>
getPrimaryAuthor(): <Promise<Author | undefined>>
getSelectedCoAuthors(allAuthors): <Promise<Author[]>>
setPrimaryAuthor(author: Author): void
fetchGitHubAuthors(userNames: string[], userAgent: string): <Promise<Author[]>>
searchGitHubAuthors(query: string, userAgent: string): <Promise<Author[]>>
repoAuthorList(authorFilter?: string): Promise<Author[] | undefined>
pathToCoAuthors(): <Promise<string>>

gitRevParse = {
  insideWorkTree(): <Promise<string>>,
  topLevelDirectory(): <Promise<boolean>>,
};

Config

// 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(): <Promise<boolean>>,
  fetchFromGitHub(): <Promise<boolean>>,
};

// Read Git properties from Git config
gitConfig = {
  getLocalCommitTemplate(): <Promise<string>>,
  getGlobalCommitTemplate(): <Promise<string>>,
};

Author class

Main class for Author data exchange between function.

class Author;

// Properties
Author.key: string
Author.name: string
Author.email: string

//Methods
Author.format(): string
Author.toString(): string
0.9.2-rc.0

2 days ago

0.9.2

2 days ago

0.9.1

3 days ago

0.9.0

4 months ago

0.8.1-beta.1

6 months ago

0.8.1-beta.2

6 months ago

0.7.0-beta.1

6 months ago

0.8.1

6 months ago

0.8.0

6 months ago

0.8.2

6 months ago

0.6.0-beta.1

7 months ago

0.7.0

6 months ago

0.6.0

7 months ago

0.5.0

11 months ago

0.4.0

12 months ago

0.3.0

1 year ago

0.1.2-beta.1

1 year ago

0.2.0

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago