builder.io 1.5.8 → 1.5.10
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/cli/index.cjs +247 -278
- package/cli/index.cjs.map +4 -4
- package/core/index.cjs +9 -9
- package/core/index.mjs +9 -9
- package/node/index.cjs +1 -1
- package/node/index.mjs +1 -1
- package/package.json +1 -1
- package/server/index.cjs +119 -119
- package/server/index.mjs +106 -106
- package/types/cli/code.d.ts +1 -1
- package/types/cli/figma-utils.d.ts +41 -0
- package/types/cli/generate.d.ts +10 -50
- package/types/cli/index.d.ts +2 -0
package/types/cli/code.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ type CodegenUsage = {
|
|
|
15
15
|
};
|
|
16
16
|
};
|
|
17
17
|
export interface ArtifactItem {
|
|
18
|
-
type: "shell" | "file" | "text" | "delta" | "done" | "diff" | "thinking" | "continue";
|
|
18
|
+
type: "shell" | "file" | "text" | "delta" | "done" | "diff" | "thinking" | "user" | "continue";
|
|
19
19
|
id?: string;
|
|
20
20
|
content: string;
|
|
21
21
|
filePath?: string;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { Credentials } from "./credentials";
|
|
2
|
+
export interface FigmaComponentInput {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
value?: any;
|
|
6
|
+
type: string;
|
|
7
|
+
baseType: "text" | "variant" | "boolean" | "slot";
|
|
8
|
+
variantOptions?: string[];
|
|
9
|
+
isDefault: boolean;
|
|
10
|
+
ref?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface FigmaComponentInfo {
|
|
13
|
+
documentName: string;
|
|
14
|
+
key: string;
|
|
15
|
+
tree: string;
|
|
16
|
+
jsx: string;
|
|
17
|
+
name: string;
|
|
18
|
+
inputs: FigmaComponentInput[];
|
|
19
|
+
description: string;
|
|
20
|
+
documentationLinks: string[];
|
|
21
|
+
instanceId: string;
|
|
22
|
+
}
|
|
23
|
+
export declare const REMOVE_EMOJI: RegExp;
|
|
24
|
+
export declare const parseFigmaURL: (str: string) => {
|
|
25
|
+
fileID: string;
|
|
26
|
+
nodeId: string;
|
|
27
|
+
} | null;
|
|
28
|
+
export declare const getFigmaNodeData: (auth: {
|
|
29
|
+
access_token: string;
|
|
30
|
+
oauth: boolean;
|
|
31
|
+
}, fileId: string, nodeIds: string, depth?: number) => Promise<any>;
|
|
32
|
+
export declare function getFigmaComponentName(name: string): string;
|
|
33
|
+
export declare function getImportDataFromToken(credentials: Credentials, token: string, verbose: boolean): Promise<(readonly [string, FigmaComponentInfo])[]>;
|
|
34
|
+
export declare function needsFigmaAuth(urls: string[]): boolean;
|
|
35
|
+
export declare function getFigmaNodeDataFromURLs(figmaAuth: {
|
|
36
|
+
access_token: string;
|
|
37
|
+
oauth: boolean;
|
|
38
|
+
} | undefined, builderAuth: {
|
|
39
|
+
privateKey: string;
|
|
40
|
+
spaceId: string;
|
|
41
|
+
}, urls: string[]): Promise<(readonly [string, FigmaComponentInfo])[]>;
|
package/types/cli/generate.d.ts
CHANGED
|
@@ -1,54 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
import type { ComponentInfo, ComponentInput, ComponentRegistry, DevToolsSys } from "../types";
|
|
1
|
+
import type { ComponentInfo, DevToolsSys } from "../types";
|
|
3
2
|
import type { CLIArgs } from "./index";
|
|
3
|
+
import { type FigmaComponentInfo } from "./figma-utils";
|
|
4
4
|
export declare const runFigmaGenerate: (sys: DevToolsSys, args: CLIArgs) => Promise<undefined>;
|
|
5
|
-
export interface
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
variantOptions?: string[];
|
|
12
|
-
isDefault: boolean;
|
|
13
|
-
ref?: string;
|
|
14
|
-
}
|
|
15
|
-
export interface FigmaComponentInfo {
|
|
16
|
-
documentName: string;
|
|
17
|
-
key: string;
|
|
18
|
-
tree: string;
|
|
19
|
-
jsx: string;
|
|
20
|
-
name: string;
|
|
21
|
-
inputs: FigmaComponentInput[];
|
|
22
|
-
description: string;
|
|
23
|
-
documentationLinks: string[];
|
|
24
|
-
instanceId: string;
|
|
25
|
-
}
|
|
26
|
-
export declare const parseFigmaURL: (str: string) => {
|
|
27
|
-
fileID: string;
|
|
28
|
-
nodeId: string;
|
|
29
|
-
} | null;
|
|
30
|
-
export declare const getFigmaNodeData: (auth: {
|
|
31
|
-
access_token: string;
|
|
32
|
-
oauth: boolean;
|
|
33
|
-
}, fileId: string, nodeIds: string, depth?: number) => Promise<any>;
|
|
34
|
-
export declare function getInputsSlotsFromComponentPropertyDefinitions(mainComponent: ComponentSetNode | ComponentNode): {
|
|
35
|
-
inputs: FigmaComponentInput[];
|
|
36
|
-
nameMap: (key: string) => string;
|
|
37
|
-
};
|
|
38
|
-
export declare const REMOVE_EMOJI: RegExp;
|
|
39
|
-
export declare function getFigmaComponentName(name: string): string;
|
|
40
|
-
export interface MappingCodeV2 {
|
|
41
|
-
figmaInterface: string;
|
|
42
|
-
reactInterface: string;
|
|
43
|
-
componentRegistry: string;
|
|
44
|
-
figmaComponentName: string;
|
|
45
|
-
figmaTree: string;
|
|
46
|
-
meta?: Record<string, any>;
|
|
47
|
-
previousCode?: string;
|
|
5
|
+
export interface MappingCodeV3 {
|
|
6
|
+
componentNames: string[];
|
|
7
|
+
figmaNode: FigmaComponentInfo;
|
|
8
|
+
figmaUrl: string;
|
|
9
|
+
registeredCmp: ComponentInfo;
|
|
10
|
+
previousCompletion?: string;
|
|
48
11
|
prompt?: string;
|
|
12
|
+
meta?: Record<string, any>;
|
|
13
|
+
token?: string;
|
|
49
14
|
}
|
|
50
|
-
export declare function generateReactInterface(registeredCmp: ComponentInfo, cmpRegistry: ComponentRegistry, addChildrenOptions: boolean): string;
|
|
51
|
-
export declare function getMappingData(figmaNode: FigmaComponentInfo, registeredCmp: ComponentInfo, cmpRegistry: ComponentRegistry, useJSX: boolean, addChildrenOptions: boolean): MappingCodeV2;
|
|
52
|
-
export declare const getTypeFromComponentInput: (input: ComponentInput) => string;
|
|
53
|
-
export declare const getPropertyAccessor: (name: string) => string;
|
|
54
|
-
export declare function getMappingPrompt(figmaNode: FigmaComponentInfo, registeredCmp: ComponentInfo, cmpRegistry: ComponentRegistry, useJSX?: boolean): string;
|
package/types/cli/index.d.ts
CHANGED
|
@@ -23,6 +23,8 @@ export interface CLIArgs {
|
|
|
23
23
|
mappingOutput?: string;
|
|
24
24
|
/** Skip package installation step */
|
|
25
25
|
skipInstallation?: boolean;
|
|
26
|
+
/** Token to use for figma */
|
|
27
|
+
token?: string;
|
|
26
28
|
/** Url to start from */
|
|
27
29
|
url?: string;
|
|
28
30
|
/** Prompt text for non-interactive mode */
|