builder.io 1.6.16 → 1.6.18
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 +1120 -437
- 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/figma/index.mjs +1 -1
- package/node/index.cjs +1 -1
- package/node/index.mjs +1 -1
- package/package.json +11 -2
- package/server/index.cjs +135 -115
- package/server/index.mjs +133 -113
- package/types/_tests_/launch.e2e.d.ts +1 -0
- package/types/_tests_/utils.d.ts +2 -1
- package/types/cli/code.d.ts +15 -4
- package/types/cli/download.d.ts +1 -1
- package/types/cli/figma-publish.d.ts +3 -11
- package/types/cli/figma-utils.d.ts +2 -15
- package/types/cli/generate.d.ts +1 -1
- package/types/cli/index.d.ts +22 -0
- package/types/cli/launch.d.ts +4 -0
- package/types/core/adapters/react/react-api-key.d.ts +1 -1
- package/types/figma/index.d.ts +2 -0
- package/types/tsconfig.tsbuildinfo +1 -1
|
@@ -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,10 +1,20 @@
|
|
|
1
1
|
import type { DevToolsSys } from "../types";
|
|
2
2
|
import type { CLIArgs } from "./index";
|
|
3
|
+
import { type Credentials } from "./credentials";
|
|
4
|
+
import { type Checkpoint } from "./incremental-tsc";
|
|
3
5
|
import type { UserContext } from "$/ai-utils";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
interface UndoState {
|
|
7
|
+
files: {
|
|
8
|
+
path: string;
|
|
9
|
+
content: string | null;
|
|
10
|
+
}[];
|
|
11
|
+
isAgent: boolean;
|
|
12
|
+
url: string | undefined;
|
|
13
|
+
}
|
|
14
|
+
interface SessionContext {
|
|
15
|
+
sessionId: string;
|
|
16
|
+
undoStates: UndoState[];
|
|
17
|
+
selectedFilePaths: Map<string, number>;
|
|
8
18
|
}
|
|
9
19
|
type CodegenUsage = {
|
|
10
20
|
total: number;
|
|
@@ -31,6 +41,7 @@ export interface ArtifactItem {
|
|
|
31
41
|
}
|
|
32
42
|
export declare const runCodeCommand: (sys: DevToolsSys, subCommand: string, args: CLIArgs) => Promise<void>;
|
|
33
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>;
|
|
34
45
|
export declare function createApp(userId: string, spaceId: string, privateKey: string, body: any): Promise<void>;
|
|
35
46
|
export declare function transformStream(body: ReadableStream<Uint8Array> | null): AsyncGenerator<string, void, unknown>;
|
|
36
47
|
export declare function checkProjectRoot(sys: DevToolsSys, interactive: boolean): Promise<undefined>;
|
package/types/cli/download.d.ts
CHANGED
|
@@ -1,25 +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 "$/ai-utils";
|
|
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
8
|
export declare function setPublicKey(sys: DevToolsSys, publicKey: string, devTools: DevTools | undefined, ensureFigmaImportPage?: boolean): Promise<boolean>;
|
|
10
|
-
export interface PublishedMapping {
|
|
11
|
-
repoInfo: RepoInfo | undefined;
|
|
12
|
-
figmaBuilderLinks: FigmaBuilderLink[];
|
|
13
|
-
spaceId: string;
|
|
14
|
-
privateKey: string;
|
|
15
|
-
userId: string;
|
|
16
|
-
userContext: UserContext;
|
|
17
|
-
}
|
|
18
9
|
export declare function findMappingsFromFiles({ sys, mappingFiles, typeCheck, }: {
|
|
19
10
|
mappingFiles: string[];
|
|
20
11
|
sys: DevToolsSys;
|
|
21
12
|
typeCheck?: boolean;
|
|
22
13
|
}): Promise<{
|
|
14
|
+
mapperFiles: FigmaMapperFile[];
|
|
23
15
|
figmaBuilderLinks: FigmaBuilderLink[];
|
|
24
16
|
diagnostics: ts.Diagnostic[];
|
|
25
17
|
figmaLinksToResolve: string[];
|
|
@@ -1,20 +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
|
-
import type { FigmaComponentInfo } from "$/ai-utils";
|
|
5
|
-
export interface FigmaBuilderLink {
|
|
6
|
-
builderName: string;
|
|
7
|
-
figmaName: string;
|
|
8
|
-
figmaKey: string;
|
|
9
|
-
figmaUrl?: string;
|
|
10
|
-
inputMapper?: string;
|
|
11
|
-
originalInputMapper?: string;
|
|
12
|
-
exportType?: ExportType;
|
|
13
|
-
importName?: string;
|
|
14
|
-
importPath?: string;
|
|
15
|
-
source: string;
|
|
16
|
-
loc?: string;
|
|
17
|
-
}
|
|
4
|
+
import type { FigmaBuilderLink, FigmaComponentInfo } from "$/ai-utils";
|
|
18
5
|
export declare const REMOVE_EMOJI: RegExp;
|
|
19
6
|
export declare const parseFigmaURL: (str: string) => {
|
|
20
7
|
fileID: string;
|
package/types/cli/generate.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ComponentInfo, ComponentRegistry, DevToolsSys } from "../types";
|
|
2
2
|
import type { CLIArgs } from "./index";
|
|
3
|
-
import type
|
|
3
|
+
import { type FigmaComponentInfo, type UserContext } from "$/ai-utils";
|
|
4
4
|
export declare const runFigmaGenerate: (sys: DevToolsSys, args: CLIArgs) => Promise<undefined>;
|
|
5
5
|
export interface MappingCodeV3 {
|
|
6
6
|
figmaNode?: FigmaComponentInfo;
|
package/types/cli/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export interface CLIArgs {
|
|
2
2
|
/** Figma access token */
|
|
3
3
|
figmaToken?: string;
|
|
4
|
+
/** GitHub access token */
|
|
5
|
+
githubToken?: string;
|
|
4
6
|
/** Run in CI mode without interactive prompts */
|
|
5
7
|
ci?: boolean;
|
|
6
8
|
/** Show help text */
|
|
@@ -33,6 +35,26 @@ export interface CLIArgs {
|
|
|
33
35
|
cwd?: string;
|
|
34
36
|
/** Debug mode */
|
|
35
37
|
debug?: boolean;
|
|
38
|
+
/** Port number for the dev server */
|
|
39
|
+
port?: number;
|
|
40
|
+
/** Port number for the dev server (shorthand) */
|
|
41
|
+
p?: number;
|
|
42
|
+
/** Command to execute */
|
|
43
|
+
command?: string;
|
|
44
|
+
/** Command to execute (shorthand) */
|
|
45
|
+
c?: string;
|
|
46
|
+
/** Skip authentication for testing purposes */
|
|
47
|
+
noAuth?: boolean;
|
|
48
|
+
/** Skip authentication for testing purposes (flag form) */
|
|
49
|
+
auth?: boolean;
|
|
50
|
+
/** Use development server instead of production for launch command */
|
|
51
|
+
dev?: boolean;
|
|
52
|
+
/** Skip browser auto-open */
|
|
53
|
+
noOpen?: boolean;
|
|
54
|
+
/** Skip browser auto-open (flag form) */
|
|
55
|
+
open?: boolean;
|
|
36
56
|
/** Raw command line arguments */
|
|
37
57
|
_: string[];
|
|
58
|
+
builderPublicKey?: string;
|
|
59
|
+
builderPrivateKey?: string;
|
|
38
60
|
}
|
|
@@ -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
|
@@ -49,11 +49,13 @@ export type FigmaURL = `https://www.figma.com/design/${string}/${string}${"?" |
|
|
|
49
49
|
export interface FigmaMappingWithKeyMapper<T extends BaseFigmaProps> {
|
|
50
50
|
url?: FigmaURL;
|
|
51
51
|
componentKey: string;
|
|
52
|
+
componentName?: string;
|
|
52
53
|
mapper?: (figma: T) => any;
|
|
53
54
|
}
|
|
54
55
|
export interface FigmaMappingWithUrlMapper<T extends BaseFigmaProps> {
|
|
55
56
|
url: FigmaURL;
|
|
56
57
|
componentKey?: string;
|
|
58
|
+
componentName?: string;
|
|
57
59
|
mapper?: (figma: T) => any;
|
|
58
60
|
}
|
|
59
61
|
export interface FigmaGenericMapper {
|