Skip to content

super-reality/sr-legacy-electron-client

Repository files navigation

Super Reality Client

semantic-release Commitizen friendly GitHub branch checks state GitHub package.json version

Installing

  1. switch to or branch from develop

  2. npm install (make sure to use Node 12.14.0, see troubleshooting)

  3. if not installed; npm install foreman -g

  4. run npm run electron-rebuild

  5. run npm run pre-build-iohook-win

Run from source

If this is the first time after installing:

npm run build or npm run electron-build

Once finished simply do npm run start

Problem Solving

If electron fails use these to debug the problem:

electron . npm run electron

Building

  • npm run build for desktop

  • npm run build:web for web

Debug

To open DevTools (show console errors, add breakpoints, etc) to the renderer use the keys Alt + Shift + D

To open the DevTools and the window of the background (used for OpenCv template matching) process you can use Alt + Shift + E

Testing

npm run jest:ci:watch opens jest watcher with common CI tests

npm run test:all Runs a single pass of lint + jest

To run or develop visual tests;

  • Build for web: npm run build:web
  • Start Jest server: npm run jest-server
  • Start Jest server: npm run jest-server (dont close it)
  • Start Jest watcher: npm run jest:watch

All visual tests are declared in src/__tests__/electron.ts and the code for the test component is in src/renderer/views/tests/index.tsx

Making changes

  1. For every new task Branch from develop

  2. Submit PR, merge into develop

We use commitzen to enforce commits format, You can use npx cz or npm run cm to create a new valid commit. Releases, semantic version numbers, tags, changelogs and publishing will automatically be handled based on these commits thanks to semantic-release (WIP).

Try to keep develop in a buildable and runnable state.

Troubleshooting

  • Node 12.14.0 is required, you can use nvm-windows or nvm to manage multiple versions of Node
    • Download the nvm installer
    • In a new command prompt, install Node: nvm install 12.14.0
    • After that, use that version: nvm use 12.14.0
  • If you get an error about not being able to find the /fx folder try running npm run electron-build again