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 ...
随机推荐
- AGC038
Contest Page 开题开错翻车场.jpg A sol $A > \frac{W}{2}$或者$B > \frac{H}{2}$的时候无解,否则构造方法长下面这样 #include& ...
- SQL系列(四)—— 唯一值(distinct)
有时需要查询某列上的不重复的数据,如: SELECT name FROM student; 结果: name lxy lxy lxy lxy 这样的结果显然不符合我们的需求.如何对列数据进行去重,查询 ...
- spring cloud应用
1.什么是注册中心 (1)就是首先有一个eureka server,服务的注册与发现的中心(2)你如果写好了一个服务,就可以将其注册到eureka server上去(3)然后别人的服务如果要调用你的服 ...
- 【转】Webpack 快速上手(上)
嫌啰嗦想直接看最终的配置请戳这里 webpack-workbench (https://github.com/onlymisaky/webpack-workbench) 由于文章篇幅较长,为了更好的阅 ...
- 43、css实现镂空半圆环
<style> .circle { position: relative; box-sizing: border-box; } .big { width: 140px; height: 1 ...
- Cheat Engine 字节数组类型
BIG5 编码:http://www.qqxiuzi.cn/zh/hanzi-big5-bianma.php 打开游戏 准备修改名字 查找BIG5码 藤 吉 开始扫描 使用字节数组类型扫描 新BIG5 ...
- consul:架构
官方文档:https://www.consul.io/docs/internals/architecture.html
- 小程序开发 解析内容中unicode转中文编码显示问题
如果对你有帮助的话麻烦点个[推荐]~最好还可以follow一下我的GitHub~感谢观看! 小程序后台返回数据的时候,html内容是经过unicode编码的不能直接显示,里边全是类似&#xxx ...
- FFMPEG 命令行工具- ffmpeg
ffmpeg 简介 ffmpeg 用于转码的应用程序,命令格式: ffmpeg [options] [[infile options] -i infile]... {[outfile options] ...
- centos7上安装zabbix3.4的详细步骤与问题处理记录
zabbix是linux运维工作中经常用到的开源工具,话不多说,直接开始正式的安装配置环境.1.安装环境 centos7 服务端:192.168.200.100 客户端:192.168.200.200 ...