Skip to content

Commit

Permalink
ref: tweaks to tasks to get builds/pkg names working for Sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
billyvg committed Jan 23, 2025
1 parent 2c3161e commit 37dcc9c
Show file tree
Hide file tree
Showing 76 changed files with 864 additions and 446 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:

- name: Build Tarballs
env:
NODE_OPTIONS: "--max_old_space_size=4096"
NODE_OPTIONS: '--max_old_space_size=4096'
run: yarn build:tarball

- name: Upload Artifacts
Expand Down
39 changes: 0 additions & 39 deletions .github/workflows/size-check.yml

This file was deleted.

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ From this monorepo, Sentry maintains and publishes the following NPM packages:
- `@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))
- `@sentry-internal/rrweb-types` (corresponds to the [original `@rrweb/types` package](https://www.npmjs.com/package/@rrweb/types))
- `@sentry-internal/rrweb-worker` (new package)

## Major changes from upstream branch

Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"typescript": "^4.9.5"
},
"scripts": {
"build:all": "NODE_OPTIONS='--max-old-space-size=4096' yarn run concurrently --success=all -r -m=1 'yarn workspaces-to-typescript-project-references' 'yarn turbo run prepare'",
"build:all": "NODE_OPTIONS='--max-old-space-size=4096' yarn run concurrently --success=all -r -m=1 'yarn workspaces-to-typescript-project-references' 'yarn turbo run prepack'",
"build:tarball": "yarn lerna run build:tarball",
"test": "yarn run concurrently --success=all -r -m=1 'yarn workspaces-to-typescript-project-references --check' 'yarn turbo run test --concurrency=1 --continue'",
"test:watch": "yarn turbo run test:watch",
Expand All @@ -54,7 +54,6 @@
"format:head": "git diff --name-only HEAD^ |grep '\\.ts$\\|\\.md$' |xargs yarn prettier --write",
"dev": "CLEAR_DIST_DIR=false yarn turbo run dev --concurrency=17",
"repl": "cd packages/rrweb && npm run repl",
"typings": "yarn turbo run typings",
"live-stream": "cd packages/rrweb && yarn live-stream",
"lint": "yarn run concurrently --success=all -r -m=1 'yarn run markdownlint docs' 'yarn eslint packages/*/src --ext .ts,.tsx,.js,.jsx,.svelte'",
"lint:report": "yarn eslint --output-file eslint_report.json --format json packages/*/src --ext .ts,.tsx,.js,.jsx",
Expand Down
8 changes: 4 additions & 4 deletions packages/all/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"test": "vitest run",
"test:watch": "vitest watch",
"check-types": "tsc -noEmit",
"prepublish": "npm run build",
"prepack": "npm run build",
"lint": "yarn eslint src/**/*.ts"
},
"homepage": "https://github.com/rrweb-io/rrweb/tree/main/packages/@rrweb/all#readme",
Expand Down Expand Up @@ -56,9 +56,9 @@
"typescript": "^4.7.3"
},
"dependencies": {
"@rrweb/types": "^2.0.0-alpha.14",
"@rrweb/packer": "^2.0.0-alpha.14",
"rrweb": "^2.0.0-alpha.14"
"@sentry-internal/rrweb": "^2.0.0-alpha.14",
"@sentry-internal/rrweb-packer": "^2.0.0-alpha.14",
"@sentry-internal/rrweb-types": "^2.0.0-alpha.14"
},
"browserslist": [
"supports es6-class"
Expand Down
4 changes: 2 additions & 2 deletions packages/all/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export * from 'rrweb';
export * from '@rrweb/packer';
export * from '@sentry-internal/rrweb';
export * from '@sentry-internal/rrweb-packer';
// export * from '@rrweb/rrweb-plugin-console-record';
// export * from '@rrweb/rrweb-plugin-console-replay';
10 changes: 5 additions & 5 deletions packages/all/test/cross-origin-iframe-packer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ import type {
eventWithTime,
listenerHandler,
mutationData,
} from '@rrweb/types';
import { unpack } from '@rrweb/packer';
} from '@sentry-internal/rrweb-types';
import { unpack } from '@sentry-internal/rrweb-packer';
import * as fs from 'fs';
import * as path from 'path';
import type * as puppeteer from 'puppeteer';
import type { recordOptions } from 'rrweb';
import type {} from '@rrweb/types';
import { EventType } from '@rrweb/types';
import type { recordOptions } from '@sentry-internal/rrweb';
import type {} from '@sentry-internal/rrweb-types';
import { EventType } from '@sentry-internal/rrweb-types';
import {
assertSnapshot,
getServerURL,
Expand Down
4 changes: 2 additions & 2 deletions packages/all/test/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NodeType } from 'rrweb-snapshot';
import { NodeType } from '@sentry-internal/rrweb-snapshot';
import { expect } from 'vitest';
import {
EventType,
Expand All @@ -8,7 +8,7 @@ import {
mouseInteractionData,
event,
pluginEvent,
} from '@rrweb/types';
} from '@sentry-internal/rrweb-types';
import * as puppeteer from 'puppeteer';
import * as path from 'path';
import * as http from 'http';
Expand Down
8 changes: 5 additions & 3 deletions packages/all/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src"],
"include": [
"src"
],
"compilerOptions": {
"rootDir": "src",
"tsBuildInfoFile": "./tsconfig.tsbuildinfo"
},
"references": [
{
"path": "../types"
"path": "../rrweb"
},
{
"path": "../packer"
},
{
"path": "../rrweb"
"path": "../types"
}
]
}
9 changes: 5 additions & 4 deletions packages/packer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rrweb/packer",
"version": "2.0.0-alpha.14",
"name": "@sentry-internal/rrweb-packer",
"version": "2.31.0",
"publishConfig": {
"access": "public"
},
Expand All @@ -11,10 +11,11 @@
"scripts": {
"dev": "vite build --watch",
"build": "tsc -noEmit && vite build",
"build:tarball": "npm pack",
"test": "vitest run",
"test:watch": "vitest watch",
"check-types": "tsc -noEmit",
"prepublish": "npm run build",
"prepack": "npm run build",
"lint": "yarn eslint src/**/*.ts"
},
"homepage": "https://github.com/rrweb-io/rrweb/tree/main/packages/@rrweb/packer#readme",
Expand Down Expand Up @@ -78,7 +79,7 @@
},
"dependencies": {
"fflate": "^0.4.4",
"@rrweb/types": "^2.0.0-alpha.14"
"@sentry-internal/rrweb-types": "^2.31.0"
},
"browserslist": [
"supports es6-class"
Expand Down
4 changes: 2 additions & 2 deletions packages/packer/src/pack.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { strFromU8, strToU8, zlibSync } from 'fflate';
import type { PackFn } from '@rrweb/types';
import type { PackFn, eventWithTime } from '@sentry-internal/rrweb-types';
import { eventWithTimeAndPacker, MARK } from './base';

export const pack: PackFn = (event) => {
export const pack: PackFn = (event: eventWithTime) => {
const _e: eventWithTimeAndPacker = {
...event,
v: MARK,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"dev": "vite build --watch",
"build": "tsc -noEmit && vite build",
"check-types": "tsc -noEmit",
"prepublish": "npm run build"
"prepack": "npm run build"
},
"repository": {
"type": "git",
Expand All @@ -43,12 +43,12 @@
},
"homepage": "https://github.com/rrweb-io/rrweb#readme",
"devDependencies": {
"rrweb": "^2.0.0-alpha.14",
"@sentry-internal/rrweb": "^2.0.0-alpha.14",
"typescript": "^4.7.3",
"vite": "^5.2.8",
"vite-plugin-dts": "^3.8.1"
},
"peerDependencies": {
"rrweb": "^2.0.0-alpha.14"
"@sentry-internal/rrweb": "^2.0.0-alpha.14"
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{
"extends": "../../../tsconfig.base.json",
"include": ["src"],
"exclude": ["vite.config.ts"],
"include": [
"src"
],
"exclude": [
"vite.config.ts"
],
"compilerOptions": {
"rootDir": "src",
"tsBuildInfoFile": "./tsconfig.tsbuildinfo"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"dev": "vite build --watch",
"build": "tsc -noEmit && vite build",
"check-types": "tsc -noEmit",
"prepublish": "npm run build"
"prepack": "npm run build"
},
"repository": {
"type": "git",
Expand All @@ -43,12 +43,12 @@
},
"homepage": "https://github.com/rrweb-io/rrweb#readme",
"devDependencies": {
"rrweb": "^2.0.0-alpha.14",
"@sentry-internal/rrweb": "^2.0.0-alpha.14",
"typescript": "^4.7.3",
"vite": "^5.2.8",
"vite-plugin-dts": "^3.8.1"
},
"peerDependencies": {
"rrweb": "^2.0.0-alpha.14"
"@sentry-internal/rrweb": "^2.0.0-alpha.14"
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { RRNode } from '@sentry-internal/rrdom';
import type { Mirror } from '@sentry-internal/rrweb-snapshot';
import SimplePeer from 'simple-peer-light';
import type { ReplayPlugin, Replayer } from 'rrweb';
import type { ReplayPlugin, Replayer } from '@sentry-internal/rrweb';
import type { WebRTCDataChannel } from './types';

// TODO: restrict callback to real nodes only, or make sure callback gets called when real node gets added to dom as well
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{
"extends": "../../../tsconfig.base.json",
"include": ["src"],
"exclude": ["vite.config.ts"],
"include": [
"src"
],
"exclude": [
"vite.config.ts"
],
"compilerOptions": {
"rootDir": "src",
"tsBuildInfoFile": "./tsconfig.tsbuildinfo"
Expand Down
6 changes: 3 additions & 3 deletions packages/plugins/rrweb-plugin-console-record/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"test:watch": "vitest watch",
"build": "tsc -noEmit && vite build",
"check-types": "tsc -noEmit",
"prepublish": "npm run build"
"prepack": "npm run build"
},
"repository": {
"type": "git",
Expand All @@ -45,14 +45,14 @@
},
"homepage": "https://github.com/rrweb-io/rrweb#readme",
"devDependencies": {
"rrweb": "^2.0.0-alpha.14",
"@sentry-internal/rrweb": "^2.0.0-alpha.14",
"typescript": "^4.7.3",
"vite": "^5.2.8",
"vite-plugin-dts": "^3.8.1",
"vitest": "^1.4.0",
"puppeteer": "^20.9.0"
},
"peerDependencies": {
"rrweb": "^2.0.0-alpha.14"
"@sentry-internal/rrweb": "^2.0.0-alpha.14"
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { eventWithTime } from '@rrweb/types';
import { record } from 'rrweb';
import type { eventWithTime } from '@sentry-internal/rrweb-types';
import { record } from '@sentry-internal/rrweb';
import { getRecordConsolePlugin } from '../../src/index';

window.Date.now = () => new Date(Date.UTC(2018, 10, 15, 8)).valueOf();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { stringifySnapshots } from '../../../rrweb/test/utils';
import { createServer, ViteDevServer } from 'vite';
import * as puppeteer from 'puppeteer';
import type { Browser, Page } from 'puppeteer';
import type { eventWithTime } from '@rrweb/types';
import type { eventWithTime } from '@sentry-internal/rrweb-types';

export async function launchPuppeteer(
options?: Parameters<(typeof puppeteer)['launch']>[0],
Expand Down
11 changes: 8 additions & 3 deletions packages/plugins/rrweb-plugin-console-record/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
{
"extends": "../../../tsconfig.base.json",
"include": ["src"],
"exclude": ["vite.config.ts", "vitest.config.ts", "test"],
"include": [
"src"
],
"exclude": [
"vite.config.ts",
"vitest.config.ts",
"test"
],
"compilerOptions": {
"rootDir": "src",
"tsBuildInfoFile": "./tsconfig.tsbuildinfo",

// TODO: enable me in the future
// at time of writing (April 2024) there are 6 errors in this package
"strict": false
Expand Down
6 changes: 3 additions & 3 deletions packages/plugins/rrweb-plugin-console-replay/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"dev": "vite build --watch",
"build": "tsc -noEmit && vite build",
"check-types": "tsc -noEmit",
"prepublish": "npm run build"
"prepack": "npm run build"
},
"repository": {
"type": "git",
Expand All @@ -44,12 +44,12 @@
"homepage": "https://github.com/rrweb-io/rrweb#readme",
"devDependencies": {
"@rrweb/rrweb-plugin-console-record": "^2.0.0-alpha.14",
"rrweb": "^2.0.0-alpha.14",
"@sentry-internal/rrweb": "^2.0.0-alpha.14",
"typescript": "^4.7.3",
"vite": "^5.2.8",
"vite-plugin-dts": "^3.8.1"
},
"peerDependencies": {
"rrweb": "^2.0.0-alpha.14"
"@sentry-internal/rrweb": "^2.0.0-alpha.14"
}
}
10 changes: 8 additions & 2 deletions packages/plugins/rrweb-plugin-console-replay/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
{
"extends": "../../../tsconfig.base.json",
"include": ["src"],
"exclude": ["vite.config.ts", "dist", "tsconfig.json"],
"include": [
"src"
],
"exclude": [
"vite.config.ts",
"dist",
"tsconfig.json"
],
"compilerOptions": {
"rootDir": ".",
"tsBuildInfoFile": "./tsconfig.tsbuildinfo"
Expand Down
Loading

0 comments on commit 37dcc9c

Please sign in to comment.