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 🙏

© 2025 – Pkg Stats / Ryan Hefner

git2zendao

v1.1.5

Published

<!-- * @Author: SongZiang * @Date: 2025-01-16 17:29:14 * @LastEditors: SongZiang * @LastEditTime: 2025-01-24 14:48:02 * @FilePath: /git2zendao/README.md -->

Readme

git2zendao 插件 README

一、概述

git2zendao 是一个帮助你在使用 Git 进行提交时与禅道(Zentao)进行集成的工具。它可以验证你的提交信息是否符合规范,并根据提交信息中的任务 ID 等信息更新禅道中的任务工时。

二、安装

  1. 首先,确保你已经安装了 Node.js 和 npm。

  2. 在你的项目中,使用以下命令安装 git2zendao 作为开发依赖:

npm install git2zendao --save-dev
  1. 为了在提交时触发 git2zendao 的功能,你需要安装 husky 并添加 post-commit 钩子。执行以下操作:
npm install husky --save-dev
npx husky install
npx husky add .husky/post-commit "npm run validate-commit"
  1. package.json 中添加 validate-commit 脚本,使其调用 git2zendao 的入口文件:
{
  "name": "your-project-name",
  "scripts": {
    "validate-commit": "node node_modules/git2zendao/index.js"
  },
  "devDependencies": {
    "git2zendao": "^x.x.x",
    "husky": "^x.x.x"
  },
  "husky": {
    "hooks": {
      "post-commit": "npm run validate-commit"
    }
  }
}

三、配置

在你的项目根目录下,你需要创建一个 git2zendao.config.json 文件,该文件包含与禅道交互所需的用户信息和任务信息。请确保将该文件添加到 .gitignore 文件中,以避免将敏感信息提交到版本控制系统。

示例 git2zendao.config.json 文件:

{
  "zendaoUrl": "https://dev.xxxxxx.cn:8686",
  "account": "your_zentao_account",
  "password": "your_zentao_password",
  "taskId": 12345
}

四、功能和使用方法

1. 提交信息规范

  • 提交信息必须以 featfixdocsstylerefactortestchore 开头。
  • 建议的提交信息格式:feat:taskId=12345-consume=1-添加新功能,其中 taskId 是禅道中的任务 ID,consume 是要消耗的工时数,后面是对该次提交的简短描述。
  • 如果你在提交信息中没有指定 taskId,插件将使用 git2zendao.config.json 文件中配置的 taskId关于 taskId 的特殊情况说明
  • 当提交信息中不包含 taskId 时,插件将使用 git2zendao.config.json 文件中的 taskId 进行后续操作。如果 git2zendao.config.json 中也没有 taskId,则不会执行与网络请求相关的操作(如更新禅道任务工时),此时提交将作为一次正常的 Git 提交,但会在控制台输出相关信息:No valid taskId found in commit message.

五、注意事项

  • 请确保你的网络连接正常,因为该插件会向禅道服务器发送网络请求。
  • 请保护好 git2zendao.config.json 文件中的敏感信息,将其添加到 .gitignore 文件中。

六、贡献和支持

如果你在使用过程中遇到问题或想要贡献代码,可以在 https://www.npmjs.com/package/git2zendao 上提出问题或提交 Pull Request。

通过上述步骤,你应该可以顺利使用 git2zendao 插件,并在使用 Git 进行开发时与禅道进行有效的集成。如果你遇到任何问题,可以查看错误信息和上述常见问题的解决方法,或者向我们寻求帮助。开发者:宋子昂,15608404717

通过上述修改,你可以更清楚地了解请求失败的原因,是服务器端的问题还是客户端的问题。你可以对其他函数中的错误处理部分进行类似的修改,以帮助你更好地调试和解决问题。

希望这个 README 文档能帮助你更好地使用 git2zendao 插件。如果你有任何进一步的问题或需要更多帮助,请随时联系我们。

请根据实际情况修改上述文档,或者修改一些描述以使其更符合你的项目细节。