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

zflow

v0.1.0

Published

git workflow

Downloads

4

Readme

zflow

分支命名

  • next 分支:下一版将上线的分支,不在下一版上线的功能不要合并到此分支。feature 分支先合并到此分支,解决掉冲突,供测试人员、产品经理测试通过后,准备上线。
  • preview 分支:预览分支,不在下一版上线的功能发布到这个分支供产品经理预览。这个分支不会合并到 master 分支,可以随便玩,坏了就 reset 到 next 分支状态。
  • master 分支:主分支,hotfixfeature 分支都从此分支 checkout 出来。
  • vMAJOR.MINOR 分支: 版本分支,比如 v0.1、v2.0。
  • feature/* 分支: 功能分支,在此分支上开发新功能。
  • hotfix/* 分支: bug修复分支,在此分支上修复bug。

新功能开发

  1. 创建新功能分支
yarn zflow create feature <name>
  1. 开发

  2. 完成新功能分支

yarn zflow finish feature [names..]
  1. 预发布
yarn zflow preprelease next
  1. 发布
yarn zflow release next

Bug修复

  1. 创建bug修复分支
yarn zflow create hotfix <name>
  1. 修复

  2. 完成bug修复分支

yarn zflow finish hotfix [names..]
  1. 预发布
yarn zflow preprelease hotfix
  1. 发布
yarn zflow release hotfix

CLI

create

yarn zflow create <type> <name>

type:

  • feature: 创建 feature 分支
  • hotfix: 创建 hotfix 分支

执行操作:

git checkout master
git checkout -b <type>/<name>
git push -u origin <type>/<name>

finish

yarn zflow finish <type> [names...] [--temp]

type:

  • current: 合并当前所在分支(featurenext)至 next 分支
  • feature: 合并 feature 分支至 next 分支
  • hotfix: 合并 hotfix 分支至 vMAJOR.MINOR 分支、next 分支和 master 分支

temp: 仅合并 hotfix 分支至 vMAJOR.MINOR 分支(临时修复,不合入下一个版本)

执行操作:

# targetBranch = type === 'next' ? 'next' : 'latest'
# newVersion = type === 'next' ? 'minor' : 'patch'

git push
zflow checkout <targetBranch>
git pull
git merge [names...] -m "Merge [names...] into <targetBranch>"
git push

# only if type is hotfix and without option temp, following commands will be executed 

git checkout master
git pull
git merge [names...] -m "Merge [names...] into master"
git push
git checkout next
git pull
git merge master -m "Merge master into next"
git push

prerelease

yarn zflow prerelease <type>

type:

  • next: 发布 next 分支至灰度环境
  • hotfix: 发布 vMAJOR.MINOR 分支至灰度环境

执行操作:

# targetBranch = type === 'next' ? 'next' : 'latest'
# newVersion = firstTimePrerelease ? 'prerelease' : type === 'next' ? 'preminor' : 'prepatch'

zflow checkout <targetBranch> 
git pull
npm version <newVersion>
git push
git push --tags

release

yarn zflow release <type>

type:

  • next: 发布 next 分支至生产环境
  • hotfix: 发布 vMAJOR.MINOR 分支至生产环境

执行操作:

# targetBranch = type === 'next' ? 'next' : 'latest'
# newVersion = type === 'next' ? 'minor' : 'patch'

zflow checkout <targetBranch>
git pull
npm version <newVersion>
git push
git push --tags

# only if type is next, following commands will be executed 
# latestVersion is generated from version in package.json

git checkout master
git pull
git merge next -m "Merge next into master"
git push
git checkout -b <latestVersion>
git push -u origin <latestVersion>