rushjs 是来自微软的单体仓库管理工具 ,与lerna 类似但是使用上稍显复杂

安装

npm install -g @microsoft/rush
 

简单使用

  • 一个传统的基于npm 的处理
~$ cd my-toolchain
~/my-toolchain$ npm run build
~/my-toolchain$ npm link
~/my-toolchain$ cd ../my-controls
~/my-controls$ npm link my-toolchain
~/my-controls$ npm run build
~/my-controls$ npm link
~/my-app$ cd ../my-app
~/my-app$ npm link my-toolchain
~/my-app$ npm link my-controls
~/my-app$ npm run build
 
 

说明:

my-app: web app
my-controls: web app 需要使用的control包
my-toolchain: nodejs 构建工具,用来编译其他项目
  • 使用rushjs的方式
    初始化项目:
 
rush init

效果:

Rush Multi-Project Build Tool 5.15.0 (unmanaged) - https://rushjs.io
Node.js version is 8.14.0 (LTS)
Starting "rush init"
Generating: /Users/dalong/mylearning/rushjs-learning/first/rush.json
Generating: /Users/dalong/mylearning/rushjs-learning/first/.gitattributes
Generating: /Users/dalong/mylearning/rushjs-learning/first/.gitignore
Generating: /Users/dalong/mylearning/rushjs-learning/first/.travis.yml
Generating: /Users/dalong/mylearning/rushjs-learning/first/common/config/rush/.npmrc
Generating: /Users/dalong/mylearning/rushjs-learning/first/common/config/rush/command-line.json
Generating: /Users/dalong/mylearning/rushjs-learning/first/common/config/rush/common-versions.json
Generating: /Users/dalong/mylearning/rushjs-learning/first/common/config/rush/experiments.json
Generating: /Users/dalong/mylearning/rushjs-learning/first/common/config/rush/pnpmfile.js
Generating: /Users/dalong/mylearning/rushjs-learning/first/common/config/rush/version-policies.json
 
 

说明:
具体文件的参数说明参考 https://rushjs.io/pages/maintainer/setup_new_repo/
添加git 源代码管理

 
git init  
git add  --all
git commit -m "init project"
 

创建一个包

mkdir -p tools/user
cd tools/user
yarn init -y
touch  index.js
/**
 * user commonjs module
 */
module.exports = {
    name: "dalong",
    age:33
}
package.json 内容

添加项目到rush 管理

编辑 rush.json 文件,追加

    {
      "packageName": "tools-user",
      "projectFolder": "tools/user",
      "reviewCategory": "tools"
    }
 

更新rush 项目

rush update 

效果

Rush Multi-Project Build Tool 5.15.0 - https://rushjs.io
Node.js version is 10.14.0 (LTS)
Starting "rush update"
Trying to acquire lock for pnpm-2.15.1
Acquired lock for pnpm-2.15.1
Installing pnpm version 2.15.1
Deleting old files from /Users/dalong/.rush/node-v10.14.0/pnpm-2.15.1
Copying /Users/dalong/mylearning/rushjs-learning/first/common/config/rush/.npmrc --> /Users/dalong/.rush/node-v10.14.0/pnpm-2.15.1/.npmrc
Running "npm install" in /Users/dalong/.rush/node-v10.14.0/pnpm-2.15.1
npm WARN deprecated pnpm@2.15.1: Please use the latest version of pnpm
npm notice created a lockfile as package-lock.json. You should commit this file.
added 1 package from 1 contributor and audited 1 package in 13.314s
found 0 vulnerabilities
Successfully installed pnpm version 2.15.1
Symlinking "/Users/dalong/mylearning/rushjs-learning/first/common/temp/pnpm-local"
  --> "/Users/dalong/.rush/node-v10.14.0/pnpm-2.15.1"
Using the default variant for installation.
Updating temp projects in /Users/dalong/mylearning/rushjs-learning/first/common/temp/projects
Copying /Users/dalong/mylearning/rushjs-learning/first/common/config/rush/.npmrc --> /Users/dalong/mylearning/rushjs-learning/first/common/temp/.npmrc
Updating /Users/dalong/mylearning/rushjs-learning/first/common/temp/pnpmfile.js
Updating /Users/dalong/mylearning/rushjs-learning/first/common/temp/projects/tools-user.tgz
Finished creating temporary modules (0.02 seconds)
Checking node_modules in /Users/dalong/mylearning/rushjs-learning/first/common/temp
Running "pnpm install" in /Users/dalong/mylearning/rushjs-learning/first/common/temp
Using hooks from: /Users/dalong/mylearning/rushjs-learning/first/common/temp/pnpmfile.js
readPackage hook is declared. Manifests of dependencies might get overridden
Packages: +1
+
Resolving: total 1, reused 0, downloaded 1, done
dependencies:
+ @rush-temp/tools-user 0.0.0
   ╭──────────────────────────────────────────────────────────────────╮
   │ │
   │ Update available! 2.25.4 → 2.25.6 │
   │ Changelog: https://github.com/pnpm/pnpm/releases/tag/v2.25.6 │
   │ Run pnpm i -g pnpm to update! │
   │ │
   │ Follow @pnpmjs for updates: https://twitter.com/pnpmjs │
   │ │
   ╰──────────────────────────────────────────────────────────────────╯
Updating /Users/dalong/mylearning/rushjs-learning/first/common/config/rush/shrinkwrap.yaml
Linking projects together...
LINKING: tools-user
Purging /Users/dalong/mylearning/rushjs-learning/first/tools/user/node_modules
Writing "/Users/dalong/mylearning/rushjs-learning/first/common/temp/rush-link.json"
Linking finished successfully. (0.02 seconds)
Next you should probably run "rush build" or "rush rebuild"
Rush update finished successfully. (18.73 seconds)
 

后续添加项目类似

说明

总的来说稍有复杂, 对于一般的项目使用这个工具有点吃力,使用yarn 或者 lerna 这样的工具还是很不错的,后期再研究下

参考资料

https://rushjs.io/pages/maintainer/setup_new_repo/

rushjs来自微软的单体仓库管理工具的更多相关文章

  1. 微软推 Azure 机器学习工具:Algorithm Cheat Sheet

    微软推 Azure 机器学习工具:Algorithm Cheat Sheet [日期:2015-05-15] 来源:CSDN  作者:Linux [字体:大 中 小]   Azure Machine ...

  2. zz【重磅】微软开源自动机器学习工具 - NNI

    [重磅]微软开源自动机器学习工具 - NNI 在机器学习建模时,除了准备数据,最耗时耗力的就是尝试各种超参组合,找到模型最佳效果的过程了.即使是对于有经验的算法工程师和数据科学家,有时候也很难把握其中 ...

  3. 微软开源自动机器学习工具NNI安装与使用

    微软开源自动机器学习工具 – NNI安装与使用   在机器学习建模时,除了准备数据,最耗时耗力的就是尝试各种超参组合,找到最佳模型的过程了.对于初学者来说,常常是无从下手.即使是对于有经验的算法工程师 ...

  4. 【重磅】微软开源自动机器学习工具 - NNI

    [重磅]微软开源自动机器学习工具 - NNI 在机器学习建模时,除了准备数据,最耗时耗力的就是尝试各种超参组合,找到模型最佳效果的过程了.即使是对于有经验的算法工程师和数据科学家,有时候也很难把握其中 ...

  5. 酷!微软发布新终端工具,Win 10 将自带 Linux 内核

    原创:技术最前线(id:TopITNews) 北京时间 5 月 7 日,2019 年微软 Build 开发者大会在雷德蒙德召开.今年大会上亮点很多,本文汇总一些和开发者相关的内容. 1. Window ...

  6. 微软开源的 AI 工具,让旧照片焕发新生

    原文地址:Bringing Old Photos Back to Life 原文作者:Ziyu Wan 译者 & 校正:HelloGitHub-小鱼干 & 鸭鸭 写在前面 在 GitH ...

  7. Window 下好用的同步备份工具(来自微软)SyncToy

    SyncToy 简单好用,满足备份的基本需求.

  8. entityframework 入门-来自微软

    必备条件 要完成本演练,需要安装 Visual Studio 2010 或 Visual Studio 2012. 如果使用的是 Visual Studio 2010,还需要安装 NuGet. 1.创 ...

  9. 【FLYabroad 】微软内部代码检查工具 (Microsoft Source Analysis for C#)[转]

    SourceAnalysis (StyleCop)的终极目标是让所有人都能写出优雅和一致的代码,因此这些代码具有很高的可读性. 早就听说了微软内部的静态代码检查和代码强制格式美化工具 StyleCop ...

随机推荐

  1. 另一个角度的redis--redis 可以看做是c/s架构的软件

    Redis 通信协议简单研究 redis 可以看做是c/s架构的软件,再打开一个终端输入下面的指令 https://www.cnblogs.com/nele/p/8908298.html redis ...

  2. 关于银企直连中银行通信类 配置篇 EPIC_PROC

    简单介绍:SAP银行企业直连,英文全称:Electronic Payment Integration(For China),简称EPIC,是SAP中国为本地化的需求开发的一款产品,以银企直连为支撑,主 ...

  3. 玩转zynq7010+ FPGA点亮三色灯

    前期主要以开发Z-TURN的PL部分为主,以期望了解该芯片的逻辑架构和系统总线,以及所有外设,后面在开始PS部分的开发,闲话少说,先看整个7z010的系统框图,所有开发目前基于ISE14.6来设置, ...

  4. Springboot+Mybatis的逆向工程

    Mybatis逆向工程,自动生成 entity类和常用的增删改查方法. 1.pom.xml引入类 <!-- 通用mapper 用于mabatis封装的基础增删改查的功能--><dep ...

  5. 使用APICloud创建一个webapp项目

    1.在APICloud官网注册,下载APICloud Studio并解压.(这里我选择的是APICloud Studio,还可以选择其他的开发工具的APICloud插件如Sublime,Webstor ...

  6. 【转】STM32生成的文件大小探索

    一般在stm32工程使用keil编译之后,keil的build output栏目下面会出现如图所示的输出信息,其中会显示code 大小 RO-data.RW-data .ZI-data的大小.一般别人 ...

  7. 【Spring Boot】Spring Boot之利用Logstash将日志转换成以JSON的格式存储和输出

    一.Logstash的作用 Logstash是一个完全开源的工具,它可以对日志进行收集.过滤,能非常方便地将日志转换成以JSON的格式存储和输出,并将其存储供以后使用. 二.整合Logstash的步骤 ...

  8. 洛谷P4180 【模板】严格次小生成树[BJWC2010] 题解

    虽然中途写的时候有点波折,但是最后一发A,还是有点爽. 这虽然是个模板题,但还是涉及到许多知识的= = 首先我们求出一个最小生成树,并且求出其边权和\(ans\).那么现在考虑加入其它的边,每次加入在 ...

  9. upd

    今天是中华人民共和国成立70周年,先祝我的祖国母亲生日快乐 由于最近嗓子不太好使,我就不发歌了 分割线 在学校挤了一点本来应该发呆的时间写了点没用的 前一部分是对一点OI知识的复习,后一部分是最近高中 ...

  10. 项目Beta冲刺(团队) —— 总结

    所属课程 软件工程1916|W(福州大学) 作业要求 Beta冲刺--总结篇 团队名称 待就业六人组 后端源码 Github地址 APP源码 Github地址 在线评审表 腾讯文档地址 Beta版本A ...