@dovenv/repo - API documentation β
Classes β
Contributors<R> β
Type Parameters β
| Type Parameter | Default type |
|---|---|
R extends RoleMap | Role |
Constructors β
new Contributors() β
new Contributors<R>(config?: ContributorsParams<R>): Contributors<R>Parameters β
| Parameter | Type |
|---|---|
config? | ContributorsParams<R> |
Returns β
Contributors<R>
Methods β
filterByRole() β
filterByRole(role: RoleKey[]): Promise<undefined | ContributorsOpts>Filter the contributors by role using a list of role IDs.
Parameters β
| Parameter | Type | Description |
|---|---|---|
role | RoleKey[] | Role IDs to filter by. |
Returns β
Promise<undefined | ContributorsOpts>
- The filtered contributors.
filterByRolePattern() β
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 β
| Parameter | Type | Description |
|---|---|---|
pattern | string[] | Pattern to filter the role IDs with. |
Returns β
Promise<undefined | ContributorsOpts>
- The filtered contributors.
getHtmlContent() β
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 β
| Parameter | Type | Description |
|---|---|---|
opts? | ContributorsGetOpts | Options object. |
Returns β
Promise<string>
- The HTML content of the contributors table.
getMarkdownContent() β
getMarkdownContent(opts?: ContributorsGetOpts): Promise<string>Converts the HTML content of the contributors table to Markdown.
Parameters β
| Parameter | Type | Description |
|---|---|---|
opts? | ContributorsGetOpts | Options object. |
Returns β
Promise<string>
- The Markdown content of the contributors table.
getTerminalContent() β
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 β
| Parameter | Type | Description |
|---|---|---|
opts? | ContributorsGetOpts | Options object. |
Returns β
Promise<string>
- The terminal-formatted content of the contributors table.
showTerminalOutput() β
showTerminalOutput(opts?: ContributorsGetOpts): Promise<void>Logs the contributors table as a formatted string to the terminal.
Parameters β
| Parameter | Type | Description |
|---|---|---|
opts? | ContributorsGetOpts | Options object. |
Returns β
Promise<void>
- The result of logging the contributors table.
Properties β
| Property | Type |
|---|---|
opts | undefined | ContributorsOpts |
Git β
Extends β
Repo<GitConfig>
Constructors β
new Git() β
new Git(data: {
opts: GitConfig;
utils: CommandSuper;
}): GitParameters β
| Parameter | Type |
|---|---|
data | object |
data.opts? | GitConfig |
data.utils | CommandSuper |
Returns β
Overrides β
Repo<GitConfig>.constructor
Methods β
init() β
init(): Promise<void>Returns β
Promise<void>
Inherited from β
Repo.init
initGH() β
initGH(): Promise<void>Returns β
Promise<void>
Inherited from β
Repo.initGH
Properties β
| Property | Type | Inherited from |
|---|---|---|
add | GitAdd | - |
branch | GitBranch | - |
commit | GitCommit | - |
husky | Husky | - |
initialize | GitInit | - |
opts | undefined | GitConfig | Repo.opts |
pull | GitPull | - |
push | GitPush | - |
GitAdd β
Extends β
GitSuper
Constructors β
new GitAdd() β
new GitAdd(__namedParameters: {
opts: GitConfig;
utils: CommandSuper;
}): GitAddParameters β
| Parameter | Type |
|---|---|
__namedParameters | object |
__namedParameters.opts? | GitConfig |
__namedParameters.utils | CommandSuper |
Returns β
Inherited from β
GitSuper.constructor
Methods β
ask() β
ask(initialValue: string): Promise<string>Parameters β
| Parameter | Type | Default value |
|---|---|---|
initialValue | string | '.' |
Returns β
Promise<string>
exec() β
exec(value: string): Promise<void>Parameters β
| Parameter | Type |
|---|---|
value | string |
Returns β
Promise<void>
getGitRemoteURL() β
getGitRemoteURL(): Promise<undefined | string>Returns β
Promise<undefined | string>
Inherited from β
GitSuper.getGitRemoteURL
init() β
init(): Promise<void>Returns β
Promise<void>
Inherited from β
GitSuper.init
initGH() β
initGH(): Promise<void>Returns β
Promise<void>
Inherited from β
GitSuper.initGH
run() β
run(): Promise<void>Returns β
Promise<void>
Properties β
| Property | Type | Inherited from |
|---|---|---|
opts | undefined | GitConfig | GitSuper.opts |
GitBranch β
Extends β
GitSuper
Constructors β
new GitBranch() β
new GitBranch(__namedParameters: {
opts: GitConfig;
utils: CommandSuper;
}): GitBranchParameters β
| Parameter | Type |
|---|---|
__namedParameters | object |
__namedParameters.opts? | GitConfig |
__namedParameters.utils | CommandSuper |
Returns β
Inherited from β
GitSuper.constructor
Methods β
askSelectBranch() β
askSelectBranch(defaultValue?: string, remote?: boolean): Promise<string>Parameters β
| Parameter | Type | Default value |
|---|---|---|
defaultValue? | string | undefined |
remote? | boolean | true |
Returns β
Promise<string>
change() β
change(branchName?: string, force?: boolean): Promise<void>Change to a specified branch.
Parameters β
| Parameter | Type | Default value | Description |
|---|---|---|---|
branchName? | string | undefined | The name of the branch to switch to. |
force? | boolean | false | If true, force switches to the branch, discarding local changes. |
Returns β
Promise<void>
create() β
create(branchName?: string): Promise<void>Create a new branch without switching to it.
Parameters β
| Parameter | Type | Description |
|---|---|---|
branchName? | string | The name of the branch to create. |
Returns β
Promise<void>
createAndSwitch() β
createAndSwitch(branchName?: string): Promise<void>Create a new branch and switch to it.
Parameters β
| Parameter | Type | Description |
|---|---|---|
branchName? | string | The name of the branch to create and switch to. |
Returns β
Promise<void>
delete() β
delete(branchName?: string, force?: boolean): Promise<void>Delete a branch.
Parameters β
| Parameter | Type | Default value | Description |
|---|---|---|---|
branchName? | string | undefined | The name of the branch to delete. |
force? | boolean | false | If true, forces deletion of the branch. |
Returns β
Promise<void>
getAll() β
getAll(remote: boolean): Promise<string[]>Get all branches in the repository.
Parameters β
| Parameter | Type | Default value | Description |
|---|---|---|---|
remote | boolean | true | If true, shows remote branches as well. |
Returns β
Promise<string[]>
- An array of branch names.
getCurrent() β
getCurrent(): Promise<string>Get the current branch name.
Returns β
Promise<string>
- The name of the current branch.
getGitRemoteURL() β
getGitRemoteURL(): Promise<undefined | string>Returns β
Promise<undefined | string>
Inherited from β
GitSuper.getGitRemoteURL
init() β
init(): Promise<void>Returns β
Promise<void>
Inherited from β
GitSuper.init
initGH() β
initGH(): Promise<void>Returns β
Promise<void>
Inherited from β
GitSuper.initGH
showAll() β
showAll(remote: boolean): Promise<void>Show all branches in the repository.
Parameters β
| Parameter | Type | Default value | Description |
|---|---|---|---|
remote | boolean | true | If true, shows remote branches as well. |
Returns β
Promise<void>
showCurrent() β
showCurrent(): Promise<void>Shows the current branch name.
Returns β
Promise<void>
switch() β
switch(branchName?: string): Promise<void>Switch to an existing branch.
Parameters β
| Parameter | Type | Description |
|---|---|---|
branchName? | string | The name of the branch to switch to. |
Returns β
Promise<void>
Properties β
| Property | Type | Inherited from |
|---|---|---|
opts | undefined | GitConfig | GitSuper.opts |
GitCommit β
Extends β
GitSuper
Constructors β
new GitCommit() β
new GitCommit(__namedParameters: {
opts: GitConfig;
utils: CommandSuper;
}): GitCommitParameters β
| Parameter | Type |
|---|---|
__namedParameters | object |
__namedParameters.opts? | GitConfig |
__namedParameters.utils | CommandSuper |
Returns β
Inherited from β
GitSuper.constructor
Methods β
ask() β
ask(execute: boolean): Promise<string>Parameters β
| Parameter | Type | Default value |
|---|---|---|
execute | boolean | true |
Returns β
Promise<string>
exec() β
exec(message: string): Promise<void>Parameters β
| Parameter | Type |
|---|---|
message | string |
Returns β
Promise<void>
getGitRemoteURL() β
getGitRemoteURL(): Promise<undefined | string>Returns β
Promise<undefined | string>
Inherited from β
GitSuper.getGitRemoteURL
getLastCommit() β
getLastCommit(): Promise<string>Get the last commit message.
Returns β
Promise<string>
The last commit message.
getStagedFiles() β
getStagedFiles(): Promise<string>Returns β
Promise<string>
getStagedFilesList() β
getStagedFilesList(): Promise<string[]>Get list of staged files.
Returns β
Promise<string[]>
List of staged files.
init() β
init(): Promise<void>Returns β
Promise<void>
Inherited from β
GitSuper.init
initGH() β
initGH(): Promise<void>Returns β
Promise<void>
Inherited from β
GitSuper.initGH
isStageEmpty() β
isStageEmpty(): Promise<boolean>Returns β
Promise<boolean>
run() β
run(): Promise<undefined | string>Returns β
Promise<undefined | string>
Properties β
| Property | Type | Inherited from |
|---|---|---|
opts | undefined | GitConfig | GitSuper.opts |
scopes | undefined | { desc: string; title: string; value: string; }[] | - |
types | undefined | { desc: string; title: string; value: string; }[] | - |
GitHub β
Constructors β
new GitHub() β
new GitHub(__namedParameters: {
opts: GitHubConfig;
utils: CommandSuper;
}): GitHubParameters β
| Parameter | Type |
|---|---|
__namedParameters | object |
__namedParameters.opts? | GitHubConfig |
__namedParameters.utils | CommandSuper |
Returns β
Methods β
download() β
download(input: string, output: string): Promise<void>Parameters β
| Parameter | Type |
|---|---|
input | string |
output | string |
Returns β
Promise<void>
Properties β
| Property | Type |
|---|---|
create | GitHubCreate |
info | GitHubInfo |
opts | undefined | GitHubConfig |
workflow | GitHubWorkflow |
GitHubInfo β
Extends β
GHSuper
Constructors β
new GitHubInfo() β
new GitHubInfo(__namedParameters: {
opts: GitHubConfig;
utils: CommandSuper;
}): GitHubInfoParameters β
| Parameter | Type |
|---|---|
__namedParameters | object |
__namedParameters.opts? | GitHubConfig |
__namedParameters.utils | CommandSuper |
Returns β
Inherited from β
GHSuper.constructor
Methods β
getRepoList() β
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 β
| Parameter | Type |
|---|---|
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() β
init(): Promise<void>Returns β
Promise<void>
Inherited from β
GHSuper.init
initGH() β
initGH(): Promise<void>Returns β
Promise<void>
Inherited from β
GHSuper.initGH
update() β
update(): Promise<void>Returns β
Promise<void>
view() β
view(): Promise<void>Returns β
Promise<void>
viewAll() β
viewAll(): Promise<void>Returns β
Promise<void>
Properties β
| Property | Type | Inherited from |
|---|---|---|
opts | undefined | GitHubConfig | GHSuper.opts |
GitHubWorkflow β
Extends β
GHSuper
Constructors β
new GitHubWorkflow() β
new GitHubWorkflow(__namedParameters: {
opts: GitHubConfig;
utils: CommandSuper;
}): GitHubWorkflowParameters β
| Parameter | Type |
|---|---|
__namedParameters | object |
__namedParameters.opts? | GitHubConfig |
__namedParameters.utils | CommandSuper |
Returns β
Inherited from β
GHSuper.constructor
Methods β
getRepoList() β
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 β
| Parameter | Type |
|---|---|
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() β
init(): Promise<void>Returns β
Promise<void>
Inherited from β
GHSuper.init
initGH() β
initGH(): Promise<void>Returns β
Promise<void>
Inherited from β
GHSuper.initGH
list() β
list(): Promise<void>Returns β
Promise<void>
run() β
run(): Promise<void>Returns β
Promise<void>
Properties β
| Property | Type | Inherited from |
|---|---|---|
opts | undefined | GitHubConfig | GHSuper.opts |
GitInit β
Extends β
GitSuper
Constructors β
new GitInit() β
new GitInit(__namedParameters: {
opts: GitConfig;
utils: CommandSuper;
}): GitInitParameters β
| Parameter | Type |
|---|---|
__namedParameters | object |
__namedParameters.opts? | GitConfig |
__namedParameters.utils | CommandSuper |
Returns β
Inherited from β
GitSuper.constructor
Methods β
getGitRemoteURL() β
getGitRemoteURL(): Promise<undefined | string>Returns β
Promise<undefined | string>
Inherited from β
GitSuper.getGitRemoteURL
init() β
init(): Promise<void>Returns β
Promise<void>
Inherited from β
GitSuper.init
initGH() β
initGH(): Promise<void>Returns β
Promise<void>
Inherited from β
GitSuper.initGH
isInit() β
isInit(): Promise<boolean>Returns β
Promise<boolean>
run() β
run(silent: boolean): Promise<void>Parameters β
| Parameter | Type | Default value |
|---|---|---|
silent | boolean | false |
Returns β
Promise<void>
Properties β
| Property | Type | Inherited from |
|---|---|---|
opts | undefined | GitConfig | GitSuper.opts |
GitPull β
Extends β
GitSuper
Constructors β
new GitPull() β
new GitPull(__namedParameters: {
opts: GitConfig;
utils: CommandSuper;
}): GitPullParameters β
| Parameter | Type |
|---|---|
__namedParameters | object |
__namedParameters.opts? | GitConfig |
__namedParameters.utils | CommandSuper |
Returns β
Inherited from β
GitSuper.constructor
Methods β
getGitRemoteURL() β
getGitRemoteURL(): Promise<undefined | string>Returns β
Promise<undefined | string>
Inherited from β
GitSuper.getGitRemoteURL
init() β
init(): Promise<void>Returns β
Promise<void>
Inherited from β
GitSuper.init
initGH() β
initGH(): Promise<void>Returns β
Promise<void>
Inherited from β
GitSuper.initGH
run() β
run(): Promise<void>Returns β
Promise<void>
Properties β
| Property | Type | Inherited from |
|---|---|---|
opts | undefined | GitConfig | GitSuper.opts |
GitPush β
Extends β
GitSuper
Constructors β
new GitPush() β
new GitPush(__namedParameters: {
opts: GitConfig;
utils: CommandSuper;
}): GitPushParameters β
| Parameter | Type |
|---|---|
__namedParameters | object |
__namedParameters.opts? | GitConfig |
__namedParameters.utils | CommandSuper |
Returns β
Inherited from β
GitSuper.constructor
Methods β
exec() β
exec(branch: string): Promise<void>Parameters β
| Parameter | Type |
|---|---|
branch | string |
Returns β
Promise<void>
getGitRemoteURL() β
getGitRemoteURL(): Promise<undefined | string>Returns β
Promise<undefined | string>
Inherited from β
GitSuper.getGitRemoteURL
init() β
init(): Promise<void>Returns β
Promise<void>
Inherited from β
GitSuper.init
initGH() β
initGH(): Promise<void>Returns β
Promise<void>
Inherited from β
GitSuper.initGH
run() β
run(opts?: {
skipUpdate: boolean;
skipWorkflow: boolean;
}): Promise<void>Parameters β
| Parameter | Type |
|---|---|
opts? | object |
opts.skipUpdate? | boolean |
opts.skipWorkflow? | boolean |
Returns β
Promise<void>
Properties β
| Property | Type | Inherited from |
|---|---|---|
opts | undefined | GitConfig | GitSuper.opts |
Husky β
Extends β
GitSuper
Constructors β
new Husky() β
new Husky(__namedParameters: {
opts: GitConfig;
utils: CommandSuper;
}): HuskyParameters β
| Parameter | Type |
|---|---|
__namedParameters | object |
__namedParameters.opts? | GitConfig |
__namedParameters.utils | CommandSuper |
Returns β
Inherited from β
GitSuper.constructor
Methods β
getGitRemoteURL() β
getGitRemoteURL(): Promise<undefined | string>Returns β
Promise<undefined | string>
Inherited from β
GitSuper.getGitRemoteURL
init() β
init(): Promise<void>Returns β
Promise<void>
Inherited from β
GitSuper.init
initGH() β
initGH(): Promise<void>Returns β
Promise<void>
Inherited from β
GitSuper.initGH
run() β
run(): Promise<void>Returns β
Promise<void>
Properties β
| Property | Type | Inherited from |
|---|---|---|
opts | undefined | GitConfig | GitSuper.opts |
Packages β
Extends β
Repo
Constructors β
new Packages() β
new Packages(__namedParameters: {
opts: GitHubConfig;
utils: CommandSuper;
}): PackagesParameters β
| Parameter | Type |
|---|---|
__namedParameters | object |
__namedParameters.opts? | GitHubConfig |
__namedParameters.utils | CommandSuper |
Returns β
Inherited from β
Repo.constructor
Methods β
ask() β
ask(): Promise<{}>Returns β
Promise<{}>
getPkgVersion() β
getPkgVersion(npm: boolean, showPrivate: boolean): Promise<{
name: pkg.name;
npm: npmVersion;
private: pkgPrivate;
version: pkg.version;
}[]>Parameters β
| Parameter | Type | Default value |
|---|---|---|
npm | boolean | true |
showPrivate | boolean | true |
Returns β
Promise<{ name: pkg.name; npm: npmVersion; private: pkgPrivate; version: pkg.version; }[]>
getSize() β
getSize(name: string): Promise<{
data: SiziumResponse;
inputType: pkg.inputType;
}>Parameters β
| Parameter | Type | Default value |
|---|---|---|
name | string | './' |
Returns β
Promise<{ data: SiziumResponse; inputType: pkg.inputType; }>
| Name | Type | Default value |
|---|---|---|
data | SiziumResponse | - |
inputType | "string" | "url" | "json" | "path" | pkg.inputType |
getSizeData() β
getSizeData(name: string): Promise<{
data: SiziumResponse;
inputType: pkg.inputType;
}>Parameters β
| Parameter | Type | Default value |
|---|---|---|
name | string | './' |
Returns β
Promise<{ data: SiziumResponse; inputType: pkg.inputType; }>
| Name | Type | Default value |
|---|---|---|
data | SiziumResponse | - |
inputType | "string" | "url" | "json" | "path" | pkg.inputType |
init() β
init(): Promise<void>Returns β
Promise<void>
Overrides β
Repo.init
initGH() β
initGH(): Promise<void>Returns β
Promise<void>
Inherited from β
Repo.initGH
prepare() β
prepare(): Promise<void>Returns β
Promise<void>
publish() β
publish(preCmd?: string): Promise<void>Parameters β
| Parameter | Type |
|---|---|
preCmd? | string |
Returns β
Promise<void>
release() β
release(): Promise<void>Returns β
Promise<void>
showPackageVersion() β
showPackageVersion(npm: boolean): Promise<void>Parameters β
| Parameter | Type | Default value |
|---|---|---|
npm | boolean | true |
Returns β
Promise<void>
version() β
version(): Promise<void>Returns β
Promise<void>
Properties β
| Property | Type | Inherited from |
|---|---|---|
opts | undefined | GitHubConfig | Repo.opts |
Functions β
contributorsPlugin() β
function contributorsPlugin<R>(conf?: ContributorsConfig<R>): ConfigDovenv plugin for managing workspace contributors.
Type Parameters β
| Type Parameter | Default type |
|---|---|
R extends RoleMap | RoleMap |
Parameters β
| Parameter | Type | Description |
|---|---|---|
conf? | ContributorsConfig<R> | Optional configuration. |
Returns β
Config
- The plugin configuration.
ghPlugin() β
function ghPlugin(conf?: GitHubConfig): ConfigParameters β
| Parameter | Type |
|---|---|
conf? | GitHubConfig |
Returns β
Config
gitPlugin() β
function gitPlugin(conf?: GitConfig): ConfigDovenv plugin for managing a repository.
Parameters β
| Parameter | Type | Description |
|---|---|---|
conf? | GitConfig | Optional configuration. |
Returns β
Config
- The plugin configuration.
Example β
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() β
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 | ContributorsOptsConverts a package's author, contributors, and maintainers information into a structured format of contributors and their roles.
Parameters β
| Parameter | Type | Description |
|---|---|---|
pkg | object | The package JSON containing author, contributors, and maintainers data. |
pkg.devEngines? | object | The 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? | ContributorsOpts | Optional 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() β
function pkgPlugin(conf?: GitHubConfig): ConfigParameters β
| Parameter | Type |
|---|---|
conf? | GitHubConfig |
Returns β
Config
repoPlugin() β
function repoPlugin<R>(opts?: Config<R>): ConfigDovenv plugin for managing a repository.
Type Parameters β
| Type Parameter | Default type |
|---|---|
R extends RoleMap | RoleMap |
Parameters β
| Parameter | Type | Description |
|---|---|---|
opts? | Config<R> | Optional configuration. |
Returns β
Config
- The plugin configuration.
Type Aliases β
Config<R> β
type Config<R>: GitHubConfig & GitConfig & {
contributors: ContributorsConfig<R>;
};Type declaration β
| Name | Type | Description |
|---|---|---|
contributors? | ContributorsConfig<R> | Contributors configuration |
Type Parameters β
| Type Parameter |
|---|
R extends Role |
ContributorsConfig<R> β
type ContributorsConfig<R>: {
member: Members<keyof R>;
role: R;
};Type Parameters β
| Type Parameter |
|---|
R extends Role |
Type declaration β
| Name | Type | Description |
|---|---|---|
member | Members<keyof R> | Set contributor members. Example [ { ghUsername: 'angelespejo', name: 'Angelo', role: 'author' }, { ghUsername: 'pigeonposse', name: 'PigeonPosse', role: 'organization' }, ] |
role | R | Set contributor roles. Example { * owner: { name: 'Owner', emoji: 'π' }, * developer: { name: 'Developer', emoji: 'π€' }, * organization: { name: 'Organization', emoji: 'π’' }, * sponsor: { name: 'Sponsor', emoji: 'π€' }, * translator: { name: 'Translator', emoji: 'π' } * }, |
GitConfig β
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 β
| Name | Type | Description |
|---|---|---|
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.path | string | The path to set the '.husky' directory. Default '.dovenv/.husky' |
pull? | unknown | Pull configuration |
push? | unknown | Push configuration |
GitHubConfig β
type GitHubConfig: {
defaultBranch: string;
desc: string;
homepageURL: string;
ID: string;
tags: string[];
URL: string;
userID: string;
workflowDefaultInputs: string;
workflowsDir: string;
};Type declaration β
| Name | Type | Description |
|---|---|---|
defaultBranch? | string | Primary branch from the repository. Example "main" |
desc? | string | Description of the repository. Example "This is a cool project" |
homepageURL? | string | The URL of the project's homepage. Example "https://pigeonposse.com" |
ID? | string | Name of the repository. Example "dovenv" |
tags? | string[] | Tags or topics associated with the repository. Example [ "web", "api", "rest-api", "openapi", "library", "node", "js"] |
URL? | string | URL of the repopository. Example "https://github.com/pigeonposse/dovenv" |
userID? | string | GitHub user |
workflowDefaultInputs? | string | Workflow default inputs. |
workflowsDir? | string | Path to .github/workflows directory. |
Members<ID> β
type Members<ID>: {
avatar: string;
ghUsername: string;
name: string;
role: ID;
url: string;
}[];Type Parameters β
| Type Parameter |
|---|
ID extends RoleKey |
Role β
type Role: RoleMap;References β
default β
Renames and re-exports repoPlugin
PackageConfig β
Renames and re-exports GitHubConfig
Variables β
CONTRIBUTOR_ROLE β
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 β
| Name | Type | Default 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' |
