Skip to content

Latest commit

 

History

History
87 lines (62 loc) · 1.99 KB

CONTRIBUTING.md

File metadata and controls

87 lines (62 loc) · 1.99 KB

Contribution Guide

  • Use Masterchat with DEBUG=masterchat and report logs that are prefixed with [action required]
  • Squash TODOs

Join our Discord to participate in discussions.

Build

git clone https://github.com/holodata/masterchat
cd masterchat
git switch dev
npm install
npm run build

Development Flow

In masterchat dir:

npm run build
npm link # link local masterchat package
npm run dev # watch and transpile files

Clone and build Masterchat CLI:

git clone https://github.com/holodata/masterchat-cli ../masterchat-cli
cd masterchat-cli
npm install
npm run build
npm link # make local `masterchat` and `mc` command available on the shell

In masterchat-cli dir, link local masterchat module and rebuild the cli:

npm link masterchat # now `masterchat-cli` uses local `masterchat` module
npm run build
DEBUG=masterchat mc live <videoId>
DEBUG=masterchat mc events

Testing

Setup

Export necessary env vars:

export MC_TEST_VIDEO_ID=<video ID of the unlisted live stream from the `MC_TEST_CHANNEL_ID` channel>
export MC_TEST_CHANNEL_ID=<primary test channel id>
export MC_TEST_CHANNEL_ID_2=<secondary test channel id>
export MC_TEST_CREDENTIAL=<base64-encoded credentials of primary test channel id>
export MC_TEST_CREDENTIAL_2=<base64-encoded credentials of secondary test channel id>

Use https://github.com/holodata/masterchat/tree/master/extra/credential-fetcher to obtain base64-encoded credentials.

Record API response while testing

Test while recording response (run only once):

NOCK_BACK_MODE=record vitest --run

Run tests using recorded response

vitest

Disable fixtures completely:

NOCK_BACK_MODE=wild vitest

Release Flow (Maintainers only)

np