Skip to content

Commit f1f5865

Browse files
YunFeng0817Yuyz0112xyj404Xu Yinjiexujiujiu
authored
move rrvideo to monorepo (#1181)
* first commit * rrvideo v0.1.0 First version of rrvideo. 1. Use as a Node.JS lib. 2. Use as a CLI. Features are implemented via puppeteer, ffmpeg and rrweb-player. * add readme * update publish script * add node env in cli file and change package.json bin to same like README (#4) Co-authored-by: Xu Yinjie <[email protected]> * release 0.2.0 * fix #6 avoid assign undefined to config * Fix: Solve the inconsistency between rrvideo and the real recorded page rendering when rendering the page with a headless browser (rrweb-io/rrvideo#26) Author: xujiujiu <[email protected]> --------- Co-authored-by: xujiujiu <[email protected]> * refactor rrvideo 1. refactor code 2. change monorepo config 3. remove separate TS dependencies * add changeset * fix: eslint errors --------- Co-authored-by: Yanzhen Yu <[email protected]> Co-authored-by: xyj <[email protected]> Co-authored-by: Xu Yinjie <[email protected]> Co-authored-by: xujiujiu <[email protected]>
1 parent 1e6f71b commit f1f5865

25 files changed

+597
-2533
lines changed

.changeset/config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"rrdom-nodejs",
1111
"rrweb-player",
1212
"@rrweb/types",
13-
"@rrweb/web-extension"
13+
"@rrweb/web-extension",
14+
"rrvideo"
1415
]
1516
],
1617
"linked": [],
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'rrvideo': patch
3+
---
4+
5+
Refactor: Move rrvideo to rrweb's monorepo

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ body:
1919
- rrweb-snapshot
2020
- rrdom
2121
- rrweb-player
22+
- web-extension
23+
- rrvideo
2224
- Other (specify below)
2325
validations:
2426
required: true

.github/ISSUE_TEMPLATE/feature_request.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ body:
1919
- rrweb-snapshot
2020
- rrdom
2121
- rrweb-player
22+
- web-extension
23+
- rrvideo
2224
- Other (specify below)
2325
validations:
2426
required: true

.vscode/rrweb-monorepo.code-workspace

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"name": "web-extension (package)",
2929
"path": "../packages/web-extension"
3030
},
31+
{ "name": "rrvideo (package)", "path": "../packages/rrvideo" },
3132
{ "name": "@rrweb/types", "path": "../packages/types" }
3233
],
3334
"settings": {

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,13 @@
2929
"eslint-plugin-compat": "^4.0.2",
3030
"eslint-plugin-jest": "^27.1.3",
3131
"eslint-plugin-tsdoc": "^0.2.16",
32-
"lerna": "^4.0.0",
3332
"markdownlint": "^0.25.1",
3433
"markdownlint-cli": "^0.31.1",
3534
"prettier": "2.8.4",
3635
"turbo": "^1.2.4",
3736
"typescript": "^4.7.3"
3837
},
3938
"scripts": {
40-
"lerna": "lerna",
4139
"build:all": "yarn run concurrently --success=all -r -m=1 'yarn workspaces-to-typescript-project-references' 'yarn turbo run prepublish'",
4240
"test": "yarn run concurrently --success=all -r -m=1 'yarn workspaces-to-typescript-project-references --check' 'yarn turbo run test'",
4341
"test:watch": "yarn turbo run test:watch",

packages/rrdom-nodejs/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@
4242
"rollup-plugin-terser": "^7.0.2",
4343
"rollup-plugin-typescript2": "^0.31.2",
4444
"rollup-plugin-web-worker-loader": "^1.6.1",
45-
"ts-jest": "^27.1.3",
46-
"typescript": "^4.7.3"
45+
"ts-jest": "^27.1.3"
4746
},
4847
"dependencies": {
4948
"cssom": "^0.5.0",

packages/rrdom/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@
4444
"rollup-plugin-terser": "^7.0.2",
4545
"rollup-plugin-typescript2": "^0.31.2",
4646
"rollup-plugin-web-worker-loader": "^1.6.1",
47-
"ts-jest": "^27.1.3",
48-
"typescript": "^4.7.3"
47+
"ts-jest": "^27.1.3"
4948
},
5049
"dependencies": {
5150
"rrweb-snapshot": "^2.0.0-alpha.6"

packages/rrvideo/README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# rrvideo
2+
3+
[中文文档](./README.zh_CN.md)
4+
5+
rrvideo is a tool for transforming the session recorded by [rrweb](https://github.com/rrweb-io/rrweb) into a video.
6+
7+
## Install rrvideo
8+
9+
1. Install [ffmpeg](https://ffmpeg.org/download.html)
10+
2. Install [Node.JS](https://nodejs.org/en/download/)
11+
3. Run `npm i -g rrvideo` to install the rrvideo CLI。
12+
13+
## Use rrvideo
14+
15+
### Transform a rrweb session(in JSON format) into a video.
16+
17+
```shell
18+
rrvideo --input PATH_TO_YOUR_RRWEB_EVENTS_FILE
19+
```
20+
21+
Running this command will output a `rrvideo-output.mp4` file in the current working directory.
22+
23+
### Config the output path
24+
25+
```shell
26+
rrvideo --input PATH_TO_YOUR_RRWEB_EVENTS_FILE --output OUTPUT_PATH
27+
```
28+
29+
### Config the replay
30+
31+
You can prepare a rrvideo config file and pass it to CLI.
32+
33+
```shell
34+
rrvideo --input PATH_TO_YOUR_RRWEB_EVENTS_JSON_FILE --config PATH_TO_YOUR_RRVIDEO_CONFIG_FILE
35+
```
36+
37+
You can find an example of the rrvideo config file [here](./rrvideo.config.example.json).

packages/rrvideo/README.zh_CN.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# rrvideo
2+
3+
rrvideo 是用于将 [rrweb](https://github.com/rrweb-io/rrweb) 录制的数据转为视频格式的工具。
4+
5+
## 安装 rrvideo
6+
7+
1. 安装 [ffmpeg](https://ffmpeg.org/download.html)
8+
2. 安装 [Node.JS](https://nodejs.org/en/download/)
9+
3. 执行 `npm i -g rrvideo` 以安装 rrvideo CLI。
10+
11+
## 使用 rrvideo
12+
13+
### 将一份 rrweb 录制的数据(JSON 格式)转换为视频。
14+
15+
```shell
16+
rrvideo --input PATH_TO_YOUR_RRWEB_EVENTS_FILE
17+
```
18+
19+
运行以上命令会在执行文件夹中生成一个 `rrvideo-output.mp4` 文件。
20+
21+
### 指定输出路径
22+
23+
```shell
24+
rrvideo --input PATH_TO_YOUR_RRWEB_EVENTS_FILE --output OUTPUT_PATH
25+
```
26+
27+
### 对回放进行配置
28+
29+
通过编写一个 rrvideo 配置文件再传入 rrvideo CLI 的方式可以对回放进行一定的配置。
30+
31+
```shell
32+
rrvideo --input PATH_TO_YOUR_RRWEB_EVENTS_JSON_FILE --config PATH_TO_YOUR_RRVIDEO_CONFIG_FILE
33+
```
34+
35+
rrvideo 配置文件可参考[示例](./rrvideo.config.example.json)

0 commit comments

Comments
 (0)