Commit graph

22 commits

Author SHA1 Message Date
PalmDevs
aba4fa7242
fix(lib/plugins): use defineLazyProperty to define plugin storage API 2025-06-03 16:13:54 +07:00
PalmDevs
3cc039ae73
feat(lib/plugins): refactor discord plugin API as API extensions
The aim is to reduce Discord-specific code in core libraries.
2025-06-02 15:50:29 +07:00
PalmDevs
6d19de566f
chore: format 2025-06-01 13:52:06 +07:00
PalmDevs
7a1ff7ef0c
feat(lib/plugins): add API for storages 2025-05-22 02:45:38 +07:00
PalmDevs
d56067d1d1
fix(lib/plugins): handle force stopping after timing out properly 2025-05-19 02:22:12 +07:00
PalmDevs
fa21c4ddc0
fix(lib/plugins): don't run setups if lifecycles do not exist 2025-05-19 02:21:35 +07:00
PalmDevs
37664aaa55
chore: format 2025-05-19 01:43:41 +07:00
PalmDevs
a43cd5d564
feat!: plugins page, tons of API changes, and bug fixes
Plugins
- Settings: Plugins page is now semi-functional
- No Track: Added new plugin
- Developer Settings: Clean up properly
- Logging: Log in preInit stage
- Staff Settings: Add ReloadRequired flags when late-running

@revenge-mod/init
- Moved to the top-level src/index.ts instead

@revenge-mod/modules
- Switch `exports` and `id` parameters in finders APIs
- Lookups now return an array of exports and ID instead of just exports
  - Lookup ID APIs have been removed
- Add `finders.get` helper, a new alternative for `finders.find`
- Corrected documentation for subscription APIs

@revenge-mod/plugins
- Added new APIs for plugins to allow running during pre-init stages
- Added `unscoped.modules.finders.get*`
- Added `unscoped.react.native`

@revenge-mod/react
- native: Added `onRunApplication` and `onRunApplicationFinished`

@revenge-mod/utils
- callbacks: Add `noopFalse`
- promises: Fix `allSettled`
- promises: Add `sleep`
2025-05-18 22:24:48 +07:00
PalmDevs
273294df82
fix(lib/modules/finders)!: remove find* apis
- `find` APIs are merely a wrapper for `wait` and `lookup` APIs. I think the developer should already know whether the module they're trying to get is initialized already or not by the time their plugin runs.
In the `init` phase, most important packages such as React, React Native, React JSX Runtime, Native modules, etc. are already initialized. So, the `lookup` APIs can be used here instead.

- While I am not sure what exactly gets initialized after `init` until `start`, you can simply do trial and error to see if the module is initialized or not. If it is not, you can use `wait` API to wait for it to be initialized.

- `lookup` can also be used inside `wait` if you know a certain module would be initialized after another module.

With all the above reasons, I think the `find*` APIs are redundant and should be removed.
2025-05-13 10:35:07 +07:00
PalmDevs
4f3621ecd4
feat(lib/plugins/apis): include plugin, reduce getters on other apis 2025-05-13 10:34:57 +07:00
PalmDevs
81f529c607
feat(lib/externals): export react-native-clipboard 2025-05-10 02:12:05 +07:00
PalmDevs
9a21a91985
feat(lib/plugins): refactor 2025-05-09 21:53:48 +07:00
PalmDevs
5de00474d4
fix(lib/plugins): lazy load some APIs 2025-05-08 20:25:11 +07:00
PalmDevs
d08d1a9795
feat(lib/plugins): expose externals lib to plugins 2025-05-08 19:10:43 +07:00
PalmDevs
ef5f2ce87c
fix(lib)!: refactor structure 2025-05-08 19:10:42 +07:00
PalmDevs
bb8d46468a
feat(lib/plugins): expose utils in unscoped API 2025-05-06 22:08:35 +07:00
PalmDevs
755021f56e
feat(lib/plugins): add internal way to get enabled plugins count 2025-05-04 16:50:26 +07:00
PalmDevs
9ec501eb06
feat: add author field in PluginManifest, move plugins to src dir 2025-05-01 12:18:28 +07:00
PalmDevs
f87c1fb584
feat(lib/plugins)!: change how plugin system works
- Separated plugin flags for statuses
- Disallow access to internal plugin flags in plugin APIs
- await `handleError` when plugin throws an error
- Added safe guards to prevent initing/starting a plugin twice or when it is not enabled
- Call GC after plugin stops
- Await plugin init and start before stopping
2025-05-01 01:18:41 +07:00
PalmDevs
ede2a582a0
chore: remove unnecessary returns and blocks 2025-04-30 18:53:41 +07:00
PalmDevs
b7bc7f3bca
fix: don't use async arrow functions 2025-04-30 18:53:00 +07:00
PalmDevs
020045f2eb
feat(lib): add initial impl of plugins 2025-04-29 21:38:14 +07:00