@principal-ade/dynamic-file-tree 0.1.28 → 0.1.30
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/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +467 -1
- package/dist/src/components/TelemetryCoverageFileTree.d.ts +66 -0
- package/dist/src/components/TelemetryCoverageFileTree.d.ts.map +1 -0
- package/dist/src/components/TelemetryCoverageFileTree.stories.d.ts +22 -0
- package/dist/src/components/TelemetryCoverageFileTree.stories.d.ts.map +1 -0
- package/dist/src/components/TelemetryCoverageFileTreeContainer.d.ts +24 -0
- package/dist/src/components/TelemetryCoverageFileTreeContainer.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -17,6 +17,10 @@ export { GitStatusFileTreeContainer } from './src/components/GitStatusFileTreeCo
|
|
|
17
17
|
export type { GitStatusFileTreeContainerProps } from './src/components/GitStatusFileTreeContainer';
|
|
18
18
|
export { MultiFileTree, MultiFileTreeCore } from './src/components/MultiFileTree';
|
|
19
19
|
export type { MultiFileTreeProps, MultiFileTreeCoreProps } from './src/components/MultiFileTree';
|
|
20
|
+
export { TelemetryCoverageFileTree, calculateTelemetryCoverageStats, } from './src/components/TelemetryCoverageFileTree';
|
|
21
|
+
export type { TelemetryCoverageFileTreeProps, FileTelemetryCoverage, TelemetryCoverageStatus, } from './src/components/TelemetryCoverageFileTree';
|
|
22
|
+
export { TelemetryCoverageFileTreeContainer } from './src/components/TelemetryCoverageFileTreeContainer';
|
|
23
|
+
export type { TelemetryCoverageFileTreeContainerProps } from './src/components/TelemetryCoverageFileTreeContainer';
|
|
20
24
|
export { combineRepositoryTrees, filterFileTreeByPaths, parseUnifiedPath, updateTreePaths, extractNameFromPath, } from './src/utils/multiTree';
|
|
21
25
|
export type { CombineTreesOptions, ParsedPath } from './src/utils/multiTree';
|
|
22
26
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.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,EAAE,MAAM,gCAAgC,CAAC;AAClF,YAAY,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAGjG,OAAO,EACL,yBAAyB,EACzB,+BAA+B,GAChC,MAAM,4CAA4C,CAAC;AACpD,YAAY,EACV,8BAA8B,EAC9B,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,4CAA4C,CAAC;AAEpD,OAAO,EAAE,kCAAkC,EAAE,MAAM,qDAAqD,CAAC;AACzG,YAAY,EAAE,uCAAuC,EAAE,MAAM,qDAAqD,CAAC;AAGnH,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,gBAAgB,EAChB,eAAe,EACf,mBAAmB,GACpB,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC"}
|
package/dist/index.mjs
CHANGED
|
@@ -1225,7 +1225,7 @@ var GitStatusFileTree = ({
|
|
|
1225
1225
|
}, /* @__PURE__ */ React7.createElement(GitStatusContext.Provider, {
|
|
1226
1226
|
value: { gitStatusMap, hasChangedChildrenMap }
|
|
1227
1227
|
}, /* @__PURE__ */ React7.createElement(Tree2, {
|
|
1228
|
-
|
|
1228
|
+
data: treeData,
|
|
1229
1229
|
onSelect: handleSelect,
|
|
1230
1230
|
...selectedFile !== undefined && { selection: selectedFile },
|
|
1231
1231
|
...openByDefault !== undefined && { openByDefault },
|
|
@@ -1804,6 +1804,469 @@ var MultiFileTree = ({
|
|
|
1804
1804
|
}
|
|
1805
1805
|
}, "Selected: ", selectedFile.source.name, " / ", selectedFile.path));
|
|
1806
1806
|
};
|
|
1807
|
+
// src/components/TelemetryCoverageFileTree.tsx
|
|
1808
|
+
import {
|
|
1809
|
+
Activity,
|
|
1810
|
+
CircleDot,
|
|
1811
|
+
Circle,
|
|
1812
|
+
TestTube
|
|
1813
|
+
} from "lucide-react";
|
|
1814
|
+
import React11, { useMemo as useMemo9 } from "react";
|
|
1815
|
+
import { Tree as Tree3 } from "react-arborist";
|
|
1816
|
+
var TelemetryCoverageContext = React11.createContext(null);
|
|
1817
|
+
var DEFAULT_TEST_PATTERNS = [
|
|
1818
|
+
/\.test\.[jt]sx?$/,
|
|
1819
|
+
/\.spec\.[jt]sx?$/,
|
|
1820
|
+
/\.tests\.[jt]sx?$/,
|
|
1821
|
+
/\.specs\.[jt]sx?$/,
|
|
1822
|
+
/__tests__\/.*\.[jt]sx?$/
|
|
1823
|
+
];
|
|
1824
|
+
var isTestFile = (filename, patterns) => {
|
|
1825
|
+
return patterns.some((pattern) => pattern.test(filename));
|
|
1826
|
+
};
|
|
1827
|
+
var getCoverageStatusDisplay = (coverage, _theme) => {
|
|
1828
|
+
const { status, tracedTestCount, totalTestCount } = coverage;
|
|
1829
|
+
const percentage = totalTestCount > 0 ? Math.round(tracedTestCount / totalTestCount * 100) : 0;
|
|
1830
|
+
switch (status) {
|
|
1831
|
+
case "covered":
|
|
1832
|
+
return {
|
|
1833
|
+
icon: /* @__PURE__ */ React11.createElement(Activity, {
|
|
1834
|
+
size: 14
|
|
1835
|
+
}),
|
|
1836
|
+
color: "#22c55e",
|
|
1837
|
+
label: `${tracedTestCount}/${totalTestCount} tests traced (${percentage}%)`,
|
|
1838
|
+
badge: `${percentage}%`
|
|
1839
|
+
};
|
|
1840
|
+
case "partial":
|
|
1841
|
+
return {
|
|
1842
|
+
icon: /* @__PURE__ */ React11.createElement(CircleDot, {
|
|
1843
|
+
size: 14
|
|
1844
|
+
}),
|
|
1845
|
+
color: "#eab308",
|
|
1846
|
+
label: `${tracedTestCount}/${totalTestCount} tests traced (${percentage}%)`,
|
|
1847
|
+
badge: `${tracedTestCount}/${totalTestCount}`
|
|
1848
|
+
};
|
|
1849
|
+
case "none":
|
|
1850
|
+
return {
|
|
1851
|
+
icon: /* @__PURE__ */ React11.createElement(Circle, {
|
|
1852
|
+
size: 14
|
|
1853
|
+
}),
|
|
1854
|
+
color: "#6b7280",
|
|
1855
|
+
label: `No tests traced (0/${totalTestCount})`,
|
|
1856
|
+
badge: "0%"
|
|
1857
|
+
};
|
|
1858
|
+
}
|
|
1859
|
+
};
|
|
1860
|
+
var sortNodes2 = (a, b) => {
|
|
1861
|
+
const aIsDir = !!a.children;
|
|
1862
|
+
const bIsDir = !!b.children;
|
|
1863
|
+
if (aIsDir && !bIsDir)
|
|
1864
|
+
return -1;
|
|
1865
|
+
if (!aIsDir && bIsDir)
|
|
1866
|
+
return 1;
|
|
1867
|
+
return a.name.localeCompare(b.name, undefined, { sensitivity: "base" });
|
|
1868
|
+
};
|
|
1869
|
+
var transformTreeStructure2 = (fileTree, showOnlyTestFiles, testPatterns) => {
|
|
1870
|
+
const transformNode = (node, parentId) => {
|
|
1871
|
+
const id = parentId ? `${parentId}/${node.name}` : node.name;
|
|
1872
|
+
if ("children" in node && node.children) {
|
|
1873
|
+
const children = node.children.map((child) => transformNode(child, id)).filter((n) => n !== null).sort(sortNodes2);
|
|
1874
|
+
if (showOnlyTestFiles && children.length === 0) {
|
|
1875
|
+
return null;
|
|
1876
|
+
}
|
|
1877
|
+
return {
|
|
1878
|
+
id,
|
|
1879
|
+
name: node.name,
|
|
1880
|
+
children
|
|
1881
|
+
};
|
|
1882
|
+
} else {
|
|
1883
|
+
const isTest = isTestFile(id, testPatterns);
|
|
1884
|
+
if (showOnlyTestFiles && !isTest) {
|
|
1885
|
+
return null;
|
|
1886
|
+
}
|
|
1887
|
+
return {
|
|
1888
|
+
id,
|
|
1889
|
+
name: node.name,
|
|
1890
|
+
isTestFile: isTest
|
|
1891
|
+
};
|
|
1892
|
+
}
|
|
1893
|
+
};
|
|
1894
|
+
return fileTree.root.children.map((node) => transformNode(node, "")).filter((n) => n !== null).sort(sortNodes2);
|
|
1895
|
+
};
|
|
1896
|
+
var filterCoveredNodes = (nodes, coverageMap) => {
|
|
1897
|
+
const result = [];
|
|
1898
|
+
const hasCoverage = (node) => {
|
|
1899
|
+
if (coverageMap.has(node.id))
|
|
1900
|
+
return true;
|
|
1901
|
+
if (node.children) {
|
|
1902
|
+
return node.children.some((child) => hasCoverage(child));
|
|
1903
|
+
}
|
|
1904
|
+
return false;
|
|
1905
|
+
};
|
|
1906
|
+
for (const node of nodes) {
|
|
1907
|
+
if (node.children) {
|
|
1908
|
+
if (hasCoverage(node)) {
|
|
1909
|
+
const filteredChildren = filterCoveredNodes(node.children, coverageMap);
|
|
1910
|
+
result.push({ ...node, children: filteredChildren });
|
|
1911
|
+
}
|
|
1912
|
+
} else {
|
|
1913
|
+
if (coverageMap.has(node.id)) {
|
|
1914
|
+
result.push(node);
|
|
1915
|
+
}
|
|
1916
|
+
}
|
|
1917
|
+
}
|
|
1918
|
+
return result;
|
|
1919
|
+
};
|
|
1920
|
+
var countVisibleNodes3 = (nodes, openByDefault) => {
|
|
1921
|
+
let count = 0;
|
|
1922
|
+
const countNode = (node) => {
|
|
1923
|
+
count++;
|
|
1924
|
+
if (node.children && node.children.length > 0 && openByDefault) {
|
|
1925
|
+
node.children.forEach(countNode);
|
|
1926
|
+
}
|
|
1927
|
+
};
|
|
1928
|
+
nodes.forEach(countNode);
|
|
1929
|
+
return count;
|
|
1930
|
+
};
|
|
1931
|
+
var TelemetryCoverageFileTree = ({
|
|
1932
|
+
fileTree,
|
|
1933
|
+
theme,
|
|
1934
|
+
coverageData,
|
|
1935
|
+
selectedDirectories: _selectedDirectories = [],
|
|
1936
|
+
selectedFile,
|
|
1937
|
+
onDirectorySelect,
|
|
1938
|
+
onFileSelect,
|
|
1939
|
+
showOnlyTestFiles = true,
|
|
1940
|
+
showUncoveredFiles = true,
|
|
1941
|
+
transparentBackground = false,
|
|
1942
|
+
horizontalNodePadding,
|
|
1943
|
+
onContextMenu,
|
|
1944
|
+
openByDefault = true,
|
|
1945
|
+
initialHeight = 600,
|
|
1946
|
+
autoHeight = false,
|
|
1947
|
+
testFilePatterns = DEFAULT_TEST_PATTERNS
|
|
1948
|
+
}) => {
|
|
1949
|
+
const coverageMap = useMemo9(() => {
|
|
1950
|
+
const map = new Map;
|
|
1951
|
+
coverageData.forEach((item) => {
|
|
1952
|
+
map.set(item.filePath, item);
|
|
1953
|
+
});
|
|
1954
|
+
return map;
|
|
1955
|
+
}, [coverageData]);
|
|
1956
|
+
const NodeRenderer = (props) => {
|
|
1957
|
+
const { node } = props;
|
|
1958
|
+
const ctx = React11.useContext(TelemetryCoverageContext);
|
|
1959
|
+
const coverage = ctx?.coverageMap.get(node.data.id);
|
|
1960
|
+
const hasTracedChildren = ctx?.hasTracedChildrenMap.get(node.data.id);
|
|
1961
|
+
const coverageDisplay = coverage ? getCoverageStatusDisplay(coverage, theme) : null;
|
|
1962
|
+
let nameColor;
|
|
1963
|
+
if (coverageDisplay) {
|
|
1964
|
+
nameColor = coverageDisplay.color;
|
|
1965
|
+
} else if (hasTracedChildren) {
|
|
1966
|
+
nameColor = "#22c55e80";
|
|
1967
|
+
} else if (node.data.isTestFile) {
|
|
1968
|
+
nameColor = "#6b728080";
|
|
1969
|
+
}
|
|
1970
|
+
const leftIcon = node.data.isTestFile && !coverage ? /* @__PURE__ */ React11.createElement(TestTube, {
|
|
1971
|
+
size: 14,
|
|
1972
|
+
style: { marginRight: 4, color: "#6b7280" }
|
|
1973
|
+
}) : null;
|
|
1974
|
+
const rightContent = coverageDisplay ? /* @__PURE__ */ React11.createElement("div", {
|
|
1975
|
+
style: {
|
|
1976
|
+
display: "flex",
|
|
1977
|
+
alignItems: "center",
|
|
1978
|
+
color: coverageDisplay.color,
|
|
1979
|
+
marginRight: "8px"
|
|
1980
|
+
},
|
|
1981
|
+
title: coverageDisplay.label
|
|
1982
|
+
}, coverageDisplay.icon, /* @__PURE__ */ React11.createElement("span", {
|
|
1983
|
+
style: {
|
|
1984
|
+
marginLeft: "4px",
|
|
1985
|
+
fontSize: "11px",
|
|
1986
|
+
fontWeight: "bold",
|
|
1987
|
+
fontFamily: "monospace"
|
|
1988
|
+
}
|
|
1989
|
+
}, coverageDisplay.badge)) : node.data.isTestFile ? /* @__PURE__ */ React11.createElement("div", {
|
|
1990
|
+
style: {
|
|
1991
|
+
display: "flex",
|
|
1992
|
+
alignItems: "center",
|
|
1993
|
+
color: "#6b7280",
|
|
1994
|
+
marginRight: "8px",
|
|
1995
|
+
opacity: 0.5
|
|
1996
|
+
},
|
|
1997
|
+
title: "No telemetry instrumentation"
|
|
1998
|
+
}, /* @__PURE__ */ React11.createElement(Circle, {
|
|
1999
|
+
size: 14
|
|
2000
|
+
})) : null;
|
|
2001
|
+
return /* @__PURE__ */ React11.createElement(TreeNode, {
|
|
2002
|
+
...props,
|
|
2003
|
+
theme,
|
|
2004
|
+
rightContent,
|
|
2005
|
+
extraContent: leftIcon,
|
|
2006
|
+
nameColor,
|
|
2007
|
+
horizontalNodePadding,
|
|
2008
|
+
onContextMenu: (e, node2) => {
|
|
2009
|
+
if (onContextMenu) {
|
|
2010
|
+
onContextMenu(e, node2.data.id, !!node2.data.children);
|
|
2011
|
+
}
|
|
2012
|
+
}
|
|
2013
|
+
});
|
|
2014
|
+
};
|
|
2015
|
+
const treeStructure = useMemo9(() => {
|
|
2016
|
+
return transformTreeStructure2(fileTree, showOnlyTestFiles, testFilePatterns);
|
|
2017
|
+
}, [fileTree, showOnlyTestFiles, testFilePatterns]);
|
|
2018
|
+
const treeData = useMemo9(() => {
|
|
2019
|
+
if (showUncoveredFiles) {
|
|
2020
|
+
return treeStructure;
|
|
2021
|
+
}
|
|
2022
|
+
return filterCoveredNodes(treeStructure, coverageMap);
|
|
2023
|
+
}, [treeStructure, showUncoveredFiles, coverageMap]);
|
|
2024
|
+
const hasTracedChildrenMap = useMemo9(() => {
|
|
2025
|
+
const map = new Map;
|
|
2026
|
+
const markTracedParents = (nodes) => {
|
|
2027
|
+
let hasTraced = false;
|
|
2028
|
+
for (const node of nodes) {
|
|
2029
|
+
if (node.children) {
|
|
2030
|
+
const childrenTraced = markTracedParents(node.children);
|
|
2031
|
+
if (childrenTraced) {
|
|
2032
|
+
map.set(node.id, true);
|
|
2033
|
+
hasTraced = true;
|
|
2034
|
+
}
|
|
2035
|
+
}
|
|
2036
|
+
const coverage = coverageMap.get(node.id);
|
|
2037
|
+
if (coverage && coverage.status !== "none") {
|
|
2038
|
+
hasTraced = true;
|
|
2039
|
+
}
|
|
2040
|
+
}
|
|
2041
|
+
return hasTraced;
|
|
2042
|
+
};
|
|
2043
|
+
markTracedParents(treeData);
|
|
2044
|
+
return map;
|
|
2045
|
+
}, [treeData, coverageMap]);
|
|
2046
|
+
const handleSelect = (selectedNodes) => {
|
|
2047
|
+
const selectedFiles = selectedNodes.filter((node) => !node.data.children).map((node) => node.data.id);
|
|
2048
|
+
const selectedDirs = selectedNodes.filter((node) => node.data.children).map((node) => node.data.id);
|
|
2049
|
+
if (onFileSelect && selectedFiles.length > 0) {
|
|
2050
|
+
onFileSelect(selectedFiles[0]);
|
|
2051
|
+
}
|
|
2052
|
+
if (onDirectorySelect) {
|
|
2053
|
+
onDirectorySelect(selectedDirs);
|
|
2054
|
+
}
|
|
2055
|
+
};
|
|
2056
|
+
const calculatedHeight = useMemo9(() => {
|
|
2057
|
+
if (autoHeight) {
|
|
2058
|
+
const visibleNodeCount = countVisibleNodes3(treeData, openByDefault);
|
|
2059
|
+
return visibleNodeCount * 28;
|
|
2060
|
+
}
|
|
2061
|
+
return initialHeight;
|
|
2062
|
+
}, [autoHeight, treeData, openByDefault, initialHeight]);
|
|
2063
|
+
const [containerRef, containerHeight] = useContainerHeight(calculatedHeight);
|
|
2064
|
+
return /* @__PURE__ */ React11.createElement("div", {
|
|
2065
|
+
ref: containerRef,
|
|
2066
|
+
style: {
|
|
2067
|
+
backgroundColor: transparentBackground ? "transparent" : theme.colors.background,
|
|
2068
|
+
color: theme.colors.text,
|
|
2069
|
+
fontFamily: theme.fonts.body,
|
|
2070
|
+
...autoHeight ? {} : { height: "100%" }
|
|
2071
|
+
}
|
|
2072
|
+
}, /* @__PURE__ */ React11.createElement(TelemetryCoverageContext.Provider, {
|
|
2073
|
+
value: { coverageMap, hasTracedChildrenMap }
|
|
2074
|
+
}, /* @__PURE__ */ React11.createElement(Tree3, {
|
|
2075
|
+
data: treeData,
|
|
2076
|
+
onSelect: handleSelect,
|
|
2077
|
+
...selectedFile !== undefined && { selection: selectedFile },
|
|
2078
|
+
openByDefault,
|
|
2079
|
+
width: "100%",
|
|
2080
|
+
height: containerHeight,
|
|
2081
|
+
rowHeight: 28
|
|
2082
|
+
}, NodeRenderer)));
|
|
2083
|
+
};
|
|
2084
|
+
var calculateTelemetryCoverageStats = (coverageData) => {
|
|
2085
|
+
const testFiles = coverageData.length;
|
|
2086
|
+
const coveredFiles = coverageData.filter((c) => c.status === "covered").length;
|
|
2087
|
+
const partialFiles = coverageData.filter((c) => c.status === "partial").length;
|
|
2088
|
+
const totalTraced = coverageData.reduce((sum, c) => sum + c.tracedTestCount, 0);
|
|
2089
|
+
const totalTests = coverageData.reduce((sum, c) => sum + c.totalTestCount, 0);
|
|
2090
|
+
return {
|
|
2091
|
+
testFiles,
|
|
2092
|
+
coveredFiles,
|
|
2093
|
+
partialFiles,
|
|
2094
|
+
uncoveredFiles: testFiles - coveredFiles - partialFiles,
|
|
2095
|
+
totalTraced,
|
|
2096
|
+
totalTests,
|
|
2097
|
+
percentage: totalTests > 0 ? Math.round(totalTraced / totalTests * 100) : 0
|
|
2098
|
+
};
|
|
2099
|
+
};
|
|
2100
|
+
// src/components/TelemetryCoverageFileTreeContainer.tsx
|
|
2101
|
+
import { RefreshCw as RefreshCw2, Eye as Eye2, EyeOff as EyeOff2, AlertCircle as AlertCircle4, Activity as Activity2 } from "lucide-react";
|
|
2102
|
+
import React12, { useState as useState7, useMemo as useMemo10 } from "react";
|
|
2103
|
+
var TelemetryCoverageFileTreeContainer = ({
|
|
2104
|
+
fileTree,
|
|
2105
|
+
theme,
|
|
2106
|
+
coverageData,
|
|
2107
|
+
selectedFile,
|
|
2108
|
+
onFileSelect,
|
|
2109
|
+
onRefresh,
|
|
2110
|
+
isLoading = false,
|
|
2111
|
+
error = null,
|
|
2112
|
+
showControls = true,
|
|
2113
|
+
onContextMenu,
|
|
2114
|
+
initialHeight,
|
|
2115
|
+
autoHeight,
|
|
2116
|
+
testFilePatterns,
|
|
2117
|
+
title = "Telemetry Coverage"
|
|
2118
|
+
}) => {
|
|
2119
|
+
const [filters, setFilters] = useState7([]);
|
|
2120
|
+
const [showUncoveredFiles, setShowUncoveredFiles] = useState7(true);
|
|
2121
|
+
const selectedDirectories = useMemo10(() => {
|
|
2122
|
+
return filters.filter((f) => f.mode === "include").map((f) => f.path);
|
|
2123
|
+
}, [filters]);
|
|
2124
|
+
const stats = useMemo10(() => calculateTelemetryCoverageStats(coverageData), [coverageData]);
|
|
2125
|
+
const handleRefresh = () => {
|
|
2126
|
+
onRefresh?.();
|
|
2127
|
+
};
|
|
2128
|
+
const toggleShowUncoveredFiles = () => {
|
|
2129
|
+
setShowUncoveredFiles(!showUncoveredFiles);
|
|
2130
|
+
};
|
|
2131
|
+
const percentageColor = stats.percentage >= 80 ? "#22c55e" : stats.percentage >= 50 ? "#eab308" : stats.percentage > 0 ? "#f97316" : "#6b7280";
|
|
2132
|
+
return /* @__PURE__ */ React12.createElement("div", {
|
|
2133
|
+
style: { display: "flex", flexDirection: "column", height: "100%" }
|
|
2134
|
+
}, showControls && /* @__PURE__ */ React12.createElement("div", {
|
|
2135
|
+
style: {
|
|
2136
|
+
padding: "12px",
|
|
2137
|
+
borderBottom: `1px solid ${theme.colors.border || "#e0e0e0"}`,
|
|
2138
|
+
backgroundColor: theme.colors.backgroundSecondary || theme.colors.background
|
|
2139
|
+
}
|
|
2140
|
+
}, /* @__PURE__ */ React12.createElement("div", {
|
|
2141
|
+
style: {
|
|
2142
|
+
display: "flex",
|
|
2143
|
+
alignItems: "center",
|
|
2144
|
+
justifyContent: "space-between",
|
|
2145
|
+
marginBottom: "8px"
|
|
2146
|
+
}
|
|
2147
|
+
}, /* @__PURE__ */ React12.createElement("div", {
|
|
2148
|
+
style: { display: "flex", alignItems: "center", gap: "8px" }
|
|
2149
|
+
}, /* @__PURE__ */ React12.createElement(Activity2, {
|
|
2150
|
+
size: 16,
|
|
2151
|
+
color: theme.colors.primary
|
|
2152
|
+
}), /* @__PURE__ */ React12.createElement("h3", {
|
|
2153
|
+
style: {
|
|
2154
|
+
margin: 0,
|
|
2155
|
+
fontSize: "14px",
|
|
2156
|
+
fontWeight: "bold",
|
|
2157
|
+
color: theme.colors.text
|
|
2158
|
+
}
|
|
2159
|
+
}, title), stats.testFiles > 0 && /* @__PURE__ */ React12.createElement("span", {
|
|
2160
|
+
style: {
|
|
2161
|
+
backgroundColor: percentageColor,
|
|
2162
|
+
color: "#ffffff",
|
|
2163
|
+
padding: "2px 8px",
|
|
2164
|
+
borderRadius: "12px",
|
|
2165
|
+
fontSize: "12px",
|
|
2166
|
+
fontWeight: "bold",
|
|
2167
|
+
fontFamily: "monospace"
|
|
2168
|
+
}
|
|
2169
|
+
}, stats.percentage, "%"), isLoading && /* @__PURE__ */ React12.createElement(RefreshCw2, {
|
|
2170
|
+
size: 16,
|
|
2171
|
+
color: theme.colors.text,
|
|
2172
|
+
className: "telemetry-coverage-spinner",
|
|
2173
|
+
style: { animation: "spin 1s linear infinite" }
|
|
2174
|
+
})), /* @__PURE__ */ React12.createElement("div", {
|
|
2175
|
+
style: { display: "flex", gap: "8px" }
|
|
2176
|
+
}, /* @__PURE__ */ React12.createElement("button", {
|
|
2177
|
+
onClick: toggleShowUncoveredFiles,
|
|
2178
|
+
style: {
|
|
2179
|
+
background: "none",
|
|
2180
|
+
border: `1px solid ${theme.colors.border || "#ccc"}`,
|
|
2181
|
+
borderRadius: "4px",
|
|
2182
|
+
padding: "4px 8px",
|
|
2183
|
+
cursor: "pointer",
|
|
2184
|
+
display: "flex",
|
|
2185
|
+
alignItems: "center",
|
|
2186
|
+
gap: "4px",
|
|
2187
|
+
fontSize: "12px",
|
|
2188
|
+
color: theme.colors.text
|
|
2189
|
+
},
|
|
2190
|
+
title: showUncoveredFiles ? "Show only covered files" : "Show all test files"
|
|
2191
|
+
}, showUncoveredFiles ? /* @__PURE__ */ React12.createElement(EyeOff2, {
|
|
2192
|
+
size: 14
|
|
2193
|
+
}) : /* @__PURE__ */ React12.createElement(Eye2, {
|
|
2194
|
+
size: 14
|
|
2195
|
+
}), showUncoveredFiles ? "Hide uncovered" : "Show all"), onRefresh && /* @__PURE__ */ React12.createElement("button", {
|
|
2196
|
+
onClick: handleRefresh,
|
|
2197
|
+
disabled: isLoading,
|
|
2198
|
+
style: {
|
|
2199
|
+
background: "none",
|
|
2200
|
+
border: `1px solid ${theme.colors.border || "#ccc"}`,
|
|
2201
|
+
borderRadius: "4px",
|
|
2202
|
+
padding: "4px 8px",
|
|
2203
|
+
cursor: isLoading ? "not-allowed" : "pointer",
|
|
2204
|
+
display: "flex",
|
|
2205
|
+
alignItems: "center",
|
|
2206
|
+
gap: "4px",
|
|
2207
|
+
fontSize: "12px",
|
|
2208
|
+
color: theme.colors.text,
|
|
2209
|
+
opacity: isLoading ? 0.6 : 1
|
|
2210
|
+
},
|
|
2211
|
+
title: "Refresh coverage data"
|
|
2212
|
+
}, /* @__PURE__ */ React12.createElement(RefreshCw2, {
|
|
2213
|
+
size: 14
|
|
2214
|
+
}), "Refresh"))), error && /* @__PURE__ */ React12.createElement("div", {
|
|
2215
|
+
style: {
|
|
2216
|
+
display: "flex",
|
|
2217
|
+
alignItems: "center",
|
|
2218
|
+
gap: "8px",
|
|
2219
|
+
padding: "8px",
|
|
2220
|
+
backgroundColor: "#fff3cd",
|
|
2221
|
+
border: "1px solid #ffeaa7",
|
|
2222
|
+
borderRadius: "4px",
|
|
2223
|
+
fontSize: "12px",
|
|
2224
|
+
color: "#856404",
|
|
2225
|
+
marginBottom: "8px"
|
|
2226
|
+
}
|
|
2227
|
+
}, /* @__PURE__ */ React12.createElement(AlertCircle4, {
|
|
2228
|
+
size: 14
|
|
2229
|
+
}), error), !error && stats.testFiles > 0 && /* @__PURE__ */ React12.createElement("div", {
|
|
2230
|
+
style: {
|
|
2231
|
+
display: "flex",
|
|
2232
|
+
gap: "16px",
|
|
2233
|
+
fontSize: "12px",
|
|
2234
|
+
color: theme.colors.textSecondary || "#666"
|
|
2235
|
+
}
|
|
2236
|
+
}, /* @__PURE__ */ React12.createElement("span", null, /* @__PURE__ */ React12.createElement("strong", {
|
|
2237
|
+
style: { color: "#22c55e" }
|
|
2238
|
+
}, stats.coveredFiles), " covered"), stats.partialFiles > 0 && /* @__PURE__ */ React12.createElement("span", null, /* @__PURE__ */ React12.createElement("strong", {
|
|
2239
|
+
style: { color: "#eab308" }
|
|
2240
|
+
}, stats.partialFiles), " partial"), /* @__PURE__ */ React12.createElement("span", null, /* @__PURE__ */ React12.createElement("strong", {
|
|
2241
|
+
style: { color: "#6b7280" }
|
|
2242
|
+
}, stats.uncoveredFiles), " uncovered"), /* @__PURE__ */ React12.createElement("span", {
|
|
2243
|
+
style: { marginLeft: "auto" }
|
|
2244
|
+
}, stats.totalTraced, "/", stats.totalTests, " tests traced")), !error && stats.testFiles === 0 && /* @__PURE__ */ React12.createElement("div", {
|
|
2245
|
+
style: {
|
|
2246
|
+
fontSize: "12px",
|
|
2247
|
+
color: theme.colors.textSecondary || "#666"
|
|
2248
|
+
}
|
|
2249
|
+
}, "No test files with coverage data found")), /* @__PURE__ */ React12.createElement(DirectoryFilterInput, {
|
|
2250
|
+
fileTree,
|
|
2251
|
+
theme,
|
|
2252
|
+
filters,
|
|
2253
|
+
onFiltersChange: setFilters
|
|
2254
|
+
}), /* @__PURE__ */ React12.createElement("div", {
|
|
2255
|
+
style: { flex: 1, marginTop: "1rem", overflow: "hidden" }
|
|
2256
|
+
}, /* @__PURE__ */ React12.createElement(TelemetryCoverageFileTree, {
|
|
2257
|
+
fileTree,
|
|
2258
|
+
theme,
|
|
2259
|
+
coverageData,
|
|
2260
|
+
selectedDirectories,
|
|
2261
|
+
selectedFile,
|
|
2262
|
+
onFileSelect,
|
|
2263
|
+
showUncoveredFiles,
|
|
2264
|
+
onContextMenu,
|
|
2265
|
+
initialHeight,
|
|
2266
|
+
autoHeight,
|
|
2267
|
+
testFilePatterns
|
|
2268
|
+
})));
|
|
2269
|
+
};
|
|
1807
2270
|
export {
|
|
1808
2271
|
useContainerHeight,
|
|
1809
2272
|
updateTreePaths,
|
|
@@ -1811,7 +2274,10 @@ export {
|
|
|
1811
2274
|
filterFileTreeByPaths,
|
|
1812
2275
|
extractNameFromPath,
|
|
1813
2276
|
combineRepositoryTrees,
|
|
2277
|
+
calculateTelemetryCoverageStats,
|
|
1814
2278
|
TreeNode,
|
|
2279
|
+
TelemetryCoverageFileTreeContainer,
|
|
2280
|
+
TelemetryCoverageFileTree,
|
|
1815
2281
|
OrderedFileList,
|
|
1816
2282
|
MultiFileTreeCore,
|
|
1817
2283
|
MultiFileTree,
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { Theme } from '@principal-ade/industry-theme';
|
|
2
|
+
import { FileTree } from '@principal-ai/repository-abstraction';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
/**
|
|
5
|
+
* Telemetry coverage status for a test file
|
|
6
|
+
* - 'covered': All tests in file have telemetry instrumentation
|
|
7
|
+
* - 'partial': Some tests have telemetry
|
|
8
|
+
* - 'none': No tests have telemetry
|
|
9
|
+
*/
|
|
10
|
+
export type TelemetryCoverageStatus = 'covered' | 'partial' | 'none';
|
|
11
|
+
/**
|
|
12
|
+
* Coverage information for a single test file
|
|
13
|
+
*/
|
|
14
|
+
export interface FileTelemetryCoverage {
|
|
15
|
+
/** Path to the test file */
|
|
16
|
+
filePath: string;
|
|
17
|
+
/** Coverage status */
|
|
18
|
+
status: TelemetryCoverageStatus;
|
|
19
|
+
/** Number of tests with telemetry */
|
|
20
|
+
tracedTestCount: number;
|
|
21
|
+
/** Total number of tests in file */
|
|
22
|
+
totalTestCount: number;
|
|
23
|
+
/** List of test names that have telemetry */
|
|
24
|
+
tracedTests?: string[];
|
|
25
|
+
}
|
|
26
|
+
export interface TelemetryCoverageFileTreeProps {
|
|
27
|
+
fileTree: FileTree;
|
|
28
|
+
theme: Theme;
|
|
29
|
+
coverageData: FileTelemetryCoverage[];
|
|
30
|
+
selectedDirectories?: string[];
|
|
31
|
+
selectedFile?: string;
|
|
32
|
+
onDirectorySelect?: (directories: string[]) => void;
|
|
33
|
+
onFileSelect?: (filePath: string) => void;
|
|
34
|
+
/** Show only test files (default: true) */
|
|
35
|
+
showOnlyTestFiles?: boolean;
|
|
36
|
+
/** Show files without coverage (default: true) */
|
|
37
|
+
showUncoveredFiles?: boolean;
|
|
38
|
+
transparentBackground?: boolean;
|
|
39
|
+
horizontalNodePadding?: string;
|
|
40
|
+
onContextMenu?: (event: React.MouseEvent, nodePath: string, isFolder: boolean) => void;
|
|
41
|
+
openByDefault?: boolean;
|
|
42
|
+
initialHeight?: number;
|
|
43
|
+
autoHeight?: boolean;
|
|
44
|
+
/** Test file patterns (default: common test patterns) */
|
|
45
|
+
testFilePatterns?: RegExp[];
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* TelemetryCoverageFileTree Component
|
|
49
|
+
*
|
|
50
|
+
* Displays a file tree showing test files and their telemetry coverage status.
|
|
51
|
+
* Similar to GitStatusFileTree but for OpenTelemetry instrumentation coverage.
|
|
52
|
+
*/
|
|
53
|
+
export declare const TelemetryCoverageFileTree: React.FC<TelemetryCoverageFileTreeProps>;
|
|
54
|
+
/**
|
|
55
|
+
* Export stats calculation for use in containers
|
|
56
|
+
*/
|
|
57
|
+
export declare const calculateTelemetryCoverageStats: (coverageData: FileTelemetryCoverage[]) => {
|
|
58
|
+
testFiles: number;
|
|
59
|
+
coveredFiles: number;
|
|
60
|
+
partialFiles: number;
|
|
61
|
+
uncoveredFiles: number;
|
|
62
|
+
totalTraced: number;
|
|
63
|
+
totalTests: number;
|
|
64
|
+
percentage: number;
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=TelemetryCoverageFileTree.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TelemetryCoverage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EAAE,OAAO,KAAK,IAAI,CAAC;IACvF,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,yDAAyD;IACzD,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC7B;AA6KD;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,EAAE,KAAK,CAAC,EAAE,CAAC,8BAA8B,CA0M9E,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,+BAA+B,GAAI,cAAc,qBAAqB,EAAE;;;;;;;;CAgBpF,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { TelemetryCoverageFileTree } from './TelemetryCoverageFileTree';
|
|
3
|
+
import { TelemetryCoverageFileTreeContainer } from './TelemetryCoverageFileTreeContainer';
|
|
4
|
+
declare const meta: Meta<typeof TelemetryCoverageFileTree>;
|
|
5
|
+
export default meta;
|
|
6
|
+
type Story = StoryObj<typeof TelemetryCoverageFileTree>;
|
|
7
|
+
export declare const Default: Story;
|
|
8
|
+
export declare const OnlyCoveredFiles: Story;
|
|
9
|
+
export declare const AllFilesView: Story;
|
|
10
|
+
export declare const FullCoverage: Story;
|
|
11
|
+
export declare const NoCoverage: Story;
|
|
12
|
+
export declare const EmptyState: Story;
|
|
13
|
+
export declare const RegalTheme: Story;
|
|
14
|
+
export declare const TerminalTheme: Story;
|
|
15
|
+
export declare const MatrixTheme: Story;
|
|
16
|
+
export declare const SlateTheme: Story;
|
|
17
|
+
export declare const WithContainer: StoryObj<typeof TelemetryCoverageFileTreeContainer>;
|
|
18
|
+
export declare const ContainerWithError: StoryObj<typeof TelemetryCoverageFileTreeContainer>;
|
|
19
|
+
export declare const ContainerLoading: StoryObj<typeof TelemetryCoverageFileTreeContainer>;
|
|
20
|
+
export declare const ContainerHighCoverage: StoryObj<typeof TelemetryCoverageFileTreeContainer>;
|
|
21
|
+
export declare const ContainerLowCoverage: StoryObj<typeof TelemetryCoverageFileTreeContainer>;
|
|
22
|
+
//# sourceMappingURL=TelemetryCoverageFileTree.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TelemetryCoverageFileTree.stories.d.ts","sourceRoot":"","sources":["../../../src/components/TelemetryCoverageFileTree.stories.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGvD,OAAO,EACL,yBAAyB,EAE1B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,kCAAkC,EAAE,MAAM,sCAAsC,CAAC;AAoQ1F,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,yBAAyB,CAUhD,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAExD,eAAO,MAAM,OAAO,EAAE,KAQrB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAgB9B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAgB1B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAoB1B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAoBxB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAgBxB,CAAC;AAIF,eAAO,MAAM,UAAU,EAAE,KASxB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAS3B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KASzB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KASxB,CAAC;AAIF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,OAAO,kCAAkC,CAmB7E,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,OAAO,kCAAkC,CAkBlF,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,OAAO,kCAAkC,CAmBhF,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,OAAO,kCAAkC,CAqBrF,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,OAAO,kCAAkC,CAqBpF,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Theme } from '@principal-ade/industry-theme';
|
|
2
|
+
import { FileTree } from '@principal-ai/repository-abstraction';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { FileTelemetryCoverage } from './TelemetryCoverageFileTree';
|
|
5
|
+
export interface TelemetryCoverageFileTreeContainerProps {
|
|
6
|
+
fileTree: FileTree;
|
|
7
|
+
theme: Theme;
|
|
8
|
+
coverageData: FileTelemetryCoverage[];
|
|
9
|
+
selectedFile?: string;
|
|
10
|
+
onFileSelect?: (filePath: string) => void;
|
|
11
|
+
onRefresh?: () => void;
|
|
12
|
+
isLoading?: boolean;
|
|
13
|
+
error?: string | null;
|
|
14
|
+
showControls?: boolean;
|
|
15
|
+
onContextMenu?: (event: React.MouseEvent, nodePath: string, isFolder: boolean) => void;
|
|
16
|
+
initialHeight?: number;
|
|
17
|
+
autoHeight?: boolean;
|
|
18
|
+
/** Custom test file patterns */
|
|
19
|
+
testFilePatterns?: RegExp[];
|
|
20
|
+
/** Title for the header (default: "Telemetry Coverage") */
|
|
21
|
+
title?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare const TelemetryCoverageFileTreeContainer: React.FC<TelemetryCoverageFileTreeContainerProps>;
|
|
24
|
+
//# sourceMappingURL=TelemetryCoverageFileTreeContainer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TelemetryCoverageFileTreeContainer.d.ts","sourceRoot":"","sources":["../../../src/components/TelemetryCoverageFileTreeContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAEhE,OAAO,KAA4B,MAAM,OAAO,CAAC;AAGjD,OAAO,EAEL,qBAAqB,EAEtB,MAAM,6BAA6B,CAAC;AAErC,MAAM,WAAW,uCAAuC;IACtD,QAAQ,EAAE,QAAQ,CAAC;IACnB,KAAK,EAAE,KAAK,CAAC;IACb,YAAY,EAAE,qBAAqB,EAAE,CAAC;IACtC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IACvF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gCAAgC;IAChC,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,2DAA2D;IAC3D,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,kCAAkC,EAAE,KAAK,CAAC,EAAE,CAAC,uCAAuC,CA6NhG,CAAC"}
|
package/package.json
CHANGED