Skip to content

@dovenv/repo - API documentation

Classes

Contributors<ID, R>

Type Parameters

Type Parameter
ID extends string
R extends Role<ID>

Constructors

new Contributors()
ts
new Contributors<ID, R>(opts?: {
  member: Contributor<Extract<keyof R, string>>[];
  role: R;
}): Contributors<ID, R>
Parameters
ParameterType
opts?object
opts.member?Contributor<Extract<keyof R, string>>[]
opts.role?R
Returns

Contributors<ID, R>

Methods

filterByRole()
ts
filterByRole(role: keyof ID[]): Promise<undefined | {
  member: Contributor<Extract<keyof R, string>>[];
  role: R;
}>
Parameters
ParameterType
rolekeyof ID[]
Returns

Promise<undefined | { member: Contributor<Extract<keyof R, string>>[]; role: R; }>

filterByRolePattern()
ts
filterByRolePattern(pattern: string[]): Promise<undefined | {
  member: Contributor<Extract<keyof R, string>>[];
  role: R;
}>
Parameters
ParameterType
patternstring[]
Returns

Promise<undefined | { member: Contributor<Extract<keyof R, string>>[]; role: R; }>

getHtmlContent()
ts
getHtmlContent(opts?: {
  member: Contributor<Extract<keyof R, string>>[];
  role: R;
}): Promise<string>
Parameters
ParameterType
opts?object
opts.member?Contributor<Extract<keyof R, string>>[]
opts.role?R
Returns

Promise<string>

getMembers()
ts
getMembers(): Promise<Contributor<Extract<keyof R, string>>[]>
Returns

Promise<Contributor<Extract<keyof R, string>>[]>

getRoles()
ts
getRoles(): Promise<R>
Returns

Promise<R>

showTerminalOutput()
ts
showTerminalOutput(opts?: {
  member: Contributor<Extract<keyof R, string>>[];
  role: R;
}): Promise<void>
Parameters
ParameterType
opts?object
opts.member?Contributor<Extract<keyof R, string>>[]
opts.role?R
Returns

Promise<void>

Properties

PropertyType
opts{ member: Contributor<Extract<keyof R, string>>[]; role: R; }
opts.memberContributor<Extract<keyof R, string>>[]
opts.roleR

Git

Extends

  • Repo<GitConfig>

Constructors

new Git()
ts
new Git(opts?: GitConfig, config?: Config): Git
Parameters
ParameterType
opts?GitConfig
config?Config
Returns

Git

Overrides

Repo<GitConfig>.constructor

Methods

init()
ts
init(): Promise<void>
Returns

Promise<void>

Inherited from

Repo.init

initGH()
ts
initGH(): Promise<void>
Returns

Promise<void>

Inherited from

Repo.initGH

Properties

PropertyTypeDefault valueDescriptionInherited from
addGitAddundefined--
branchGitBranchundefined--
commitGitCommitundefined--
configundefined | ConfigundefinedThe dovenv configuration.Repo.config
huskyHuskyundefined--
initializeGitInitundefined--
optsundefined | GitConfigundefinedConfiguration options.Repo.opts
pullGitPullundefined--
pushGitPushundefined--
titlestring'repo'-Repo.title

GitAdd

Extends

  • GitSuper

Constructors

new GitAdd()
ts
new GitAdd(opts?: GitConfig, config?: Config): GitAdd
Parameters
ParameterType
opts?GitConfig
config?Config
Returns

GitAdd

Inherited from

GitSuper.constructor

Methods

ask()
ts
ask(initialValue: string): Promise<string>
Parameters
ParameterTypeDefault value
initialValuestring'.'
Returns

Promise<string>

exec()
ts
exec(value: string): Promise<void>
Parameters
ParameterType
valuestring
Returns

Promise<void>

getGitRemoteURL()
ts
getGitRemoteURL(): Promise<undefined | string>
Returns

Promise<undefined | string>

Inherited from

GitSuper.getGitRemoteURL

init()
ts
init(): Promise<void>
Returns

Promise<void>

Inherited from

GitSuper.init

initGH()
ts
initGH(): Promise<void>
Returns

Promise<void>

Inherited from

GitSuper.initGH

run()
ts
run(): Promise<void>
Returns

Promise<void>

Properties

PropertyTypeDefault valueDescriptionInherited from
configundefined | ConfigundefinedThe dovenv configuration.GitSuper.config
optsundefined | GitConfigundefinedConfiguration options.GitSuper.opts
titlestring'repo'-GitSuper.title

GitBranch

Extends

  • GitSuper

Constructors

new GitBranch()
ts
new GitBranch(opts?: GitConfig, config?: Config): GitBranch
Parameters
ParameterType
opts?GitConfig
config?Config
Returns

GitBranch

Inherited from

GitSuper.constructor

Methods

askSelectBranch()
ts
askSelectBranch(defaultValue?: string, remote?: boolean): Promise<string>
Parameters
ParameterTypeDefault value
defaultValue?stringundefined
remote?booleantrue
Returns

Promise<string>

change()
ts
change(branchName?: string, force?: boolean): Promise<void>

Change to a specified branch.

Parameters
ParameterTypeDefault valueDescription
branchName?stringundefinedThe name of the branch to switch to.
force?booleanfalseIf true, force switches to the branch, discarding local changes.
Returns

Promise<void>

create()
ts
create(branchName?: string): Promise<void>

Create a new branch without switching to it.

Parameters
ParameterTypeDescription
branchName?stringThe name of the branch to create.
Returns

Promise<void>

createAndSwitch()
ts
createAndSwitch(branchName?: string): Promise<void>

Create a new branch and switch to it.

Parameters
ParameterTypeDescription
branchName?stringThe name of the branch to create and switch to.
Returns

Promise<void>

delete()
ts
delete(branchName?: string, force?: boolean): Promise<void>

Delete a branch.

Parameters
ParameterTypeDefault valueDescription
branchName?stringundefinedThe name of the branch to delete.
force?booleanfalseIf true, forces deletion of the branch.
Returns

Promise<void>

getAll()
ts
getAll(remote: boolean): Promise<string[]>

Get all branches in the repository.

Parameters
ParameterTypeDefault valueDescription
remotebooleantrueIf true, shows remote branches as well.
Returns

Promise<string[]>

  • An array of branch names.
getCurrent()
ts
getCurrent(): Promise<string>

Get the current branch name.

Returns

Promise<string>

  • The name of the current branch.
getGitRemoteURL()
ts
getGitRemoteURL(): Promise<undefined | string>
Returns

Promise<undefined | string>

Inherited from

GitSuper.getGitRemoteURL

init()
ts
init(): Promise<void>
Returns

Promise<void>

Inherited from

GitSuper.init

initGH()
ts
initGH(): Promise<void>
Returns

Promise<void>

Inherited from

GitSuper.initGH

showAll()
ts
showAll(remote: boolean): Promise<void>

Show all branches in the repository.

Parameters
ParameterTypeDefault valueDescription
remotebooleantrueIf true, shows remote branches as well.
Returns

Promise<void>

showCurrent()
ts
showCurrent(): Promise<void>

Shows the current branch name.

Returns

Promise<void>

switch()
ts
switch(branchName?: string): Promise<void>

Switch to an existing branch.

Parameters
ParameterTypeDescription
branchName?stringThe name of the branch to switch to.
Returns

Promise<void>

Properties

PropertyTypeDefault valueDescriptionInherited from
configundefined | ConfigundefinedThe dovenv configuration.GitSuper.config
optsundefined | GitConfigundefinedConfiguration options.GitSuper.opts
titlestring'repo'-GitSuper.title

GitCommit

Extends

  • GitSuper

Constructors

new GitCommit()
ts
new GitCommit(opts?: GitConfig, config?: Config): GitCommit
Parameters
ParameterType
opts?GitConfig
config?Config
Returns

GitCommit

Inherited from

GitSuper.constructor

Methods

ask()
ts
ask(execute: boolean): Promise<string>
Parameters
ParameterTypeDefault value
executebooleantrue
Returns

Promise<string>

exec()
ts
exec(message: string): Promise<void>
Parameters
ParameterType
messagestring
Returns

Promise<void>

getGitRemoteURL()
ts
getGitRemoteURL(): Promise<undefined | string>
Returns

Promise<undefined | string>

Inherited from

GitSuper.getGitRemoteURL

getLastCommit()
ts
getLastCommit(): Promise<string>

Get the last commit message.

Returns

Promise<string>

The last commit message.

getStagedFiles()
ts
getStagedFiles(): Promise<string>
Returns

Promise<string>

getStagedFilesList()
ts
getStagedFilesList(): Promise<string[]>

Get list of staged files.

Returns

Promise<string[]>

List of staged files

init()
ts
init(): Promise<void>
Returns

Promise<void>

Inherited from

GitSuper.init

initGH()
ts
initGH(): Promise<void>
Returns

Promise<void>

Inherited from

GitSuper.initGH

isStageEmpty()
ts
isStageEmpty(): Promise<boolean>
Returns

Promise<boolean>

run()
ts
run(): Promise<undefined | string>
Returns

Promise<undefined | string>

Properties

PropertyTypeDefault valueDescriptionInherited from
configundefined | ConfigundefinedThe dovenv configuration.GitSuper.config
optsundefined | GitConfigundefinedConfiguration options.GitSuper.opts
scopesundefined | { desc: string; title: string; value: string; }[]undefined--
titlestring'repo'-GitSuper.title
typesundefined | { desc: string; title: string; value: string; }[]undefined--

GitHub

Extends

Constructors

new GitHub()
ts
new GitHub(opts?: GitHubConfig, config?: Config): GitHub
Parameters
ParameterType
opts?GitHubConfig
config?Config
Returns

GitHub

Overrides

PluginCore<GitHubConfig>.constructor

Methods

download()
ts
download(input: string, output: string): Promise<void>
Parameters
ParameterType
inputstring
outputstring
Returns

Promise<void>

Properties

PropertyTypeDescriptionInherited from
configundefined | ConfigThe dovenv configuration.PluginCore.config
createGitHubCreate--
infoGitHubInfo--
optsundefined | GitHubConfigConfiguration options.PluginCore.opts
titlestringThe title of the application. Use in internal logs and functions.PluginCore.title
workflowGitHubWorkflow--

GitHubInfo

Extends

  • GHSuper

Constructors

new GitHubInfo()
ts
new GitHubInfo(opts?: GitHubConfig, config?: Config): GitHubInfo
Parameters
ParameterType
opts?GitHubConfig
config?Config
Returns

GitHubInfo

Inherited from

GHSuper.constructor

Methods

getRepoList()
ts
getRepoList(opts?: {
  archived: boolean;
  fork: boolean;
  visibility: "public" | "private" | "internal";
 }): Promise<{
  desc: undefined | string;
  homepage: undefined | string;
  name: r.name;
  owner: r.owner.login;
  topics: undefined | string[];
  url: r.url;
}[]>
Parameters
ParameterType
opts?object
opts.archived?boolean
opts.fork?boolean
opts.visibility?"public" | "private" | "internal"
Returns

Promise<{ desc: undefined | string; homepage: undefined | string; name: r.name; owner: r.owner.login; topics: undefined | string[]; url: r.url; }[]>

Inherited from

GHSuper.getRepoList

init()
ts
init(): Promise<void>
Returns

Promise<void>

Inherited from

GHSuper.init

initGH()
ts
initGH(): Promise<void>
Returns

Promise<void>

Inherited from

GHSuper.initGH

update()
ts
update(): Promise<void>
Returns

Promise<void>

view()
ts
view(): Promise<void>
Returns

Promise<void>

viewAll()
ts
viewAll(): Promise<void>
Returns

Promise<void>

Properties

PropertyTypeDefault valueDescriptionInherited from
configundefined | ConfigundefinedThe dovenv configuration.GHSuper.config
optsundefined | GitHubConfigundefinedConfiguration options.GHSuper.opts
titlestring'repo'-GHSuper.title

GitHubWorkflow

Extends

  • GHSuper

Constructors

new GitHubWorkflow()
ts
new GitHubWorkflow(opts?: GitHubConfig, config?: Config): GitHubWorkflow
Parameters
ParameterType
opts?GitHubConfig
config?Config
Returns

GitHubWorkflow

Inherited from

GHSuper.constructor

Methods

getRepoList()
ts
getRepoList(opts?: {
  archived: boolean;
  fork: boolean;
  visibility: "public" | "private" | "internal";
 }): Promise<{
  desc: undefined | string;
  homepage: undefined | string;
  name: r.name;
  owner: r.owner.login;
  topics: undefined | string[];
  url: r.url;
}[]>
Parameters
ParameterType
opts?object
opts.archived?boolean
opts.fork?boolean
opts.visibility?"public" | "private" | "internal"
Returns

Promise<{ desc: undefined | string; homepage: undefined | string; name: r.name; owner: r.owner.login; topics: undefined | string[]; url: r.url; }[]>

Inherited from

GHSuper.getRepoList

init()
ts
init(): Promise<void>
Returns

Promise<void>

Inherited from

GHSuper.init

initGH()
ts
initGH(): Promise<void>
Returns

Promise<void>

Inherited from

GHSuper.initGH

list()
ts
list(): Promise<void>
Returns

Promise<void>

run()
ts
run(): Promise<void>
Returns

Promise<void>

Properties

PropertyTypeDefault valueDescriptionInherited from
configundefined | ConfigundefinedThe dovenv configuration.GHSuper.config
optsundefined | GitHubConfigundefinedConfiguration options.GHSuper.opts
titlestring'repo'-GHSuper.title

GitInit

Extends

  • GitSuper

Constructors

new GitInit()
ts
new GitInit(opts?: GitConfig, config?: Config): GitInit
Parameters
ParameterType
opts?GitConfig
config?Config
Returns

GitInit

Inherited from

GitSuper.constructor

Methods

getGitRemoteURL()
ts
getGitRemoteURL(): Promise<undefined | string>
Returns

Promise<undefined | string>

Inherited from

GitSuper.getGitRemoteURL

init()
ts
init(): Promise<void>
Returns

Promise<void>

Inherited from

GitSuper.init

initGH()
ts
initGH(): Promise<void>
Returns

Promise<void>

Inherited from

GitSuper.initGH

isInit()
ts
isInit(): Promise<boolean>
Returns

Promise<boolean>

run()
ts
run(silent: boolean): Promise<void>
Parameters
ParameterTypeDefault value
silentbooleanfalse
Returns

Promise<void>

Properties

PropertyTypeDefault valueDescriptionInherited from
configundefined | ConfigundefinedThe dovenv configuration.GitSuper.config
optsundefined | GitConfigundefinedConfiguration options.GitSuper.opts
titlestring'repo'-GitSuper.title

GitPull

Extends

  • GitSuper

Constructors

new GitPull()
ts
new GitPull(opts?: GitConfig, config?: Config): GitPull
Parameters
ParameterType
opts?GitConfig
config?Config
Returns

GitPull

Inherited from

GitSuper.constructor

Methods

getGitRemoteURL()
ts
getGitRemoteURL(): Promise<undefined | string>
Returns

Promise<undefined | string>

Inherited from

GitSuper.getGitRemoteURL

init()
ts
init(): Promise<void>
Returns

Promise<void>

Inherited from

GitSuper.init

initGH()
ts
initGH(): Promise<void>
Returns

Promise<void>

Inherited from

GitSuper.initGH

run()
ts
run(): Promise<void>
Returns

Promise<void>

Properties

PropertyTypeDefault valueDescriptionInherited from
configundefined | ConfigundefinedThe dovenv configuration.GitSuper.config
optsundefined | GitConfigundefinedConfiguration options.GitSuper.opts
titlestring'repo'-GitSuper.title

GitPush

Extends

  • GitSuper

Constructors

new GitPush()
ts
new GitPush(opts?: GitConfig, config?: Config): GitPush
Parameters
ParameterType
opts?GitConfig
config?Config
Returns

GitPush

Inherited from

GitSuper.constructor

Methods

exec()
ts
exec(branch: string): Promise<void>
Parameters
ParameterType
branchstring
Returns

Promise<void>

getGitRemoteURL()
ts
getGitRemoteURL(): Promise<undefined | string>
Returns

Promise<undefined | string>

Inherited from

GitSuper.getGitRemoteURL

init()
ts
init(): Promise<void>
Returns

Promise<void>

Inherited from

GitSuper.init

initGH()
ts
initGH(): Promise<void>
Returns

Promise<void>

Inherited from

GitSuper.initGH

run()
ts
run(): Promise<void>
Returns

Promise<void>

Properties

PropertyTypeDefault valueDescriptionInherited from
configundefined | ConfigundefinedThe dovenv configuration.GitSuper.config
optsundefined | GitConfigundefinedConfiguration options.GitSuper.opts
titlestring'repo'-GitSuper.title

Husky

Extends

  • GitSuper

Constructors

new Husky()
ts
new Husky(opts?: GitConfig, config?: Config): Husky
Parameters
ParameterType
opts?GitConfig
config?Config
Returns

Husky

Inherited from

GitSuper.constructor

Methods

getGitRemoteURL()
ts
getGitRemoteURL(): Promise<undefined | string>
Returns

Promise<undefined | string>

Inherited from

GitSuper.getGitRemoteURL

init()
ts
init(): Promise<void>
Returns

Promise<void>

Inherited from

GitSuper.init

initGH()
ts
initGH(): Promise<void>
Returns

Promise<void>

Inherited from

GitSuper.initGH

run()
ts
run(): Promise<void>
Returns

Promise<void>

Properties

PropertyTypeDefault valueDescriptionInherited from
configundefined | ConfigundefinedThe dovenv configuration.GitSuper.config
optsundefined | GitConfigundefinedConfiguration options.GitSuper.opts
titlestring'repo'-GitSuper.title

Packages

Extends

  • Repo

Constructors

new Packages()
ts
new Packages(opts?: GitHubConfig, config?: Config): Packages
Parameters
ParameterType
opts?GitHubConfig
config?Config
Returns

Packages

Inherited from

Repo.constructor

Methods

ask()
ts
ask(): Promise<{}>
Returns

Promise<{}>

getPkgVersion()
ts
getPkgVersion(npm: boolean): Promise<{
  name: string;
  npm: string;
  version: string;
}[]>
Parameters
ParameterTypeDefault value
npmbooleantrue
Returns

Promise<{ name: string; npm: string; version: string; }[]>

init()
ts
init(): Promise<void>
Returns

Promise<void>

Overrides

Repo.init

initGH()
ts
initGH(): Promise<void>
Returns

Promise<void>

Inherited from

Repo.initGH

prepare()
ts
prepare(): Promise<undefined | number>
Returns

Promise<undefined | number>

publish()
ts
publish(preCmd?: string): Promise<undefined | number>
Parameters
ParameterType
preCmd?string
Returns

Promise<undefined | number>

release()
ts
release(): Promise<void>
Returns

Promise<void>

showPackageVersion()
ts
showPackageVersion(npm: boolean): Promise<void>
Parameters
ParameterTypeDefault value
npmbooleantrue
Returns

Promise<void>

version()
ts
version(): Promise<undefined | number>
Returns

Promise<undefined | number>

Properties

PropertyTypeDefault valueDescriptionInherited from
configundefined | ConfigundefinedThe dovenv configuration.Repo.config
optsundefined | GitHubConfigundefinedConfiguration options.Repo.opts
titlestring'repo'-Repo.title

Functions

contributorsPlugin()

ts
function contributorsPlugin<ID, R>(conf?: ContributorsConfig<ID, R>): Config

Type Parameters

Type Parameter
ID extends string
R extends Role<ID>

Parameters

ParameterType
conf?ContributorsConfig<ID, R>

Returns

Config


ghPlugin()

ts
function ghPlugin(conf?: GitHubConfig): Config

Parameters

ParameterType
conf?GitHubConfig

Returns

Config


gitPlugin()

ts
function gitPlugin(conf?: GitConfig): Config

Parameters

ParameterType
conf?GitConfig

Returns

Config


pkgPlugin()

ts
function pkgPlugin(conf?: GitHubConfig): Config

Parameters

ParameterType
conf?GitHubConfig

Returns

Config


repoPlugin()

ts
function repoPlugin<Contr, R>(opts?: Config<Contr, R>): Config

Dovenv plugin for managing a repository.

Type Parameters

Type Parameter
Contr extends string
R extends Role<Contr>

Parameters

ParameterTypeDescription
opts?Config<Contr, R>Optional configuration.

Returns

Config

  • The plugin configuration.

Type Aliases

Config<I, R>

ts
type Config<I, R>: GitHubConfig & GitConfig & {
  contributors: ContributorsConfig<I, R>;
};

Type declaration

NameTypeDescription
contributors?ContributorsConfig<I, R>Contributors configuration

Type Parameters

Type Parameter
I extends string
R extends Role<I>

ContributorsConfig<ID, R>

ts
type ContributorsConfig<ID, R>: {
  member: Contributor<Extract<keyof R, string>>[];
  role: R;
};

Type Parameters

Type Parameter
ID extends string
R extends Role<ID>

Type declaration

NameTypeDescription
memberContributor<Extract<keyof R, string>>[]Set contributor members Example [ { ghUsername: 'angelespejo', name: 'Angelo', role: 'author' }, { ghUsername: 'pigeonposse', name: 'PigeonPosse', role: 'organization' }, ]
roleRSet contributor roles Example { * owner: { name: 'Owner', emoji: '👑' }, * developer: { name: 'Developer', emoji: '🤝' }, * organization: { name: 'Organization', emoji: '🏢' }, * sponsor: { name: 'Sponsor', emoji: '🤝' }, * translator: { name: 'Translator', emoji: '🌏' } * },

GitHubConfig

ts
type GitHubConfig: {
  defaultBranch: string;
  desc: string;
  homepageURL: string;
  ID: string;
  tags: string[];
  URL: string;
  userID: string;
  workflowDefaultInputs: string;
  workflowsDir: string;
};

Type declaration

NameTypeDescription
defaultBranch?stringPrimary branch from the repository Example "main"
desc?stringDescription of the repository Example "This is a cool project"
homepageURL?stringThe URL of the project's homepage. Example "https://pigeonposse.com"
ID?stringName of the repository Example "dovenv"
tags?string[]Tags or topics associated with the repository Example [ "web", "api", "rest-api", "openapi", "library", "node", "js"]
URL?stringURL of the repopository Example "https://github.com/pigeonposse/dovenv"
userID?stringGitHub user
workflowDefaultInputs?stringWorkflow default inputs
workflowsDir?stringPath to .github/workflows directory

References

default

Renames and re-exports repoPlugin

Variables

CONTRIBUTOR_ROLE

ts
const CONTRIBUTOR_ROLE: {
  author: {
     desc: 'Author of the project.';
     emoji: '👑';
     name: 'Author';
    };
  designer: {
     desc: 'Contributor for the design of the project. Images, icons, etc.';
     emoji: '💄';
     name: 'Designer';
    };
  developer: {
     desc: 'Contributor for the development of the project. Code, docs, etc.';
     emoji: '👨‍💻';
     name: 'Developer';
    };
  organization: {
     emoji: '🏢';
     name: 'Organization';
    };
  sponsor: {
     emoji: '🤝';
     name: 'Sponsor';
    };
  translator: {
     emoji: '🌏';
     name: 'Translator';
    };
};

Type declaration

NameTypeDefault value
author{ desc: 'Author of the project.'; emoji: '👑'; name: 'Author'; }-
author.descstring'Author of the project.'
author.emojistring'👑'
author.namestring'Author'
designer{ desc: 'Contributor for the design of the project. Images, icons, etc.'; emoji: '💄'; name: 'Designer'; }-
designer.descstring'Contributor for the design of the project. Images, icons, etc.'
designer.emojistring'💄'
designer.namestring'Designer'
developer{ desc: 'Contributor for the development of the project. Code, docs, etc.'; emoji: '👨‍💻'; name: 'Developer'; }-
developer.descstring'Contributor for the development of the project. Code, docs, etc.'
developer.emojistring'👨‍💻'
developer.namestring'Developer'
organization{ emoji: '🏢'; name: 'Organization'; }-
organization.emojistring'🏢'
organization.namestring'Organization'
sponsor{ emoji: '🤝'; name: 'Sponsor'; }-
sponsor.emojistring'🤝'
sponsor.namestring'Sponsor'
translator{ emoji: '🌏'; name: 'Translator'; }-
translator.emojistring'🌏'
translator.namestring'Translator'