builder.io 1.17.3 → 1.17.4
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 +526 -525
- 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 +1 -1
- package/server/index.cjs +73 -73
- package/server/index.mjs +73 -73
- package/types/cli/codegen.d.ts +4 -0
- package/types/cli/credentials.d.ts +10 -1
- package/types/cli/utils/env-capture.d.ts +89 -0
- package/types/cli/utils/env-capture.test.d.ts +1 -0
- package/types/cli/utils/process-tracker.d.ts +1 -0
- package/types/tsconfig.tsbuildinfo +1 -1
package/types/cli/codegen.d.ts
CHANGED
|
@@ -78,7 +78,11 @@ export declare class CodeGenSession {
|
|
|
78
78
|
pullLatestFromRemote(): Promise<CodegenApiResult>;
|
|
79
79
|
abortMerge(emitStatus?: boolean): Promise<CodegenApiResult>;
|
|
80
80
|
syncChangesFromRemote(opts?: {
|
|
81
|
+
remoteBranches?: "both" | "main" | "ai";
|
|
81
82
|
fastForward?: "never" | "required" | "auto";
|
|
83
|
+
canPush?: boolean;
|
|
84
|
+
uncommittedChanges?: "stash" | "commit" | "fail";
|
|
85
|
+
allowUnrelatedHistory?: boolean;
|
|
82
86
|
}): Promise<CodegenApiResult>;
|
|
83
87
|
/**
|
|
84
88
|
* Get the current commit hash
|
|
@@ -5,7 +5,16 @@ export interface CredentialsOptions {
|
|
|
5
5
|
forceSpaceId?: string;
|
|
6
6
|
builderPublicKey?: boolean;
|
|
7
7
|
builderPrivateKey?: boolean;
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* `always`: Figma auth will be required even if Figma credentials have already been set.
|
|
10
|
+
* `if-unset`: Figma auth will be required only if Figma credentials have not been set.
|
|
11
|
+
* `undefined` (default): Figma auth will never be required.
|
|
12
|
+
* */
|
|
13
|
+
requireFigmaAuth?: "always" | "if-unset";
|
|
14
|
+
/**
|
|
15
|
+
* If `true`, Builder.io auth will be required even if Builder.io credentials have
|
|
16
|
+
* already been set.
|
|
17
|
+
*/
|
|
9
18
|
force?: boolean;
|
|
10
19
|
}
|
|
11
20
|
export interface FigmaAuth {
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options for capturing environment variables from a setup command
|
|
3
|
+
*/
|
|
4
|
+
export interface EnvCaptureOptions {
|
|
5
|
+
/** The command to wrap with env capture */
|
|
6
|
+
command: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Result of environment capture
|
|
10
|
+
*/
|
|
11
|
+
export interface EnvCaptureResult {
|
|
12
|
+
/** The modified command that includes env capture */
|
|
13
|
+
command: string;
|
|
14
|
+
/** Path to the temporary file where env will be captured */
|
|
15
|
+
envFilePath: string;
|
|
16
|
+
/**
|
|
17
|
+
* Function to get the captured environment variables.
|
|
18
|
+
* This will read, parse, and cleanup the env file in one call.
|
|
19
|
+
* Returns undefined if the env file couldn't be read.
|
|
20
|
+
*/
|
|
21
|
+
getCapturedEnv: () => Promise<Record<string, string> | undefined>;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Wraps a command with environment variable capture at the end.
|
|
25
|
+
* The environment is captured to a temporary file that can be parsed later.
|
|
26
|
+
*
|
|
27
|
+
* @param options - Configuration for env capture
|
|
28
|
+
* @returns The modified command and a function to retrieve the captured env
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```typescript
|
|
32
|
+
* const { command, getCapturedEnv } = wrapCommandWithEnvCapture({
|
|
33
|
+
* command: 'npm install',
|
|
34
|
+
* });
|
|
35
|
+
*
|
|
36
|
+
* // Execute command...
|
|
37
|
+
* // Later, get the captured environment (reads, parses, and cleans up automatically):
|
|
38
|
+
* const env = await getCapturedEnv();
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare function wrapCommandWithEnvCapture(options: EnvCaptureOptions): EnvCaptureResult;
|
|
42
|
+
/**
|
|
43
|
+
* Parses an environment file into a key-value object.
|
|
44
|
+
* Handles multi-line values and empty lines.
|
|
45
|
+
*
|
|
46
|
+
* @param filePath - Path to the environment file
|
|
47
|
+
* @returns A promise that resolves to the parsed environment variables
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```typescript
|
|
51
|
+
* const env = await parseEnvFile('/tmp/env.txt');
|
|
52
|
+
* console.log(env.PATH); // "/usr/bin:/bin"
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export declare function parseEnvFile(filePath: string): Promise<Record<string, string>>;
|
|
56
|
+
/**
|
|
57
|
+
* Parses environment variable content into a key-value object.
|
|
58
|
+
* This is the core parsing logic extracted for easier testing.
|
|
59
|
+
*
|
|
60
|
+
* Environment format is: KEY=VALUE
|
|
61
|
+
* Each line represents one variable.
|
|
62
|
+
*
|
|
63
|
+
* @param content - The raw content from an env file
|
|
64
|
+
* @returns The parsed environment variables
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```typescript
|
|
68
|
+
* const env = parseEnvContent('PATH=/usr/bin\nHOME=/home/user');
|
|
69
|
+
* // { PATH: '/usr/bin', HOME: '/home/user' }
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
export declare function parseEnvContent(content: string): Record<string, string>;
|
|
73
|
+
/**
|
|
74
|
+
* Cleans up the environment capture file.
|
|
75
|
+
* Call this after parsing to remove temporary files.
|
|
76
|
+
*
|
|
77
|
+
* @param filePath - Path to the environment file to clean up
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* ```typescript
|
|
81
|
+
* try {
|
|
82
|
+
* const env = await parseEnvFile(envFilePath);
|
|
83
|
+
* // Use env...
|
|
84
|
+
* } finally {
|
|
85
|
+
* await cleanupEnvFile(envFilePath);
|
|
86
|
+
* }
|
|
87
|
+
* ```
|
|
88
|
+
*/
|
|
89
|
+
export declare function cleanupEnvFile(filePath: string): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -76,6 +76,7 @@ export declare const isMultiLineCommand: (command: string) => boolean;
|
|
|
76
76
|
* Creates a temporary script file for multi-line commands
|
|
77
77
|
*/
|
|
78
78
|
export declare const createTempScript: (command: string, shell: string) => string;
|
|
79
|
+
export declare const getTempScriptPath: (extension: string) => string;
|
|
79
80
|
/**
|
|
80
81
|
* Cleans up a temporary script file
|
|
81
82
|
*/
|