Skip to content

Commit cc258b9

Browse files
committed
fix rrweb ci checks (#95)
Fix Github Actions PR checks.
1 parent 142f103 commit cc258b9

File tree

13 files changed

+45
-104
lines changed

13 files changed

+45
-104
lines changed

.github/workflows/eslint.yml

Lines changed: 0 additions & 47 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

.github/workflows/style-check.yml

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@ on: [push, pull_request_target]
55
jobs:
66
eslint_check_upload:
77
runs-on: ubuntu-latest
8-
name: ESLint Check and Report Upload
8+
name: Build & ESLint Check
99

1010
steps:
1111
- uses: actions/checkout@v3
1212
- name: Setup Node.js
13-
uses: actions/setup-node@v1
13+
uses: actions/setup-node@v3
1414
with:
15-
node-version: 16.15.0
16-
registry-url: https://registry.npmjs.org
15+
node-version: 16
1716
- name: Install
1817
run: YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn
1918
- name: Build Packages
@@ -48,33 +47,31 @@ jobs:
4847

4948
prettier_check:
5049
# In the forked PR, it's hard to format code and push to the branch directly, so the action only check the format correctness.
51-
if: github.event_name != 'push' && github.event.pull_request.head.repo.full_name != 'rrweb-io/rrweb'
50+
if: github.event_name != 'push'
5251
runs-on: ubuntu-latest
5352
name: Format Check
5453
steps:
5554
- uses: actions/checkout@v3
5655
- name: Setup Node.js
57-
uses: actions/setup-node@v1
56+
uses: actions/setup-node@v3
5857
with:
59-
node-version: 16.15.0
60-
registry-url: https://registry.npmjs.org
58+
node-version: 16
6159
- name: Install
6260
run: YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn
6361
- name: Prettier Check
6462
run: yarn prettier --check '**/*.{ts,md}'
6563

6664
prettier:
6765
# Skip the format code action in forked PRs
68-
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == 'rrweb-io/rrweb'
66+
if: github.event_name == 'push'
6967
runs-on: ubuntu-latest
7068
name: Format Code
7169
steps:
7270
- uses: actions/checkout@v3
7371
- name: Setup Node.js
74-
uses: actions/setup-node@v1
72+
uses: actions/setup-node@v3
7573
with:
76-
node-version: 16.15.0
77-
registry-url: https://registry.npmjs.org
74+
node-version: 16
7875
- name: Install
7976
run: YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn
8077
- name: Prettify Code

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"eslint-plugin-tsdoc": "^0.2.16",
3131
"markdownlint": "^0.25.1",
3232
"markdownlint-cli": "^0.31.1",
33+
"prettier": "^2.7.1",
3334
"turbo": "^1.2.4",
3435
"typescript": "^4.7.3"
3536
},

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export class RRDocument
3838
extends BaseRRDocumentImpl(RRNode)
3939
implements IRRDocument
4040
{
41-
readonly nodeName: '#document' = '#document';
41+
readonly nodeName = '#document' as const;
4242
private _nwsapi: NWSAPI;
4343
get nwsapi() {
4444
if (!this._nwsapi) {
@@ -374,15 +374,15 @@ export class RRIFrameElement extends RRElement {
374374
}
375375

376376
export class RRText extends BaseRRTextImpl(RRNode) {
377-
readonly nodeName: '#text' = '#text';
377+
readonly nodeName = '#text' as const;
378378
}
379379

380380
export class RRComment extends BaseRRCommentImpl(RRNode) {
381-
readonly nodeName: '#comment' = '#comment';
381+
readonly nodeName = '#comment' as const;
382382
}
383383

384384
export class RRCDATASection extends BaseRRCDATASectionImpl(RRNode) {
385-
readonly nodeName: '#cdata-section' = '#cdata-section';
385+
readonly nodeName = '#cdata-section' as const;
386386
}
387387

388388
interface RRElementTagNameMap {

packages/rrdom/src/document.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ export function BaseRRDocumentImpl<
199199
>(RRNodeClass: RRNode) {
200200
return class BaseRRDocument extends RRNodeClass implements IRRDocument {
201201
public readonly nodeType: number = NodeType.DOCUMENT_NODE;
202-
public readonly nodeName: '#document' = '#document';
202+
public readonly nodeName = '#document' as const;
203203
public readonly compatMode: 'BackCompat' | 'CSS1Compat' = 'CSS1Compat';
204204
public readonly RRNodeType = RRNodeType.Document;
205205
public textContent: string | null = null;
@@ -604,7 +604,7 @@ export function BaseRRTextImpl<RRNode extends ConstrainedConstructor<IRRNode>>(
604604
// @ts-ignore
605605
return class BaseRRText extends RRNodeClass implements IRRText {
606606
public readonly nodeType: number = NodeType.TEXT_NODE;
607-
public readonly nodeName: '#text' = '#text';
607+
public readonly nodeName = '#text' as const;
608608
public readonly RRNodeType = RRNodeType.Text;
609609
public data: string;
610610

@@ -634,7 +634,7 @@ export function BaseRRCommentImpl<
634634
// @ts-ignore
635635
return class BaseRRComment extends RRNodeClass implements IRRComment {
636636
public readonly nodeType: number = NodeType.COMMENT_NODE;
637-
public readonly nodeName: '#comment' = '#comment';
637+
public readonly nodeName = '#comment' as const;
638638
public readonly RRNodeType = RRNodeType.Comment;
639639
public data: string;
640640

@@ -666,7 +666,7 @@ export function BaseRRCDATASectionImpl<
666666
extends RRNodeClass
667667
implements IRRCDATASection
668668
{
669-
public readonly nodeName: '#cdata-section' = '#cdata-section';
669+
public readonly nodeName = '#cdata-section' as const;
670670
public readonly nodeType: number = NodeType.CDATA_SECTION_NODE;
671671
public readonly RRNodeType = RRNodeType.CDATA;
672672
public data: string;

packages/rrdom/tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
"lib": ["es6", "dom"],
1414
"skipLibCheck": true,
1515
"declaration": true,
16-
"importsNotUsedAsValues": "error",
17-
"composite": true
16+
"importsNotUsedAsValues": "error"
1817
},
1918
"references": [
2019
{

packages/rrweb-player/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"version": "1.0.1",
44
"private": true,
55
"devDependencies": {
6-
"@highlight-run/rrweb-types": "^2.0.0-alpha.4",
7-
"@rollup/plugin-commonjs": "^22.0.0",
6+
"@highlight-run/rrweb-types": "workspace:*",
7+
"@rollup/plugin-commonjs": "22.0.0",
88
"@rollup/plugin-node-resolve": "^13.2.1",
99
"@types/offscreencanvas": "^2019.6.4",
1010
"eslint": "^8.23.1",

packages/rrweb-snapshot/src/rebuild.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,10 @@ function buildNode(
199199
/**
200200
* Find all remote fonts in the style tag.
201201
* We need to find and replace the URLs with a proxy URL so we can bypass CORS.
202+
*
202203
*/
203204
if (typeof value === 'string') {
204-
const regex =
205-
/url\(\"https:\/\/\S*(.eot|.woff2|.ttf|.woff)\S*\"\)/gm;
205+
const regex = /url\("https:\/\/\S*(.eot|.woff2|.ttf|.woff)\S*"\)/gm;
206206
let m;
207207
const fontUrls: { originalUrl: string; proxyUrl: string }[] = [];
208208

packages/rrweb-snapshot/test/integration.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import * as typescript from 'rollup-plugin-typescript2';
88
import * as assert from 'assert';
99
import { waitForRAF } from './utils';
1010

11-
const _typescript = (typescript as unknown) as () => rollup.Plugin;
11+
const _typescript = typescript as unknown as () => rollup.Plugin;
1212

1313
const htmlFolder = path.join(__dirname, 'html');
1414
const htmls = fs.readdirSync(htmlFolder).map((filePath) => {

0 commit comments

Comments
 (0)