Skip to content

Latest commit

 

History

History
211 lines (146 loc) · 7.4 KB

CONTRIBUTING.md

File metadata and controls

211 lines (146 loc) · 7.4 KB

Contributing to Ferdi 5

🎉 First off, thanks for taking the time and your effort to make Ferdi better! 🎉

Table of contents

Code of Conduct

This project and everyone participating in it is governed by the Ferdi Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to stefan@adlk.io.

What should I know before I get started?

For the moment, Ferdi's development is a bit slow but all contributions are highly appreciated. Check this issue for discussion.

How Can I Contribute?

As a basic rule, before filing issues, feature requests or anything else. Take a look at the issues and check if this has not already been reported by another user. If so, engage in the already existing discussion.

Setting up your Development machine

Install System-level dependencies

Node.js, npm, node-gyp

Please make sure you are running the exact node version used by the developers/contributors as specified in the nvmrc file.

Currently, these are the combinations of system dependencies that work on an intel-based machines for MacOS/Linux/Windows (building on an ARM-based machine is still a work-in-progress due to node-sass native dependencies)

node -v
v14.16.1
npm -v
6.14.12
node-gyp -v
v8.0.0

Git

The version 2.23.0 for Git is working fine for development. You can then use the console from Git to do the development procedure.

Note: This list can likely get outdated. If so, please refer to the specific version of the electronuserland builder that we use in our Dockerfile.

Debian/Ubuntu

apt install ca-certificates curl netbase wget tzdata rpm

Fedora

dnf install libX11-devel libXext-devel libXScrnSaver-devel libxkbfile-devel rpm

Windows

Please make sure you run this command as an administrator:

npm i -g windows-build-tools --vs2015

Clone repository with submodule

git clone https://github.com/getferdi/ferdi.git
cd ferdi
git submodule update --init --recursive

It is important you execute the last command to get the required submodules (recipes, server).

Local caching of dependencies

Set these env vars into your profile (or if you use direnv, you can manage them via the respective .envrc file)

export ELECTRON_CACHE=$HOME/.cache/electron
export ELECTRON_BUILDER_CACHE=$HOME/.cache/electron-builder

Install dependencies

Run the following command to install all dependencies, and link sibling modules with Ferdi.

npx lerna bootstrap

If you previously ran npm install, it sometimes is necessary to delete your node_modules folder before running npx lerna bootstrap. If you encounter the gyp: No Xcode or CLT version error on macOS at this step, please have a look here.

Fix native modules to match current electron node version

npm run rebuild

Package recipe repository

Ferdi requires its recipes to be packaged before it can use it. When running Ferdi as a development instance, you'll need to package the local recipes before you can create any services inside Ferdi.

cd recipes && npm i && npm run package

Using Docker to build an rpm package

docker build -t ferdi-package .

The above will place all the built artifacts into the /ferdi folder within the image.

If you want to copy them outside of the image, simply mount a volume into a different location, and copy all files from /ferdi into the mounted folder (/ferdi-out in the example command below).

DATE=`date +"%Y-%b-%d-%H-%M"`
mkdir -p ~/Downloads/$DATE
docker run -e GIT_SHA=`git rev-parse --short HEAD` -v ~/Downloads/$DATE:/ferdi-out -it ferdi-package sh
# inside the container:
mv /ferdi/Ferdi-*.AppImage /ferdi-out/Ferdi-$GIT_SHA.AppImage
mv /ferdi/ferdi-*.tar.gz /ferdi-out/Ferdi-$GIT_SHA.tar.gz
mv /ferdi/ferdi-*.x86_64.rpm /ferdi-out/Ferdi-x86_64-$GIT_SHA.rpm
mv /ferdi/ferdi_*_amd64.deb /ferdi-out/Ferdi-amd64-$GIT_SHA.deb
mv /ferdi/ferdi /ferdi-out/Ferdi-$GIT_SHA
mv /ferdi/latest-linux.yml /ferdi-out/latest-linux-$GIT_SHA.yml

Start development app

Run these two commands simultaneously in different terminals:

npm run dev
DEBUG=Ferdi:* npm run start

Optionally, you can run both commands in one terminal with misty (see misty.yml):

DEBUG=Ferdi:* npx misty

Note: please prefer debug() over console.log().

Styleguide

Git Commit Messages format

  • Use the present tense ("Add feature" not "Added feature")
  • Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
  • Limit the first line to 72 characters or less
  • Reference issues and pull requests liberally after the first line
  • When only changing documentation, include [ci skip] in the commit description

Javascript Coding style-checker

  • Please use es-lint and the defined rules to maintain a consistent style

Packaging

npm run build

Assets will be available in the out folder.

Release

Create a new draft release that targets the release branch, then:

git checkout develop && git pull -r
git checkout release
git submodule update --remote --force
git commit -am "Update submodules"
git merge --no-ff develop
git push

Once the draft release assets are uploaded (13 assets), publish the release (you will need elevated permissions in GitHub for doing this). The last commit of the release branch will be tagged. You can then merge release into master and back into develop if needed