@builder.io/dev-tools 1.6.20-dev.202504032053.5a0a40ed → 1.6.22
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/angular/index.cjs +1 -46
- package/angular/index.mjs +1 -21
- package/cli/index.cjs +3297 -99950
- package/cli/index.cjs.map +4 -4
- package/core/index.cjs +847 -13484
- package/core/index.mjs +848 -13475
- package/figma/index.cjs +1 -39
- package/figma/index.mjs +1 -19
- package/node/index.cjs +105 -25289
- package/node/index.mjs +105 -25293
- package/package.json +1 -1
- package/remix/build.cjs +1 -132
- package/remix/index.mjs +1 -113
- package/server/index.cjs +1430 -15536
- package/server/index.mjs +1429 -15531
- package/types/_tests_/utils.d.ts +2 -1
- package/types/cli/code-server.d.ts +3 -0
- package/types/cli/code-tools.d.ts +11 -0
- package/types/cli/code.d.ts +51 -39
- package/types/cli/download.d.ts +1 -1
- package/types/cli/figma-publish.d.ts +7 -18
- package/types/cli/figma-utils.d.ts +16 -40
- package/types/cli/figma.d.ts +1 -0
- package/types/cli/generate.d.ts +5 -6
- package/types/cli/index.d.ts +24 -2
- package/types/cli/indexing.d.ts +0 -8
- package/types/cli/io-service.d.ts +86 -0
- package/types/cli/launch.d.ts +0 -1
- package/types/cli/report/figma-report.d.ts +3 -0
- package/types/cli/sync-utils.d.ts +2 -1
- package/types/common/ast/component-input-types.d.ts +1 -1
- package/types/common/ast/convert-values.d.ts +1 -1
- package/types/common/dotenv.d.ts +1 -1
- package/types/common/dotenv.test.d.ts +1 -0
- package/types/common/test-utils.d.ts +3 -1
- package/types/core/adapters/angular/index.d.ts +1 -0
- package/types/core/adapters/react/react-api-key.d.ts +1 -1
- package/types/figma/index.d.ts +3 -10
- package/types/server/builder-connect.d.ts +4 -1
- package/types/tsconfig.tsbuildinfo +1 -1
- package/types/types.d.ts +14 -4
- package/vite/index.cjs +3 -153
- package/vite/index.mjs +3 -119
- package/webpack/index.cjs +27 -2883
- package/webpack/index.mjs +27 -2871
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;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CodeGenTools, ContentMessageItemToolResult, ProjectFile } from "$/ai-utils";
|
|
2
|
+
import type { DevToolsSys } from "../core";
|
|
3
|
+
export interface LLMToolCalls {
|
|
4
|
+
name: CodeGenTools;
|
|
5
|
+
input: Record<string, any>;
|
|
6
|
+
id: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function resolveToolCalls(sys: DevToolsSys, toolCalls: LLMToolCalls[]): Promise<{
|
|
9
|
+
toolResults: ContentMessageItemToolResult[];
|
|
10
|
+
projectFiles: ProjectFile[];
|
|
11
|
+
}>;
|
package/types/cli/code.d.ts
CHANGED
|
@@ -1,49 +1,61 @@
|
|
|
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
|
-
|
|
3
|
+
import { type Credentials } from "./credentials";
|
|
4
|
+
import { type Checkpoint } from "./incremental-tsc";
|
|
5
|
+
import { type IOService } from "./io-service";
|
|
6
|
+
import type { ContentMessageItemToolResult, CustomInstruction, ProjectFile, UserContext } from "$/ai-utils";
|
|
7
|
+
import prettier from "prettier";
|
|
8
|
+
interface UndoState {
|
|
9
|
+
files: {
|
|
10
|
+
path: string;
|
|
11
|
+
content: Uint8Array | null;
|
|
12
|
+
}[];
|
|
13
|
+
isAgent: boolean;
|
|
14
|
+
url: string | undefined;
|
|
15
|
+
toolResults: ContentMessageItemToolResult[];
|
|
14
16
|
}
|
|
15
|
-
|
|
17
|
+
interface CodeGenSearchResponse {
|
|
18
|
+
ranked: RankedResult[];
|
|
19
|
+
relevantPaths: string[];
|
|
20
|
+
}
|
|
21
|
+
interface RankedResult {
|
|
22
|
+
filePath: string;
|
|
23
|
+
startIndex: number;
|
|
24
|
+
endIndex: number;
|
|
25
|
+
score: number;
|
|
16
26
|
id: string;
|
|
17
|
-
name: string;
|
|
18
|
-
content: string;
|
|
19
27
|
}
|
|
20
|
-
type
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
28
|
+
type State = "initial-with-url" | "initial-without-url" | "success" | "success-just-text" | "abort" | "error";
|
|
29
|
+
export interface SessionContext {
|
|
30
|
+
sessionId: string;
|
|
31
|
+
undoStates: UndoState[];
|
|
32
|
+
selectedFilePaths: Map<string, number>;
|
|
33
|
+
customInstructions: CustomInstruction[];
|
|
34
|
+
userContext: UserContext;
|
|
35
|
+
prettierConfig: prettier.Config | null;
|
|
36
|
+
state: State;
|
|
37
|
+
}
|
|
38
|
+
export interface UserInput {
|
|
39
|
+
userPrompt: string;
|
|
40
|
+
sentiment: "positive" | "negative" | "undo";
|
|
41
|
+
files: ProjectFile[];
|
|
42
|
+
searchResponse: CodeGenSearchResponse | null;
|
|
43
|
+
rerankFiles?: number;
|
|
44
|
+
mostRelevantFile: string | null;
|
|
45
|
+
role: "user" | "agent";
|
|
46
|
+
}
|
|
47
|
+
export declare const runCodeCommand: (sys: DevToolsSys, subCommand: string, args: CLIArgs, io?: IOService) => Promise<void>;
|
|
48
|
+
export declare const createSessionContext: (sys: DevToolsSys) => Promise<SessionContext>;
|
|
49
|
+
export declare const runCodeGen: (sys: DevToolsSys, args: CLIArgs, io?: IOService) => Promise<void>;
|
|
50
|
+
interface InteractiveAnswer {
|
|
51
|
+
command: "exit" | undefined;
|
|
52
|
+
userPrompt: string | undefined;
|
|
53
|
+
feedback: "positive" | "negative" | "undo" | undefined;
|
|
42
54
|
}
|
|
43
|
-
export declare
|
|
44
|
-
export declare
|
|
55
|
+
export declare function getUserInput(sys: DevToolsSys, credentials: Credentials, args: CLIArgs, sessionContext: SessionContext, answer: InteractiveAnswer, signal: AbortSignal | undefined, io?: IOService): Promise<UserInput>;
|
|
56
|
+
export declare function agentCompletion(sys: DevToolsSys, credentials: Credentials, args: CLIArgs, sessionContext: SessionContext, userInput: UserInput, url: string | undefined, baselineCheckpoint: Checkpoint, signal: AbortSignal | undefined, io?: IOService): Promise<Checkpoint>;
|
|
45
57
|
export declare function createApp(userId: string, spaceId: string, privateKey: string, body: any): Promise<void>;
|
|
46
58
|
export declare function transformStream(body: ReadableStream<Uint8Array> | null): AsyncGenerator<string, void, unknown>;
|
|
47
|
-
export declare function checkProjectRoot(sys: DevToolsSys, interactive: boolean): Promise<
|
|
59
|
+
export declare function checkProjectRoot(sys: DevToolsSys, interactive: boolean, io?: IOService): Promise<void>;
|
|
48
60
|
export declare function getUserContext(sys: DevToolsSys): Promise<UserContext>;
|
|
49
61
|
export {};
|
package/types/cli/download.d.ts
CHANGED
|
@@ -1,29 +1,18 @@
|
|
|
1
|
-
import
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
import type { DevTools, DevToolsSys } from "../types";
|
|
2
3
|
import type { CLIArgs } from "./index";
|
|
3
|
-
import {
|
|
4
|
-
import { type UserContext } from "./code";
|
|
4
|
+
import type { FigmaBuilderLink, FigmaMapperFile } from "$/ai-utils";
|
|
5
5
|
export declare const runFigmaPublish: (sys: DevToolsSys, args: CLIArgs) => Promise<undefined>;
|
|
6
6
|
export declare const FIGMA_CONNECT_CALL = "figmaMapping";
|
|
7
7
|
export declare function findAllMappingFiles(sys: DevToolsSys): Promise<string[]>;
|
|
8
|
-
export interface FigmaBuilderData {
|
|
9
|
-
figmaBuilderLinks: FigmaBuilderLink[];
|
|
10
|
-
}
|
|
11
8
|
export declare function setPublicKey(sys: DevToolsSys, publicKey: string, devTools: DevTools | undefined, ensureFigmaImportPage?: boolean): Promise<boolean>;
|
|
12
|
-
export
|
|
13
|
-
repoInfo: RepoInfo | undefined;
|
|
14
|
-
figmaBuilderLinks: FigmaBuilderLink[];
|
|
15
|
-
spaceId: string;
|
|
16
|
-
privateKey: string;
|
|
17
|
-
userId: string;
|
|
18
|
-
userContext: UserContext;
|
|
19
|
-
}
|
|
20
|
-
export declare function findMappingsFromFiles({ sys, force, mappingFiles, print, }: {
|
|
21
|
-
force?: boolean;
|
|
9
|
+
export declare function findMappingsFromFiles({ sys, mappingFiles, typeCheck, }: {
|
|
22
10
|
mappingFiles: string[];
|
|
23
|
-
print: boolean;
|
|
24
11
|
sys: DevToolsSys;
|
|
12
|
+
typeCheck?: boolean;
|
|
25
13
|
}): Promise<{
|
|
14
|
+
mapperFiles: FigmaMapperFile[];
|
|
26
15
|
figmaBuilderLinks: FigmaBuilderLink[];
|
|
27
|
-
|
|
16
|
+
diagnostics: ts.Diagnostic[];
|
|
28
17
|
figmaLinksToResolve: string[];
|
|
29
18
|
}>;
|
|
@@ -1,56 +1,32 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
}
|
|
1
|
+
import { type Credentials, type FigmaAuth } from "./credentials";
|
|
2
|
+
import type { DevToolsSys } from "../types";
|
|
3
|
+
import type { CLIArgs } from "./index";
|
|
4
|
+
import type { FigmaBuilderLink, FigmaComponentInfo } from "$/ai-utils";
|
|
5
|
+
type FigmaAPIOpts = {
|
|
6
|
+
auth: {
|
|
7
|
+
access_token: string;
|
|
8
|
+
oauth: boolean;
|
|
9
|
+
};
|
|
10
|
+
params?: Record<string, any>;
|
|
11
|
+
};
|
|
37
12
|
export declare const REMOVE_EMOJI: RegExp;
|
|
38
13
|
export declare const parseFigmaURL: (str: string) => {
|
|
39
14
|
fileID: string;
|
|
40
15
|
nodeId: string;
|
|
41
16
|
} | null;
|
|
42
|
-
export declare const
|
|
17
|
+
export declare const figmaApi: (sys: DevToolsSys, args: CLIArgs, path: string, { auth, params }: FigmaAPIOpts) => Promise<any>;
|
|
18
|
+
export declare const getFigmaNodeData: (sys: DevToolsSys, args: CLIArgs, auth: {
|
|
43
19
|
access_token: string;
|
|
44
20
|
oauth: boolean;
|
|
45
21
|
}, fileId: string, nodeIds: string, depth?: number) => Promise<any>;
|
|
46
|
-
export declare function getFigmaComponentName(name: string): string;
|
|
47
22
|
export declare function getImportDataFromToken(credentials: Credentials, token: string, verbose: boolean): Promise<(readonly [string, FigmaComponentInfo])[]>;
|
|
48
23
|
export declare function needsFigmaAuth(urls: string[]): boolean;
|
|
49
|
-
export declare function getFigmaNodeDataFromURLs(figmaAuth: {
|
|
24
|
+
export declare function getFigmaNodeDataFromURLs(sys: DevToolsSys, args: CLIArgs, figmaAuth: {
|
|
50
25
|
access_token: string;
|
|
51
26
|
oauth: boolean;
|
|
52
27
|
} | undefined, builderAuth: {
|
|
53
28
|
privateKey: string;
|
|
54
29
|
spaceId: string;
|
|
55
30
|
}, urls: string[]): Promise<(readonly [string, FigmaComponentInfo])[]>;
|
|
56
|
-
export declare function inPlaceResolveFigmaURLs(figmaAuth: FigmaAuth, figmaBuilderLinks: FigmaBuilderLink[], figmaLinksToResolve: string[]): Promise<void>;
|
|
31
|
+
export declare function inPlaceResolveFigmaURLs(sys: DevToolsSys, args: CLIArgs, figmaAuth: FigmaAuth, figmaBuilderLinks: FigmaBuilderLink[], figmaLinksToResolve: string[]): Promise<void>;
|
|
32
|
+
export {};
|
package/types/cli/figma.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { DevToolsSys } from "../types";
|
|
2
2
|
import type { CLIArgs } from ".";
|
|
3
3
|
export declare const runFigmaCommand: (sys: DevToolsSys, subCommand: string, args: CLIArgs) => Promise<void>;
|
|
4
|
+
export declare function askToInstallBuilder(sys: DevToolsSys, args: CLIArgs): Promise<void>;
|
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 { type UserContext } from "
|
|
4
|
-
import { type FigmaComponentInfo } from "./figma-utils";
|
|
3
|
+
import { type FigmaComponentInfo, type 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
|
@@ -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 */
|
|
@@ -27,12 +29,32 @@ export interface CLIArgs {
|
|
|
27
29
|
url?: string;
|
|
28
30
|
/** Prompt text for non-interactive mode */
|
|
29
31
|
prompt?: string;
|
|
30
|
-
/** Generation mode
|
|
31
|
-
mode?: "
|
|
32
|
+
/** Generation mode */
|
|
33
|
+
mode?: "fast" | "quality" | "quality-v3";
|
|
32
34
|
/** Working directory to run commands from */
|
|
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
|
}
|
package/types/cli/indexing.d.ts
CHANGED
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
import type { DevToolsSys } from "../types";
|
|
2
2
|
import type { CLIArgs } from "./index";
|
|
3
3
|
import { type Credentials } from "./credentials";
|
|
4
|
-
export interface ArtifactItem {
|
|
5
|
-
type: "shell" | "file" | "text" | "delta" | "done";
|
|
6
|
-
id?: string;
|
|
7
|
-
content: string;
|
|
8
|
-
filePath?: string;
|
|
9
|
-
artifactTitle?: string;
|
|
10
|
-
incomplete?: boolean;
|
|
11
|
-
}
|
|
12
4
|
export declare const runCodeIndexing: (_sys: DevToolsSys, _args: CLIArgs) => Promise<void>;
|
|
13
5
|
export declare const codeIndexing: (sys: DevToolsSys, credentials: Credentials) => Promise<void>;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { type SelectOptions, type ConfirmOptions, type TextOptions } from "@clack/prompts";
|
|
2
|
+
import { spinner } from "./spinner";
|
|
3
|
+
import type { WebSocket } from "ws";
|
|
4
|
+
export interface IOService {
|
|
5
|
+
log(str: string): void;
|
|
6
|
+
info(str: string): void;
|
|
7
|
+
warn(str: string): void;
|
|
8
|
+
error(str: string): void;
|
|
9
|
+
write(text: string): void;
|
|
10
|
+
writeMetadata(metadata: Record<string, any>): void;
|
|
11
|
+
confirm(options: ConfirmOptions): Promise<boolean | symbol>;
|
|
12
|
+
text(options: TextOptions): Promise<string | symbol>;
|
|
13
|
+
select<Value>(options: SelectOptions<Value>): Promise<Value | symbol>;
|
|
14
|
+
createSpinner(): ReturnType<typeof spinner>;
|
|
15
|
+
isInteractive(): boolean;
|
|
16
|
+
isTTY(): boolean;
|
|
17
|
+
exit(code: number): Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
export declare class ConsoleIOService implements IOService {
|
|
20
|
+
log(str: string): void;
|
|
21
|
+
info(str: string): void;
|
|
22
|
+
warn(str: string): void;
|
|
23
|
+
error(str: string): void;
|
|
24
|
+
write(text: string): void;
|
|
25
|
+
writeMetadata(_: Record<string, any>): void;
|
|
26
|
+
confirm(options: ConfirmOptions): Promise<boolean | symbol>;
|
|
27
|
+
text(options: TextOptions): Promise<string | symbol>;
|
|
28
|
+
select<Value>(options: SelectOptions<Value>): Promise<Value | symbol>;
|
|
29
|
+
createSpinner(): ReturnType<typeof spinner>;
|
|
30
|
+
isInteractive(): boolean;
|
|
31
|
+
isTTY(): boolean;
|
|
32
|
+
exit(code: number): Promise<void>;
|
|
33
|
+
}
|
|
34
|
+
export interface BaseMessage {
|
|
35
|
+
type: string;
|
|
36
|
+
[key: string]: any;
|
|
37
|
+
}
|
|
38
|
+
export interface LogMessage extends BaseMessage {
|
|
39
|
+
type: "log";
|
|
40
|
+
level: "info" | "warn" | "error";
|
|
41
|
+
message: string;
|
|
42
|
+
}
|
|
43
|
+
export interface WriteMessage extends BaseMessage {
|
|
44
|
+
type: "write";
|
|
45
|
+
text: string;
|
|
46
|
+
}
|
|
47
|
+
export interface SpinnerMessage extends BaseMessage {
|
|
48
|
+
type: "spinner";
|
|
49
|
+
status: "start" | "stop";
|
|
50
|
+
message: string;
|
|
51
|
+
code?: number;
|
|
52
|
+
}
|
|
53
|
+
export interface PromptRequest extends BaseMessage {
|
|
54
|
+
type: "prompt";
|
|
55
|
+
promptType: "text" | "confirm" | "select";
|
|
56
|
+
options: any;
|
|
57
|
+
requestId: string;
|
|
58
|
+
}
|
|
59
|
+
export interface PromptResponse extends BaseMessage {
|
|
60
|
+
type: "prompt_response";
|
|
61
|
+
requestId: string;
|
|
62
|
+
value: any;
|
|
63
|
+
cancelled?: boolean;
|
|
64
|
+
}
|
|
65
|
+
export declare class WebSocketIOService implements IOService {
|
|
66
|
+
private ws;
|
|
67
|
+
private promptCallbacks;
|
|
68
|
+
private messageQueue;
|
|
69
|
+
private isProcessing;
|
|
70
|
+
constructor(ws: WebSocket);
|
|
71
|
+
private sendMessage;
|
|
72
|
+
private prompt;
|
|
73
|
+
log(...args: any[]): void;
|
|
74
|
+
info(...args: any[]): void;
|
|
75
|
+
warn(...args: any[]): void;
|
|
76
|
+
error(...args: any[]): void;
|
|
77
|
+
write(text: string): void;
|
|
78
|
+
writeMetadata(metadata: Record<string, any>): void;
|
|
79
|
+
confirm(options: ConfirmOptions): Promise<boolean | symbol>;
|
|
80
|
+
text(options: TextOptions): Promise<string | symbol>;
|
|
81
|
+
select<Value>(options: SelectOptions<Value>): Promise<Value | symbol>;
|
|
82
|
+
createSpinner(): ReturnType<typeof spinner>;
|
|
83
|
+
isInteractive(): boolean;
|
|
84
|
+
isTTY(): boolean;
|
|
85
|
+
exit(code: number): Promise<void>;
|
|
86
|
+
}
|
package/types/cli/launch.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { DevToolsSys } from "@builder.io/dev-tools/core";
|
|
2
2
|
import type { CLIArgs } from "./index";
|
|
3
|
-
export declare const API_PORT = 48753;
|
|
4
3
|
export declare const PROXY_PORT = 48752;
|
|
5
4
|
export declare function runLaunchCommand(sys: DevToolsSys, subCommand: string, args: CLIArgs): Promise<number>;
|
|
@@ -4,8 +4,9 @@ export declare function extractSignatureInfo(content: string): {
|
|
|
4
4
|
sessionKey?: string;
|
|
5
5
|
snippetId?: string;
|
|
6
6
|
};
|
|
7
|
-
export declare function getAllProjectFiles(basePath: string): Promise<string[]>;
|
|
7
|
+
export declare function getAllProjectFiles(basePath: string, globPattern?: string): Promise<string[]>;
|
|
8
8
|
export declare function findBuilderFiles(basePath: string, targetContentId: string, targetSessionKey: string): Promise<FileNode[]>;
|
|
9
|
+
export declare function filterNonImportantFiles(files: string[]): string[];
|
|
9
10
|
export declare function getIgnorePatterns(basePath: string): (path: string) => boolean;
|
|
10
11
|
export declare function watchDirectory(basePath: string, syncInfo: SyncInfo, onChange: (updatedSyncInfo: SyncInfo) => void): () => Promise<void>;
|
|
11
12
|
export declare function setupSyncServer(sys: DevToolsSys, initialSyncInfo?: SyncInfo): Promise<void>;
|
|
@@ -17,7 +17,7 @@ export declare const NUMBER_TYPES: string[];
|
|
|
17
17
|
export declare const BOOLEAN_TYPES: string[];
|
|
18
18
|
export declare const ARRAY_TYPES: string[];
|
|
19
19
|
export declare const OBJECT_TYPES: string[];
|
|
20
|
-
export declare function getPrimitiveType(t: string): "number" | "
|
|
20
|
+
export declare function getPrimitiveType(t: string): "number" | "string" | "boolean" | "object" | "array";
|
|
21
21
|
export declare function removeQuotes(text: string): string;
|
|
22
22
|
export declare const resolveType: (sys: DevToolsSys, checker: ts.TypeChecker, type: ts.Type) => string[] | undefined;
|
|
23
23
|
export declare const typeToString: (sys: DevToolsSys, checker: ts.TypeChecker, type: ts.Type) => string;
|
|
@@ -8,4 +8,4 @@ export declare function objectExpressionToObjectValue(sys: DevToolsSys, objectLi
|
|
|
8
8
|
};
|
|
9
9
|
export declare function convertArrayExpressionToJsArray(sys: DevToolsSys, arr: ts.ArrayLiteralExpression): any[];
|
|
10
10
|
export declare function getTextOfPropertyName(sys: DevToolsSys, prop: ts.PropertyAssignment | ts.ObjectLiteralElementLike | undefined): string | undefined;
|
|
11
|
-
export declare function valueToExpression(sys: DevToolsSys, val: any): ts.
|
|
11
|
+
export declare function valueToExpression(sys: DevToolsSys, val: any): ts.ObjectLiteralExpression | ts.Identifier | ts.StringLiteral | ts.NumericLiteral | ts.TrueLiteral | ts.FalseLiteral | ts.ArrayLiteralExpression;
|
package/types/common/dotenv.d.ts
CHANGED
|
@@ -3,4 +3,4 @@ export declare function getDotEnvValue(sys: DevToolsSys, dotEnvFileNames: string
|
|
|
3
3
|
export declare function setDotEnvValue(sys: DevToolsSys, dotEnvFileNames: string[], envKey: string, envValue: string): Promise<EnvInfo>;
|
|
4
4
|
export declare function parseDotEnvFile(sys: DevToolsSys, envPath: string): Promise<Record<string, string> | null>;
|
|
5
5
|
export declare function parseDotEnvContent(envContent: string): Record<string, string>;
|
|
6
|
-
export declare function setDotEnvVar(sys: DevToolsSys, envPath: string, key: string, value: string): Promise<"create" | "update" | null>;
|
|
6
|
+
export declare function setDotEnvVar(sys: DevToolsSys, envPath: string, key: string, value: string): Promise<"create" | "update" | "permission-error" | null>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { DevToolsSys } from "../types";
|
|
2
2
|
import ts from "typescript";
|
|
3
3
|
export declare function codeEqual(sys: DevToolsSys, n: ts.Node | null | undefined | string, expectCode: string, removeComments?: boolean): Promise<void>;
|
|
4
|
-
export declare function createTestFsSys(rootDir: string
|
|
4
|
+
export declare function createTestFsSys(rootDir: string, options?: {
|
|
5
|
+
readOnlyPermissions?: boolean;
|
|
6
|
+
}): Promise<DevToolsSys>;
|
|
5
7
|
export declare function createTestMemSys(rootDir?: string): Promise<DevToolsSys>;
|
|
6
8
|
export declare function createRemixTestMemSys(rootDir?: string): Promise<DevToolsSys>;
|
|
7
9
|
export declare function createAngularTestMemSys(rootDir?: string): Promise<DevToolsSys>;
|
|
@@ -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 {
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import { type DevToolsServerContext, type ConnectedBuilder, type ValidatedBuilder, type SPACE_KIND_VALUES } from "../types";
|
|
2
|
-
export declare function connectBuilder(ctx: DevToolsServerContext, publicApiKey: string, privateAuthKey: string, kind: SPACE_KIND_VALUES): Promise<ConnectedBuilder
|
|
2
|
+
export declare function connectBuilder(ctx: DevToolsServerContext, publicApiKey: string, privateAuthKey: string, kind: SPACE_KIND_VALUES): Promise<ConnectedBuilder | {
|
|
3
|
+
success: boolean;
|
|
4
|
+
pathname: string;
|
|
5
|
+
}>;
|
|
3
6
|
export declare function validateBuilder(ctx: DevToolsServerContext): Promise<ValidatedBuilder>;
|