Skip to content

Commit

Permalink
Imports now point to @chromaui/rrweb-snapshot so tests should pass
Browse files Browse the repository at this point in the history
  • Loading branch information
skitterm committed Sep 25, 2024
1 parent f695df0 commit 1c5bdfc
Show file tree
Hide file tree
Showing 40 changed files with 63 additions and 47 deletions.
2 changes: 1 addition & 1 deletion packages/all/test/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NodeType } from 'rrweb-snapshot';
import { NodeType } from '@chromaui/rrweb-snapshot';
import { expect } from 'vitest';
import {
EventType,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Mirror } from 'rrweb-snapshot';
import type { Mirror } from '@chromaui/rrweb-snapshot';
import SimplePeer from 'simple-peer-light';
import type { RecordPlugin, ICrossOriginIframeMirror } from '@rrweb/types';
import type { WebRTCDataChannel } from './types';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { RRNode } from 'rrdom';
import type { Mirror } from 'rrweb-snapshot';
import type { Mirror } from '@chromaui/rrweb-snapshot';
import SimplePeer from 'simple-peer-light';
import type { ReplayPlugin, Replayer } from 'rrweb';
import type { WebRTCDataChannel } from './types';
Expand Down
2 changes: 1 addition & 1 deletion packages/rrdom-nodejs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@
"cssstyle": "^2.3.0",
"nwsapi": "2.2.0",
"rrdom": "^2.0.0-alpha.17",
"rrweb-snapshot": "^2.0.0-alpha.17"
"@chromaui/rrweb-snapshot": "2.0.0-alpha.17-noAbsolute"
}
}
2 changes: 1 addition & 1 deletion packages/rrdom-nodejs/src/document-nodejs.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
import { NodeType as RRNodeType } from 'rrweb-snapshot';
import { NodeType as RRNodeType } from '@chromaui/rrweb-snapshot';
import type { NWSAPI } from 'nwsapi';
import type { CSSStyleDeclaration as CSSStyleDeclarationType } from 'cssstyle';
import {
Expand Down
2 changes: 1 addition & 1 deletion packages/rrdom-nodejs/test/document-nodejs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import { describe, it, expect, beforeAll } from 'vitest';
import * as fs from 'fs';
import * as path from 'path';
import { NodeType as RRNodeType } from 'rrweb-snapshot';
import { NodeType as RRNodeType } from '@chromaui/rrweb-snapshot';
import {
RRCanvasElement,
RRCDATASection,
Expand Down
4 changes: 3 additions & 1 deletion packages/rrdom-nodejs/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src"],
"include": [
"src"
],
"compilerOptions": {
"rootDir": "src",
"tsBuildInfoFile": "./tsconfig.tsbuildinfo"
Expand Down
2 changes: 1 addition & 1 deletion packages/rrdom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@
"vite-plugin-dts": "^3.9.1"
},
"dependencies": {
"rrweb-snapshot": "^2.0.0-alpha.17"
"@chromaui/rrweb-snapshot": "2.0.0-alpha.17-noAbsolute"
}
}
2 changes: 1 addition & 1 deletion packages/rrdom/src/diff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
NodeType as RRNodeType,
Mirror as NodeMirror,
type elementNode,
} from 'rrweb-snapshot';
} from '@chromaui/rrweb-snapshot';
import type {
canvasMutationData,
canvasEventWithTime,
Expand Down
2 changes: 1 addition & 1 deletion packages/rrdom/src/document.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NodeType as RRNodeType } from 'rrweb-snapshot';
import { NodeType as RRNodeType } from '@chromaui/rrweb-snapshot';
import { parseCSSText, camelize, toCSSText } from './style';
export interface IRRNode {
parentElement: IRRNode | null;
Expand Down
4 changes: 2 additions & 2 deletions packages/rrdom/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import {
NodeType as RRNodeType,
createMirror as createNodeMirror,
} from 'rrweb-snapshot';
} from '@chromaui/rrweb-snapshot';
import type {
Mirror as NodeMirror,
IMirror,
serializedNodeWithId,
} from 'rrweb-snapshot';
} from '@chromaui/rrweb-snapshot';
import type {
canvasMutationData,
canvasEventWithTime,
Expand Down
2 changes: 1 addition & 1 deletion packages/rrdom/test/diff.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
createMirror,
Mirror as NodeMirror,
serializedNodeWithId,
} from 'rrweb-snapshot';
} from '@chromaui/rrweb-snapshot';
import {
buildFromDom,
getDefaultSN,
Expand Down
2 changes: 1 addition & 1 deletion packages/rrdom/test/diff/dialog.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
createMirror,
Mirror as NodeMirror,
serializedNodeWithId,
} from 'rrweb-snapshot';
} from '@chromaui/rrweb-snapshot';
import { RRDocument } from '../../src';
import { diff, ReplayerHandler } from '../../src/diff';

Expand Down
2 changes: 1 addition & 1 deletion packages/rrdom/test/document.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @jest-environment jsdom
*/
import { NodeType as RRNodeType } from 'rrweb-snapshot';
import { NodeType as RRNodeType } from '@chromaui/rrweb-snapshot';
import {
BaseRRDocument,
BaseRRDocumentType,
Expand Down
2 changes: 1 addition & 1 deletion packages/rrdom/test/virtual-dom.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
NodeType,
NodeType as RRNodeType,
textNode,
} from 'rrweb-snapshot';
} from '@chromaui/rrweb-snapshot';
import {
buildFromDom,
buildFromNode,
Expand Down
4 changes: 3 additions & 1 deletion packages/rrdom/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src"],
"include": [
"src"
],
"compilerOptions": {
"rootDir": "src",
"tsBuildInfoFile": "./tsconfig.tsbuildinfo"
Expand Down
2 changes: 1 addition & 1 deletion packages/rrweb-player/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { eventWithTime } from '@rrweb/types';
import type { Replayer, playerConfig } from '@rrweb/replay';
import type { Mirror } from 'rrweb-snapshot';
import type { Mirror } from '@chromaui/rrweb-snapshot';

export type RRwebPlayerOptions = {
target: HTMLElement;
Expand Down
2 changes: 1 addition & 1 deletion packages/rrweb-snapshot/test/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
fixSafariColons,
isNodeMetaEqual,
} from '../src/utils';
import type { serializedNodeWithId } from 'rrweb-snapshot';
import type { serializedNodeWithId } from '@chromaui/rrweb-snapshot';

describe('utils', () => {
describe('isNodeMetaEqual()', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/rrweb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,6 @@
"base64-arraybuffer": "^1.0.1",
"mitt": "^3.0.0",
"rrdom": "^2.0.0-alpha.17",
"rrweb-snapshot": "^2.0.0-alpha.17"
"@chromaui/rrweb-snapshot": "2.0.0-alpha.17-noAbsolute"
}
}
4 changes: 2 additions & 2 deletions packages/rrweb/src/record/iframe-manager.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Mirror, serializedNodeWithId } from 'rrweb-snapshot';
import { genId, NodeType } from 'rrweb-snapshot';
import type { Mirror, serializedNodeWithId } from '@chromaui/rrweb-snapshot';
import { genId, NodeType } from '@chromaui/rrweb-snapshot';
import type { CrossOriginIframeMessageEvent } from '../types';
import CrossOriginIframeMirror from './cross-origin-iframe-mirror';
import { EventType, IncrementalSource } from '@rrweb/types';
Expand Down
2 changes: 1 addition & 1 deletion packages/rrweb/src/record/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
type MaskInputOptions,
type SlimDOMOptions,
createMirror,
} from 'rrweb-snapshot';
} from '@chromaui/rrweb-snapshot';
import { initObservers, mutationBuffers } from './observer';
import {
on,
Expand Down
3 changes: 1 addition & 2 deletions packages/rrweb/src/record/mutation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
isNativeShadowDom,
getInputType,
toLowerCase,
} from 'rrweb-snapshot';
} from '@chromaui/rrweb-snapshot';
import type { observerParam, MutationBufferParam } from '../types';
import type {
mutationRecord,
Expand Down Expand Up @@ -349,7 +349,6 @@ export default class MutationBuffer {
onStylesheetLoad: (link, childSn) => {
this.stylesheetManager.attachLinkElement(link, childSn);
},
// @ts-expect-error cssCaptured isn't specified as an accepted property,
// but we didn't touch anything near here, so ignoring for now
cssCaptured,
});
Expand Down
2 changes: 1 addition & 1 deletion packages/rrweb/src/record/observer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
Mirror,
getInputType,
toLowerCase,
} from 'rrweb-snapshot';
} from '@chromaui/rrweb-snapshot';
import type { FontFaceSet } from 'css-font-loading-module';
import {
throttle,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ICanvas, Mirror, DataURLOptions } from 'rrweb-snapshot';
import type { ICanvas, Mirror, DataURLOptions } from '@chromaui/rrweb-snapshot';
import type {
blockClass,
canvasManagerMutationCallback,
Expand Down
2 changes: 1 addition & 1 deletion packages/rrweb/src/record/observers/canvas/canvas.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ICanvas } from 'rrweb-snapshot';
import type { ICanvas } from '@chromaui/rrweb-snapshot';
import type { blockClass, IWindow, listenerHandler } from '@rrweb/types';
import { isBlocked, patch } from '../../../utils';

Expand Down
4 changes: 2 additions & 2 deletions packages/rrweb/src/record/shadow-dom-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import {
initAdoptedStyleSheetObserver,
} from './observer';
import { patch, inDom } from '../utils';
import type { Mirror } from 'rrweb-snapshot';
import { isNativeShadowDom } from 'rrweb-snapshot';
import type { Mirror } from '@chromaui/rrweb-snapshot';
import { isNativeShadowDom } from '@chromaui/rrweb-snapshot';
import dom from '@rrweb/utils';

type BypassOptions = Omit<
Expand Down
7 changes: 5 additions & 2 deletions packages/rrweb/src/record/stylesheet-manager.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import type { elementNode, serializedNodeWithId } from 'rrweb-snapshot';
import { stringifyRule } from 'rrweb-snapshot';
import type {
elementNode,
serializedNodeWithId,
} from '@chromaui/rrweb-snapshot';
import { stringifyRule } from '@chromaui/rrweb-snapshot';
import type {
adoptedStyleSheetCallback,
adoptedStyleSheetParam,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { encode } from 'base64-arraybuffer';
import type { DataURLOptions } from 'rrweb-snapshot';
import type { DataURLOptions } from '@chromaui/rrweb-snapshot';
import type {
ImageBitmapDataURLWorkerParams,
ImageBitmapDataURLWorkerResponse,
Expand Down
2 changes: 1 addition & 1 deletion packages/rrweb/src/replay/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
type attributes,
type serializedElementNodeWithId,
toLowerCase,
} from 'rrweb-snapshot';
} from '@chromaui/rrweb-snapshot';
import {
RRDocument,
createOrGetNode,
Expand Down
2 changes: 1 addition & 1 deletion packages/rrweb/src/replay/media/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { type Emitter, MediaInteractions, ReplayerEvents } from '@rrweb/types';
import type { RRMediaElement } from 'rrdom';
import type { createPlayerService, createSpeedService } from '../machine';
import type { Mirror, mediaAttributes } from 'rrweb-snapshot';
import type { Mirror, mediaAttributes } from '@chromaui/rrweb-snapshot';
import type { mediaInteractionData } from '@rrweb/types';

type MediaState = {
Expand Down
2 changes: 1 addition & 1 deletion packages/rrweb/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type {
MaskInputFn,
MaskTextFn,
DataURLOptions,
} from 'rrweb-snapshot';
} from '@chromaui/rrweb-snapshot';
import type { IframeManager } from './record/iframe-manager';
import type { ShadowDomManager } from './record/shadow-dom-manager';
import type { Replayer } from './replay';
Expand Down
8 changes: 6 additions & 2 deletions packages/rrweb/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ import type {
DeprecatedMirror,
textMutation,
} from '@rrweb/types';
import type { IMirror, Mirror, SlimDOMOptions } from 'rrweb-snapshot';
import { isShadowRoot, IGNORED_NODE, classMatchesRegex } from 'rrweb-snapshot';
import type { IMirror, Mirror, SlimDOMOptions } from '@chromaui/rrweb-snapshot';
import {
isShadowRoot,
IGNORED_NODE,
classMatchesRegex,
} from '@chromaui/rrweb-snapshot';
import { RRNode, RRIFrameElement, BaseRRNode } from 'rrdom';
import dom from '@rrweb/utils';

Expand Down
2 changes: 1 addition & 1 deletion packages/rrweb/test/integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
} from './utils';
import type { recordOptions } from '../src/types';
import { eventWithTime, EventType, RecordPlugin } from '@rrweb/types';
import { visitSnapshot, NodeType } from 'rrweb-snapshot';
import { visitSnapshot, NodeType } from '@chromaui/rrweb-snapshot';

describe('record integration tests', function (this: ISuite) {
vi.setConfig({ testTimeout: 10_000 });
Expand Down
2 changes: 1 addition & 1 deletion packages/rrweb/test/record/webgl.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
stripBase64,
waitForRAF,
} from '../utils';
import type { ICanvas } from 'rrweb-snapshot';
import type { ICanvas } from '@chromaui/rrweb-snapshot';

interface ISuite {
code: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/rrweb/test/rrdom.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import { EventType, IncrementalSource, Replayer, eventWithTime } from '../src';
import { vi, type MockInstance } from 'vitest';
import type { styleDeclarationData, styleSheetRuleData } from '@rrweb/types';
import { createMirror, Mirror as NodeMirror } from 'rrweb-snapshot';
import { createMirror, Mirror as NodeMirror } from '@chromaui/rrweb-snapshot';
import type { ReplayerHandler } from 'rrdom';

describe('diff algorithm for rrdom', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/rrweb/test/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NodeType } from 'rrweb-snapshot';
import { NodeType } from '@chromaui/rrweb-snapshot';
import {
EventType,
IncrementalSource,
Expand Down
4 changes: 3 additions & 1 deletion packages/rrweb/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src"],
"include": [
"src"
],
"compilerOptions": {
"rootDir": "src",
"tsBuildInfoFile": "./tsconfig.tsbuildinfo",
Expand Down
2 changes: 1 addition & 1 deletion packages/types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"vite-plugin-dts": "^3.9.1"
},
"dependencies": {
"rrweb-snapshot": "^2.0.0-alpha.17"
"@chromaui/rrweb-snapshot": "2.0.0-alpha.17-noAbsolute"
},
"browserslist": [
"supports es6-class"
Expand Down
2 changes: 1 addition & 1 deletion packages/types/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type {
Mirror,
INode,
DataURLOptions,
} from 'rrweb-snapshot';
} from '@chromaui/rrweb-snapshot';

export enum EventType {
DomContentLoaded,
Expand Down
8 changes: 6 additions & 2 deletions packages/types/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src"],
"exclude": ["vite.config.ts"],
"include": [
"src"
],
"exclude": [
"vite.config.ts"
],
"compilerOptions": {
"rootDir": "src",
"tsBuildInfoFile": "./tsconfig.tsbuildinfo"
Expand Down

0 comments on commit 1c5bdfc

Please sign in to comment.