@builder.io/dev-tools 1.6.86-dev.202506081826.ef0003060 → 1.6.86-dev.202506090634.ffa10c8b4

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.
@@ -1,5 +1,3 @@
1
- import type { ChildProcessByStdio } from "child_process";
2
- import type { Readable } from "stream";
3
1
  /**
4
2
  * Initialize logging by wrapping all console methods to write to logs file
5
3
  */
@@ -8,10 +6,6 @@ export declare function initializeLogging(): void;
8
6
  * Reset console methods to their original state
9
7
  */
10
8
  export declare function resetLogging(): void;
11
- /**
12
- * Capture and log child process output
13
- */
14
- export declare function setupChildProcessLogging(childProcess: ChildProcessByStdio<null, Readable, Readable>, prefix: string): void;
15
9
  /**
16
10
  * Display intro message with logging
17
11
  */
@@ -0,0 +1,52 @@
1
+ import type { WorkspaceFolder, WorkspaceConfiguration } from "@builder.io/ai-utils";
2
+ import type { DevToolsSys } from "../../types";
3
+ export interface ResolveWorkspacePathOptions {
4
+ filePath: string;
5
+ forceWorkspace?: boolean;
6
+ workspace?: WorkspaceConfiguration;
7
+ workingDirectory: string;
8
+ sys: DevToolsSys;
9
+ canCollapseWorkspace?: boolean;
10
+ }
11
+ export interface ResolveWorkspacePathResult {
12
+ resolvedPath: string;
13
+ workspaceFolder?: WorkspaceFolder;
14
+ }
15
+ /**
16
+ * Resolves a workspace file path to its actual file system path.
17
+ *
18
+ * This function handles various workspace configurations:
19
+ * - Single workspace named "." (treats paths as direct relative paths)
20
+ * - Multiple workspaces (matches path prefixes to workspace names/folder names)
21
+ * - No workspace configuration (falls back to working directory)
22
+ *
23
+ * @param options Configuration object containing all required parameters
24
+ * @param options.filePath A file path that may include a workspace prefix (e.g., "workspace1/path/to/file.js")
25
+ * @param options.forceWorkspace If true, will try the first workspace as fallback when no workspace folder is found
26
+ * @param options.workspace Optional workspace configuration with folders
27
+ * @param options.workingDirectory The base working directory to resolve paths against
28
+ * @param options.sys DevToolsSys object providing path resolution functions
29
+ * @returns Object containing the resolved file system path and matched workspace folder
30
+ *
31
+ * @example
32
+ * ```typescript
33
+ * import { createNodeSys } from '@builder.io/dev-tools/node';
34
+ *
35
+ * const result = resolveWorkspacePath({
36
+ * filePath: 'frontend/src/components/Button.tsx',
37
+ * workingDirectory: '/home/user/project',
38
+ * sys: createNodeSys(),
39
+ * workspace: {
40
+ * folders: [
41
+ * { name: 'frontend', path: './packages/frontend' },
42
+ * { name: 'backend', path: './packages/backend' }
43
+ * ]
44
+ * }
45
+ * });
46
+ * // Returns: {
47
+ * // resolvedPath: '/home/user/project/packages/frontend/src/components/Button.tsx',
48
+ * // workspaceFolder: { name: 'frontend', path: './packages/frontend' }
49
+ * // }
50
+ * ```
51
+ */
52
+ export declare function resolveWorkspacePath(options: ResolveWorkspacePathOptions): ResolveWorkspacePathResult;
@@ -0,0 +1 @@
1
+ export {};
@@ -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): "object" | "string" | "number" | "boolean" | "array";
20
+ export declare function getPrimitiveType(t: string): "string" | "number" | "boolean" | "object" | "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;