@kubb/renderer-jsx 5.15.1 → 5.15.3

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.d.cts CHANGED
@@ -68,25 +68,7 @@ type ConstProps = Omit<ast.ConstNode, 'kind' | 'nodes'> & {
68
68
  * ```
69
69
  */
70
70
  export declare function Const({ children, ...props }: ConstProps): KubbReactElement;
71
- type BasePropsWithBaseName = {
72
- /**
73
- * Base file name including extension, derived from the input path.
74
- * Based on UNIX basename convention: `${name}${extname}`.
75
- *
76
- * @link https://nodejs.org/api/path.html#pathbasenamepath-suffix
77
- *
78
- * @example
79
- * `baseName: 'petStore.ts'`
80
- */
81
- baseName: `${string}.${string}`;
82
- /**
83
- * Fully qualified path to the generated file.
84
- *
85
- * @example
86
- * `path: 'src/models/petStore.ts'`
87
- */
88
- path: string;
89
- };
71
+ type BasePropsWithBaseName = Pick<ast.FileNode, 'baseName' | 'path'>;
90
72
  type BasePropsWithoutBaseName = {
91
73
  baseName?: never;
92
74
  /**
@@ -96,28 +78,12 @@ type BasePropsWithoutBaseName = {
96
78
  path?: string | null;
97
79
  };
98
80
  type BaseProps = BasePropsWithBaseName | BasePropsWithoutBaseName;
99
- type Props$6<TMeta> = BaseProps & {
81
+ type Props$6<TMeta extends object> = BaseProps & Pick<ast.UserFileNode<TMeta>, 'banner' | 'footer' | 'copy'> & {
100
82
  key?: Key;
101
83
  /**
102
84
  * Arbitrary metadata attached to the file node for plugins to read.
103
85
  */
104
86
  meta?: TMeta | null;
105
- /**
106
- * Text prepended to the generated file content before any source blocks.
107
- * Accepts `null` so `resolver.default.banner()` results can be passed directly.
108
- */
109
- banner?: string | null;
110
- /**
111
- * Text appended to the generated file content after all source blocks.
112
- * Accepts `null` so `resolver.default.footer()` results can be passed directly.
113
- */
114
- footer?: string | null;
115
- /**
116
- * Absolute on-disk path to copy into the output, through the parser's `copy` hook when it has
117
- * one. Use to emit a real source file shipped inside a package (a template) into the generated
118
- * folder. Child source blocks are ignored for output but still drive barrel generation.
119
- */
120
- copy?: string | null;
121
87
  /**
122
88
  * Child nodes rendered as the content of this file (source blocks, imports, exports).
123
89
  */
package/dist/index.d.ts CHANGED
@@ -68,25 +68,7 @@ type ConstProps = Omit<ast.ConstNode, 'kind' | 'nodes'> & {
68
68
  * ```
69
69
  */
70
70
  export declare function Const({ children, ...props }: ConstProps): KubbReactElement;
71
- type BasePropsWithBaseName = {
72
- /**
73
- * Base file name including extension, derived from the input path.
74
- * Based on UNIX basename convention: `${name}${extname}`.
75
- *
76
- * @link https://nodejs.org/api/path.html#pathbasenamepath-suffix
77
- *
78
- * @example
79
- * `baseName: 'petStore.ts'`
80
- */
81
- baseName: `${string}.${string}`;
82
- /**
83
- * Fully qualified path to the generated file.
84
- *
85
- * @example
86
- * `path: 'src/models/petStore.ts'`
87
- */
88
- path: string;
89
- };
71
+ type BasePropsWithBaseName = Pick<ast.FileNode, 'baseName' | 'path'>;
90
72
  type BasePropsWithoutBaseName = {
91
73
  baseName?: never;
92
74
  /**
@@ -96,28 +78,12 @@ type BasePropsWithoutBaseName = {
96
78
  path?: string | null;
97
79
  };
98
80
  type BaseProps = BasePropsWithBaseName | BasePropsWithoutBaseName;
99
- type Props$6<TMeta> = BaseProps & {
81
+ type Props$6<TMeta extends object> = BaseProps & Pick<ast.UserFileNode<TMeta>, 'banner' | 'footer' | 'copy'> & {
100
82
  key?: Key;
101
83
  /**
102
84
  * Arbitrary metadata attached to the file node for plugins to read.
103
85
  */
104
86
  meta?: TMeta | null;
105
- /**
106
- * Text prepended to the generated file content before any source blocks.
107
- * Accepts `null` so `resolver.default.banner()` results can be passed directly.
108
- */
109
- banner?: string | null;
110
- /**
111
- * Text appended to the generated file content after all source blocks.
112
- * Accepts `null` so `resolver.default.footer()` results can be passed directly.
113
- */
114
- footer?: string | null;
115
- /**
116
- * Absolute on-disk path to copy into the output, through the parser's `copy` hook when it has
117
- * one. Use to emit a real source file shipped inside a package (a template) into the generated
118
- * folder. Child source blocks are ignored for output but still drive barrel generation.
119
- */
120
- copy?: string | null;
121
87
  /**
122
88
  * Child nodes rendered as the content of this file (source blocks, imports, exports).
123
89
  */
@@ -20,19 +20,10 @@ declare namespace JSX {
20
20
  ['kubb-jsx']: {
21
21
  children?: string;
22
22
  };
23
- ['kubb-file']: {
23
+ ['kubb-file']: Omit<ast.UserFileNode, 'sources' | 'imports' | 'exports' | 'meta' | 'pointer'> & {
24
+ meta?: ast.FileNode['meta'] | null;
24
25
  id?: string | null;
25
26
  children?: KubbReactNode;
26
- baseName: ast.FileNode['baseName'];
27
- path: string;
28
- banner?: string | null;
29
- footer?: string | null;
30
- /**
31
- * Absolute on-disk path to copy into the output, through the parser's `copy` hook when it has
32
- * one. Use to emit a real source file shipped inside a package (a template) into the generated folder.
33
- */
34
- copy?: string | null;
35
- meta?: ast.FileNode['meta'] | null;
36
27
  };
37
28
  ['kubb-source']: Omit<ast.SourceNode, 'kind'> & {
38
29
  children?: KubbReactNode;
@@ -20,19 +20,10 @@ declare namespace JSX {
20
20
  ['kubb-jsx']: {
21
21
  children?: string;
22
22
  };
23
- ['kubb-file']: {
23
+ ['kubb-file']: Omit<ast.UserFileNode, 'sources' | 'imports' | 'exports' | 'meta' | 'pointer'> & {
24
+ meta?: ast.FileNode['meta'] | null;
24
25
  id?: string | null;
25
26
  children?: KubbReactNode;
26
- baseName: ast.FileNode['baseName'];
27
- path: string;
28
- banner?: string | null;
29
- footer?: string | null;
30
- /**
31
- * Absolute on-disk path to copy into the output, through the parser's `copy` hook when it has
32
- * one. Use to emit a real source file shipped inside a package (a template) into the generated folder.
33
- */
34
- copy?: string | null;
35
- meta?: ast.FileNode['meta'] | null;
36
27
  };
37
28
  ['kubb-source']: Omit<ast.SourceNode, 'kind'> & {
38
29
  children?: KubbReactNode;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/renderer-jsx",
3
- "version": "5.15.1",
3
+ "version": "5.15.3",
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",
@@ -94,7 +94,7 @@
94
94
  "registry": "https://registry.npmjs.org/"
95
95
  },
96
96
  "dependencies": {
97
- "@kubb/ast": "5.15.1",
97
+ "@kubb/ast": "^5.15.3",
98
98
  "yaml": "^2.9.1"
99
99
  },
100
100
  "engines": {