Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@kubb/react

Package Overview
Dependencies
Maintainers
1
Versions
402
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kubb/react - npm Package Compare versions

Comparing version 1.15.0-canary.20231027T200932 to 2.0.0-alpha.1

dist/components.cjs

13

dist/client/index.d.ts

@@ -1,2 +0,3 @@

import { KubbFile, Logger } from '@kubb/core';
import { Logger } from '@kubb/core/utils';
import { KubbFile } from '@kubb/core';
import { ReactNode, Key } from 'react';

@@ -17,2 +18,3 @@

'kubb-file': {
id?: string;
children?: ReactNode;

@@ -23,2 +25,3 @@ key?: Key;

env?: NodeJS.ProcessEnv;
override?: boolean;
};

@@ -30,2 +33,4 @@ 'kubb-source': {

print?: boolean;
removeComments?: boolean;
noEmitHelpers?: boolean;
};

@@ -76,5 +81,9 @@ 'kubb-import': KubbFile.Import & {

/**
* Custom for Kubb
* @deprecated
* Use Files instead
* File will include all sources combined
*/
file?: KubbFile.File;
files: KubbFile.File[];
getFile: (id: string) => KubbFile.File | undefined;
};

@@ -81,0 +90,0 @@

133

dist/index.d.ts

@@ -1,9 +0,11 @@

import { KubbFile, Logger, FileManager, PluginManager } from '@kubb/core';
import { Logger } from '@kubb/core/utils';
import { KubbFile, FileManager, PluginManager } from '@kubb/core';
import * as react from 'react';
import { ReactNode, Key } from 'react';
declare function createIndent$1(size: number): string;
type AppContextProps<Meta extends Record<string, unknown> = Record<string, unknown>> = {
meta: Meta;
};
declare const AppContext: react.Context<AppContextProps<Record<string, unknown>>>;

@@ -19,2 +21,3 @@ type ReactElementNames = 'br';

'kubb-file': {
id?: string;
children?: ReactNode;

@@ -25,2 +28,3 @@ key?: Key;

env?: NodeJS.ProcessEnv;
override?: boolean;
};

@@ -32,2 +36,4 @@ 'kubb-source': {

print?: boolean;
removeComments?: boolean;
noEmitHelpers?: boolean;
};

@@ -72,2 +78,3 @@ 'kubb-import': KubbFile.Import & {

type NodeNames = ElementNames | TextName;
type KubbNode = ReactNode;

@@ -79,30 +86,30 @@ type RootType<T = unknown> = {

/**
* Custom for Kubb
* @deprecated
* Use Files instead
* File will include all sources combined
*/
file?: KubbFile.File;
files: KubbFile.File[];
getFile: (id: string) => KubbFile.File | undefined;
};
type Props$8 = {
type Props$7 = {
container?: DOMElement;
logger?: Logger;
};
declare function createRoot<Context extends AppContextProps = AppContextProps>({ container, logger }?: Props$8): RootType<Context>;
declare function createRoot<Context extends AppContextProps = AppContextProps>({ container, logger }?: Props$7): 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): ReactNode;
declare function Export({ name, path, isTypeOnly, asAlias, print: printExport }: Props$6): KubbNode;
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, path, isTypeOnly, print: printImport }: Props$5): ReactNode;
declare function Import({ name, root, path, isTypeOnly, print: printImport }: Props$5): KubbNode;

@@ -119,6 +126,8 @@ type BasePropsWithBaseName = {

type Props$4 = BaseProps & {
id?: string;
env?: NodeJS.ProcessEnv;
children?: ReactNode;
children?: KubbNode;
override?: boolean;
};
declare function File({ baseName, path, env, children }: Props$4): ReactNode;
declare function File(props: Props$4): KubbNode;
declare namespace File {

@@ -129,8 +138,26 @@ var Export: typeof Export;

}
type FileSourceProps = {
print?: boolean;
type FileSourceUnionProps = {
/**
* When path is set it will copy-paste that file as a string inside the component
* Children will then be ignored
*/
path?: string;
children?: ReactNode;
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;
};
declare function FileSource({ path, print, children }: FileSourceProps): ReactNode;
type FileSourceProps = FileSourceUnionProps & {
print?: boolean;
/**
* Removes comments
*/
removeComments?: boolean;
noEmitHelpers?: boolean;
};
declare function FileSource({ path, print, removeComments, children }: FileSourceProps): KubbNode;

@@ -144,3 +171,3 @@ type Props$3 = {

returnType?: string;
children?: ReactNode;
children?: KubbNode;
JSDoc?: {

@@ -150,3 +177,3 @@ comments: string[];

};
declare function Function({ name, export: canExport, async, generics, params, returnType, JSDoc, children }: Props$3): ReactNode;
declare function Function({ name, export: canExport, async, generics, params, returnType, JSDoc, children }: Props$3): KubbNode;
declare namespace Function {

@@ -158,12 +185,11 @@ var Arrow: typeof ArrowFunction;

};
declare function ArrowFunction({ name, export: canExport, async, generics, params, returnType, JSDoc, singleLine, children }: ArrowFunctionProps): ReactNode;
declare const Fun: typeof Function;
declare function ArrowFunction({ name, export: canExport, async, generics, params, returnType, JSDoc, singleLine, children }: ArrowFunctionProps): KubbNode;
type Props$2 = {
children?: ReactNode;
children?: KubbNode;
indentSize?: number;
};
declare function Text({ indentSize, children }: Props$2): ReactNode;
declare function Text({ indentSize, children }: Props$2): KubbNode;
declare namespace Text {
var Space: ({ indentSize }: Omit<Props$2, "children">) => ReactNode;
var Space: ({ indentSize }: Omit<Props$2, "children">) => react.ReactNode;
}

@@ -179,3 +205,2 @@

};
declare function createIndent(size: number): string;
declare function useIndent({ size, children }: Props$1): React.ReactNode;

@@ -193,47 +218,7 @@

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[];
/**
* @deprecated use `@kubb/core/utils' import instead
*/
declare const createIndent: typeof createIndent$1;
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 };
export { AppContextProps, DOMElement, DOMNode, DOMNodeAttribute, ElementNames, Export, File, Function, Import, KubbNode, Node, NodeNames, RootType, Text, TextNode, createIndent, createRoot, useApp, useFileManager, useIndent, useMeta, usePackageVersion, usePluginManager };

@@ -12,2 +12,3 @@ import { KubbFile } from '@kubb/core';

'kubb-file': {
id?: string;
children?: ReactNode;

@@ -18,2 +19,3 @@ key?: Key;

env?: NodeJS.ProcessEnv;
override?: boolean;
};

@@ -25,2 +27,4 @@ 'kubb-source': {

print?: boolean;
removeComments?: boolean;
noEmitHelpers?: boolean;
};

@@ -27,0 +31,0 @@ 'kubb-import': KubbFile.Import & {

@@ -1,2 +0,3 @@

import { KubbFile, Logger } from '@kubb/core';
import { Logger } from '@kubb/core/utils';
import { KubbFile } from '@kubb/core';
import { ReactNode, Key } from 'react';

@@ -17,2 +18,3 @@

'kubb-file': {
id?: string;
children?: ReactNode;

@@ -23,2 +25,3 @@ key?: Key;

env?: NodeJS.ProcessEnv;
override?: boolean;
};

@@ -30,2 +33,4 @@ 'kubb-source': {

print?: boolean;
removeComments?: boolean;
noEmitHelpers?: boolean;
};

@@ -75,5 +80,9 @@ 'kubb-import': KubbFile.Import & {

/**
* Custom for Kubb
* @deprecated
* Use Files instead
* File will include all sources combined
*/
file?: KubbFile.File;
files: KubbFile.File[];
getFile: (id: string) => KubbFile.File | undefined;
};

@@ -80,0 +89,0 @@

{
"name": "@kubb/react",
"version": "1.15.0-canary.20231027T200932",
"version": "2.0.0-alpha.1",
"description": "Generator react",

@@ -49,3 +49,2 @@ "keywords": [

"dist",
"schemas",
"*.d.ts",

@@ -57,4 +56,4 @@ "*.d.cts",

"dependencies": {
"@kubb/core": "1.15.0-canary.20231027T200912",
"@kubb/parser": "1.15.0-canary.20231027T200853"
"@kubb/core": "2.0.0-alpha.1",
"@kubb/parser": "2.0.0-alpha.1"
},

@@ -69,3 +68,2 @@ "devDependencies": {

"@kubb/eslint-config": "1.1.8",
"@kubb/parser": "1.15.0-canary.20231027T200853",
"@kubb/ts-config": "0.1.0",

@@ -89,4 +87,4 @@ "@kubb/tsup-config": "1.1.8"

"release": "pnpm publish --no-git-check",
"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",
"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",
"start": "tsup --watch",

@@ -93,0 +91,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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc