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

gitwork

v2.0.6

Published

一秒写出漂亮的工作报告!

Downloads

13

Readme

gitwork

一秒写出漂亮的工作报告!

效果演示

为什么开发它

程序员的工作基本都在编码, 所以我们可以直接读取避免记录生成工作报告. 对于每周都在开几次任务进度会, 还得每周都要写工作报告, 在工作报告中, 有注意到大家的工作报告基本都是千篇一律:

测试:

本周创建了 x 个 bug, 测试了 x 个bug, 关闭了 x 个 bug... 下周计划: 编写测试报告, 继续测试.

开发:

本周修复 xx bug, 开发了 xx 功能. 下周计划: 修复 xx bug, 开发 xx 功能.

周某:

意义在哪里? 这得人工写? 我周某人就是不惯着!

功能

  • 支持任意时间段的报告
  • 高度可自定义, 例如模板/变量/git作者名/项目名转换...
  • 支持根据 commit message 规范转换任务风格, 例如 fix(cli): xxx 将被转换为 🐛修复cli中的缺陷: xxx
  • 支持模板插槽
  • 支持从多个项目目录中读取数据生成一个工作报告
  • 支持自动过滤较高相似并的任务(避免看起来一个任务在报告中出现了几次)
  • [ ] 支持生成工作小结
  • [ ] 支持直接转换为 pdf/邮件/html/jpeg/...

使用

# 安装
npm i -g gitwork

# 生成当月工作报告
gitwork

# 指定开始时间生成报告
gitwork after=2021-01-01

# 生成周报
gitwork template=week

# 查看使用说明
gitwork --help

# 查看版本号
gitwork -v

# 打开配置文件所在位置
gitwork --config

命令行参数

  • -v, --version 显示程序版本号
  • --help 显示帮助页面
  • --config 打开配置文件所在位置
  • --select 选择报告配置

可配置项

这些选项来自配置文件,你可以使用 gitwork --config 打开配置文件所在位置,也可以在使用时通过命令行设置报告参数, 例如 gitwork author=wll8

  • select
    • [x] 你可以使用配置文件保存多个报告,批量生成它们,多个使用逗号分割。
    • 可选值
      • default 程序默认的报告配置
      • 其他自己在配置文件中添加的模板标志
    • 默认值 default
  • layout
    • [ ] 布局方式
    • 可选值
      • repository-time 先仓库后时间
      • time-repository 先时间后仓库
    • 默认值 repository-time
  • author
    • [x] 指定要生成报告的 git 用户名
    • 可选值
      • 其他你自己指定的用户名,多个使用逗号分割
    • 默认值 当前 git 用户, 即 git config user.name 的值
  • ignoreAuthor
    • 是否忽略按用户名进行过滤
    • 可选值
      • true
      • false
    • 默认值 false
  • authorName
    • [x] 实际输出到报告中的名称, 例如 git 用户名和报告中所需姓名不同时
    • 默认值 当前 git 用户
  • template
    • [x] 报告的时间编排方式
    • 可选值
      • month
      • month-week
      • month-week-day
      • week
      • week-day
      • day
    • 默认值 month-week
  • messageBody
    • 如何处理 git commit message 的 body 部分, 由于它的内容不可控, 可能会破坏报告
    • 可选值
      • raw 原样使用
      • none 不使用
      • compatible 当含有可能破坏报告的内容时不使用
    • 默认值: compatible
  • useFile
    • [x] 使用文件模板, 相对于配置文件目录
    • 默认值: ./default.template.md
  • after
    • 开始时间, YYYY-MM-DD 格式
    • 默认值 根据 template 转换
  • before
    • 结束时间, YYYY-MM-DD 格式
    • 默认值 根据 template 转换
  • outFile
    • [ ] 输出文件, 支持 .md .html .pdf .jpeg .word .xlsx, 相对于运行目录
    • 默认值: ./gitwork.out.md
  • insertFile
    • [ ] 插入文件, 相对于运行目录
    • 默认值: ./todo.md
  • rootLevel
    • [x] 从多少个#号开始表示生成内容中最高级别标题, 不包含文档根结点标题, 根节点标题的级别应在 report.title 中添加
    • 默认值: 2
  • repository
    • [x] 从哪些仓库中生成报告
    • 可选值
      • string 本地仓库绝对路径, 多个时使用逗号分割
      • array
        • path 本地仓库绝对路径
        • name 项目名称
    • 默认值: 当前仓库
  • noEqualMsg
    • [x] 过滤掉重复的 msg
    • 可选值
      • true
      • false
    • 默认值: true
  • similarity
    • [x] 过滤掉大于给定相似值的 msg
    • 可选值
      • 0 到 1 之前的值
    • 默认值: 0.75
  • messageTypeSimilarity
    • [x] 配置 message type 的相似程度
    • 可选值
      • 0 到 1 之前的值
    • 默认值: 0.8
  • noUnknownType
    • [x] 是否移除未知的 type
    • 可选值
      • true
      • false
    • 默认值: false
  • messageTypeTemplate
    • [x] 配置 message 的生成模板
    • 可选值
      • 可使用字符串模板, 支持使用 messageConvert[type].des 中的变量
    • 默认值: #{emoji}#{text}
  • messageConvert
    • [x] 配置 message 的详细生成规则
    • 可选值
      • false 不进行转换
      • object 自定义请参考
        • [type] git commit message type 标志
          • alias array type 别名
          • des type 转换配置
            • emoji 表情
            • text type 和 scope 的转换模板
              • 0 没有 scope 时的模板
              • 1 有 scope 时的模板
    • 默认值: 参考 config.js

todo

  • [ ] fix: 应使用保险的方式检查 messageBody 中的内容
  • [ ] feat: 如果只有一个时间结点时, 则不显示它. 比如下面内容, 当为本周周报时, 重复显示 2022年07月 第4周 是没有意义的.
  • [ ] feat: 格式化输出
    • [x] 每个 commit 前插入一个空行
    • [ ] 多行 commit 消息时再每行后面添加两个空格, 这样默认 markdown 才会显示换行效果
    • [x] 移除 commit title 与 body 之前的空行
    • [x] 移除 body 后面多于的空行
    • [ ] 合并两个空行为一个
    • [x] 转换 msg 提交标志, 例如转换 fix(client): xxx修复 client 中的缺陷: xxx