In this directory apps/remixdesktop, yarn, then run: yarn start:dev to boot the electron app
In chrome chrome://inspect/#devices you can add localhost:5858 to the network targets and then you will see an inspect button electron/js2c/browser_init
file:///
You can use that to inspect the output of the electron app
Then app will be started in live reload mode, anything you do in Remix IDE will be reloaded.
It will not however reload electron code. You need to rerun yarn start:dev every time.
If you run into issues with yarn when native node modules are being rebuilt you need
- Windows: install Visual Studio Tools with Desktop Development C++ enabled in the Workloads
- MacOS: install Xcode or Xcode Command Line Tools
- Linux: unknown, probably a C++ compiler
## Builds
Builds can be found in the artefacts of CI.
### Electron Plugin
Electron has its own Plugin Engine, which holds plugins, these plugins have plugin clients attached to them. Each of those clients is created when an instance of Remix Desktop connects
and activates a plugin. Follow all these steps to make that work.
1. create a plugin file in apps/remixdesktop/src/plugins
2. add imports:
```
import { Profile } from '@remixproject/plugin-utils'
import { ElectronBasePlugin, ElectronBasePluginClient } from '@remixproject/plugin-electron'
The ElectronBasePluginClient is the specific instance which will be connected to the IDE. The BasePlugin is just holding all the clients for all the instances.
Any instance specific code is set as functions on the ElectronBasePluginClient class.
6. If you need fs access you need to track the workingdir like we do here:
This ensures you know where the user is working
```
class IsoGitPluginClient extends ElectronBasePluginClient {
12. In Remix IDE create a plugin in src/app/plugins/electron. If everything works correctly the methods will be loaded from the electron side, no need to specify them here.
This plugin is only a passthrough.
```
const profile = {
displayName: 'compilerLoader',
name: 'compilerloader',
description: 'Loads the compiler for offline use',
}
export class compilerLoaderPluginDesktop extends ElectronPlugin {
constructor() {
super(profile)
this.methods = []
}
async onActivation(): Promise<void> {
// something to do
}
}
```
13. if you need to activate that on load you need to add it to the app.js where other plugins are activated.
## CI
CI will only run the builds is the branch is master or contains the word: desktop
CI will only run the builds is the branch is master or contains the word: desktop