The contribution types supported by All Contributors, as data. π£
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.
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.
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"
Type guard for whether a string is a known ContributionTypeName.
all-contributors/cli#295 Expose contribution-types in separate package tracks a first-party package exposing these utilities and types. In the meantime, this package approximates what all-contributors does.
See .github/CONTRIBUTING.md, then .github/DEVELOPMENT.md.
Thanks! π£
Josh Goldberg β¨ π» π π π€ π π§ π π§ |
π This package was templated with
create-typescript-appusing the Bingo framework.