Skip to content

Commit 98dfcc4

Browse files
Lms24billyvg
authored andcommitted
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
1 parent 9d17a71 commit 98dfcc4

File tree

111 files changed

+588
-239
lines changed

Some content is hidden

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

111 files changed

+588
-239
lines changed

.craft.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
github:
2+
owner: getsentry
3+
repo: rrweb
4+
changelogPolicy: simple
5+
preReleaseCommand: bash scripts/craft-pre-release.sh
6+
requireNames:
7+
- /^sentry-internal-rrweb-snapshot-.*\.tgz$/
8+
- /^sentry-internal-rrweb-player-.*\.tgz$/
9+
- /^sentry-internal-rrweb-.*\.tgz$/
10+
- /^sentry-internal-rrdom-.*\.tgz$/
11+
targets:
12+
- name: github
13+
includeNames: /^sentry-.*.tgz$/
14+
- name: npm
15+
includeNames: /^sentry-.*.tgz$/

.github/workflows/ci-cd.yml

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1-
name: Tests
1+
name: Build & Tests
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- release/**
8+
pull_request:
49

510
concurrency: ${{ github.workflow }}-${{ github.ref }}
611

712
jobs:
8-
release:
13+
job_test:
914
name: Tests
1015
runs-on: ubuntu-latest
1116
steps:
@@ -39,3 +44,29 @@ jobs:
3944
name: image-diff
4045
path: packages/rrweb/test/e2e/__image_snapshots__/__diff_output__/*.png
4146
if-no-files-found: ignore
47+
48+
job_artifacts:
49+
needs: job_test
50+
name: Upload Artifacts
51+
runs-on: ubuntu-latest
52+
# Build artifacts are only needed for releasing workflow.
53+
if: startsWith(github.ref, 'refs/heads/release/')
54+
steps:
55+
- name: Checkout Repo
56+
uses: actions/checkout@v3
57+
58+
- name: Set up Node
59+
uses: volta-cli/action@v3
60+
61+
- name: Install Dependencies
62+
run: yarn --frozen-lockfile
63+
64+
- name: Build Tarballs
65+
run: yarn build:tarball
66+
67+
- name: Upload Artifacts
68+
uses: actions/upload-artifact@v3
69+
with:
70+
name: ${{ github.sha }}
71+
path: |
72+
${{ github.workspace }}/packages/**/*.tgz

.github/workflows/release.yml

Lines changed: 23 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,30 @@
1-
name: Release
2-
1+
name: Prepare Release
32
on:
4-
push:
5-
branches:
6-
- master
7-
8-
concurrency: ${{ github.workflow }}-${{ github.ref }}
9-
3+
workflow_dispatch:
4+
inputs:
5+
version:
6+
description: Version to release
7+
required: true
8+
force:
9+
description: Force a release even when there are release-blockers (optional)
10+
required: false
11+
merge_target:
12+
description: Target branch to merge into. Uses the default branch, sentry-v1, as a fallback (optional)
13+
required: false
1014
jobs:
1115
release:
12-
name: Release
1316
runs-on: ubuntu-latest
17+
name: 'Release a new version'
1418
steps:
15-
- name: Checkout Repo
16-
uses: actions/checkout@v3
17-
18-
- name: Setup Node.js lts/*
19-
uses: actions/setup-node@v3
19+
- uses: actions/checkout@v3
2020
with:
21-
node-version: lts/*
22-
23-
- name: Install Dependencies
24-
run: yarn
25-
26-
- name: Create Release Pull Request or Publish to npm
27-
id: changesets
28-
uses: changesets/action@v1
29-
with:
30-
publish: yarn run release
21+
token: ${{ secrets.GH_RELEASE_PAT }}
22+
fetch-depth: 0
23+
- name: Prepare release
24+
uses: getsentry/action-prepare-release@v1
3125
env:
32-
NODE_OPTIONS: "--max-old-space-size=4096"
33-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
35-
36-
# - name: Send a Slack notification if a publish happens
37-
# if: steps.changesets.outputs.published == 'true'
38-
# # You can do something when a publish happens.
39-
# run: my-slack-bot send-notification --message "A new version of ${GITHUB_REPOSITORY} was published!"
26+
GITHUB_TOKEN: ${{ secrets.GH_RELEASE_PAT }}
27+
with:
28+
version: ${{ github.event.inputs.version }}
29+
force: ${{ github.event.inputs.force }}
30+
merge_target: ${{ github.event.inputs.merge_target }}

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
This project is forked from rrweb-io/rrweb (https://github.com/rrweb-io/rrweb) under the MIT license:
2+
13
MIT License
24

35
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
1921
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2022
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2123
SOFTWARE.
24+
25+
Our modifications to this project are also released under the MIT license:
26+
27+
Copyright (c) 2023 Functional Software, Inc. dba Sentry
28+
29+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
30+
and associated documentation files (the "Software"), to deal in the Software without restriction,
31+
including without limitation the rights to use, copy, modify, merge, publish, distribute,
32+
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
33+
furnished to do so, subject to the following conditions:
34+
35+
The above copyright notice and this permission notice shall be included in all copies or substantial
36+
portions of the Software.
37+
38+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
39+
NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
40+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
41+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
42+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,30 @@
1+
<p align="center">
2+
<a href="https://sentry.io/?utm_source=github&utm_medium=logo" target="_blank">
3+
<img src="https://sentry-brand.storage.googleapis.com/sentry-wordmark-dark-280x84.png" alt="Sentry" width="280" height="84">
4+
</a>
5+
</p>
6+
7+
# Sentry rrweb Fork
8+
9+
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.
10+
11+
From this monorepo, Sentry maintains and publishes the following NPM packages:
12+
13+
- `@sentry-internal/rrweb` (corresponds to the [original `rrweb` package](https://www.npmjs.com/package/rrweb))
14+
- `@sentry-internal/rrdom` (corresponds to the [original `rrdom` package](https://www.npmjs.com/package/rrdom))
15+
- `@sentry-internal/rrweb-player` (corresponds to the [original `rrweb-player` package](https://www.npmjs.com/package/rrweb-player))
16+
- `@sentry-internal/rrweb-snapshot` (corresponds to the [original `rrweb-snapshot` package](https://www.npmjs.com/package/rrweb-snapshot))
17+
18+
# rrweb
19+
120
<p align="center">
221
<img width="100px" height="100px" src="https://www.rrweb.io/favicon.png">
322
</p>
423
<p align="center">
5-
<a href="https://www.rrweb.io/" style="font-weight: bold">Try rrweb</a>
24+
<a href="https://github.com/rrweb-io/rrweb" style="font-weight: bold">Check out the original rrweb Repo</a>
25+
</p>
26+
<p align="center">
27+
<a href="https://rrweb.io" style="font-weight: bold">rrweb.io</a>
628
</p>
729

830
# rrweb

packages/rrdom-nodejs/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"lint": "yarn eslint src/**/*.ts"
1212
},
1313
"keywords": [
14-
"rrweb",
14+
"@sentry-internal/rrweb",
1515
"rrdom-nodejs"
1616
],
1717
"license": "MIT",
@@ -48,8 +48,8 @@
4848
"cssom": "^0.5.0",
4949
"cssstyle": "^2.3.0",
5050
"nwsapi": "^2.2.0",
51-
"rrdom": "^2.0.0-alpha.9",
52-
"rrweb-snapshot": "^2.0.0-alpha.9"
51+
"@sentry-internal/rrdom": "^2.0.0-alpha.9",
52+
"@sentry-internal/rrweb-snapshot": "^2.0.0-alpha.9"
5353
},
5454
"browserslist": [
5555
"supports es6-class"

packages/rrdom-nodejs/src/document-nodejs.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
2-
import { NodeType as RRNodeType } from 'rrweb-snapshot';
2+
import { NodeType as RRNodeType } from '@sentry-internal/rrweb-snapshot';
33
import type { NWSAPI } from 'nwsapi';
44
import type { CSSStyleDeclaration as CSSStyleDeclarationType } from 'cssstyle';
55
import {
@@ -14,7 +14,7 @@ import {
1414
ClassList,
1515
IRRDocument,
1616
CSSStyleDeclaration,
17-
} from 'rrdom';
17+
} from '@sentry-internal/rrdom';
1818
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-var-requires
1919
const nwsapi = require('nwsapi');
2020
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-var-requires

packages/rrdom-nodejs/test/document-nodejs.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*/
44
import * as fs from 'fs';
55
import * as path from 'path';
6-
import { NodeType as RRNodeType } from 'rrweb-snapshot';
6+
import { NodeType as RRNodeType } from '@sentry-internal/rrweb-snapshot';
77
import {
88
RRCanvasElement,
99
RRCDATASection,
@@ -16,7 +16,7 @@ import {
1616
RRStyleElement,
1717
RRText,
1818
} from '../src/document-nodejs';
19-
import { buildFromDom } from 'rrdom';
19+
import { buildFromDom } from '@sentry-internal/rrdom';
2020

2121
describe('RRDocument for nodejs environment', () => {
2222
describe('RRDocument API', () => {

packages/rrdom-nodejs/tsconfig.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,18 @@
1010
"sourceMap": true,
1111
"rootDir": "src",
1212
"outDir": "build",
13-
"lib": ["es6", "dom"],
13+
"lib": [
14+
"es6",
15+
"dom"
16+
],
1417
"skipLibCheck": true,
1518
"declaration": true,
1619
"importsNotUsedAsValues": "error"
1720
},
1821
"compileOnSave": true,
19-
"exclude": ["test"],
22+
"exclude": [
23+
"test"
24+
],
2025
"include": [
2126
"src",
2227
"test.d.ts",

packages/rrdom/LICENSE

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Copyright (c) 2023 Sentry (https://sentry.io) and individual contributors. All rights reserved.
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
4+
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
5+
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
6+
persons to whom the Software is furnished to do so, subject to the following conditions:
7+
8+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
9+
Software.
10+
11+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
12+
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
13+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
14+
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0 commit comments

Comments
 (0)