@builder.io/dev-tools 1.6.19 → 1.6.20-dev.202504032053.5a0a40ed
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 +46 -1
- package/angular/index.mjs +21 -1
- package/cli/index.cjs +100043 -1783
- package/cli/index.cjs.map +4 -4
- package/cli/main.cjs +1 -1
- package/core/index.cjs +13488 -851
- package/core/index.mjs +13479 -852
- package/figma/index.cjs +39 -1
- package/figma/index.mjs +19 -1
- package/node/index.cjs +25289 -105
- package/node/index.mjs +25293 -105
- package/package.json +6 -2
- package/remix/build.cjs +132 -1
- package/remix/index.mjs +113 -1
- package/server/index.cjs +15527 -1356
- package/server/index.mjs +15523 -1356
- package/types/_tests_/utils.d.ts +1 -2
- package/types/cli/code.d.ts +15 -15
- package/types/cli/download.d.ts +1 -1
- package/types/cli/figma-publish.d.ts +18 -7
- package/types/cli/figma-utils.d.ts +40 -16
- package/types/cli/generate.d.ts +6 -5
- package/types/cli/index.d.ts +0 -22
- package/types/cli/launch.d.ts +1 -0
- package/types/common/ast/component-input-types.d.ts +1 -1
- package/types/common/ast/convert-values.d.ts +1 -1
- package/types/core/adapters/angular/index.d.ts +0 -1
- package/types/core/adapters/react/react-api-key.d.ts +1 -1
- package/types/figma/index.d.ts +10 -3
- package/types/tsconfig.tsbuildinfo +1 -1
- package/vite/index.cjs +153 -3
- package/vite/index.mjs +119 -3
- package/webpack/index.cjs +2883 -27
- package/webpack/index.mjs +2871 -27
package/types/_tests_/utils.d.ts
CHANGED
|
@@ -24,9 +24,8 @@ interface CLI {
|
|
|
24
24
|
modified: string[];
|
|
25
25
|
}>;
|
|
26
26
|
npm(...args: string[]): Promise<number>;
|
|
27
|
-
spawn(command: string, args: string[]): Promise<number>;
|
|
28
27
|
}
|
|
29
|
-
export declare function testCLI(name: string, template: string | undefined, handler: (cli: Handler, expect: ExpectStatic) => Promise<void>, timeout?: number
|
|
28
|
+
export declare function testCLI(name: string, template: string | undefined, handler: (cli: Handler, expect: ExpectStatic) => Promise<void>, timeout?: number): void;
|
|
30
29
|
type Handler = (cmd: "builderio" | "create-builderio", args: string[], options?: {
|
|
31
30
|
debug?: boolean;
|
|
32
31
|
}) => CLI;
|
package/types/cli/code.d.ts
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import type { DevToolsSys } from "../types";
|
|
2
2
|
import type { CLIArgs } from "./index";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
export interface UserContext {
|
|
4
|
+
client: string;
|
|
5
|
+
clientVersion: string;
|
|
6
|
+
nodeVersion: string;
|
|
7
|
+
systemPlatform: string;
|
|
8
|
+
systemEOL: string;
|
|
9
|
+
systemArch: string;
|
|
10
|
+
frameworks: string[];
|
|
11
|
+
systemShell?: string;
|
|
12
|
+
inGitRepo?: boolean;
|
|
13
|
+
[key: string]: string[] | string | boolean | undefined;
|
|
13
14
|
}
|
|
14
|
-
interface
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
export interface CustomInstruction {
|
|
16
|
+
id: string;
|
|
17
|
+
name: string;
|
|
18
|
+
content: string;
|
|
18
19
|
}
|
|
19
20
|
type CodegenUsage = {
|
|
20
21
|
total: number;
|
|
@@ -41,7 +42,6 @@ export interface ArtifactItem {
|
|
|
41
42
|
}
|
|
42
43
|
export declare const runCodeCommand: (sys: DevToolsSys, subCommand: string, args: CLIArgs) => Promise<void>;
|
|
43
44
|
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,18 +1,29 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { DevTools, DevToolsSys } from "../types";
|
|
1
|
+
import type { DevTools, DevToolsSys, RepoInfo } from "../types";
|
|
3
2
|
import type { CLIArgs } from "./index";
|
|
4
|
-
import type
|
|
3
|
+
import { type FigmaBuilderLink } from "./figma-utils";
|
|
4
|
+
import { type UserContext } from "./code";
|
|
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
|
+
}
|
|
8
11
|
export declare function setPublicKey(sys: DevToolsSys, publicKey: string, devTools: DevTools | undefined, ensureFigmaImportPage?: boolean): Promise<boolean>;
|
|
9
|
-
export
|
|
12
|
+
export interface PublishedMapping {
|
|
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;
|
|
10
22
|
mappingFiles: string[];
|
|
23
|
+
print: boolean;
|
|
11
24
|
sys: DevToolsSys;
|
|
12
|
-
typeCheck?: boolean;
|
|
13
25
|
}): Promise<{
|
|
14
|
-
mapperFiles: FigmaMapperFile[];
|
|
15
26
|
figmaBuilderLinks: FigmaBuilderLink[];
|
|
16
|
-
|
|
27
|
+
foundErrors: boolean;
|
|
17
28
|
figmaLinksToResolve: string[];
|
|
18
29
|
}>;
|
|
@@ -1,32 +1,56 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
+
}
|
|
12
37
|
export declare const REMOVE_EMOJI: RegExp;
|
|
13
38
|
export declare const parseFigmaURL: (str: string) => {
|
|
14
39
|
fileID: string;
|
|
15
40
|
nodeId: string;
|
|
16
41
|
} | null;
|
|
17
|
-
export declare const
|
|
18
|
-
export declare const getFigmaNodeData: (sys: DevToolsSys, args: CLIArgs, auth: {
|
|
42
|
+
export declare const getFigmaNodeData: (auth: {
|
|
19
43
|
access_token: string;
|
|
20
44
|
oauth: boolean;
|
|
21
45
|
}, fileId: string, nodeIds: string, depth?: number) => Promise<any>;
|
|
46
|
+
export declare function getFigmaComponentName(name: string): string;
|
|
22
47
|
export declare function getImportDataFromToken(credentials: Credentials, token: string, verbose: boolean): Promise<(readonly [string, FigmaComponentInfo])[]>;
|
|
23
48
|
export declare function needsFigmaAuth(urls: string[]): boolean;
|
|
24
|
-
export declare function getFigmaNodeDataFromURLs(
|
|
49
|
+
export declare function getFigmaNodeDataFromURLs(figmaAuth: {
|
|
25
50
|
access_token: string;
|
|
26
51
|
oauth: boolean;
|
|
27
52
|
} | undefined, builderAuth: {
|
|
28
53
|
privateKey: string;
|
|
29
54
|
spaceId: string;
|
|
30
55
|
}, urls: string[]): Promise<(readonly [string, FigmaComponentInfo])[]>;
|
|
31
|
-
export declare function inPlaceResolveFigmaURLs(
|
|
32
|
-
export {};
|
|
56
|
+
export declare function inPlaceResolveFigmaURLs(figmaAuth: FigmaAuth, figmaBuilderLinks: FigmaBuilderLink[], figmaLinksToResolve: string[]): Promise<void>;
|
package/types/cli/generate.d.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import type { ComponentInfo, ComponentRegistry, DevToolsSys } from "../types";
|
|
2
2
|
import type { CLIArgs } from "./index";
|
|
3
|
-
import { type
|
|
3
|
+
import { type UserContext } from "./code";
|
|
4
|
+
import { type FigmaComponentInfo } from "./figma-utils";
|
|
4
5
|
export declare const runFigmaGenerate: (sys: DevToolsSys, args: CLIArgs) => Promise<undefined>;
|
|
5
6
|
export interface MappingCodeV3 {
|
|
6
|
-
figmaNode
|
|
7
|
-
registry
|
|
7
|
+
figmaNode: FigmaComponentInfo;
|
|
8
|
+
registry: ComponentRegistry;
|
|
8
9
|
userContext?: UserContext;
|
|
9
|
-
figmaUrl
|
|
10
|
+
figmaUrl: string;
|
|
10
11
|
docsUrl?: string;
|
|
11
|
-
registeredCmp
|
|
12
|
+
registeredCmp: ComponentInfo;
|
|
12
13
|
previousCompletion?: string;
|
|
13
14
|
userPrompt?: string;
|
|
14
15
|
token?: string;
|
package/types/cli/index.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
export interface CLIArgs {
|
|
2
2
|
/** Figma access token */
|
|
3
3
|
figmaToken?: string;
|
|
4
|
-
/** GitHub access token */
|
|
5
|
-
githubToken?: string;
|
|
6
4
|
/** Run in CI mode without interactive prompts */
|
|
7
5
|
ci?: boolean;
|
|
8
6
|
/** Show help text */
|
|
@@ -35,26 +33,6 @@ export interface CLIArgs {
|
|
|
35
33
|
cwd?: string;
|
|
36
34
|
/** Debug mode */
|
|
37
35
|
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;
|
|
56
36
|
/** Raw command line arguments */
|
|
57
37
|
_: string[];
|
|
58
|
-
builderPublicKey?: string;
|
|
59
|
-
builderPrivateKey?: string;
|
|
60
38
|
}
|
package/types/cli/launch.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
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;
|
|
3
4
|
export declare const PROXY_PORT = 48752;
|
|
4
5
|
export declare function runLaunchCommand(sys: DevToolsSys, subCommand: string, args: CLIArgs): Promise<number>;
|
|
@@ -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" | "object" | "string" | "boolean" | "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.ObjectLiteralExpression | ts.
|
|
11
|
+
export declare function valueToExpression(sys: DevToolsSys, val: any): ts.Identifier | ts.ObjectLiteralExpression | ts.ArrayLiteralExpression | ts.StringLiteral | ts.NumericLiteral | ts.TrueLiteral | ts.FalseLiteral;
|
|
@@ -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 = "YOUR_PUBLIC_BUILDER_KEY";
|
package/types/figma/index.d.ts
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
import type { FigmaComponentInput } from "$/ai-utils";
|
|
2
1
|
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
|
+
}
|
|
3
12
|
export interface FigmaNode {
|
|
4
13
|
"@type": "passedNode";
|
|
5
14
|
$id: string;
|
|
@@ -49,13 +58,11 @@ export type FigmaURL = `https://www.figma.com/design/${string}/${string}${"?" |
|
|
|
49
58
|
export interface FigmaMappingWithKeyMapper<T extends BaseFigmaProps> {
|
|
50
59
|
url?: FigmaURL;
|
|
51
60
|
componentKey: string;
|
|
52
|
-
componentName?: string;
|
|
53
61
|
mapper?: (figma: T) => any;
|
|
54
62
|
}
|
|
55
63
|
export interface FigmaMappingWithUrlMapper<T extends BaseFigmaProps> {
|
|
56
64
|
url: FigmaURL;
|
|
57
65
|
componentKey?: string;
|
|
58
|
-
componentName?: string;
|
|
59
66
|
mapper?: (figma: T) => any;
|
|
60
67
|
}
|
|
61
68
|
export interface FigmaGenericMapper {
|