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

koi-release-tool

v2.0.7

Published

快速部署分支创建工具,支持多项目类型和环境配置

Downloads

39

Readme

Koi Release Tool

一个快速部署分支创建工具,支持多项目类型和环境配置。提供简单易用的命令行界面,支持Windows、Linux和macOS系统。

功能特性

  • 🚀 快速创建发布分支
  • 🔧 支持多种项目类型配置
  • 🌍 支持多环境部署
  • 📦 自动生成构建脚本
  • 🎨 彩色终端输出
  • ⚡ 一键式操作

安装

全局安装(推荐)

# 全局安装
npm install -g koi-release-tool

# 或者使用yarn
yarn global add koi-release-tool

本地开发安装

# 克隆项目
git clone <repository-url>
cd koi-banch

# 本地安装
./install-local.sh

# 或者手动安装
npm link

系统要求

  • Node.js >= 12.0.0
  • Git
  • Windows系统需要WSL支持(自动处理)

使用方法

koi release <系统名称> <环境> <版本号>

参数说明

  • 系统名称: 项目系统名称(如:raas-html, saas-html)
  • 环境: 部署环境(如:ali, test, prod)
  • 版本号: 版本号(如:2.1.48, 1.0.26)

使用示例

# 创建raas-html项目的ali环境2.1.48版本分支
koi release raas-html ali 2.1.48

# 创建saas-html项目的ali环境1.0.26版本分支
koi release saas-html ali 1.0.26

工作流程

工具采用双脚本架构,确保跨平台兼容性:

主流程(koi-simple.js)

  1. 参数验证: 检查命令参数格式和数量
  2. 脚本调用: 调用 quick-deploy.sh 执行实际部署逻辑
  3. 跨平台支持: 自动处理Windows WSL和Linux/macOS环境

部署流程(quick-deploy.sh)

  1. 检查工作区: 确保没有未提交的更改
  2. 拉取最新代码: 从远程仓库获取最新代码
  3. 分支管理: 删除已存在的同名分支(如果存在)
  4. 创建分支: 创建格式为 {系统名称}-{环境}.{版本号}.release 的分支
  5. 生成构建脚本: 根据项目类型自动生成 build.sh 脚本
  6. 提交更改: 自动提交所有更改并提示推送命令

支持的项目类型

  • raas-html: 使用 npm run raas 构建
  • saas-html: 使用 npm run saas 构建
  • 其他项目: 使用 npm run {项目名称} 构建

环境变量

脚本会自动设置以下环境变量:

  • PROJECT_TYPE: 项目类型
  • BUILD_ENV: 构建环境
  • VERSION: 版本号

生成的文件

  • build.sh: 自动生成的构建脚本,包含项目特定的构建命令

项目结构

koi-banch/
├── bin/
│   ├── koi.js          # 主入口脚本(完整版)
│   └── koi-simple.js   # 简化版入口脚本(默认使用)
├── quick-deploy.sh     # 核心部署脚本
├── install-local.sh    # 本地安装脚本
├── package.json        # 项目配置
└── README.md          # 项目文档

注意事项

  • 使用前请确保在Git仓库中
  • 确保工作区没有未提交的更改
  • 创建的分支需要手动推送到远程仓库
  • Windows系统会自动使用WSL执行脚本,无需额外配置

兼容性

  • ✅ Windows 10/11 (通过WSL)
  • ✅ Linux (Ubuntu, CentOS, Debian等)
  • ✅ macOS (10.14+)
  • ✅ Node.js 12.0.0+
  • ✅ Git 2.0+

故障排除

常见问题

Q: Windows系统提示"找不到命令" A: 确保已安装WSL,工具会自动使用WSL执行脚本。

Q: 权限被拒绝错误 A: 确保脚本有执行权限,工具会自动设置权限。

Q: Git操作失败 A: 确保在Git仓库中,且工作区没有未提交的更改。

Q: 分支已存在 A: 工具会自动删除已存在的同名分支,无需手动处理。

调试模式

# 查看详细输出
DEBUG=1 koi release <系统名称> <环境> <版本号>

发布到私有npm仓库

# 登录到私有npm仓库
npm login --registry=https://your-private-registry.com

# 发布包
npm publish --registry=https://your-private-registry.com

许可证

MIT

贡献

欢迎提交Issue和Pull Request!

更新日志

1.0.0

  • 🎉 初始版本发布
  • ✨ 支持基本的发布分支创建功能
  • 🔧 支持多种项目类型(raas-html, saas-html, raas, saas-html)
  • 📦 自动生成构建脚本
  • 🌍 跨平台支持(Windows WSL, Linux, macOS)
  • 🎨 彩色终端输出
  • ⚡ 双脚本架构确保稳定性
  • 🛠️ 本地开发安装支持