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

@naverpay/commit-helper

v1.1.0

Published

help your commit in git

Downloads

178

Readme

@naverpay/commit-helper

huskycommit-msg훅을 기반으로, 커밋에 필요한 각 종 도구를 제공하는 cli 입니다.

How to use

.husky/commit-msg

npx --yes @naverpay/commit-helper@latest $1

@latest가 아니어도 상관없습니다만, latest라면 항상 최신버전을 사용하실 수 있습니다.

what it does

커밋에 이슈 태깅

➜  your-repo git:(feature/1) git add . &&  git commit -m ":memo: test"
ℹ No staged files match any configured task.
$ git branch --show-current
feature/1
[feature/1 1e70c244f] [#1] :memo: test
 1 file changed, 1 insertion(+)

이제 커밋을 하면, .commithelperrc.json에 따라서 자동으로 이슈번호가 태깅됩니다.

사용자화

만약 사전에 정의된 규칙외에 레포에 특별한 규칙을 넣고 싶으시다면, cosmicconfig 규칙을 commithelper로 사용해주세요. cosmicconfigeslint prettier 등지에서 널리 사용되는 rc 설정을 읽어서 사용하는 라이브러리로, commithelpercosmicconfig를 사용합니다. 그리고 사전에 정의된 규칙과 충돌이 있다면 cosmicconfig를 우선합니다.

.commithelperrc.json

{
    "rules": {
        "feature": null,
        "qa": "your-org/your-repo"
    }
}

위와 같이 있다면,

  • feature/1[#1] 로 태깅됩니다.
  • qa/1[your-org/your-repo#1]로 태깅됩니다.

커밋 방지

  • main, develop master 브랜치에 직접적으로 하는 것을 방지하며, main, develop master 브랜치에 커밋을 하려고 하면 에러를 발생시킵니다.
  • 이외에 다른 브랜치를 막고 싶다면, commithelperrcprotect필드를 추가해주세요.

commithelperrc

.commithelperrc의 규칙은 다음과 같습니다.

{
    "protect": ["main", "master", "develop"],
    "rules": {
        "feature": null,
        "qa": "your-org/your-repo"
    }
}

rules

  • 키는 브랜치명 규칙입니다. feature를 키로 한다면, feature/*** 네이밍의 브랜치들이 타겟이 됩니다.
  • 값은 해당 브랜치와 매칭할 레포명입니다. 예를 들어 'your-org/your-repo' 라고 값이 설정되어 있다면, 'your-org/your-repo#1' 로 연결됩니다.
  • 값이 만약 null이라면, 자기 저장소 자신을 태깅합니다. featurenull이라면, 위와 같이 [#1]로 태깅합니다.

protect

  • 커밋을 막고 싶은 브랜치를 배열로 넣어주세요. main, master, develop는 기본적으로 막힙니다.

Q&A

  • 커밋메시지에 이미 [your-org/your-repo#1] 와 같은 형식의 태깅이 되어 있으면 어떻게 되나요?
    • commithelper는 동작하지 않고, 해당 커밋 메시지 태깅을 존중합니다.
  • .commithelperrc 룰과 자체 규칙 룰이 충돌하면 어떻게 되나요?
    • cosmicconfig를 우선합니다.
  • feature/1_xxx feature/1-xxx 와 같은 형태의 브랜치명은 어떻게 처리되나요?
    • feature/1로 처리됩니다.
    • 자세한 내용은 테스트 코드를 참조하세요.