@builder.io/dev-tools 1.6.30 → 1.6.32-dev.202505051820.05d6c195
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 +104726 -3494
- 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 +12 -2
- package/types/cli/io-service.d.ts +86 -0
- package/types/cli/launch/helpers.d.ts +2 -5
- package/types/cli/launch/logger.d.ts +1 -3
- 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
|
@@ -23,6 +23,10 @@ export interface SessionContext {
|
|
|
23
23
|
userContext: UserContext;
|
|
24
24
|
prettierConfig: prettier.Config | null;
|
|
25
25
|
state: GenerateCompletionState;
|
|
26
|
+
title: string | undefined;
|
|
27
|
+
beforeCommit: string | undefined;
|
|
28
|
+
createdUnixTime: number;
|
|
29
|
+
updatedUnixTime: number;
|
|
26
30
|
}
|
|
27
31
|
export interface CodeGenSessionOptionsBase {
|
|
28
32
|
sys: DevToolsSys;
|
|
@@ -95,7 +99,7 @@ export declare class CodeGenSession {
|
|
|
95
99
|
getNextUrl(): string | undefined;
|
|
96
100
|
getNextMessage(): Promise<GenerateUserMessage>;
|
|
97
101
|
sendFeedback(sentiment: "positive" | "negative" | "undo", message?: string, lastCompletionId?: string | undefined): Promise<void>;
|
|
98
|
-
|
|
102
|
+
lastTurnHasChanges(): Promise<boolean>;
|
|
99
103
|
sendMessage(message: GenerateUserMessage): void;
|
|
100
104
|
getTurns(): CodegenTurn[];
|
|
101
105
|
getSessionContext(): SessionContext;
|
|
@@ -104,7 +108,13 @@ export declare class CodeGenSession {
|
|
|
104
108
|
close(): Promise<void>;
|
|
105
109
|
connectToEventLoop(shouldReplay: boolean, onStep: (step: GenerateCompletionStep) => void): () => void;
|
|
106
110
|
waitForEventLoop(): Promise<void>;
|
|
107
|
-
agentCompletion(userMessage: GenerateUserMessage, signal: AbortSignal | undefined, onStep: (step: GenerateCompletionStep) =>
|
|
111
|
+
agentCompletion(userMessage: GenerateUserMessage, signal: AbortSignal | undefined, onStep: (step: GenerateCompletionStep) => void): Promise<void>;
|
|
112
|
+
commitWorkInProgress(lastTurn: CodegenTurn): Promise<string | undefined>;
|
|
113
|
+
/**
|
|
114
|
+
* Returns true if the last turn's afterCommit (or beforeCommit) is different from the session's beforeCommit.
|
|
115
|
+
*/
|
|
116
|
+
hasChanges(): boolean;
|
|
117
|
+
isCleanWorkTree(): Promise<boolean>;
|
|
108
118
|
}
|
|
109
119
|
export declare function transformStream(body: ReadableStream<Uint8Array> | null): AsyncGenerator<string, void, unknown>;
|
|
110
120
|
export declare function getUserContext(sys: DevToolsSys): Promise<UserContext>;
|
|
@@ -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
|
+
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { EnsureConfigResult } from "types";
|
|
2
2
|
export declare const GIT_APP_FOLDER = "code";
|
|
3
|
+
export declare const LOGS_FILE_PATH: string;
|
|
4
|
+
export declare const STATUS_FILE_PATH: string;
|
|
3
5
|
export declare const transformVolumePath: (volumePath?: string) => string;
|
|
4
6
|
export declare const navigateToVolumePath: (volumePath: string) => void;
|
|
5
7
|
export declare const navigateToGitAppFolder: () => void;
|
|
@@ -57,9 +59,4 @@ export type LaunchStatus = {
|
|
|
57
59
|
};
|
|
58
60
|
};
|
|
59
61
|
export declare const updateStatus: <T extends keyof LaunchStatus>(key: T, value: Partial<LaunchStatus[T]>) => void;
|
|
60
|
-
/**
|
|
61
|
-
* This path is derived from the logs file path, which is set by `initializeLogging`.
|
|
62
|
-
* Therefore make sure that `initializeLogging` has been called before calling this function.
|
|
63
|
-
*/
|
|
64
|
-
export declare const getBuilderStatusFilePath: () => string;
|
|
65
62
|
export declare const getConfigStatus: () => LaunchStatus;
|
|
@@ -2,9 +2,7 @@ import type { ChildProcessWithoutNullStreams } from "child_process";
|
|
|
2
2
|
/**
|
|
3
3
|
* Initialize logging by wrapping all console methods to write to logs file
|
|
4
4
|
*/
|
|
5
|
-
export declare function initializeLogging(
|
|
6
|
-
goToParentTimes?: number;
|
|
7
|
-
}): void;
|
|
5
|
+
export declare function initializeLogging(): void;
|
|
8
6
|
/**
|
|
9
7
|
* Reset console methods to their original state
|
|
10
8
|
*/
|
|
@@ -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>;
|