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

pv-script

v0.0.7

Published

A project git/version script

Downloads

8

Readme

安装

可通过 npmyarnpnpm 安装

npm i -D pv-script
yarn add -D pv-script
pnpm add -D pv-script

推荐在 package.json 中使用 pv-script,例如

{
  "scripts": {
    ...
    "checkout:develop": "pv-script develop",
    "checkout:release": "pv-script release",
    "version": "pv-script version"
  }
}

上面命令可能对你现在的项目配置不太匹配,例如 pv-script 默认切的主分支是 master,但也可以通过传入配置改变这个默认值

使用

pv-script 目前有三个 command,分别是 develop、release、version。可通过 pv-script -h 查看详细信息。

develop

执行 develop 会进行以下操作

  • 切换到“主分支”
  • 拉取“主分支”代码
  • 生成“开发分支”,并切换

在 pv-script 默认切换的主分支是 master,如果你的项目主分支是 main,那么可以在使用 pv-script 命令时传入 “-m main”。例如 pv-script develop -m main

默认生成的开发分支的模板是 %type%/%time%-%name%,这个模板最后生成的分支名为 命令行中选择的开发分支类型/当前时间-命令行中输入的分支名。那也就是说我们可以自由组合分支名的模板,通过 -t 即可指定。例如%time%/%type%/%name%,最后生成的分支名为当前时间/命令行中选择的开发分支类型/命令行中输入的分支名

develop 目前只支持三个模板变量 %time% 当前时间: 年-月-日 %type% 开发分支类型:feature/hotfix %name% 输入的分支名

release

执行 release 会进行以下操作

  • 切换到“主分支”
  • 拉取“主分支”代码
  • 生成“发布分支”,并切换

在 pv-script 默认切换的主分支是 master,如果你的项目主分支是 main,那么可以在使用 pv-script 命令时传入 “-m main”。例如 pv-script release -m main

默认生成的发布分支的模板是 release/%version%-%name%,这个模板最后生成的分支名为 release/命令行中选择的版本-命令行中输入的分支名。那也就是说我们可以自由组合分支名的模板,通过 -t 即可指定。例如%version%/%name%,最后生成的分支名为命令行中选择的版本/命令行中输入的分支名

release 目前只支持二个模板变量 %version% 命令行中选择的版本,可以选择 patch、minor、major 三个版本级别的更新,也可以自定义版本 %name% 输入的分支名

version

执行 version 会进行以下操作

  • 获取当前的分支名,解析其中的版本号,如果没有版本号,那么会执行失败
  • 修改 package.json 的 version 字段