@kubb/react-fabric 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +49 -78
- package/dist/{App-CbT7rbmH.d.cts → Fabric-DwVGMumV.d.ts} +27 -27
- package/dist/{App-D7ehObix.d.ts → Fabric-nxgJyzWH.d.cts} +27 -27
- package/dist/{KubbFile-FGXV713i.d.cts → KubbFile-DHCtBOpy.d.cts} +1 -1
- package/dist/{KubbFile-D4gyyfL-.d.ts → KubbFile-bFdmEsQz.d.ts} +1 -1
- package/dist/backend-BwCrJwGY.cjs +11364 -0
- package/dist/backend-BwCrJwGY.cjs.map +1 -0
- package/dist/backend-U2f8IEJ7.js +11361 -0
- package/dist/backend-U2f8IEJ7.js.map +1 -0
- package/dist/chunk-9mlisOrp.js +28 -0
- package/dist/chunk-BaqVhFee.cjs +46 -0
- package/dist/devtools-CYVZyenT.cjs +102 -0
- package/dist/devtools-CYVZyenT.cjs.map +1 -0
- package/dist/devtools-D7cmED8s.js +94 -0
- package/dist/devtools-D7cmED8s.js.map +1 -0
- package/dist/devtools.cjs +2 -10885
- package/dist/devtools.d.cts +11 -1
- package/dist/devtools.d.ts +11 -1
- package/dist/devtools.js +2 -10885
- package/dist/{globals-D_1Lfe9-.d.ts → globals-1MFa0Fvg.d.ts} +3 -3
- package/dist/{globals-BRG2DOJd.d.cts → globals-C7dPa-nz.d.cts} +3 -3
- package/dist/globals.d.cts +3 -3
- package/dist/globals.d.ts +3 -3
- package/dist/index.cjs +34 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +16 -9
- package/dist/index.d.ts +16 -9
- package/dist/index.js +15 -5
- package/dist/index.js.map +1 -1
- package/dist/jsx-dev-runtime.cjs +8 -0
- package/dist/jsx-dev-runtime.js +5 -0
- package/dist/jsx-runtime-8_h1Kd4b.cjs +36 -0
- package/dist/jsx-runtime-8_h1Kd4b.cjs.map +1 -0
- package/dist/jsx-runtime-BJX2mL7C.js +13 -0
- package/dist/jsx-runtime-BJX2mL7C.js.map +1 -0
- package/dist/{react-Bq0UOw6S.cjs → jsx-runtime-C9xQ4GQD.js} +239 -57
- package/dist/jsx-runtime-C9xQ4GQD.js.map +1 -0
- package/dist/{react-BBkwFtZV.js → jsx-runtime-CSnwG7o6.cjs} +253 -42
- package/dist/jsx-runtime-CSnwG7o6.cjs.map +1 -0
- package/dist/jsx-runtime.cjs +6 -15
- package/dist/jsx-runtime.d.cts +3 -3
- package/dist/jsx-runtime.d.ts +3 -3
- package/dist/jsx-runtime.js +3 -12
- package/dist/parsers.d.cts +2 -2
- package/dist/parsers.d.ts +2 -2
- package/dist/{Runtime-DJ4dWT9w.cjs → plugins-BQE1GnQ7.cjs} +110 -76
- package/dist/plugins-BQE1GnQ7.cjs.map +1 -0
- package/dist/{Runtime-CatKeybQ.js → plugins-BVFjgEC2.js} +85 -58
- package/dist/plugins-BVFjgEC2.js.map +1 -0
- package/dist/plugins.cjs +4 -36
- package/dist/plugins.d.cts +16 -49
- package/dist/plugins.d.ts +16 -49
- package/dist/plugins.js +3 -34
- package/dist/reactPlugin-CLgWWifj.d.cts +38 -0
- package/dist/reactPlugin-DyvfLVFa.d.ts +38 -0
- package/dist/{types-Brnyan9B.d.ts → types-BnXxcIyv.d.ts} +1 -1
- package/dist/{types-C3p0Ljxf.d.cts → types-DoYRYV1C.d.cts} +1 -1
- package/dist/types.d.cts +1 -1
- package/dist/types.d.ts +1 -1
- package/package.json +10 -6
- package/src/Renderer.ts +26 -22
- package/src/Runtime.tsx +2 -2
- package/src/createReactFabric.ts +17 -0
- package/src/devtools.ts +107 -110
- package/src/index.ts +2 -1
- package/src/plugins/reactPlugin.ts +3 -3
- package/dist/Runtime-CatKeybQ.js.map +0 -1
- package/dist/Runtime-DJ4dWT9w.cjs.map +0 -1
- package/dist/devtools.cjs.map +0 -1
- package/dist/devtools.js.map +0 -1
- package/dist/jsx-runtime-Dg-pJBHd.js +0 -228
- package/dist/jsx-runtime-Dg-pJBHd.js.map +0 -1
- package/dist/jsx-runtime-d2dmYscH.cjs +0 -233
- package/dist/jsx-runtime-d2dmYscH.cjs.map +0 -1
- package/dist/jsx-runtime.cjs.map +0 -1
- package/dist/jsx-runtime.js.map +0 -1
- package/dist/plugins.cjs.map +0 -1
- package/dist/plugins.js.map +0 -1
- package/dist/react-BBkwFtZV.js.map +0 -1
- package/dist/react-Bq0UOw6S.cjs.map +0 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//#region rolldown:runtime
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __commonJS = (cb, mod) => function() {
|
|
9
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
13
|
+
key = keys[i];
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
15
|
+
get: ((k) => from[k]).bind(null, key),
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
22
|
+
value: mod,
|
|
23
|
+
enumerable: true
|
|
24
|
+
}) : target, mod));
|
|
25
|
+
var __toDynamicImportESM = (isNodeMode) => (mod) => __toESM(mod.default, isNodeMode);
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
export { __toDynamicImportESM as n, __toESM as r, __commonJS as t };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
//#region rolldown:runtime
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __commonJS = (cb, mod) => function() {
|
|
9
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
13
|
+
key = keys[i];
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
15
|
+
get: ((k) => from[k]).bind(null, key),
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
22
|
+
value: mod,
|
|
23
|
+
enumerable: true
|
|
24
|
+
}) : target, mod));
|
|
25
|
+
var __toDynamicImportESM = (isNodeMode) => (mod) => __toESM(mod.default, isNodeMode);
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
|
|
29
|
+
Object.defineProperty(exports, '__commonJS', {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
get: function () {
|
|
32
|
+
return __commonJS;
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
Object.defineProperty(exports, '__toDynamicImportESM', {
|
|
36
|
+
enumerable: true,
|
|
37
|
+
get: function () {
|
|
38
|
+
return __toDynamicImportESM;
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
Object.defineProperty(exports, '__toESM', {
|
|
42
|
+
enumerable: true,
|
|
43
|
+
get: function () {
|
|
44
|
+
return __toESM;
|
|
45
|
+
}
|
|
46
|
+
});
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
const require_chunk = require('./chunk-BaqVhFee.cjs');
|
|
2
|
+
let signal_exit = require("signal-exit");
|
|
3
|
+
signal_exit = require_chunk.__toESM(signal_exit);
|
|
4
|
+
let ws = require("ws");
|
|
5
|
+
ws = require_chunk.__toESM(ws);
|
|
6
|
+
let execa = require("execa");
|
|
7
|
+
execa = require_chunk.__toESM(execa);
|
|
8
|
+
|
|
9
|
+
//#region src/devtools.ts
|
|
10
|
+
function open() {
|
|
11
|
+
Promise.resolve().then(() => require_chunk.__toDynamicImportESM(1)(require("./backend-BwCrJwGY.cjs"))).then((devtools) => {
|
|
12
|
+
const customGlobal = global;
|
|
13
|
+
customGlobal.WebSocket || (customGlobal.WebSocket = ws.default);
|
|
14
|
+
customGlobal.window || (customGlobal.window = global);
|
|
15
|
+
customGlobal.self || (customGlobal.self = global);
|
|
16
|
+
customGlobal.isDevtoolsEnabled = true;
|
|
17
|
+
customGlobal.window.__REACT_DEVTOOLS_COMPONENT_FILTERS__ = [
|
|
18
|
+
{
|
|
19
|
+
type: 2,
|
|
20
|
+
value: "Context.Provider",
|
|
21
|
+
isEnabled: true,
|
|
22
|
+
isValid: true
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
type: 2,
|
|
26
|
+
value: "KubbRoot",
|
|
27
|
+
isEnabled: true,
|
|
28
|
+
isValid: true
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
type: 2,
|
|
32
|
+
value: "KubbErrorBoundary",
|
|
33
|
+
isEnabled: true,
|
|
34
|
+
isValid: true
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
type: 2,
|
|
38
|
+
value: "kubb-file",
|
|
39
|
+
isEnabled: true,
|
|
40
|
+
isValid: true
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
type: 2,
|
|
44
|
+
value: "kubb-text",
|
|
45
|
+
isEnabled: true,
|
|
46
|
+
isValid: true
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
type: 2,
|
|
50
|
+
value: "kubb-import",
|
|
51
|
+
isEnabled: true,
|
|
52
|
+
isValid: true
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
type: 2,
|
|
56
|
+
value: "kubb-export",
|
|
57
|
+
isEnabled: true,
|
|
58
|
+
isValid: true
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
type: 2,
|
|
62
|
+
value: "kubb-source",
|
|
63
|
+
isEnabled: true,
|
|
64
|
+
isValid: true
|
|
65
|
+
}
|
|
66
|
+
];
|
|
67
|
+
console.info("Opening devtools");
|
|
68
|
+
const controller = new AbortController();
|
|
69
|
+
(0, execa.execa)({
|
|
70
|
+
stdio: "pipe",
|
|
71
|
+
preferLocal: true,
|
|
72
|
+
cancelSignal: controller.signal,
|
|
73
|
+
gracefulCancel: true
|
|
74
|
+
})`npx react-devtools`;
|
|
75
|
+
devtools.initialize();
|
|
76
|
+
console.info("Connecting devtools");
|
|
77
|
+
try {
|
|
78
|
+
devtools.connectToDevTools({
|
|
79
|
+
host: "localhost",
|
|
80
|
+
port: 8097,
|
|
81
|
+
useHttps: false,
|
|
82
|
+
isAppActive: () => true
|
|
83
|
+
});
|
|
84
|
+
} catch (e) {
|
|
85
|
+
console.error(e);
|
|
86
|
+
console.info("Error when connecting the devtools");
|
|
87
|
+
}
|
|
88
|
+
(0, signal_exit.onExit)(() => {
|
|
89
|
+
console.info("Disconnecting devtools");
|
|
90
|
+
controller.abort();
|
|
91
|
+
}, { alwaysLast: false });
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
//#endregion
|
|
96
|
+
Object.defineProperty(exports, 'open', {
|
|
97
|
+
enumerable: true,
|
|
98
|
+
get: function () {
|
|
99
|
+
return open;
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
//# sourceMappingURL=devtools-CYVZyenT.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"devtools-CYVZyenT.cjs","names":[],"sources":["../src/devtools.ts"],"sourcesContent":["import { onExit } from 'signal-exit'\n\nimport ws from 'ws'\nimport { execa } from 'execa'\n\ndeclare global {\n var WebSocket: typeof WebSocket\n var self: any\n var window: any\n var isDevtoolsEnabled: any\n}\n\nexport function open() {\n // biome-ignore lint/suspicious/noTsIgnore: cannot find types\n // @ts-ignore\n import('react-devtools-core').then((devtools) => {\n // Filter out Kubbs's internal components from devtools for a cleaner view.\n // See https://github.com/facebook/react/blob/edf6eac8a181860fd8a2d076a43806f1237495a1/packages/react-devtools-shared/src/types.js#L24\n const customGlobal = global as any\n customGlobal.WebSocket ||= ws\n customGlobal.window ||= global\n customGlobal.self ||= global\n customGlobal.isDevtoolsEnabled = true\n customGlobal.window.__REACT_DEVTOOLS_COMPONENT_FILTERS__ = [\n {\n // ComponentFilterDisplayName\n type: 2,\n value: 'Context.Provider',\n isEnabled: true,\n isValid: true,\n },\n {\n // ComponentFilterDisplayName\n type: 2,\n value: 'KubbRoot',\n isEnabled: true,\n isValid: true,\n },\n {\n // ComponentFilterDisplayName\n type: 2,\n value: 'KubbErrorBoundary',\n isEnabled: true,\n isValid: true,\n },\n {\n // ComponentFilterDisplayName\n type: 2,\n value: 'kubb-file',\n isEnabled: true,\n isValid: true,\n },\n {\n // ComponentFilterDisplayName\n type: 2,\n value: 'kubb-text',\n isEnabled: true,\n isValid: true,\n },\n {\n // ComponentFilterDisplayName\n type: 2,\n value: 'kubb-import',\n isEnabled: true,\n isValid: true,\n },\n {\n // ComponentFilterDisplayName\n type: 2,\n value: 'kubb-export',\n isEnabled: true,\n isValid: true,\n },\n {\n // ComponentFilterDisplayName\n type: 2,\n value: 'kubb-source',\n isEnabled: true,\n isValid: true,\n },\n ]\n\n console.info('Opening devtools')\n const controller = new AbortController()\n execa({\n stdio: 'pipe',\n preferLocal: true,\n cancelSignal: controller.signal,\n gracefulCancel: true,\n })`npx react-devtools`\n\n ;(devtools as any).initialize()\n console.info('Connecting devtools')\n\n try {\n ;(devtools as any).connectToDevTools({\n host: 'localhost',\n port: 8097,\n useHttps: false,\n isAppActive: () => true,\n })\n } catch (e) {\n console.error(e)\n console.info('Error when connecting the devtools')\n }\n\n onExit(\n () => {\n console.info('Disconnecting devtools')\n controller.abort()\n },\n { alwaysLast: false },\n )\n })\n}\n"],"mappings":";;;;;;;;;AAYA,SAAgB,OAAO;AAGrB,wGAA8B,MAAM,aAAa;EAG/C,MAAM,eAAe;AACrB,eAAa,cAAb,aAAa,YAAc;AAC3B,eAAa,WAAb,aAAa,SAAW;AACxB,eAAa,SAAb,aAAa,OAAS;AACtB,eAAa,oBAAoB;AACjC,eAAa,OAAO,uCAAuC;GACzD;IAEE,MAAM;IACN,OAAO;IACP,WAAW;IACX,SAAS;IACV;GACD;IAEE,MAAM;IACN,OAAO;IACP,WAAW;IACX,SAAS;IACV;GACD;IAEE,MAAM;IACN,OAAO;IACP,WAAW;IACX,SAAS;IACV;GACD;IAEE,MAAM;IACN,OAAO;IACP,WAAW;IACX,SAAS;IACV;GACD;IAEE,MAAM;IACN,OAAO;IACP,WAAW;IACX,SAAS;IACV;GACD;IAEE,MAAM;IACN,OAAO;IACP,WAAW;IACX,SAAS;IACV;GACD;IAEE,MAAM;IACN,OAAO;IACP,WAAW;IACX,SAAS;IACV;GACD;IAEE,MAAM;IACN,OAAO;IACP,WAAW;IACX,SAAS;IACV;GACF;AAED,UAAQ,KAAK,mBAAmB;EAChC,MAAM,aAAa,IAAI,iBAAiB;AACxC,mBAAM;GACJ,OAAO;GACP,aAAa;GACb,cAAc,WAAW;GACzB,gBAAgB;GACjB,CAAC;AAED,EAAC,SAAiB,YAAY;AAC/B,UAAQ,KAAK,sBAAsB;AAEnC,MAAI;AACD,GAAC,SAAiB,kBAAkB;IACnC,MAAM;IACN,MAAM;IACN,UAAU;IACV,mBAAmB;IACpB,CAAC;WACK,GAAG;AACV,WAAQ,MAAM,EAAE;AAChB,WAAQ,KAAK,qCAAqC;;AAGpD,gCACQ;AACJ,WAAQ,KAAK,yBAAyB;AACtC,cAAW,OAAO;KAEpB,EAAE,YAAY,OAAO,CACtB;GACD"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { n as __toDynamicImportESM } from "./chunk-9mlisOrp.js";
|
|
2
|
+
import { onExit } from "signal-exit";
|
|
3
|
+
import ws from "ws";
|
|
4
|
+
import { execa } from "execa";
|
|
5
|
+
|
|
6
|
+
//#region src/devtools.ts
|
|
7
|
+
function open() {
|
|
8
|
+
import("./backend-U2f8IEJ7.js").then(__toDynamicImportESM(1)).then((devtools) => {
|
|
9
|
+
const customGlobal = global;
|
|
10
|
+
customGlobal.WebSocket || (customGlobal.WebSocket = ws);
|
|
11
|
+
customGlobal.window || (customGlobal.window = global);
|
|
12
|
+
customGlobal.self || (customGlobal.self = global);
|
|
13
|
+
customGlobal.isDevtoolsEnabled = true;
|
|
14
|
+
customGlobal.window.__REACT_DEVTOOLS_COMPONENT_FILTERS__ = [
|
|
15
|
+
{
|
|
16
|
+
type: 2,
|
|
17
|
+
value: "Context.Provider",
|
|
18
|
+
isEnabled: true,
|
|
19
|
+
isValid: true
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
type: 2,
|
|
23
|
+
value: "KubbRoot",
|
|
24
|
+
isEnabled: true,
|
|
25
|
+
isValid: true
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
type: 2,
|
|
29
|
+
value: "KubbErrorBoundary",
|
|
30
|
+
isEnabled: true,
|
|
31
|
+
isValid: true
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
type: 2,
|
|
35
|
+
value: "kubb-file",
|
|
36
|
+
isEnabled: true,
|
|
37
|
+
isValid: true
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
type: 2,
|
|
41
|
+
value: "kubb-text",
|
|
42
|
+
isEnabled: true,
|
|
43
|
+
isValid: true
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
type: 2,
|
|
47
|
+
value: "kubb-import",
|
|
48
|
+
isEnabled: true,
|
|
49
|
+
isValid: true
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
type: 2,
|
|
53
|
+
value: "kubb-export",
|
|
54
|
+
isEnabled: true,
|
|
55
|
+
isValid: true
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
type: 2,
|
|
59
|
+
value: "kubb-source",
|
|
60
|
+
isEnabled: true,
|
|
61
|
+
isValid: true
|
|
62
|
+
}
|
|
63
|
+
];
|
|
64
|
+
console.info("Opening devtools");
|
|
65
|
+
const controller = new AbortController();
|
|
66
|
+
execa({
|
|
67
|
+
stdio: "pipe",
|
|
68
|
+
preferLocal: true,
|
|
69
|
+
cancelSignal: controller.signal,
|
|
70
|
+
gracefulCancel: true
|
|
71
|
+
})`npx react-devtools`;
|
|
72
|
+
devtools.initialize();
|
|
73
|
+
console.info("Connecting devtools");
|
|
74
|
+
try {
|
|
75
|
+
devtools.connectToDevTools({
|
|
76
|
+
host: "localhost",
|
|
77
|
+
port: 8097,
|
|
78
|
+
useHttps: false,
|
|
79
|
+
isAppActive: () => true
|
|
80
|
+
});
|
|
81
|
+
} catch (e) {
|
|
82
|
+
console.error(e);
|
|
83
|
+
console.info("Error when connecting the devtools");
|
|
84
|
+
}
|
|
85
|
+
onExit(() => {
|
|
86
|
+
console.info("Disconnecting devtools");
|
|
87
|
+
controller.abort();
|
|
88
|
+
}, { alwaysLast: false });
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
//#endregion
|
|
93
|
+
export { open as t };
|
|
94
|
+
//# sourceMappingURL=devtools-D7cmED8s.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"devtools-D7cmED8s.js","names":[],"sources":["../src/devtools.ts"],"sourcesContent":["import { onExit } from 'signal-exit'\n\nimport ws from 'ws'\nimport { execa } from 'execa'\n\ndeclare global {\n var WebSocket: typeof WebSocket\n var self: any\n var window: any\n var isDevtoolsEnabled: any\n}\n\nexport function open() {\n // biome-ignore lint/suspicious/noTsIgnore: cannot find types\n // @ts-ignore\n import('react-devtools-core').then((devtools) => {\n // Filter out Kubbs's internal components from devtools for a cleaner view.\n // See https://github.com/facebook/react/blob/edf6eac8a181860fd8a2d076a43806f1237495a1/packages/react-devtools-shared/src/types.js#L24\n const customGlobal = global as any\n customGlobal.WebSocket ||= ws\n customGlobal.window ||= global\n customGlobal.self ||= global\n customGlobal.isDevtoolsEnabled = true\n customGlobal.window.__REACT_DEVTOOLS_COMPONENT_FILTERS__ = [\n {\n // ComponentFilterDisplayName\n type: 2,\n value: 'Context.Provider',\n isEnabled: true,\n isValid: true,\n },\n {\n // ComponentFilterDisplayName\n type: 2,\n value: 'KubbRoot',\n isEnabled: true,\n isValid: true,\n },\n {\n // ComponentFilterDisplayName\n type: 2,\n value: 'KubbErrorBoundary',\n isEnabled: true,\n isValid: true,\n },\n {\n // ComponentFilterDisplayName\n type: 2,\n value: 'kubb-file',\n isEnabled: true,\n isValid: true,\n },\n {\n // ComponentFilterDisplayName\n type: 2,\n value: 'kubb-text',\n isEnabled: true,\n isValid: true,\n },\n {\n // ComponentFilterDisplayName\n type: 2,\n value: 'kubb-import',\n isEnabled: true,\n isValid: true,\n },\n {\n // ComponentFilterDisplayName\n type: 2,\n value: 'kubb-export',\n isEnabled: true,\n isValid: true,\n },\n {\n // ComponentFilterDisplayName\n type: 2,\n value: 'kubb-source',\n isEnabled: true,\n isValid: true,\n },\n ]\n\n console.info('Opening devtools')\n const controller = new AbortController()\n execa({\n stdio: 'pipe',\n preferLocal: true,\n cancelSignal: controller.signal,\n gracefulCancel: true,\n })`npx react-devtools`\n\n ;(devtools as any).initialize()\n console.info('Connecting devtools')\n\n try {\n ;(devtools as any).connectToDevTools({\n host: 'localhost',\n port: 8097,\n useHttps: false,\n isAppActive: () => true,\n })\n } catch (e) {\n console.error(e)\n console.info('Error when connecting the devtools')\n }\n\n onExit(\n () => {\n console.info('Disconnecting devtools')\n controller.abort()\n },\n { alwaysLast: false },\n )\n })\n}\n"],"mappings":";;;;;;AAYA,SAAgB,OAAO;AAGrB,QAAO,uDAAuB,MAAM,aAAa;EAG/C,MAAM,eAAe;AACrB,eAAa,cAAb,aAAa,YAAc;AAC3B,eAAa,WAAb,aAAa,SAAW;AACxB,eAAa,SAAb,aAAa,OAAS;AACtB,eAAa,oBAAoB;AACjC,eAAa,OAAO,uCAAuC;GACzD;IAEE,MAAM;IACN,OAAO;IACP,WAAW;IACX,SAAS;IACV;GACD;IAEE,MAAM;IACN,OAAO;IACP,WAAW;IACX,SAAS;IACV;GACD;IAEE,MAAM;IACN,OAAO;IACP,WAAW;IACX,SAAS;IACV;GACD;IAEE,MAAM;IACN,OAAO;IACP,WAAW;IACX,SAAS;IACV;GACD;IAEE,MAAM;IACN,OAAO;IACP,WAAW;IACX,SAAS;IACV;GACD;IAEE,MAAM;IACN,OAAO;IACP,WAAW;IACX,SAAS;IACV;GACD;IAEE,MAAM;IACN,OAAO;IACP,WAAW;IACX,SAAS;IACV;GACD;IAEE,MAAM;IACN,OAAO;IACP,WAAW;IACX,SAAS;IACV;GACF;AAED,UAAQ,KAAK,mBAAmB;EAChC,MAAM,aAAa,IAAI,iBAAiB;AACxC,QAAM;GACJ,OAAO;GACP,aAAa;GACb,cAAc,WAAW;GACzB,gBAAgB;GACjB,CAAC;AAED,EAAC,SAAiB,YAAY;AAC/B,UAAQ,KAAK,sBAAsB;AAEnC,MAAI;AACD,GAAC,SAAiB,kBAAkB;IACnC,MAAM;IACN,MAAM;IACN,UAAU;IACV,mBAAmB;IACpB,CAAC;WACK,GAAG;AACV,WAAQ,MAAM,EAAE;AAChB,WAAQ,KAAK,qCAAqC;;AAGpD,eACQ;AACJ,WAAQ,KAAK,yBAAyB;AACtC,cAAW,OAAO;KAEpB,EAAE,YAAY,OAAO,CACtB;GACD"}
|