rushjs来自微软的单体仓库管理工具
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来自微软的单体仓库管理工具的更多相关文章
- 微软推 Azure 机器学习工具:Algorithm Cheat Sheet
微软推 Azure 机器学习工具:Algorithm Cheat Sheet [日期:2015-05-15] 来源:CSDN 作者:Linux [字体:大 中 小] Azure Machine ...
- zz【重磅】微软开源自动机器学习工具 - NNI
[重磅]微软开源自动机器学习工具 - NNI 在机器学习建模时,除了准备数据,最耗时耗力的就是尝试各种超参组合,找到模型最佳效果的过程了.即使是对于有经验的算法工程师和数据科学家,有时候也很难把握其中 ...
- 微软开源自动机器学习工具NNI安装与使用
微软开源自动机器学习工具 – NNI安装与使用 在机器学习建模时,除了准备数据,最耗时耗力的就是尝试各种超参组合,找到最佳模型的过程了.对于初学者来说,常常是无从下手.即使是对于有经验的算法工程师 ...
- 【重磅】微软开源自动机器学习工具 - NNI
[重磅]微软开源自动机器学习工具 - NNI 在机器学习建模时,除了准备数据,最耗时耗力的就是尝试各种超参组合,找到模型最佳效果的过程了.即使是对于有经验的算法工程师和数据科学家,有时候也很难把握其中 ...
- 酷!微软发布新终端工具,Win 10 将自带 Linux 内核
原创:技术最前线(id:TopITNews) 北京时间 5 月 7 日,2019 年微软 Build 开发者大会在雷德蒙德召开.今年大会上亮点很多,本文汇总一些和开发者相关的内容. 1. Window ...
- 微软开源的 AI 工具,让旧照片焕发新生
原文地址:Bringing Old Photos Back to Life 原文作者:Ziyu Wan 译者 & 校正:HelloGitHub-小鱼干 & 鸭鸭 写在前面 在 GitH ...
- Window 下好用的同步备份工具(来自微软)SyncToy
SyncToy 简单好用,满足备份的基本需求.
- entityframework 入门-来自微软
必备条件 要完成本演练,需要安装 Visual Studio 2010 或 Visual Studio 2012. 如果使用的是 Visual Studio 2010,还需要安装 NuGet. 1.创 ...
- 【FLYabroad 】微软内部代码检查工具 (Microsoft Source Analysis for C#)[转]
SourceAnalysis (StyleCop)的终极目标是让所有人都能写出优雅和一致的代码,因此这些代码具有很高的可读性. 早就听说了微软内部的静态代码检查和代码强制格式美化工具 StyleCop ...
随机推荐
- NVDLA软件架构和源码解析 第一章—内核驱动【华为云技术分享】
驱动整体设计介绍 不同的processor Nvidia DLA的内核驱动KMD(Kernel mode driver)中,并不是把DLA当成一个设备来控制,而是把不同的功能模块当做不同的proces ...
- 探索ASP.NET MVC5系列
探索ASP.NET MVC5系列之~~~6.Session篇(进程外Session) 探索ASP.NET MVC5系列之~~~5.缓存篇(页面缓存+二级缓存) 探索ASP.NET MV ...
- 2019 边锋游戏java面试笔试题 (含面试题解析)
本人5年开发经验.18年年底开始跑路找工作,在互联网寒冬下成功拿到阿里巴巴.今日头条.边锋游戏等公司offer,岗位是Java后端开发,因为发展原因最终选择去了边锋游戏,入职一年时间了,也成为了面 ...
- 【转载】 C#中ArrayList使用GetRange方法获取某一段集合数据
在C#的编程开发中,ArrayList集合是一个常用的非泛型类集合,可以使用GetRange方法来获取集合中指定索引位置开始的一整段集合数据组成一个新的集合,GetRange方法的签名为virtual ...
- 【转载】C#通过Rows.Count属性获取总行数
在C#中的Datatable数据变量的操作过程中,有时候我们需要知道DataTable中是否含有数据行或者DataTable的数据总行数,此时我们就可以先拿到DataTable中的Rows属性对象,通 ...
- Java 之 lambda 表达式
一.函数式编程思想概述 在数学中,函数就是有输入量.输出量的一套计算方案,就是“拿什么东西做什么事情”.相对而言,面向对象过分强调“必须通过对象的形式来做事情”,而函数式思想则尽量忽略面向对象的复杂语 ...
- Palo Alto GlobalProtect上的PreAuth RCE
0x00 前言 SSL VPN虽然可以保护企业资产免受互联网被攻击的风险影响,但如果SSL VPN本身容易受到攻击呢?它们暴露在互联网上,可以可靠并安全地连接到内网中.一旦SSL VPN服务器遭到入侵 ...
- linux的bash特性
Shell本身是应用程序,是用户与操作系统之间完成交互式操作的一个接口程序,为用户提供简化的操作. Bourne Again Shell,简称bash,是Linux系统中默认的shell程序. Bas ...
- ML-凸优化初识
ML问题 = 模型 + 优化 类似于, 程序 = 数据结构 + 算法 模型(objective): DL, LR, SCV, Tree, XGBoost..... 优化(train): GD/SGD, ...
- Linux 常用命令(根据自己的理解随时更新)
1. linux 目录解释系统启动必须: /boot:存放的启动 Linux 时使用的内核文件,包括连接文件以及镜像文件. /etc:存放所有的系统需要的配置文件和子目录列表,更改目录下的文件可能会导 ...