@kubb/react
Advanced tools
Comparing version 1.15.0-canary.20231027T174927 to 1.15.0-canary.20231027T185556
@@ -1,3 +0,2 @@ | ||
import { Logger } from '@kubb/core/utils'; | ||
import { KubbFile } from '@kubb/core'; | ||
import { KubbFile, Logger } from '@kubb/core'; | ||
import { ReactNode, Key } from 'react'; | ||
@@ -18,3 +17,2 @@ | ||
'kubb-file': { | ||
id?: string; | ||
children?: ReactNode; | ||
@@ -25,3 +23,2 @@ key?: Key; | ||
env?: NodeJS.ProcessEnv; | ||
override?: boolean; | ||
}; | ||
@@ -33,4 +30,2 @@ 'kubb-source': { | ||
print?: boolean; | ||
removeComments?: boolean; | ||
noEmitHelpers?: boolean; | ||
}; | ||
@@ -81,9 +76,5 @@ 'kubb-import': KubbFile.Import & { | ||
/** | ||
* @deprecated | ||
* Use Files instead | ||
* File will include all sources combined | ||
* Custom for Kubb | ||
*/ | ||
file?: KubbFile.File; | ||
files: KubbFile.File[]; | ||
getFile: (id: string) => KubbFile.File | undefined; | ||
}; | ||
@@ -90,0 +81,0 @@ |
@@ -1,3 +0,2 @@ | ||
import { Logger } from '@kubb/core/utils'; | ||
import { KubbFile, FileManager, PluginManager } from '@kubb/core'; | ||
import { KubbFile, Logger, FileManager, PluginManager } from '@kubb/core'; | ||
import * as react from 'react'; | ||
@@ -9,2 +8,3 @@ import { ReactNode, Key } from 'react'; | ||
}; | ||
declare const AppContext: react.Context<AppContextProps<Record<string, unknown>>>; | ||
@@ -20,3 +20,2 @@ type ReactElementNames = 'br'; | ||
'kubb-file': { | ||
id?: string; | ||
children?: ReactNode; | ||
@@ -27,3 +26,2 @@ key?: Key; | ||
env?: NodeJS.ProcessEnv; | ||
override?: boolean; | ||
}; | ||
@@ -35,4 +33,2 @@ 'kubb-source': { | ||
print?: boolean; | ||
removeComments?: boolean; | ||
noEmitHelpers?: boolean; | ||
}; | ||
@@ -77,3 +73,2 @@ 'kubb-import': KubbFile.Import & { | ||
type NodeNames = ElementNames | TextName; | ||
type KubbNode = ReactNode; | ||
@@ -85,30 +80,30 @@ type RootType<T = unknown> = { | ||
/** | ||
* @deprecated | ||
* Use Files instead | ||
* File will include all sources combined | ||
* Custom for Kubb | ||
*/ | ||
file?: KubbFile.File; | ||
files: KubbFile.File[]; | ||
getFile: (id: string) => KubbFile.File | undefined; | ||
}; | ||
type Props$7 = { | ||
type Props$8 = { | ||
container?: DOMElement; | ||
logger?: Logger; | ||
}; | ||
declare function createRoot<Context extends AppContextProps = AppContextProps>({ container, logger }?: Props$7): RootType<Context>; | ||
declare function createRoot<Context extends AppContextProps = AppContextProps>({ container, logger }?: Props$8): RootType<Context>; | ||
type Props$7<Meta extends Record<string, unknown> = Record<string, unknown>> = { | ||
onError: (error: Error) => void; | ||
meta: Meta; | ||
logger?: Logger; | ||
children?: ReactNode; | ||
}; | ||
declare function App<Meta extends Record<string, unknown> = Record<string, unknown>>({ onError, logger, meta, children }: Props$7<Meta>): ReactNode; | ||
type Props$6 = KubbFile.Export & { | ||
print?: boolean; | ||
}; | ||
declare function Export({ name, path, isTypeOnly, asAlias, print: printExport }: Props$6): KubbNode; | ||
declare function Export({ name, path, isTypeOnly, asAlias, print: printExport }: Props$6): ReactNode; | ||
type Props$5 = KubbFile.Import & { | ||
print?: boolean; | ||
/** | ||
* When root is set it will get the path with relative getRelativePath(root, path) | ||
*/ | ||
root?: string; | ||
}; | ||
declare function Import({ name, root, path, isTypeOnly, print: printImport }: Props$5): KubbNode; | ||
declare function Import({ name, path, isTypeOnly, print: printImport }: Props$5): ReactNode; | ||
@@ -125,8 +120,6 @@ type BasePropsWithBaseName = { | ||
type Props$4 = BaseProps & { | ||
id?: string; | ||
env?: NodeJS.ProcessEnv; | ||
children?: KubbNode; | ||
override?: boolean; | ||
children?: ReactNode; | ||
}; | ||
declare function File(props: Props$4): KubbNode; | ||
declare function File({ baseName, path, env, children }: Props$4): ReactNode; | ||
declare namespace File { | ||
@@ -137,26 +130,8 @@ var Export: typeof Export; | ||
} | ||
type FileSourceUnionProps = { | ||
/** | ||
* When path is set it will copy-paste that file as a string inside the component | ||
* Children will then be ignored | ||
*/ | ||
type FileSourceProps = { | ||
print?: boolean; | ||
path?: string; | ||
children?: never; | ||
} | { | ||
/** | ||
* When path is set it will copy-paste that file as a string inside the component | ||
* Children will then be ignored | ||
*/ | ||
path?: never; | ||
children?: KubbNode; | ||
children?: ReactNode; | ||
}; | ||
type FileSourceProps = FileSourceUnionProps & { | ||
print?: boolean; | ||
/** | ||
* Removes comments | ||
*/ | ||
removeComments?: boolean; | ||
noEmitHelpers?: boolean; | ||
}; | ||
declare function FileSource({ path, print, removeComments, children }: FileSourceProps): KubbNode; | ||
declare function FileSource({ path, print, children }: FileSourceProps): ReactNode; | ||
@@ -170,3 +145,3 @@ type Props$3 = { | ||
returnType?: string; | ||
children?: KubbNode; | ||
children?: ReactNode; | ||
JSDoc?: { | ||
@@ -176,3 +151,3 @@ comments: string[]; | ||
}; | ||
declare function Function({ name, export: canExport, async, generics, params, returnType, JSDoc, children }: Props$3): KubbNode; | ||
declare function Function({ name, export: canExport, async, generics, params, returnType, JSDoc, children }: Props$3): ReactNode; | ||
declare namespace Function { | ||
@@ -184,11 +159,12 @@ var Arrow: typeof ArrowFunction; | ||
}; | ||
declare function ArrowFunction({ name, export: canExport, async, generics, params, returnType, JSDoc, singleLine, children }: ArrowFunctionProps): KubbNode; | ||
declare function ArrowFunction({ name, export: canExport, async, generics, params, returnType, JSDoc, singleLine, children }: ArrowFunctionProps): ReactNode; | ||
declare const Fun: typeof Function; | ||
type Props$2 = { | ||
children?: KubbNode; | ||
children?: ReactNode; | ||
indentSize?: number; | ||
}; | ||
declare function Text({ indentSize, children }: Props$2): KubbNode; | ||
declare function Text({ indentSize, children }: Props$2): ReactNode; | ||
declare namespace Text { | ||
var Space: ({ indentSize }: Omit<Props$2, "children">) => react.ReactNode; | ||
var Space: ({ indentSize }: Omit<Props$2, "children">) => ReactNode; | ||
} | ||
@@ -204,2 +180,3 @@ | ||
}; | ||
declare function createIndent(size: number): string; | ||
declare function useIndent({ size, children }: Props$1): React.ReactNode; | ||
@@ -217,2 +194,47 @@ | ||
export { AppContextProps, DOMElement, DOMNode, DOMNodeAttribute, ElementNames, Export, File, Function, Import, KubbNode, Node, NodeNames, RootType, Text, TextNode, createRoot, useApp, useFileManager, useIndent, useMeta, usePackageVersion, usePluginManager }; | ||
declare const createNode: (nodeName: ElementNames) => DOMElement; | ||
declare const appendChildNode: (node: DOMElement, childNode: DOMElement) => void; | ||
declare const insertBeforeNode: (node: DOMElement, newChildNode: DOMNode, beforeChildNode: DOMNode) => void; | ||
declare const removeChildNode: (node: DOMElement, removeNode: DOMNode) => void; | ||
declare const setAttribute: (node: DOMElement, key: string, value: DOMNodeAttribute) => void; | ||
declare const createTextNode: (text: string) => TextNode; | ||
declare const setTextNodeValue: (node: TextNode, text: string) => void; | ||
declare const nodeNames: ElementNames[]; | ||
type ReactTemplateOptions = { | ||
logger?: Logger; | ||
debug?: boolean; | ||
}; | ||
declare class ReactTemplate<Context extends AppContextProps = AppContextProps> { | ||
#private; | ||
readonly id: string; | ||
constructor(rootNode: DOMElement, options?: ReactTemplateOptions); | ||
get output(): string; | ||
get file(): KubbFile.File | undefined; | ||
resized: () => void; | ||
resolveExitPromise: () => void; | ||
rejectExitPromise: (reason?: Error) => void; | ||
unsubscribeExit: () => void; | ||
onRender: () => void; | ||
onError(_error: Error): void; | ||
render(node: ReactNode, context?: Context): void; | ||
unmount(error?: Error | number | null): void; | ||
} | ||
type Result = { | ||
output: string; | ||
imports: Array<KubbFile.Import>; | ||
exports: Array<KubbFile.Export>; | ||
file?: KubbFile.File; | ||
}; | ||
declare function renderer(node: DOMElement): Result; | ||
declare function getFile(node: DOMElement): KubbFile.File | undefined; | ||
declare function squashExportNodes(node: DOMElement): Array<KubbFile.Export>; | ||
declare function squashImportNodes(node: DOMElement): Array<KubbFile.Import>; | ||
declare function squashTextNodes(node: DOMElement): string; | ||
export { App, AppContext, AppContextProps, ArrowFunction, DOMElement, DOMNode, DOMNodeAttribute, ElementNames, Export, File, Fun, Function, Import, Node, NodeNames, ReactTemplate, ReactTemplateOptions, RootType, Text, TextNode, appendChildNode, createIndent, createNode, createRoot, createTextNode, getFile, insertBeforeNode, nodeNames, removeChildNode, renderer, setAttribute, setTextNodeValue, squashExportNodes, squashImportNodes, squashTextNodes, useApp, useFileManager, useIndent, useMeta, usePackageVersion, usePluginManager }; |
@@ -12,3 +12,2 @@ import { KubbFile } from '@kubb/core'; | ||
'kubb-file': { | ||
id?: string; | ||
children?: ReactNode; | ||
@@ -19,3 +18,2 @@ key?: Key; | ||
env?: NodeJS.ProcessEnv; | ||
override?: boolean; | ||
}; | ||
@@ -27,4 +25,2 @@ 'kubb-source': { | ||
print?: boolean; | ||
removeComments?: boolean; | ||
noEmitHelpers?: boolean; | ||
}; | ||
@@ -31,0 +27,0 @@ 'kubb-import': KubbFile.Import & { |
@@ -1,3 +0,2 @@ | ||
import { Logger } from '@kubb/core/utils'; | ||
import { KubbFile } from '@kubb/core'; | ||
import { KubbFile, Logger } from '@kubb/core'; | ||
import { ReactNode, Key } from 'react'; | ||
@@ -18,3 +17,2 @@ | ||
'kubb-file': { | ||
id?: string; | ||
children?: ReactNode; | ||
@@ -25,3 +23,2 @@ key?: Key; | ||
env?: NodeJS.ProcessEnv; | ||
override?: boolean; | ||
}; | ||
@@ -33,4 +30,2 @@ 'kubb-source': { | ||
print?: boolean; | ||
removeComments?: boolean; | ||
noEmitHelpers?: boolean; | ||
}; | ||
@@ -80,9 +75,5 @@ 'kubb-import': KubbFile.Import & { | ||
/** | ||
* @deprecated | ||
* Use Files instead | ||
* File will include all sources combined | ||
* Custom for Kubb | ||
*/ | ||
file?: KubbFile.File; | ||
files: KubbFile.File[]; | ||
getFile: (id: string) => KubbFile.File | undefined; | ||
}; | ||
@@ -89,0 +80,0 @@ |
{ | ||
"name": "@kubb/react", | ||
"version": "1.15.0-canary.20231027T174927", | ||
"version": "1.15.0-canary.20231027T185556", | ||
"description": "Generator react", | ||
@@ -49,2 +49,3 @@ "keywords": [ | ||
"dist", | ||
"schemas", | ||
"*.d.ts", | ||
@@ -56,10 +57,7 @@ "*.d.cts", | ||
"dependencies": { | ||
"@kubb/core": "alpha", | ||
"@kubb/parser": "alpha" | ||
"@kubb/core": "1.15.0-canary.20231027T185539", | ||
"@kubb/parser": "1.15.0-canary.20231027T185523" | ||
}, | ||
"devDependencies": { | ||
"@kubb/eslint-config": "alpha", | ||
"@kubb/ts-config": "alpha", | ||
"@kubb/tsup-config": "alpha", | ||
"@types/react": "^18.2.33", | ||
"@types/react": "^18.2.31", | ||
"@types/react-reconciler": "^0.28.6", | ||
@@ -69,3 +67,7 @@ "eslint": "^8.52.0", | ||
"react-reconciler": "^0.29.0", | ||
"tsup": "^7.2.0" | ||
"tsup": "^7.2.0", | ||
"@kubb/eslint-config": "1.1.8", | ||
"@kubb/parser": "1.15.0-canary.20231027T185523", | ||
"@kubb/ts-config": "0.1.0", | ||
"@kubb/tsup-config": "1.1.8" | ||
}, | ||
@@ -87,4 +89,4 @@ "packageManager": "pnpm@8.3.0", | ||
"release": "pnpm publish --no-git-check", | ||
"release:canary": "bash ../../.github/canary.sh && node ../../scripts/build.js canary && pnpm publish --no-git-check -tag canary", | ||
"release:alpha": "bash ../../.github/canary.sh && node ../../scripts/build.js alpha && pnpm publish --no-git-check -tag alpha", | ||
"release:canary": "bash ../../.github/canary.sh && pnpm publish --no-git-check -tag canary", | ||
"release:alpha": "bash ../../.github/canary.sh && pnpm publish --no-git-check -tag alpha", | ||
"start": "tsup --watch", | ||
@@ -91,0 +93,0 @@ "test": "vitest --passWithNoTests", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
61
16086770
10
27
156092
+ Added@kubb/core@1.15.0-canary.20231027T185539(transitive)
+ Added@kubb/parser@1.15.0-canary.20231027T185523(transitive)
+ Addedansi-styles@3.2.1(transitive)
+ Addedarray-back@3.1.04.0.2(transitive)
+ Addedcamel-case@4.1.2(transitive)
+ Addedcapital-case@1.0.4(transitive)
+ Addedchalk@2.4.2(transitive)
+ Addedchange-case@4.1.2(transitive)
+ Addedcolor-convert@1.9.3(transitive)
+ Addedcolor-name@1.1.3(transitive)
+ Addedcommand-line-args@5.2.1(transitive)
+ Addedcommand-line-usage@6.1.3(transitive)
+ Addedconstant-case@3.0.4(transitive)
+ Addeddeep-extend@0.6.0(transitive)
+ Addeddirectory-tree@3.5.2(transitive)
+ Addeddot-case@3.0.4(transitive)
+ Addedescape-string-regexp@1.0.5(transitive)
+ Addedfind-replace@3.0.0(transitive)
+ Addedfind-up@6.3.0(transitive)
+ Addedhas-flag@3.0.0(transitive)
+ Addedheader-case@2.0.4(transitive)
+ Addedjs-runtime@0.0.6(transitive)
+ Addedlodash.camelcase@4.3.0(transitive)
+ Addedlodash.isequal@4.5.0(transitive)
+ Addedlower-case@2.0.2(transitive)
+ Addedno-case@3.0.4(transitive)
+ Addedparam-case@3.0.4(transitive)
+ Addedpascal-case@3.1.2(transitive)
+ Addedpath-case@3.0.4(transitive)
+ Addedpicocolors@1.1.1(transitive)
+ Addedreduce-flatten@2.0.0(transitive)
+ Addedsentence-case@3.0.4(transitive)
+ Addedsnake-case@3.0.4(transitive)
+ Addedsupports-color@5.5.0(transitive)
+ Addedtable-layout@1.0.2(transitive)
+ Addedtslib@2.8.1(transitive)
+ Addedtypical@4.0.05.2.0(transitive)
+ Addedupper-case@2.0.2(transitive)
+ Addedupper-case-first@2.0.2(transitive)
+ Addedwordwrapjs@4.0.1(transitive)
- Removed@kubb/core@3.0.0-alpha.31(transitive)
- Removed@kubb/fs@3.0.0-alpha.31(transitive)
- Removed@kubb/parser@2.0.0-alpha.12(transitive)
- Removed@kubb/parser-ts@3.0.0-alpha.31(transitive)
- Removed@kubb/types@3.0.0-alpha.31(transitive)
- Removedchange-case@5.4.4(transitive)
- Removedeventemitter3@5.0.1(transitive)
- Removedfind-up@7.0.0(transitive)
- Removedjs-runtime@0.0.8(transitive)
- Removedobject-hash@3.0.0(transitive)
- Removedp-queue@8.1.0(transitive)
- Removedp-timeout@6.1.4(transitive)
- Removedremeda@2.21.0(transitive)
- Removedtype-fest@4.36.0(transitive)
- Removedunicorn-magic@0.1.0(transitive)