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

@pch1024/good-repo-cli

v0.0.5

Published

一个自动化配置项目中流程与规范的工具,配置内容包括 husky、eslint、prettier、lintStaged、commitizen、release-it 内容。

Downloads

5

Readme

@pch1024/good-repo-cli

一个自动化配置项目中流程与规范的工具,配置内容包括 husky、eslint、prettier、lintStaged、commitizen、release-it 内容。

安装

# 全局安装
sudo npm i @pch1024/good-repo-cli -g
good-repo # 全局安装后使用

# 临时安装并使用
npx @pch1024/good-repo-cli good-repo

涉及改动文件

  • 新增文件
// cli 文件
const goodreporcFile = path.join(cwd, ".goodreporc.json");

// 一些配置文件
const czrcFile = path.join(cwd, ".cz.json");
const commitlintrcFile = path.join(cwd, ".commitlintrc.json");
const lintstagedrcFile = path.join(cwd, ".lintstagedrc.json");
const releaseitrcFile = path.join(cwd, ".release-it.json");

// 其他
// .husky/*				# 由 husky 生成
// .eslintrc.json		# 由 eslint 生成
// CHANGELOG.md 		# 由 release-it 生成
  • package.json
// 可选的新增
"scripts": {
	"lint": "lint-staged",
	"prepare": "husky install",
	"commit": "git commit",
	"release": "HUSKY=0 release-it"
},
// 可选的新增
"devDependencies": {
    "@commitlint/cli": "^18.4.3",
    "@commitlint/config-conventional": "^18.4.3",
    "@commitlint/cz-commitlint": "^18.4.3",
    "@release-it/conventional-changelog": "^8.0.1",
    "@typescript-eslint/eslint-plugin": "^6.16.0",
    "@typescript-eslint/parser": "^6.16.0",
    "commitizen": "^4.3.0",
    "eslint": "^8.56.0",
    "husky": "^8.0.3",
    "lint-staged": "^15.2.0",
    "prettier": "^3.1.1",
    "release-it": "^17.0.1",
},

规范的开发流程

# 1 暂存文件
git add .

# 2 执行提交
git commit # 执行 husky 的 git hook(内部执行顺序:lint-staged、commitizen、commitlint)

# 3 发版

## 3.1 不需要发版
git push

## 3.2 需要发版
### 执行 HUSKY=0 release-it 命令
#### 内部执行顺序:
##### 1. 确认 NPM Publish 动作
##### 2. 确认 CommitMsg 信息
##### 3. 确认 GitTag 信息
##### 4. 确认 GitPush 动作
pnpm release