@kubb/react-fabric 0.11.4 → 0.11.6

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.
Files changed (67) hide show
  1. package/dist/{Fabric-BELBf-bX.d.cts → Fabric-4Ac6xwwR.d.ts} +4 -2
  2. package/dist/{Fabric-DbJhvsCq.d.ts → Fabric-xd8epqSF.d.cts} +1 -2
  3. package/dist/{TreeNode-Dqmg64Vf.d.cts → TreeNode-CoigrXFC.d.ts} +3 -3
  4. package/dist/{TreeNode-tc-jO4rk.d.ts → TreeNode-Pwm74f2F.d.cts} +2 -3
  5. package/dist/{chunk-BCPZiDLE.js → chunk-DkQCb-7t.js} +5 -1
  6. package/dist/globals.d.cts +3 -4
  7. package/dist/globals.d.ts +4 -4
  8. package/dist/index.cjs +110 -10
  9. package/dist/index.cjs.map +1 -1
  10. package/dist/index.d.cts +26 -24
  11. package/dist/index.d.ts +27 -24
  12. package/dist/index.js +107 -8
  13. package/dist/index.js.map +1 -1
  14. package/dist/jsx-dev-runtime.cjs +28 -12
  15. package/dist/jsx-dev-runtime.cjs.map +1 -1
  16. package/dist/jsx-dev-runtime.d.cts +6 -7
  17. package/dist/jsx-dev-runtime.d.ts +5 -5
  18. package/dist/jsx-dev-runtime.js +25 -8
  19. package/dist/jsx-dev-runtime.js.map +1 -1
  20. package/dist/{jsx-namespace-Cwg_oGAF.d.cts → jsx-namespace-CDB8OdrC.d.cts} +3 -3
  21. package/dist/{jsx-namespace-bLrscF7g.d.ts → jsx-namespace-rawlYj_g.d.ts} +3 -3
  22. package/dist/{jsx-runtime-Cq39dA50.cjs → jsx-runtime-6sQc68DD.cjs} +30 -13
  23. package/dist/{jsx-runtime-Cq39dA50.cjs.map → jsx-runtime-6sQc68DD.cjs.map} +1 -1
  24. package/dist/{jsx-runtime-Isgf9orn.js → jsx-runtime-CT8FKS42.js} +27 -9
  25. package/dist/{jsx-runtime-Isgf9orn.js.map → jsx-runtime-CT8FKS42.js.map} +1 -1
  26. package/dist/jsx-runtime.cjs +2 -2
  27. package/dist/jsx-runtime.d.cts +6 -7
  28. package/dist/jsx-runtime.d.ts +5 -5
  29. package/dist/jsx-runtime.js +2 -2
  30. package/dist/parsers.d.cts +2 -3
  31. package/dist/parsers.d.ts +3 -3
  32. package/dist/plugins.cjs +3 -3
  33. package/dist/plugins.d.cts +3 -4
  34. package/dist/plugins.d.ts +4 -4
  35. package/dist/plugins.js +3 -3
  36. package/dist/{react-DfIUVisP.js → react-CDrFaZVO.js} +92 -32
  37. package/dist/{react-DfIUVisP.js.map → react-CDrFaZVO.js.map} +1 -1
  38. package/dist/{react-CWV4qQg2.cjs → react-DgrQzKJp.cjs} +144 -35
  39. package/dist/{react-CWV4qQg2.cjs.map → react-DgrQzKJp.cjs.map} +1 -1
  40. package/dist/{reactPlugin-BHE3X6-B.d.ts → reactPlugin-6pWd-WfZ.d.cts} +2 -3
  41. package/dist/{reactPlugin-B8F6jVb5.cjs → reactPlugin-BzGD_nR7.cjs} +6507 -4219
  42. package/dist/reactPlugin-BzGD_nR7.cjs.map +1 -0
  43. package/dist/{reactPlugin-yhmHKdUw.d.cts → reactPlugin-CpMrftCn.d.ts} +3 -3
  44. package/dist/{reactPlugin-CAtVV84d.js → reactPlugin-lOa0xpGM.js} +6492 -4209
  45. package/dist/reactPlugin-lOa0xpGM.js.map +1 -0
  46. package/dist/{types-BKNiqRcq.d.cts → types-125Qu-Uh.d.ts} +4 -4
  47. package/dist/{types-BKXB0ewg.d.ts → types-BrE57KWH.d.cts} +3 -4
  48. package/dist/types.d.cts +2 -2
  49. package/dist/types.d.ts +2 -2
  50. package/package.json +5 -12
  51. package/shims.d.ts +1 -0
  52. package/src/Runtime.tsx +0 -6
  53. package/src/components/App.tsx +5 -0
  54. package/src/createReactFabric.ts +2 -2
  55. package/src/devtools.ts +17 -2
  56. package/src/index.ts +1 -1
  57. package/dist/chunk-BrXtsOCC.cjs +0 -41
  58. package/dist/devtools-BRzetYQI.js +0 -94
  59. package/dist/devtools-BRzetYQI.js.map +0 -1
  60. package/dist/devtools-D3a3Jrcj.cjs +0 -101
  61. package/dist/devtools-D3a3Jrcj.cjs.map +0 -1
  62. package/dist/devtools.cjs +0 -3
  63. package/dist/devtools.d.cts +0 -11
  64. package/dist/devtools.d.ts +0 -11
  65. package/dist/devtools.js +0 -3
  66. package/dist/reactPlugin-B8F6jVb5.cjs.map +0 -1
  67. package/dist/reactPlugin-CAtVV84d.js.map +0 -1
@@ -1,5 +1,6 @@
1
- import { b as Source, c as FileManager, g as Import, h as File, p as Export } from "./Fabric-BELBf-bX.cjs";
2
- import { t as TreeNode } from "./TreeNode-Dqmg64Vf.cjs";
1
+ import { r as __name } from "./chunk-DkQCb-7t.js";
2
+ import { b as Source, c as FileManager, g as Import, h as File, p as Export } from "./Fabric-4Ac6xwwR.js";
3
+ import { t as TreeNode } from "./TreeNode-CoigrXFC.js";
3
4
  import React, { JSX, Key, ReactNode } from "react";
4
5
 
5
6
  //#region ../fabric-core/src/composables/useNodeTree.d.ts
@@ -125,5 +126,4 @@ type KubbImportProps = Import;
125
126
  type KubbExportProps = Export;
126
127
  type LineBreakProps = React.DetailedHTMLProps<React.HTMLAttributes<HTMLBRElement>, HTMLBRElement>;
127
128
  //#endregion
128
- export { Params as _, Key as a, RootContextProps as b, KubbFileProps as c, KubbSourceProps as d, KubbTextProps as f, Param as g, FunctionParams as h, ElementNames as i, KubbImportProps as l, TextNode as m, DOMNode as n, KubbElement as o, LineBreakProps as p, DOMNodeAttribute as r, KubbExportProps as s, DOMElement as t, KubbNode as u, createFunctionParams as v, ComponentNode as x, JSDoc as y };
129
- //# sourceMappingURL=types-BKNiqRcq.d.cts.map
129
+ export { Params as _, Key as a, RootContextProps as b, KubbFileProps as c, KubbSourceProps as d, KubbTextProps as f, Param as g, FunctionParams as h, ElementNames as i, KubbImportProps as l, TextNode as m, DOMNode as n, KubbElement as o, LineBreakProps as p, DOMNodeAttribute as r, KubbExportProps as s, DOMElement as t, KubbNode as u, createFunctionParams as v, ComponentNode as x, JSDoc as y };
@@ -1,5 +1,5 @@
1
- import { b as Source, c as FileManager, g as Import, h as File, p as Export } from "./Fabric-DbJhvsCq.js";
2
- import { t as TreeNode } from "./TreeNode-tc-jO4rk.js";
1
+ import { b as Source, c as FileManager, g as Import, h as File, p as Export, x as __name } from "./Fabric-xd8epqSF.cjs";
2
+ import { t as TreeNode } from "./TreeNode-Pwm74f2F.cjs";
3
3
  import React, { JSX, Key, ReactNode } from "react";
4
4
 
5
5
  //#region ../fabric-core/src/composables/useNodeTree.d.ts
@@ -125,5 +125,4 @@ type KubbImportProps = Import;
125
125
  type KubbExportProps = Export;
126
126
  type LineBreakProps = React.DetailedHTMLProps<React.HTMLAttributes<HTMLBRElement>, HTMLBRElement>;
127
127
  //#endregion
128
- export { Params as _, Key as a, RootContextProps as b, KubbFileProps as c, KubbSourceProps as d, KubbTextProps as f, Param as g, FunctionParams as h, ElementNames as i, KubbImportProps as l, TextNode as m, DOMNode as n, KubbElement as o, LineBreakProps as p, DOMNodeAttribute as r, KubbExportProps as s, DOMElement as t, KubbNode as u, createFunctionParams as v, ComponentNode as x, JSDoc as y };
129
- //# sourceMappingURL=types-BKXB0ewg.d.ts.map
128
+ export { Params as _, Key as a, RootContextProps as b, KubbFileProps as c, KubbSourceProps as d, KubbTextProps as f, Param as g, FunctionParams as h, ElementNames as i, KubbImportProps as l, TextNode as m, DOMNode as n, KubbElement as o, LineBreakProps as p, DOMNodeAttribute as r, KubbExportProps as s, DOMElement as t, KubbNode as u, createFunctionParams as v, ComponentNode as x, JSDoc as y };
package/dist/types.d.cts CHANGED
@@ -1,3 +1,3 @@
1
- import { _ as KubbFile_d_exports, a as FabricOptions, i as FabricMode, n as FabricConfig, r as FabricContext } from "./Fabric-BELBf-bX.cjs";
2
- import { _ as Params, a as Key, b as RootContextProps, c as KubbFileProps, d as KubbSourceProps, f as KubbTextProps, g as Param, i as ElementNames, l as KubbImportProps, m as TextNode, n as DOMNode, o as KubbElement, p as LineBreakProps, r as DOMNodeAttribute, s as KubbExportProps, t as DOMElement, u as KubbNode, x as ComponentNode, y as JSDoc } from "./types-BKNiqRcq.cjs";
1
+ import { _ as KubbFile_d_exports, a as FabricOptions, i as FabricMode, n as FabricConfig, r as FabricContext } from "./Fabric-xd8epqSF.cjs";
2
+ import { _ as Params, a as Key, b as RootContextProps, c as KubbFileProps, d as KubbSourceProps, f as KubbTextProps, g as Param, i as ElementNames, l as KubbImportProps, m as TextNode, n as DOMNode, o as KubbElement, p as LineBreakProps, r as DOMNodeAttribute, s as KubbExportProps, t as DOMElement, u as KubbNode, x as ComponentNode, y as JSDoc } from "./types-BrE57KWH.cjs";
3
3
  export { ComponentNode, DOMElement, DOMNode, DOMNodeAttribute, ElementNames, FabricConfig, FabricContext, FabricMode, FabricOptions, JSDoc, Key, KubbElement, KubbExportProps, KubbFile_d_exports as KubbFile, KubbFileProps, KubbImportProps, KubbNode, KubbSourceProps, KubbTextProps, LineBreakProps, Param, Params, RootContextProps, TextNode };
package/dist/types.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { _ as KubbFile_d_exports, a as FabricOptions, i as FabricMode, n as FabricConfig, r as FabricContext } from "./Fabric-DbJhvsCq.js";
2
- import { _ as Params, a as Key, b as RootContextProps, c as KubbFileProps, d as KubbSourceProps, f as KubbTextProps, g as Param, i as ElementNames, l as KubbImportProps, m as TextNode, n as DOMNode, o as KubbElement, p as LineBreakProps, r as DOMNodeAttribute, s as KubbExportProps, t as DOMElement, u as KubbNode, x as ComponentNode, y as JSDoc } from "./types-BKXB0ewg.js";
1
+ import { _ as KubbFile_d_exports, a as FabricOptions, i as FabricMode, n as FabricConfig, r as FabricContext } from "./Fabric-4Ac6xwwR.js";
2
+ import { _ as Params, a as Key, b as RootContextProps, c as KubbFileProps, d as KubbSourceProps, f as KubbTextProps, g as Param, i as ElementNames, l as KubbImportProps, m as TextNode, n as DOMNode, o as KubbElement, p as LineBreakProps, r as DOMNodeAttribute, s as KubbExportProps, t as DOMElement, u as KubbNode, x as ComponentNode, y as JSDoc } from "./types-125Qu-Uh.js";
3
3
  export { ComponentNode, DOMElement, DOMNode, DOMNodeAttribute, ElementNames, FabricConfig, FabricContext, FabricMode, FabricOptions, JSDoc, Key, KubbElement, KubbExportProps, KubbFile_d_exports as KubbFile, KubbFileProps, KubbImportProps, KubbNode, KubbSourceProps, KubbTextProps, LineBreakProps, Param, Params, RootContextProps, TextNode };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/react-fabric",
3
- "version": "0.11.4",
3
+ "version": "0.11.6",
4
4
  "description": "React integration for Kubb, providing JSX runtime support and React component generation capabilities for code generation plugins.",
5
5
  "keywords": [
6
6
  "react",
@@ -29,10 +29,6 @@
29
29
  "require": "./dist/index.cjs",
30
30
  "import": "./dist/index.js"
31
31
  },
32
- "./devtools": {
33
- "require": "./dist/devtools.cjs",
34
- "import": "./dist/devtools.js"
35
- },
36
32
  "./globals": {
37
33
  "require": "./dist/globals.cjs",
38
34
  "import": "./dist/globals.js"
@@ -67,9 +63,6 @@
67
63
  "globals": [
68
64
  "./dist/globals.d.ts"
69
65
  ],
70
- "devtools": [
71
- "./dist/devtools.d.ts"
72
- ],
73
66
  "jsx-dev-runtime": [
74
67
  "./dist/jsx-runtime.d.ts"
75
68
  ],
@@ -108,17 +101,17 @@
108
101
  "execa": "^9.6.1",
109
102
  "indent-string": "^5.0.0",
110
103
  "natural-orderby": "^5.0.0",
111
- "react-devtools-core": "6.1.2",
104
+ "react-devtools-core": "6.1.5",
112
105
  "signal-exit": "^4.1.0",
113
106
  "ws": "8.18.0",
114
- "@kubb/fabric-core": "0.11.4"
107
+ "@kubb/fabric-core": "0.11.6"
115
108
  },
116
109
  "devDependencies": {
117
110
  "@types/react": "^19.2.8",
118
111
  "@types/react-reconciler": "0.32.0",
119
112
  "@types/ws": "^8.18.1",
120
- "react": "19.2.1",
121
- "react-reconciler": "0.32.0"
113
+ "react": "19.2.3",
114
+ "react-reconciler": "0.33.0"
122
115
  },
123
116
  "engines": {
124
117
  "node": ">=20"
package/shims.d.ts ADDED
@@ -0,0 +1 @@
1
+ declare module 'react-devtools-core'
package/src/Runtime.tsx CHANGED
@@ -77,12 +77,6 @@ export class Runtime {
77
77
  },
78
78
  { alwaysLast: false },
79
79
  ).bind(this)
80
-
81
- Renderer.injectIntoDevTools({
82
- bundleType: 1,
83
- version: '19.1.0',
84
- rendererPackageName: 'kubb',
85
- })
86
80
  }
87
81
 
88
82
  get fileManager() {
@@ -1,4 +1,5 @@
1
1
  import { AppContext, NodeTreeContext, provide, RootContext, useContext, useNodeTree } from '@kubb/fabric-core'
2
+ import type * as React from 'react'
2
3
  import type { KubbNode } from '../types.ts'
3
4
 
4
5
  export type AppProps<TMeta extends object = object> = {
@@ -12,6 +13,10 @@ export type AppProps<TMeta extends object = object> = {
12
13
  children?: KubbNode
13
14
  }
14
15
 
16
+ export function Div(props: { children: React.ReactNode }) {
17
+ return <div>{props.children}</div>
18
+ }
19
+
15
20
  /**
16
21
  * App container containing the AppContext carrying `meta` and an `exit` hook.
17
22
  */
@@ -8,12 +8,12 @@ import { reactPlugin } from './plugins/reactPlugin.ts'
8
8
  export function createReactFabric(
9
9
  config: FabricConfig<Options & { mode?: FabricMode; devtools?: boolean }> = {},
10
10
  ): Fabric<Options & { mode?: FabricMode; devtools?: boolean }> {
11
- const fabric = createFabric({ mode: config.mode })
12
-
13
11
  if (config.devtools) {
14
12
  open()
15
13
  }
16
14
 
15
+ const fabric = createFabric({ mode: config.mode })
16
+
17
17
  fabric.use(reactPlugin, {
18
18
  stdout: config.stdout,
19
19
  stderr: config.stderr,
package/src/devtools.ts CHANGED
@@ -2,6 +2,8 @@ import { execa } from 'execa'
2
2
  import { onExit } from 'signal-exit'
3
3
  import ws from 'ws'
4
4
 
5
+ import { Renderer } from './Renderer.ts'
6
+
5
7
  declare global {
6
8
  var WebSocket: typeof WebSocket
7
9
  var self: any
@@ -81,7 +83,7 @@ export function open() {
81
83
 
82
84
  // biome-ignore lint/suspicious/noTsIgnore: cannot find types
83
85
  // @ts-ignore
84
- import('react-devtools-core').then((devtools) => {
86
+ import('react-devtools-core').then(async (devtools) => {
85
87
  console.info('Opening devtools')
86
88
  const controller = new AbortController()
87
89
  execa({
@@ -89,12 +91,25 @@ export function open() {
89
91
  preferLocal: true,
90
92
  cancelSignal: controller.signal,
91
93
  gracefulCancel: true,
92
- })`npx react-devtools`
94
+ })`npx react-devtools@6.1.5`
93
95
 
94
96
  // Destructure the functions from the module
95
97
  const { initialize, connectToDevTools } = devtools
96
98
 
99
+ // Initialize DevTools BEFORE importing Renderer (which imports React)
97
100
  initialize()
101
+ console.info('Initializing devtools')
102
+
103
+ // Inject the renderer BEFORE connecting to DevTools
104
+ // This ensures DevTools can properly discover the custom renderer
105
+ Renderer.injectIntoDevTools({
106
+ bundleType: 1,
107
+ version: '19.1.0',
108
+ rendererPackageName: 'kubb',
109
+ // findFiberByHostInstance is required for DevTools to map elements to fibers
110
+ findFiberByHostInstance: () => null,
111
+ })
112
+
98
113
  console.info('Connecting devtools')
99
114
 
100
115
  try {
package/src/index.ts CHANGED
@@ -15,7 +15,7 @@ export const useEffect = React.useEffect
15
15
  export const useReducer = React.useReducer
16
16
  export const useRef = React.useRef
17
17
  // components
18
- export { App } from './components/App.tsx'
18
+ export { App, Div } from './components/App.tsx'
19
19
  export { Const } from './components/Const.tsx'
20
20
  export { File } from './components/File.tsx'
21
21
  export { Function } from './components/Function.tsx'
@@ -1,41 +0,0 @@
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 __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
12
- key = keys[i];
13
- if (!__hasOwnProp.call(to, key) && key !== except) {
14
- __defProp(to, key, {
15
- get: ((k) => from[k]).bind(null, key),
16
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
- });
18
- }
19
- }
20
- }
21
- return to;
22
- };
23
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
24
- value: mod,
25
- enumerable: true
26
- }) : target, mod));
27
-
28
- //#endregion
29
-
30
- Object.defineProperty(exports, '__commonJSMin', {
31
- enumerable: true,
32
- get: function () {
33
- return __commonJSMin;
34
- }
35
- });
36
- Object.defineProperty(exports, '__toESM', {
37
- enumerable: true,
38
- get: function () {
39
- return __toESM;
40
- }
41
- });
@@ -1,94 +0,0 @@
1
- import { execa } from "execa";
2
- import { onExit } from "signal-exit";
3
- import ws from "ws";
4
-
5
- //#region src/devtools.ts
6
- function open() {
7
- const customGlobal = global;
8
- customGlobal.WebSocket || (customGlobal.WebSocket = ws);
9
- customGlobal.window || (customGlobal.window = global);
10
- customGlobal.self || (customGlobal.self = global);
11
- customGlobal.isDevtoolsEnabled = true;
12
- customGlobal.window.__REACT_DEVTOOLS_COMPONENT_FILTERS__ = [
13
- {
14
- type: 2,
15
- value: "Context.Provider",
16
- isEnabled: true,
17
- isValid: true
18
- },
19
- {
20
- type: 2,
21
- value: "KubbRoot",
22
- isEnabled: true,
23
- isValid: true
24
- },
25
- {
26
- type: 2,
27
- value: "KubbErrorBoundary",
28
- isEnabled: true,
29
- isValid: true
30
- },
31
- {
32
- type: 2,
33
- value: "kubb-file",
34
- isEnabled: true,
35
- isValid: true
36
- },
37
- {
38
- type: 2,
39
- value: "kubb-text",
40
- isEnabled: true,
41
- isValid: true
42
- },
43
- {
44
- type: 2,
45
- value: "kubb-import",
46
- isEnabled: true,
47
- isValid: true
48
- },
49
- {
50
- type: 2,
51
- value: "kubb-export",
52
- isEnabled: true,
53
- isValid: true
54
- },
55
- {
56
- type: 2,
57
- value: "kubb-source",
58
- isEnabled: true,
59
- isValid: true
60
- }
61
- ];
62
- import("react-devtools-core").then((devtools) => {
63
- console.info("Opening devtools");
64
- const controller = new AbortController();
65
- execa({
66
- stdio: "pipe",
67
- preferLocal: true,
68
- cancelSignal: controller.signal,
69
- gracefulCancel: true
70
- })`npx react-devtools`;
71
- const { initialize, connectToDevTools } = devtools;
72
- initialize();
73
- console.info("Connecting devtools");
74
- try {
75
- 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-BRzetYQI.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"devtools-BRzetYQI.js","names":[],"sources":["../src/devtools.ts"],"sourcesContent":["import { execa } from 'execa'\nimport { onExit } from 'signal-exit'\nimport ws from 'ws'\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 // Set up global polyfills BEFORE importing react-devtools-core\n // This is required because react-devtools-core expects these to be available\n const customGlobal = global as any\n customGlobal.WebSocket ||= ws\n customGlobal.window ||= global\n customGlobal.self ||= global\n customGlobal.isDevtoolsEnabled = true\n\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 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 // biome-ignore lint/suspicious/noTsIgnore: cannot find types\n // @ts-ignore\n import('react-devtools-core').then((devtools) => {\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 // Destructure the functions from the module\n const { initialize, connectToDevTools } = devtools\n\n initialize()\n console.info('Connecting devtools')\n\n try {\n 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":";;;;;AAWA,SAAgB,OAAO;CAGrB,MAAM,eAAe;AACrB,cAAa,cAAb,aAAa,YAAc;AAC3B,cAAa,WAAb,aAAa,SAAW;AACxB,cAAa,SAAb,aAAa,OAAS;AACtB,cAAa,oBAAoB;AAIjC,cAAa,OAAO,uCAAuC;EACzD;GAEE,MAAM;GACN,OAAO;GACP,WAAW;GACX,SAAS;GACV;EACD;GAEE,MAAM;GACN,OAAO;GACP,WAAW;GACX,SAAS;GACV;EACD;GAEE,MAAM;GACN,OAAO;GACP,WAAW;GACX,SAAS;GACV;EACD;GAEE,MAAM;GACN,OAAO;GACP,WAAW;GACX,SAAS;GACV;EACD;GAEE,MAAM;GACN,OAAO;GACP,WAAW;GACX,SAAS;GACV;EACD;GAEE,MAAM;GACN,OAAO;GACP,WAAW;GACX,SAAS;GACV;EACD;GAEE,MAAM;GACN,OAAO;GACP,WAAW;GACX,SAAS;GACV;EACD;GAEE,MAAM;GACN,OAAO;GACP,WAAW;GACX,SAAS;GACV;EACF;AAID,QAAO,uBAAuB,MAAM,aAAa;AAC/C,UAAQ,KAAK,mBAAmB;EAChC,MAAM,aAAa,IAAI,iBAAiB;AACxC,QAAM;GACJ,OAAO;GACP,aAAa;GACb,cAAc,WAAW;GACzB,gBAAgB;GACjB,CAAC;EAGF,MAAM,EAAE,YAAY,sBAAsB;AAE1C,cAAY;AACZ,UAAQ,KAAK,sBAAsB;AAEnC,MAAI;AACF,qBAAkB;IAChB,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"}
@@ -1,101 +0,0 @@
1
- const require_chunk = require('./chunk-BrXtsOCC.cjs');
2
- let execa = require("execa");
3
- let signal_exit = require("signal-exit");
4
- let ws = require("ws");
5
- ws = require_chunk.__toESM(ws);
6
-
7
- //#region src/devtools.ts
8
- function open() {
9
- const customGlobal = global;
10
- customGlobal.WebSocket || (customGlobal.WebSocket = ws.default);
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
- import("react-devtools-core").then((devtools) => {
65
- console.info("Opening devtools");
66
- const controller = new AbortController();
67
- (0, execa.execa)({
68
- stdio: "pipe",
69
- preferLocal: true,
70
- cancelSignal: controller.signal,
71
- gracefulCancel: true
72
- })`npx react-devtools`;
73
- const { initialize, connectToDevTools } = devtools;
74
- initialize();
75
- console.info("Connecting devtools");
76
- try {
77
- connectToDevTools({
78
- host: "localhost",
79
- port: 8097,
80
- useHttps: false,
81
- isAppActive: () => true
82
- });
83
- } catch (e) {
84
- console.error(e);
85
- console.info("Error when connecting the devtools");
86
- }
87
- (0, signal_exit.onExit)(() => {
88
- console.info("Disconnecting devtools");
89
- controller.abort();
90
- }, { alwaysLast: false });
91
- });
92
- }
93
-
94
- //#endregion
95
- Object.defineProperty(exports, 'open', {
96
- enumerable: true,
97
- get: function () {
98
- return open;
99
- }
100
- });
101
- //# sourceMappingURL=devtools-D3a3Jrcj.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"devtools-D3a3Jrcj.cjs","names":[],"sources":["../src/devtools.ts"],"sourcesContent":["import { execa } from 'execa'\nimport { onExit } from 'signal-exit'\nimport ws from 'ws'\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 // Set up global polyfills BEFORE importing react-devtools-core\n // This is required because react-devtools-core expects these to be available\n const customGlobal = global as any\n customGlobal.WebSocket ||= ws\n customGlobal.window ||= global\n customGlobal.self ||= global\n customGlobal.isDevtoolsEnabled = true\n\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 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 // biome-ignore lint/suspicious/noTsIgnore: cannot find types\n // @ts-ignore\n import('react-devtools-core').then((devtools) => {\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 // Destructure the functions from the module\n const { initialize, connectToDevTools } = devtools\n\n initialize()\n console.info('Connecting devtools')\n\n try {\n 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":";;;;;;;AAWA,SAAgB,OAAO;CAGrB,MAAM,eAAe;AACrB,cAAa,cAAb,aAAa,YAAc;AAC3B,cAAa,WAAb,aAAa,SAAW;AACxB,cAAa,SAAb,aAAa,OAAS;AACtB,cAAa,oBAAoB;AAIjC,cAAa,OAAO,uCAAuC;EACzD;GAEE,MAAM;GACN,OAAO;GACP,WAAW;GACX,SAAS;GACV;EACD;GAEE,MAAM;GACN,OAAO;GACP,WAAW;GACX,SAAS;GACV;EACD;GAEE,MAAM;GACN,OAAO;GACP,WAAW;GACX,SAAS;GACV;EACD;GAEE,MAAM;GACN,OAAO;GACP,WAAW;GACX,SAAS;GACV;EACD;GAEE,MAAM;GACN,OAAO;GACP,WAAW;GACX,SAAS;GACV;EACD;GAEE,MAAM;GACN,OAAO;GACP,WAAW;GACX,SAAS;GACV;EACD;GAEE,MAAM;GACN,OAAO;GACP,WAAW;GACX,SAAS;GACV;EACD;GAEE,MAAM;GACN,OAAO;GACP,WAAW;GACX,SAAS;GACV;EACF;AAID,QAAO,uBAAuB,MAAM,aAAa;AAC/C,UAAQ,KAAK,mBAAmB;EAChC,MAAM,aAAa,IAAI,iBAAiB;AACxC,mBAAM;GACJ,OAAO;GACP,aAAa;GACb,cAAc,WAAW;GACzB,gBAAgB;GACjB,CAAC;EAGF,MAAM,EAAE,YAAY,sBAAsB;AAE1C,cAAY;AACZ,UAAQ,KAAK,sBAAsB;AAEnC,MAAI;AACF,qBAAkB;IAChB,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"}
package/dist/devtools.cjs DELETED
@@ -1,3 +0,0 @@
1
- const require_devtools = require('./devtools-D3a3Jrcj.cjs');
2
-
3
- exports.open = require_devtools.open;
@@ -1,11 +0,0 @@
1
- //#region src/devtools.d.ts
2
- declare global {
3
- var WebSocket: typeof WebSocket;
4
- var self: any;
5
- var window: any;
6
- var isDevtoolsEnabled: any;
7
- }
8
- declare function open(): void;
9
- //#endregion
10
- export { open };
11
- //# sourceMappingURL=devtools.d.cts.map
@@ -1,11 +0,0 @@
1
- //#region src/devtools.d.ts
2
- declare global {
3
- var WebSocket: typeof WebSocket;
4
- var self: any;
5
- var window: any;
6
- var isDevtoolsEnabled: any;
7
- }
8
- declare function open(): void;
9
- //#endregion
10
- export { open };
11
- //# sourceMappingURL=devtools.d.ts.map
package/dist/devtools.js DELETED
@@ -1,3 +0,0 @@
1
- import { t as open } from "./devtools-BRzetYQI.js";
2
-
3
- export { open };