builder.io 1.6.10 → 1.6.13
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 +333 -333
- package/cli/index.cjs.map +4 -4
- package/cli/main.cjs +2 -2
- package/core/index.cjs +58 -58
- package/core/index.mjs +58 -58
- package/figma/jsx-runtime/index.d.ts +2 -2
- package/figma/jsx-runtime/prop-types.d.ts +9 -9
- package/figma/jsx-runtime/react.d.ts +101 -105
- package/node/index.cjs +46 -47
- package/node/index.mjs +46 -47
- package/package.json +1 -1
- package/remix/build.cjs +1 -1
- package/remix/index.mjs +1 -1
- package/remix/server-build/index.cjs +3 -3
- package/server/index.cjs +169 -172
- package/server/index.mjs +169 -172
- package/types/_tests_/code.e2e.d.ts +1 -0
- package/types/_tests_/create-builder.e2e.d.ts +1 -0
- package/types/_tests_/figma-generate.e2e.d.ts +1 -0
- package/types/_tests_/figma-publish.e2e.d.ts +1 -0
- package/types/_tests_/help.e2e.d.ts +1 -0
- package/types/_tests_/utils.d.ts +42 -0
- package/types/_tests_/vitest.config.d.ts +2 -0
- package/types/cli/builder-add/options.d.ts +1 -1
- package/types/cli/code-file-utils.d.ts +1 -1
- package/types/cli/credentials.d.ts +1 -1
- package/types/cli/figma-publish.d.ts +5 -3
- package/types/cli/figma-utils.d.ts +6 -5
- package/types/cli/index.d.ts +2 -0
- package/types/cli/spinner.d.ts +0 -1
- package/types/cli/track.d.ts +1 -1
- package/types/common/ast/component-input-types.d.ts +1 -1
- package/types/common/builder/builder-api.d.ts +1 -1
- package/types/common/builder/content-generation.d.ts +1 -1
- package/types/common/test-utils.d.ts +1 -1
- package/types/core/adapters/next/next-test-utils.d.ts +5 -5
- package/types/core/adapters/react/react-test-utils.d.ts +2 -2
- package/types/core/adapters/remix/remix-test-utils.d.ts +2 -2
- package/types/figma/index.d.ts +0 -1
- package/types/server/request-handler.d.ts +0 -1
- package/types/tsconfig.tsbuildinfo +1 -0
- package/types/types.d.ts +0 -1
- package/types/vitest.config.d.ts +2 -0
- package/vite/index.cjs +3 -3
- package/vite/index.d.ts +1 -1
- package/vite/index.mjs +3 -3
- package/webpack/index.cjs +1 -1
- package/webpack/index.d.ts +1 -1
- package/webpack/index.mjs +1 -1
- package/types/cli/kv.d.ts +0 -20
- package/types/cli/main.d.cts +0 -2
- package/types/figma/jsx-runtime/index.d.cts +0 -2
- package/types/figma/jsx-runtime/index.d.ts +0 -2
- package/types/next/index.d.cts +0 -4
- package/types/next/index.d.mts +0 -4
- package/types/remix/index-shim.d.cts +0 -2
- /package/types/vite/{index.d.ts → main.d.ts} +0 -0
- /package/types/webpack/{index.d.ts → main.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type ExpectStatic } from "vitest";
|
|
2
|
+
interface CLI {
|
|
3
|
+
output(): string;
|
|
4
|
+
consumeOutput(): string;
|
|
5
|
+
inputText(text: string): Promise<void>;
|
|
6
|
+
inputEnter(text?: string): Promise<void>;
|
|
7
|
+
inputArrowUp(): Promise<void>;
|
|
8
|
+
inputArrowDown(): Promise<void>;
|
|
9
|
+
inputArrowRight(): Promise<void>;
|
|
10
|
+
inputArrowLeft(): Promise<void>;
|
|
11
|
+
inputCtrlC(): Promise<void>;
|
|
12
|
+
inputSpace(): Promise<void>;
|
|
13
|
+
waitUntilText(text: string, timeout?: number): Promise<void>;
|
|
14
|
+
waitUntilExit(): Promise<number>;
|
|
15
|
+
wait(ms: number): Promise<void>;
|
|
16
|
+
writeFile(path: string, content: string): Promise<void>;
|
|
17
|
+
readFile(path: string): string;
|
|
18
|
+
exists(path: string): boolean;
|
|
19
|
+
readdir(path: string): string[];
|
|
20
|
+
fsSnapshot(path: string): Promise<Snapshot>;
|
|
21
|
+
fsDiff(oldSnap: Snapshot): Promise<{
|
|
22
|
+
added: string[];
|
|
23
|
+
removed: string[];
|
|
24
|
+
modified: string[];
|
|
25
|
+
}>;
|
|
26
|
+
npm(...args: string[]): Promise<number>;
|
|
27
|
+
}
|
|
28
|
+
export declare function testCLI(name: string, template: string | undefined, handler: (cli: Handler, expect: ExpectStatic) => Promise<void>, timeout?: number): void;
|
|
29
|
+
type Handler = (cmd: "builderio" | "create-builderio", args: string[], options?: {
|
|
30
|
+
debug?: boolean;
|
|
31
|
+
}) => CLI;
|
|
32
|
+
export declare function createCLI(template: string | undefined, handler: (cli: Handler) => Promise<void>): Promise<void>;
|
|
33
|
+
/**
|
|
34
|
+
* A snapshot maps a file's relative path to its hash.
|
|
35
|
+
*/
|
|
36
|
+
type Snapshot = {
|
|
37
|
+
cwd: string;
|
|
38
|
+
hashes: {
|
|
39
|
+
[file: string]: string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { AddCliOptions } from "
|
|
1
|
+
import type { AddCliOptions } from "../../types";
|
|
2
2
|
export declare function getOptions(cwd: string, args: string[]): AddCliOptions;
|
|
@@ -32,7 +32,7 @@ export declare function calculateMaxFileTokens(fileImportance: number, highImpor
|
|
|
32
32
|
/**
|
|
33
33
|
* Get recently modified files using git commands with commit relationship tracking
|
|
34
34
|
*/
|
|
35
|
-
export declare function getGitModifiedFiles(appRootDir: string, commitCount?: number): Promise<Map<string, GitFileInfo>>;
|
|
35
|
+
export declare function getGitModifiedFiles(sys: DevToolsSys, appRootDir: string, commitCount?: number): Promise<Map<string, GitFileInfo>>;
|
|
36
36
|
/**
|
|
37
37
|
* Update file relationships based on files modified in the same commit
|
|
38
38
|
*/
|
|
@@ -44,6 +44,6 @@ export interface Credentials {
|
|
|
44
44
|
userId?: string;
|
|
45
45
|
}
|
|
46
46
|
export declare const getCredentials: (sys: DevToolsSys, args: CLIArgs, opts: CredentialsOptions) => Promise<Credentials>;
|
|
47
|
-
export declare function getFigmaAuth(): Promise<FigmaAuth>;
|
|
47
|
+
export declare function getFigmaAuth(sys: DevToolsSys): Promise<FigmaAuth>;
|
|
48
48
|
export declare function getBuilderCodegenUsage(builderPublicKey: string, builderPrivateKey: string): Promise<BuilderCodegenUsage>;
|
|
49
49
|
export declare function getBuilderAuth(sys: DevToolsSys, preferSpaceId?: string): Promise<BuilderAuth>;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import ts from "typescript";
|
|
1
2
|
import type { DevTools, DevToolsSys, RepoInfo } from "../types";
|
|
2
3
|
import type { CLIArgs } from "./index";
|
|
3
4
|
import { type FigmaBuilderLink } from "./figma-utils";
|
|
5
|
+
import { type UserContext } from "./code";
|
|
4
6
|
export declare const runFigmaPublish: (sys: DevToolsSys, args: CLIArgs) => Promise<undefined>;
|
|
5
7
|
export declare const FIGMA_CONNECT_CALL = "figmaMapping";
|
|
6
8
|
export declare function findAllMappingFiles(sys: DevToolsSys): Promise<string[]>;
|
|
@@ -14,14 +16,14 @@ export interface PublishedMapping {
|
|
|
14
16
|
spaceId: string;
|
|
15
17
|
privateKey: string;
|
|
16
18
|
userId: string;
|
|
19
|
+
userContext: UserContext;
|
|
17
20
|
}
|
|
18
|
-
export declare function findMappingsFromFiles({ force, mappingFiles,
|
|
21
|
+
export declare function findMappingsFromFiles({ sys, force, mappingFiles, }: {
|
|
19
22
|
force?: boolean;
|
|
20
23
|
mappingFiles: string[];
|
|
21
|
-
print: boolean;
|
|
22
24
|
sys: DevToolsSys;
|
|
23
25
|
}): Promise<{
|
|
24
26
|
figmaBuilderLinks: FigmaBuilderLink[];
|
|
25
|
-
|
|
27
|
+
diagnostics: ts.Diagnostic[];
|
|
26
28
|
figmaLinksToResolve: string[];
|
|
27
29
|
}>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type { ExportType } from "../types";
|
|
1
|
+
import { type Credentials, type FigmaAuth } from "./credentials";
|
|
2
|
+
import type { DevToolsSys, ExportType } from "../types";
|
|
3
|
+
import type { CLIArgs } from "./index";
|
|
3
4
|
export interface FigmaComponentInput {
|
|
4
5
|
id: string;
|
|
5
6
|
name: string;
|
|
@@ -39,18 +40,18 @@ export declare const parseFigmaURL: (str: string) => {
|
|
|
39
40
|
fileID: string;
|
|
40
41
|
nodeId: string;
|
|
41
42
|
} | null;
|
|
42
|
-
export declare const getFigmaNodeData: (auth: {
|
|
43
|
+
export declare const getFigmaNodeData: (sys: DevToolsSys, args: CLIArgs, auth: {
|
|
43
44
|
access_token: string;
|
|
44
45
|
oauth: boolean;
|
|
45
46
|
}, fileId: string, nodeIds: string, depth?: number) => Promise<any>;
|
|
46
47
|
export declare function getFigmaComponentName(name: string): string;
|
|
47
48
|
export declare function getImportDataFromToken(credentials: Credentials, token: string, verbose: boolean): Promise<(readonly [string, FigmaComponentInfo])[]>;
|
|
48
49
|
export declare function needsFigmaAuth(urls: string[]): boolean;
|
|
49
|
-
export declare function getFigmaNodeDataFromURLs(figmaAuth: {
|
|
50
|
+
export declare function getFigmaNodeDataFromURLs(sys: DevToolsSys, args: CLIArgs, figmaAuth: {
|
|
50
51
|
access_token: string;
|
|
51
52
|
oauth: boolean;
|
|
52
53
|
} | undefined, builderAuth: {
|
|
53
54
|
privateKey: string;
|
|
54
55
|
spaceId: string;
|
|
55
56
|
}, urls: string[]): Promise<(readonly [string, FigmaComponentInfo])[]>;
|
|
56
|
-
export declare function inPlaceResolveFigmaURLs(figmaAuth: FigmaAuth, figmaBuilderLinks: FigmaBuilderLink[], figmaLinksToResolve: string[]): Promise<void>;
|
|
57
|
+
export declare function inPlaceResolveFigmaURLs(sys: DevToolsSys, args: CLIArgs, figmaAuth: FigmaAuth, figmaBuilderLinks: FigmaBuilderLink[], figmaLinksToResolve: string[]): Promise<void>;
|
package/types/cli/index.d.ts
CHANGED
package/types/cli/spinner.d.ts
CHANGED
package/types/cli/track.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import * as Amplitude from "@amplitude/analytics-node";
|
|
2
|
-
export declare function initTracking(): Promise<void>;
|
|
2
|
+
export declare function initTracking(verbose: boolean): Promise<void>;
|
|
3
3
|
export declare function track(eventName: string, options: Record<string, any>): Promise<Amplitude.Types.Result>;
|
|
4
4
|
export declare function setUserId(id: string): 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): "
|
|
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;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DevToolsSys } from "../types";
|
|
2
2
|
import ts from "typescript";
|
|
3
|
-
export declare function codeEqual(sys: DevToolsSys, n: ts.Node | null | undefined | string, expectCode: string, removeComments?: boolean): void
|
|
3
|
+
export declare function codeEqual(sys: DevToolsSys, n: ts.Node | null | undefined | string, expectCode: string, removeComments?: boolean): Promise<void>;
|
|
4
4
|
export declare function createTestFsSys(rootDir: string): Promise<DevToolsSys>;
|
|
5
5
|
export declare function createTestMemSys(rootDir?: string): Promise<DevToolsSys>;
|
|
6
6
|
export declare function createRemixTestMemSys(rootDir?: string): Promise<DevToolsSys>;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import type { SDK_VERSION_VALUES } from "
|
|
1
|
+
import type { SDK_VERSION_VALUES } from "../../../types";
|
|
2
2
|
export declare function createNextTestMemSys(rootDir?: string): Promise<import("./index").NextDevToolsSys>;
|
|
3
3
|
export declare function createNextAppTestFixturesSys(): Promise<import("./index").NextDevToolsSys>;
|
|
4
4
|
export declare function createNextAppTestFixturesDevTools(sdkVersion?: SDK_VERSION_VALUES): Promise<{
|
|
5
5
|
sys: import("./index").NextDevToolsSys;
|
|
6
|
-
devTools: import("
|
|
6
|
+
devTools: import("../../../types").DevToolsAdapter;
|
|
7
7
|
}>;
|
|
8
8
|
export declare function createNextPagesTestFixturesSys(): Promise<import("./index").NextDevToolsSys>;
|
|
9
9
|
export declare function createNextPagesTestFixturesDevTools(sdkVersion?: SDK_VERSION_VALUES): Promise<{
|
|
10
10
|
sys: import("./index").NextDevToolsSys;
|
|
11
|
-
devTools: import("
|
|
11
|
+
devTools: import("../../../types").DevToolsAdapter;
|
|
12
12
|
}>;
|
|
13
13
|
export declare function createNextAppTestDevTools(): Promise<{
|
|
14
|
-
sys: import("
|
|
15
|
-
devTools: import("
|
|
14
|
+
sys: import("../../../types").DevToolsSys;
|
|
15
|
+
devTools: import("../../../types").DevToolsAdapter;
|
|
16
16
|
}>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { SDK_VERSION_VALUES } from "
|
|
1
|
+
import type { SDK_VERSION_VALUES } from "../../../types";
|
|
2
2
|
export declare function createReactTestMemSys(rootDir?: string): Promise<import("./index").ReactDevToolsSys>;
|
|
3
3
|
export declare function createReactAppTestFixturesSys(): Promise<import("./index").ReactDevToolsSys>;
|
|
4
4
|
export declare function createReactAppTestFixturesDevTools(sdkVersion?: SDK_VERSION_VALUES): Promise<{
|
|
5
5
|
sys: import("./index").ReactDevToolsSys;
|
|
6
|
-
devTools: import("
|
|
6
|
+
devTools: import("../../../types").DevToolsAdapter;
|
|
7
7
|
}>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { SDK_VERSION_VALUES } from "
|
|
1
|
+
import type { SDK_VERSION_VALUES } from "../../../types";
|
|
2
2
|
export declare function createRemixTestFixturesSys(): Promise<import("./index").RemixDevToolsSys>;
|
|
3
3
|
export declare function createRemixTestMemSys(rootDir?: string): Promise<import("./index").RemixDevToolsSys>;
|
|
4
4
|
export declare function createRemixTestFixturesDevTools(sdkVersion?: SDK_VERSION_VALUES): Promise<{
|
|
5
5
|
sys: import("./index").RemixDevToolsSys;
|
|
6
|
-
devTools: import("
|
|
6
|
+
devTools: import("../../../types").DevToolsAdapter;
|
|
7
7
|
}>;
|
package/types/figma/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import type { DevToolsServerContext } from "../types";
|
|
3
2
|
import type { IncomingMessage, Server, ServerResponse } from "http";
|
|
4
3
|
export declare function handleDevRequest(ctx: DevToolsServerContext | null, server: Server, req: IncomingMessage, res: ServerResponse): Promise<void>;
|