@builder.io/dev-tools 1.18.44-dev.202512111107.bf5b095a5 → 1.18.44-dev.202512111428.dadde891f

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.
@@ -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): "number" | "string" | "boolean" | "object" | "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;
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Component Map Builder
3
+ *
4
+ * Builds a map of component names to their source file locations for the Design tab.
5
+ * This allows the Design tab to work without requiring React's _debugSource or customer plugins.
6
+ */
7
+ import type { DevToolsSys } from "../types";
8
+ export interface ComponentLocation {
9
+ file: string;
10
+ line: number;
11
+ column: number;
12
+ displayName: string;
13
+ }
14
+ export type ComponentMap = Record<string, ComponentLocation[]>;
15
+ /**
16
+ * Build a map of component names to their source locations
17
+ */
18
+ export declare function buildComponentMap(sys: DevToolsSys, rootDir?: string): Promise<ComponentMap>;
19
+ /**
20
+ * Cache for component map with file watching
21
+ */
22
+ export declare class ComponentMapCache {
23
+ private cache;
24
+ private lastBuilt;
25
+ private building;
26
+ private readonly ttl;
27
+ private sys;
28
+ private rootDir;
29
+ constructor(sys: DevToolsSys, rootDir?: string);
30
+ /**
31
+ * Get the component map, building it if necessary
32
+ */
33
+ get(): Promise<ComponentMap>;
34
+ /**
35
+ * Invalidate the cache
36
+ */
37
+ invalidate(): void;
38
+ /**
39
+ * Force rebuild of the component map
40
+ */
41
+ rebuild(): Promise<ComponentMap>;
42
+ }
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Server-side source map resolution using @jridgewell/trace-mapping
3
+ * Fetches bundled files from dev server and resolves to original source locations
4
+ */
5
+ export interface OriginalPosition {
6
+ source: string;
7
+ line: number;
8
+ column: number;
9
+ name?: string;
10
+ }
11
+ /**
12
+ * Resolve a bundled file location to its original source location
13
+ * @param projectRoot Root directory of the project (for file fallback)
14
+ * @param devServerUrl Base URL of the dev server (e.g., http://localhost:3000)
15
+ * @param bundledPath Path to the bundled file (e.g., /_next/static/chunks/app/page.js)
16
+ * @param line Line number in bundled file (1-indexed)
17
+ * @param column Column number in bundled file (0-indexed)
18
+ */
19
+ export declare function resolveSourceLocation(projectRoot: string, devServerUrl: string, bundledPath: string, line: number, column: number): Promise<OriginalPosition | null>;
20
+ /**
21
+ * Batch resolve multiple source locations with deduplication
22
+ */
23
+ export declare function batchResolveSourceLocations(projectRoot: string, devServerUrl: string, locations: Array<{
24
+ bundledPath: string;
25
+ line: number;
26
+ column: number;
27
+ }>): Promise<Array<OriginalPosition | null>>;
28
+ /**
29
+ * Clear the source map cache
30
+ */
31
+ export declare function clearSourceMapCache(): void;