builder.io 1.6.85 → 1.6.86
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 +408 -406
- package/cli/index.cjs.map +4 -4
- package/core/index.cjs +1 -1
- package/core/index.mjs +1 -1
- package/node/index.cjs +1 -1
- package/node/index.mjs +1 -1
- package/package.json +2 -1
- package/server/index.cjs +40 -40
- package/server/index.mjs +44 -44
- package/types/cli/code-tools.d.ts +2 -1
- package/types/cli/codegen.d.ts +0 -6
- package/types/cli/figma-utils.d.ts +1 -1
- package/types/cli/report/figma-report.d.ts +51 -0
- package/types/tsconfig.tsbuildinfo +1 -1
|
@@ -28,6 +28,7 @@ export interface ToolContext extends Partial<FusionContext> {
|
|
|
28
28
|
emitter: CodeGenEventEmitter;
|
|
29
29
|
signal: AbortSignal | undefined;
|
|
30
30
|
workingDirectory: string;
|
|
31
|
+
bashWorkingDirectory: string;
|
|
31
32
|
resolveWorkspacePath: (path: string, forceWorkspace: boolean) => {
|
|
32
33
|
resolvedPath: string;
|
|
33
34
|
workspaceFolder?: WorkspaceFolder;
|
|
@@ -55,6 +56,6 @@ interface RipgrepMatch {
|
|
|
55
56
|
interface RipgrepResult {
|
|
56
57
|
matches: RipgrepMatch[];
|
|
57
58
|
}
|
|
58
|
-
export declare function runRipgrep(sys: DevToolsSys,
|
|
59
|
+
export declare function runRipgrep(sys: DevToolsSys, bashWorkingDirectory: string, pattern: string, includeGlob?: string, excludeGlob?: string): Promise<RipgrepResult>;
|
|
59
60
|
export declare function newAbortError(): Error;
|
|
60
61
|
export {};
|
package/types/cli/codegen.d.ts
CHANGED
|
@@ -183,12 +183,6 @@ export declare class CodeGenSession {
|
|
|
183
183
|
resolvedPath: string;
|
|
184
184
|
workspaceFolder?: WorkspaceFolder;
|
|
185
185
|
};
|
|
186
|
-
/**
|
|
187
|
-
* Converts an absolute path back to a workspace-relative path if applicable
|
|
188
|
-
* @param absolutePath An absolute file system path
|
|
189
|
-
* @returns The workspace-relative path with appropriate prefix
|
|
190
|
-
*/
|
|
191
|
-
toWorkspaceRelativePath(absolutePath: string): string;
|
|
192
186
|
/**
|
|
193
187
|
* Reads a file from the workspace
|
|
194
188
|
* @param filePath A file path that may include a workspace prefix
|
|
@@ -13,7 +13,7 @@ export declare const parseFigmaURL: (str: string) => {
|
|
|
13
13
|
fileID: string;
|
|
14
14
|
nodeId: string;
|
|
15
15
|
} | null;
|
|
16
|
-
export declare const figmaApi: (sys: DevToolsSys, args: CLIArgs, path: string, { auth, params }: FigmaAPIOpts) => Promise<
|
|
16
|
+
export declare const figmaApi: <T = any>(sys: DevToolsSys, args: CLIArgs, path: string, { auth, params }: FigmaAPIOpts) => Promise<T>;
|
|
17
17
|
export declare const getFigmaNodeData: (sys: DevToolsSys, args: CLIArgs, auth: {
|
|
18
18
|
access_token: string;
|
|
19
19
|
oauth: boolean;
|
|
@@ -1,3 +1,54 @@
|
|
|
1
|
+
import type { FigmaComponentInfo } from "$/ai-utils";
|
|
1
2
|
import type { CLIArgs } from "..";
|
|
2
3
|
import type { DevToolsSys } from "../../core";
|
|
4
|
+
import type { PublishedComponent, PublishedComponentSet } from "@figma/rest-api-spec";
|
|
5
|
+
type Context = {
|
|
6
|
+
sys: DevToolsSys;
|
|
7
|
+
args: CLIArgs;
|
|
8
|
+
debug: (msg: unknown) => void;
|
|
9
|
+
figmaAuth: {
|
|
10
|
+
access_token: string;
|
|
11
|
+
oauth: boolean;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* A component or component set
|
|
16
|
+
*/
|
|
17
|
+
type FigmaTeamComponent = {
|
|
18
|
+
/** The unique identifier for the component. */
|
|
19
|
+
key: string;
|
|
20
|
+
/** The unique identifier of the Figma file that contains the component. */
|
|
21
|
+
file_key: string;
|
|
22
|
+
/** The unique identifier of the component node within the Figma file. */
|
|
23
|
+
node_id: string;
|
|
24
|
+
/** A URL to a thumbnail image of the component. */
|
|
25
|
+
thumbnail_url?: string;
|
|
26
|
+
/** The name of the component. */
|
|
27
|
+
name: string;
|
|
28
|
+
/** The description of the component as entered by the publisher. */
|
|
29
|
+
description: string;
|
|
30
|
+
/** The component data. */
|
|
31
|
+
componentData?: FigmaComponentInfo;
|
|
32
|
+
/** Whether the component is published. */
|
|
33
|
+
isPublished?: boolean;
|
|
34
|
+
};
|
|
35
|
+
export declare function extractFigmaIds(url: string): {
|
|
36
|
+
teamId?: string;
|
|
37
|
+
fileKey?: string;
|
|
38
|
+
nodeId?: string;
|
|
39
|
+
};
|
|
40
|
+
export declare function fetchTeamComponents(context: Context, teamId: string, onProgress: () => void): Promise<PublishedComponent[]>;
|
|
41
|
+
export declare function fetchTeamComponentSets(context: Context, teamId: string, onProgress: () => void): Promise<PublishedComponentSet[]>;
|
|
42
|
+
/**
|
|
43
|
+
* Returns a list of components and component sets that are present in the file or selection as
|
|
44
|
+
* well as a set of remote keys for components that are referenced but not present.
|
|
45
|
+
*/
|
|
46
|
+
export declare function processFileOrSelection(context: Context, fileKey: string, nodeId?: string): Promise<{
|
|
47
|
+
fileComponents: FigmaTeamComponent[];
|
|
48
|
+
remoteKeys: Set<string>;
|
|
49
|
+
}>;
|
|
50
|
+
export declare function fetchRemoteComponentData(context: Context, remoteKeys: Set<string>): Promise<(FigmaTeamComponent | undefined)[]>;
|
|
51
|
+
export declare function resolveComponentData(context: Context, components: FigmaTeamComponent[]): Promise<FigmaTeamComponent[]>;
|
|
52
|
+
export declare function generateComponentReport(component: FigmaTeamComponent, baseDir: string): Promise<void>;
|
|
3
53
|
export declare const runFigmaReport: (sys: DevToolsSys, args: CLIArgs) => Promise<void>;
|
|
54
|
+
export {};
|