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

ly-tool-git-commitlint

v1.1.15

Published

基于vue-cli3的代码提交检查规范

Downloads

31

Readme

Git commit 规范

结合 commitizen commitlint conventional-changelog-cli husky,进行封装,一键安装,开箱即用的 git commit 规范。

功能

  1. 自动提示 commit 填写格式。
  2. 自动提示影响范围
  3. commit 是否规范,不规范不允许提交
  4. 集成 git add . && git commit 不需要在执行两个命令
  5. 自动生成 changelog

配置

  1. 下载

# 为了防止和已有的包冲突,可以提前移除 `node_modules` 后再安装
rm -rf node_modules

# npm
npm i ly-tool-git-commitlint [email protected] [email protected] [email protected] [email protected] [email protected] -D

# yarn 
yarn add ly-tool-git-commitlint [email protected] [email protected] [email protected] [email protected] -D
  • 在 package.json 中添加
{
  "scripts": {
    "log": "conventional-changelog --config ./node_modules/ly-tool-git-commitlint/lib/log -i CHANGELOG.md -s -r 0",
    "cz": "npm run log && git add . && git cz"
  },
  "husky": {
    "hooks": {
      "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
    }
  },
  "config": {
    "commitizen": {
      "path": "./node_modules/ly-tool-git-commitlint/lib/cz"
    }
  }
}

增加 commitlint.config.js 文件

module.exports = {
  extends: ['./node_modules/ly-tool-git-commitlint/lib/lint']
};

使用

npm run cz  # git add . && git commit -m 'feat:(xxx): xxx'
npm run log # 生成 CHANGELOG
  1. 代码提交 npm run cz 标注一个提交的类型(选择)

2a9618603ec5a160b.md.png

  1. (必填)本次提交的改变所影响的范围(选择)

16162376442926ca10d2e35ca8f50.md.jpg

1206a5d4ad62c5a7d.md.png 3. (非必填)提供更详细的变更描述 4. (非必填)是否存在不兼容变更? 5. (非必填)此次变更是否影响某些打开的 bug/issue

changelog 演示

WX20210320-1857072x6265fb6784e85b8c.md.png

类型

| 规范名 | 描述 | | -------- | ------------------------------------------------------- | | feat | 一个新功能| | ui | 更新用户界面和样式文件| | fix | Bug修复| | docs | 修改文档| | merge | 合并代码| | art | 代码格式化| | perf | 性能优化| | refactor | 重构代码| | revert | 撤销上一次的提交| | release | 发布版本| | test | 测试用例| | build | 影响构建系统或外部依赖的更改(例如:gulp,npm,webpack)| | init | 初次提交| | dep_add | 添加依赖| | dep_rm | 删除依赖|

范围

| 规范名 | 描述 | | -------- | ------------------------------------------------------- | | global | 影响整个项目| | noproblem | 无影响| | ui | UI 界面| | data | 数据变化| | component | 影响公共组件使用| | unknown | 不知道影响范围|

下版本准本使用generator实现基础配置 敬请期待 欢迎一起交流 欢迎star

2021-3-20

1.1.10
  1. 更新readme
1.1.1 - 1.1.9
  1. 优化scope字段在changelog文件内的展示 由英文展示为中文
  2. 部分性能优化
  3. husky生效

2021-3-19

1.1.0
  1. 修复没有选择scope时changelog错位的bug
  2. 限定husky包版本
  3. scope删除modules字段