@kubb/renderer-jsx 5.0.6 → 5.2.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/dist/index.cjs CHANGED
@@ -577,20 +577,22 @@ function* walkFiles(element) {
577
577
  yield* walkFiles(type(props));
578
578
  return;
579
579
  }
580
- if (typeof type === "string") if (type === "kubb-file" && props["baseName"] !== void 0 && props["path"] !== void 0) {
581
- const { sources, exports, imports } = collectFileChildren(props["children"]);
582
- yield {
583
- baseName: props["baseName"],
584
- path: props["path"],
585
- meta: props["meta"] || {},
586
- footer: props["footer"],
587
- banner: props["banner"],
588
- copy: props["copy"],
589
- sources,
590
- exports,
591
- imports
592
- };
593
- } else yield* walkFiles(props["children"]);
580
+ if (typeof type === "string") {
581
+ if (type === "kubb-file" && props["baseName"] !== void 0 && props["path"] !== void 0) {
582
+ const { sources, exports, imports } = collectFileChildren(props["children"]);
583
+ yield {
584
+ baseName: props["baseName"],
585
+ path: props["path"],
586
+ meta: props["meta"] || {},
587
+ footer: props["footer"],
588
+ banner: props["banner"],
589
+ copy: props["copy"],
590
+ sources,
591
+ exports,
592
+ imports
593
+ };
594
+ } else yield* walkFiles(props["children"]);
595
+ }
594
596
  }
595
597
  }
596
598
  /**
package/dist/index.d.ts CHANGED
@@ -43,8 +43,8 @@ type Props$7 = {
43
43
  * // > Breaking change in v6.
44
44
  * ```
45
45
  */
46
- declare function Callout({ type, title, children }: Props$7): KubbReactElement;
47
- declare namespace Callout {
46
+ export declare function Callout({ type, title, children }: Props$7): KubbReactElement;
47
+ export declare namespace Callout {
48
48
  var displayName: string;
49
49
  }
50
50
  //#endregion
@@ -105,8 +105,8 @@ type ConstProps = {
105
105
  * </Const>
106
106
  * ```
107
107
  */
108
- declare function Const({ children, ...props }: ConstProps): KubbReactElement;
109
- declare namespace Const {
108
+ export declare function Const({ children, ...props }: ConstProps): KubbReactElement;
109
+ export declare namespace Const {
110
110
  var displayName: string;
111
111
  }
112
112
  //#endregion
@@ -183,8 +183,8 @@ type Props$6<TMeta> = BaseProps & {
183
183
  * </File>
184
184
  * ```
185
185
  */
186
- declare function File<TMeta extends object = object>({ children, ...props }: Props$6<TMeta>): KubbReactElement;
187
- declare namespace File {
186
+ export declare function File<TMeta extends object = object>({ children, ...props }: Props$6<TMeta>): KubbReactElement;
187
+ export declare namespace File {
188
188
  var displayName: string;
189
189
  var Export: typeof FileExport;
190
190
  var Import: typeof FileImport;
@@ -304,8 +304,8 @@ type Props$5 = {
304
304
  * </File>
305
305
  * ```
306
306
  */
307
- declare function Frontmatter({ data }: Props$5): KubbReactElement;
308
- declare namespace Frontmatter {
307
+ export declare function Frontmatter({ data }: Props$5): KubbReactElement;
308
+ export declare namespace Frontmatter {
309
309
  var displayName: string;
310
310
  }
311
311
  //#endregion
@@ -385,8 +385,8 @@ type Props$4 = {
385
385
  * // }
386
386
  * ```
387
387
  */
388
- declare function Function({ children, ...props }: Props$4): KubbReactElement;
389
- declare namespace Function {
388
+ export declare function Function({ children, ...props }: Props$4): KubbReactElement;
389
+ export declare namespace Function {
390
390
  var displayName: string;
391
391
  var Arrow: typeof ArrowFunction;
392
392
  }
@@ -442,8 +442,8 @@ type Props$3 = {
442
442
  * // ## Installation
443
443
  * ```
444
444
  */
445
- declare function Heading({ level, children }: Props$3): KubbReactElement;
446
- declare namespace Heading {
445
+ export declare function Heading({ level, children }: Props$3): KubbReactElement;
446
+ export declare namespace Heading {
447
447
  var displayName: string;
448
448
  }
449
449
  //#endregion
@@ -475,8 +475,8 @@ type Props$2 = {
475
475
  * </Function>
476
476
  * ```
477
477
  */
478
- declare function Jsx({ children }: Props$2): KubbReactElement;
479
- declare namespace Jsx {
478
+ export declare function Jsx({ children }: Props$2): KubbReactElement;
479
+ export declare namespace Jsx {
480
480
  var displayName: string;
481
481
  }
482
482
  //#endregion
@@ -512,8 +512,8 @@ type Props$1 = {
512
512
  * // 2. Second
513
513
  * ```
514
514
  */
515
- declare function List({ ordered, items }: Props$1): KubbReactElement;
516
- declare namespace List {
515
+ export declare function List({ ordered, items }: Props$1): KubbReactElement;
516
+ export declare namespace List {
517
517
  var displayName: string;
518
518
  }
519
519
  //#endregion
@@ -538,8 +538,8 @@ type Props = {
538
538
  * <Paragraph>{'A pet object with `id` and `name` fields.'}</Paragraph>
539
539
  * ```
540
540
  */
541
- declare function Paragraph({ children }: Props): KubbReactElement;
542
- declare namespace Paragraph {
541
+ export declare function Paragraph({ children }: Props): KubbReactElement;
542
+ export declare namespace Paragraph {
543
543
  var displayName: string;
544
544
  }
545
545
  //#endregion
@@ -591,8 +591,8 @@ type TypeProps = {
591
591
  * </Type>
592
592
  * ```
593
593
  */
594
- declare function Type({ children, ...props }: TypeProps): KubbReactElement;
595
- declare namespace Type {
594
+ export declare function Type({ children, ...props }: TypeProps): KubbReactElement;
595
+ export declare namespace Type {
596
596
  var displayName: string;
597
597
  }
598
598
  //#endregion
@@ -1126,11 +1126,10 @@ type FileNode<TMeta extends object = object> = BaseNode & {
1126
1126
  * })
1127
1127
  * ```
1128
1128
  */
1129
- declare const jsxRenderer: () => {
1129
+ export declare const jsxRenderer: () => {
1130
1130
  render(element: KubbReactElement): Promise<void>;
1131
1131
  readonly files: FileNode[];
1132
1132
  [Symbol.dispose](): void;
1133
1133
  };
1134
1134
  //#endregion
1135
- export { Callout, Const, File, Frontmatter, Function, Heading, Jsx, List, Paragraph, Type, jsxRenderer };
1136
1135
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -576,20 +576,22 @@ function* walkFiles(element) {
576
576
  yield* walkFiles(type(props));
577
577
  return;
578
578
  }
579
- if (typeof type === "string") if (type === "kubb-file" && props["baseName"] !== void 0 && props["path"] !== void 0) {
580
- const { sources, exports, imports } = collectFileChildren(props["children"]);
581
- yield {
582
- baseName: props["baseName"],
583
- path: props["path"],
584
- meta: props["meta"] || {},
585
- footer: props["footer"],
586
- banner: props["banner"],
587
- copy: props["copy"],
588
- sources,
589
- exports,
590
- imports
591
- };
592
- } else yield* walkFiles(props["children"]);
579
+ if (typeof type === "string") {
580
+ if (type === "kubb-file" && props["baseName"] !== void 0 && props["path"] !== void 0) {
581
+ const { sources, exports, imports } = collectFileChildren(props["children"]);
582
+ yield {
583
+ baseName: props["baseName"],
584
+ path: props["path"],
585
+ meta: props["meta"] || {},
586
+ footer: props["footer"],
587
+ banner: props["banner"],
588
+ copy: props["copy"],
589
+ sources,
590
+ exports,
591
+ imports
592
+ };
593
+ } else yield* walkFiles(props["children"]);
594
+ }
593
595
  }
594
596
  }
595
597
  /**
@@ -70,7 +70,7 @@ declare namespace JSX {
70
70
  * Fragment marker. A `<>…</>` compiles to `jsx(Fragment, …)`, and the renderer
71
71
  * unwraps it while walking the tree.
72
72
  */
73
- declare const Fragment: unique symbol;
73
+ export declare const Fragment: unique symbol;
74
74
  /**
75
75
  * Create a Kubb JSX element. The automatic JSX runtime calls this for every tag,
76
76
  * so the renderer never depends on React at runtime. The `type` is a host
@@ -78,9 +78,9 @@ declare const Fragment: unique symbol;
78
78
  * `props`.
79
79
  */
80
80
  declare function createElement(type: unknown, props: Record<string, unknown> | null, key?: Key | null): KubbReactElement;
81
- declare const jsx: typeof createElement;
82
- declare const jsxs: typeof createElement;
83
- declare const jsxDEV: typeof createElement;
81
+ export declare const jsx: typeof createElement;
82
+ export declare const jsxs: typeof createElement;
83
+ export declare const jsxDEV: typeof createElement;
84
84
  //#endregion
85
- export { Fragment, type JSX, jsx, jsxDEV, jsxs };
85
+ export type { JSX };
86
86
  //# sourceMappingURL=jsx-runtime.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/renderer-jsx",
3
- "version": "5.0.6",
3
+ "version": "5.2.0",
4
4
  "description": "Self-contained synchronous JSX renderer for Kubb. Turns JSX into FileNodes with built-in components (File, Function, Type, Const). An alternative for the ast.factory syntax.",
5
5
  "keywords": [
6
6
  "codegen",
@@ -57,18 +57,22 @@
57
57
  },
58
58
  "exports": {
59
59
  ".": {
60
+ "types": "./dist/index.d.ts",
60
61
  "import": "./dist/index.js",
61
62
  "require": "./dist/index.cjs"
62
63
  },
63
64
  "./jsx-dev-runtime": {
65
+ "types": "./dist/jsx-dev-runtime.d.ts",
64
66
  "import": "./dist/jsx-dev-runtime.js",
65
67
  "require": "./dist/jsx-dev-runtime.cjs"
66
68
  },
67
69
  "./jsx-runtime": {
70
+ "types": "./dist/jsx-runtime.d.ts",
68
71
  "import": "./dist/jsx-runtime.js",
69
72
  "require": "./dist/jsx-runtime.cjs"
70
73
  },
71
74
  "./types": {
75
+ "types": "./dist/types.d.ts",
72
76
  "import": "./dist/types.js",
73
77
  "require": "./dist/types.cjs"
74
78
  },
@@ -79,7 +83,7 @@
79
83
  "registry": "https://registry.npmjs.org/"
80
84
  },
81
85
  "dependencies": {
82
- "@kubb/kit": "5.0.6",
86
+ "@kubb/kit": "5.2.0",
83
87
  "yaml": "^2.9.0"
84
88
  },
85
89
  "engines": {