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. Rdlc Mail Label

    1.创建报表服务器项目RDLML. 2.新建共享数据源DataMailLabel,设置到数据库AdventureWorks的连接,并为报表指定相应的访问凭据. 3.选择Name.Color.Thumb ...

  2. [转] js async await 终极异步解决方案

    阅读目录 回顾 Promise async await 字面理解 async.await 如何执行 await 操作符 总结 既然有了promise 为什么还要有async await ? 当然是pr ...

  3. Linux学习笔记之文件读取过程

    0x00 概述 对于Linux系统来说,一切的数据都起源于磁盘中存储的文件.Linux文件系统的结构及其在磁盘中是如何存储的?操作系统是怎样找到这些文件进行读取的?这一章主要围绕这几个问题进行介绍(以 ...

  4. C#完成 使用异步线程定时更新窗体标签内容,并对标签内容进行求和显示

    这是我在面试过程中遇到的一个小测试,很可惜,当天未能圆满完成,虽然第二天经过实际测试已经OK 了,但学无止境,继续努力吧,特将此代码贴在这里,供以后学习使用: namespace mytest { p ...

  5. jquery 获取后台实时数据

    第一步.提醒后台处理数据1.$.ajax({}) 提交数据,2.后台返回状态3.后台开始处理数据,并每秒记录状态到 data.json 文件4.前台每秒请求 data.json 文件,直到处理完成 第 ...

  6. Unity AsyncGPUReadback 接口测试

    Unity2018新加入了该接口,可以做到异步RenderTexture->像素数据和异步的ComputeBuffer.GetData 那么写了几个例子来测试下. 1.RenderTexture ...

  7. springMVC执行流程及架构

    目录 springMVC简单执行流程 springMVC框架 注解实现 springMVC简单执行流程 springMVC框架 执行流程: 1.用户发送请求至前端控制器DispatcherServle ...

  8. pandas-20 DataFrame()的基本操作

    pandas-20 DataFrame()的基本操作 感觉上pandas的DataFrame就像numpy中的矩阵,不过它拥有列名和索引名,实际操作起来会更方便一些. 如: df = pd.read_ ...

  9. Java 之 Random 类

    一.Random 类  random 类的实例用于生成伪随机数. Demo: Random r = new Random(); int i = r.nextInt(); 二.Random 使用步骤 1 ...

  10. Keras上实现简单线性回归模型

    版权声明:本文为博主原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明. 本文链接:https://blog.csdn.net/marsjhao/article/detai ...