Skip to content

LLM Resources

@dovenv/repo - API documentation ​

Classes ​

Contributors<R> ​

Type Parameters ​

Type ParameterDefault type
R extends RoleMapRole

Constructors ​

new Contributors() ​
ts
new Contributors<R>(config?: ContributorsParams<R>): Contributors<R>
Parameters ​
ParameterType
config?ContributorsParams<R>
Returns ​

Contributors<R>

Methods ​

filterByRole() ​
ts
filterByRole(role: RoleKey[]): Promise<undefined | ContributorsOpts>

Filter the contributors by role using a list of role IDs.

Parameters ​
ParameterTypeDescription
roleRoleKey[]Role IDs to filter by.
Returns ​

Promise<undefined | ContributorsOpts>

  • The filtered contributors.
filterByRolePattern() ​
ts
filterByRolePattern(pattern: string[]): Promise<undefined | ContributorsOpts>

Filter the contributors by role using a pattern.

Uses the getMatch utility to filter the role IDs using the provided pattern. The filtered role IDs are then passed to the filterByRole method.

Parameters ​
ParameterTypeDescription
patternstring[]Pattern to filter the role IDs with.
Returns ​

Promise<undefined | ContributorsOpts>

  • The filtered contributors.
getHtmlContent() ​
ts
getHtmlContent(opts?: ContributorsGetOpts): Promise<string>

Retrieves the HTML content of a table containing the contributors.

Optionally takes an object with the same shape as the class constructor options. If the role or member properties are not provided, they default to the class constructor options.

Parameters ​
ParameterTypeDescription
opts?ContributorsGetOptsOptions object.
Returns ​

Promise<string>

  • The HTML content of the contributors table.
getMarkdownContent() ​
ts
getMarkdownContent(opts?: ContributorsGetOpts): Promise<string>

Converts the HTML content of the contributors table to Markdown.

Parameters ​
ParameterTypeDescription
opts?ContributorsGetOptsOptions object.
Returns ​

Promise<string>

  • The Markdown content of the contributors table.
getTerminalContent() ​
ts
getTerminalContent(opts?: ContributorsGetOpts): Promise<string>

Retrieves the contributors table content formatted for the terminal.

Optionally takes an object with the same shape as the class constructor options. If the role or member properties are not provided, they default to the class constructor options.

Parameters ​
ParameterTypeDescription
opts?ContributorsGetOptsOptions object.
Returns ​

Promise<string>

  • The terminal-formatted content of the contributors table.
showTerminalOutput() ​
ts
showTerminalOutput(opts?: ContributorsGetOpts): Promise<void>

Logs the contributors table as a formatted string to the terminal.

Parameters ​
ParameterTypeDescription
opts?ContributorsGetOptsOptions object.
Returns ​

Promise<void>

  • The result of logging the contributors table.

Properties ​

PropertyType
optsundefined | ContributorsOpts

Git ​

Extends ​

Constructors ​

new Git() ​
ts
new Git(data: {
  opts: GitConfig;
  utils: CommandSuper;
 }): Git
Parameters ​
ParameterType
dataobject
data.opts?GitConfig
data.utilsCommandSuper
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 ​

PropertyTypeInherited from
addGitAdd-
branchGitBranch-
commitGitCommit-
huskyHusky-
initializeGitInit-
optsundefined | GitConfigRepo.opts
pullGitPull-
pushGitPush-

GitAdd ​

Extends ​

  • GitSuper

Constructors ​

new GitAdd() ​
ts
new GitAdd(__namedParameters: {
  opts: GitConfig;
  utils: CommandSuper;
 }): GitAdd
Parameters ​
ParameterType
__namedParametersobject
__namedParameters.opts?GitConfig
__namedParameters.utilsCommandSuper
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 ​

PropertyTypeInherited from
optsundefined | GitConfigGitSuper.opts

GitBranch ​

Extends ​

  • GitSuper

Constructors ​

new GitBranch() ​
ts
new GitBranch(__namedParameters: {
  opts: GitConfig;
  utils: CommandSuper;
 }): GitBranch
Parameters ​
ParameterType
__namedParametersobject
__namedParameters.opts?GitConfig
__namedParameters.utilsCommandSuper
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 ​

PropertyTypeInherited from
optsundefined | GitConfigGitSuper.opts

GitCommit ​

Extends ​

  • GitSuper

Constructors ​

new GitCommit() ​
ts
new GitCommit(__namedParameters: {
  opts: GitConfig;
  utils: CommandSuper;
 }): GitCommit
Parameters ​
ParameterType
__namedParametersobject
__namedParameters.opts?GitConfig
__namedParameters.utilsCommandSuper
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 ​

PropertyTypeInherited from
optsundefined | GitConfigGitSuper.opts
scopesundefined | { desc: string; title: string; value: string; }[]-
typesundefined | { desc: string; title: string; value: string; }[]-

GitHub ​

Constructors ​

new GitHub() ​
ts
new GitHub(__namedParameters: {
  opts: GitHubConfig;
  utils: CommandSuper;
 }): GitHub
Parameters ​
ParameterType
__namedParametersobject
__namedParameters.opts?GitHubConfig
__namedParameters.utilsCommandSuper
Returns ​

GitHub

Methods ​

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

Promise<void>

Properties ​

PropertyType
createGitHubCreate
infoGitHubInfo
optsundefined | GitHubConfig
workflowGitHubWorkflow

GitHubInfo ​

Extends ​

  • GHSuper

Constructors ​

new GitHubInfo() ​
ts
new GitHubInfo(__namedParameters: {
  opts: GitHubConfig;
  utils: CommandSuper;
 }): GitHubInfo
Parameters ​
ParameterType
__namedParametersobject
__namedParameters.opts?GitHubConfig
__namedParameters.utilsCommandSuper
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 ​

PropertyTypeInherited from
optsundefined | GitHubConfigGHSuper.opts

GitHubWorkflow ​

Extends ​

  • GHSuper

Constructors ​

new GitHubWorkflow() ​
ts
new GitHubWorkflow(__namedParameters: {
  opts: GitHubConfig;
  utils: CommandSuper;
 }): GitHubWorkflow
Parameters ​
ParameterType
__namedParametersobject
__namedParameters.opts?GitHubConfig
__namedParameters.utilsCommandSuper
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 ​

PropertyTypeInherited from
optsundefined | GitHubConfigGHSuper.opts

GitInit ​

Extends ​

  • GitSuper

Constructors ​

new GitInit() ​
ts
new GitInit(__namedParameters: {
  opts: GitConfig;
  utils: CommandSuper;
 }): GitInit
Parameters ​
ParameterType
__namedParametersobject
__namedParameters.opts?GitConfig
__namedParameters.utilsCommandSuper
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 ​

PropertyTypeInherited from
optsundefined | GitConfigGitSuper.opts

GitPull ​

Extends ​

  • GitSuper

Constructors ​

new GitPull() ​
ts
new GitPull(__namedParameters: {
  opts: GitConfig;
  utils: CommandSuper;
 }): GitPull
Parameters ​
ParameterType
__namedParametersobject
__namedParameters.opts?GitConfig
__namedParameters.utilsCommandSuper
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 ​

PropertyTypeInherited from
optsundefined | GitConfigGitSuper.opts

GitPush ​

Extends ​

  • GitSuper

Constructors ​

new GitPush() ​
ts
new GitPush(__namedParameters: {
  opts: GitConfig;
  utils: CommandSuper;
 }): GitPush
Parameters ​
ParameterType
__namedParametersobject
__namedParameters.opts?GitConfig
__namedParameters.utilsCommandSuper
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(opts?: {
  skipUpdate: boolean;
  skipWorkflow: boolean;
}): Promise<void>
Parameters ​
ParameterType
opts?object
opts.skipUpdate?boolean
opts.skipWorkflow?boolean
Returns ​

Promise<void>

Properties ​

PropertyTypeInherited from
optsundefined | GitConfigGitSuper.opts

Husky ​

Extends ​

  • GitSuper

Constructors ​

new Husky() ​
ts
new Husky(__namedParameters: {
  opts: GitConfig;
  utils: CommandSuper;
 }): Husky
Parameters ​
ParameterType
__namedParametersobject
__namedParameters.opts?GitConfig
__namedParameters.utilsCommandSuper
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 ​

PropertyTypeInherited from
optsundefined | GitConfigGitSuper.opts

Packages ​

Extends ​

  • Repo

Constructors ​

new Packages() ​
ts
new Packages(__namedParameters: {
  opts: GitHubConfig;
  utils: CommandSuper;
 }): Packages
Parameters ​
ParameterType
__namedParametersobject
__namedParameters.opts?GitHubConfig
__namedParameters.utilsCommandSuper
Returns ​

Packages

Inherited from ​

Repo.constructor

Methods ​

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

Promise<{}>

getPkgVersion() ​
ts
getPkgVersion(npm: boolean, showPrivate: boolean): Promise<{
  name: pkg.name;
  npm: npmVersion;
  private: pkgPrivate;
  version: pkg.version;
}[]>
Parameters ​
ParameterTypeDefault value
npmbooleantrue
showPrivatebooleantrue
Returns ​

Promise<{ name: pkg.name; npm: npmVersion; private: pkgPrivate; version: pkg.version; }[]>

getSize() ​
ts
getSize(name: string): Promise<{
  data: SiziumResponse;
  inputType: pkg.inputType;
}>
Parameters ​
ParameterTypeDefault value
namestring'./'
Returns ​

Promise<{ data: SiziumResponse; inputType: pkg.inputType; }>

NameTypeDefault value
dataSiziumResponse-
inputType"string" | "url" | "json" | "path"pkg.inputType
getSizeData() ​
ts
getSizeData(name: string): Promise<{
  data: SiziumResponse;
  inputType: pkg.inputType;
}>
Parameters ​
ParameterTypeDefault value
namestring'./'
Returns ​

Promise<{ data: SiziumResponse; inputType: pkg.inputType; }>

NameTypeDefault value
dataSiziumResponse-
inputType"string" | "url" | "json" | "path"pkg.inputType
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<void>
Returns ​

Promise<void>

publish() ​
ts
publish(preCmd?: string): Promise<void>
Parameters ​
ParameterType
preCmd?string
Returns ​

Promise<void>

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<void>
Returns ​

Promise<void>

Properties ​

PropertyTypeInherited from
optsundefined | GitHubConfigRepo.opts

Functions ​

contributorsPlugin() ​

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

Dovenv plugin for managing workspace contributors.

Type Parameters ​

Type ParameterDefault type
R extends RoleMapRoleMap

Parameters ​

ParameterTypeDescription
conf?ContributorsConfig<R>Optional configuration.

Returns ​

Config

  • The plugin configuration.

ghPlugin() ​

ts
function ghPlugin(conf?: GitHubConfig): Config

Parameters ​

ParameterType
conf?GitHubConfig

Returns ​

Config


gitPlugin() ​

ts
function gitPlugin(conf?: GitConfig): Config

Dovenv plugin for managing a repository.

Parameters ​

ParameterTypeDescription
conf?GitConfigOptional configuration.

Returns ​

Config

  • The plugin configuration.

Example ​

ts
import { defineConfig } from '@dovenv/core'
import { gitPlugin } from '@dovenv/plugin/repo'

export default defineConfig( [
  gitPlugin( {
    commit : {
      types : [
        { value: 'feat', title: 'A new feature' },
        { value: 'fix', title: 'A bug fix' },
      ],
      scopes : [
        { value: 'core', title: 'Core' },
        { value: 'package', title: 'Package' },
        { value: 'env', title: 'Environment' },
        { value: 'all', title: 'All' },
      ],
    },
  } ),
] )

package2Contributors() ​

ts
function package2Contributors(pkg: {
  devEngines: {
     cpu: undefined | {
        name: string;
        onFail: "error" | "ignore" | "warn";
        version: string;
       };
     libc: undefined | {
        name: string;
        onFail: "error" | "ignore" | "warn";
        version: string;
       };
     os: undefined | {
        name: string;
        onFail: "error" | "ignore" | "warn";
        version: string;
       };
     packageManager: undefined | {
        name: string;
        onFail: "error" | "ignore" | "warn";
        version: string;
       };
     runtime: undefined | {
        name: string;
        onFail: "error" | "ignore" | "warn";
        version: string;
       };
    };
 }, opts?: ContributorsOpts): undefined | ContributorsOpts

Converts a package's author, contributors, and maintainers information into a structured format of contributors and their roles.

Parameters ​

ParameterTypeDescription
pkgobjectThe package JSON containing author, contributors, and maintainers data.
pkg.devEngines?objectThe devEngines field aids engineers working on a codebase to all be using the same tooling. See https://docs.npmjs.com/cli/v11/configuring-npm/package-json#devengines
pkg.devEngines.cpu?undefined | { name: string; onFail: "error" | "ignore" | "warn"; version: string; }-
pkg.devEngines.libc?undefined | { name: string; onFail: "error" | "ignore" | "warn"; version: string; }-
pkg.devEngines.os?undefined | { name: string; onFail: "error" | "ignore" | "warn"; version: string; }-
pkg.devEngines.packageManager?undefined | { name: string; onFail: "error" | "ignore" | "warn"; version: string; }-
pkg.devEngines.runtime?undefined | { name: string; onFail: "error" | "ignore" | "warn"; version: string; }-
opts?ContributorsOptsOptional contributors options.

Returns ​

undefined | ContributorsOpts

An object containing: - role: An object defining various contributor roles with their names and emojis. - member: An array of contributors with details like role, GitHub username, name, and URL.


pkgPlugin() ​

ts
function pkgPlugin(conf?: GitHubConfig): Config

Parameters ​

ParameterType
conf?GitHubConfig

Returns ​

Config


repoPlugin() ​

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

Dovenv plugin for managing a repository.

Type Parameters ​

Type ParameterDefault type
R extends RoleMapRoleMap

Parameters ​

ParameterTypeDescription
opts?Config<R>Optional configuration.

Returns ​

Config

  • The plugin configuration.

Type Aliases ​

Config<R> ​

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

Type declaration ​

NameTypeDescription
contributors?ContributorsConfig<R>Contributors configuration

Type Parameters ​

Type Parameter
R extends Role

ContributorsConfig<R> ​

ts
type ContributorsConfig<R>: {
  member: Members<keyof R>;
  role: R;
};

Type Parameters ​

Type Parameter
R extends Role

Type declaration ​

NameTypeDescription
memberMembers<keyof R>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: '🌏' } * },

GitConfig ​

ts
type GitConfig: GitHubConfig & {
  commit: {
     scopes: {
        desc: string;
        title: string;
        value: string;
       }[];
     types: {
        desc: string;
        title: string;
        value: string;
       }[];
    };
  husky: {
     path: string;
    };
  pull: unknown;
  push: unknown;
};

Type declaration ​

NameTypeDescription
commit?{ scopes: { desc: string; title: string; value: string; }[]; types: { desc: string; title: string; value: string; }[]; }Commit configuration
commit.scopes?{ desc: string; title: string; value: string; }[]Scope of commit message. Example [ {value: 'core'}, {value: 'package'}, {value: 'env'}, {value: 'all'} ]
commit.types?{ desc: string; title: string; value: string; }[]Type of commit message. Add types for your commits. Example [ {value: 'feat', title: 'A new feature'}, {value: 'fix', title: 'A bug fix'} ]
husky?{ path: string; }Husky configuration Link https://typicode.github.io/husky/
husky.pathstringThe path to set the '.husky' directory. Default '.dovenv/.husky'
pull?unknownPull configuration
push?unknownPush configuration

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.

Members<ID> ​

ts
type Members<ID>: {
  avatar: string;
  ghUsername: string;
  name: string;
  role: ID;
  url: string;
 }[];

Type Parameters ​

Type Parameter
ID extends RoleKey

Role ​

ts
type Role: RoleMap;

References ​

default ​

Renames and re-exports repoPlugin

PackageConfig ​

Renames and re-exports GitHubConfig

Variables ​

CONTRIBUTOR_ROLE ​

ts
const CONTRIBUTOR_ROLE: {
  author: {
     desc: 'Author of the project.';
     emoji: 'πŸ‘‘';
     name: 'Author';
    };
  contributor: {
     desc: 'Contributor for the development of the project. Code, docs, etc.';
     emoji: 'πŸ’»';
     name: 'Contributor';
    };
  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';
    };
  mantainer: {
     desc: 'Maintainer of the project. Code, docs, etc.';
     emoji: '🚧';
     name: 'Mantainer';
    };
  organization: {
     desc: 'Organization of the project.';
     emoji: '🏒';
     name: 'Organization';
    };
  sponsor: {
     desc: 'Sponsor of the project.';
     emoji: '🀝';
     name: 'Sponsor';
    };
  translator: {
     desc: 'Translator for the project.';
     emoji: '🌏';
     name: 'Translator';
    };
};

Contributor roles object with their names and emojis.

Type declaration ​

NameTypeDefault value
author{ desc: 'Author of the project.'; emoji: 'πŸ‘‘'; name: 'Author'; }-
author.desc"Author of the project."'Author of the project.'
author.emoji"πŸ‘‘"'πŸ‘‘'
author.name"Author"'Author'
contributor{ desc: 'Contributor for the development of the project. Code, docs, etc.'; emoji: 'πŸ’»'; name: 'Contributor'; }-
contributor.desc"Contributor for the development of the project. Code, docs, etc."'Contributor for the development of the project. Code, docs, etc.'
contributor.emoji"πŸ’»"'πŸ’»'
contributor.name"Contributor"'Contributor'
designer{ desc: 'Contributor for the design of the project. Images, icons, etc.'; emoji: 'πŸ’„'; name: 'Designer'; }-
designer.desc"Contributor for the design of the project. Images, icons, etc."'Contributor for the design of the project. Images, icons, etc.'
designer.emoji"πŸ’„"'πŸ’„'
designer.name"Designer"'Designer'
developer{ desc: 'Contributor for the development of the project. Code, docs, etc.'; emoji: 'πŸ’»'; name: 'Developer'; }-
developer.desc"Contributor for the development of the project. Code, docs, etc."'Contributor for the development of the project. Code, docs, etc.'
developer.emoji"πŸ’»"'πŸ’»'
developer.name"Developer"'Developer'
mantainer{ desc: 'Maintainer of the project. Code, docs, etc.'; emoji: '🚧'; name: 'Mantainer'; }-
mantainer.desc"Maintainer of the project. Code, docs, etc."'Maintainer of the project. Code, docs, etc.'
mantainer.emoji"🚧"'🚧'
mantainer.name"Mantainer"'Mantainer'
organization{ desc: 'Organization of the project.'; emoji: '🏒'; name: 'Organization'; }-
organization.desc"Organization of the project."'Organization of the project.'
organization.emoji"🏒"'🏒'
organization.name"Organization"'Organization'
sponsor{ desc: 'Sponsor of the project.'; emoji: '🀝'; name: 'Sponsor'; }-
sponsor.desc"Sponsor of the project."'Sponsor of the project.'
sponsor.emoji"🀝"'🀝'
sponsor.name"Sponsor"'Sponsor'
translator{ desc: 'Translator for the project.'; emoji: '🌏'; name: 'Translator'; }-
translator.desc"Translator for the project."'Translator for the project.'
translator.emoji"🌏"'🌏'
translator.name"Translator"'Translator'