Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions .eslintignore

This file was deleted.

30 changes: 0 additions & 30 deletions .eslintrc.js

This file was deleted.

14 changes: 7 additions & 7 deletions .github/workflows/style-check.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Prettier Check
name: Format Check

on: [push, pull_request]

jobs:
prettier_check:
format_check:
# In the forked PR, it's hard to format code and push to the branch directly, so the action only check the format correctness.
if: github.event_name != 'push' && github.event.pull_request.head.repo.full_name != 'rrweb-io/rrweb'
permissions:
Expand All @@ -24,10 +24,10 @@ jobs:
run: yarn install --frozen-lockfile
env:
PUPPETEER_SKIP_DOWNLOAD: true
- name: Prettier Check
run: yarn prettier --check '**/*.{ts,md}'
- name: Format Check
run: yarn vp fmt . --check

prettier:
format:
# Skip the format code action in forked PRs
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == 'rrweb-io/rrweb'
runs-on: ubuntu-latest
Expand All @@ -48,8 +48,8 @@ jobs:
run: yarn install --frozen-lockfile
env:
PUPPETEER_SKIP_DOWNLOAD: true
- name: Prettify Code
run: yarn prettier --write '**/*.{ts,md}'
- name: Format Code
run: yarn vp fmt . --write
- name: Commit Changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
Expand Down
112 changes: 0 additions & 112 deletions .prettierignore

This file was deleted.

3 changes: 0 additions & 3 deletions .prettierrc

This file was deleted.

57 changes: 57 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
const { FlatCompat } = require('@eslint/eslintrc');
const js = require('@eslint/js');

const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
});

module.exports = [
{
ignores: [
'.DS_Store',
'node_modules',
'build',
'dist',
'package',
'.env',
'.env.*',
'!*.env.example',
'pnpm-lock.yaml',
'package-lock.json',
'yarn.lock',
],
},
...compat.config({
env: {
browser: true,
es2021: true,
node: true,
'jest/globals': true,
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:compat/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
tsconfigRootDir: __dirname,
project: ['./tsconfig.eslint.json', './packages/**/tsconfig.json'],
},
plugins: ['@typescript-eslint', 'eslint-plugin-tsdoc', 'jest', 'compat'],
rules: {
'tsdoc/syntax': 'warn',
'@typescript-eslint/prefer-as-const': 'warn',
camelcase: [
'error',
{
allow: ['rr_.*', 'legacy_.*', 'UNSAFE_.*', '__rrweb_.*'],
},
],
},
}),
];
67 changes: 35 additions & 32 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,40 +1,58 @@
{
"name": "@rrweb/_monorepo",
"private": true,
"description": "record and replay the web",
"repository": {
"type": "git",
"url": "git+ssh://git@github.com/rrweb-io/rrweb.git"
},
"keywords": [
"devtools",
"product-analytics",
"real-user-monitoring",
"rrweb"
],
"author": "rrweb Core Team <maintainers@rrweb.com>",
"license": "MIT",
"homepage": "https://github.com/rrweb-io/rrweb#readme",
"bugs": {
"url": "https://github.com/rrweb-io/rrweb/issues"
},
"private": true,
"homepage": "https://github.com/rrweb-io/rrweb#readme",
"license": "MIT",
"author": "rrweb Core Team <maintainers@rrweb.com>",
"repository": {
"type": "git",
"url": "git+ssh://git@github.com/rrweb-io/rrweb.git"
},
"workspaces": [
"packages/*",
"packages/plugins/*"
],
"scripts": {
"build:all": "NODE_OPTIONS='--max-old-space-size=4096' yarn turbo run prepublish",
"references:update": "yarn workspaces-to-typescript-project-references",
"test": "yarn turbo run test --concurrency=1 --continue",
"test:watch": "yarn turbo run test:watch",
"test:update": "yarn turbo run test:update",
"check-types": "yarn turbo run check-types --continue",
"format": "vp fmt . --write",
"format:head": "git diff --name-only HEAD^ | grep '\\.[tj]sx\\?$\\|\\.md$' | xargs vp fmt --write",
"dev": "yarn turbo run dev --concurrency=18",
"repl": "cd packages/rrweb && npm run repl",
"live-stream": "cd packages/rrweb && yarn live-stream",
"lint": "vp lint packages",
"lint:report": "node -e \"require('fs').writeFileSync('eslint_report.json','[]\\\\n')\" && vp lint packages",
"release": "yarn build:all && changeset publish"
},
"devDependencies": {
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.27.1",
"@eslint/eslintrc": "^3.3.1",
"@eslint/js": "^9.39.1",
"@monorepo-utils/workspaces-to-typescript-project-references": "^2.8.2",
"@types/prettier": "2.7.3",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"@typescript-eslint/eslint-plugin": "^8.61.0",
"@typescript-eslint/parser": "^8.61.0",
"browserslist": "^4.22.1",
"concurrently": "^7.1.0",
"cross-env": "^7.0.3",
"esbuild-plugin-umd-wrapper": "^2.0.0",
"eslint": "^8.53.0",
"eslint-plugin-compat": "^5.0.0",
"eslint": "^9.39.1",
"eslint-plugin-compat": "^7.0.2",
"eslint-plugin-jest": "^27.6.0",
"eslint-plugin-tsdoc": "^0.2.17",
"happy-dom": "^14.12.0",
Expand All @@ -43,31 +61,16 @@
"prettier": "2.8.4",
"rollup-plugin-visualizer": "^5.12.0",
"turbo": "^2.0.4",
"typescript": "^5.4.5"
},
"scripts": {
"build:all": "NODE_OPTIONS='--max-old-space-size=4096' yarn turbo run prepublish",
"references:update": "yarn workspaces-to-typescript-project-references",
"test": "yarn turbo run test --concurrency=1 --continue",
"test:watch": "yarn turbo run test:watch",
"test:update": "yarn turbo run test:update",
"check-types": "yarn turbo run check-types --continue",
"format": "yarn prettier --write '**/*.{ts,md}'",
"format:head": "git diff --name-only HEAD^ |grep '\\.ts$\\|\\.md$' |xargs yarn prettier --write",
"dev": "yarn turbo run dev --concurrency=18",
"repl": "cd packages/rrweb && npm run repl",
"live-stream": "cd packages/rrweb && yarn live-stream",
"lint": "yarn run concurrently --success=all -r -m=1 'yarn run markdownlint docs' 'ESLINT_USE_FLAT_CONFIG=false yarn eslint \"packages/**/src/**/*.{ts,tsx,js,jsx,svelte}\"'",
"lint:report": "ESLINT_USE_FLAT_CONFIG=false yarn eslint --output-file eslint_report.json --format json \"packages/**/src/**/*.{ts,tsx,js,jsx}\"",
"release": "yarn build:all && changeset publish"
"typescript": "^5.4.5",
"vite-plus": "^0.1.24"
},
"resolutions": {
"**/cssom": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz",
"**/@types/dom-webcodecs": "0.1.5"
"**/@types/dom-webcodecs": "0.1.5",
"**/cssom": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz"
},
"browserslist": [
"defaults",
"not op_mini all"
],
"packageManager": "yarn@1.22.19"
"packageManager": "yarn@1.22.22"
}
2 changes: 1 addition & 1 deletion packages/all/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"test:watch": "vitest watch",
"check-types": "tsc -noEmit",
"prepublish": "tsc -noEmit && vite build",
"lint": "yarn eslint src/**/*.ts"
"lint": "vp lint src"
},
"homepage": "https://github.com/rrweb-io/rrweb/tree/main/packages/@rrweb/all#readme",
"bugs": {
Expand Down
2 changes: 1 addition & 1 deletion packages/browser-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"retest:update": "cross-env PUPPETEER_HEADLESS=true yarn retest --update",
"check-types": "tsc -noEmit",
"prepublish": "tsc -noEmit && vite build",
"lint": "yarn eslint src/**/*.ts"
"lint": "vp lint src"
},
"homepage": "https://github.com/rrweb-io/rrweb/tree/main/packages/browser-client#readme",
"bugs": {
Expand Down
4 changes: 2 additions & 2 deletions packages/browser-client/test/integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,8 @@ ${JSON.stringify(defaultOptions(options))}
(metadataResponse) =>
Boolean(
metadataResponse &&
metadataResponse.metadata &&
Object.keys(metadataResponse.metadata).length,
metadataResponse.metadata &&
Object.keys(metadataResponse.metadata).length,
),
{ timeout: 8000, interval: 200 },
);
Expand Down
Loading
Loading