@builder.io/dev-tools 1.17.4-dev.202510291025.824fafb3d → 1.17.5-dev.202510300826.98ea03d41
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 +88 -90
- package/cli/index.cjs.map +3 -3
- 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 +1 -1
- package/server/index.cjs +2 -2
- package/server/index.mjs +2 -2
- package/types/cli/codegen.d.ts +1 -1
- package/types/cli/repo-connect/env-collector.d.ts +27 -0
- package/types/cli/repo-connect/file-collector.d.ts +33 -0
- package/types/cli/repo-connect/git-detector.d.ts +21 -0
- package/types/cli/repo-connect/install-runner.d.ts +10 -0
- package/types/cli/repo-connect/package-detector.d.ts +21 -0
- package/types/cli/repo-connect/repo-connect.d.ts +6 -0
- package/types/cli/utils/env-filter.d.ts +33 -0
- package/types/cli/utils/file-overrides-manager.d.ts +77 -0
- package/types/cli/utils/file-overrides-manager.test.d.ts +1 -0
- package/types/tsconfig.tsbuildinfo +1 -1
package/types/cli/codegen.d.ts
CHANGED
|
@@ -69,7 +69,7 @@ export declare class CodeGenSession {
|
|
|
69
69
|
archiveProject(): Promise<string>;
|
|
70
70
|
isIdle(): boolean;
|
|
71
71
|
needsBackup(): Promise<boolean>;
|
|
72
|
-
uploadBackup(): Promise<BackupGitRepoResult | {
|
|
72
|
+
uploadBackup(forcedFullBackup?: boolean): Promise<BackupGitRepoResult | {
|
|
73
73
|
success: false;
|
|
74
74
|
error: Error;
|
|
75
75
|
}>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { EnvironmentVariable } from "$/ai-utils";
|
|
2
|
+
import type { DevToolsSys } from "../../types";
|
|
3
|
+
interface CategorizedEnvVar {
|
|
4
|
+
key: string;
|
|
5
|
+
value: string;
|
|
6
|
+
category: string;
|
|
7
|
+
isSecret: boolean;
|
|
8
|
+
shouldPreselect: boolean;
|
|
9
|
+
fromDotEnv?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Filter and categorize environment variables
|
|
13
|
+
*/
|
|
14
|
+
export declare function filterAndCategorizeEnvVars(dotEnvVars?: Record<string, string>): CategorizedEnvVar[];
|
|
15
|
+
/**
|
|
16
|
+
* Present multiselect UI for environment variables
|
|
17
|
+
*/
|
|
18
|
+
export declare function selectEnvironmentVariables(sys: DevToolsSys, gitRoot: string): Promise<EnvironmentVariable[] | null>;
|
|
19
|
+
/**
|
|
20
|
+
* Format environment variables summary
|
|
21
|
+
*/
|
|
22
|
+
export declare function formatEnvSummary(envVars: EnvironmentVariable[]): {
|
|
23
|
+
total: number;
|
|
24
|
+
secrets: number;
|
|
25
|
+
public: number;
|
|
26
|
+
};
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { DevToolsSys } from "../../types";
|
|
2
|
+
import type { FileOverride } from "$/ai-utils";
|
|
3
|
+
export interface CollectedFiles {
|
|
4
|
+
projectNpmrc?: {
|
|
5
|
+
path: string;
|
|
6
|
+
content: string;
|
|
7
|
+
};
|
|
8
|
+
userNpmrc?: {
|
|
9
|
+
path: string;
|
|
10
|
+
content: string;
|
|
11
|
+
};
|
|
12
|
+
etcHosts?: {
|
|
13
|
+
path: string;
|
|
14
|
+
content: string;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Collect configuration files from the project and system
|
|
19
|
+
*/
|
|
20
|
+
export declare function collectConfigFiles(sys: DevToolsSys, gitRoot: string): Promise<CollectedFiles>;
|
|
21
|
+
/**
|
|
22
|
+
* Convert collected files to FileOverride array with proper path conventions
|
|
23
|
+
*
|
|
24
|
+
* Path conventions:
|
|
25
|
+
* - ./ prefix = relative to git repository root
|
|
26
|
+
* - ~/ prefix = relative to home directory
|
|
27
|
+
* - absolute paths = only for well-known system files
|
|
28
|
+
*/
|
|
29
|
+
export declare function filesToFileOverrides(collected: CollectedFiles): FileOverride[];
|
|
30
|
+
/**
|
|
31
|
+
* Format collected files summary
|
|
32
|
+
*/
|
|
33
|
+
export declare function formatFilesSummary(collected: CollectedFiles): string[];
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { DevToolsSys } from "../../types";
|
|
2
|
+
export interface GitInfo {
|
|
3
|
+
gitRoot: string;
|
|
4
|
+
recommendedRoot?: string;
|
|
5
|
+
originUrl: string;
|
|
6
|
+
repoProvider: "github" | "gitlab" | "bitbucket" | "azure" | "custom";
|
|
7
|
+
repoProtocol: "https" | "ssh";
|
|
8
|
+
repoFullName: string;
|
|
9
|
+
repoOwner: string;
|
|
10
|
+
repoName: string;
|
|
11
|
+
isPrivate: boolean;
|
|
12
|
+
projectName: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Detect git repository information
|
|
16
|
+
*/
|
|
17
|
+
export declare function detectGitInfo(sys: DevToolsSys): Promise<GitInfo>;
|
|
18
|
+
/**
|
|
19
|
+
* Display git info in a user-friendly format
|
|
20
|
+
*/
|
|
21
|
+
export declare function formatGitInfo(info: GitInfo): string[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface InstallResult {
|
|
2
|
+
success: boolean;
|
|
3
|
+
command: string;
|
|
4
|
+
exitCode?: number;
|
|
5
|
+
skipped: boolean;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Run install command with live output and retry logic
|
|
9
|
+
*/
|
|
10
|
+
export declare function runInstallCommand(cwd: string, initialCommand?: string): Promise<InstallResult>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { SetupMiseDependency } from "$/ai-utils";
|
|
2
|
+
export interface PackageVersions {
|
|
3
|
+
node?: string;
|
|
4
|
+
npm?: string;
|
|
5
|
+
pnpm?: string;
|
|
6
|
+
yarn?: string;
|
|
7
|
+
bun?: string;
|
|
8
|
+
deno?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Detect versions of installed package managers and runtimes
|
|
12
|
+
*/
|
|
13
|
+
export declare function detectPackageVersions(): Promise<PackageVersions>;
|
|
14
|
+
/**
|
|
15
|
+
* Convert package versions to SetupMiseDependency array
|
|
16
|
+
*/
|
|
17
|
+
export declare function packagesToSetupDependencies(versions: PackageVersions): SetupMiseDependency[];
|
|
18
|
+
/**
|
|
19
|
+
* Format package versions for display
|
|
20
|
+
*/
|
|
21
|
+
export declare function formatPackageVersions(versions: PackageVersions): string;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { DevToolsSys } from "@builder.io/dev-tools/core";
|
|
2
|
+
/**
|
|
3
|
+
* Check if an environment variable key should be filtered out
|
|
4
|
+
* @param key - The environment variable key to check
|
|
5
|
+
* @returns true if the variable should be filtered out, false otherwise
|
|
6
|
+
*/
|
|
7
|
+
export declare function shouldFilterEnvVar(key: string): boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Filter out unwanted environment variables from process.env
|
|
10
|
+
* @param env - The environment object to filter (defaults to process.env)
|
|
11
|
+
* @returns Filtered environment variables
|
|
12
|
+
*/
|
|
13
|
+
export declare function filterEnvVars(env?: Record<string, string | undefined>): Record<string, string>;
|
|
14
|
+
/**
|
|
15
|
+
* Load environment variables from .env files in the working directory.
|
|
16
|
+
* Checks multiple .env file variants in order of priority.
|
|
17
|
+
*
|
|
18
|
+
* @param sys - DevToolsSys instance for file system access
|
|
19
|
+
* @param workingDirectory - Directory to look for .env files (defaults to cwd)
|
|
20
|
+
* @param envFiles - Array of .env file names to check (defaults to standard .env files)
|
|
21
|
+
* @returns Object containing environment variables from .env files
|
|
22
|
+
*/
|
|
23
|
+
export declare function loadDotEnvVars(sys: DevToolsSys, workingDirectory?: string, envFiles?: string[]): Promise<Record<string, string>>;
|
|
24
|
+
/**
|
|
25
|
+
* Get a combined environment object with:
|
|
26
|
+
* 1. Filtered process.env (excluding npm_*, IDE variables, etc.)
|
|
27
|
+
* 2. .env file variables (highest priority)
|
|
28
|
+
*
|
|
29
|
+
* @param sys - DevToolsSys instance
|
|
30
|
+
* @param workingDirectory - Directory to look for .env files
|
|
31
|
+
* @returns Combined and filtered environment variables
|
|
32
|
+
*/
|
|
33
|
+
export declare function getFilteredEnvWithDotEnv(sys: DevToolsSys, workingDirectory?: string): Promise<Record<string, string>>;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
export interface FileOverride {
|
|
2
|
+
/**
|
|
3
|
+
* Path where the file should be written.
|
|
4
|
+
* - Absolute paths: "/app/.env", "/etc/config/app.conf"
|
|
5
|
+
* - Tilde expansion: "~/.config/app.json" (expands to home directory)
|
|
6
|
+
* - Relative paths: "./file.txt", "config.json" (resolved against working directory)
|
|
7
|
+
*/
|
|
8
|
+
path: string;
|
|
9
|
+
/**
|
|
10
|
+
* Content to write to the file.
|
|
11
|
+
*/
|
|
12
|
+
content: string;
|
|
13
|
+
}
|
|
14
|
+
export interface SentryLike {
|
|
15
|
+
captureException: (error: unknown) => void;
|
|
16
|
+
}
|
|
17
|
+
export interface ApplyFileOverridesResult {
|
|
18
|
+
success: boolean;
|
|
19
|
+
appliedFiles: string[];
|
|
20
|
+
failedFiles: Array<{
|
|
21
|
+
path: string;
|
|
22
|
+
error: string;
|
|
23
|
+
}>;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Expand tilde (~) in file path to home directory
|
|
27
|
+
* @param filePath - The file path that may contain tilde
|
|
28
|
+
* @returns Expanded path with home directory
|
|
29
|
+
*/
|
|
30
|
+
export declare function expandTildePath(filePath: string): string;
|
|
31
|
+
/**
|
|
32
|
+
* Resolve a file path to an absolute path.
|
|
33
|
+
* Handles tilde expansion, relative paths, and absolute paths.
|
|
34
|
+
* @param filePath - The file path to resolve
|
|
35
|
+
* @param workingDirectory - Optional working directory for resolving relative paths
|
|
36
|
+
* @returns Resolved absolute path
|
|
37
|
+
*/
|
|
38
|
+
export declare function resolveFilePath(filePath: string, workingDirectory?: string): string;
|
|
39
|
+
/**
|
|
40
|
+
* Validate that a file path can be resolved to an absolute path
|
|
41
|
+
* Supports tilde (~) expansion and relative paths (when workingDirectory is provided)
|
|
42
|
+
* @param filePath - The file path to validate
|
|
43
|
+
* @param workingDirectory - Optional working directory for resolving relative paths
|
|
44
|
+
* @returns true if valid, false otherwise
|
|
45
|
+
*/
|
|
46
|
+
export declare function isValidFilePath(filePath: string, workingDirectory?: string): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Apply multiple file overrides to the filesystem.
|
|
49
|
+
* This function will:
|
|
50
|
+
* 1. Validate each file path
|
|
51
|
+
* 2. Resolve relative paths against working directory
|
|
52
|
+
* 3. Create directories as needed
|
|
53
|
+
* 4. Write files with the provided content
|
|
54
|
+
* 5. Return detailed results for success/failure of each file
|
|
55
|
+
*
|
|
56
|
+
* @param overrides - Array of file overrides to apply
|
|
57
|
+
* @param workingDirectory - Optional working directory for resolving relative paths
|
|
58
|
+
* @param sentry - Optional Sentry instance for error logging
|
|
59
|
+
* @returns Object with overall success status and details for each file
|
|
60
|
+
*/
|
|
61
|
+
export declare function applyFileOverrides(overrides: FileOverride[], workingDirectory?: string, sentry?: SentryLike): ApplyFileOverridesResult;
|
|
62
|
+
/**
|
|
63
|
+
* Read a file and return its content
|
|
64
|
+
* Supports tilde (~) expansion and relative paths.
|
|
65
|
+
* @param filePath - The path to the file to read
|
|
66
|
+
* @param workingDirectory - Optional working directory for resolving relative paths
|
|
67
|
+
* @returns The file content or null if it cannot be read
|
|
68
|
+
*/
|
|
69
|
+
export declare function readFileOverride(filePath: string, workingDirectory?: string): string | null;
|
|
70
|
+
/**
|
|
71
|
+
* Check if a file exists at the given path
|
|
72
|
+
* Supports tilde (~) expansion and relative paths.
|
|
73
|
+
* @param filePath - The path to check
|
|
74
|
+
* @param workingDirectory - Optional working directory for resolving relative paths
|
|
75
|
+
* @returns true if the file exists, false otherwise
|
|
76
|
+
*/
|
|
77
|
+
export declare function fileOverrideExists(filePath: string, workingDirectory?: string): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|