this repo has no description

everything: latest swc fixes

Changed files
+71 -49
packages
core-extensions
src
common
disableSentry
moonbase
noTrack
quietLoggers
settings
+1 -4
packages/core-extensions/src/common/index.ts
···
},
flux: {
-
dependencies: [
-
{ ext: "spacepack", id: "spacepack" },
-
"useStateFromStores:function"
-
]
+
dependencies: [{ ext: "spacepack", id: "spacepack" }, "connectStores:"]
},
fluxDispatcher: {
+4 -2
packages/core-extensions/src/common/webpackModules/components.ts
···
const Components = spacepack.findByCode("MasonryList:function")[0].exports;
const MarkdownParser = spacepack.findByCode(
"parseAutoModerationSystemMessage:"
-
)[0].exports.default;
+
)[0].exports.Z;
const LegacyText = spacepack.findByCode(".selectable", ".colorStandard")[0]
.exports.default;
-
const Flex = spacepack.findByCode(".flex" + "GutterSmall,")[0].exports.Flex;
+
const Flex = Object.values(
+
spacepack.findByCode(".flex" + "GutterSmall,")[0].exports
+
)[0];
const CardClasses = spacepack.findByCode("card", "cardHeader", "inModal")[0]
.exports;
const ControlClasses = spacepack.findByCode(
+26 -4
packages/core-extensions/src/common/webpackModules/flux.ts
···
import spacepack from "@moonlight-mod/wp/spacepack_spacepack";
-
module.exports = spacepack.findByCode(
-
["useStateFromStores", ":function"].join(""),
-
"Store:"
-
)[0].exports;
+
const mod = spacepack.findByCode("connectStores:")[0].exports;
+
+
const useStateFromStores = spacepack.findFunctionByStrings(
+
mod,
+
'"useStateFromStores"'
+
)!;
+
+
module.exports = {
+
BatchedStoreListener: spacepack.findFunctionByStrings(
+
mod,
+
" tried to load a non-existent store."
+
),
+
Dispatcher: spacepack.findFunctionByStrings(mod, "_dispatchWithDevtools("),
+
Store: spacepack.findFunctionByStrings(mod, "registerActionHandlers("),
+
default: mod.ZP,
+
statesWillNeverBeEqual: spacepack.findFunctionByStrings(mod, "return!1"),
+
useStateFromStores,
+
useStateFromStoresArray: spacepack.findFunctionByStrings(
+
mod,
+
new RegExp(`return ${useStateFromStores.name}\\(.+?\\.[^Z]\\)`)
+
),
+
useStateFromStoresObject: spacepack.findFunctionByStrings(
+
mod,
+
new RegExp(`return ${useStateFromStores.name}\\(.+?\\.Z\\)`)
+
)
+
};
+1 -1
packages/core-extensions/src/common/webpackModules/fluxDispatcher.ts
···
module.exports = spacepack.findByExports(
"isDispatching",
"dispatch"
-
)[0].exports.default;
+
)[0].exports.Z;
+7 -7
packages/core-extensions/src/disableSentry/index.ts
···
export const patches: Patch[] = [
{
-
find: "DSN:function",
+
find: "profiledRootComponent:",
replace: {
type: PatchReplaceType.Normal,
-
match: /(?<=\.default=){.+?}}/,
+
match: /(?<=\.Z=){.+?}}/,
replacement: 'require("disableSentry_stub").proxy()'
}
},
···
find: "window.DiscordSentry.addBreadcrumb",
replace: {
type: PatchReplaceType.Normal,
-
match: /default:function\(\){return .}/,
+
match: /Z:function\(\){return .}/,
replacement:
'default:function(){return (...args)=>{moonlight.getLogger("disableSentry").debug("Sentry calling addBreadcrumb passthrough:", ...args);}}'
}
},
{
-
find: "initSentry:function",
+
find: "/error-reporting-proxy/web",
replace: {
type: PatchReplaceType.Normal,
-
match: /initSentry:function\(\){return .}/,
-
replacement: "default:function(){return ()=>{}}"
+
match: /(?<=function .\(\){var _;)/,
+
replacement: "return;"
}
},
{
find: "window.DiscordErrors=",
replace: {
type: PatchReplaceType.Normal,
-
match: /\(0,.\.usesClientMods\)\(\)/,
+
match: /(?<=uses_client_mods:)./,
replacement: "false"
}
}
+1 -1
packages/core-extensions/src/moonbase/index.tsx
···
"Masks.PANEL_BUTTON",
"removeButtonContainer:",
'"Missing channel in Channel.openChannelContextMenu"',
-
".default.HEADER_BAR"
+
".forumOrHome]:"
]
},
+2 -1
packages/core-extensions/src/moonbase/webpackModules/moonbase.tsx
···
element: () => {
// Require it here because lazy loading SUX
const SettingsNotice =
-
spacepack.findByCode("onSaveButtonColor")[0].exports.default;
+
spacepack.findByCode("onSaveButtonColor")[0].exports.Z;
return (
<SettingsNotice
submitting={MoonbaseSettingsStore.submitting}
···
onSave={() => {
MoonbaseSettingsStore.writeConfig();
}}
+
disabled={false}
/>
);
}
+1 -1
packages/core-extensions/src/moonbase/webpackModules/ui/config/index.tsx
···
const RemoveButtonClasses = spacepack.findByCode("removeButtonContainer")[0]
.exports;
-
const CircleXIcon = spacepack.findByCode(CircleXIconSVG)[0].exports.default;
+
const CircleXIcon = spacepack.findByCode(CircleXIconSVG)[0].exports.Z;
function RemoveEntryButton({ onClick }: { onClick: () => void }) {
return (
<div className={RemoveButtonClasses.removeButtonContainer}>
+8 -7
packages/core-extensions/src/moonbase/webpackModules/ui/extensions/card.tsx
···
"topSection"
)[0].exports;
-
const DownloadIcon =
-
spacepack.findByCode(DownloadIconSVG)[0].exports.DownloadIcon;
-
const TrashIcon = spacepack.findByCode(TrashIconSVG)[0].exports.default;
-
const DangerIcon =
-
spacepack.findByCode(DangerIconSVG)[0].exports.CircleExclamationPointIcon;
+
const DownloadIcon = Object.values(
+
spacepack.findByCode(DownloadIconSVG)[0].exports
+
)[0];
+
const TrashIcon = spacepack.findByCode(TrashIconSVG)[0].exports.Z;
+
const DangerIcon: any = Object.values(
+
spacepack.findByCode(DangerIconSVG)[0].exports
+
)[0];
-
const PanelButton =
-
spacepack.findByCode("Masks.PANEL_BUTTON")[0].exports.default;
+
const PanelButton = spacepack.findByCode("Masks.PANEL_BUTTON")[0].exports.Z;
export default function ExtensionCard({ uniqueId }: { uniqueId: number }) {
const [tab, setTab] = React.useState(ExtensionPage.Info);
+5 -6
packages/core-extensions/src/moonbase/webpackModules/ui/extensions/filterBar.tsx
···
const modPromise = spacepack.lazyLoad(
'"Missing channel in Channel.openChannelContextMenu"',
/e\("(\d+)"\)/g,
-
/webpackId:"(.+?)"/
+
/webpackId:(\d+?),/
);
const Margins = spacepack.findByCode("marginCenterHorz:")[0].exports;
···
.exports;
const TagItem = spacepack.findByCode(".FORUM_TAG_A11Y_FILTER_BY_TAG")[0].exports
-
.default;
+
.Z;
const ChevronSmallDownIcon = spacepack.findByCode(ChevronSmallDownIconSVG)[0]
-
.exports.default;
+
.exports.Z;
const ChevronSmallUpIcon = spacepack.findByCode(ChevronSmallUpIconSVG)[0]
-
.exports.default;
+
.exports.Z;
let ArrowsUpDownIcon: React.FunctionComponent;
function toggleTag(
···
export default React.lazy(() =>
modPromise.then(async () => {
await modPromise;
-
ArrowsUpDownIcon ??=
-
spacepack.findByCode(ArrowsUpDownIconSVG)[0].exports.default;
+
ArrowsUpDownIcon ??= spacepack.findByCode(ArrowsUpDownIconSVG)[0].exports.Z;
return { default: FilterBar };
})
+3 -2
packages/core-extensions/src/moonbase/webpackModules/ui/extensions/index.tsx
···
import { MoonbaseSettingsStore } from "@moonlight-mod/wp/moonbase_stores";
const Margins = spacepack.findByCode("marginCenterHorz:")[0].exports;
-
const SearchBar = spacepack.findByCode("Messages.SEARCH", "hideSearchIcon")[0]
-
.exports.SearchBar;
+
const SearchBar: any = Object.values(
+
spacepack.findByCode("Messages.SEARCH", "hideSearchIcon")[0].exports
+
)[0];
export default function ExtensionsPage() {
const moonbaseId = MoonbaseSettingsStore.getExtensionUniqueId("moonbase")!;
+1 -2
packages/core-extensions/src/moonbase/webpackModules/ui/index.tsx
···
const Margins = spacepack.findByCode("marginCenterHorz:")[0].exports;
-
const { Divider } = spacepack.findByCode(".default.HEADER_BAR")[0].exports
-
.default;
+
const { Divider } = spacepack.findByCode(".forumOrHome]:")[0].exports.Z;
const TitleBarClasses = spacepack.findByCode("iconWrapper:", "children:")[0]
.exports;
const TabBarClasses = spacepack.findByCode("nowPlayingColumn:")[0].exports;
+1 -1
packages/core-extensions/src/noTrack/index.ts
···
{
find: "analyticsTrackingStoreMaker:function",
replace: {
-
match: /analyticsTrackingStoreMaker:function\(\){return .}/,
+
match: /analyticsTrackingStoreMaker:function\(\){return .+?}/,
replacement: "analyticsTrackingStoreMaker:function(){return ()=>{}}"
}
},
+6 -6
packages/core-extensions/src/quietLoggers/index.ts
···
{
find: '"./ggsans-800-extrabolditalic.woff2":',
replace: {
-
match: /\.then\(function\(\){var.+?"MODULE_NOT_FOUND",.\}\)/,
-
replacement: ".then(()=>(()=>{}))"
+
match: /throw .+?,./,
+
replacement: "return{}"
}
},
{
···
['="RunningGameStore"', /.\.info\("games",{.+?}\),/],
[
'"[BUILD INFO] Release Channel: "',
-
/new .{1,2}\.default\(\)\.log\("\[BUILD INFO\] Release Channel: ".+?"\)\),/
+
/new .{1,2}\.Z\(\)\.log\("\[BUILD INFO\] Release Channel: ".+?"\)\),/
],
[
-
'.AnalyticEvents.APP_NATIVE_CRASH,"Storage"',
+
'.APP_NATIVE_CRASH,"Storage"',
/console\.log\("AppCrashedFatalReport lastCrash:",.,.\);/
],
[
-
'.AnalyticEvents.APP_NATIVE_CRASH,"Storage"',
+
'.APP_NATIVE_CRASH,"Storage"',
'console.log("AppCrashedFatalReport: getLastCrash not supported.");'
],
-
['"[NATIVE INFO] ', /new .{1,2}\.default\(\)\.log\("\[NATIVE INFO] .+?\)\),/],
+
['"[NATIVE INFO] ', /new .{1,2}\.Z\(\)\.log\("\[NATIVE INFO] .+?\)\),/],
['"Spellchecker"', /.\.info\("Switching to ".+?"\(unavailable\)"\);?/g],
[
'throw Error("Messages are still loading.");',
+4 -4
packages/core-extensions/src/settings/index.ts
···
export const patches: Patch[] = [
{
-
find: ".useUnseenOutboundPromotions)().length",
+
find: '"useGenerateUserSettingsSections"',
replace: {
-
match: /(\.push\(.+?\)}\)\)}\),)(.)}/,
-
replacement: (_, orig, sections) =>
-
`${orig}require("settings_settings").Settings._mutateSections(${sections})}`
+
match: /(?<=\.push\(.+?\)}\)\)}\),)./,
+
replacement: (sections: string) =>
+
`require("settings_settings").Settings._mutateSections(${sections})`
}
},
{