Skip to content

Commit c71ebd2

Browse files
Juice10jeffdnguyen
authored andcommitted
Improve development tooling (rrweb-io#1516)
- Running `yarn build` in a `packages/*/` directory will trigger build of all dependencies too, and cache them if possible. - Fix for `yarn dev` breaking for `rrweb` package whenever changing files in `rrweb` package - Update typescript, turbo, vite and vite-plugin-dts - Require `workspaces-to-typescript-project-references` from `prepublish`
1 parent 52c726f commit c71ebd2

File tree

54 files changed

+420
-247
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+420
-247
lines changed

.changeset/wicked-lions-return.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

.vscode/rrweb-monorepo.code-workspace

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@
9494
"@rrweb/rrweb-plugin-sequential-id",
9595
"@rrweb/rrweb-plugin-canvas-webrtc-record",
9696
"@rrweb/rrweb-plugin-canvas-webrtc-replay"
97-
]
97+
],
98+
"typescript.tsdk": " rrweb monorepo/node_modules/typescript/lib"
9899
}
99100
}

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,19 @@
3737
"markdownlint": "^0.25.1",
3838
"markdownlint-cli": "^0.31.1",
3939
"prettier": "2.8.4",
40-
"turbo": "^2.0.3",
41-
"typescript": "^4.9.5"
40+
"turbo": "^2.0.4",
41+
"typescript": "^5.4.5"
4242
},
4343
"scripts": {
44-
"build:all": "NODE_OPTIONS='--max-old-space-size=4096' yarn run concurrently --success=all -r -m=1 'yarn workspaces-to-typescript-project-references' 'yarn turbo run prepublish'",
45-
"test": "yarn run concurrently --success=all -r -m=1 'yarn workspaces-to-typescript-project-references --check' 'yarn turbo run test --concurrency=1 --continue'",
44+
"build:all": "NODE_OPTIONS='--max-old-space-size=4096' yarn turbo run prepublish",
45+
"references:update": "yarn workspaces-to-typescript-project-references",
46+
"test": "yarn turbo run test --concurrency=1 --continue",
4647
"test:watch": "yarn turbo run test:watch",
4748
"test:update": "yarn turbo run test:update",
4849
"check-types": "yarn turbo run check-types --continue",
4950
"format": "yarn prettier --write '**/*.{ts,md}'",
5051
"format:head": "git diff --name-only HEAD^ |grep '\\.ts$\\|\\.md$' |xargs yarn prettier --write",
51-
"dev": "CLEAR_DIST_DIR=false yarn turbo run dev --concurrency=17",
52+
"dev": "yarn turbo run dev --concurrency=17",
5253
"repl": "cd packages/rrweb && npm run repl",
5354
"live-stream": "cd packages/rrweb && yarn live-stream",
5455
"lint": "yarn run concurrently --success=all -r -m=1 'yarn run markdownlint docs' 'yarn eslint packages/*/src --ext .ts,.tsx,.js,.jsx,.svelte'",

packages/all/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
],
1111
"scripts": {
1212
"dev": "vite build --watch",
13-
"build": "tsc -noEmit && vite build",
13+
"build": "yarn turbo run prepublish",
1414
"test": "vitest run",
1515
"test:watch": "vitest watch",
1616
"check-types": "tsc -noEmit",
17-
"prepublish": "npm run build",
17+
"prepublish": "tsc -noEmit && vite build",
1818
"lint": "yarn eslint src/**/*.ts"
1919
},
2020
"homepage": "https://github.com/rrweb-io/rrweb/tree/main/packages/@rrweb/all#readme",
@@ -50,10 +50,10 @@
5050
],
5151
"devDependencies": {
5252
"puppeteer": "^20.9.0",
53-
"vite": "^5.2.8",
54-
"vite-plugin-dts": "^3.8.1",
53+
"vite": "^5.3.1",
54+
"vite-plugin-dts": "^3.9.1",
5555
"vitest": "^1.4.0",
56-
"typescript": "^4.7.3"
56+
"typescript": "^5.4.5"
5757
},
5858
"dependencies": {
5959
"@rrweb/types": "^2.0.0-alpha.15",

packages/packer/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
],
1111
"scripts": {
1212
"dev": "vite build --watch",
13-
"build": "tsc -noEmit && vite build",
13+
"build": "yarn turbo run prepublish",
1414
"test": "vitest run",
1515
"test:watch": "vitest watch",
1616
"check-types": "tsc -noEmit",
17-
"prepublish": "npm run build",
17+
"prepublish": "tsc -noEmit && vite build",
1818
"lint": "yarn eslint src/**/*.ts"
1919
},
2020
"homepage": "https://github.com/rrweb-io/rrweb/tree/main/packages/@rrweb/packer#readme",
@@ -71,10 +71,10 @@
7171
"package.json"
7272
],
7373
"devDependencies": {
74-
"vite": "^5.2.8",
75-
"vite-plugin-dts": "^3.8.1",
74+
"vite": "^5.3.1",
75+
"vite-plugin-dts": "^3.9.1",
7676
"vitest": "^1.4.0",
77-
"typescript": "^4.7.3"
77+
"typescript": "^5.4.5"
7878
},
7979
"dependencies": {
8080
"fflate": "^0.4.4",

packages/packer/src/pack.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { strFromU8, strToU8, zlibSync } from 'fflate';
22
import type { PackFn } from '@rrweb/types';
3-
import { eventWithTimeAndPacker, MARK } from './base';
3+
import { type eventWithTimeAndPacker, MARK } from './base';
44

55
export const pack: PackFn = (event) => {
66
const _e: eventWithTimeAndPacker = {

packages/packer/src/unpack.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { strFromU8, strToU8, unzlibSync } from 'fflate';
2-
import { eventWithTimeAndPacker, MARK } from './base';
2+
import { type eventWithTimeAndPacker, MARK } from './base';
33
import type { UnpackFn, eventWithTime } from '@rrweb/types';
44

55
export const unpack: UnpackFn = (raw: string) => {

packages/plugins/rrweb-plugin-canvas-webrtc-record/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
],
2626
"scripts": {
2727
"dev": "vite build --watch",
28-
"build": "tsc -noEmit && vite build",
28+
"build": "yarn turbo run prepublish",
2929
"check-types": "tsc -noEmit",
30-
"prepublish": "npm run build"
30+
"prepublish": "tsc -noEmit && vite build"
3131
},
3232
"repository": {
3333
"type": "git",
@@ -44,9 +44,9 @@
4444
"homepage": "https://github.com/rrweb-io/rrweb#readme",
4545
"devDependencies": {
4646
"rrweb": "^2.0.0-alpha.15",
47-
"typescript": "^4.7.3",
48-
"vite": "^5.2.8",
49-
"vite-plugin-dts": "^3.8.1"
47+
"typescript": "^5.4.5",
48+
"vite": "^5.3.1",
49+
"vite-plugin-dts": "^3.9.1"
5050
},
5151
"peerDependencies": {
5252
"rrweb": "^2.0.0-alpha.15"

packages/plugins/rrweb-plugin-canvas-webrtc-replay/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
],
2626
"scripts": {
2727
"dev": "vite build --watch",
28-
"build": "tsc -noEmit && vite build",
28+
"build": "yarn turbo run prepublish",
2929
"check-types": "tsc -noEmit",
30-
"prepublish": "npm run build"
30+
"prepublish": "tsc -noEmit && vite build"
3131
},
3232
"repository": {
3333
"type": "git",
@@ -44,9 +44,9 @@
4444
"homepage": "https://github.com/rrweb-io/rrweb#readme",
4545
"devDependencies": {
4646
"rrweb": "^2.0.0-alpha.15",
47-
"typescript": "^4.7.3",
48-
"vite": "^5.2.8",
49-
"vite-plugin-dts": "^3.8.1"
47+
"typescript": "^5.4.5",
48+
"vite": "^5.3.1",
49+
"vite-plugin-dts": "^3.9.1"
5050
},
5151
"peerDependencies": {
5252
"rrweb": "^2.0.0-alpha.15"

packages/plugins/rrweb-plugin-console-record/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
"dev": "vite build --watch",
2828
"test": "vitest run",
2929
"test:watch": "vitest watch",
30-
"build": "tsc -noEmit && vite build",
30+
"build": "yarn turbo run prepublish",
3131
"check-types": "tsc -noEmit",
32-
"prepublish": "npm run build"
32+
"prepublish": "tsc -noEmit && vite build"
3333
},
3434
"repository": {
3535
"type": "git",
@@ -46,9 +46,9 @@
4646
"homepage": "https://github.com/rrweb-io/rrweb#readme",
4747
"devDependencies": {
4848
"rrweb": "^2.0.0-alpha.15",
49-
"typescript": "^4.7.3",
50-
"vite": "^5.2.8",
51-
"vite-plugin-dts": "^3.8.1",
49+
"typescript": "^5.4.5",
50+
"vite": "^5.3.1",
51+
"vite-plugin-dts": "^3.9.1",
5252
"vitest": "^1.4.0",
5353
"puppeteer": "^20.9.0"
5454
},

0 commit comments

Comments
 (0)