builder.io 1.5.9 → 1.5.11

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.
@@ -32,4 +32,5 @@ export declare const runCodeCommand: (sys: DevToolsSys, subCommand: string, args
32
32
  export declare const runCodeGen: (sys: DevToolsSys, args: CLIArgs) => Promise<undefined>;
33
33
  export declare function createApp(userId: string, spaceId: string, privateKey: string, body: any): Promise<void>;
34
34
  export declare function transformStream(body: ReadableStream<Uint8Array> | null): AsyncGenerator<string, void, unknown>;
35
+ export declare function checkProjectRoot(sys: DevToolsSys): Promise<void>;
35
36
  export {};
@@ -1,6 +1,6 @@
1
1
  import type { CLIArgs } from "./index";
2
2
  import type { DevToolsSys } from "../types";
3
- import { type FigmaBuilderLink } from "./figma-publish";
3
+ import { type FigmaBuilderLink } from "./figma-utils";
4
4
  interface KVGetRequest {
5
5
  privateKey: string;
6
6
  spaceId: string;
@@ -1,19 +1,6 @@
1
- import type { DevTools, DevToolsSys, ExportType, RepoInfo } from "../types";
1
+ import type { DevTools, DevToolsSys, RepoInfo } from "../types";
2
2
  import type { CLIArgs } from "./index";
3
- import { type FigmaAuth } from "./credentials";
4
- export interface FigmaBuilderLink {
5
- builderName: string;
6
- figmaName: string;
7
- figmaKey: string;
8
- figmaUrl?: string;
9
- inputMapper?: string;
10
- originalInputMapper?: string;
11
- exportType?: ExportType;
12
- importName?: string;
13
- importPath?: string;
14
- source: string;
15
- loc?: string;
16
- }
3
+ import { type FigmaBuilderLink } from "./figma-utils";
17
4
  export declare const runFigmaPublish: (sys: DevToolsSys, args: CLIArgs) => Promise<undefined>;
18
5
  export declare const FIGMA_CONNECT_CALL = "figmaMapping";
19
6
  export declare function findAllMappingFiles(sys: DevToolsSys): Promise<string[]>;
@@ -28,8 +15,7 @@ export interface PublishedMapping {
28
15
  privateKey: string;
29
16
  userId: string;
30
17
  }
31
- export declare function findMappingsFromFiles({ figmaAuth, force, mappingFiles, print, sys, }: {
32
- figmaAuth?: FigmaAuth;
18
+ export declare function findMappingsFromFiles({ force, mappingFiles, print, sys, }: {
33
19
  force?: boolean;
34
20
  mappingFiles: string[];
35
21
  print: boolean;
@@ -37,4 +23,5 @@ export declare function findMappingsFromFiles({ figmaAuth, force, mappingFiles,
37
23
  }): Promise<{
38
24
  figmaBuilderLinks: FigmaBuilderLink[];
39
25
  foundErrors: boolean;
26
+ figmaLinksToResolve: string[];
40
27
  }>;
@@ -0,0 +1,56 @@
1
+ import type { Credentials, FigmaAuth } from "./credentials";
2
+ import type { ExportType } from "../types";
3
+ export interface FigmaComponentInput {
4
+ id: string;
5
+ name: string;
6
+ value?: any;
7
+ type: string;
8
+ baseType: "text" | "variant" | "boolean" | "slot";
9
+ variantOptions?: string[];
10
+ isDefault: boolean;
11
+ ref?: string;
12
+ }
13
+ export interface FigmaBuilderLink {
14
+ builderName: string;
15
+ figmaName: string;
16
+ figmaKey: string;
17
+ figmaUrl?: string;
18
+ inputMapper?: string;
19
+ originalInputMapper?: string;
20
+ exportType?: ExportType;
21
+ importName?: string;
22
+ importPath?: string;
23
+ source: string;
24
+ loc?: string;
25
+ }
26
+ export interface FigmaComponentInfo {
27
+ documentName: string;
28
+ key: string;
29
+ tree: string;
30
+ jsx: string;
31
+ name: string;
32
+ inputs: FigmaComponentInput[];
33
+ description: string;
34
+ documentationLinks: string[];
35
+ instanceId: string;
36
+ }
37
+ export declare const REMOVE_EMOJI: RegExp;
38
+ export declare const parseFigmaURL: (str: string) => {
39
+ fileID: string;
40
+ nodeId: string;
41
+ } | null;
42
+ export declare const getFigmaNodeData: (auth: {
43
+ access_token: string;
44
+ oauth: boolean;
45
+ }, fileId: string, nodeIds: string, depth?: number) => Promise<any>;
46
+ export declare function getFigmaComponentName(name: string): string;
47
+ export declare function getImportDataFromToken(credentials: Credentials, token: string, verbose: boolean): Promise<(readonly [string, FigmaComponentInfo])[]>;
48
+ export declare function needsFigmaAuth(urls: string[]): boolean;
49
+ export declare function getFigmaNodeDataFromURLs(figmaAuth: {
50
+ access_token: string;
51
+ oauth: boolean;
52
+ } | undefined, builderAuth: {
53
+ privateKey: string;
54
+ spaceId: string;
55
+ }, urls: string[]): Promise<(readonly [string, FigmaComponentInfo])[]>;
56
+ export declare function inPlaceResolveFigmaURLs(figmaAuth: FigmaAuth, figmaBuilderLinks: FigmaBuilderLink[], figmaLinksToResolve: string[]): Promise<void>;
@@ -1,54 +1,14 @@
1
- /// <reference types="@figma/plugin-typings" />
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 FigmaComponentInput {
6
- id: string;
7
- name: string;
8
- value?: any;
9
- type: string;
10
- baseType: "text" | "variant" | "boolean" | "slot";
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;
@@ -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 */