From a3f6ed832c18345580f5529cb418762eb59af597 Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Tue, 24 Jan 2023 09:28:57 -0500 Subject: [PATCH] publish(repo): Publish forked rrweb packages to NPM (#20) This patch adds the necessary configuration around our rrweb fork to publish our own `@sentry-internal/rr*` packages. This includes: - prefixing packages with `@sentry-internal` - adjusting licences and the readme - adding a craft config and a version bump script - adding artifact upload to our build&test GHA - adding the Sentry create release GHA --- .craft.yml | 15 +++ .github/workflows/ci-cd.yml | 37 ++++- .github/workflows/release.yml | 55 ++++---- LICENSE | 21 +++ README.md | 24 +++- packages/rrdom-nodejs/package.json | 4 +- packages/rrdom-nodejs/src/document-nodejs.ts | 4 +- .../rrdom-nodejs/test/document-nodejs.test.ts | 4 +- packages/rrdom-nodejs/tsconfig.json | 9 +- packages/rrdom/LICENSE | 42 ++++++ packages/rrdom/package.json | 7 +- packages/rrdom/rollup.config.js | 2 + packages/rrdom/src/diff.ts | 4 +- packages/rrdom/src/document.ts | 2 +- packages/rrdom/src/index.ts | 6 +- packages/rrdom/test/diff.test.ts | 8 +- packages/rrdom/test/document.test.ts | 2 +- packages/rrdom/test/virtual-dom.test.ts | 2 +- packages/rrdom/tsconfig.json | 9 +- packages/rrvideo/package.json | 10 +- packages/rrvideo/src/cli.ts | 2 +- packages/rrvideo/src/index.ts | 6 +- packages/rrvideo/test/events/example.ts | 4 +- packages/rrweb-player/LICENSE | 42 ++++++ packages/rrweb-player/package.json | 9 +- packages/rrweb-player/src/Controller.svelte | 127 +++++++++++++++++- packages/rrweb-player/src/Player.svelte | 20 ++- .../rrweb-player/src/components/Switch.svelte | 12 +- packages/rrweb-player/src/main.ts | 2 +- packages/rrweb-player/src/utils.ts | 8 +- packages/rrweb-player/tsconfig.json | 4 +- packages/rrweb-player/typings/index.d.ts | 8 +- packages/rrweb-snapshot/LICENSE | 42 ++++++ packages/rrweb-snapshot/package.json | 4 +- packages/rrweb-snapshot/test/utils.test.ts | 2 +- packages/rrweb/LICENSE | 42 ++++++ packages/rrweb/package.json | 11 +- packages/rrweb/src/index.ts | 2 +- packages/rrweb/src/packer/base.ts | 2 +- packages/rrweb/src/packer/unpack.ts | 2 +- .../rrweb/src/plugins/canvas-webrtc/Readme.md | 4 +- .../src/plugins/canvas-webrtc/record/index.ts | 7 +- .../src/plugins/canvas-webrtc/replay/index.ts | 4 +- .../rrweb/src/plugins/console/record/index.ts | 6 +- .../rrweb/src/plugins/console/replay/index.ts | 4 +- .../src/plugins/sequential-id/record/index.ts | 2 +- .../src/plugins/sequential-id/replay/index.ts | 2 +- .../src/record/cross-origin-iframe-mirror.ts | 2 +- packages/rrweb/src/record/iframe-manager.ts | 14 +- packages/rrweb/src/record/index.ts | 4 +- packages/rrweb/src/record/mutation.ts | 4 +- packages/rrweb/src/record/observer.ts | 4 +- .../rrweb/src/record/observers/canvas/2d.ts | 4 +- .../record/observers/canvas/canvas-manager.ts | 10 +- .../src/record/observers/canvas/canvas.ts | 8 +- .../record/observers/canvas/serialize-args.ts | 2 +- .../src/record/observers/canvas/webgl.ts | 4 +- .../rrweb/src/record/shadow-dom-manager.ts | 6 +- .../rrweb/src/record/stylesheet-manager.ts | 9 +- .../workers/image-bitmap-data-url-worker.ts | 4 +- packages/rrweb/src/replay/canvas/2d.ts | 2 +- .../src/replay/canvas/deserialize-args.ts | 5 +- packages/rrweb/src/replay/canvas/index.ts | 2 +- packages/rrweb/src/replay/canvas/webgl.ts | 5 +- packages/rrweb/src/replay/index.ts | 8 +- packages/rrweb/src/replay/machine.ts | 2 +- packages/rrweb/src/replay/timer.ts | 2 +- packages/rrweb/src/types.ts | 6 +- packages/rrweb/src/utils.ts | 12 +- .../rrweb/test/benchmark/dom-mutation.test.ts | 2 +- .../benchmark/replay-fast-forward.test.ts | 2 +- packages/rrweb/test/e2e/webgl.test.ts | 2 +- .../adopted-style-sheet-modification.ts | 4 +- .../rrweb/test/events/adopted-style-sheet.ts | 4 +- .../rrweb/test/events/canvas-in-iframe.ts | 4 +- .../events/custom-element-define-class.ts | 4 +- .../rrweb/test/events/document-replacement.ts | 4 +- packages/rrweb/test/events/hover.ts | 2 +- .../test/events/iframe-shadowdom-hover.ts | 4 +- packages/rrweb/test/events/iframe.ts | 4 +- packages/rrweb/test/events/input.ts | 4 +- packages/rrweb/test/events/ordering.ts | 4 +- packages/rrweb/test/events/scroll.ts | 4 +- packages/rrweb/test/events/selection.ts | 4 +- packages/rrweb/test/events/shadow-dom.ts | 4 +- .../test/events/style-sheet-rule-events.ts | 4 +- .../test/events/style-sheet-text-mutation.ts | 4 +- packages/rrweb/test/integration.test.ts | 4 +- packages/rrweb/test/machine.test.ts | 2 +- packages/rrweb/test/packer.test.ts | 2 +- packages/rrweb/test/record.test.ts | 2 +- .../test/record/cross-origin-iframes.test.ts | 4 +- .../rrweb/test/record/error-handler.test.ts | 2 +- packages/rrweb/test/record/webgl.test.ts | 4 +- .../test/replay/preload-all-images.test.ts | 2 +- .../rrweb/test/replay/webgl-mutation.test.ts | 2 +- packages/rrweb/test/replayer.test.ts | 2 +- packages/rrweb/test/utils.ts | 4 +- packages/types/package.json | 14 +- packages/types/src/index.ts | 2 +- packages/types/tsconfig.json | 13 +- packages/web-extension/package.json | 8 +- .../web-extension/src/background/index.ts | 2 +- packages/web-extension/src/content/index.ts | 2 +- packages/web-extension/src/content/inject.ts | 4 +- packages/web-extension/src/pages/Player.tsx | 2 +- packages/web-extension/src/types.ts | 2 +- packages/web-extension/src/utils/recording.ts | 2 +- packages/web-extension/src/utils/storage.ts | 2 +- packages/web-extension/tsconfig.json | 4 +- scripts/craft-pre-release.sh | 20 +++ 111 files changed, 699 insertions(+), 238 deletions(-) create mode 100644 .craft.yml create mode 100644 packages/rrdom/LICENSE create mode 100644 packages/rrweb-player/LICENSE create mode 100644 packages/rrweb-snapshot/LICENSE create mode 100644 packages/rrweb/LICENSE create mode 100755 scripts/craft-pre-release.sh diff --git a/.craft.yml b/.craft.yml new file mode 100644 index 0000000000..6032f44ad7 --- /dev/null +++ b/.craft.yml @@ -0,0 +1,15 @@ +github: + owner: getsentry + repo: rrweb +changelogPolicy: simple +preReleaseCommand: bash scripts/craft-pre-release.sh +requireNames: + - /^sentry-internal-rrweb-snapshot-.*\.tgz$/ + - /^sentry-internal-rrweb-player-.*\.tgz$/ + - /^sentry-internal-rrweb-.*\.tgz$/ + - /^sentry-internal-rrdom-.*\.tgz$/ +targets: + - name: github + includeNames: /^sentry-.*.tgz$/ + - name: npm + includeNames: /^sentry-.*.tgz$/ diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index a1ad8e81cf..0c0865c97c 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -1,11 +1,16 @@ -name: Tests +name: Build & Tests -on: [push, pull_request] +on: + push: + branches: + - master + - release/** + pull_request: concurrency: ${{ github.workflow }}-${{ github.ref }} jobs: - release: + job_test: name: Tests runs-on: ubuntu-latest steps: @@ -39,3 +44,29 @@ jobs: name: image-diff path: packages/rrweb/test/e2e/__image_snapshots__/__diff_output__/*.png if-no-files-found: ignore + + job_artifacts: + needs: job_test + name: Upload Artifacts + runs-on: ubuntu-latest + # Build artifacts are only needed for releasing workflow. + if: startsWith(github.ref, 'refs/heads/release/') + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + + - name: Set up Node + uses: volta-cli/action@v3 + + - name: Install Dependencies + run: yarn --frozen-lockfile + + - name: Build Tarballs + run: yarn build:tarball + + - name: Upload Artifacts + uses: actions/upload-artifact@v3 + with: + name: ${{ github.sha }} + path: | + ${{ github.workspace }}/packages/**/*.tgz diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1e895be580..e6335c507e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,39 +1,30 @@ -name: Release - +name: Prepare Release on: - push: - branches: - - master - -concurrency: ${{ github.workflow }}-${{ github.ref }} - + workflow_dispatch: + inputs: + version: + description: Version to release + required: true + force: + description: Force a release even when there are release-blockers (optional) + required: false + merge_target: + description: Target branch to merge into. Uses the default branch, sentry-v1, as a fallback (optional) + required: false jobs: release: - name: Release runs-on: ubuntu-latest + name: 'Release a new version' steps: - - name: Checkout Repo - uses: actions/checkout@v3 - - - name: Setup Node.js lts/* - uses: actions/setup-node@v3 + - uses: actions/checkout@v3 with: - node-version: lts/* - - - name: Install Dependencies - run: yarn - - - name: Create Release Pull Request or Publish to npm - id: changesets - uses: changesets/action@v1 - with: - publish: yarn run release + token: ${{ secrets.GH_RELEASE_PAT }} + fetch-depth: 0 + - name: Prepare release + uses: getsentry/action-prepare-release@v1 env: - NODE_OPTIONS: "--max-old-space-size=4096" - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - - # - name: Send a Slack notification if a publish happens - # if: steps.changesets.outputs.published == 'true' - # # You can do something when a publish happens. - # run: my-slack-bot send-notification --message "A new version of ${GITHUB_REPOSITORY} was published!" + GITHUB_TOKEN: ${{ secrets.GH_RELEASE_PAT }} + with: + version: ${{ github.event.inputs.version }} + force: ${{ github.event.inputs.force }} + merge_target: ${{ github.event.inputs.merge_target }} diff --git a/LICENSE b/LICENSE index fce28eb837..1b6395aae4 100644 --- a/LICENSE +++ b/LICENSE @@ -1,3 +1,5 @@ +This project is forked from rrweb-io/rrweb (https://github.com/rrweb-io/rrweb) under the MIT license: + MIT License Copyright (c) 2018 Contributors (https://github.com/rrweb-io/rrweb/graphs/contributors) and SmartX Inc. @@ -19,3 +21,22 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Our modifications to this project are also released under the MIT license: + +Copyright (c) 2023 Functional Software, Inc. dba Sentry + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software +and associated documentation files (the "Software"), to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, publish, distribute, +sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial +portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT +NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md index 697cbcdabb..60c705e6bd 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,30 @@ +

+ + Sentry + +

+ +# Sentry rrweb Fork + +This repo is a fork of [rrweb](https://github.com/rrweb-io/rrweb). The purpose is to apply patches and bugfixes to rrweb and release Sentry-internal packages with our patches included. All credits and attribution for rrweb go to the original creators of the library and all its contributors. + +From this monorepo, Sentry maintains and publishes the following NPM packages: + +- `@sentry-internal/rrweb` (corresponds to the [original `rrweb` package](https://www.npmjs.com/package/rrweb)) +- `@sentry-internal/rrdom` (corresponds to the [original `rrdom` package](https://www.npmjs.com/package/rrdom)) +- `@sentry-internal/rrweb-player` (corresponds to the [original `rrweb-player` package](https://www.npmjs.com/package/rrweb-player)) +- `@sentry-internal/rrweb-snapshot` (corresponds to the [original `rrweb-snapshot` package](https://www.npmjs.com/package/rrweb-snapshot)) + +# rrweb +

- Try rrweb + Check out the original rrweb Repo +

+

+ rrweb.io

# rrweb diff --git a/packages/rrdom-nodejs/package.json b/packages/rrdom-nodejs/package.json index 9e2b8d23b2..c70047a5b0 100644 --- a/packages/rrdom-nodejs/package.json +++ b/packages/rrdom-nodejs/package.json @@ -48,8 +48,8 @@ "cssom": "^0.5.0", "cssstyle": "^2.3.0", "nwsapi": "^2.2.0", - "rrdom": "^2.0.0-alpha.9", - "rrweb-snapshot": "^2.0.0-alpha.9" + "@sentry-internal/rrdom": "^2.0.0-alpha.9", + "@sentry-internal/rrweb-snapshot": "^2.0.0-alpha.9" }, "browserslist": [ "supports es6-class" diff --git a/packages/rrdom-nodejs/src/document-nodejs.ts b/packages/rrdom-nodejs/src/document-nodejs.ts index 1d13970d34..b7b796444a 100644 --- a/packages/rrdom-nodejs/src/document-nodejs.ts +++ b/packages/rrdom-nodejs/src/document-nodejs.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ -import { NodeType as RRNodeType } from 'rrweb-snapshot'; +import { NodeType as RRNodeType } from '@sentry-internal/rrweb-snapshot'; import type { NWSAPI } from 'nwsapi'; import type { CSSStyleDeclaration as CSSStyleDeclarationType } from 'cssstyle'; import { @@ -14,7 +14,7 @@ import { ClassList, IRRDocument, CSSStyleDeclaration, -} from 'rrdom'; +} from '@sentry-internal/rrdom'; // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-var-requires const nwsapi = require('nwsapi'); // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-var-requires diff --git a/packages/rrdom-nodejs/test/document-nodejs.test.ts b/packages/rrdom-nodejs/test/document-nodejs.test.ts index ba3c6144d8..b42fc59098 100644 --- a/packages/rrdom-nodejs/test/document-nodejs.test.ts +++ b/packages/rrdom-nodejs/test/document-nodejs.test.ts @@ -3,7 +3,7 @@ */ import * as fs from 'fs'; import * as path from 'path'; -import { NodeType as RRNodeType } from 'rrweb-snapshot'; +import { NodeType as RRNodeType } from '@sentry-internal/rrweb-snapshot'; import { RRCanvasElement, RRCDATASection, @@ -16,7 +16,7 @@ import { RRStyleElement, RRText, } from '../src/document-nodejs'; -import { buildFromDom } from 'rrdom'; +import { buildFromDom } from '@sentry-internal/rrdom'; describe('RRDocument for nodejs environment', () => { describe('RRDocument API', () => { diff --git a/packages/rrdom-nodejs/tsconfig.json b/packages/rrdom-nodejs/tsconfig.json index 0c2f119853..88f7b03681 100644 --- a/packages/rrdom-nodejs/tsconfig.json +++ b/packages/rrdom-nodejs/tsconfig.json @@ -10,13 +10,18 @@ "sourceMap": true, "rootDir": "src", "outDir": "build", - "lib": ["es6", "dom"], + "lib": [ + "es6", + "dom" + ], "skipLibCheck": true, "declaration": true, "importsNotUsedAsValues": "error" }, "compileOnSave": true, - "exclude": ["test"], + "exclude": [ + "test" + ], "include": [ "src", "test.d.ts", diff --git a/packages/rrdom/LICENSE b/packages/rrdom/LICENSE new file mode 100644 index 0000000000..1b6395aae4 --- /dev/null +++ b/packages/rrdom/LICENSE @@ -0,0 +1,42 @@ +This project is forked from rrweb-io/rrweb (https://github.com/rrweb-io/rrweb) under the MIT license: + +MIT License + +Copyright (c) 2018 Contributors (https://github.com/rrweb-io/rrweb/graphs/contributors) and SmartX Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +Our modifications to this project are also released under the MIT license: + +Copyright (c) 2023 Functional Software, Inc. dba Sentry + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software +and associated documentation files (the "Software"), to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, publish, distribute, +sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial +portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT +NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/packages/rrdom/package.json b/packages/rrdom/package.json index 04bbbbad0a..6466c419a4 100644 --- a/packages/rrdom/package.json +++ b/packages/rrdom/package.json @@ -1,5 +1,5 @@ { - "name": "rrdom", + "name": "@sentry-internal/rrdom", "version": "2.0.0-alpha.9", "homepage": "https://github.com/rrweb-io/rrweb/tree/main/packages/rrdom#readme", "license": "MIT", @@ -20,6 +20,7 @@ }, "scripts": { "dev": "rollup -c -w", + "build:tarball": "npm pack", "bundle": "rollup --config", "bundle:es-only": "cross-env ES_ONLY=true rollup --config", "check-types": "tsc -noEmit", @@ -32,7 +33,7 @@ }, "devDependencies": { "@rollup/plugin-commonjs": "^20.0.0", - "@rrweb/types": "^2.0.0-alpha.9", + "@sentry-internal/rrweb-types": "^2.0.0-alpha.9", "@types/jest": "^27.4.1", "@types/puppeteer": "^5.4.4", "@typescript-eslint/eslint-plugin": "^5.23.0", @@ -47,6 +48,6 @@ "ts-jest": "^27.1.3" }, "dependencies": { - "rrweb-snapshot": "^2.0.0-alpha.9" + "@sentry-internal/rrweb-snapshot": "^2.0.0-alpha.9" } } diff --git a/packages/rrdom/rollup.config.js b/packages/rrdom/rollup.config.js index 5bd346673f..af7d6fa597 100644 --- a/packages/rrdom/rollup.config.js +++ b/packages/rrdom/rollup.config.js @@ -55,6 +55,7 @@ for (let config of baseConfigs) { name: config.name, format: 'iife', file: pkg.unpkg.replace(pkg.name, config.path), + extend: true, }, ], }, @@ -67,6 +68,7 @@ for (let config of baseConfigs) { format: 'iife', file: toMinPath(pkg.unpkg).replace(pkg.name, config.path), sourcemap: true, + extend: true, }, ], }, diff --git a/packages/rrdom/src/diff.ts b/packages/rrdom/src/diff.ts index f37f298106..f530259e11 100644 --- a/packages/rrdom/src/diff.ts +++ b/packages/rrdom/src/diff.ts @@ -2,7 +2,7 @@ import { NodeType as RRNodeType, Mirror as NodeMirror, elementNode, -} from 'rrweb-snapshot'; +} from '@sentry-internal/rrweb-snapshot'; import type { canvasMutationData, canvasEventWithTime, @@ -10,7 +10,7 @@ import type { scrollData, styleDeclarationData, styleSheetRuleData, -} from '@rrweb/types'; +} from '@sentry-internal/rrweb-types'; import type { IRRCDATASection, IRRComment, diff --git a/packages/rrdom/src/document.ts b/packages/rrdom/src/document.ts index a053009a76..12373dd502 100644 --- a/packages/rrdom/src/document.ts +++ b/packages/rrdom/src/document.ts @@ -1,4 +1,4 @@ -import { NodeType as RRNodeType } from 'rrweb-snapshot'; +import { NodeType as RRNodeType } from '@sentry-internal/rrweb-snapshot'; import { parseCSSText, camelize, toCSSText } from './style'; export interface IRRNode { parentElement: IRRNode | null; diff --git a/packages/rrdom/src/index.ts b/packages/rrdom/src/index.ts index eeddb03e1c..f1e9323c3a 100644 --- a/packages/rrdom/src/index.ts +++ b/packages/rrdom/src/index.ts @@ -1,12 +1,12 @@ import { NodeType as RRNodeType, createMirror as createNodeMirror, -} from 'rrweb-snapshot'; +} from '@sentry-internal/rrweb-snapshot'; import type { Mirror as NodeMirror, IMirror, serializedNodeWithId, -} from 'rrweb-snapshot'; +} from '@sentry-internal/rrweb-snapshot'; import type { canvasMutationData, canvasEventWithTime, @@ -14,7 +14,7 @@ import type { scrollData, styleSheetRuleData, styleDeclarationData, -} from '@rrweb/types'; +} from '@sentry-internal/rrweb-types'; import { BaseRRNode as RRNode, BaseRRCDATASectionImpl, diff --git a/packages/rrdom/test/diff.test.ts b/packages/rrdom/test/diff.test.ts index 3f18a6ee7e..c418adf870 100644 --- a/packages/rrdom/test/diff.test.ts +++ b/packages/rrdom/test/diff.test.ts @@ -8,7 +8,7 @@ import { serializedNodeWithId, createMirror, Mirror as NodeMirror, -} from 'rrweb-snapshot'; +} from '@sentry-internal/rrweb-snapshot'; import { buildFromDom, getDefaultSN, @@ -25,14 +25,14 @@ import { sameNodeType, } from '../src/diff'; import type { IRRElement, IRRNode } from '../src/document'; -import { Replayer } from 'rrweb'; +import { Replayer } from '@sentry-internal/rrweb'; import type { eventWithTime, canvasMutationData, styleDeclarationData, styleSheetRuleData, -} from '@rrweb/types'; -import { EventType, IncrementalSource } from '@rrweb/types'; +} from '@sentry-internal/rrweb-types'; +import { EventType, IncrementalSource } from '@sentry-internal/rrweb-types'; import { compileTSCode } from './utils'; const elementSn = { diff --git a/packages/rrdom/test/document.test.ts b/packages/rrdom/test/document.test.ts index 38a35e505f..d0cd27a49d 100644 --- a/packages/rrdom/test/document.test.ts +++ b/packages/rrdom/test/document.test.ts @@ -1,7 +1,7 @@ /** * @jest-environment jsdom */ -import { NodeType as RRNodeType } from 'rrweb-snapshot'; +import { NodeType as RRNodeType } from '@sentry-internal/rrweb-snapshot'; import { BaseRRDocumentImpl, BaseRRDocumentTypeImpl, diff --git a/packages/rrdom/test/virtual-dom.test.ts b/packages/rrdom/test/virtual-dom.test.ts index b99aca5ae4..4d3cfe4750 100644 --- a/packages/rrdom/test/virtual-dom.test.ts +++ b/packages/rrdom/test/virtual-dom.test.ts @@ -15,7 +15,7 @@ import { NodeType, NodeType as RRNodeType, textNode, -} from 'rrweb-snapshot'; +} from '@sentry-internal/rrweb-snapshot'; import { buildFromDom, buildFromNode, diff --git a/packages/rrdom/tsconfig.json b/packages/rrdom/tsconfig.json index 450e56e151..ed182cbd3f 100644 --- a/packages/rrdom/tsconfig.json +++ b/packages/rrdom/tsconfig.json @@ -10,7 +10,10 @@ "sourceMap": true, "rootDir": "src", "outDir": "build", - "lib": ["es6", "dom"], + "lib": [ + "es6", + "dom" + ], "skipLibCheck": true, "declaration": true, "importsNotUsedAsValues": "error" @@ -24,7 +27,9 @@ } ], "compileOnSave": true, - "exclude": ["test"], + "exclude": [ + "test" + ], "include": [ "src", "../rrweb/src/record/workers/workers.d.ts", diff --git a/packages/rrvideo/package.json b/packages/rrvideo/package.json index c654da461f..2e52115278 100644 --- a/packages/rrvideo/package.json +++ b/packages/rrvideo/package.json @@ -1,5 +1,5 @@ { - "name": "rrvideo", + "name": "@sentry-internal/rrvideo", "version": "2.0.0-alpha.9", "description": "transform rrweb session into video", "main": "build/index.js", @@ -20,19 +20,19 @@ "author": "yanzhen@smartx.com", "license": "MIT", "devDependencies": { + "@sentry-internal/rrweb-types": "^2.0.0-alpha.9", "@types/fs-extra": "11.0.1", "@types/jest": "^27.4.1", "@types/minimist": "^1.2.1", "@types/node": "^18.15.11", "jest": "^27.5.1", - "ts-jest": "^27.1.3", - "@rrweb/types": "^2.0.0-alpha.9" + "ts-jest": "^27.1.3" }, "dependencies": { "@open-tech-world/cli-progress-bar": "^2.0.2", + "@sentry-internal/rrweb-player": "^2.0.0-alpha.9", "fs-extra": "^11.1.1", "minimist": "^1.2.5", - "playwright": "^1.32.1", - "rrweb-player": "^2.0.0-alpha.9" + "playwright": "^1.32.1" } } diff --git a/packages/rrvideo/src/cli.ts b/packages/rrvideo/src/cli.ts index 600c531a23..e1e716b69e 100644 --- a/packages/rrvideo/src/cli.ts +++ b/packages/rrvideo/src/cli.ts @@ -3,7 +3,7 @@ import * as fs from 'fs'; import * as path from 'path'; import minimist from 'minimist'; import { ProgressBar } from '@open-tech-world/cli-progress-bar'; -import type { RRwebPlayerOptions } from 'rrweb-player'; +import type { RRwebPlayerOptions } from '@sentry-internal/rrweb-player'; import { transformToVideo } from './index'; const argv = minimist(process.argv.slice(2)); diff --git a/packages/rrvideo/src/index.ts b/packages/rrvideo/src/index.ts index 0909746929..ed81abe0ce 100644 --- a/packages/rrvideo/src/index.ts +++ b/packages/rrvideo/src/index.ts @@ -1,11 +1,11 @@ import * as fs from 'fs-extra'; import * as path from 'path'; import { chromium } from 'playwright'; -import { EventType, eventWithTime } from '@rrweb/types'; -import type { RRwebPlayerOptions } from 'rrweb-player'; +import { EventType, eventWithTime } from '@sentry-internal/rrweb-types'; +import type { RRwebPlayerOptions } from '@sentry-internal/rrweb-player'; const rrwebScriptPath = path.resolve( - require.resolve('rrweb-player'), + require.resolve('@sentry-internal/rrweb-player'), '../../dist/index.js', ); const rrwebStylePath = path.resolve(rrwebScriptPath, '../style.css'); diff --git a/packages/rrvideo/test/events/example.ts b/packages/rrvideo/test/events/example.ts index 00701fd6ca..aac875ca9b 100644 --- a/packages/rrvideo/test/events/example.ts +++ b/packages/rrvideo/test/events/example.ts @@ -1,5 +1,5 @@ -import { EventType, IncrementalSource } from '@rrweb/types'; -import type { eventWithTime } from '@rrweb/types'; +import { EventType, IncrementalSource } from '@sentry-internal/rrweb-types'; +import type { eventWithTime } from '@sentry-internal/rrweb-types'; const now = Date.now(); const events: eventWithTime[] = [ diff --git a/packages/rrweb-player/LICENSE b/packages/rrweb-player/LICENSE new file mode 100644 index 0000000000..1b6395aae4 --- /dev/null +++ b/packages/rrweb-player/LICENSE @@ -0,0 +1,42 @@ +This project is forked from rrweb-io/rrweb (https://github.com/rrweb-io/rrweb) under the MIT license: + +MIT License + +Copyright (c) 2018 Contributors (https://github.com/rrweb-io/rrweb/graphs/contributors) and SmartX Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +Our modifications to this project are also released under the MIT license: + +Copyright (c) 2023 Functional Software, Inc. dba Sentry + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software +and associated documentation files (the "Software"), to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, publish, distribute, +sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial +portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT +NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/packages/rrweb-player/package.json b/packages/rrweb-player/package.json index 5536cc6b12..c7818cde6e 100644 --- a/packages/rrweb-player/package.json +++ b/packages/rrweb-player/package.json @@ -1,10 +1,10 @@ { - "name": "rrweb-player", + "name": "@sentry-internal/rrweb-player", "version": "2.0.0-alpha.9", "devDependencies": { "@rollup/plugin-commonjs": "^22.0.0", "@rollup/plugin-node-resolve": "^13.2.1", - "@rrweb/types": "^2.0.0-alpha.9", + "@sentry-internal/rrweb-types": "^2.0.0-alpha.9", "@types/offscreencanvas": "^2019.6.4", "eslint-config-google": "^0.14.0", "eslint-plugin-svelte3": "^4.0.0", @@ -24,10 +24,11 @@ }, "dependencies": { "@tsconfig/svelte": "^1.0.0", - "rrweb": "^2.0.0-alpha.9" + "@sentry-internal/rrweb": "^2.0.0-alpha.9" }, "scripts": { "build": "rollup -c", + "build:tarball": "npm pack", "dev": "rollup -c -w", "prepublishOnly": "yarn build", "start": "sirv public", @@ -51,7 +52,7 @@ "url": "git+https://github.com/rrweb-io/rrweb.git" }, "keywords": [ - "rrweb" + "@sentry-internal/rrweb" ], "author": "yanzhen@smartx.com", "license": "MIT", diff --git a/packages/rrweb-player/src/Controller.svelte b/packages/rrweb-player/src/Controller.svelte index 5a352e6dd0..cb2dbb19e4 100644 --- a/packages/rrweb-player/src/Controller.svelte +++ b/packages/rrweb-player/src/Controller.svelte @@ -1,11 +1,11 @@ +{#if showController} +
+
+ {formatTime(currentTime)} +
handleProgressClick(event)} + > +
+ {#each customEvents as event} +
+ {/each} + +
+
+ {formatTime(meta.totalTime)} +
+
+ + {#each speedOption as s} + + {/each} + + +
+
+{/if} + - -
- -
diff --git a/packages/rrweb-player/src/main.ts b/packages/rrweb-player/src/main.ts index df0568912d..6ed5d33214 100644 --- a/packages/rrweb-player/src/main.ts +++ b/packages/rrweb-player/src/main.ts @@ -1,4 +1,4 @@ -import type { eventWithTime } from '@rrweb/types'; +import type { eventWithTime } from '@sentry-internal/rrweb-types'; import _Player from './Player.svelte'; type PlayerProps = { diff --git a/packages/rrweb-player/src/utils.ts b/packages/rrweb-player/src/utils.ts index 2a3f29219c..d113d95a54 100644 --- a/packages/rrweb-player/src/utils.ts +++ b/packages/rrweb-player/src/utils.ts @@ -15,8 +15,8 @@ declare global { } } -import { EventType, IncrementalSource } from 'rrweb'; -import type { eventWithTime } from '@rrweb/types'; +import { EventType, IncrementalSource } from '@sentry-internal/rrweb'; +import type { eventWithTime } from '@sentry-internal/rrweb-types'; export function inlineCss(cssObj: Record): string { let style = ''; @@ -146,7 +146,7 @@ export function typeOf( } /** - * Forked from 'rrweb' replay/index.ts. The original function is not exported. + * Forked from '@sentry-internal/rrweb' replay/index.ts. The original function is not exported. * Determine whether the event is a user interaction event * @param event - event to be determined * @returns true if the event is a user interaction event @@ -161,7 +161,7 @@ function isUserInteraction(event: eventWithTime): boolean { ); } -// Forked from 'rrweb' replay/index.ts. A const threshold of inactive time. +// Forked from '@sentry-internal/rrweb' replay/index.ts. A const threshold of inactive time. const SKIP_TIME_THRESHOLD = 10 * 1000; /** diff --git a/packages/rrweb-player/tsconfig.json b/packages/rrweb-player/tsconfig.json index 7255820373..4b7d4a575a 100644 --- a/packages/rrweb-player/tsconfig.json +++ b/packages/rrweb-player/tsconfig.json @@ -1,6 +1,8 @@ { "extends": "@tsconfig/svelte/tsconfig.json", - "include": ["src/**/*"], + "include": [ + "src/**/*" + ], "exclude": [ "node_modules/*", "__sapper__/*", diff --git a/packages/rrweb-player/typings/index.d.ts b/packages/rrweb-player/typings/index.d.ts index e76b493e6f..ec923c3aa7 100755 --- a/packages/rrweb-player/typings/index.d.ts +++ b/packages/rrweb-player/typings/index.d.ts @@ -1,7 +1,7 @@ -import { playerConfig } from 'rrweb/typings/types'; -import { eventWithTime } from '@rrweb/types'; -import { Replayer } from 'rrweb'; -import { Mirror } from 'rrweb-snapshot'; +import { playerConfig } from '@sentry-internal/rrweb/typings/types'; +import { eventWithTime } from '@sentry-internal/rrweb-types'; +import { Replayer } from '@sentry-internal/rrweb'; +import { Mirror } from '@sentry-internal/rrweb-snapshot'; import { SvelteComponent } from 'svelte'; export type RRwebPlayerOptions = { diff --git a/packages/rrweb-snapshot/LICENSE b/packages/rrweb-snapshot/LICENSE new file mode 100644 index 0000000000..1b6395aae4 --- /dev/null +++ b/packages/rrweb-snapshot/LICENSE @@ -0,0 +1,42 @@ +This project is forked from rrweb-io/rrweb (https://github.com/rrweb-io/rrweb) under the MIT license: + +MIT License + +Copyright (c) 2018 Contributors (https://github.com/rrweb-io/rrweb/graphs/contributors) and SmartX Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +Our modifications to this project are also released under the MIT license: + +Copyright (c) 2023 Functional Software, Inc. dba Sentry + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software +and associated documentation files (the "Software"), to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, publish, distribute, +sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial +portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT +NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/packages/rrweb-snapshot/package.json b/packages/rrweb-snapshot/package.json index 4fc2fda5d6..990b29d49b 100644 --- a/packages/rrweb-snapshot/package.json +++ b/packages/rrweb-snapshot/package.json @@ -1,5 +1,5 @@ { - "name": "rrweb-snapshot", + "name": "@sentry-internal/rrweb-snapshot", "version": "2.0.0-alpha.9", "description": "rrweb's component to take a snapshot of DOM, aka DOM serializer", "scripts": { @@ -21,7 +21,7 @@ "url": "git+https://github.com/rrweb-io/rrweb.git" }, "keywords": [ - "rrweb", + "@sentry-internal/rrweb", "snapshot", "DOM" ], diff --git a/packages/rrweb-snapshot/test/utils.test.ts b/packages/rrweb-snapshot/test/utils.test.ts index 09a2bebd4d..c35906d55b 100644 --- a/packages/rrweb-snapshot/test/utils.test.ts +++ b/packages/rrweb-snapshot/test/utils.test.ts @@ -3,7 +3,7 @@ */ import { NodeType, serializedNode } from '../src/types'; import { isNodeMetaEqual } from '../src/utils'; -import { serializedNodeWithId } from 'rrweb-snapshot'; +import { serializedNodeWithId } from '@sentry-internal/rrweb-snapshot'; describe('utils', () => { describe('isNodeMetaEqual()', () => { diff --git a/packages/rrweb/LICENSE b/packages/rrweb/LICENSE new file mode 100644 index 0000000000..1b6395aae4 --- /dev/null +++ b/packages/rrweb/LICENSE @@ -0,0 +1,42 @@ +This project is forked from rrweb-io/rrweb (https://github.com/rrweb-io/rrweb) under the MIT license: + +MIT License + +Copyright (c) 2018 Contributors (https://github.com/rrweb-io/rrweb/graphs/contributors) and SmartX Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +Our modifications to this project are also released under the MIT license: + +Copyright (c) 2023 Functional Software, Inc. dba Sentry + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software +and associated documentation files (the "Software"), to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, publish, distribute, +sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial +portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT +NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/packages/rrweb/package.json b/packages/rrweb/package.json index 9b50b2fdb4..574d19c61b 100644 --- a/packages/rrweb/package.json +++ b/packages/rrweb/package.json @@ -1,5 +1,5 @@ { - "name": "rrweb", + "name": "@sentry-internal/rrweb", "version": "2.0.0-alpha.9", "description": "record and replay the web", "scripts": { @@ -15,6 +15,7 @@ "repl": "yarn bundle:browser && node scripts/repl.js", "live-stream": "yarn bundle:browser && node scripts/stream.js", "dev": "yarn bundle:browser --watch", + "build:tarball": "npm pack", "bundle:browser": "cross-env BROWSER_ONLY=true rollup --config", "bundle": "rollup --config", "typings": "tsc -d --declarationDir typings", @@ -29,7 +30,7 @@ "url": "git+ssh://git@github.com/rrweb-io/rrweb.git" }, "keywords": [ - "rrweb" + "@sentry-internal/rrweb" ], "main": "lib/rrweb-all.cjs", "module": "es/rrweb/packages/rrweb/src/entries/all.js", @@ -81,13 +82,13 @@ "tslib": "^2.3.1" }, "dependencies": { - "@rrweb/types": "^2.0.0-alpha.9", + "@sentry-internal/rrweb-types": "^2.0.0-alpha.9", "@types/css-font-loading-module": "0.0.7", "@xstate/fsm": "^1.4.0", "base64-arraybuffer": "^1.0.1", "fflate": "^0.4.4", "mitt": "^3.0.0", - "rrdom": "^2.0.0-alpha.9", - "rrweb-snapshot": "^2.0.0-alpha.9" + "@sentry-internal/rrdom": "^2.0.0-alpha.9", + "@sentry-internal/rrweb-snapshot": "^2.0.0-alpha.9" } } diff --git a/packages/rrweb/src/index.ts b/packages/rrweb/src/index.ts index ecc1695909..d8be9b2d20 100644 --- a/packages/rrweb/src/index.ts +++ b/packages/rrweb/src/index.ts @@ -8,7 +8,7 @@ export { IncrementalSource, MouseInteractions, ReplayerEvents, -} from '@rrweb/types'; +} from '@sentry-internal/rrweb-types'; export type { recordOptions } from './types'; diff --git a/packages/rrweb/src/packer/base.ts b/packages/rrweb/src/packer/base.ts index ac6ee9a337..a0db28fae4 100644 --- a/packages/rrweb/src/packer/base.ts +++ b/packages/rrweb/src/packer/base.ts @@ -1,4 +1,4 @@ -import type { eventWithTime } from '@rrweb/types'; +import type { eventWithTime } from '@sentry-internal/rrweb-types'; export type PackFn = (event: eventWithTime) => string; export type UnpackFn = (raw: string) => eventWithTime; diff --git a/packages/rrweb/src/packer/unpack.ts b/packages/rrweb/src/packer/unpack.ts index 0c4bf252d1..f2a607ca97 100644 --- a/packages/rrweb/src/packer/unpack.ts +++ b/packages/rrweb/src/packer/unpack.ts @@ -1,6 +1,6 @@ import { strFromU8, strToU8, unzlibSync } from 'fflate'; import { UnpackFn, eventWithTimeAndPacker, MARK } from './base'; -import type { eventWithTime } from '@rrweb/types'; +import type { eventWithTime } from '@sentry-internal/rrweb-types'; export const unpack: UnpackFn = (raw: string) => { if (typeof raw !== 'string') { diff --git a/packages/rrweb/src/plugins/canvas-webrtc/Readme.md b/packages/rrweb/src/plugins/canvas-webrtc/Readme.md index 520da44c0c..9e8c0e1e80 100644 --- a/packages/rrweb/src/plugins/canvas-webrtc/Readme.md +++ b/packages/rrweb/src/plugins/canvas-webrtc/Readme.md @@ -13,7 +13,7 @@ https://user-images.githubusercontent.com/4106/186701616-fd71a107-5d53-423c-ba09 ```js // Record side -import rrweb from 'rrweb'; +import rrweb from '@sentry-internal/rrweb'; import { RRWebPluginCanvasWebRTCRecord } from 'rrweb-plugin-canvas-webrtc-record'; const webRTCRecordPlugin = new RRWebPluginCanvasWebRTCRecord({ @@ -42,7 +42,7 @@ rrweb.record({ ```js // Replay side -import rrweb from 'rrweb'; +import rrweb from '@sentry-internal/rrweb'; import { RRWebPluginCanvasWebRTCReplay } from 'rrweb-plugin-canvas-webrtc-replay'; const webRTCReplayPlugin = new RRWebPluginCanvasWebRTCReplay({ diff --git a/packages/rrweb/src/plugins/canvas-webrtc/record/index.ts b/packages/rrweb/src/plugins/canvas-webrtc/record/index.ts index 03aad10c9c..f6b8ab444a 100644 --- a/packages/rrweb/src/plugins/canvas-webrtc/record/index.ts +++ b/packages/rrweb/src/plugins/canvas-webrtc/record/index.ts @@ -1,6 +1,9 @@ -import type { Mirror } from 'rrweb-snapshot'; +import type { Mirror } from '@sentry-internal/rrweb-snapshot'; import SimplePeer from 'simple-peer-light'; -import type { RecordPlugin, ICrossOriginIframeMirror } from '@rrweb/types'; +import type { + RecordPlugin, + ICrossOriginIframeMirror, +} from '@sentry-internal/rrweb-types'; import type { WebRTCDataChannel } from '../types'; export const PLUGIN_NAME = 'rrweb/canvas-webrtc@1'; diff --git a/packages/rrweb/src/plugins/canvas-webrtc/replay/index.ts b/packages/rrweb/src/plugins/canvas-webrtc/replay/index.ts index 45a1297043..79833b253f 100644 --- a/packages/rrweb/src/plugins/canvas-webrtc/replay/index.ts +++ b/packages/rrweb/src/plugins/canvas-webrtc/replay/index.ts @@ -1,5 +1,5 @@ -import type { RRNode } from 'rrdom'; -import type { Mirror } from 'rrweb-snapshot'; +import type { RRNode } from '@sentry-internal/rrdom'; +import type { Mirror } from '@sentry-internal/rrweb-snapshot'; import SimplePeer from 'simple-peer-light'; import type { Replayer } from '../../../replay'; import type { ReplayPlugin } from '../../../types'; diff --git a/packages/rrweb/src/plugins/console/record/index.ts b/packages/rrweb/src/plugins/console/record/index.ts index a3bd4d3843..f2863ccbbf 100644 --- a/packages/rrweb/src/plugins/console/record/index.ts +++ b/packages/rrweb/src/plugins/console/record/index.ts @@ -1,4 +1,8 @@ -import type { listenerHandler, RecordPlugin, IWindow } from '@rrweb/types'; +import type { + listenerHandler, + RecordPlugin, + IWindow, +} from '@sentry-internal/rrweb-types'; import { patch } from '../../../utils'; import { ErrorStackParser, StackFrame } from './error-stack-parser'; import { stringify } from './stringify'; diff --git a/packages/rrweb/src/plugins/console/replay/index.ts b/packages/rrweb/src/plugins/console/replay/index.ts index a0915fa6af..f9e1f61bfb 100644 --- a/packages/rrweb/src/plugins/console/replay/index.ts +++ b/packages/rrweb/src/plugins/console/replay/index.ts @@ -1,6 +1,6 @@ import { LogLevel, LogData, PLUGIN_NAME } from '../record'; -import type { eventWithTime } from '@rrweb/types'; -import { EventType, IncrementalSource } from '@rrweb/types'; +import type { eventWithTime } from '@sentry-internal/rrweb-types'; +import { EventType, IncrementalSource } from '@sentry-internal/rrweb-types'; import type { ReplayPlugin } from '../../../types'; /** diff --git a/packages/rrweb/src/plugins/sequential-id/record/index.ts b/packages/rrweb/src/plugins/sequential-id/record/index.ts index 140b9c7003..205e4fe6a6 100644 --- a/packages/rrweb/src/plugins/sequential-id/record/index.ts +++ b/packages/rrweb/src/plugins/sequential-id/record/index.ts @@ -1,4 +1,4 @@ -import type { RecordPlugin } from '@rrweb/types'; +import type { RecordPlugin } from '@sentry-internal/rrweb-types'; export type SequentialIdOptions = { key: string; diff --git a/packages/rrweb/src/plugins/sequential-id/replay/index.ts b/packages/rrweb/src/plugins/sequential-id/replay/index.ts index 0f3d94b820..fedaa3c90f 100644 --- a/packages/rrweb/src/plugins/sequential-id/replay/index.ts +++ b/packages/rrweb/src/plugins/sequential-id/replay/index.ts @@ -1,6 +1,6 @@ import type { SequentialIdOptions } from '../record'; import type { ReplayPlugin } from '../../../types'; -import type { eventWithTime } from '@rrweb/types'; +import type { eventWithTime } from '@sentry-internal/rrweb-types'; type Options = SequentialIdOptions & { warnOnMissingId: boolean; diff --git a/packages/rrweb/src/record/cross-origin-iframe-mirror.ts b/packages/rrweb/src/record/cross-origin-iframe-mirror.ts index 4e7a69326e..53ffc6c9ea 100644 --- a/packages/rrweb/src/record/cross-origin-iframe-mirror.ts +++ b/packages/rrweb/src/record/cross-origin-iframe-mirror.ts @@ -1,4 +1,4 @@ -import type { ICrossOriginIframeMirror } from '@rrweb/types'; +import type { ICrossOriginIframeMirror } from '@sentry-internal/rrweb-types'; export default class CrossOriginIframeMirror implements ICrossOriginIframeMirror { diff --git a/packages/rrweb/src/record/iframe-manager.ts b/packages/rrweb/src/record/iframe-manager.ts index 377b7bc0ff..8433a86424 100644 --- a/packages/rrweb/src/record/iframe-manager.ts +++ b/packages/rrweb/src/record/iframe-manager.ts @@ -1,9 +1,15 @@ -import type { Mirror, serializedNodeWithId } from 'rrweb-snapshot'; -import { genId, NodeType } from 'rrweb-snapshot'; +import type { + Mirror, + serializedNodeWithId, +} from '@sentry-internal/rrweb-snapshot'; +import { genId, NodeType } from '@sentry-internal/rrweb-snapshot'; import type { CrossOriginIframeMessageEvent } from '../types'; import CrossOriginIframeMirror from './cross-origin-iframe-mirror'; -import { EventType, IncrementalSource } from '@rrweb/types'; -import type { eventWithTime, mutationCallBack } from '@rrweb/types'; +import { EventType, IncrementalSource } from '@sentry-internal/rrweb-types'; +import type { + eventWithTime, + mutationCallBack, +} from '@sentry-internal/rrweb-types'; import type { StylesheetManager } from './stylesheet-manager'; export class IframeManager { diff --git a/packages/rrweb/src/record/index.ts b/packages/rrweb/src/record/index.ts index 94e198abc3..0c0158c30e 100644 --- a/packages/rrweb/src/record/index.ts +++ b/packages/rrweb/src/record/index.ts @@ -3,7 +3,7 @@ import { MaskInputOptions, SlimDOMOptions, createMirror, -} from 'rrweb-snapshot'; +} from '@sentry-internal/rrweb-snapshot'; import { initObservers, mutationBuffers } from './observer'; import { on, @@ -27,7 +27,7 @@ import { scrollCallback, canvasMutationParam, adoptedStyleSheetParam, -} from '@rrweb/types'; +} from '@sentry-internal/rrweb-types'; import type { CrossOriginIframeMessageEventContent } from '../types'; import { IframeManager } from './iframe-manager'; import { ShadowDomManager } from './shadow-dom-manager'; diff --git a/packages/rrweb/src/record/mutation.ts b/packages/rrweb/src/record/mutation.ts index 64dbff6004..701425c0d8 100644 --- a/packages/rrweb/src/record/mutation.ts +++ b/packages/rrweb/src/record/mutation.ts @@ -11,7 +11,7 @@ import { getInputType, toLowerCase, getInputValue, -} from 'rrweb-snapshot'; +} from '@sentry-internal/rrweb-snapshot'; import type { observerParam, MutationBufferParam } from '../types'; import type { mutationRecord, @@ -21,7 +21,7 @@ import type { addedNodeMutation, styleAttributeValue, Optional, -} from '@rrweb/types'; +} from '@sentry-internal/rrweb-types'; import { isBlocked, isAncestorRemoved, diff --git a/packages/rrweb/src/record/observer.ts b/packages/rrweb/src/record/observer.ts index 01f36e4b51..cd8ec9b0cd 100644 --- a/packages/rrweb/src/record/observer.ts +++ b/packages/rrweb/src/record/observer.ts @@ -7,7 +7,7 @@ import { toLowerCase, needMaskingText, toUpperCase, -} from 'rrweb-snapshot'; +} from '@sentry-internal/rrweb-snapshot'; import type { FontFaceSet } from 'css-font-loading-module'; import { throttle, @@ -50,7 +50,7 @@ import { SelectionRange, selectionCallback, customElementCallback, -} from '@rrweb/types'; +} from '@sentry-internal/rrweb-types'; import MutationBuffer from './mutation'; import { callbackWrapper } from './error-handler'; diff --git a/packages/rrweb/src/record/observers/canvas/2d.ts b/packages/rrweb/src/record/observers/canvas/2d.ts index d74a4edc0c..98d1d08576 100644 --- a/packages/rrweb/src/record/observers/canvas/2d.ts +++ b/packages/rrweb/src/record/observers/canvas/2d.ts @@ -1,11 +1,11 @@ -import type { Mirror } from 'rrweb-snapshot'; +import type { Mirror } from '@sentry-internal/rrweb-snapshot'; import { blockClass, CanvasContext, canvasManagerMutationCallback, IWindow, listenerHandler, -} from '@rrweb/types'; +} from '@sentry-internal/rrweb-types'; import { hookSetter, isBlocked, patch } from '../../../utils'; import { serializeArgs } from './serialize-args'; diff --git a/packages/rrweb/src/record/observers/canvas/canvas-manager.ts b/packages/rrweb/src/record/observers/canvas/canvas-manager.ts index ad6781dd58..c48ca7838f 100644 --- a/packages/rrweb/src/record/observers/canvas/canvas-manager.ts +++ b/packages/rrweb/src/record/observers/canvas/canvas-manager.ts @@ -1,4 +1,8 @@ -import type { ICanvas, Mirror, DataURLOptions } from 'rrweb-snapshot'; +import type { + ICanvas, + Mirror, + DataURLOptions, +} from '@sentry-internal/rrweb-snapshot'; import type { blockClass, canvasManagerMutationCallback, @@ -8,9 +12,9 @@ import type { IWindow, listenerHandler, CanvasArg, -} from '@rrweb/types'; +} from '@sentry-internal/rrweb-types'; import { isBlocked } from '../../../utils'; -import { CanvasContext } from '@rrweb/types'; +import { CanvasContext } from '@sentry-internal/rrweb-types'; import initCanvas2DMutationObserver from './2d'; import initCanvasContextObserver from './canvas'; import initCanvasWebGLMutationObserver from './webgl'; diff --git a/packages/rrweb/src/record/observers/canvas/canvas.ts b/packages/rrweb/src/record/observers/canvas/canvas.ts index 36408ec8cb..092fdf03f8 100644 --- a/packages/rrweb/src/record/observers/canvas/canvas.ts +++ b/packages/rrweb/src/record/observers/canvas/canvas.ts @@ -1,5 +1,9 @@ -import type { ICanvas } from 'rrweb-snapshot'; -import type { blockClass, IWindow, listenerHandler } from '@rrweb/types'; +import type { ICanvas } from '@sentry-internal/rrweb-snapshot'; +import type { + blockClass, + IWindow, + listenerHandler, +} from '@sentry-internal/rrweb-types'; import { isBlocked, patch } from '../../../utils'; export default function initCanvasContextObserver( diff --git a/packages/rrweb/src/record/observers/canvas/serialize-args.ts b/packages/rrweb/src/record/observers/canvas/serialize-args.ts index 32806fefef..fd386fc73f 100644 --- a/packages/rrweb/src/record/observers/canvas/serialize-args.ts +++ b/packages/rrweb/src/record/observers/canvas/serialize-args.ts @@ -1,5 +1,5 @@ import { encode } from 'base64-arraybuffer'; -import type { IWindow, CanvasArg } from '@rrweb/types'; +import type { IWindow, CanvasArg } from '@sentry-internal/rrweb-types'; // TODO: unify with `replay/webgl.ts` type CanvasVarMap = Map; diff --git a/packages/rrweb/src/record/observers/canvas/webgl.ts b/packages/rrweb/src/record/observers/canvas/webgl.ts index a5b026ab2c..3397dc6273 100644 --- a/packages/rrweb/src/record/observers/canvas/webgl.ts +++ b/packages/rrweb/src/record/observers/canvas/webgl.ts @@ -1,4 +1,4 @@ -import type { Mirror } from 'rrweb-snapshot'; +import type { Mirror } from '@sentry-internal/rrweb-snapshot'; import { blockClass, CanvasContext, @@ -6,7 +6,7 @@ import { canvasMutationWithType, IWindow, listenerHandler, -} from '@rrweb/types'; +} from '@sentry-internal/rrweb-types'; import { hookSetter, isBlocked, patch } from '../../../utils'; import { saveWebGLVar, serializeArgs } from './serialize-args'; diff --git a/packages/rrweb/src/record/shadow-dom-manager.ts b/packages/rrweb/src/record/shadow-dom-manager.ts index 169c77216a..9e15433da0 100644 --- a/packages/rrweb/src/record/shadow-dom-manager.ts +++ b/packages/rrweb/src/record/shadow-dom-manager.ts @@ -3,15 +3,15 @@ import type { mutationCallBack, scrollCallback, SamplingStrategy, -} from '@rrweb/types'; +} from '@sentry-internal/rrweb-types'; import { initMutationObserver, initScrollObserver, initAdoptedStyleSheetObserver, } from './observer'; import { patch, inDom } from '../utils'; -import type { Mirror } from 'rrweb-snapshot'; -import { isNativeShadowDom } from 'rrweb-snapshot'; +import type { Mirror } from '@sentry-internal/rrweb-snapshot'; +import { isNativeShadowDom } from '@sentry-internal/rrweb-snapshot'; type BypassOptions = Omit< MutationBufferParam, diff --git a/packages/rrweb/src/record/stylesheet-manager.ts b/packages/rrweb/src/record/stylesheet-manager.ts index 89c628768f..49df28ca62 100644 --- a/packages/rrweb/src/record/stylesheet-manager.ts +++ b/packages/rrweb/src/record/stylesheet-manager.ts @@ -1,11 +1,14 @@ -import type { elementNode, serializedNodeWithId } from 'rrweb-snapshot'; -import { getCssRuleString } from 'rrweb-snapshot'; +import type { + elementNode, + serializedNodeWithId, +} from '@sentry-internal/rrweb-snapshot'; +import { getCssRuleString } from '@sentry-internal/rrweb-snapshot'; import type { adoptedStyleSheetCallback, adoptedStyleSheetParam, attributeMutation, mutationCallBack, -} from '@rrweb/types'; +} from '@sentry-internal/rrweb-types'; import { StyleSheetMirror } from '../utils'; export class StylesheetManager { diff --git a/packages/rrweb/src/record/workers/image-bitmap-data-url-worker.ts b/packages/rrweb/src/record/workers/image-bitmap-data-url-worker.ts index 374edfe1b0..0d142409f4 100644 --- a/packages/rrweb/src/record/workers/image-bitmap-data-url-worker.ts +++ b/packages/rrweb/src/record/workers/image-bitmap-data-url-worker.ts @@ -1,9 +1,9 @@ import { encode } from 'base64-arraybuffer'; -import type { DataURLOptions } from 'rrweb-snapshot'; +import type { DataURLOptions } from '@sentry-internal/rrweb-snapshot'; import type { ImageBitmapDataURLWorkerParams, ImageBitmapDataURLWorkerResponse, -} from '@rrweb/types'; +} from '@sentry-internal/rrweb-types'; const lastBlobMap: Map = new Map(); const transparentBlobMap: Map = new Map(); diff --git a/packages/rrweb/src/replay/canvas/2d.ts b/packages/rrweb/src/replay/canvas/2d.ts index f9fefba226..75d30e9c20 100644 --- a/packages/rrweb/src/replay/canvas/2d.ts +++ b/packages/rrweb/src/replay/canvas/2d.ts @@ -1,5 +1,5 @@ import type { Replayer } from '../'; -import type { canvasMutationCommand } from '@rrweb/types'; +import type { canvasMutationCommand } from '@sentry-internal/rrweb-types'; import { deserializeArg } from './deserialize-args'; export default async function canvasMutation({ diff --git a/packages/rrweb/src/replay/canvas/deserialize-args.ts b/packages/rrweb/src/replay/canvas/deserialize-args.ts index a690d7986f..b10b7e353c 100644 --- a/packages/rrweb/src/replay/canvas/deserialize-args.ts +++ b/packages/rrweb/src/replay/canvas/deserialize-args.ts @@ -1,6 +1,9 @@ import { decode } from 'base64-arraybuffer'; import type { Replayer } from '../'; -import type { CanvasArg, SerializedCanvasArg } from '@rrweb/types'; +import type { + CanvasArg, + SerializedCanvasArg, +} from '@sentry-internal/rrweb-types'; // TODO: add ability to wipe this list type GLVarMap = Map; diff --git a/packages/rrweb/src/replay/canvas/index.ts b/packages/rrweb/src/replay/canvas/index.ts index 27cd165cd4..ef1994d27b 100644 --- a/packages/rrweb/src/replay/canvas/index.ts +++ b/packages/rrweb/src/replay/canvas/index.ts @@ -4,7 +4,7 @@ import { canvasMutationCommand, canvasMutationData, canvasMutationParam, -} from '@rrweb/types'; +} from '@sentry-internal/rrweb-types'; import webglMutation from './webgl'; import canvas2DMutation from './2d'; diff --git a/packages/rrweb/src/replay/canvas/webgl.ts b/packages/rrweb/src/replay/canvas/webgl.ts index 85ff81f8d6..28057e73f3 100644 --- a/packages/rrweb/src/replay/canvas/webgl.ts +++ b/packages/rrweb/src/replay/canvas/webgl.ts @@ -1,5 +1,8 @@ import type { Replayer } from '../'; -import { CanvasContext, canvasMutationCommand } from '@rrweb/types'; +import { + CanvasContext, + canvasMutationCommand, +} from '@sentry-internal/rrweb-types'; import { deserializeArg, variableListFor } from './deserialize-args'; function getContext( diff --git a/packages/rrweb/src/replay/index.ts b/packages/rrweb/src/replay/index.ts index aac84c2783..a5f26ac04a 100644 --- a/packages/rrweb/src/replay/index.ts +++ b/packages/rrweb/src/replay/index.ts @@ -9,7 +9,7 @@ import { attributes, serializedElementNodeWithId, toLowerCase, -} from 'rrweb-snapshot'; +} from '@sentry-internal/rrweb-snapshot'; import { RRDocument, createOrGetNode, @@ -17,7 +17,7 @@ import { buildFromDom, diff, getDefaultSN, -} from 'rrdom'; +} from '@sentry-internal/rrdom'; import type { RRNode, RRElement, @@ -27,7 +27,7 @@ import type { RRCanvasElement, ReplayerHandler, Mirror as RRDOMMirror, -} from 'rrdom'; +} from '@sentry-internal/rrdom'; import * as mittProxy from 'mitt'; import { polyfill as smoothscrollPolyfill } from './smoothscroll'; import { Timer } from './timer'; @@ -63,7 +63,7 @@ import { styleSheetRuleData, styleDeclarationData, adoptedStyleSheetData, -} from '@rrweb/types'; +} from '@sentry-internal/rrweb-types'; import { polyfill, queueToResolveTrees, diff --git a/packages/rrweb/src/replay/machine.ts b/packages/rrweb/src/replay/machine.ts index 07d948fdca..af444bc563 100644 --- a/packages/rrweb/src/replay/machine.ts +++ b/packages/rrweb/src/replay/machine.ts @@ -6,7 +6,7 @@ import { EventType, Emitter, IncrementalSource, -} from '@rrweb/types'; +} from '@sentry-internal/rrweb-types'; import { Timer, addDelay } from './timer'; export type PlayerContext = { diff --git a/packages/rrweb/src/replay/timer.ts b/packages/rrweb/src/replay/timer.ts index 0d18c3f870..325768e0a8 100644 --- a/packages/rrweb/src/replay/timer.ts +++ b/packages/rrweb/src/replay/timer.ts @@ -3,7 +3,7 @@ import { eventWithTime, EventType, IncrementalSource, -} from '@rrweb/types'; +} from '@sentry-internal/rrweb-types'; export class Timer { public timeOffset = 0; diff --git a/packages/rrweb/src/types.ts b/packages/rrweb/src/types.ts index 6286fad089..b0f4070cee 100644 --- a/packages/rrweb/src/types.ts +++ b/packages/rrweb/src/types.ts @@ -6,12 +6,12 @@ import type { MaskTextFn, DataURLOptions, MaskAttributeFn, -} from 'rrweb-snapshot'; +} from '@sentry-internal/rrweb-snapshot'; import type { PackFn, UnpackFn } from './packer/base'; import type { IframeManager } from './record/iframe-manager'; import type { ShadowDomManager } from './record/shadow-dom-manager'; import type { Replayer } from './replay'; -import type { RRNode } from 'rrdom'; +import type { RRNode } from '@sentry-internal/rrdom'; import type { CanvasManager } from './record/observers/canvas/canvas-manager'; import type { StylesheetManager } from './record/stylesheet-manager'; import type { @@ -39,7 +39,7 @@ import type { styleDeclarationCallback, styleSheetRuleCallback, viewportResizeCallback, -} from '@rrweb/types'; +} from '@sentry-internal/rrweb-types'; import type ProcessedNodeManager from './record/processed-node-manager'; export type recordOptions = { diff --git a/packages/rrweb/src/utils.ts b/packages/rrweb/src/utils.ts index 604c8810e2..2d115b2156 100644 --- a/packages/rrweb/src/utils.ts +++ b/packages/rrweb/src/utils.ts @@ -8,10 +8,14 @@ import type { IWindow, DeprecatedMirror, textMutation, -} from '@rrweb/types'; -import type { IMirror, Mirror } from 'rrweb-snapshot'; -import { isShadowRoot, IGNORED_NODE, classMatchesRegex } from 'rrweb-snapshot'; -import type { RRNode, RRIFrameElement } from 'rrdom'; +} from '@sentry-internal/rrweb-types'; +import type { IMirror, Mirror } from '@sentry-internal/rrweb-snapshot'; +import { + isShadowRoot, + IGNORED_NODE, + classMatchesRegex, +} from '@sentry-internal/rrweb-snapshot'; +import type { RRNode, RRIFrameElement } from '@sentry-internal/rrdom'; export function on( type: string, diff --git a/packages/rrweb/test/benchmark/dom-mutation.test.ts b/packages/rrweb/test/benchmark/dom-mutation.test.ts index aca474e2ad..fc41472906 100644 --- a/packages/rrweb/test/benchmark/dom-mutation.test.ts +++ b/packages/rrweb/test/benchmark/dom-mutation.test.ts @@ -1,7 +1,7 @@ import * as fs from 'fs'; import * as path from 'path'; import type { Page } from 'puppeteer'; -import type { eventWithTime } from '@rrweb/types'; +import type { eventWithTime } from '@sentry-internal/rrweb-types'; import type { recordOptions } from '../../src/types'; import { startServer, launchPuppeteer, ISuite, getServerURL } from '../utils'; diff --git a/packages/rrweb/test/benchmark/replay-fast-forward.test.ts b/packages/rrweb/test/benchmark/replay-fast-forward.test.ts index 6fbed1a055..d4e91ea370 100644 --- a/packages/rrweb/test/benchmark/replay-fast-forward.test.ts +++ b/packages/rrweb/test/benchmark/replay-fast-forward.test.ts @@ -1,7 +1,7 @@ import * as fs from 'fs'; import * as path from 'path'; import * as https from 'https'; -import type { eventWithTime } from '@rrweb/types'; +import type { eventWithTime } from '@sentry-internal/rrweb-types'; import type { recordOptions } from '../../src/types'; import { launchPuppeteer, ISuite } from '../utils'; diff --git a/packages/rrweb/test/e2e/webgl.test.ts b/packages/rrweb/test/e2e/webgl.test.ts index 09521b547d..501d4c660c 100644 --- a/packages/rrweb/test/e2e/webgl.test.ts +++ b/packages/rrweb/test/e2e/webgl.test.ts @@ -11,7 +11,7 @@ import { ISuite, } from '../utils'; import type { recordOptions } from '../../src/types'; -import type { eventWithTime } from '@rrweb/types'; +import type { eventWithTime } from '@sentry-internal/rrweb-types'; import { toMatchImageSnapshot } from 'jest-image-snapshot'; expect.extend({ toMatchImageSnapshot }); diff --git a/packages/rrweb/test/events/adopted-style-sheet-modification.ts b/packages/rrweb/test/events/adopted-style-sheet-modification.ts index fd26ea9c37..cc53e89a24 100644 --- a/packages/rrweb/test/events/adopted-style-sheet-modification.ts +++ b/packages/rrweb/test/events/adopted-style-sheet-modification.ts @@ -1,5 +1,5 @@ -import { EventType, IncrementalSource } from '@rrweb/types'; -import type { eventWithTime } from '@rrweb/types'; +import { EventType, IncrementalSource } from '@sentry-internal/rrweb-types'; +import type { eventWithTime } from '@sentry-internal/rrweb-types'; const now = Date.now(); const events: eventWithTime[] = [ diff --git a/packages/rrweb/test/events/adopted-style-sheet.ts b/packages/rrweb/test/events/adopted-style-sheet.ts index 70ddc4305a..bacca4409c 100644 --- a/packages/rrweb/test/events/adopted-style-sheet.ts +++ b/packages/rrweb/test/events/adopted-style-sheet.ts @@ -1,5 +1,5 @@ -import { EventType, IncrementalSource } from '@rrweb/types'; -import type { eventWithTime } from '@rrweb/types'; +import { EventType, IncrementalSource } from '@sentry-internal/rrweb-types'; +import type { eventWithTime } from '@sentry-internal/rrweb-types'; const now = Date.now(); diff --git a/packages/rrweb/test/events/canvas-in-iframe.ts b/packages/rrweb/test/events/canvas-in-iframe.ts index 28abee2c2e..13e2f7f43d 100644 --- a/packages/rrweb/test/events/canvas-in-iframe.ts +++ b/packages/rrweb/test/events/canvas-in-iframe.ts @@ -1,5 +1,5 @@ -import { EventType, IncrementalSource } from '@rrweb/types'; -import type { eventWithTime } from '@rrweb/types'; +import { EventType, IncrementalSource } from '@sentry-internal/rrweb-types'; +import type { eventWithTime } from '@sentry-internal/rrweb-types'; const now = Date.now(); diff --git a/packages/rrweb/test/events/custom-element-define-class.ts b/packages/rrweb/test/events/custom-element-define-class.ts index 3f9bd9fa6b..d03af76600 100644 --- a/packages/rrweb/test/events/custom-element-define-class.ts +++ b/packages/rrweb/test/events/custom-element-define-class.ts @@ -1,5 +1,5 @@ -import { EventType } from '@rrweb/types'; -import type { eventWithTime } from '@rrweb/types'; +import { EventType } from '@sentry-internal/rrweb-types'; +import type { eventWithTime } from '@sentry-internal/rrweb-types'; const now = Date.now(); const events: eventWithTime[] = [ diff --git a/packages/rrweb/test/events/document-replacement.ts b/packages/rrweb/test/events/document-replacement.ts index 8b79e7dc9b..f120a274cc 100644 --- a/packages/rrweb/test/events/document-replacement.ts +++ b/packages/rrweb/test/events/document-replacement.ts @@ -1,5 +1,5 @@ -import { EventType, IncrementalSource } from '@rrweb/types'; -import type { eventWithTime } from '@rrweb/types'; +import { EventType, IncrementalSource } from '@sentry-internal/rrweb-types'; +import type { eventWithTime } from '@sentry-internal/rrweb-types'; const now = Date.now(); const events: eventWithTime[] = [ diff --git a/packages/rrweb/test/events/hover.ts b/packages/rrweb/test/events/hover.ts index 73b2a4ea55..7352911927 100644 --- a/packages/rrweb/test/events/hover.ts +++ b/packages/rrweb/test/events/hover.ts @@ -1,4 +1,4 @@ -import { IncrementalSource, MouseInteractions } from '@rrweb/types'; +import { IncrementalSource, MouseInteractions } from '@sentry-internal/rrweb-types'; import type { eventWithTime } from '../../../types/src'; const events: eventWithTime[] = [ diff --git a/packages/rrweb/test/events/iframe-shadowdom-hover.ts b/packages/rrweb/test/events/iframe-shadowdom-hover.ts index 0e3671dcbf..96afc37084 100644 --- a/packages/rrweb/test/events/iframe-shadowdom-hover.ts +++ b/packages/rrweb/test/events/iframe-shadowdom-hover.ts @@ -1,5 +1,5 @@ -import { EventType, IncrementalSource } from '@rrweb/types'; -import type { eventWithTime } from '@rrweb/types'; +import { EventType, IncrementalSource } from '@sentry-internal/rrweb-types'; +import type { eventWithTime } from '@sentry-internal/rrweb-types'; const now = Date.now(); diff --git a/packages/rrweb/test/events/iframe.ts b/packages/rrweb/test/events/iframe.ts index 7288b7ada7..7afa9069f0 100644 --- a/packages/rrweb/test/events/iframe.ts +++ b/packages/rrweb/test/events/iframe.ts @@ -1,5 +1,5 @@ -import { EventType, IncrementalSource } from '@rrweb/types'; -import type { eventWithTime } from '@rrweb/types'; +import { EventType, IncrementalSource } from '@sentry-internal/rrweb-types'; +import type { eventWithTime } from '@sentry-internal/rrweb-types'; const now = Date.now(); diff --git a/packages/rrweb/test/events/input.ts b/packages/rrweb/test/events/input.ts index a1dedc41a7..437fbbc8e4 100644 --- a/packages/rrweb/test/events/input.ts +++ b/packages/rrweb/test/events/input.ts @@ -1,5 +1,5 @@ -import { EventType, IncrementalSource } from '@rrweb/types'; -import type { eventWithTime } from '@rrweb/types'; +import { EventType, IncrementalSource } from '@sentry-internal/rrweb-types'; +import type { eventWithTime } from '@sentry-internal/rrweb-types'; const now = Date.now(); const events: eventWithTime[] = [ diff --git a/packages/rrweb/test/events/ordering.ts b/packages/rrweb/test/events/ordering.ts index 53dbfc2b15..dd0cd60066 100644 --- a/packages/rrweb/test/events/ordering.ts +++ b/packages/rrweb/test/events/ordering.ts @@ -1,5 +1,5 @@ -import { EventType, IncrementalSource } from '@rrweb/types'; -import type { eventWithTime } from '@rrweb/types'; +import { EventType, IncrementalSource } from '@sentry-internal/rrweb-types'; +import type { eventWithTime } from '@sentry-internal/rrweb-types'; const now = Date.now(); const events: eventWithTime[] = [ diff --git a/packages/rrweb/test/events/scroll.ts b/packages/rrweb/test/events/scroll.ts index baf6d1e0a8..6a254254f4 100644 --- a/packages/rrweb/test/events/scroll.ts +++ b/packages/rrweb/test/events/scroll.ts @@ -1,5 +1,5 @@ -import { EventType, IncrementalSource } from '@rrweb/types'; -import type { eventWithTime } from '@rrweb/types'; +import { EventType, IncrementalSource } from '@sentry-internal/rrweb-types'; +import type { eventWithTime } from '@sentry-internal/rrweb-types'; const now = Date.now(); const events: eventWithTime[] = [ diff --git a/packages/rrweb/test/events/selection.ts b/packages/rrweb/test/events/selection.ts index 2d16655592..da43495c56 100644 --- a/packages/rrweb/test/events/selection.ts +++ b/packages/rrweb/test/events/selection.ts @@ -1,5 +1,5 @@ -import { EventType, IncrementalSource } from '@rrweb/types'; -import type { eventWithTime } from '@rrweb/types'; +import { EventType, IncrementalSource } from '@sentry-internal/rrweb-types'; +import type { eventWithTime } from '@sentry-internal/rrweb-types'; const now = Date.now(); diff --git a/packages/rrweb/test/events/shadow-dom.ts b/packages/rrweb/test/events/shadow-dom.ts index 106e848f53..10e5acd8f4 100644 --- a/packages/rrweb/test/events/shadow-dom.ts +++ b/packages/rrweb/test/events/shadow-dom.ts @@ -1,5 +1,5 @@ -import { EventType, IncrementalSource } from '@rrweb/types'; -import type { eventWithTime } from '@rrweb/types'; +import { EventType, IncrementalSource } from '@sentry-internal/rrweb-types'; +import type { eventWithTime } from '@sentry-internal/rrweb-types'; const now = Date.now(); diff --git a/packages/rrweb/test/events/style-sheet-rule-events.ts b/packages/rrweb/test/events/style-sheet-rule-events.ts index 577c0caf41..8be331d1b4 100644 --- a/packages/rrweb/test/events/style-sheet-rule-events.ts +++ b/packages/rrweb/test/events/style-sheet-rule-events.ts @@ -1,5 +1,5 @@ -import { EventType, IncrementalSource } from '@rrweb/types'; -import type { eventWithTime } from '@rrweb/types'; +import { EventType, IncrementalSource } from '@sentry-internal/rrweb-types'; +import type { eventWithTime } from '@sentry-internal/rrweb-types'; const now = Date.now(); const events: eventWithTime[] = [ diff --git a/packages/rrweb/test/events/style-sheet-text-mutation.ts b/packages/rrweb/test/events/style-sheet-text-mutation.ts index d6dcc6de1e..6302e88e3d 100644 --- a/packages/rrweb/test/events/style-sheet-text-mutation.ts +++ b/packages/rrweb/test/events/style-sheet-text-mutation.ts @@ -1,5 +1,5 @@ -import { EventType, IncrementalSource } from '@rrweb/types'; -import type { eventWithTime } from '@rrweb/types'; +import { EventType, IncrementalSource } from '@sentry-internal/rrweb-types'; +import type { eventWithTime } from '@sentry-internal/rrweb-types'; const now = Date.now(); const events: eventWithTime[] = [ diff --git a/packages/rrweb/test/integration.test.ts b/packages/rrweb/test/integration.test.ts index 4186e52ee8..b40e199ce2 100644 --- a/packages/rrweb/test/integration.test.ts +++ b/packages/rrweb/test/integration.test.ts @@ -17,8 +17,8 @@ import { EventType, RecordPlugin, IncrementalSource, -} from '@rrweb/types'; -import { visitSnapshot, NodeType } from 'rrweb-snapshot'; +} from '@sentry-internal/rrweb-types'; +import { visitSnapshot, NodeType } from '@sentry-internal/rrweb-snapshot'; /** * Used to filter scroll events out of snapshots as they are flakey diff --git a/packages/rrweb/test/machine.test.ts b/packages/rrweb/test/machine.test.ts index bf96a317b5..60cd0df83b 100644 --- a/packages/rrweb/test/machine.test.ts +++ b/packages/rrweb/test/machine.test.ts @@ -1,6 +1,6 @@ import { discardPriorSnapshots } from '../src/replay/machine'; import { sampleEvents } from './utils'; -import { EventType } from '@rrweb/types'; +import { EventType } from '@sentry-internal/rrweb-types'; const events = sampleEvents.filter( (e) => ![EventType.DomContentLoaded, EventType.Load].includes(e.type), diff --git a/packages/rrweb/test/packer.test.ts b/packages/rrweb/test/packer.test.ts index e6487d7a20..3da1929e5c 100644 --- a/packages/rrweb/test/packer.test.ts +++ b/packages/rrweb/test/packer.test.ts @@ -1,5 +1,5 @@ import { pack, unpack } from '../src/packer'; -import { eventWithTime, EventType } from '@rrweb/types'; +import { eventWithTime, EventType } from '@sentry-internal/rrweb-types'; import { MARK } from '../src/packer/base'; const event: eventWithTime = { diff --git a/packages/rrweb/test/record.test.ts b/packages/rrweb/test/record.test.ts index 1a0a87421f..ea4d10f445 100644 --- a/packages/rrweb/test/record.test.ts +++ b/packages/rrweb/test/record.test.ts @@ -10,7 +10,7 @@ import { IncrementalSource, styleSheetRuleData, selectionData, -} from '@rrweb/types'; +} from '@sentry-internal/rrweb-types'; import { assertSnapshot, getServerURL, diff --git a/packages/rrweb/test/record/cross-origin-iframes.test.ts b/packages/rrweb/test/record/cross-origin-iframes.test.ts index 1b0d00f2d0..e36b6d17eb 100644 --- a/packages/rrweb/test/record/cross-origin-iframes.test.ts +++ b/packages/rrweb/test/record/cross-origin-iframes.test.ts @@ -6,8 +6,8 @@ import type { listenerHandler, eventWithTime, mutationData, -} from '@rrweb/types'; -import { EventType, IncrementalSource } from '@rrweb/types'; +} from '@sentry-internal/rrweb-types'; +import { EventType, IncrementalSource } from '@sentry-internal/rrweb-types'; import { assertSnapshot, getServerURL, diff --git a/packages/rrweb/test/record/error-handler.test.ts b/packages/rrweb/test/record/error-handler.test.ts index 25b94e9f4c..6ce46e92b7 100644 --- a/packages/rrweb/test/record/error-handler.test.ts +++ b/packages/rrweb/test/record/error-handler.test.ts @@ -2,7 +2,7 @@ import * as fs from 'fs'; import * as path from 'path'; import type * as puppeteer from 'puppeteer'; import type { recordOptions } from '../../src/types'; -import { listenerHandler, eventWithTime, EventType } from '@rrweb/types'; +import { listenerHandler, eventWithTime, EventType } from '@sentry-internal/rrweb-types'; import { launchPuppeteer } from '../utils'; import { callbackWrapper, diff --git a/packages/rrweb/test/record/webgl.test.ts b/packages/rrweb/test/record/webgl.test.ts index 762d3607bd..867a5f1083 100644 --- a/packages/rrweb/test/record/webgl.test.ts +++ b/packages/rrweb/test/record/webgl.test.ts @@ -8,14 +8,14 @@ import { EventType, IncrementalSource, CanvasContext, -} from '@rrweb/types'; +} from '@sentry-internal/rrweb-types'; import { assertSnapshot, launchPuppeteer, stripBase64, waitForRAF, } from '../utils'; -import type { ICanvas } from 'rrweb-snapshot'; +import type { ICanvas } from '@sentry-internal/rrweb-snapshot'; interface ISuite { code: string; diff --git a/packages/rrweb/test/replay/preload-all-images.test.ts b/packages/rrweb/test/replay/preload-all-images.test.ts index 36133d3a6d..7f4b17782e 100644 --- a/packages/rrweb/test/replay/preload-all-images.test.ts +++ b/packages/rrweb/test/replay/preload-all-images.test.ts @@ -11,7 +11,7 @@ import { IncrementalSource, EventType, eventWithTime, -} from '@rrweb/types'; +} from '@sentry-internal/rrweb-types'; let replayer: Replayer; diff --git a/packages/rrweb/test/replay/webgl-mutation.test.ts b/packages/rrweb/test/replay/webgl-mutation.test.ts index 378b0636e6..7cd11cf602 100644 --- a/packages/rrweb/test/replay/webgl-mutation.test.ts +++ b/packages/rrweb/test/replay/webgl-mutation.test.ts @@ -6,7 +6,7 @@ import { polyfillWebGLGlobals } from '../utils'; polyfillWebGLGlobals(); import webglMutation from '../../src/replay/canvas/webgl'; -import { CanvasContext } from '@rrweb/types'; +import { CanvasContext } from '@sentry-internal/rrweb-types'; import { variableListFor } from '../../src/replay/canvas/deserialize-args'; let canvas: HTMLCanvasElement; diff --git a/packages/rrweb/test/replayer.test.ts b/packages/rrweb/test/replayer.test.ts index 183d2417fb..387325b2df 100644 --- a/packages/rrweb/test/replayer.test.ts +++ b/packages/rrweb/test/replayer.test.ts @@ -23,7 +23,7 @@ import adoptedStyleSheetModification from './events/adopted-style-sheet-modifica import documentReplacementEvents from './events/document-replacement'; import hoverInIframeShadowDom from './events/iframe-shadowdom-hover'; import customElementDefineClass from './events/custom-element-define-class'; -import { ReplayerEvents } from '@rrweb/types'; +import { ReplayerEvents } from '@sentry-internal/rrweb-types'; interface ISuite { code: string; diff --git a/packages/rrweb/test/utils.ts b/packages/rrweb/test/utils.ts index c45c6522dd..71a0ac003a 100644 --- a/packages/rrweb/test/utils.ts +++ b/packages/rrweb/test/utils.ts @@ -1,4 +1,4 @@ -import { NodeType } from 'rrweb-snapshot'; +import { NodeType } from '@sentry-internal/rrweb-snapshot'; import { EventType, IncrementalSource, @@ -7,7 +7,7 @@ import { Optional, mouseInteractionData, event, -} from '@rrweb/types'; +} from '@sentry-internal/rrweb-types'; import type { recordOptions } from '../src/types'; import * as puppeteer from 'puppeteer'; import { format } from 'prettier'; diff --git a/packages/types/package.json b/packages/types/package.json index c438396a99..ef92abfe3a 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,12 +1,12 @@ { - "name": "@rrweb/types", + "name": "@sentry-internal/rrweb-types", "version": "2.0.0-alpha.9", "publishConfig": { "access": "public" }, "keywords": [ "rrweb", - "@rrweb/types" + "@sentry-internal/rrweb-types" ], "scripts": { "dev": "vite", @@ -25,13 +25,13 @@ }, "license": "MIT", "type": "module", - "main": "./dist/types.umd.cjs", - "module": "./dist/types.js", + "main": "./dist/rrweb-types.umd.cjs", + "module": "./dist/rrweb-types.js", "typings": "dist/index.d.ts", "exports": { ".": { - "import": "./dist/types.js", - "require": "./dist/types.umd.cjs" + "import": "./dist/rrweb-types.js", + "require": "./dist/rrweb-types.umd.cjs" } }, "files": [ @@ -43,7 +43,7 @@ "vite-plugin-dts": "^1.6.6" }, "dependencies": { - "rrweb-snapshot": "^2.0.0-alpha.9" + "@sentry-internal/rrweb-snapshot": "^2.0.0-alpha.9" }, "browserslist": [ "supports es6-class" diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts index ad74f4fdac..f825f6e850 100644 --- a/packages/types/src/index.ts +++ b/packages/types/src/index.ts @@ -3,7 +3,7 @@ import type { Mirror, INode, DataURLOptions, -} from 'rrweb-snapshot'; +} from '@sentry-internal/rrweb-snapshot'; export enum EventType { DomContentLoaded, diff --git a/packages/types/tsconfig.json b/packages/types/tsconfig.json index ecde939d12..5023550074 100644 --- a/packages/types/tsconfig.json +++ b/packages/types/tsconfig.json @@ -10,14 +10,21 @@ "sourceMap": true, "rootDir": "src", "outDir": "build", - "lib": ["es6", "dom"], + "lib": [ + "es6", + "dom" + ], "skipLibCheck": true, "declaration": true, "importsNotUsedAsValues": "error" }, "compileOnSave": true, - "exclude": ["test"], - "include": ["src"], + "exclude": [ + "test" + ], + "include": [ + "src" + ], "references": [ { "path": "../rrweb-snapshot" diff --git a/packages/web-extension/package.json b/packages/web-extension/package.json index 2e438d485a..b1a02bd346 100644 --- a/packages/web-extension/package.json +++ b/packages/web-extension/package.json @@ -16,7 +16,7 @@ "prepublish": "npm run pack:chrome && npm run pack:firefox" }, "devDependencies": { - "@rrweb/types": "^2.0.0-alpha.9", + "@sentry-internal/rrweb-types": "^2.0.0-alpha.9", "@types/react-dom": "^18.0.6", "@types/webextension-polyfill": "^0.9.1", "@vitejs/plugin-react": "^2.1.0", @@ -31,6 +31,8 @@ "@chakra-ui/react": "^2.3.4", "@emotion/react": "^11.10.4", "@emotion/styled": "^11.10.4", + "@sentry-internal/rrweb-player": "^2.0.0-alpha.9", + "@sentry-internal/rrweb": "^2.0.0-alpha.9", "@tanstack/react-table": "^8.5.22", "framer-motion": "^7.3.6", "idb": "^7.1.1", @@ -39,8 +41,6 @@ "react": "^18.2.0", "react-dom": "^18.2.0", "react-icons": "^4.4.0", - "react-router-dom": "^6.4.1", - "rrweb": "^2.0.0-alpha.9", - "rrweb-player": "^2.0.0-alpha.9" + "react-router-dom": "^6.4.1" } } diff --git a/packages/web-extension/src/background/index.ts b/packages/web-extension/src/background/index.ts index 901669907b..7374a7efe4 100644 --- a/packages/web-extension/src/background/index.ts +++ b/packages/web-extension/src/background/index.ts @@ -1,5 +1,5 @@ import Browser from 'webextension-polyfill'; -import type { eventWithTime } from '@rrweb/types'; +import type { eventWithTime } from '@sentry-internal/rrweb-types'; import Channel from '~/utils/channel'; import { LocalData, diff --git a/packages/web-extension/src/content/index.ts b/packages/web-extension/src/content/index.ts index 5f99e974aa..ea257d55a6 100644 --- a/packages/web-extension/src/content/index.ts +++ b/packages/web-extension/src/content/index.ts @@ -1,6 +1,6 @@ import Browser, { Storage } from 'webextension-polyfill'; import { nanoid } from 'nanoid'; -import type { eventWithTime } from '@rrweb/types'; +import type { eventWithTime } from '@sentry-internal/rrweb-types'; import { LocalData, LocalDataKey, diff --git a/packages/web-extension/src/content/inject.ts b/packages/web-extension/src/content/inject.ts index 1d18474a01..d7957322ed 100644 --- a/packages/web-extension/src/content/inject.ts +++ b/packages/web-extension/src/content/inject.ts @@ -1,6 +1,6 @@ -import { record } from 'rrweb'; +import { record } from '@sentry-internal/rrweb'; import type { recordOptions } from 'rrweb/typings/types'; -import type { eventWithTime } from '@rrweb/types'; +import type { eventWithTime } from '@sentry-internal/rrweb-types'; import { MessageName, RecordStartedMessage } from '~/types'; import { isInCrossOriginIFrame } from '~/utils'; diff --git a/packages/web-extension/src/pages/Player.tsx b/packages/web-extension/src/pages/Player.tsx index b9744a8fa4..cc0a92cd8c 100644 --- a/packages/web-extension/src/pages/Player.tsx +++ b/packages/web-extension/src/pages/Player.tsx @@ -1,6 +1,6 @@ import { useRef, useEffect, useState } from 'react'; import { useParams } from 'react-router-dom'; -import Replayer from 'rrweb-player'; +import Replayer from '@sentry-internal/rrweb-player'; import { Box, Breadcrumb, diff --git a/packages/web-extension/src/types.ts b/packages/web-extension/src/types.ts index f0dae57e43..47c880554b 100644 --- a/packages/web-extension/src/types.ts +++ b/packages/web-extension/src/types.ts @@ -1,4 +1,4 @@ -import type { eventWithTime } from '@rrweb/types'; +import type { eventWithTime } from '@sentry-internal/rrweb-types'; export enum SyncDataKey { settings = 'settings', diff --git a/packages/web-extension/src/utils/recording.ts b/packages/web-extension/src/utils/recording.ts index 69fc8362ea..2a7c98fcdd 100644 --- a/packages/web-extension/src/utils/recording.ts +++ b/packages/web-extension/src/utils/recording.ts @@ -1,5 +1,5 @@ import Browser from 'webextension-polyfill'; -import type { eventWithTime } from '@rrweb/types'; +import type { eventWithTime } from '@sentry-internal/rrweb-types'; import { LocalData, diff --git a/packages/web-extension/src/utils/storage.ts b/packages/web-extension/src/utils/storage.ts index 9c52c38a05..765a9bd11a 100644 --- a/packages/web-extension/src/utils/storage.ts +++ b/packages/web-extension/src/utils/storage.ts @@ -1,5 +1,5 @@ import { openDB } from 'idb'; -import { eventWithTime } from '@rrweb/types'; +import { eventWithTime } from '@sentry-internal/rrweb-types'; import { Session } from '~/types'; /** diff --git a/packages/web-extension/tsconfig.json b/packages/web-extension/tsconfig.json index 6eba04af10..c36573b1bc 100644 --- a/packages/web-extension/tsconfig.json +++ b/packages/web-extension/tsconfig.json @@ -22,10 +22,10 @@ "exclude": ["dist", "node_modules"], "references": [ { - "path": "../rrweb" + "path": "../rrweb-player" }, { - "path": "../rrweb-player" + "path": "../rrweb" }, { "path": "../types" diff --git a/scripts/craft-pre-release.sh b/scripts/craft-pre-release.sh new file mode 100755 index 0000000000..75df3de94e --- /dev/null +++ b/scripts/craft-pre-release.sh @@ -0,0 +1,20 @@ +#!/bin/bash +set -eux + +# Move to the project root +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +cd $SCRIPT_DIR/.. +OLD_VERSION="${1}" +NEW_VERSION="${2}" + +# Do not tag and commit changes made by "npm version" +export npm_config_git_tag_version=false + +yarn install --frozen-lockfile +# --force-publish - force publish all packages, this will skip the lerna changed check for changed packages and forces a package that didn't have a git diff change to be updated. +# --exact - specify updated dependencies in updated packages exactly (with no punctuation), instead of as semver compatible (with a ^). +# --no-git-tag-version - don't commit changes to package.json files and don't tag the release. +# --no-push - don't push committed and tagged changes. +# --include-merged-tags - include tags from merged branches when detecting changed packages. +# --yes - skip all confirmation prompts +yarn lerna version --force-publish --exact --no-git-tag-version --no-push --include-merged-tags --yes "${NEW_VERSION}"