uilint-react 0.2.72 → 0.2.73

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/dist/DevTool.d.ts CHANGED
@@ -1,10 +1,24 @@
1
+ /** DevTool operating mode */
2
+ export type DevToolMode = "websocket" | "static";
1
3
  export type DevToolProps = {
4
+ /** Enable/disable the devtool (default: true) */
2
5
  enabled?: boolean;
6
+ /**
7
+ * Operating mode:
8
+ * - "websocket": Connect to local uilint serve (default)
9
+ * - "static": Load issues from pre-built manifest
10
+ */
11
+ mode?: DevToolMode;
12
+ /**
13
+ * URL to the lint manifest (required for mode="static")
14
+ * Example: "/.uilint/manifest.json"
15
+ */
16
+ manifestUrl?: string;
3
17
  };
4
18
  /**
5
19
  * Main devtool React root.
6
20
  *
7
- * Handles WebSocket connection and UI rendering.
21
+ * Handles WebSocket connection (or static manifest loading) and UI rendering.
8
22
  */
9
- export declare function DevTool({ enabled }: DevToolProps): import("react/jsx-runtime").JSX.Element | null;
23
+ export declare function DevTool({ enabled, mode, manifestUrl, }: DevToolProps): import("react/jsx-runtime").JSX.Element | null;
10
24
  //# sourceMappingURL=DevTool.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DevTool.d.ts","sourceRoot":"","sources":["../src/DevTool.tsx"],"names":[],"mappings":"AAiCA,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AASF;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,EAAE,OAAc,EAAE,EAAE,YAAY,kDA0GvD"}
1
+ {"version":3,"file":"DevTool.d.ts","sourceRoot":"","sources":["../src/DevTool.tsx"],"names":[],"mappings":"AAsBA,6BAA6B;AAC7B,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG,QAAQ,CAAC;AAajD,MAAM,MAAM,YAAY,GAAG;IACzB,iDAAiD;IACjD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AASF;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,EACtB,OAAc,EACd,IAAkB,EAClB,WAAW,GACZ,EAAE,YAAY,kDA+Hd"}
@@ -0,0 +1,56 @@
1
+ import { LintManifest } from './manifest-types';
2
+ /**
3
+ * Options for creating a manifest fetcher
4
+ */
5
+ export interface ManifestFetcherOptions {
6
+ /** URL to fetch manifest from */
7
+ manifestUrl: string;
8
+ /** Number of retry attempts on failure (default: 3) */
9
+ retries?: number;
10
+ /** Delay between retries in ms (default: 1000) */
11
+ retryDelay?: number;
12
+ /** Cache TTL in ms (default: 0 = no expiry, fetch once) */
13
+ cacheTtl?: number;
14
+ }
15
+ /**
16
+ * Result of a fetch operation
17
+ */
18
+ export interface FetchResult {
19
+ manifest: LintManifest;
20
+ /** Whether this came from cache */
21
+ cached: boolean;
22
+ /** Timestamp when fetched */
23
+ fetchedAt: number;
24
+ }
25
+ /**
26
+ * Manifest fetcher interface
27
+ */
28
+ export interface ManifestFetcher {
29
+ /** Fetch the manifest (uses cache if available) */
30
+ fetch(): Promise<FetchResult>;
31
+ /** Get cached manifest without fetching */
32
+ getCached(): LintManifest | null;
33
+ /** Invalidate the cache */
34
+ invalidate(): void;
35
+ /** Check if manifest is currently being fetched */
36
+ isFetching(): boolean;
37
+ /** Get the manifest URL */
38
+ getManifestUrl(): string;
39
+ }
40
+ /**
41
+ * Create a manifest fetcher instance
42
+ */
43
+ export declare function createManifestFetcher(options: ManifestFetcherOptions): ManifestFetcher;
44
+ /**
45
+ * Configure the global manifest fetcher for static mode
46
+ */
47
+ export declare function configureManifestFetcher(options: ManifestFetcherOptions): ManifestFetcher;
48
+ /**
49
+ * Get the global manifest fetcher
50
+ */
51
+ export declare function getManifestFetcher(): ManifestFetcher | null;
52
+ /**
53
+ * Clear the global manifest fetcher
54
+ */
55
+ export declare function clearManifestFetcher(): void;
56
+ //# sourceMappingURL=manifest-fetcher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest-fetcher.d.ts","sourceRoot":"","sources":["../../../src/core/services/manifest-fetcher.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,iCAAiC;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,uDAAuD;IACvD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kDAAkD;IAClD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,YAAY,CAAC;IACvB,mCAAmC;IACnC,MAAM,EAAE,OAAO,CAAC;IAChB,6BAA6B;IAC7B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,mDAAmD;IACnD,KAAK,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC;IAC9B,2CAA2C;IAC3C,SAAS,IAAI,YAAY,GAAG,IAAI,CAAC;IACjC,2BAA2B;IAC3B,UAAU,IAAI,IAAI,CAAC;IACnB,mDAAmD;IACnD,UAAU,IAAI,OAAO,CAAC;IACtB,2BAA2B;IAC3B,cAAc,IAAI,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,sBAAsB,GAC9B,eAAe,CA2IjB;AAOD;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,sBAAsB,GAC9B,eAAe,CAGjB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,eAAe,GAAG,IAAI,CAE3D;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAE3C"}
@@ -0,0 +1,102 @@
1
+ /**
2
+ * Lint Manifest Types (Browser)
3
+ *
4
+ * Types for consuming the static lint manifest in the browser.
5
+ * These mirror the types in packages/uilint/src/commands/manifest/types.ts
6
+ */
7
+ /**
8
+ * A single lint issue in the manifest
9
+ */
10
+ export interface ManifestIssue {
11
+ /** Line number (1-indexed) */
12
+ line: number;
13
+ /** Column number (1-indexed, optional) */
14
+ column?: number;
15
+ /** Issue message */
16
+ message: string;
17
+ /** ESLint rule ID (e.g., "uilint/color-consistency") */
18
+ ruleId?: string;
19
+ /** data-loc attribute value (e.g., "app/page.tsx:45:10") */
20
+ dataLoc: string;
21
+ }
22
+ /**
23
+ * Source code snippet for context
24
+ */
25
+ export interface SourceSnippet {
26
+ /** Lines of source code around the issue */
27
+ lines: string[];
28
+ /** Starting line number (1-indexed) */
29
+ startLine: number;
30
+ /** Ending line number (1-indexed) */
31
+ endLine: number;
32
+ }
33
+ /**
34
+ * File entry in the manifest
35
+ */
36
+ export interface ManifestFileEntry {
37
+ /** Relative file path from project root */
38
+ filePath: string;
39
+ /** All issues found in this file */
40
+ issues: ManifestIssue[];
41
+ /** Source snippets for each dataLoc (optional) */
42
+ snippets?: Record<string, SourceSnippet>;
43
+ }
44
+ /**
45
+ * Rule metadata included in manifest
46
+ */
47
+ export interface ManifestRuleMeta {
48
+ /** Rule ID (e.g., "color-consistency") */
49
+ id: string;
50
+ /** Human-readable name */
51
+ name: string;
52
+ /** Rule description */
53
+ description: string;
54
+ /** Category: static (ESLint) or semantic (AI) */
55
+ category: "static" | "semantic";
56
+ /** Default severity */
57
+ defaultSeverity: "error" | "warn" | "off";
58
+ /** Current severity from ESLint config */
59
+ currentSeverity?: "error" | "warn" | "off";
60
+ /** Documentation URL */
61
+ docs?: string;
62
+ }
63
+ /**
64
+ * Summary statistics
65
+ */
66
+ export interface ManifestSummary {
67
+ /** Total number of files scanned */
68
+ filesScanned: number;
69
+ /** Total number of files with issues */
70
+ filesWithIssues: number;
71
+ /** Total number of issues */
72
+ totalIssues: number;
73
+ /** Issues by severity */
74
+ bySeverity: {
75
+ error: number;
76
+ warn: number;
77
+ };
78
+ }
79
+ /**
80
+ * The complete lint manifest
81
+ */
82
+ export interface LintManifest {
83
+ /** Manifest format version */
84
+ version: "1.0";
85
+ /** ISO timestamp when manifest was generated */
86
+ generatedAt: string;
87
+ /** Absolute path to workspace root */
88
+ workspaceRoot: string;
89
+ /** Absolute path to app root (Next.js project) */
90
+ appRoot: string;
91
+ /** Git commit SHA (if available) */
92
+ commitSha?: string;
93
+ /** Git branch name (if available) */
94
+ branch?: string;
95
+ /** All files with lint issues */
96
+ files: ManifestFileEntry[];
97
+ /** Rule metadata for UI display */
98
+ rules: ManifestRuleMeta[];
99
+ /** Summary statistics */
100
+ summary: ManifestSummary;
101
+ }
102
+ //# sourceMappingURL=manifest-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest-types.d.ts","sourceRoot":"","sources":["../../../src/core/services/manifest-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,8BAA8B;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,0CAA0C;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oBAAoB;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,wDAAwD;IACxD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4DAA4D;IAC5D,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,4CAA4C;IAC5C,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,uCAAuC;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,qCAAqC;IACrC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,2CAA2C;IAC3C,QAAQ,EAAE,MAAM,CAAC;IACjB,oCAAoC;IACpC,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,kDAA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OAAO,EAAE,eAAe,CAAC;CAC1B"}
@@ -18,8 +18,21 @@ declare global {
18
18
  | "bottom-left"
19
19
  | "bottom-right"
20
20
  | "top-left"
21
- | "top-right";
21
+ | "top-right"
22
+ | "top-center"
23
+ | "bottom-center";
22
24
  theme?: "light" | "dark" | "system";
25
+ /**
26
+ * Operating mode:
27
+ * - "websocket": Connect to local uilint serve (default)
28
+ * - "static": Load issues from pre-built manifest
29
+ */
30
+ mode?: "websocket" | "static";
31
+ /**
32
+ * URL to the lint manifest (required for mode="static")
33
+ * Example: "/.uilint/manifest.json"
34
+ */
35
+ "manifest-url"?: string;
23
36
  },
24
37
  HTMLElement
25
38
  >;