all-contributors-types
v0.1.0
Published
The contribution types supported by All Contributors, as data. 🔣
Readme
Usage
npm i all-contributors-typesimport {
contributionTypes,
createContributionLink,
isContributionTypeName,
} from "all-contributors-types";
contributionTypes.bug;
// { description: "Bug reports", link: "issues", symbol: "🐛" }
createContributionLink("bug", {
login: "JoshuaKGoldberg",
projectName: "all-contributors-types",
projectOwner: "JoshuaKGoldberg",
});
// "https://github.com/JoshuaKGoldberg/all-contributors-types/issues?q=author%3AJoshuaKGoldberg"
isContributionTypeName("bug"); // true
isContributionTypeName("other"); // falseThe data and links are kept in sync with all-contributors-cli's emoji key.
contributionTypes
Each contribution type, keyed by name, with:
description: human-readable description, such as"Bug reports"link(optional): which kind of repository page it links to:"commits","issues", or"reviews"symbol: emoji, such as"🐛"
The ContributionTypeName type is a union of all contribution type names.
createContributionLink
Creates the URL a contribution links to in an All Contributors README table, the same as all-contributors generate.
Contribution types without a link get a #type-login anchor.
Options:
login(optional): username of the contributorprojectName: name of the repositoryprojectOwner: owner of the repositoryrepoHost(optional): base URL of the repository host, if not the default forrepoTyperepoType(optional):"github"(default) or"gitlab"
isContributionTypeName
Type guard for whether a string is a known ContributionTypeName.
Development
See .github/CONTRIBUTING.md, then .github/DEVELOPMENT.md.
Thanks! 🔣
Contributors
💝 This package was templated with
create-typescript-appusing the Bingo framework.
