@kubb/react-fabric 0.4.1 → 0.5.0

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 CHANGED
@@ -139,16 +139,20 @@ Injected `fabric.writeEntry` parameters (via `barrelPlugin`):
139
139
  | root | `string` | Root directory where the entry `index.ts` should be created. |
140
140
  | mode | `'all' \| 'named' \| 'propagate' \| false` | Controls which export style to use for the entry barrel. |
141
141
 
142
- #### `progressPlugin`
143
- Shows a CLI progress bar by listening to core events.
142
+ #### `loggerPlugin`
143
+ Streams Fabric lifecycle activity as colourful consola logs, optional progress bars, and websocket messages that you can consume from custom tooling.
144
144
 
145
145
  ```
146
- import { progressPlugin } from '@kubb/fabric-core/plugins'
146
+ import { loggerPlugin } from '@kubb/fabric-core/plugins'
147
147
  ```
148
148
 
149
- | Option | Type | Default | Description |
150
- |---|---|---|-----------------------------------------------------------------------------------------|
151
- | | | — | This plugin has no options, it displays a CLI progress bar by listening to core events. |
149
+ | Option | Type | Default | Description |
150
+ |---|---|---|---|
151
+ | level | `import('consola').LogLevel` | — | Optional explicit log level passed to `createConsola`. |
152
+ | progress | `boolean` | `true` | Enable/disable the integrated CLI progress bar. |
153
+ | websocket | `boolean \| { host?: string; port?: number }` | `true` | Toggle or configure the websocket server that broadcasts Fabric events for future GUIs. |
154
+
155
+ By default the plugin displays a progress bar, starts a websocket server on an ephemeral port, and announces the URL. Every key lifecycle hook (`start`, `process:*`, `file:*`, `write:*`, `end`) is logged with a `Fabric` tag, animated in the progress bar, and broadcast to connected clients—perfect for building dashboards on top of Fabric.
152
156
 
153
157
 
154
158
  #### `graphPlugin`
package/dist/index.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { a as FabricOptions, b as Source, c as FileManager, f as BaseName, g as Import, h as File$1, i as FabricMode, l as FileProcessor, n as FabricConfig, p as Export, t as Fabric, v as Path, y as ResolvedFile } from "./Fabric-DECM64S6.cjs";
2
2
  import { a as JSDoc, d as KubbNode, g as FunctionParams, o as Key, y as createFunctionParams } from "./types-C2T-S5lY.cjs";
3
3
  import { t as Options$1 } from "./reactPlugin-DkhxnXP_.cjs";
4
- import * as react6 from "react";
4
+ import * as react0 from "react";
5
5
  import React, { ReactNode } from "react";
6
6
 
7
7
  //#region ../fabric-core/src/defineFabric.d.ts
@@ -50,9 +50,9 @@ type Props$4<TMeta = unknown> = {
50
50
  declare function App<TMeta = unknown>({
51
51
  meta,
52
52
  children
53
- }: Props$4<TMeta>): react6.JSX.Element;
53
+ }: Props$4<TMeta>): react0.JSX.Element;
54
54
  declare namespace App {
55
- var Context: react6.Context<AppContextProps<unknown> | undefined>;
55
+ var Context: react0.Context<AppContextProps<unknown> | undefined>;
56
56
  var displayName: string;
57
57
  }
58
58
  //#endregion
@@ -88,7 +88,7 @@ declare function Const({
88
88
  JSDoc,
89
89
  asConst,
90
90
  children
91
- }: Props$3): react6.JSX.Element;
91
+ }: Props$3): react0.JSX.Element;
92
92
  declare namespace Const {
93
93
  var displayName: string;
94
94
  }
@@ -137,13 +137,13 @@ type Props$2<TMeta> = BaseProps & {
137
137
  declare function File<TMeta extends object = object>({
138
138
  children,
139
139
  ...rest
140
- }: Props$2<TMeta>): react6.JSX.Element;
140
+ }: Props$2<TMeta>): react0.JSX.Element;
141
141
  declare namespace File {
142
142
  var displayName: string;
143
143
  var Export: typeof FileExport;
144
144
  var Import: typeof FileImport;
145
145
  var Source: typeof FileSource;
146
- var Context: react6.Context<FileContextProps<object>>;
146
+ var Context: react0.Context<FileContextProps<object>>;
147
147
  }
148
148
  type FileSourceProps = Omit<Source, 'value'> & {
149
149
  key?: Key;
@@ -155,7 +155,7 @@ declare function FileSource({
155
155
  isExportable,
156
156
  isIndexable,
157
157
  children
158
- }: FileSourceProps): react6.JSX.Element;
158
+ }: FileSourceProps): react0.JSX.Element;
159
159
  declare namespace FileSource {
160
160
  var displayName: string;
161
161
  }
@@ -167,7 +167,7 @@ declare function FileExport({
167
167
  path,
168
168
  isTypeOnly,
169
169
  asAlias
170
- }: FileExportProps): react6.JSX.Element;
170
+ }: FileExportProps): react0.JSX.Element;
171
171
  declare namespace FileExport {
172
172
  var displayName: string;
173
173
  }
@@ -180,7 +180,7 @@ declare function FileImport({
180
180
  path,
181
181
  isTypeOnly,
182
182
  isNameSpace
183
- }: FileImportProps): react6.JSX.Element;
183
+ }: FileImportProps): react0.JSX.Element;
184
184
  declare namespace FileImport {
185
185
  var displayName: string;
186
186
  }
@@ -233,7 +233,7 @@ declare function Function({
233
233
  returnType,
234
234
  JSDoc,
235
235
  children
236
- }: Props$1): react6.JSX.Element;
236
+ }: Props$1): react0.JSX.Element;
237
237
  declare namespace Function {
238
238
  var displayName: string;
239
239
  var Arrow: typeof ArrowFunction;
@@ -255,7 +255,7 @@ declare function ArrowFunction({
255
255
  JSDoc,
256
256
  singleLine,
257
257
  children
258
- }: ArrowFunctionProps): react6.JSX.Element;
258
+ }: ArrowFunctionProps): react0.JSX.Element;
259
259
  declare namespace ArrowFunction {
260
260
  var displayName: string;
261
261
  }
@@ -296,7 +296,7 @@ declare function Type({
296
296
  export: canExport,
297
297
  JSDoc,
298
298
  children
299
- }: Props): react6.JSX.Element;
299
+ }: Props): react0.JSX.Element;
300
300
  declare namespace Type {
301
301
  var displayName: string;
302
302
  }
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { a as FabricOptions, b as Source, c as FileManager, f as BaseName, g as Import, h as File$1, i as FabricMode, l as FileProcessor, n as FabricConfig, p as Export, t as Fabric, v as Path, y as ResolvedFile } from "./Fabric-DGhsnD3H.js";
2
2
  import { a as JSDoc, d as KubbNode, g as FunctionParams, o as Key, y as createFunctionParams } from "./types-rKVyNQC0.js";
3
3
  import { t as Options$1 } from "./reactPlugin-DAOLEVg9.js";
4
- import * as react0 from "react";
4
+ import * as react1 from "react";
5
5
  import React, { ReactNode } from "react";
6
6
 
7
7
  //#region ../fabric-core/src/defineFabric.d.ts
@@ -50,9 +50,9 @@ type Props$4<TMeta = unknown> = {
50
50
  declare function App<TMeta = unknown>({
51
51
  meta,
52
52
  children
53
- }: Props$4<TMeta>): react0.JSX.Element;
53
+ }: Props$4<TMeta>): react1.JSX.Element;
54
54
  declare namespace App {
55
- var Context: react0.Context<AppContextProps<unknown> | undefined>;
55
+ var Context: react1.Context<AppContextProps<unknown> | undefined>;
56
56
  var displayName: string;
57
57
  }
58
58
  //#endregion
@@ -88,7 +88,7 @@ declare function Const({
88
88
  JSDoc,
89
89
  asConst,
90
90
  children
91
- }: Props$3): react0.JSX.Element;
91
+ }: Props$3): react1.JSX.Element;
92
92
  declare namespace Const {
93
93
  var displayName: string;
94
94
  }
@@ -137,13 +137,13 @@ type Props$2<TMeta> = BaseProps & {
137
137
  declare function File<TMeta extends object = object>({
138
138
  children,
139
139
  ...rest
140
- }: Props$2<TMeta>): react0.JSX.Element;
140
+ }: Props$2<TMeta>): react1.JSX.Element;
141
141
  declare namespace File {
142
142
  var displayName: string;
143
143
  var Export: typeof FileExport;
144
144
  var Import: typeof FileImport;
145
145
  var Source: typeof FileSource;
146
- var Context: react0.Context<FileContextProps<object>>;
146
+ var Context: react1.Context<FileContextProps<object>>;
147
147
  }
148
148
  type FileSourceProps = Omit<Source, 'value'> & {
149
149
  key?: Key;
@@ -155,7 +155,7 @@ declare function FileSource({
155
155
  isExportable,
156
156
  isIndexable,
157
157
  children
158
- }: FileSourceProps): react0.JSX.Element;
158
+ }: FileSourceProps): react1.JSX.Element;
159
159
  declare namespace FileSource {
160
160
  var displayName: string;
161
161
  }
@@ -167,7 +167,7 @@ declare function FileExport({
167
167
  path,
168
168
  isTypeOnly,
169
169
  asAlias
170
- }: FileExportProps): react0.JSX.Element;
170
+ }: FileExportProps): react1.JSX.Element;
171
171
  declare namespace FileExport {
172
172
  var displayName: string;
173
173
  }
@@ -180,7 +180,7 @@ declare function FileImport({
180
180
  path,
181
181
  isTypeOnly,
182
182
  isNameSpace
183
- }: FileImportProps): react0.JSX.Element;
183
+ }: FileImportProps): react1.JSX.Element;
184
184
  declare namespace FileImport {
185
185
  var displayName: string;
186
186
  }
@@ -233,7 +233,7 @@ declare function Function({
233
233
  returnType,
234
234
  JSDoc,
235
235
  children
236
- }: Props$1): react0.JSX.Element;
236
+ }: Props$1): react1.JSX.Element;
237
237
  declare namespace Function {
238
238
  var displayName: string;
239
239
  var Arrow: typeof ArrowFunction;
@@ -255,7 +255,7 @@ declare function ArrowFunction({
255
255
  JSDoc,
256
256
  singleLine,
257
257
  children
258
- }: ArrowFunctionProps): react0.JSX.Element;
258
+ }: ArrowFunctionProps): react1.JSX.Element;
259
259
  declare namespace ArrowFunction {
260
260
  var displayName: string;
261
261
  }
@@ -296,7 +296,7 @@ declare function Type({
296
296
  export: canExport,
297
297
  JSDoc,
298
298
  children
299
- }: Props): react0.JSX.Element;
299
+ }: Props): react1.JSX.Element;
300
300
  declare namespace Type {
301
301
  var displayName: string;
302
302
  }
@@ -1,9 +1,10 @@
1
1
  import { m as Extname, o as Plugin, s as UserPlugin } from "./Fabric-DECM64S6.cjs";
2
2
  import { n as reactPlugin } from "./reactPlugin-DkhxnXP_.cjs";
3
+ import { LogLevel } from "consola";
3
4
 
4
5
  //#region ../fabric-core/src/plugins/barrelPlugin.d.ts
5
6
  type Mode = 'all' | 'named' | 'propagate' | false;
6
- type Options$2 = {
7
+ type Options$3 = {
7
8
  root: string;
8
9
  mode: Mode;
9
10
  dryRun?: boolean;
@@ -28,16 +29,16 @@ declare global {
28
29
  }
29
30
  }
30
31
  }
31
- declare const barrelPlugin: Plugin<Options$2, ExtendOptions$1>;
32
+ declare const barrelPlugin: Plugin<Options$3, ExtendOptions$1>;
32
33
  //#endregion
33
34
  //#region ../fabric-core/src/plugins/createPlugin.d.ts
34
- declare function createPlugin<Options$3 = unknown, TAppExtension extends Record<string, any> = {}>(plugin: UserPlugin<Options$3, TAppExtension>): Plugin<Options$3, TAppExtension>;
35
+ declare function createPlugin<Options$4 = unknown, TAppExtension extends Record<string, any> = {}>(plugin: UserPlugin<Options$4, TAppExtension>): Plugin<Options$4, TAppExtension>;
35
36
  //#endregion
36
37
  //#region ../fabric-core/src/plugins/fsPlugin.d.ts
37
38
  type WriteOptions = {
38
39
  extension?: Record<Extname, Extname | ''>;
39
40
  };
40
- type Options$1 = {
41
+ type Options$2 = {
41
42
  dryRun?: boolean;
42
43
  /**
43
44
  * Optional callback that is invoked whenever a file is written by the plugin.
@@ -58,20 +59,51 @@ declare global {
58
59
  }
59
60
  }
60
61
  }
61
- declare const fsPlugin: Plugin<Options$1, ExtendOptions>;
62
+ declare const fsPlugin: Plugin<Options$2, ExtendOptions>;
62
63
  //#endregion
63
64
  //#region ../fabric-core/src/plugins/graphPlugin.d.ts
64
- type Options = {
65
+ type Options$1 = {
65
66
  root: string;
66
67
  /**
67
68
  * @default false
68
69
  */
69
70
  open?: boolean;
70
71
  };
71
- declare const graphPlugin: Plugin<Options, {}>;
72
+ declare const graphPlugin: Plugin<Options$1, {}>;
72
73
  //#endregion
73
- //#region ../fabric-core/src/plugins/progressPlugin.d.ts
74
- declare const progressPlugin: Plugin<[], {}>;
74
+ //#region ../fabric-core/src/plugins/loggerPlugin.d.ts
75
+ type WebSocketOptions = {
76
+ /**
77
+ * Hostname to bind the websocket server to.
78
+ * @default '127.0.0.1'
79
+ */
80
+ host?: string;
81
+ /**
82
+ * Port to bind the websocket server to.
83
+ * @default 0 (random available port)
84
+ */
85
+ port?: number;
86
+ };
87
+ type Options = {
88
+ /**
89
+ * Explicit consola log level.
90
+ */
91
+ level?: LogLevel;
92
+ /**
93
+ * Toggle progress bar output.
94
+ * @default true
95
+ */
96
+ progress?: boolean;
97
+ /**
98
+ * Toggle or configure the websocket broadcast server.
99
+ * When `true`, a websocket server is started on an ephemeral port.
100
+ * When `false`, websocket support is disabled.
101
+ * When providing an object, the server uses the supplied host and port.
102
+ * @default true
103
+ */
104
+ websocket?: boolean | WebSocketOptions;
105
+ };
106
+ declare const loggerPlugin: Plugin<Options, {}>;
75
107
  //#endregion
76
- export { barrelPlugin, createPlugin, fsPlugin, graphPlugin, progressPlugin, reactPlugin };
108
+ export { barrelPlugin, createPlugin, fsPlugin, graphPlugin, loggerPlugin, reactPlugin };
77
109
  //# sourceMappingURL=plugins.d.cts.map
package/dist/plugins.d.ts CHANGED
@@ -1,9 +1,10 @@
1
1
  import { m as Extname, o as Plugin, s as UserPlugin } from "./Fabric-DGhsnD3H.js";
2
2
  import { n as reactPlugin } from "./reactPlugin-DAOLEVg9.js";
3
+ import { LogLevel } from "consola";
3
4
 
4
5
  //#region ../fabric-core/src/plugins/barrelPlugin.d.ts
5
6
  type Mode = 'all' | 'named' | 'propagate' | false;
6
- type Options$2 = {
7
+ type Options$3 = {
7
8
  root: string;
8
9
  mode: Mode;
9
10
  dryRun?: boolean;
@@ -28,16 +29,16 @@ declare global {
28
29
  }
29
30
  }
30
31
  }
31
- declare const barrelPlugin: Plugin<Options$2, ExtendOptions$1>;
32
+ declare const barrelPlugin: Plugin<Options$3, ExtendOptions$1>;
32
33
  //#endregion
33
34
  //#region ../fabric-core/src/plugins/createPlugin.d.ts
34
- declare function createPlugin<Options$3 = unknown, TAppExtension extends Record<string, any> = {}>(plugin: UserPlugin<Options$3, TAppExtension>): Plugin<Options$3, TAppExtension>;
35
+ declare function createPlugin<Options$4 = unknown, TAppExtension extends Record<string, any> = {}>(plugin: UserPlugin<Options$4, TAppExtension>): Plugin<Options$4, TAppExtension>;
35
36
  //#endregion
36
37
  //#region ../fabric-core/src/plugins/fsPlugin.d.ts
37
38
  type WriteOptions = {
38
39
  extension?: Record<Extname, Extname | ''>;
39
40
  };
40
- type Options$1 = {
41
+ type Options$2 = {
41
42
  dryRun?: boolean;
42
43
  /**
43
44
  * Optional callback that is invoked whenever a file is written by the plugin.
@@ -58,20 +59,51 @@ declare global {
58
59
  }
59
60
  }
60
61
  }
61
- declare const fsPlugin: Plugin<Options$1, ExtendOptions>;
62
+ declare const fsPlugin: Plugin<Options$2, ExtendOptions>;
62
63
  //#endregion
63
64
  //#region ../fabric-core/src/plugins/graphPlugin.d.ts
64
- type Options = {
65
+ type Options$1 = {
65
66
  root: string;
66
67
  /**
67
68
  * @default false
68
69
  */
69
70
  open?: boolean;
70
71
  };
71
- declare const graphPlugin: Plugin<Options, {}>;
72
+ declare const graphPlugin: Plugin<Options$1, {}>;
72
73
  //#endregion
73
- //#region ../fabric-core/src/plugins/progressPlugin.d.ts
74
- declare const progressPlugin: Plugin<[], {}>;
74
+ //#region ../fabric-core/src/plugins/loggerPlugin.d.ts
75
+ type WebSocketOptions = {
76
+ /**
77
+ * Hostname to bind the websocket server to.
78
+ * @default '127.0.0.1'
79
+ */
80
+ host?: string;
81
+ /**
82
+ * Port to bind the websocket server to.
83
+ * @default 0 (random available port)
84
+ */
85
+ port?: number;
86
+ };
87
+ type Options = {
88
+ /**
89
+ * Explicit consola log level.
90
+ */
91
+ level?: LogLevel;
92
+ /**
93
+ * Toggle progress bar output.
94
+ * @default true
95
+ */
96
+ progress?: boolean;
97
+ /**
98
+ * Toggle or configure the websocket broadcast server.
99
+ * When `true`, a websocket server is started on an ephemeral port.
100
+ * When `false`, websocket support is disabled.
101
+ * When providing an object, the server uses the supplied host and port.
102
+ * @default true
103
+ */
104
+ websocket?: boolean | WebSocketOptions;
105
+ };
106
+ declare const loggerPlugin: Plugin<Options, {}>;
75
107
  //#endregion
76
- export { barrelPlugin, createPlugin, fsPlugin, graphPlugin, progressPlugin, reactPlugin };
108
+ export { barrelPlugin, createPlugin, fsPlugin, graphPlugin, loggerPlugin, reactPlugin };
77
109
  //# sourceMappingURL=plugins.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/react-fabric",
3
- "version": "0.4.1",
3
+ "version": "0.5.0",
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",
@@ -111,7 +111,7 @@
111
111
  "react-devtools-core": "6.1.2",
112
112
  "signal-exit": "^4.1.0",
113
113
  "ws": "8.18.0",
114
- "@kubb/fabric-core": "0.4.1"
114
+ "@kubb/fabric-core": "0.5.0"
115
115
  },
116
116
  "devDependencies": {
117
117
  "@types/react": "^19.2.6",