From ffc19366abb3d2b896c70dce848ed3983ba03d7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5vard=20Holvik?= Date: Wed, 8 Nov 2023 15:14:56 +0100 Subject: [PATCH] Fix build and lint warnings Fixes some noise in the console, removes Vite-specific hack from README. --- README.md | 14 -------------- package.json | 2 +- rollup.config.js | 1 + src/lib/__tests__/LocalMedia.spec.ts | 2 -- src/lib/api/credentialsService/index.ts | 2 +- 5 files changed, 3 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index ceef75c6..da08648c 100644 --- a/README.md +++ b/README.md @@ -102,20 +102,6 @@ function MyCallUX( { roomUrl, localStream }) { ``` -#### Usage with Vite development environment - -There is a [known Vite issue](https://github.com/vitejs/vite/issues/1973) where modules trying to access `process.env` throw `Uncaught ReferenceError: process is not defined`. -This can be solved in `vite.config.js` with the following line: - -``` javascript -export default defineConfig({ - ...rest, - define: { - 'process.env': {} - }, -}); -``` - #### Usage with Next.js If you are integrating these React hooks with Next.js, you need to ensure your diff --git a/package.json b/package.json index d33ddcaa..cfd35191 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@whereby.com/browser-sdk", - "version": "2.0.0-alpha28", + "version": "2.0.0-beta3", "description": "Modules for integration Whereby video in web apps", "author": "Whereby AS", "license": "MIT", diff --git a/rollup.config.js b/rollup.config.js index 831e9e06..a7ecfded 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -102,6 +102,7 @@ module.exports = [ { input: "src/lib/react/index.ts", output: [{ file: "dist/react/index.d.ts", format: "es" }], + external: ["@whereby/jslib-media/src/webrtc/RtcManager"], plugins: [dts()], }, { diff --git a/src/lib/__tests__/LocalMedia.spec.ts b/src/lib/__tests__/LocalMedia.spec.ts index 712d91a5..8df60dfb 100644 --- a/src/lib/__tests__/LocalMedia.spec.ts +++ b/src/lib/__tests__/LocalMedia.spec.ts @@ -25,8 +25,6 @@ Object.defineProperty(navigator, "mediaDevices", { value: mockMediaDevices, }); -const mockedMediaDevices = jest.mocked(navigator.mediaDevices); - describe("LocalMedia", () => { describe("constructor", () => { describe("when passing constraints", () => { diff --git a/src/lib/api/credentialsService/index.ts b/src/lib/api/credentialsService/index.ts index 47ade083..8bab1a40 100644 --- a/src/lib/api/credentialsService/index.ts +++ b/src/lib/api/credentialsService/index.ts @@ -6,7 +6,7 @@ import ChromeStorageStore from "../modules/ChromeStorageStore"; import LocalStorageStore from "../modules/LocalStorageStore"; import ApiClient from "../ApiClient"; import localStorage from "../localStorageWrapper"; -import { Credentials } from ".."; +import Credentials from "../Credentials"; /** * Events triggered by this service