Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@
"options": {
"singleQuote": false
}
},
{
"files": "for-developers/**/*.md, for-developers/**/*.mdx",
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
"options": {
"proseWrap": "always",
"printWidth": 80,
"useTabs": false,
"tabWidth": 2
}
}
]
}
164 changes: 111 additions & 53 deletions for-developers/Satellite-API.md

Large diffs are not rendered by default.

60 changes: 44 additions & 16 deletions for-developers/core-development/build-companion.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ sidebar_position: 12
description: Sharing your modified Companion with others
---

The Companion repo allows you to build a distributable binary from sources by running
The Companion repo allows you to build a distributable binary from sources by
running

```bash
yarn dist
Expand All @@ -19,51 +20,78 @@ You can also cross-build for a specific platform using one of the following:
- macOS intel: `yarn macdist`
- macOS Apple silicon: `yarn macarmdist`

The build will be added to a sub-directory of _electron-output/_ named _xxx_-unpacked. For example _electron-output/linux-unpacked_ or _electron-output/win-unpacked_.
The build will be added to a sub-directory of _electron-output/_ named
_xxx_-unpacked. For example _electron-output/linux-unpacked_ or
_electron-output/win-unpacked_.

There you will find a binary to run a Headed build (a system with a monitor, keyboard, and mouse).
On Windows it is named _Companion.exe_ on linux it is named _companion-launcher_
There you will find a binary to run a Headed build (a system with a monitor,
keyboard, and mouse). On Windows it is named _Companion.exe_ on linux it is
named _companion-launcher_

Windows builds also include an installer program named _companion-win64.exe_ in _electron-output/_ (not _electron-output/win-unpacked_!), which can be distributed independently of the "unpacked" contents.
Windows builds also include an installer program named _companion-win64.exe_ in
_electron-output/_ (not _electron-output/win-unpacked_!), which can be
distributed independently of the "unpacked" contents.

Linux builds include a shell script to run headless named _companion_headless.sh_
Linux builds include a shell script to run headless named
_companion_headless.sh_

You can also start a "headless" run manually by running main.js from xxx-unpacked/resources, i.e.:
You can also start a "headless" run manually by running main.js from
xxx-unpacked/resources, i.e.:

```bash
./node-runtimes/main/bin/node main.js
```

:::info[Linux note]
To build Windows distributables from Linux systems (even WSL) you must install Wine first:

To build Windows distributables from Linux systems (even WSL) you must install
Wine first:

```bash
sudo apt install wine
sudo bash -c “dpkg --add-architecture i386 && apt-get update && apt-get install wine32:i386”
```

note: if your wine config gets corrupted, delete `~/.wine`.

:::

:::info[Windows note]
The very end of ‘yarn dist’ (signing) creates symlinks. By default, Windows restricts symlink creation, so this step will fail. You have three options to allow building Companion in Windows:

The very end of ‘yarn dist’ (signing) creates symlinks. By default, Windows
restricts symlink creation, so this step will fail. You have three options to
allow building Companion in Windows:

1. Run `yarn dist` in a shell with Administrator privileges.
2. Turn on Developer Mode in Windows Settings. (Open Settings and search for "developer"):
2. Turn on Developer Mode in Windows Settings. (Open Settings and search for
"developer"):

![image](images/developers-setting.png)
![Windows Developer Settings](images/developers-setting.png)

3. Set a local policy in the “Local Security Policy” editor: Security Settings > Local Policies > User Rights Assignment: Create symbolic links, to allow yourself to create symlinks:
3. Set a local policy in the “Local Security Policy” editor: Security Settings >
Local Policies > User Rights Assignment: Create symbolic links, to allow
yourself to create symlinks:

![image](images/set-symlink-permission.png)
![Windows Symlink Permissions](images/set-symlink-permission.png)

:::

:::tip[Windows Tip]
Windows Antimalware Executable can slow down build times by 50-100%. You can improve performance by excluding certain folders: After cloning the companion repo and running `yarn install` the first time (see [Developing Core Companion](development-flow.md)) go to Windows Security > Virus and Threat Protection > Exclusions and add node_modules from your companion root. For completeness and a slight additional boost add: cache, dist, electron-output, shared-lib\dist, webui\build, and companion\dist.
You may want/need to exclude these folders from backup apps too.

Windows Antimalware Executable can slow down build times by 50-100%. You can
improve performance by excluding certain folders: After cloning the companion
repo and running `yarn install` the first time (see
[Developing Core Companion](development-flow.md)) go to Windows Security > Virus
and Threat Protection > Exclusions and add node_modules from your companion
root. For completeness and a slight additional boost add: cache, dist,
electron-output, shared-lib\dist, webui\build, and companion\dist. You may
want/need to exclude these folders from backup apps too.

:::

:::danger[Raspberry Pi]
It is not recommended to run Companion on a Raspberry Pi with the desktop environment installed.

It is not recommended to run Companion on a Raspberry Pi with the desktop
environment installed.

:::
Loading