Commit graph

59 commits

Author SHA1 Message Date
PalmDevs
a3ebccf1d6
fix(lib/plugins): resolve dependency graph before pushing nodes to ordered list 2025-07-21 15:32:38 +07:00
PalmDevs
601d5a28f5
feat(lib/plugins): improve types and documentation 2025-07-21 14:45:03 +07:00
PalmDevs
f5ed49d4e2
fix: declare unscoped storage API using decorators instead 2025-07-21 14:06:51 +07:00
PalmDevs
7a365f93c7
fix(lib/plugins/apis): spread descriptors instead of values 2025-07-21 14:05:37 +07:00
PalmDevs
84bb9992f5
feat(lib/plugins): do API decorator filtering 2025-07-21 14:02:00 +07:00
PalmDevs
72035286a9
feat(lib/plugins): cache resolved dependencies 2025-07-21 14:01:21 +07:00
PalmDevs
a1316e720e
fix(lib/plugins): error during preinit stage not being logged 2025-07-20 23:34:52 +07:00
PalmDevs
2bb51b7782
fix(lib/plugins): internal plugins marked ImplicitDependency not being added to head of list 2025-07-20 23:34:31 +07:00
PalmDevs
2e455cf2c5
feat: add ability to decorate plugin APIs, move private properties to WeakMap stores 2025-07-20 23:06:56 +07:00
PalmDevs
78614c1cc9
chore: move SettingRendererConfig patches to lib, refactor how lifecycles are run 2025-07-19 23:23:32 +07:00
PalmDevs
d3b754d2cc
feat(lib/plugins): switch to objects for storage 2025-07-18 23:44:08 +07:00
PalmDevs
0095a3e153
feat(lib/plugins): allow accessing react API in preInit 2025-07-16 20:02:18 +07:00
PalmDevs
8d4581f9c1
fix: register start-only plugins during start stage
Previously they were registered on init which may have caused some minor performance issues.
2025-07-14 23:13:52 +07:00
PalmDevs
37a20160db
fix: do not use emitter to emit error event
Discord's EventEmitter handles the `error` event specially for some reason.
2025-07-13 00:26:22 +07:00
PalmDevs
811bd30756
chore: revert 8347e24 2025-07-12 21:05:27 +07:00
PalmDevs
0746db3648
chore(lib/plugins): move utils assignments to own lib 2025-07-11 17:55:54 +07:00
PalmDevs
b3d9f0c9ec
fix(lib/plugins): remove bad assignment 2025-07-11 17:49:30 +07:00
PalmDevs
f591fc7de9
feat(lib/plugins): expose utils, components to unscoped API 2025-07-11 17:43:23 +07:00
PalmDevs
4b2a612374
chore(lib/utils): do not pluralize submodules 2025-07-11 17:33:06 +07:00
PalmDevs
83a3eb53fb
feat(lib/plugins): expose storage lib to unscoped API 2025-07-11 17:02:22 +07:00
PalmDevs
8babd1837a
feat(lib/plugins): log plugin errors in native as well 2025-07-11 15:19:27 +07:00
PalmDevs
2b05b34a28
chore: lint and format 2025-07-11 01:15:50 +07:00
PalmDevs
8347e24e54
chore(lib/react)!: remove jsx-runtime
This has been made because no developer will likely ever require this API.

The current API assumes you already have an instance of the component, which means you can likely already patch that component instance itself.

The API can be made more powerful by taking any string names, and comparing it to the component's type name, type displayName, name, displayName, etc., but it will introduce performance bottlenecks.
2025-07-11 01:15:20 +07:00
PalmDevs
075f33f6c6
chore: cleanup 2025-07-05 13:56:52 +07:00
PalmDevs
77f8d62720
fix: improve perf by not returning implicitly 2025-06-17 19:53:58 +07:00
PalmDevs
256191b8a4
fix(lib/plugins): emit events properly when no lifecycles are present 2025-06-16 18:13:48 +07:00
PalmDevs
598728d195
fix(lib/plugins)!: name types more consistently
skip-checks:true
2025-06-16 09:57:25 +07:00
PalmDevs
fb8cc2d897
feat!: allow plugin API extensions to get runtime options, and allow API extensions to pass options, refactor api.storage to API extensions 2025-06-16 09:51:30 +07:00
PalmDevs
99d7dc0111
fix(lib/plugins): don't catch manually thrown errors, remove useless event 2025-06-14 22:05:26 +07:00
PalmDevs
33bb878c5c
feat(lib/plugins): switch to event-based system 2025-06-14 18:01:39 +07:00
PalmDevs
ca12fac256
feat(lib/plugins): add settings pages for plugins 2025-06-10 22:22:59 +07:00
PalmDevs
2123126aef
fix(lib/plugins): pass storage options correctly 2025-06-10 00:02:18 +07:00
PalmDevs
3619993dc0
fix(lib): export types exports as types-only 2025-06-08 18:47:42 +07:00
PalmDevs
cf38e74338
fix(lib/plugins/apis): use imports instead of require where possible 2025-06-07 10:07:32 +07:00
PalmDevs
2c56aa87c1
fix(lib/plugins): move unscoped.externals to its own pkg 2025-06-06 20:51:07 +07:00
PalmDevs
0ad9454dce
fix: define lazy-loaded APIs without shallow clone 2025-06-06 20:08:25 +07:00
PalmDevs
2b905801c3
chore: format 2025-06-03 16:24:58 +07:00
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