···11-## Moonbase
22-33-- Added changelog for moonlight updates (but it won't show this one D:)
44-- Added a button to update all extensions
55-- Added an icon to distinguish the repository of an extension
66-- Extensions now stay at the top even after updating (thanks @maddymeows!)
77-- Moved some buttons to the extension tab bar
88-- Added missing row gap to extension info
99-- Improved update handling
1010-111## Core
122133- Updated mappings
1414- - For extension developers: there were a lot of type changes! Your extension should still run, but there may be issues with compilation. Please let us know if we got any types wrong.
1515-- Added new `donate` key in manifest
1616- - For extension developers: Put your donate links here! Don't have/want donations? Put a charity you like!
1717-- Added new patches to Quiet Loggers (thanks @gBasil!)
1818-- Made `setConfigOption` actually async
1919-2020-## Misc
2121-2222-- Added packageManager to `package.json` for corepack (thanks @slonkazoid!)
2323-- Began work on using the moonlight installer from a Flatpak
44+- Fixed using remapped paths as patch finds not working
···3030// Patches to simply remove a logger call
3131const stubPatches = [
3232 // "sh" is not a valid locale.
3333- ["is not a valid locale", /(.)\.error\(""\.concat\((.)," is not a valid locale\."\)\)/g],
3333+ ["is not a valid locale", /void (.)\.error\(""\.concat\((.)," is not a valid locale\."\)\)/g],
3434 ['"[BUILD INFO] Release Channel: "', /new .{1,2}\.Z\(\)\.log\("\[BUILD INFO\] Release Channel: ".+?\)\),/],
3535 ['.APP_NATIVE_CRASH,"Storage"', /console\.log\("AppCrashedFatalReport lastCrash:",.,.\);/],
3636- ['.APP_NATIVE_CRASH,"Storage"', 'console.log("AppCrashedFatalReport: getLastCrash not supported.");'],
3636+ ['.APP_NATIVE_CRASH,"Storage"', 'void console.log("AppCrashedFatalReport: getLastCrash not supported.")'],
3737 ['"[NATIVE INFO] ', /new .{1,2}\.Z\(\)\.log\("\[NATIVE INFO] .+?\)\);/],
3838 ['"Spellchecker"', /.\.info\("Switching to ".+?"\(unavailable\)"\);?/g],
3939 ['throw Error("Messages are still loading.");', /console\.warn\("Unsupported Locale",.\),/],
···77 "name": "Rocketship",
88 "tagline": "Adds new features when using rocketship",
99 "description": "**This extension only works on Linux when using rocketship:**\nhttps://github.com/moonlight-mod/rocketship\n\nAdds new features to the Discord Linux client with rocketship, such as a better screensharing experience.",
1010- "authors": ["NotNite", "Cynosphere", "adryd"]
1010+ "authors": ["NotNite", "Cynosphere", "adryd"],
1111+ "deprecated": true
1112 }
1213}
···121121}
122122123123export type Messages = {
124124+ /**
125125+ * Adds a component to the username of a message
126126+ */
124127 addToUsername: (id: string, component: React.FC<any>, anchor?: MessageUsernameAnchors, before?: boolean) => void;
128128+ /**
129129+ * Adds a component to the username badge area of a message (e.g. where role icons/new member badge is)
130130+ */
125131 addUsernameBadge: (
126132 id: string,
127133 component: React.FC<any>,
128134 anchor?: MessageUsernameBadgeAnchors,
129135 before?: boolean
130136 ) => void;
137137+ /**
138138+ * Adds a component to the end of a message header (e.g. silent indicator)
139139+ */
131140 addBadge: (id: string, component: React.FC<any>, anchor?: MessageBadgeAnchors, before?: boolean) => void;
132141 /**
142142+ * Adds a component to message accessories (e.g. embeds)
143143+ */
144144+ addAccessory: (id: string, component: React.FC<any>) => void;
145145+ /**
133146 * @private
134147 */
135148 _patchUsername: Patcher<any>;
···141154 * @private
142155 */
143156 _patchBadges: Patcher<any>;
157157+ /**
158158+ * @private
159159+ */
160160+ _patchAccessories: Patcher<any>;
144161};
145162//#endregion
+10-7
packages/types/src/coreExtensions/settings.ts
···77};
8899export type SettingsSection =
1010- | { section: "DIVIDER"; pos: number }
1111- | { section: "HEADER"; label: string; pos: number }
1010+ | { section: "DIVIDER"; pos: number | ((sections: SettingsSection[]) => number) }
1111+ | { section: "HEADER"; label: string; pos: number | ((sections: SettingsSection[]) => number) }
1212 | {
1313 section: string;
1414 label: string;
1515 color: string | null;
1616 element: React.FunctionComponent;
1717- pos: number;
1717+ pos: number | ((sections: SettingsSection[]) => number);
1818 notice?: NoticeProps;
1919+ onClick?: () => void;
1920 _moonlight_submenu?: () => ReactElement | ReactElement[];
2021 };
2122···3233 * @param color A color to use for the section
3334 * @param pos The position in the settings menu to place the section
3435 * @param notice A notice to display when in the section
3636+ * @param onClick A custom action to execute when clicked from the context menu
3537 */
3638 addSection: (
3739 section: string,
3840 label: string,
3941 element: React.FunctionComponent,
4042 color?: string | null,
4141- pos?: number,
4242- notice?: NoticeProps
4343+ pos?: number | ((sections: SettingsSection[]) => number),
4444+ notice?: NoticeProps,
4545+ onClick?: () => void
4346 ) => void;
44474548 /**
···5356 * Places a divider in the settings menu.
5457 * @param pos The position in the settings menu to place the divider
5558 */
5656- addDivider: (pos: number | null) => void;
5959+ addDivider: (pos: number | ((sections: SettingsSection[]) => number) | null) => void;
57605861 /**
5962 * Places a header in the settings menu.
6063 * @param pos The position in the settings menu to place the header
6164 */
6262- addHeader: (label: string, pos: number | null) => void;
6565+ addHeader: (label: string, pos: number | ((sections: SettingsSection[]) => number) | null) => void;
63666467 /**
6568 * @private
+1
packages/types/src/coreExtensions.ts
···77export * as AppPanels from "./coreExtensions/appPanels";
88export * as Commands from "./coreExtensions/commands";
99export * as ComponentEditor from "./coreExtensions/componentEditor";
1010+export * as Common from "./coreExtensions/common";
+4
packages/types/src/discord/require.ts
···11import { AppPanels } from "../coreExtensions/appPanels";
22import { Commands } from "../coreExtensions/commands";
33+import { ErrorBoundary, Icons } from "../coreExtensions/common";
34import { DMList, MemberList, Messages } from "../coreExtensions/componentEditor";
45import { ContextMenu, EvilItemParser } from "../coreExtensions/contextMenu";
56import { Markdown } from "../coreExtensions/markdown";
···1314declare function WebpackRequire(id: "appPanels_appPanels"): AppPanels;
14151516declare function WebpackRequire(id: "commands_commands"): Commands;
1717+1818+declare function WebpackRequire(id: "common_ErrorBoundary"): ErrorBoundary;
1919+declare function WebpackRequire(id: "common_icons"): Icons;
16201721declare function WebpackRequire(id: "componentEditor_dmList"): DMList;
1822declare function WebpackRequire(id: "componentEditor_memberList"): MemberList;
+6
packages/types/src/extension.ts
···135135 * @example https://moonlight-mod.github.io/
136136 */
137137 blocked?: string[];
138138+139139+ /**
140140+ * A mapping from CSP directives to URLs to allow.
141141+ * @example { "script-src": ["https://example.com"] }
142142+ */
143143+ csp?: Record<string, string[]>;
138144};
139145140146export enum ExtensionEnvironment {
+10-3
packages/types/src/globals.ts
···44import type EventEmitter from "events";
55import type LunAST from "@moonlight-mod/lunast";
66import type Moonmap from "@moonlight-mod/moonmap";
77-import type { EventPayloads, EventType, MoonlightEventEmitter } from "./core/event";
88-import { MoonlightFS } from "./fs";
77+import type {
88+ WebEventPayloads,
99+ WebEventType,
1010+ MoonlightEventEmitter,
1111+ NodeEventType,
1212+ NodeEventPayloads
1313+} from "./core/event";
1414+import type { MoonlightFS } from "./fs";
9151016export type MoonlightHost = {
1117 config: Config;
···3440 processedExtensions: ProcessedExtensions;
3541 nativesCache: Record<string, any>;
3642 isBrowser: boolean;
4343+ events: MoonlightEventEmitter<NodeEventType, NodeEventPayloads>;
37443845 version: string;
3946 branch: MoonlightBranch;
···6067 unpatched: Set<IdentifiedPatch>;
6168 pendingModules: Set<IdentifiedWebpackModule>;
6269 enabledExtensions: Set<string>;
6363- events: MoonlightEventEmitter<EventType, EventPayloads>;
7070+ events: MoonlightEventEmitter<WebEventType, WebEventPayloads>;
6471 patchingInternals: {
6572 onModuleLoad: (moduleId: string | string[], callback: (moduleId: string) => void) => void;
6673 registerPatch: (patch: IdentifiedPatch) => void;