@builder.io/dev-tools 1.25.0-dev.202602061535.438a13c38 → 1.25.0-dev.202602091025.fe9dae917
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 +18920 -240
- 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 +5 -3
- package/server/index.cjs +19000 -332
- package/server/index.mjs +19001 -331
- package/types/cli/fetch.d.ts +21 -8
- package/types/cli/fetch.test.d.ts +1 -0
- package/types/cli/launch/InitStateMachine.d.ts +90 -156
- package/types/tsconfig.tsbuildinfo +1 -1
- package/vendors/darwin-arm64/complete/rg.bash +783 -0
- package/vendors/darwin-arm64/complete/rg.fish +175 -0
- package/vendors/darwin-arm64/doc/rg.1 +2178 -0
- package/vendors/darwin-arm64/rg +0 -0
- package/vendors/darwin-x64/complete/rg.bash +783 -0
- package/vendors/darwin-x64/complete/rg.fish +175 -0
- package/vendors/darwin-x64/doc/rg.1 +2178 -0
- package/vendors/darwin-x64/rg +0 -0
- package/vendors/linux-arm64/complete/rg.bash +783 -0
- package/vendors/linux-arm64/complete/rg.fish +175 -0
- package/vendors/linux-arm64/doc/rg.1 +2178 -0
- package/vendors/linux-arm64/rg +0 -0
- package/vendors/linux-x64/complete/rg.bash +783 -0
- package/vendors/linux-x64/complete/rg.fish +175 -0
- package/vendors/linux-x64/doc/rg.1 +2178 -0
- package/vendors/linux-x64/rg +0 -0
- package/vendors/win32-x64/rg.exe +0 -0
package/types/cli/fetch.d.ts
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
import { type RequestInit } from "undici";
|
|
1
|
+
import { type RequestInit, Dispatcher } from "undici";
|
|
2
2
|
import { NetworkError } from "../common/errors";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Detect PAC (Proxy Auto-Configuration) URL from macOS system settings
|
|
5
|
+
* Only runs on macOS and caches the result
|
|
6
|
+
*/
|
|
7
|
+
declare function getActiveServicePacUrl(): string | null;
|
|
8
|
+
/**
|
|
9
|
+
* Resolve proxy for a URL using PAC resolver
|
|
10
|
+
* Returns proxy URL string or undefined for direct connection
|
|
11
|
+
*/
|
|
12
|
+
declare function resolveProxyFromPac(url: string): Promise<string | undefined>;
|
|
13
|
+
declare function getAgent(url?: string): Promise<Dispatcher>;
|
|
14
|
+
export declare const safeFetch: (input: string | URL, init?: RequestInit) => ReturnType<typeof globalThis.fetch>;
|
|
7
15
|
/**
|
|
8
16
|
* Checks the health of the Builder.io API by attempting to fetch the health endpoint.
|
|
9
17
|
* Retries up to 3 times with a delay between attempts.
|
|
@@ -11,6 +19,11 @@ export declare const safeFetch: (
|
|
|
11
19
|
* @returns undefined if all attempts fail
|
|
12
20
|
* @throws NetworkError if all retry attempts fail
|
|
13
21
|
*/
|
|
14
|
-
export declare function checkBuilderHealth(
|
|
15
|
-
|
|
16
|
-
|
|
22
|
+
export declare function checkBuilderHealth(delayMs?: number): Promise<NetworkError | undefined>;
|
|
23
|
+
export declare const __testing__: {
|
|
24
|
+
getActiveServicePacUrl: typeof getActiveServicePacUrl;
|
|
25
|
+
resolveProxyFromPac: typeof resolveProxyFromPac;
|
|
26
|
+
getAgent: typeof getAgent;
|
|
27
|
+
resetCache: () => void;
|
|
28
|
+
};
|
|
29
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,166 +1,100 @@
|
|
|
1
1
|
import type { DevToolsSys } from "@builder.io/dev-tools/core";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
type InitState,
|
|
6
|
-
type InitStateStep,
|
|
7
|
-
type InitStatusLog,
|
|
8
|
-
} from "$/ai-utils";
|
|
9
|
-
type ValidatedWorkspaceFolder = WorkspaceFolder &
|
|
10
|
-
Required<Pick<WorkspaceFolder, "name" | "path">>;
|
|
11
|
-
type WorkspaceFolderWithRepoInfo = ValidatedWorkspaceFolder &
|
|
12
|
-
Required<Pick<WorkspaceFolder, "repoName" | "repoUrl">>;
|
|
2
|
+
import { type FusionConfig, type WorkspaceFolder, type InitState, type InitStateStep, type InitStatusLog } from "$/ai-utils";
|
|
3
|
+
type ValidatedWorkspaceFolder = WorkspaceFolder & Required<Pick<WorkspaceFolder, "name" | "path">>;
|
|
4
|
+
type WorkspaceFolderWithRepoInfo = ValidatedWorkspaceFolder & Required<Pick<WorkspaceFolder, "repoName" | "repoUrl">>;
|
|
13
5
|
import type { Credentials } from "../credentials";
|
|
14
6
|
import { type GitBackupDownloadResult } from "../backup";
|
|
15
7
|
export interface InitConfig {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
8
|
+
fusionConfig: FusionConfig;
|
|
9
|
+
credentials: Credentials;
|
|
10
|
+
sys: DevToolsSys;
|
|
11
|
+
debug?: boolean;
|
|
12
|
+
sentryTags?: Record<string, string>;
|
|
21
13
|
}
|
|
22
14
|
export interface InitStatus {
|
|
23
|
-
|
|
24
|
-
|
|
15
|
+
message: string;
|
|
16
|
+
error?: string;
|
|
25
17
|
}
|
|
26
18
|
export declare class InitStateMachine {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
repositories: ValidatedWorkspaceFolder[],
|
|
108
|
-
): Promise<void>;
|
|
109
|
-
step4CollectRepoInfo(
|
|
110
|
-
config: InitConfig,
|
|
111
|
-
volumePath: string,
|
|
112
|
-
repositories: ValidatedWorkspaceFolder[],
|
|
113
|
-
): Promise<void>;
|
|
114
|
-
private isGitConfigured;
|
|
115
|
-
private getGitRemoteUrl;
|
|
116
|
-
private sanitizeGitRemoteUrl;
|
|
117
|
-
/**
|
|
118
|
-
* Check if the repository URL is from a standard git hosting provider
|
|
119
|
-
*/
|
|
120
|
-
private isStandardGitHost;
|
|
121
|
-
/**
|
|
122
|
-
* Check if the repository host is reachable via network
|
|
123
|
-
* Performs DNS resolution and TCP connection check
|
|
124
|
-
*/
|
|
125
|
-
private checkHostConnectivity;
|
|
126
|
-
private checkConnectivityDirect;
|
|
127
|
-
private checkConnectivityViaProxy;
|
|
128
|
-
/**
|
|
129
|
-
* Ensures the parent directory of the given path exists.
|
|
130
|
-
* Handles nested repo.path like "subdir/myproject".
|
|
131
|
-
*/
|
|
132
|
-
private ensureParentDirExists;
|
|
133
|
-
private cleanupLockFiles;
|
|
134
|
-
validateGitRepo(repoPath: string): Promise<void>;
|
|
135
|
-
/**
|
|
136
|
-
* If a backup is available, perform a backup recovery (and throw if it fails and cannot be recovered from).
|
|
137
|
-
* If no backup is available, do nothing.
|
|
138
|
-
*/
|
|
139
|
-
private restoreFromPartialBackup;
|
|
140
|
-
private initializeGitRepo;
|
|
141
|
-
private refreshRepoConfig;
|
|
142
|
-
runInitializationCommand({
|
|
143
|
-
repo,
|
|
144
|
-
tempCloningDir,
|
|
145
|
-
repoPath,
|
|
146
|
-
initCommand,
|
|
147
|
-
}: {
|
|
148
|
-
repo: ValidatedWorkspaceFolder;
|
|
149
|
-
tempCloningDir: string;
|
|
150
|
-
repoPath: string;
|
|
151
|
-
initCommand: string;
|
|
152
|
-
}): Promise<{
|
|
153
|
-
outcome: boolean;
|
|
154
|
-
error?: Error;
|
|
155
|
-
}>;
|
|
156
|
-
cloneRepository({
|
|
157
|
-
repo,
|
|
158
|
-
repoPath,
|
|
159
|
-
backupResult,
|
|
160
|
-
}: {
|
|
161
|
-
repo: WorkspaceFolderWithRepoInfo;
|
|
162
|
-
repoPath: string;
|
|
163
|
-
backupResult: GitBackupDownloadResult | undefined;
|
|
164
|
-
}): Promise<boolean>;
|
|
19
|
+
logIdCounter: number;
|
|
20
|
+
initStatusLogs: InitStatusLog[];
|
|
21
|
+
sys: DevToolsSys;
|
|
22
|
+
config: InitConfig;
|
|
23
|
+
/**
|
|
24
|
+
* @deprecated use addInitLog instead. Do not use this directly.
|
|
25
|
+
*/
|
|
26
|
+
debug: boolean;
|
|
27
|
+
initState: InitState;
|
|
28
|
+
constructor(config: InitConfig);
|
|
29
|
+
checkout(branchName: string, ref: string, repoPath: string): Promise<boolean>;
|
|
30
|
+
execAsync(exec: string, args: string[], cwd?: string, retry?: number): Promise<string>;
|
|
31
|
+
git(args: string[], cwd: string, retry?: number, timeout?: number): Promise<string>;
|
|
32
|
+
performBackup({ sys, credentials, fusionConfig, volumePath, repositories, isConnectedToProvider, forcedFullBackup, }: {
|
|
33
|
+
sys: DevToolsSys;
|
|
34
|
+
credentials: Credentials;
|
|
35
|
+
fusionConfig: FusionConfig;
|
|
36
|
+
volumePath: string;
|
|
37
|
+
repositories: ValidatedWorkspaceFolder[];
|
|
38
|
+
isConnectedToProvider: boolean;
|
|
39
|
+
forcedFullBackup: boolean;
|
|
40
|
+
}): Promise<void>;
|
|
41
|
+
performRegularBackup(args: Omit<Parameters<typeof this.performBackup>[0], "isConnectedToProvider" | "forcedFullBackup">): Promise<void>;
|
|
42
|
+
performOfflineBackup(args: Omit<Parameters<typeof this.performBackup>[0], "isConnectedToProvider" | "forcedFullBackup">): Promise<void>;
|
|
43
|
+
performForcedFullBackup(args: Omit<Parameters<typeof this.performBackup>[0], "isConnectedToProvider" | "forcedFullBackup">): Promise<void>;
|
|
44
|
+
init(): Promise<boolean>;
|
|
45
|
+
addInitLog(type: "status" | "log" | "error" | "complete", message: string, options?: {
|
|
46
|
+
step?: InitStateStep;
|
|
47
|
+
error?: string;
|
|
48
|
+
success?: boolean;
|
|
49
|
+
}): void;
|
|
50
|
+
clearInitLogs(): void;
|
|
51
|
+
hasFilesButNoGit(repoPath: string): Promise<boolean>;
|
|
52
|
+
step1CheckDirectories(volumePath: string, repositories: ValidatedWorkspaceFolder[]): Promise<void>;
|
|
53
|
+
step2ConfigureGitRepositories(volumePath: string, repositories: ValidatedWorkspaceFolder[]): Promise<void>;
|
|
54
|
+
step3ConfigureGitUser(volumePath: string, repositories: ValidatedWorkspaceFolder[]): Promise<void>;
|
|
55
|
+
step4CollectRepoInfo(config: InitConfig, volumePath: string, repositories: ValidatedWorkspaceFolder[]): Promise<void>;
|
|
56
|
+
private isGitConfigured;
|
|
57
|
+
private getGitRemoteUrl;
|
|
58
|
+
private sanitizeGitRemoteUrl;
|
|
59
|
+
/**
|
|
60
|
+
* Check if the repository URL is from a standard git hosting provider
|
|
61
|
+
*/
|
|
62
|
+
private isStandardGitHost;
|
|
63
|
+
/**
|
|
64
|
+
* Check if the repository host is reachable via network
|
|
65
|
+
* Performs DNS resolution and TCP connection check
|
|
66
|
+
*/
|
|
67
|
+
private checkHostConnectivity;
|
|
68
|
+
private checkConnectivityDirect;
|
|
69
|
+
private checkConnectivityViaProxy;
|
|
70
|
+
/**
|
|
71
|
+
* Ensures the parent directory of the given path exists.
|
|
72
|
+
* Handles nested repo.path like "subdir/myproject".
|
|
73
|
+
*/
|
|
74
|
+
private ensureParentDirExists;
|
|
75
|
+
private cleanupLockFiles;
|
|
76
|
+
validateGitRepo(repoPath: string): Promise<void>;
|
|
77
|
+
/**
|
|
78
|
+
* If a backup is available, perform a backup recovery (and throw if it fails and cannot be recovered from).
|
|
79
|
+
* If no backup is available, do nothing.
|
|
80
|
+
*/
|
|
81
|
+
private restoreFromPartialBackup;
|
|
82
|
+
private initializeGitRepo;
|
|
83
|
+
private refreshRepoConfig;
|
|
84
|
+
runInitializationCommand({ repo, tempCloningDir, repoPath, initCommand, }: {
|
|
85
|
+
repo: ValidatedWorkspaceFolder;
|
|
86
|
+
tempCloningDir: string;
|
|
87
|
+
repoPath: string;
|
|
88
|
+
initCommand: string;
|
|
89
|
+
}): Promise<{
|
|
90
|
+
outcome: boolean;
|
|
91
|
+
error?: Error;
|
|
92
|
+
}>;
|
|
93
|
+
cloneRepository({ repo, repoPath, backupResult, }: {
|
|
94
|
+
repo: WorkspaceFolderWithRepoInfo;
|
|
95
|
+
repoPath: string;
|
|
96
|
+
backupResult: GitBackupDownloadResult | undefined;
|
|
97
|
+
}): Promise<boolean>;
|
|
98
|
+
markGitSafe(repoPath: string): Promise<string>;
|
|
165
99
|
}
|
|
166
100
|
export {};
|