diff --git a/lib/discord/src/init.ts b/lib/discord/src/init.ts index 4f99e96..0887951 100644 --- a/lib/discord/src/init.ts +++ b/lib/discord/src/init.ts @@ -1,3 +1,5 @@ +/** biome-ignore-all lint/complexity/useArrowFunction: Rolldown issue: Bug requires us to use normal functions instead of arrow functions */ + import { _initExts, _uapi } from '@revenge-mod/plugins/_' import { defineLazyProperty } from '@revenge-mod/utils/objects' import { Logger } from './common' @@ -7,25 +9,30 @@ import type { PluginApiDiscord } from './types/revenge' const uapi = _uapi as UnscopedInitPluginApi const discord = (uapi.discord = {} as PluginApiDiscord) -// TODO: Rolldown issue: Bug requires us to do { ...require('...') } instead of just require('...') -defineLazyProperty(discord, 'actions', () => ({ - ...require('@revenge-mod/discord/actions'), -})) -defineLazyProperty(discord, 'common', () => ({ - ...require('@revenge-mod/discord/common'), -})) -defineLazyProperty(discord, 'design', () => ({ - ...require('@revenge-mod/discord/design'), -})) -defineLazyProperty(discord, 'native', () => ({ - ...require('@revenge-mod/discord/native'), -})) -defineLazyProperty(discord, 'modules', () => ({ - settings: { - ...require('@revenge-mod/discord/modules/settings'), - renderer: require('@revenge-mod/discord/modules/settings/renderer'), - }, -})) +defineLazyProperty(discord, 'actions', function () { + return require('@revenge-mod/discord/actions') +}) + +defineLazyProperty(discord, 'common', function () { + return require('@revenge-mod/discord/common') +}) + +defineLazyProperty(discord, 'design', function () { + return require('@revenge-mod/discord/design') +}) + +defineLazyProperty(discord, 'native', function () { + return require('@revenge-mod/discord/native') +}) + +defineLazyProperty(discord, 'modules', function () { + return { + settings: { + ...require('@revenge-mod/discord/modules/settings'), + renderer: require('@revenge-mod/discord/modules/settings/renderer'), + }, + } +}) _initExts.push((api, { manifest: { id } }) => defineLazyProperty( diff --git a/lib/plugins/src/apis/externals.ts b/lib/plugins/src/apis/externals.ts index 379a1d3..a35e231 100644 --- a/lib/plugins/src/apis/externals.ts +++ b/lib/plugins/src/apis/externals.ts @@ -1,3 +1,5 @@ +/** biome-ignore-all lint/complexity/useArrowFunction: Rolldown issue: Bug requires us to use normal functions instead of arrow functions */ + import { defineLazyProperty } from '@revenge-mod/utils/objects' export interface PluginApiExternals { @@ -9,16 +11,18 @@ export interface PluginApiExternals { export const externals = {} as PluginApiExternals -// TODO: Rolldown issue: Bug requires us to do { ...require('...') } instead of just require('...') -defineLazyProperty(externals, 'Browserify', () => ({ - ...require('@revenge-mod/externals/browserify'), -})) -defineLazyProperty(externals, 'ReactNativeClipboard', () => ({ - ...require('@revenge-mod/externals/react-native-clipboard'), -})) -defineLazyProperty(externals, 'ReactNavigation', () => ({ - ...require('@revenge-mod/externals/react-navigation'), -})) -defineLazyProperty(externals, 'Shopify', () => ({ - ...require('@revenge-mod/externals/shopify'), -})) +defineLazyProperty(externals, 'Browserify', function () { + return require('@revenge-mod/externals/browserify') +}) + +defineLazyProperty(externals, 'ReactNativeClipboard', function () { + return require('@revenge-mod/externals/react-native-clipboard') +}) + +defineLazyProperty(externals, 'ReactNavigation', function () { + return require('@revenge-mod/externals/react-navigation') +}) + +defineLazyProperty(externals, 'Shopify', function () { + return require('@revenge-mod/externals/shopify') +})