Moonlight Docs v2.0 Help

Getting started

Before you can start developing plugins or contributing to moonlight, you need to set up a development environment

In this tutorial, you will learn how to:

  • Setup a development environment

  • Compile and start moonlight

  • Compile and start a moonlight plugin

Requirements

A linux vm and all mentioned items in the "Linux" tab :>

Creating an environment for a plugin

To start developing a plugin for moonlight, you need a development environment first. To create a development environment, follow these steps:

  1. Open a terminal and create a directory for the development environment. Replace the path with the one you want to use

    mkdir ~/MoonlightDev/myNewPlugin cd ~/MoonlightDev/myNewPlugin mldev plugin create MyNewPlugin . mldev db start
  2. Open the folder of your instance in the file manager and go into the folder called source. In there should be a file called MyNewPlugin.sln (Depends on the provided name). Open this file with the C# IDE of your choice. It should automatically load the project, and you should be able to start developing a plugin. It should already contain some example code.

  3. To test your plugin, go back to the terminal and run the following command. If this is the first run, moonlight should automatically create an admin user for you and print the credentials in the console. After moonlight started, you should see a URL in the console. Open it in your web browser to open your local moonlight test instance.

    mldev plugin run

Creating an environment for contributions

To start modifying moonlights source code, you need a development environment first. To create a development environment, follow these steps:

  1. Open a terminal and create a directory for the development environment. Replace the path with the one you want to use

    mkdir ~/MoonlightDev/myMoonlightContribution cd ~/MoonlightDev/myMoonlightContribution mldev contribution create ImproveUi . mldev db start
  2. Open the folder of your instance in the file manager and go into the folder called source. In there should be a file called Moonlight.sln. Open this file with the C# IDE of your choice. It should automatically load the project, and you should be able to start developing with moonlight.

  3. To test your changes, just run the project via your IDE. If you use Rider for example, you just need to press the green "Play" button. The database credentials should be automatically via the mldev db start command.

Last modified: 15 September 2024