Code Monkey home page Code Monkey logo

pkgs's Introduction

Overview

结合pnpmmonorepo工具,提供了基本的version升级和publish发布功能。并且有syncdiff模式,默认sync

同时支持monorepo和multirepo架构

Usage

npm i -g @abmao/pkgs
pkgs version // 升级版本
pkgs publish // 发布包

Features

mode

monorepo有两种模式

  • sync: 命令将同步所有包
  • diff: 命令只会对更改过的文件触发

Config

支持的配置方式如下:

  • 根目录
    • pkgs.config.ts
    • pkgs.config.js
    • pkgs.config.cjs
    • pkgs.config.mjs
    • pkgs.config.json
  • package.json的字段
    • pkgs

Default

以下是代码中的默认配置,会读取pnpm-workspace.yaml找到多包工作区,如果没找该文件到的话,会默认成packages/*

{
  packagesPath: undefined, // 默认读取pnpm-workspace.yaml
  mode: 'sync',
  push: true,
  version: {
    message: 'chore: version %s',
  },
  publish: {},
  run: {
    type: 'all',
  },
  plugins: [],
}

Options

  • version: pkgs version命令配置
    • mode: sync | diff。决定命令模式
    • message: 运行`git commit -m '${message} v${version}'`的message
    • push: 自动提交到所有远程仓库

Commands

可以使用pkgs -h查看具体指令

version

pkgs version

升级package版本号

  • --mode <type>: 默认sync
    • sync: 升级所有package版本号
    • diff: 升级修更改过和需要更改的package版本号
  • -m --message <message>: 默认chore: version。运行`git commit -m '${message} v${version}'`的message

publish

pkgs publish

发布package

  • --tag <type>: npm publish --tag <type>

init

创建pkgs相关文件

- packages
- package.json
- pkgs.json

run

可以指定指令例如pkgs run test, 会自动触发需要test的包

有3种模式,all[全部] | work(工作区) | stage(暂存区) | repository(版本库),默认all,不同模式对应不同的diff区域对比,并且会分析你的包顺序,智能运行你的命令。

pkgs run test --type all
pkgs run test --type work
pkgs run test --type stage
pkgs run test --type repository

pkgs's People

Contributors

hengshanmwc avatar mawencan avatar chuhoman avatar

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.