builder.io 1.6.15 → 1.6.17
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 +1128 -452
- package/cli/index.cjs.map +4 -4
- package/core/index.cjs +4 -4
- package/core/index.mjs +4 -4
- package/figma/index.cjs +1 -1
- package/node/index.cjs +1 -1
- package/node/index.mjs +1 -1
- package/package.json +15 -7
- package/server/index.cjs +112 -103
- package/server/index.mjs +122 -113
- package/types/_tests_/dev-tools.e2e.d.ts +1 -0
- package/types/_tests_/launch.e2e.d.ts +1 -0
- package/types/_tests_/utils.d.ts +2 -1
- package/types/cli/code.d.ts +15 -15
- package/types/cli/download.d.ts +1 -1
- package/types/cli/figma-publish.d.ts +3 -14
- package/types/cli/figma-utils.d.ts +2 -35
- package/types/cli/generate.d.ts +5 -6
- package/types/cli/index.d.ts +14 -0
- package/types/cli/launch.d.ts +5 -0
- package/types/core/adapters/react/react-api-key.d.ts +1 -1
- package/types/figma/index.d.ts +3 -10
- package/types/tsconfig.tsbuildinfo +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/types/_tests_/utils.d.ts
CHANGED
|
@@ -24,8 +24,9 @@ interface CLI {
|
|
|
24
24
|
modified: string[];
|
|
25
25
|
}>;
|
|
26
26
|
npm(...args: string[]): Promise<number>;
|
|
27
|
+
spawn(command: string, args: string[]): Promise<number>;
|
|
27
28
|
}
|
|
28
|
-
export declare function testCLI(name: string, template: string | undefined, handler: (cli: Handler, expect: ExpectStatic) => Promise<void>, timeout?: number): void;
|
|
29
|
+
export declare function testCLI(name: string, template: string | undefined, handler: (cli: Handler, expect: ExpectStatic) => Promise<void>, timeout?: number, skip?: boolean): void;
|
|
29
30
|
type Handler = (cmd: "builderio" | "create-builderio", args: string[], options?: {
|
|
30
31
|
debug?: boolean;
|
|
31
32
|
}) => CLI;
|
package/types/cli/code.d.ts
CHANGED
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
import type { DevToolsSys } from "../types";
|
|
2
2
|
import type { CLIArgs } from "./index";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
[key: string]: string[] | string | boolean | undefined;
|
|
3
|
+
import { type Credentials } from "./credentials";
|
|
4
|
+
import { type Checkpoint } from "./incremental-tsc";
|
|
5
|
+
import type { UserContext } from "$/ai-utils";
|
|
6
|
+
interface UndoState {
|
|
7
|
+
files: {
|
|
8
|
+
path: string;
|
|
9
|
+
content: string | null;
|
|
10
|
+
}[];
|
|
11
|
+
isAgent: boolean;
|
|
12
|
+
url: string | undefined;
|
|
14
13
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
interface SessionContext {
|
|
15
|
+
sessionId: string;
|
|
16
|
+
undoStates: UndoState[];
|
|
17
|
+
selectedFilePaths: Map<string, number>;
|
|
19
18
|
}
|
|
20
19
|
type CodegenUsage = {
|
|
21
20
|
total: number;
|
|
@@ -42,6 +41,7 @@ export interface ArtifactItem {
|
|
|
42
41
|
}
|
|
43
42
|
export declare const runCodeCommand: (sys: DevToolsSys, subCommand: string, args: CLIArgs) => Promise<void>;
|
|
44
43
|
export declare const runCodeGen: (sys: DevToolsSys, args: CLIArgs) => Promise<undefined>;
|
|
44
|
+
export declare function agentCompletion(sys: DevToolsSys, credentials: Credentials, args: CLIArgs, userContext: UserContext, sessionContext: SessionContext, userPrompt: string, initialUrl: string | undefined, relevantFile: string | null | undefined, wasBad: boolean, baselineCheckpoint: Checkpoint): Promise<Checkpoint>;
|
|
45
45
|
export declare function createApp(userId: string, spaceId: string, privateKey: string, body: any): Promise<void>;
|
|
46
46
|
export declare function transformStream(body: ReadableStream<Uint8Array> | null): AsyncGenerator<string, void, unknown>;
|
|
47
47
|
export declare function checkProjectRoot(sys: DevToolsSys, interactive: boolean): Promise<undefined>;
|
package/types/cli/download.d.ts
CHANGED
|
@@ -1,28 +1,17 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
|
-
import type { DevTools, DevToolsSys
|
|
2
|
+
import type { DevTools, DevToolsSys } from "../types";
|
|
3
3
|
import type { CLIArgs } from "./index";
|
|
4
|
-
import {
|
|
5
|
-
import { type UserContext } from "./code";
|
|
4
|
+
import type { FigmaBuilderLink, FigmaMapperFile } from "$/ai-utils";
|
|
6
5
|
export declare const runFigmaPublish: (sys: DevToolsSys, args: CLIArgs) => Promise<undefined>;
|
|
7
6
|
export declare const FIGMA_CONNECT_CALL = "figmaMapping";
|
|
8
7
|
export declare function findAllMappingFiles(sys: DevToolsSys): Promise<string[]>;
|
|
9
|
-
export interface FigmaBuilderData {
|
|
10
|
-
figmaBuilderLinks: FigmaBuilderLink[];
|
|
11
|
-
}
|
|
12
8
|
export declare function setPublicKey(sys: DevToolsSys, publicKey: string, devTools: DevTools | undefined, ensureFigmaImportPage?: boolean): Promise<boolean>;
|
|
13
|
-
export interface PublishedMapping {
|
|
14
|
-
repoInfo: RepoInfo | undefined;
|
|
15
|
-
figmaBuilderLinks: FigmaBuilderLink[];
|
|
16
|
-
spaceId: string;
|
|
17
|
-
privateKey: string;
|
|
18
|
-
userId: string;
|
|
19
|
-
userContext: UserContext;
|
|
20
|
-
}
|
|
21
9
|
export declare function findMappingsFromFiles({ sys, mappingFiles, typeCheck, }: {
|
|
22
10
|
mappingFiles: string[];
|
|
23
11
|
sys: DevToolsSys;
|
|
24
12
|
typeCheck?: boolean;
|
|
25
13
|
}): Promise<{
|
|
14
|
+
mapperFiles: FigmaMapperFile[];
|
|
26
15
|
figmaBuilderLinks: FigmaBuilderLink[];
|
|
27
16
|
diagnostics: ts.Diagnostic[];
|
|
28
17
|
figmaLinksToResolve: string[];
|
|
@@ -1,40 +1,7 @@
|
|
|
1
1
|
import { type Credentials, type FigmaAuth } from "./credentials";
|
|
2
|
-
import type { DevToolsSys
|
|
2
|
+
import type { DevToolsSys } from "../types";
|
|
3
3
|
import type { CLIArgs } from "./index";
|
|
4
|
-
|
|
5
|
-
id: string;
|
|
6
|
-
name: string;
|
|
7
|
-
value?: any;
|
|
8
|
-
type: string;
|
|
9
|
-
baseType: "text" | "variant" | "boolean" | "slot";
|
|
10
|
-
variantOptions?: string[];
|
|
11
|
-
isDefault: boolean;
|
|
12
|
-
ref?: string;
|
|
13
|
-
}
|
|
14
|
-
export interface FigmaBuilderLink {
|
|
15
|
-
builderName: string;
|
|
16
|
-
figmaName: string;
|
|
17
|
-
figmaKey: string;
|
|
18
|
-
figmaUrl?: string;
|
|
19
|
-
inputMapper?: string;
|
|
20
|
-
originalInputMapper?: string;
|
|
21
|
-
exportType?: ExportType;
|
|
22
|
-
importName?: string;
|
|
23
|
-
importPath?: string;
|
|
24
|
-
source: string;
|
|
25
|
-
loc?: string;
|
|
26
|
-
}
|
|
27
|
-
export interface FigmaComponentInfo {
|
|
28
|
-
documentName: string;
|
|
29
|
-
key: string;
|
|
30
|
-
tree: string;
|
|
31
|
-
jsx: string;
|
|
32
|
-
name: string;
|
|
33
|
-
inputs: FigmaComponentInput[];
|
|
34
|
-
description: string;
|
|
35
|
-
documentationLinks: string[];
|
|
36
|
-
instanceId: string;
|
|
37
|
-
}
|
|
4
|
+
import type { FigmaBuilderLink, FigmaComponentInfo } from "$/ai-utils";
|
|
38
5
|
export declare const REMOVE_EMOJI: RegExp;
|
|
39
6
|
export declare const parseFigmaURL: (str: string) => {
|
|
40
7
|
fileID: string;
|
package/types/cli/generate.d.ts
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import type { ComponentInfo, ComponentRegistry, DevToolsSys } from "../types";
|
|
2
2
|
import type { CLIArgs } from "./index";
|
|
3
|
-
import {
|
|
4
|
-
import { type FigmaComponentInfo } from "./figma-utils";
|
|
3
|
+
import type { FigmaComponentInfo, UserContext } from "$/ai-utils";
|
|
5
4
|
export declare const runFigmaGenerate: (sys: DevToolsSys, args: CLIArgs) => Promise<undefined>;
|
|
6
5
|
export interface MappingCodeV3 {
|
|
7
|
-
figmaNode
|
|
8
|
-
registry
|
|
6
|
+
figmaNode?: FigmaComponentInfo;
|
|
7
|
+
registry?: ComponentRegistry;
|
|
9
8
|
userContext?: UserContext;
|
|
10
|
-
figmaUrl
|
|
9
|
+
figmaUrl?: string;
|
|
11
10
|
docsUrl?: string;
|
|
12
|
-
registeredCmp
|
|
11
|
+
registeredCmp?: ComponentInfo;
|
|
13
12
|
previousCompletion?: string;
|
|
14
13
|
userPrompt?: string;
|
|
15
14
|
token?: string;
|
package/types/cli/index.d.ts
CHANGED
|
@@ -33,6 +33,20 @@ export interface CLIArgs {
|
|
|
33
33
|
cwd?: string;
|
|
34
34
|
/** Debug mode */
|
|
35
35
|
debug?: boolean;
|
|
36
|
+
/** Port number for the dev server */
|
|
37
|
+
port?: number;
|
|
38
|
+
/** Port number for the dev server (shorthand) */
|
|
39
|
+
p?: number;
|
|
40
|
+
/** Command to execute */
|
|
41
|
+
command?: string;
|
|
42
|
+
/** Command to execute (shorthand) */
|
|
43
|
+
c?: string;
|
|
44
|
+
/** Skip authentication for testing purposes */
|
|
45
|
+
noAuth?: boolean;
|
|
46
|
+
/** Skip authentication for testing purposes (flag form) */
|
|
47
|
+
auth?: boolean;
|
|
48
|
+
/** Use development server instead of production for launch command */
|
|
49
|
+
dev?: boolean;
|
|
36
50
|
/** Raw command line arguments */
|
|
37
51
|
_: string[];
|
|
38
52
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { DevToolsSys } from "@builder.io/dev-tools/core";
|
|
2
|
+
import type { CLIArgs } from "./index";
|
|
3
|
+
export declare const API_PORT = 48753;
|
|
4
|
+
export declare const PROXY_PORT = 48752;
|
|
5
|
+
export declare function runLaunchCommand(sys: DevToolsSys, subCommand: string, args: CLIArgs): Promise<number>;
|
|
@@ -3,4 +3,4 @@ import type { ReactDevToolsSys } from ".";
|
|
|
3
3
|
export declare function getReactApiKey(sys: ReactDevToolsSys): Promise<EnvInfo>;
|
|
4
4
|
export declare function setReactApiKey(sys: ReactDevToolsSys, publicApiKey: string): Promise<EnvInfo>;
|
|
5
5
|
export declare const REACT_VITE_BUILDER_KEY_ENV = "VITE_PUBLIC_BUILDER_KEY";
|
|
6
|
-
export declare const REACT_WEBPACK_BUILDER_KEY_ENV = "
|
|
6
|
+
export declare const REACT_WEBPACK_BUILDER_KEY_ENV = "PUBLIC_BUILDER_KEY";
|
package/types/figma/index.d.ts
CHANGED
|
@@ -1,14 +1,5 @@
|
|
|
1
|
+
import type { FigmaComponentInput } from "$/ai-utils";
|
|
1
2
|
export type FigmaNodeType = "COMPONENT" | "ELLIPSE" | "FRAME" | "GROUP" | "INSTANCE" | "LINE" | "POLYGON" | "RECTANGLE" | "STAR" | "TEXT" | "VECTOR";
|
|
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
3
|
export interface FigmaNode {
|
|
13
4
|
"@type": "passedNode";
|
|
14
5
|
$id: string;
|
|
@@ -58,11 +49,13 @@ export type FigmaURL = `https://www.figma.com/design/${string}/${string}${"?" |
|
|
|
58
49
|
export interface FigmaMappingWithKeyMapper<T extends BaseFigmaProps> {
|
|
59
50
|
url?: FigmaURL;
|
|
60
51
|
componentKey: string;
|
|
52
|
+
componentName?: string;
|
|
61
53
|
mapper?: (figma: T) => any;
|
|
62
54
|
}
|
|
63
55
|
export interface FigmaMappingWithUrlMapper<T extends BaseFigmaProps> {
|
|
64
56
|
url: FigmaURL;
|
|
65
57
|
componentKey?: string;
|
|
58
|
+
componentName?: string;
|
|
66
59
|
mapper?: (figma: T) => any;
|
|
67
60
|
}
|
|
68
61
|
export interface FigmaGenericMapper {
|