npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cz-vinyl

v2.5.4

Published

Commitizen adapter for formatting commit messages

Downloads

47,372

Readme

Commitizen adapter for formatting commit messages. Format commit messages with conventional commits.

cz-vinyl allows you to easily use emojis and ticket ID (JIRA, ...) in your commits using commitizen.

? Select the type of changes you're committing: (Use arrow keys or type to search)
> 🤖 chore: Build process or auxiliary tool changes
  🚀 ci: CI related changes
  📘 docs: Documentation only changes
  🔥 feat: A new feature
  🐞 fix: A bug fix
  ⚡ perf: A code change that improves performance
  💡 refactor: A code change that neither fixes a bug or adds a feature

Demo

cz-vinyl

OpenAI support

As from version 2.3.0 we now support OpenAI to generate your commit message! Create your own OpenAI account and provide this library your API key token to use it.

Payment

You pay for your own requests to OpenAI API. The package uses the 3.5-turbo model official model, that is ~15x times cheaper than GPT-4.

Installation

Globally

npm install --global cz-vinyl

# set as default adapter for your projects
echo '{ "path": "cz-vinyl" }' > ~/.czrc

Locally

npm install --save-dev cz-vinyl

Add this to your package.json:

"config": {
  "commitizen": {
    "path": "cz-vinyl"
  }
}

Usage

$ git cz

ESM support

cz-vinyl now supports only ESM modules, from version >1.6.2. For any issue regarding this, please visit this link https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

Configuration

Like commitizen, you can specify the configuration of cz-vinyl through various options. Configuration can be set in environment variables or in the following files (the following files can also be configured in home directory):

  • a package.json property: "czvinyl": {...} or in ~/package.json, for example
  • a .czvinylrc file in JSON or YAML format
  • a .czvinylrc.json, .czvinylrc.yaml, .czvinylrc.yml, .czvinylrc.js, or .czvinylrc.cjs file
  • a inflint.config.ts, czvinyl.config.js, or czvinyl.config.cjs CommonJS module exporting an object

The default commit types, descriptions and emoji that are used are:

[
	{
		"description": "Build process or auxiliary tool changes",
		"emoji": "🤖",
		"value": "chore"
	},
	{
		"description": "CI related changes",
		"emoji": "🚀",
		"value": "ci"
	},
	{
		"description": "Documentation only changes",
		"emoji": "📘",
		"value": "docs"
	},
	{
		"description": "A new feature",
		"emoji": "🔥",
		"value": "feat"
	},
	{
		"description": "A bug fix",
		"emoji": "🐞",
		"value": "fix"
	},
	{
		"description": "A code change that improves performance",
		"emoji": "⚡",
		"value": "perf"
	},
	{
		"description": "A code change that neither fixes a bug or adds a feature",
		"emoji": "💡",
		"value": "refactor"
	},
	{
		"description": "Create a release commit",
		"emoji": "🔖",
		"value": "release"
	},
	{
		"description": "Markup, white-space, formatting, missing semi-colons...",
		"emoji": "🎨",
		"value": "style"
	},
	{
		"description": "Adding missing tests",
		"emoji": "✅",
		"value": "test"
	}
]

| Environment variable | Key | Type | Default | Description | |---------------------------------------|---------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------| | CZ_HEADER_FORMAT | headerFormat | string | (commitType: string, scope: string \| undefined, emoji: string \| undefined, ticketId: string \| undefined, subject: string) => string | {type}: {emoji} [{ticket_id}] {subject} | How the commit header will be formatted. Supported placeholders: type, scope, emoji, ticket_id, subject | | CZ_BODY_FORMAT | bodyFormat | string | (commitType: string, scope: string \| undefined, ticketId: string \| undefined, body: string \| undefined) => string | {body} | How the commit body will be formatted. Supported placeholders: type, scope, ticket_id, body | | | commitTypes | { value: string; description: string, emoji?: string }[] | See above | The commit types to work with. | | CZ_MAX_COMMIT_LINE_WIDTH | maxCommitLineWidth | number | 72 | Wraps the commit body message with max line width | | CZ_TYPE_QUESTION | typeQuestion | string | Select the type of changes you're committing:\n | The CLI question for type | | CZ_SCOPE_QUESTION | scopeQuestion | string | Specify a scope: | The CLI question for scope | | CZ_SKIP_SCOPE | skipScope | boolean | true | Whether to prompt the user to a scope question | | | scopes | string[] | [] | Available scopes (empty array allows free text) | | CZ_TICKET_ID_QUESTION | ticketIdQuestion | string | Type the JIRA Id (ex. V-12345): | The CLI question for ticket ID | | CZ_SKIP_TICKET_ID | skipTicketId | boolean | false | Whether to prompt the user to a ticket ID question | | CZ_TICKET_ID_REGEX | ticketIdRegex | string | ((?<!([A-Z]{1,10})-?)[A-Z]+-\d+) | A string represents a valid RegEx to extract ticket ID from the branch | | CZ_ALLOW_EMPTY_TICKET_ID_FOR_BRANCHES | allowEmptyTicketIdForBranches | string[] | [] | List of branches to exclude validation for ticket ID | | CZ_SUBJECT_QUESTION | subjectQuestion | string | Write a short, imperative mood description of the change:\n | The CLI question for subject | | CZ_SUBJECT_MAX_LENGTH | subjectMaxLength | number | 70 | Max length of the subject text | | CZ_SUBJECT_MIN_LENGTH | subjectMinLength | number | 3 | Min length of the subject text | | CZ_BODY_QUESTION | bodyQuestion | string | Provide a longer description of the change:\n | The CLI question for body | | CZ_SKIP_BODY | skipBody | boolean | false | Whether to prompt the user to a body question | | CZ_SKIP_BREAKING_CHANGES | skipBreakingChanges | boolean | true | Whether to prompt the user to a breaking change question | | CZ_ISSUES_QUESTION | issuesQuestion | string | List any issue closed (#1, #2, ...): | The CLI question for issues | | CZ_SKIP_ISSUES | skipIssues | boolean | true | Whether to prompt the user to a issues question | | CZ_OPEN_AI_TOKEN | openAiToken | string | null | null | Whether to use OpenAI to generate a commit message including commit subject & body. A body will be dismissed if skipBody is enabled. |

Examples

Support

For support, email [email protected] or open an issue at cz-vinyl issues.

Contributing

Contributions are always welcome!

See CONTRIBUTING.md for ways to get started.

Please adhere to this project's CODE_OF_CONDUCT.md.

If you want to make PR please first check your code by:

  1. Run pnpm i to install dependencies
  2. Build your source code by running pnpm build
  3. Modify .cz.json file with:
{
	"path": "./dist/index.cjs"
}
  1. Run git cmt and check results of your code

Authors

License

MIT