Skip to content

Commit

Permalink
build: remove webrtc from external
Browse files Browse the repository at this point in the history
  • Loading branch information
xstelea committed Nov 28, 2023
1 parent 46b84bf commit ba9b771
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
2 changes: 0 additions & 2 deletions rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,10 @@ export default [
},
],
plugins: [typescript()],
external: ['@koush/wrtc'],
},
{
input: 'dist/types/radix-connect-webrtc.d.ts',
output: [{ file: 'dist/radix-connect-webrtc.d.ts', format: 'es' }],
plugins: [dts()],
external: ['@koush/wrtc'],
},
]
9 changes: 8 additions & 1 deletion src/connector/__tests__/webrtc.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// @ts-nocheck
import webRTC from '@koush/wrtc'
import { ConnectorClient } from '../connector-client'
import type { SignalingSubjectsType } from '../signaling/subjects'
import { SignalingSubjects } from '../signaling/subjects'
Expand All @@ -9,9 +11,14 @@ import { filter, firstValueFrom, Subject } from 'rxjs'
import { delayAsync } from '../../test-utils/delay-async'
import { Logger } from 'tslog'
import { generateConnectionPassword } from '../helpers'
import { NodeWebRTC } from '../../dependencies/webrtc'
import { NodeWebSocket } from '../../dependencies/websocket'

const NodeWebRTC = (): WebRTC => ({
RTCIceCandidate: webRTC.RTCIceCandidate,
RTCSessionDescription: webRTC.RTCSessionDescription,
RTCPeerConnection: webRTC.RTCPeerConnection,
})

describe('connector client', () => {
let extensionLogger = new Logger({ name: 'extensionConnector', minLevel: 0 })
let walletLogger = new Logger({ name: 'walletConnector', minLevel: 2 })
Expand Down
9 changes: 0 additions & 9 deletions src/dependencies/webrtc.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// @ts-nocheck
import webRTC from '@koush/wrtc'

type AConstructorTypeOf<A, T> = new (args: A) => T

export type WebRTC = {
Expand All @@ -12,12 +9,6 @@ export type WebRTC = {
RTCPeerConnection: AConstructorTypeOf<RTCConfiguration, RTCPeerConnection>
}

export const NodeWebRTC = (): WebRTC => ({
RTCIceCandidate: webRTC.RTCIceCandidate,
RTCSessionDescription: webRTC.RTCSessionDescription,
RTCPeerConnection: webRTC.RTCPeerConnection,
})

export const BrowserWebRTC = (): WebRTC => ({
RTCIceCandidate: RTCIceCandidate,
RTCSessionDescription: RTCSessionDescription,
Expand Down

0 comments on commit ba9b771

Please sign in to comment.