Skip to content

Commit 52cd74d

Browse files
committed
Update official repository docs
1 parent a5769a2 commit 52cd74d

File tree

1 file changed

+57
-14
lines changed

1 file changed

+57
-14
lines changed

src/content/docs/ext-dev/official-repository.md

Lines changed: 57 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,51 @@ sidebar:
55
order: 2
66
---
77

8-
While moonlight allows you to use custom repositories from URLs, it comes with an [official repository][extensions] built in. While submitting to the official repository is not required, it is highly suggested.
8+
While moonlight allows you to use custom repositories from URLs, it comes with an [official repository](https://github.com/moonlight-mod/extensions) built in. While submitting to the official repository is not required, it is highly encouraged.
9+
10+
Every extension on the official repository is reviewed and tested by the moonlight core team. All extension updates are also reviewed, but they will take less time than submitting a new extension.
11+
12+
## Requirements
13+
14+
We check for these when reviewing extensions:
15+
16+
- Your extension manifest should have a `version` set.
17+
- We suggest you stick to the major/minor/patch format seen in [SemVer](https://semver.org) (e.g. `1.0.0`).
18+
- You don't have to follow a specific guideline for how you bump the version, but you should use the same three-version format.
19+
- Your extension manifest should have a detailed `meta` object. We encourage you to at least set `name`, `tagline`, `authors`, and `source`.
20+
- The `source` should link to the repository the extension is built from.
21+
22+
There are also some technical requirements for submitting your extension:
23+
24+
- Your extension must be on a Git repository available through HTTPS.
25+
- This isn't restricted to just GitHub, you can use any Git forge you'd like (including Gitea and Forgejo)!
26+
- Git over SSH is not supported.
27+
- Your repository must use pnpm.
28+
- Your repository must provide scripts to build and pack your extension into an .asar.
29+
- If you created your extension repository with `create-extension`, these are already setup for you.
30+
31+
Your extension may be [blocked for merge](#review-guidelines) if there are any changes required, or [denied](#repository-rules) if your extension violates the repository rules.
932

1033
## Submitting a pull request
1134

12-
There are some requirements for submission:
35+
If this is your first time submitting to the official repository, [create a fork](https://github.com/moonlight-mod/extensions/fork) first. If you're new to forking on GitHub, see [here](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo) for more detailed instructions.
1336

14-
- Your extension must be open source on a Git repository.
15-
- Your extension must use pnpm.
16-
- Your extension manifest must contain an `id`, `version`, and `meta.source`. The ID and version can be any unique string, and the source must be a URL to the repository where your code is located in.
37+
The easiest way to submit a pull request is via the GitHub web UI. Press the `.` key on your keyboard (or click the pencil icon when viewing a manifest) to start editing your fork. You can also clone your fork locally, if you prefer that.
1738

18-
Then, create a pull request to [the official repository][extensions], adding a manifest. A manifest is a JSON object that looks like this:
39+
In your fork, create a `.json` file in the `exts` folder, named after your extension's ID. Here's an example:
1940

20-
```json
41+
```json title="exts/platformStyles.json"
2142
{
2243
"repository": "https://github.com/Cynosphere/moonlight-extensions.git",
23-
"commit": "accf381859ca72eb624abc9ce04ec30c21982a87",
24-
"scripts": ["build", "repo"],
25-
"artifact": "repo/platformStyles.asar"
44+
"commit": "df8a5d67809e5cb03f7d301dc8c65e3d1a79f9d9"
2645
}
2746
```
2847

29-
`repository` must be a valid HTTPS Git URL. `commit` must be a valid commit in that repository. `scripts` is an array of pnpm scripts to build your project - for repositories using the official build script, this will be `build` and `repo`. `artifact` is the location of the output file - for repositories using the sample extension, this will be `repo/<extension id>.asar`.
48+
We call this a "build manifest" (to distinguish it from the extension manifest in your Git repository). Set `repository` to the URL of your Git repository, and set `commit` to the commit SHA that contains your extension. On GitHub, you can get the latest commit SHA by clicking the copy icon when viewing the commit in the web UI.
49+
50+
All you have to do is make the pull request, and we'll review and test it from there. If you need to make any changes, we'll let you know in the pull request comments. Otherwise, once the pull request is merged, your extension will be available for installation in Moonbase! If you're in [our Discord server](https://discord.gg/FdZBTFCP6F), let us know and we'll give you the "Extension Developer" role.
51+
52+
To update an extension, simply make another pull request, and update the `commit` in the build manifest. Make sure you increase the `version` in the extension manifest first!
3053

3154
## Adoption rules
3255

@@ -37,8 +60,6 @@ To prevent extensions from going unmaintained on the official repository, an ado
3760

3861
An extension is defined as "outdated" when its features do not work, the extension crashes the client, or it has not been updated for the latest [API level](/ext-dev/migrating-api-levels). We encourage developers to reach out for permission in a public space, like GitHub issues or in the moonlight Discord server, so that the response can be verified.
3962

40-
[extensions]: <https://github.com/moonlight-mod/extensions>
41-
4263
## Repository rules
4364

4465
Extensions that violate the following rules cannot be submitted to the official repository:
@@ -48,6 +69,28 @@ Extensions that violate the following rules cannot be submitted to the official
4869
- Respect the privacy of other users. No logging of other users' actions or long-term scraping of the Discord API.
4970
- Examples: message loggers/"anti delete", message archival, read states via "hidden pixel" tracking
5071
- Respect the privacy of the user. Interactions with third party services must be clearly denoted inside the extension tagline or description.
51-
- Examples: HTTP APIs
72+
- Examples: HTTP APIs, RPC calls to other processes on the user's machine
5273

5374
If you're unsure if your extension can be submitted or not, feel free to ask!
75+
76+
## Review guidelines
77+
78+
The extension review process is implemented for security reasons, but reviewers may also block an extension from merge if there's a very important problem. Reviewers should block merging on these kinds of issues:
79+
80+
- Invalid extension manifests (e.g. mismatched ID)
81+
- Extension updates that haven't had a version bump
82+
- Hardcoding unstable values (e.g. minified variables in a patch, Discord CSS classes, requiring direct module IDs)
83+
- The extension manifest (or a Webpack module) is missing a declared dependency
84+
- Conflicting extensions that aren't declared in the extension manifest
85+
- Potential rule compliance issues
86+
- Potential safety issues (e.g. very wide CSP/CORS settings)
87+
- Updating unrelated files in the pull request (e.g. accidental formatting of other build manifests)
88+
89+
Reviewers should *not* block for these kinds of issues, as they do not impact the functionality of the extension, but they may want to comment on them:
90+
91+
- Badly written patches that are still functional (e.g. lots of lazy matching)
92+
- Code that could be cleaned up (e.g. using `spacepack.require` instead of `import`)
93+
- Code that could be rewritten to be more compatible (e.g. converting patches to a Flux listener)
94+
- Remnants of the sample extension (e.g. unused loggers, leftover Node entrypoint)
95+
96+
Reviewers may want to leave a comment on their review when leaving extra feedback to give the extension author the opportunity to fix it. If the extension author doesn't want to fix it, the extension should still be merged.

0 commit comments

Comments
 (0)