Skip to content

Latest commit

 

History

History
executable file
·
78 lines (53 loc) · 2.55 KB

DEVELOPER.md

File metadata and controls

executable file
·
78 lines (53 loc) · 2.55 KB

Developers Guide. Ish.

First:

  1. Install node.js
  2. Install n sudo npm install n -g
  3. Install yarn sudo npm install yarn -g

Getting started

$ n 12.18.4
$ git clone <your forked repository>
$ cd companion
$ yarn update
$ yarn dev

Code style

We use prettier to format the code in this project.

Many code editors support using prettier to format code you write. It is recommended to run yarn format before committing your changes to ensure any changes are correctly formatted.

Tools

Update all, including yarn in submodules [Core Devs, Mod Devs]

yarn update

Modules

When you're doing changes to modules in companion, you need to upgrade the git link in the core as well.

  1. Make sure you pull inside the module folder git pull origin master
  2. Do your changes
  3. Commit the changes with a nice message
  4. Push your changes git push origin HEAD:master

Now, in the core, we need to upgrade the reference to the module to the new version. For this we've made a tool. Go to the companion base directory (not inside the module):

cd companion
./tools/upgrade_module.sh <modulename>

When you want to create a new mynewmodule module that doesn't have a repository yet:

  1. cd ./lib/module/
  2. mkdir mynewmodule
  3. cd mynewmodule
  4. yarn init -y
  5. git init
  6. git add package.json
  7. git commit package.json -m "package.json"
  8. echo node_modules/ > .gitignore
  9. git add .gitignore
  10. git commit .gitignore -m "gitignore to ignore the node_modules/ folder"

Now, you need to ask the core developers to create a repository for your module, and wait for them to create the module repository.

When the repository gets created by a core developer, you can continue.

  1. git remote add origin https://github.com/bitfocus/companion-module-mynewmodule.git
  2. git push origin HEAD:master

Now we're at a point that the core developers must decide if its time to include this module in the companion core. But ask us on slack, and if we decide to add it - and we say it's done, you my proceed.

It's important that you didn't get any erros in the last push, because you're going to delete the code from your computer (make a backup if you're unsure).

  1. cd ..
  2. rm -rf mynewmodule
  3. cd ../../
  4. yarn update

The module should now appear in lib/module/mynewmodule, and if you want to change something in the module after this, you need to do your changes, commit it to the repository and read the beginning of the modules section in this document.

Questions? SLACK! :)