add lerna to manage monorepo

This commit is contained in:
Yanzhen Yu
2026-04-01 12:00:00 +08:00
parent 257e8c10c9
commit 309b7d9026
9 changed files with 3386 additions and 65 deletions

View File

@@ -11,9 +11,6 @@ install:
- yarn - yarn
script: script:
- cd packages/rrweb-snapshot - yarn lerna run prepublish
- yarn bundle - yarn lerna run check-types
- yarn test - xvfb-run --server-args="-screen 0 1920x1080x24" yarn lerna run test
- cd ../rrweb
- yarn check-types
- xvfb-run --server-args="-screen 0 1920x1080x24" yarn test

10
lerna.json Normal file
View File

@@ -0,0 +1,10 @@
{
"version": "independent",
"npmClient": "yarn",
"useWorkspaces": true,
"command": {
"publish": {
"message": "chore(release): publish %s"
}
}
}

View File

@@ -18,5 +18,8 @@
"packages/rrweb", "packages/rrweb",
"packages/rrweb-snapshot", "packages/rrweb-snapshot",
"packages/rrweb-player" "packages/rrweb-player"
] ],
"devDependencies": {
"lerna": "^4.0.0"
}
} }

View File

@@ -32,7 +32,8 @@
"dev": "rollup -c -w", "dev": "rollup -c -w",
"prepublishOnly": "yarn build", "prepublishOnly": "yarn build",
"start": "sirv public", "start": "sirv public",
"validate": "svelte-check" "validate": "svelte-check",
"prepublish": "yarn build"
}, },
"description": "rrweb's replayer UI", "description": "rrweb's replayer UI",
"main": "lib/index.js", "main": "lib/index.js",

View File

@@ -8,7 +8,8 @@
"test": "cross-env TS_NODE_CACHE=false TS_NODE_FILES=true mocha -r ts-node/register test/**/*.ts", "test": "cross-env TS_NODE_CACHE=false TS_NODE_FILES=true mocha -r ts-node/register test/**/*.ts",
"bundle": "rollup --config", "bundle": "rollup --config",
"bundle:es-only": "cross-env ES_ONLY=true rollup --config", "bundle:es-only": "cross-env ES_ONLY=true rollup --config",
"typings": "tsc -d --declarationDir typings" "typings": "tsc -d --declarationDir typings",
"prepublish": "npm run typings && npm run bundle"
}, },
"repository": { "repository": {
"type": "git", "type": "git",

View File

@@ -12,7 +12,8 @@
"bundle:browser": "cross-env BROWSER_ONLY=true rollup --config", "bundle:browser": "cross-env BROWSER_ONLY=true rollup --config",
"bundle": "rollup --config", "bundle": "rollup --config",
"typings": "tsc -d --declarationDir typings", "typings": "tsc -d --declarationDir typings",
"check-types": "tsc -noEmit" "check-types": "tsc -noEmit",
"prepublish": "npm run typings && npm run bundle"
}, },
"repository": { "repository": {
"type": "git", "type": "git",

View File

@@ -39,5 +39,4 @@ export declare type Logger = {
}; };
export declare const PLUGIN_NAME = "rrweb/console@1"; export declare const PLUGIN_NAME = "rrweb/console@1";
export declare const getRecordConsolePlugin: (options?: LogRecordOptions) => RecordPlugin; export declare const getRecordConsolePlugin: (options?: LogRecordOptions) => RecordPlugin;
export { }; export {};

View File

@@ -19,6 +19,7 @@ export declare class Replayer {
private fragmentParentMap; private fragmentParentMap;
private elementStateMap; private elementStateMap;
private virtualStyleRulesMap; private virtualStyleRulesMap;
private cache;
private imageMap; private imageMap;
private mirror; private mirror;
private firstFullSnapshot; private firstFullSnapshot;
@@ -38,6 +39,7 @@ export declare class Replayer {
addEvent(rawEvent: eventWithTime | string): void; addEvent(rawEvent: eventWithTime | string): void;
enableInteract(): void; enableInteract(): void;
disableInteract(): void; disableInteract(): void;
resetCache(): void;
private setupDom; private setupDom;
private handleResize; private handleResize;
private getCastFn; private getCastFn;

3413
yarn.lock

File diff suppressed because it is too large Load Diff