@builder.io/dev-tools 1.7.8 → 1.7.9-dev.202507220502.f46b7a282
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 +108649 -3840
- package/cli/index.cjs.map +4 -4
- package/core/index.cjs +14129 -790
- package/core/index.mjs +14119 -790
- package/figma/index.cjs +47 -1
- package/figma/index.mjs +27 -1
- package/node/index.cjs +25310 -105
- package/node/index.mjs +25314 -105
- package/package.json +1 -1
- package/remix/build.cjs +132 -1
- package/remix/index.mjs +113 -1
- package/server/index.cjs +21952 -1469
- package/server/index.mjs +21951 -1469
- package/types/cli/backup.d.ts +8 -6
- package/types/cli/code-server.d.ts +0 -0
- package/types/cli/codegen.d.ts +3 -26
- package/types/cli/io-service.d.ts +86 -0
- package/types/cli/launch/InitStateMachine.d.ts +12 -1
- package/types/cli/launch/helpers.d.ts +0 -11
- package/types/cli/launch/install-jsx-plugin.d.ts +7 -0
- package/types/cli/launch/logger.d.ts +38 -0
- package/types/cli/launch-init-v2.d.ts +13 -0
- package/types/cli/launch-init.d.ts +19 -0
- package/types/cli/repo-indexing-utils.d.ts +2 -0
- package/types/cli/repo-indexing.d.ts +17 -0
- package/types/cli/repo-indexing.mock.d.ts +5 -0
- package/types/cli/utils/repo-indexing-group-prompts.d.ts +1 -0
- package/types/common/ast/component-input-types.d.ts +1 -1
- package/types/common/utils.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
package/types/cli/backup.d.ts
CHANGED
|
@@ -13,18 +13,20 @@ export declare function requestSignedDownloadUrl(credentials: Credentials, body:
|
|
|
13
13
|
* Records a successful git backup in Firebase
|
|
14
14
|
*/
|
|
15
15
|
export declare function recordBackupSuccess(credentials: Credentials, body: GitBackupRecordOptions): Promise<GitBackupRecordResult>;
|
|
16
|
-
|
|
17
|
-
* Downloads a git backup bundle
|
|
18
|
-
* @returns The path to the downloaded bundle file, or null if no backup exists
|
|
19
|
-
*/
|
|
20
|
-
export declare function downloadGitBackup(sys: DevToolsSys, credentials: Credentials, options: GitBackupDownloadUrlOptions): Promise<{
|
|
16
|
+
export type GitBackupDownloadResult = {
|
|
21
17
|
success: boolean;
|
|
18
|
+
partial?: boolean;
|
|
22
19
|
exists?: boolean;
|
|
23
20
|
bundlePath?: string;
|
|
24
21
|
bundleSize?: number;
|
|
25
22
|
error?: Error;
|
|
26
23
|
message?: string;
|
|
27
|
-
}
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Downloads a git backup bundle
|
|
27
|
+
* @returns The path to the downloaded bundle file, or null if no backup exists
|
|
28
|
+
*/
|
|
29
|
+
export declare function downloadGitBackup(sys: DevToolsSys, credentials: Credentials, options: GitBackupDownloadUrlOptions): Promise<GitBackupDownloadResult>;
|
|
28
30
|
/**
|
|
29
31
|
* Uploads a file stream to a signed URL
|
|
30
32
|
*/
|
|
File without changes
|
package/types/cli/codegen.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DevToolsSys } from "../types";
|
|
2
2
|
import { type Credentials } from "./credentials";
|
|
3
|
-
import type
|
|
3
|
+
import { type CodegenFeedback, type CodeGenToolMap, type CodegenTurn, type CommitMode, type CustomInstruction, type FusionConfig, type GenerateCompletionState, type GenerateCompletionStep, type GenerateCompletionStepGit, type GenerateUserMessage, type UserContext, type WorkspaceConfiguration, type WorkspaceFolder, type LoadWholeSessionOptions, type LoadWholeSessionResult, type LoadHistoryResult, type CodeGenMode } from "$/ai-utils";
|
|
4
4
|
import prettier from "prettier";
|
|
5
5
|
import { type FusionContext } from "./code-tools";
|
|
6
6
|
import EventEmitter from "node:events";
|
|
@@ -56,33 +56,13 @@ export declare class CodeGenSession {
|
|
|
56
56
|
getRepoUrl(): string | undefined;
|
|
57
57
|
setPrUrl(prUrl: string): void;
|
|
58
58
|
prExists(): boolean;
|
|
59
|
-
pushRepoV2({ repoFullName
|
|
59
|
+
pushRepoV2({ repoFullName }: {
|
|
60
60
|
repoFullName: string;
|
|
61
|
-
remoteUrl: string;
|
|
62
61
|
}): Promise<{
|
|
63
|
-
output: string;
|
|
64
|
-
upToDate: boolean;
|
|
65
|
-
createdBranch: boolean;
|
|
66
|
-
setUpToStream: boolean;
|
|
67
|
-
status: GenerateCompletionStepGit | null;
|
|
68
|
-
success: boolean;
|
|
69
|
-
error?: undefined;
|
|
70
|
-
details?: undefined;
|
|
71
|
-
} | {
|
|
72
62
|
success: boolean;
|
|
73
63
|
error: string;
|
|
74
|
-
details
|
|
64
|
+
details?: undefined;
|
|
75
65
|
} | {
|
|
76
|
-
success: boolean;
|
|
77
|
-
error: string;
|
|
78
|
-
}>;
|
|
79
|
-
pushRepo(...args: [
|
|
80
|
-
{
|
|
81
|
-
repoFullName: string;
|
|
82
|
-
githubToken: string;
|
|
83
|
-
githubBaseUrl?: string;
|
|
84
|
-
}
|
|
85
|
-
] | [string, string, string?]): Promise<{
|
|
86
66
|
output: string;
|
|
87
67
|
upToDate: boolean;
|
|
88
68
|
createdBranch: boolean;
|
|
@@ -95,9 +75,6 @@ export declare class CodeGenSession {
|
|
|
95
75
|
success: boolean;
|
|
96
76
|
error: string;
|
|
97
77
|
details: string;
|
|
98
|
-
} | {
|
|
99
|
-
success: boolean;
|
|
100
|
-
error: string;
|
|
101
78
|
}>;
|
|
102
79
|
archiveProject(): Promise<string>;
|
|
103
80
|
isIdle(): Promise<boolean>;
|
|
@@ -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,6 +1,7 @@
|
|
|
1
1
|
import type { DevToolsSys } from "@builder.io/dev-tools/core";
|
|
2
2
|
import { type FusionConfig, type WorkspaceFolder, type InitState, type InitStateStep, type InitStatusLog } from "$/ai-utils";
|
|
3
3
|
import type { Credentials } from "../credentials";
|
|
4
|
+
import { type GitBackupDownloadResult } from "../backup";
|
|
4
5
|
export interface InitConfig {
|
|
5
6
|
fusionConfig: FusionConfig;
|
|
6
7
|
credentials: Credentials;
|
|
@@ -30,5 +31,15 @@ export declare class InitStateMachine {
|
|
|
30
31
|
private isGitConfigured;
|
|
31
32
|
private getGitRemoteUrl;
|
|
32
33
|
private sanitizeGitRemoteUrl;
|
|
33
|
-
|
|
34
|
+
/**
|
|
35
|
+
* If a backup is available, perform a backup recovery (and throw if it fails and cannot be recovered from).
|
|
36
|
+
* If no backup is available, do nothing.
|
|
37
|
+
*/
|
|
38
|
+
private restoreFromPartialBackup;
|
|
39
|
+
cloneRepository({ repo, repoPath, signal, backupResult, }: {
|
|
40
|
+
repo: Required<WorkspaceFolder>;
|
|
41
|
+
repoPath: string;
|
|
42
|
+
signal?: AbortSignal;
|
|
43
|
+
backupResult: GitBackupDownloadResult | undefined;
|
|
44
|
+
}): Promise<boolean>;
|
|
34
45
|
}
|
|
@@ -1,12 +1 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Get the GitHub remote URL for a given repository
|
|
3
|
-
* @param repoFullName - The full name of the repository (e.g. "BuilderIO/fusion-starter")
|
|
4
|
-
* @param githubToken - The GitHub token to use for the remote URL
|
|
5
|
-
* @returns The GitHub remote URL
|
|
6
|
-
*/
|
|
7
|
-
export declare const getGitHubRemoteUrl: ({ repoFullName, githubToken, githubHost, }: {
|
|
8
|
-
repoFullName: string;
|
|
9
|
-
githubToken: string | undefined;
|
|
10
|
-
githubHost: string;
|
|
11
|
-
}) => string;
|
|
12
1
|
export declare const getCommandWithShellArgs: (command: string, shell: string) => string[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DevToolsSys } from "@builder.io/dev-tools/core";
|
|
2
|
+
import { type InstallOutcome } from "./helpers";
|
|
3
|
+
export declare const installJsxPlugin: (sys: DevToolsSys) => Promise<{
|
|
4
|
+
timestamp: string;
|
|
5
|
+
installOutcome: InstallOutcome;
|
|
6
|
+
error: string | undefined;
|
|
7
|
+
}>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Initialize logging by wrapping all console methods to write to logs file
|
|
3
|
+
*/
|
|
4
|
+
export declare function initializeLogging(): void;
|
|
5
|
+
/**
|
|
6
|
+
* Reset console methods to their original state
|
|
7
|
+
*/
|
|
8
|
+
export declare function resetLogging(): void;
|
|
9
|
+
/**
|
|
10
|
+
* Display intro message with logging
|
|
11
|
+
*/
|
|
12
|
+
export declare const intro: (message: string) => void;
|
|
13
|
+
/**
|
|
14
|
+
* Wrapped clack logging methods with file logging
|
|
15
|
+
*/
|
|
16
|
+
export declare const log: {
|
|
17
|
+
info: (message: string) => void;
|
|
18
|
+
success: (message: string) => void;
|
|
19
|
+
error: (message: string) => void;
|
|
20
|
+
warn: (message: string) => void;
|
|
21
|
+
step: (message: string) => void;
|
|
22
|
+
message: (message?: string, { symbol }?: import("@clack/prompts").LogMessageOptions) => void;
|
|
23
|
+
warning: (message: string) => void;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Display outro message with logging
|
|
27
|
+
*/
|
|
28
|
+
export declare const outro: (message: string) => void;
|
|
29
|
+
/**
|
|
30
|
+
* Reads logs with pagination
|
|
31
|
+
* @param nextToken Line number to start reading from (0-indexed)
|
|
32
|
+
* @param limit Number of lines to read
|
|
33
|
+
* @returns Object containing logs array and next token
|
|
34
|
+
*/
|
|
35
|
+
export declare const readLogs: (nextToken?: number, limit?: number) => {
|
|
36
|
+
logs: string[];
|
|
37
|
+
nextToken: number | null;
|
|
38
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { DevToolsSys } from "@builder.io/dev-tools/core";
|
|
2
|
+
import type { CLIArgs } from "./index";
|
|
3
|
+
export interface InitArgs extends CLIArgs {
|
|
4
|
+
repoFullName?: string;
|
|
5
|
+
branchName?: string;
|
|
6
|
+
githubToken?: string;
|
|
7
|
+
installCommand?: string;
|
|
8
|
+
dockerImageType?: "fusion-starter" | "node";
|
|
9
|
+
}
|
|
10
|
+
export declare function runLaunchInitCommandV2({ args, sys, }: {
|
|
11
|
+
sys: DevToolsSys;
|
|
12
|
+
args: InitArgs;
|
|
13
|
+
}): Promise<number>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { DevToolsSys } from "@builder.io/dev-tools/core";
|
|
2
|
+
import type { CLIArgs } from "./index";
|
|
3
|
+
export interface InitArgs extends CLIArgs {
|
|
4
|
+
repoFullName?: string;
|
|
5
|
+
branchName?: string;
|
|
6
|
+
githubToken?: string;
|
|
7
|
+
installCommand?: string;
|
|
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";
|
|
15
|
+
}
|
|
16
|
+
export declare function runLaunchInitCommand({ args, sys, }: {
|
|
17
|
+
sys: DevToolsSys;
|
|
18
|
+
args: InitArgs;
|
|
19
|
+
}): Promise<number>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { DevToolsSys } from "../types";
|
|
2
|
+
import type { CLIArgs } from "./index";
|
|
3
|
+
export interface RepoIndexingDoc {
|
|
4
|
+
name: string;
|
|
5
|
+
content: string | {
|
|
6
|
+
name: string;
|
|
7
|
+
description: string;
|
|
8
|
+
components: string[];
|
|
9
|
+
relevantFiles: string[];
|
|
10
|
+
}[];
|
|
11
|
+
createdDate: string;
|
|
12
|
+
description: string;
|
|
13
|
+
id: string;
|
|
14
|
+
ownerId: string;
|
|
15
|
+
userId: string;
|
|
16
|
+
}
|
|
17
|
+
export declare const runRepoIndexing: (sys: DevToolsSys, args: CLIArgs) => Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const REPO_INDEXING_GROUP_PROMPT: string;
|
|
@@ -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;
|
package/types/common/utils.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export declare function clone<T>(obj: T): T;
|
|
|
19
19
|
export declare function shouldSkipFolder(sys: DevToolsSys, skipFolders: Set<string>, fileName: string): boolean;
|
|
20
20
|
export declare function getPackageManager(): string;
|
|
21
21
|
export declare function isWindows(): boolean;
|
|
22
|
-
export declare function builderNpxPackage(): "\"@builder.io/dev-tools\""
|
|
22
|
+
export declare function builderNpxPackage(): "builder.io" | "\"@builder.io/dev-tools\"";
|
|
23
23
|
/**
|
|
24
24
|
* Sanitizes a component name for use in filesystem paths by replacing invalid characters with underscores
|
|
25
25
|
* @param name The component name to sanitize
|
|
@@ -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>;
|