# Development

## Local

```
npm run watch
```

## Build

```
npm run build
```

## Build (Web)

```
npm run build:web
```

# Architecture

The main entrypoint of the Chrome extension is `src/content.ts`.

Most of the logic lives is `src/overlay.ts` where the `renderOverlay` function is defined.

```
/src (all source code)
  /background.ts (extension background worker)
  /content.ts (extension injected script)
  /options.ts (extension options configuration options logic)
  /options.html (extension options configuration options html)
  /options.html (extension options popup html)
  /menu.ts (helper for rendering ring menu menu.json)
  /web.ts (exposes the library code as a global object)
  /mjpg.ts (util test client for watching the metadata stream)
  /live.ts (util test client for testing live streaming locally)
  /cc.ts (abstract wrappers for websocket and rtc)
```

# Deployment (Library)

First increase the library version, then run:

```
npm publish
```

Then on the host project:

```
npm i museme@latest
```

# Deployment (Chrome Extension)

To install the extension on Chrome, in development:

```
npm run watch
```

Then go to:

```
chrome://extensions
```

Click on "Load unpacked".

To deploy extension on Chrome Store:

```
npm run build
npm run zip
```

Then upload `extension.zip`.
