Cynosphere / moonlight-extensions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

moonlight sample extension

This is a sample extension for the moonlight Discord mod.

Getting started

  • Make sure you have Node.js and pnpm installed.
  • Click "Use this template".
  • In the repository settings, make sure GitHub Actions are enabled for this repository, and that the GitHub Pages source is set to GitHub Actions.

Then, clone and start hacking away:

  • Install dependencies (pnpm i).
  • Build the project (pnpm run build).
    • If you'd prefer to run in watch mode, do pnpm run dev instead.

Add the following to your moonlight config:

{
  "devSearchPaths": [
    "/path/to/sample-extension/dist"
  ]
}

where /path/to/sample-extension is the folder you cloned the repository into. After restarting your client, the extension will load.

Project structure

This sample extension uses esbuild as its build system. The two entrypoints (index and node) get loaded on the web and Node.js side respectively. Code exported from the Node.js side can be called from the web side. Each side is optional, in case you only need to run in a specific context (usually web only).

Publishing to GitHub Pages

Your repository will be published to https://<username>.github.io/<repository>/repo.json. Every time a commit is made to the main branch, the extensions will be built on GitHub Actions and published automatically.

About

License:MIT License


Languages

Language:TypeScript 65.6%Language:JavaScript 34.4%