UNPKG

@kubb/react

Version:

React integration for Kubb, providing JSX runtime support and React component generation capabilities for code generation plugins.

83 lines (81 loc) 1.64 kB
import { __toDynamicImportESM } from "./chunk-ZQaqVjc_.js"; import { onExit } from "signal-exit"; import ws from "ws"; //#region src/devtools.ts const customGlobal = globalThis; customGlobal.WebSocket ||= ws; customGlobal.window ||= customGlobal; customGlobal.self ||= customGlobal; customGlobal.isDevtoolsEnabled = true; customGlobal.window.__REACT_DEVTOOLS_COMPONENT_FILTERS__ = [ { type: 2, value: "Context.Provider", isEnabled: true, isValid: true }, { type: 2, value: "KubbRoot", isEnabled: true, isValid: true }, { type: 2, value: "KubbErrorBoundary", isEnabled: true, isValid: true }, { type: 2, value: "kubb-file", isEnabled: true, isValid: true }, { type: 2, value: "kubb-text", isEnabled: true, isValid: true }, { type: 2, value: "kubb-import", isEnabled: true, isValid: true }, { type: 2, value: "kubb-export", isEnabled: true, isValid: true }, { type: 2, value: "kubb-source", isEnabled: true, isValid: true } ]; function openDevtools() { let subprocess; import("execa").then(async (execa) => { console.log("Opening devtools"); subprocess = execa.execa({ preferLocal: true })`npx react-devtools`; }).then(() => { return import("./backend-DMntf818.js").then(__toDynamicImportESM(1)); }).then((devtools) => { console.log("Connecting devtools"); devtools.default.connectToDevTools(); }).catch(() => { console.log("Error connecting devtools"); }); onExit(() => { console.log("Disconnecting devtools"); subprocess?.kill(); }, { alwaysLast: false }); } openDevtools(); //#endregion export { }; //# sourceMappingURL=devtools.js.map