File tree Expand file tree Collapse file tree 5 files changed +4
-38
lines changed Expand file tree Collapse file tree 5 files changed +4
-38
lines changed Original file line number Diff line number Diff line change 11/* eslint-disable @typescript-eslint/no-unsafe-member-access */
22import { getCurrentHub } from '@sentry/core' ;
33import type { ReplayRecordingData , Transport } from '@sentry/types' ;
4- import { TextEncoder } from 'util' ;
4+ import { TextEncoder } from 'util' ;
55
66import type { ReplayContainer , Session } from './src/types' ;
77
8- // @ts -ignore TS error, this is replaced in prod builds bc of rollup
9- global . __SENTRY_REPLAY_VERSION__ = 'version:Test' ;
10-
118( global as any ) . TextEncoder = TextEncoder ;
129
1310type MockTransport = jest . MockedFunction < Transport [ 'send' ] > ;
Original file line number Diff line number Diff line change 1- import replace from '@rollup/plugin-replace' ;
2-
31import { makeBaseBundleConfig , makeBundleConfigVariants } from '../../rollup/index.js' ;
42
5- import pkg from './package.json' ;
6-
73const baseBundleConfig = makeBaseBundleConfig ( {
84 bundleType : 'addon' ,
95 entrypoints : [ 'src/index.ts' ] ,
106 jsVersion : 'es6' ,
117 licenseTitle : '@sentry/replay' ,
128 outputFileBase : ( ) => 'bundles/replay' ,
13- packageSpecificConfig : {
14- plugins : [
15- replace ( {
16- preventAssignment : true ,
17- values : {
18- __SENTRY_REPLAY_VERSION__ : JSON . stringify ( pkg . version ) ,
19- } ,
20- } ) ,
21- ] ,
22- } ,
239} ) ;
2410
2511const builds = makeBundleConfigVariants ( baseBundleConfig ) ;
Original file line number Diff line number Diff line change 11import path from 'path' ;
22
3- import replace from '@rollup/plugin-replace' ;
4-
53import { makeBaseNPMConfig , makeNPMConfigVariants } from '../../rollup/index' ;
64
7- import pkg from './package.json' ;
8-
95export default makeNPMConfigVariants (
106 makeBaseNPMConfig ( {
117 hasBundles : true ,
128 packageSpecificConfig : {
13- plugins : [
14- // TODO: Remove this - replay version will be in sync w/ SDK version
15- replace ( {
16- preventAssignment : true ,
17- values : {
18- __SENTRY_REPLAY_VERSION__ : JSON . stringify ( pkg . version ) ,
19- } ,
20- } ) ,
21- ] ,
229 output : {
2310 // set exports to 'named' or 'auto' so that rollup doesn't warn about
2411 // the default export in `worker/worker.js`
Original file line number Diff line number Diff line change @@ -29,10 +29,6 @@ export interface WorkerRequest {
2929 args : unknown [ ] ;
3030}
3131
32- declare global {
33- const __SENTRY_REPLAY_VERSION__ : string ;
34- }
35-
3632// PerformancePaintTiming and PerformanceNavigationTiming are only available with TS 4.4 and newer
3733// Therefore, we're exporting them here to make them available in older TS versions
3834export type PerformancePaintTiming = PerformanceEntry ;
Original file line number Diff line number Diff line change @@ -30,12 +30,12 @@ export async function prepareReplayEvent({
3030
3131 // extract the SDK name because `client._prepareEvent` doesn't add it to the event
3232 const metadata = client . getSdkMetadata && client . getSdkMetadata ( ) ;
33- const name = ( metadata && metadata . sdk && metadata . sdk . name ) || 'sentry.javascript.unknown' ;
33+ const { name, version } = ( metadata && metadata . sdk ) || { } ;
3434
3535 preparedEvent . sdk = {
3636 ...preparedEvent . sdk ,
37- version : __SENTRY_REPLAY_VERSION__ ,
38- name ,
37+ name : name || 'sentry.javascript.unknown' ,
38+ version : version || '0.0.0' ,
3939 } ;
4040
4141 return preparedEvent ;
You can’t perform that action at this time.
0 commit comments