@builder.io/dev-tools 1.6.32 → 1.6.33-dev.202505061815.c7d79ad3
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 +104936 -3498
- package/cli/index.cjs.map +4 -4
- package/core/index.cjs +13656 -851
- package/core/index.mjs +13647 -852
- package/figma/index.cjs +39 -1
- package/figma/index.mjs +19 -1
- package/node/index.cjs +25304 -105
- package/node/index.mjs +25308 -105
- package/package.json +1 -1
- package/remix/build.cjs +132 -1
- package/remix/index.mjs +113 -1
- package/server/index.cjs +14994 -1363
- package/server/index.mjs +14987 -1363
- package/types/cli/code-server.d.ts +0 -0
- package/types/cli/codegen.d.ts +8 -2
- package/types/cli/index.d.ts +4 -0
- package/types/cli/io-service.d.ts +86 -0
- package/types/cli/launch/helpers.d.ts +12 -1
- package/types/cli/launch/server.d.ts +11 -5
- package/types/cli/launch-init.d.ts +6 -0
- package/types/cli/launch.d.ts +6 -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/vite/ensure-remix-config.d.ts +6 -0
- package/types/core/adapters/vite/remix-utils.d.ts +10 -0
- package/types/core/adapters/vite/vite-config-helpers.d.ts +6 -0
- 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
|
File without changes
|
package/types/cli/codegen.d.ts
CHANGED
|
@@ -4,16 +4,20 @@ import { type Credentials } from "./credentials";
|
|
|
4
4
|
import type { CodegenTurn, CustomInstruction, GenerateCompletionState, GenerateCompletionStep, GenerateUserMessage, UserContext } from "$/ai-utils";
|
|
5
5
|
import prettier from "prettier";
|
|
6
6
|
import { type ProvidedToolContext } from "./code-tools";
|
|
7
|
-
import type { ChildProcessWithoutNullStreams } from "child_process";
|
|
8
7
|
export interface RunCommandCtx {
|
|
9
8
|
command: string;
|
|
9
|
+
state: "running" | "crashed";
|
|
10
|
+
ensureRunning: () => Promise<boolean>;
|
|
11
|
+
addCheckpoint: () => void;
|
|
12
|
+
getCheckpoints: (n: number) => string;
|
|
10
13
|
getAllStdout: () => string;
|
|
11
14
|
getAllStderr: () => string;
|
|
12
15
|
getOutput: () => string;
|
|
13
16
|
pid: number | undefined;
|
|
14
|
-
|
|
17
|
+
onClose: (callback: (code: number | null) => void) => void;
|
|
15
18
|
onStdout: (callback: (data: string) => void) => void;
|
|
16
19
|
onStderr: (callback: (data: string) => void) => void;
|
|
20
|
+
restart: () => Promise<void>;
|
|
17
21
|
}
|
|
18
22
|
export interface SessionContext {
|
|
19
23
|
sessionId: string;
|
|
@@ -33,10 +37,12 @@ export interface CodeGenSessionOptionsBase {
|
|
|
33
37
|
credentials: Credentials;
|
|
34
38
|
args: CLIArgs;
|
|
35
39
|
position: string;
|
|
40
|
+
maxTokens?: number;
|
|
36
41
|
mode?: "quality" | "quality-v3" | "fast";
|
|
37
42
|
fusion?: boolean;
|
|
38
43
|
fusionRemote?: string;
|
|
39
44
|
fusionAutoInitGit?: boolean;
|
|
45
|
+
builtInCustomInstructions?: CustomInstruction[];
|
|
40
46
|
featureBranch?: string;
|
|
41
47
|
providedToolContext?: ProvidedToolContext;
|
|
42
48
|
}
|
package/types/cli/index.d.ts
CHANGED
|
@@ -41,4 +41,8 @@ export interface CLIArgs {
|
|
|
41
41
|
_: string[];
|
|
42
42
|
/** Auto-initialize a git repository if none exists (for Fusion) */
|
|
43
43
|
fusionAutoInitGit?: boolean;
|
|
44
|
+
/** Builder private key, used for authentication. */
|
|
45
|
+
builderPrivateKey?: string;
|
|
46
|
+
/** Builder public key, used for authentication. */
|
|
47
|
+
builderPublicKey?: string;
|
|
44
48
|
}
|
|
@@ -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
|
+
}
|
|
@@ -29,7 +29,7 @@ export type LaunchStatus = {
|
|
|
29
29
|
gitRepo?: {
|
|
30
30
|
exists?: boolean;
|
|
31
31
|
configured?: boolean;
|
|
32
|
-
repo?: string
|
|
32
|
+
repo?: string;
|
|
33
33
|
branch?: string;
|
|
34
34
|
error?: string | undefined;
|
|
35
35
|
current?: string | undefined;
|
|
@@ -60,3 +60,14 @@ export type LaunchStatus = {
|
|
|
60
60
|
};
|
|
61
61
|
export declare const updateStatus: <T extends keyof LaunchStatus>(key: T, value: Partial<LaunchStatus[T]>) => void;
|
|
62
62
|
export declare const getConfigStatus: () => LaunchStatus;
|
|
63
|
+
/**
|
|
64
|
+
* Get the GitHub remote URL for a given repository
|
|
65
|
+
* @param repoFullName - The full name of the repository (e.g. "BuilderIO/fusion-starter")
|
|
66
|
+
* @param githubToken - The GitHub token to use for the remote URL
|
|
67
|
+
* @returns The GitHub remote URL
|
|
68
|
+
*/
|
|
69
|
+
export declare const getGitHubRemoteUrl: ({ repoFullName, githubToken, }: {
|
|
70
|
+
repoFullName: string;
|
|
71
|
+
githubToken: string | undefined;
|
|
72
|
+
}) => string;
|
|
73
|
+
export declare const getActiveBranch: () => string;
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
import { type Express
|
|
1
|
+
import { type Express } from "express";
|
|
2
2
|
export declare const BUILDER_ENDPOINT_PREFIX = "/_builder.io";
|
|
3
3
|
export declare const BUILDER_API_ENDPOINT_PREFIX: string;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Endpoints that are not authenticated because they are used by the fly.io health check.
|
|
6
|
+
*/
|
|
7
|
+
export declare const NON_AUTHENTICATED_ENDPOINTS: {
|
|
8
|
+
readonly STATUS: "/status";
|
|
9
|
+
readonly PROXY_STATUS: "/proxy-status";
|
|
10
|
+
};
|
|
11
|
+
export declare const configureServer: ({ app, validBuilderPrivateKey, authenticateProxy, }: {
|
|
12
|
+
app: Express;
|
|
6
13
|
validBuilderPrivateKey: string | undefined;
|
|
7
14
|
authenticateProxy: boolean;
|
|
8
|
-
}) =>
|
|
9
|
-
export declare const createLogAndConfigEndpoints: (app: Express) => void;
|
|
15
|
+
}) => void;
|
|
@@ -6,6 +6,12 @@ export interface InitArgs extends CLIArgs {
|
|
|
6
6
|
githubToken?: string;
|
|
7
7
|
installCommand?: string;
|
|
8
8
|
volumePath?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Indicates the type of docker image the CLI is running on.
|
|
11
|
+
*
|
|
12
|
+
* @default "node"
|
|
13
|
+
*/
|
|
14
|
+
dockerImageType?: "fusion-starter" | "node";
|
|
9
15
|
}
|
|
10
16
|
export declare function runLaunchInitCommand({ args, sys, }: {
|
|
11
17
|
sys: DevToolsSys;
|
package/types/cli/launch.d.ts
CHANGED
|
@@ -29,6 +29,12 @@ export interface LaunchArgs extends CLIArgs {
|
|
|
29
29
|
* @default false
|
|
30
30
|
*/
|
|
31
31
|
authenticateProxy?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Indicates the type of docker image the CLI is running on.
|
|
34
|
+
*
|
|
35
|
+
* @default "node"
|
|
36
|
+
*/
|
|
37
|
+
dockerImageType?: "fusion-starter" | "node";
|
|
32
38
|
}
|
|
33
39
|
export declare function runLaunchCommand({ sys, args, }: {
|
|
34
40
|
sys: DevToolsSys;
|
|
@@ -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): "string" | "object" | "number" | "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.Identifier | ts.StringLiteral | ts.NumericLiteral | ts.
|
|
11
|
+
export declare function valueToExpression(sys: DevToolsSys, val: any): ts.ObjectLiteralExpression | ts.Identifier | ts.StringLiteral | ts.NumericLiteral | ts.ArrayLiteralExpression | ts.TrueLiteral | ts.FalseLiteral;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { DevToolsSys } from "../..";
|
|
2
|
+
import type { EnsureConfigResult } from "../../../types";
|
|
3
|
+
/**
|
|
4
|
+
* Ensure the Remix Vite config has the necessary plugins and settings
|
|
5
|
+
*/
|
|
6
|
+
export declare function ensureRemixConfig(sys: DevToolsSys, configFilePath: string, configContent: string): Promise<EnsureConfigResult>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { DevToolsSys } from "../..";
|
|
2
|
+
import type ts from "typescript";
|
|
3
|
+
/**
|
|
4
|
+
* Check if the current project is using Remix framework
|
|
5
|
+
*/
|
|
6
|
+
export declare function isRemixFramework(sys: DevToolsSys): boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Update an object literal to include the external dependencies for Remix
|
|
9
|
+
*/
|
|
10
|
+
export declare function updateCommonJsLibrary(sys: DevToolsSys, config: ts.ObjectLiteralExpression): ts.ObjectLiteralExpression | null;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { DevToolsSys } from "../..";
|
|
2
|
+
import type { EnsureConfigResult } from "../../../types";
|
|
3
|
+
/**
|
|
4
|
+
* Update a Vite config file to include a plugin
|
|
5
|
+
*/
|
|
6
|
+
export declare function updateViteConfig(sys: DevToolsSys, configFilePath: string, configContent: string, pluginName: string, importPath: string): Promise<EnsureConfigResult>;
|