Skip to content

About

The contribution types supported by All Contributors, as data. πŸ”£

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

All Contributors Types

The contribution types supported by All Contributors, as data. πŸ”£

πŸ‘ͺ All Contributors: 1 🀝 Code of Conduct: Kept πŸ§ͺ Coverage πŸ“ License: MIT πŸ“¦ npm version πŸ’ͺ TypeScript: Strict

Usage

npm i all-contributors-types
import {
	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"); // false

The 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 contributor
  • projectName: name of the repository
  • projectOwner: owner of the repository
  • repoHost (optional): base URL of the repository host, if not the default for repoType
  • repoType (optional): "github" (default) or "gitlab"

isContributionTypeName

Type guard for whether a string is a known ContributionTypeName.

Why?

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.

Development

See .github/CONTRIBUTING.md, then .github/DEVELOPMENT.md. Thanks! πŸ”£

Contributors

Josh Goldberg ✨
Josh Goldberg ✨

πŸ’» πŸ–‹ πŸ“– πŸ€” πŸš‡ 🚧 πŸ“† πŸ”§

πŸ’ This package was templated with create-typescript-app using the Bingo framework.

About

The contribution types supported by All Contributors, as data. πŸ”£

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages