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

@fe_korey/commit

v0.1.1

Published

Tencent Cloud Frontend's commit config

Downloads

8

Readme

TCF腾讯云前端,代码提交检查

前言

云前端已经有了工程代码规范,但本地开发没有强制约束,导致某些同学刀尖舔血,逍遥法外-_!!。 本项目用于提交代码的本地检查(不含CI服务端检查),强制约束提交行为: 提交代码时检查eslint规范和commit消息格式,不符合规范的禁止提交并给出友好的提示。

快速使用

  1. 安装
tnpm i --save-dev @tencent/tcf-commit
  1. package.json配置
"husky": {
  "hooks": {
    "pre-commit": "tcf-commit",
    "commit-msg": "tcf-commit -t msg"
  }
}

命令参数

例如:tcf-commit -e js|json

  1. -e --ext 待检查文件后缀名 默认 js|ts
  2. -t --type 检查类型 默认code。代码检查code,提交消息检查msg
  3. -c --config 配置文件,commitlint的config

提交消息检查

规范的提交message,有助于定位问题和自动生成变更日志

标准格式

type(scope?): subject
body?
footer?

注意:type(scope?):空格subject

type说明

  • build:主要目的是修改项目构建系统(例如 glup,webpack,rollup 的配置等)的提交
  • ci:主要目的是修改项目继续集成流程(例如 Travis,Jenkins,GitLab CI,Circle等)的提交
  • docs:文档更新
  • feat:新增功能
  • merge:分支合并 Merge branch ? of ?
  • fix:bug 修复
  • perf:性能, 体验优化
  • refactor:重构代码(既没有新增功能,也没有修复 bug)
  • style:不影响程序逻辑的代码修改(修改空白字符,格式缩进,补全缺失的分号等,没有改变代码逻辑)
  • test:新增测试用例或是更新现有测试
  • revert:回滚某个更早之前的提交
  • chore:不属于以上类型的其他类型

eslint格式检查

  1. eslint规范参考,TCF腾讯云前端,统一代码规范
  2. 每次只检查当前要提交的代码,而不是全量。(注:这样便于旧项目改造且提供检查效率)
  3. 代码必须保证无error问题
  4. 虽然warning不做强制要求,但前端同学也需要注意关注和优化。
  5. 后面服务端CI也会介入代码检查,在每次发布时,出具eslint报告。