Coder Social home page Coder Social logo

citrusjunoss / cimi Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fengxinhhh/cimi

0.0 0.0 0.0 4.9 MB

一款全自动发布NPM包的工具

Home Page: https://github.com/fengxinhhh

License: MIT License

Shell 0.86% JavaScript 30.35% TypeScript 68.79%

cimi's Introduction

npm npm

Cimi

一款全自动 npm 发包工具,一行命令帮助你 git replase、创建 git tag、发布 npm 包。

Cimi 自动生成新版本号,自动生成 commit message,创建 tag,push 到 github,最后发布到 npm 中,整个过程只需要一行命令,解放你的双手!

使用示例

Screenshot

Cimi 有什么优势?

当我们在开发组件库或者其他开源工具包时,我们发一个新的 NPM 包可能需要这些工作:

  • 手动修改package.json中的version.
  • git add .git commit -m "xxxx"生成一个提交.
  • git push origin master 推送到远端.
  • 在 github 中打一个新tag.
  • npm publish将代码提交到 NPM.

听起来是不是很麻烦?而有了cimi,你只需要一行简单的代码:

cimi patch main

就可以完成上面所有事情。

Cimi 修改版本规则

Cimi共有五种规则,来进行发包,其实也就是确定版本号。

  • cimi patch 更新一个小版本,如 1.1.0 -> 1.1.1,如 bug 修复;
  • cimi minor 更新一个中版本,如 1.1.0 -> 1.2.0,如新增功能;
  • cimi major 更新一个大版本,如 1.1.0 -> 2.1.0,如重构架构;
  • cimi beta 将当前版本转为 beta 版本,如 1.1.0 -> 1.1.0-beta,如生产前测试;
  • cimi upgradeBeta 将当前 beta 版本升级一次 beta 号,如 1.1.0-beta -> 1.1.0-beta2,如二次测试;

而分支默认为master,如果主分支为其他分支,应这样使用:

cimi patch main

cimi patch dev

当然,也可以通过cimi manual来触发对话模式,允许你手动输入更改版本。

类似这样的:

manual select

该场景适用于频繁更改patchpatch-beta版本号时,当然,更开放的交互更将让你有掌控感,不是吗?[偷笑]~

使用

# 全局安装cimi
npm i cimi -g
# 本地安装cimi
npm i cimi -D

以下是cimi -h的输出:

Usage: cimi [options]

A fully automatic NPM package tool, one line command to help you "git add/commit/push, create git tag, release NPM package"

Options:
  -v, --version  output the version number
  -m,manual      manual select your new package version
  patch          patch your new npm package
  minor          minor your new npm package
  major          major your new npm package
  beta           beta your new npm package
  upgradeBeta    upgrade your npm package new version
  -h, --help     display help for command

  Tip:

    You should run this script in the root directory of you project or run by npm scripts.

  Examples:

    $ cimi manual [branch] (default: master)
    $ cimi patch [branch] (default: master)
    $ cimi minor [branch] (default: master)
    $ cimi major [branch] (default: master)
    $ cimi beta [branch] (default: master)
    $ cimi upgradeBeta [branch] (default: master)

LICENSE

MIT © fengxin

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.