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

git-commit-lint

v1.0.0

Published

自定义cz-customizable

Downloads

1

Readme

git-commit-lint

自定义团队或个人的一个 git-commit 约束

使用

全局安装

npm install -g git-commit-lint@latest

全局安装后, 将在全局添加命令:

  • my-cm : 可以用来代替你的 git commit
  • my-cm-int : 在项目中一键初始化使用 git-commit-lint

项目中初始化

初始化后, 请执行 npm install 安装依赖即可。

my-cm-int

定制个人的规则

第一步

  • fork 本仓库

自定义规则

module.exports = {
  types: [
    { value: 'feat', name: 'feat:    一个新的特性' },
    { value: 'fix', name: 'fix:    修复一个Bug' },
    { value: 'docs', name: 'docs:    变更的只有文档' },
    { value: 'style', name: 'style:    空格, 分号等格式修复' },
    {
      value: 'refactor',
      name: 'refactor:    代码重构,注意和特性、修复区分开'
    },
    { value: 'perf', name: 'perf:    提升性能' },
    { value: 'test', name: 'test:    添加一个测试' },
    { value: 'revert', name: 'revert:    代码回退' },
    { value: 'chore', name: 'chore:    开发工具变动(构建、脚手架工具等)' },
    { value: 'release', name: 'release:    发布项目' }
  ],
  scopes: [],
  messages: {
    type: '选择一种你的提交类型:',
    scope: '选择一个scope:',
    customScope: '本次更改范围 scope(可选):',
    subject: '短说明:',
    body: '长说明,使用"|"换行(可选):\n',
    breaking: '非兼容性说明 (可选):\n',
    footer: '关联的BUG,例如:【一个Bug】http://xxx.com/bug (可选):\n',
    confirmCommit: '确定提交说明?'
  },
  allowCustomScopes: true,
  allowBreakingChanges: ['feat', 'fix'],
  subjectLimit: 100
};
const czConfig = require('./cz-config');

module.exports = {
  extends: ['@commitlint/config-conventional'],
  // rules: https://github.com/conventional-changelog/commitlint/blob/master/docs/reference-rules.md
  rules: {
    'type-enum': [2, 'always', czConfig.types.map(({ value }) => value)],
    'type-empty': [2, 'never'], // 提交不符合规范时,不提交
    'subject-empty': [2, 'never'], // 提交不符合规范时,不能提交
    'subject-full-stop': [0, 'never'], // 句号结尾.
    'subject-max-length': [1, 'never', 100], // 超过最大长度 100 war提示
    'subject-case': [0, 'never'], // 命名格式
    'scope-empty': [1, 'never'] // scope 为空时wan提示,可以提交
  }
};

编辑全局命令

编辑: package.json

   "bin": {
-    "my-cm": "./src/index.js",
-    "my-cm-init": "./src/init.js"
+    "test-cm": "./src/index.js",
+    "test-cm-init": "./src/init.js"
   },

编辑: src/init.js

   scripts: {
-    "cm": `my-cm`
+    "cm": `test-cm`
   },

发布你的包并享受