DevCompanion: Update

This commit is contained in:
thororen1234 2026-01-30 10:39:33 -05:00
parent 0b0285e68b
commit 94cc3fc424
No known key found for this signature in database
3 changed files with 13 additions and 4 deletions

View file

@ -48,13 +48,12 @@ export const settings = definePluginSettings({
export default definePlugin({
name: "DevCompanion",
description: "Dev Companion Plugin. Please report anything not working or being weird (most likely its a bug) to sadan, either ping or dm, thanks!",
authors: [Devs.Ven, Devs.sadan, Devs.Samwich],
authors: [Devs.Ven, Devs.sadan],
reporterTestable: ReporterTestable.None,
isModified: true,
settings,
toolboxActions: {
"Reconnect"() {
Reconnect() {
socket?.close(1000, "Reconnecting");
initWs(true);
}
@ -64,6 +63,10 @@ export default definePlugin({
// if we're running the reporter, we need to initws in the reporter file to avoid a race condition
if (!IS_DEV) throw new Error("This plugin requires dev mode to run, please build with pnpm build --dev");
initWs();
window.reconnectDevtools = () => {
socket?.close(1000, "Reconnecting");
initWs(true);
};
},
stop: stopWs,

View file

@ -262,6 +262,9 @@ export function initWs(isManual = false) {
case "Component":
results = findAll(parsedArgs[0]);
break;
case "CssClasses":
results = findAll(filters.byClassNames(...parsedArgs), { topLevelOnly: true });
break;
case "ByProps":
results = findAll(filters.byProps(...parsedArgs));
break;
@ -373,6 +376,9 @@ export function initWs(isManual = false) {
case "ByProps":
results = findAll(filters.byProps(...parsedArgs));
break;
case "CssClasses":
results = findAll(filters.byClassNames(...parsedArgs), { topLevelOnly: true });
break;
case "Store":
results = findAll(filters.byStoreName(parsedArgs[0]));
break;

View file

@ -35,7 +35,7 @@ export type FindOrSearchData =
} & _PrefixKeys<_CapitalizeKeys<FindData>, "find">);
export type AnyFindType =
`find${"Component" | "ByProps" | "Store" | "ByCode" | "ModuleId" | "ComponentByCode" | ""}${"Lazy" | ""}`;
`find${"Component" | "ByProps" | "CssClasses" | "Store" | "ByCode" | "ModuleId" | "ComponentByCode" | ""}${"Lazy" | ""}`;
export type StringNode = {
type: "string";