@scrymore/scry-sbcov 0.2.0
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/README.md +410 -0
- package/bin/scry-sbcov.js +3 -0
- package/dist/analyzers/git-analyzer.d.ts +49 -0
- package/dist/analyzers/git-analyzer.d.ts.map +1 -0
- package/dist/analyzers/git-analyzer.js +265 -0
- package/dist/analyzers/git-analyzer.js.map +1 -0
- package/dist/cli/config.d.ts +12 -0
- package/dist/cli/config.d.ts.map +1 -0
- package/dist/cli/config.js +197 -0
- package/dist/cli/config.js.map +1 -0
- package/dist/cli/index.d.ts +7 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +164 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/core/analyzer.d.ts +19 -0
- package/dist/core/analyzer.d.ts.map +1 -0
- package/dist/core/analyzer.js +117 -0
- package/dist/core/analyzer.js.map +1 -0
- package/dist/core/coverage-calculator.d.ts +38 -0
- package/dist/core/coverage-calculator.d.ts.map +1 -0
- package/dist/core/coverage-calculator.js +335 -0
- package/dist/core/coverage-calculator.js.map +1 -0
- package/dist/core/report-generator.d.ts +10 -0
- package/dist/core/report-generator.d.ts.map +1 -0
- package/dist/core/report-generator.js +477 -0
- package/dist/core/report-generator.js.map +1 -0
- package/dist/core/story-executor.d.ts +22 -0
- package/dist/core/story-executor.d.ts.map +1 -0
- package/dist/core/story-executor.js +379 -0
- package/dist/core/story-executor.js.map +1 -0
- package/dist/detectors/component-detector.d.ts +15 -0
- package/dist/detectors/component-detector.d.ts.map +1 -0
- package/dist/detectors/component-detector.js +632 -0
- package/dist/detectors/component-detector.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/parsers/story-parser.d.ts +18 -0
- package/dist/parsers/story-parser.d.ts.map +1 -0
- package/dist/parsers/story-parser.js +353 -0
- package/dist/parsers/story-parser.js.map +1 -0
- package/dist/types/index.d.ts +502 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +6 -0
- package/dist/types/index.js.map +1 -0
- package/package.json +79 -0
|
@@ -0,0 +1,632 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Component Detector
|
|
3
|
+
* Finds React components and extracts their prop interfaces using TypeScript AST analysis
|
|
4
|
+
*/
|
|
5
|
+
import { Project, Node } from 'ts-morph';
|
|
6
|
+
import * as path from 'node:path';
|
|
7
|
+
import * as fs from 'node:fs';
|
|
8
|
+
import { glob } from 'glob';
|
|
9
|
+
// Patterns for detecting state-related props
|
|
10
|
+
const SCENARIO_PATTERNS = {
|
|
11
|
+
isLoading: { name: 'Loading State', priority: 'high' },
|
|
12
|
+
loading: { name: 'Loading State', priority: 'high' },
|
|
13
|
+
isProcessing: { name: 'Processing State', priority: 'high' },
|
|
14
|
+
pending: { name: 'Pending State', priority: 'medium' },
|
|
15
|
+
isFetching: { name: 'Fetching State', priority: 'high' },
|
|
16
|
+
isError: { name: 'Error State', priority: 'high' },
|
|
17
|
+
hasError: { name: 'Error State', priority: 'high' },
|
|
18
|
+
error: { name: 'Error State', priority: 'high' },
|
|
19
|
+
errorMessage: { name: 'Error State', priority: 'high' },
|
|
20
|
+
isInvalid: { name: 'Invalid State', priority: 'high' },
|
|
21
|
+
isEmpty: { name: 'Empty State', priority: 'medium' },
|
|
22
|
+
empty: { name: 'Empty State', priority: 'medium' },
|
|
23
|
+
noData: { name: 'Empty State', priority: 'medium' },
|
|
24
|
+
hasData: { name: 'Data State', priority: 'medium' },
|
|
25
|
+
disabled: { name: 'Disabled State', priority: 'high' },
|
|
26
|
+
isDisabled: { name: 'Disabled State', priority: 'high' },
|
|
27
|
+
isOpen: { name: 'Open State', priority: 'medium' },
|
|
28
|
+
open: { name: 'Open State', priority: 'medium' },
|
|
29
|
+
expanded: { name: 'Expanded State', priority: 'medium' },
|
|
30
|
+
isExpanded: { name: 'Expanded State', priority: 'medium' },
|
|
31
|
+
isVisible: { name: 'Visible State', priority: 'medium' },
|
|
32
|
+
visible: { name: 'Visible State', priority: 'medium' },
|
|
33
|
+
hidden: { name: 'Hidden State', priority: 'medium' },
|
|
34
|
+
isHidden: { name: 'Hidden State', priority: 'medium' },
|
|
35
|
+
isSelected: { name: 'Selected State', priority: 'medium' },
|
|
36
|
+
selected: { name: 'Selected State', priority: 'medium' },
|
|
37
|
+
checked: { name: 'Checked State', priority: 'medium' },
|
|
38
|
+
isChecked: { name: 'Checked State', priority: 'medium' },
|
|
39
|
+
isActive: { name: 'Active State', priority: 'medium' },
|
|
40
|
+
active: { name: 'Active State', priority: 'medium' },
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Detect React components in the project
|
|
44
|
+
*/
|
|
45
|
+
export async function detectComponents(projectPath, config, verbose = false) {
|
|
46
|
+
const components = [];
|
|
47
|
+
// Find all matching files
|
|
48
|
+
const files = await findComponentFiles(projectPath, config.include, config.exclude);
|
|
49
|
+
if (verbose) {
|
|
50
|
+
console.log(`Found ${files.length} potential component files`);
|
|
51
|
+
}
|
|
52
|
+
// Initialize ts-morph project
|
|
53
|
+
const project = new Project({
|
|
54
|
+
tsConfigFilePath: findTsConfig(projectPath),
|
|
55
|
+
skipAddingFilesFromTsConfig: true,
|
|
56
|
+
});
|
|
57
|
+
// Add source files
|
|
58
|
+
for (const file of files) {
|
|
59
|
+
project.addSourceFileAtPath(file);
|
|
60
|
+
}
|
|
61
|
+
// Analyze each file
|
|
62
|
+
for (const file of files) {
|
|
63
|
+
const sourceFile = project.getSourceFile(file);
|
|
64
|
+
if (!sourceFile)
|
|
65
|
+
continue;
|
|
66
|
+
const fileComponents = analyzeSourceFile(sourceFile, projectPath, verbose);
|
|
67
|
+
components.push(...fileComponents);
|
|
68
|
+
}
|
|
69
|
+
if (verbose) {
|
|
70
|
+
console.log(`Detected ${components.length} React components`);
|
|
71
|
+
}
|
|
72
|
+
return components;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Find component files matching patterns
|
|
76
|
+
*/
|
|
77
|
+
async function findComponentFiles(projectPath, includePatterns, excludePatterns) {
|
|
78
|
+
const allFiles = [];
|
|
79
|
+
for (const pattern of includePatterns) {
|
|
80
|
+
const matches = await glob(pattern, {
|
|
81
|
+
cwd: projectPath,
|
|
82
|
+
absolute: true,
|
|
83
|
+
ignore: excludePatterns,
|
|
84
|
+
});
|
|
85
|
+
allFiles.push(...matches);
|
|
86
|
+
}
|
|
87
|
+
// Deduplicate
|
|
88
|
+
return [...new Set(allFiles)];
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Find tsconfig.json
|
|
92
|
+
*/
|
|
93
|
+
function findTsConfig(projectPath) {
|
|
94
|
+
const candidates = ['tsconfig.json', 'tsconfig.app.json', 'tsconfig.base.json'];
|
|
95
|
+
for (const candidate of candidates) {
|
|
96
|
+
const fullPath = path.join(projectPath, candidate);
|
|
97
|
+
try {
|
|
98
|
+
fs.accessSync(fullPath);
|
|
99
|
+
return fullPath;
|
|
100
|
+
}
|
|
101
|
+
catch {
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return undefined;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Analyze a source file for React components
|
|
109
|
+
*/
|
|
110
|
+
function analyzeSourceFile(sourceFile, projectPath, _verbose) {
|
|
111
|
+
const components = [];
|
|
112
|
+
const filePath = sourceFile.getFilePath();
|
|
113
|
+
const relativePath = path.relative(projectPath, filePath);
|
|
114
|
+
// Find function declarations that could be components
|
|
115
|
+
for (const func of sourceFile.getFunctions()) {
|
|
116
|
+
const component = analyzeFunctionComponent(func, filePath, relativePath);
|
|
117
|
+
if (component) {
|
|
118
|
+
components.push(component);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
// Find variable declarations (arrow functions, forwardRef, memo)
|
|
122
|
+
for (const variable of sourceFile.getVariableDeclarations()) {
|
|
123
|
+
const component = analyzeVariableComponent(variable, filePath, relativePath);
|
|
124
|
+
if (component) {
|
|
125
|
+
components.push(component);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
// Find class components
|
|
129
|
+
for (const classDecl of sourceFile.getClasses()) {
|
|
130
|
+
const component = analyzeClassComponent(classDecl, filePath, relativePath);
|
|
131
|
+
if (component) {
|
|
132
|
+
components.push(component);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return components;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Analyze a function declaration for React component patterns
|
|
139
|
+
*/
|
|
140
|
+
function analyzeFunctionComponent(func, filePath, relativePath) {
|
|
141
|
+
const name = func.getName();
|
|
142
|
+
if (!name || !isComponentName(name))
|
|
143
|
+
return null;
|
|
144
|
+
const returnType = func.getReturnType();
|
|
145
|
+
const returnTypeText = returnType.getText();
|
|
146
|
+
// Check return type first, but also fall back to checking for JSX in body
|
|
147
|
+
// when type inference fails (returns 'any' without React types)
|
|
148
|
+
if (!isReactReturnType(returnType)) {
|
|
149
|
+
// If return type is 'any' or unknown, check if function body contains JSX
|
|
150
|
+
if (returnTypeText !== 'any' && returnTypeText !== 'unknown') {
|
|
151
|
+
return null;
|
|
152
|
+
}
|
|
153
|
+
const body = func.getBody();
|
|
154
|
+
if (!body || !containsJsx(body)) {
|
|
155
|
+
return null;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
const props = extractPropsFromFunction(func);
|
|
159
|
+
const scenarios = detectScenarios(props);
|
|
160
|
+
const exportType = func.isExported() ? (func.isDefaultExport() ? 'default' : 'named') : 'named';
|
|
161
|
+
return {
|
|
162
|
+
filePath,
|
|
163
|
+
relativePath,
|
|
164
|
+
componentName: name,
|
|
165
|
+
componentType: 'function',
|
|
166
|
+
exportType,
|
|
167
|
+
props,
|
|
168
|
+
scenarios,
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Analyze a variable declaration for React component patterns
|
|
173
|
+
*/
|
|
174
|
+
function analyzeVariableComponent(variable, filePath, relativePath) {
|
|
175
|
+
const name = variable.getName();
|
|
176
|
+
if (!isComponentName(name))
|
|
177
|
+
return null;
|
|
178
|
+
const initializer = variable.getInitializer();
|
|
179
|
+
if (!initializer)
|
|
180
|
+
return null;
|
|
181
|
+
// Check for forwardRef
|
|
182
|
+
if (Node.isCallExpression(initializer)) {
|
|
183
|
+
const expression = initializer.getExpression();
|
|
184
|
+
const expressionText = expression.getText();
|
|
185
|
+
if (expressionText.includes('forwardRef')) {
|
|
186
|
+
return analyzeForwardRefComponent(variable, initializer, filePath, relativePath);
|
|
187
|
+
}
|
|
188
|
+
if (expressionText.includes('memo')) {
|
|
189
|
+
return analyzeMemoComponent(variable, initializer, filePath, relativePath);
|
|
190
|
+
}
|
|
191
|
+
// Could be an HOC
|
|
192
|
+
if (isComponentName(expressionText.split('(')[0]) || expressionText.startsWith('with')) {
|
|
193
|
+
return analyzeHocComponent(variable, initializer, filePath, relativePath);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
// Check for arrow function
|
|
197
|
+
if (Node.isArrowFunction(initializer)) {
|
|
198
|
+
return analyzeArrowFunctionComponent(variable, initializer, filePath, relativePath);
|
|
199
|
+
}
|
|
200
|
+
return null;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Analyze forwardRef component
|
|
204
|
+
*/
|
|
205
|
+
function analyzeForwardRefComponent(variable, call, filePath, relativePath) {
|
|
206
|
+
const name = variable.getName();
|
|
207
|
+
if (!Node.isCallExpression(call))
|
|
208
|
+
return null;
|
|
209
|
+
const args = call.getArguments();
|
|
210
|
+
if (args.length === 0)
|
|
211
|
+
return null;
|
|
212
|
+
const callback = args[0];
|
|
213
|
+
let props = [];
|
|
214
|
+
if (Node.isArrowFunction(callback) || Node.isFunctionExpression(callback)) {
|
|
215
|
+
props = extractPropsFromArrowFunction(callback);
|
|
216
|
+
}
|
|
217
|
+
const scenarios = detectScenarios(props);
|
|
218
|
+
const exportType = variable.isExported() ? 'named' : 'named';
|
|
219
|
+
return {
|
|
220
|
+
filePath,
|
|
221
|
+
relativePath,
|
|
222
|
+
componentName: name,
|
|
223
|
+
componentType: 'forwardRef',
|
|
224
|
+
exportType,
|
|
225
|
+
props,
|
|
226
|
+
scenarios,
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Analyze memo component
|
|
231
|
+
*/
|
|
232
|
+
function analyzeMemoComponent(variable, call, filePath, relativePath) {
|
|
233
|
+
const name = variable.getName();
|
|
234
|
+
if (!Node.isCallExpression(call))
|
|
235
|
+
return null;
|
|
236
|
+
const args = call.getArguments();
|
|
237
|
+
if (args.length === 0)
|
|
238
|
+
return null;
|
|
239
|
+
const callback = args[0];
|
|
240
|
+
let props = [];
|
|
241
|
+
if (Node.isArrowFunction(callback) || Node.isFunctionExpression(callback)) {
|
|
242
|
+
props = extractPropsFromArrowFunction(callback);
|
|
243
|
+
}
|
|
244
|
+
else if (Node.isFunctionDeclaration(callback)) {
|
|
245
|
+
props = extractPropsFromFunction(callback);
|
|
246
|
+
}
|
|
247
|
+
const scenarios = detectScenarios(props);
|
|
248
|
+
return {
|
|
249
|
+
filePath,
|
|
250
|
+
relativePath,
|
|
251
|
+
componentName: name,
|
|
252
|
+
componentType: 'memo',
|
|
253
|
+
exportType: 'named',
|
|
254
|
+
props,
|
|
255
|
+
scenarios,
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Analyze HOC-wrapped component
|
|
260
|
+
*/
|
|
261
|
+
function analyzeHocComponent(variable, _call, filePath, relativePath) {
|
|
262
|
+
const name = variable.getName();
|
|
263
|
+
// HOCs are complex to analyze, return basic info
|
|
264
|
+
return {
|
|
265
|
+
filePath,
|
|
266
|
+
relativePath,
|
|
267
|
+
componentName: name,
|
|
268
|
+
componentType: 'hoc',
|
|
269
|
+
exportType: 'named',
|
|
270
|
+
props: [],
|
|
271
|
+
scenarios: [],
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Analyze arrow function component
|
|
276
|
+
*/
|
|
277
|
+
function analyzeArrowFunctionComponent(variable, arrow, filePath, relativePath) {
|
|
278
|
+
const name = variable.getName();
|
|
279
|
+
// Check return type
|
|
280
|
+
const returnType = arrow.getReturnType();
|
|
281
|
+
if (!isReactReturnType(returnType)) {
|
|
282
|
+
// Also check if body contains JSX
|
|
283
|
+
const body = arrow.getBody();
|
|
284
|
+
if (!containsJsx(body))
|
|
285
|
+
return null;
|
|
286
|
+
}
|
|
287
|
+
const props = extractPropsFromArrowFunction(arrow);
|
|
288
|
+
const scenarios = detectScenarios(props);
|
|
289
|
+
return {
|
|
290
|
+
filePath,
|
|
291
|
+
relativePath,
|
|
292
|
+
componentName: name,
|
|
293
|
+
componentType: 'function',
|
|
294
|
+
exportType: 'named',
|
|
295
|
+
props,
|
|
296
|
+
scenarios,
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* Analyze class component
|
|
301
|
+
*/
|
|
302
|
+
function analyzeClassComponent(classDecl, filePath, relativePath) {
|
|
303
|
+
const name = classDecl.getName();
|
|
304
|
+
if (!name || !isComponentName(name))
|
|
305
|
+
return null;
|
|
306
|
+
// Check if extends React.Component or Component
|
|
307
|
+
const extendsClause = classDecl.getExtends();
|
|
308
|
+
if (!extendsClause)
|
|
309
|
+
return null;
|
|
310
|
+
const baseClassName = extendsClause.getText();
|
|
311
|
+
if (!baseClassName.includes('Component') && !baseClassName.includes('PureComponent')) {
|
|
312
|
+
return null;
|
|
313
|
+
}
|
|
314
|
+
const props = extractPropsFromClass(classDecl);
|
|
315
|
+
const scenarios = detectScenarios(props);
|
|
316
|
+
return {
|
|
317
|
+
filePath,
|
|
318
|
+
relativePath,
|
|
319
|
+
componentName: name,
|
|
320
|
+
componentType: 'class',
|
|
321
|
+
exportType: classDecl.isDefaultExport() ? 'default' : 'named',
|
|
322
|
+
props,
|
|
323
|
+
scenarios,
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Check if a name follows component naming convention (PascalCase)
|
|
328
|
+
*/
|
|
329
|
+
function isComponentName(name) {
|
|
330
|
+
return /^[A-Z][a-zA-Z0-9]*$/.test(name);
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Check if a type is a React return type
|
|
334
|
+
*/
|
|
335
|
+
function isReactReturnType(type) {
|
|
336
|
+
const typeText = type.getText();
|
|
337
|
+
return (typeText.includes('JSX.Element') ||
|
|
338
|
+
typeText.includes('ReactElement') ||
|
|
339
|
+
typeText.includes('ReactNode') ||
|
|
340
|
+
typeText === 'Element' ||
|
|
341
|
+
typeText.includes('FC<') ||
|
|
342
|
+
typeText.includes('FunctionComponent<') ||
|
|
343
|
+
typeText === 'null' ||
|
|
344
|
+
typeText.includes('| null') ||
|
|
345
|
+
typeText.includes('| undefined'));
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* Check if a node contains JSX
|
|
349
|
+
*/
|
|
350
|
+
function containsJsx(node) {
|
|
351
|
+
const text = node.getText();
|
|
352
|
+
return text.includes('<') && (text.includes('/>') || text.includes('</'));
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* Extract props from a function declaration
|
|
356
|
+
*/
|
|
357
|
+
function extractPropsFromFunction(func) {
|
|
358
|
+
const params = func.getParameters();
|
|
359
|
+
if (params.length === 0)
|
|
360
|
+
return [];
|
|
361
|
+
const propsParam = params[0];
|
|
362
|
+
return extractPropsFromParameter(propsParam);
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Extract props from an arrow function
|
|
366
|
+
*/
|
|
367
|
+
function extractPropsFromArrowFunction(arrow) {
|
|
368
|
+
const params = arrow.getParameters();
|
|
369
|
+
if (params.length === 0)
|
|
370
|
+
return [];
|
|
371
|
+
const propsParam = params[0];
|
|
372
|
+
return extractPropsFromParameter(propsParam);
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* Extract props from a parameter
|
|
376
|
+
*/
|
|
377
|
+
function extractPropsFromParameter(param) {
|
|
378
|
+
const props = [];
|
|
379
|
+
// Check for destructuring pattern
|
|
380
|
+
const nameNode = param.getNameNode();
|
|
381
|
+
if (Node.isObjectBindingPattern(nameNode)) {
|
|
382
|
+
for (const element of nameNode.getElements()) {
|
|
383
|
+
const propName = element.getName();
|
|
384
|
+
const initializer = element.getInitializer();
|
|
385
|
+
// BindingElement doesn't have getTypeNode(), so we get type from the element's symbol
|
|
386
|
+
let propType = 'unknown';
|
|
387
|
+
try {
|
|
388
|
+
const elementType = element.getType();
|
|
389
|
+
if (elementType) {
|
|
390
|
+
propType = simplifyTypeText(elementType.getText());
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
catch {
|
|
394
|
+
// Fallback to unknown if type inference fails
|
|
395
|
+
}
|
|
396
|
+
props.push({
|
|
397
|
+
name: propName,
|
|
398
|
+
type: propType,
|
|
399
|
+
required: !initializer && !element.getDotDotDotToken(),
|
|
400
|
+
hasDefault: !!initializer,
|
|
401
|
+
defaultValue: initializer ? parseDefaultValue(initializer.getText()) : null,
|
|
402
|
+
description: null,
|
|
403
|
+
variants: null,
|
|
404
|
+
});
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
// Get props from inferred type (works even without explicit type annotation)
|
|
408
|
+
// This is important for forwardRef components where the type comes from generics
|
|
409
|
+
const type = param.getType();
|
|
410
|
+
if (type) {
|
|
411
|
+
const typeProps = extractPropsFromType(type);
|
|
412
|
+
// Merge with existing props
|
|
413
|
+
for (const typeProp of typeProps) {
|
|
414
|
+
const existing = props.find(p => p.name === typeProp.name);
|
|
415
|
+
if (existing) {
|
|
416
|
+
// Update with type info
|
|
417
|
+
if (existing.type === 'unknown') {
|
|
418
|
+
existing.type = typeProp.type;
|
|
419
|
+
}
|
|
420
|
+
if (!existing.variants && typeProp.variants) {
|
|
421
|
+
existing.variants = typeProp.variants;
|
|
422
|
+
}
|
|
423
|
+
if (!existing.description && typeProp.description) {
|
|
424
|
+
existing.description = typeProp.description;
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
else {
|
|
428
|
+
props.push(typeProp);
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
return props;
|
|
433
|
+
}
|
|
434
|
+
/**
|
|
435
|
+
* Extract props from a type
|
|
436
|
+
*/
|
|
437
|
+
function extractPropsFromType(type) {
|
|
438
|
+
const props = [];
|
|
439
|
+
// Get properties from the type
|
|
440
|
+
const properties = type.getProperties();
|
|
441
|
+
for (const prop of properties) {
|
|
442
|
+
const propName = prop.getName();
|
|
443
|
+
const declarations = prop.getDeclarations();
|
|
444
|
+
if (declarations.length === 0)
|
|
445
|
+
continue;
|
|
446
|
+
const declaration = declarations[0];
|
|
447
|
+
let propType = 'unknown';
|
|
448
|
+
let required = true;
|
|
449
|
+
let description = null;
|
|
450
|
+
let variants = null;
|
|
451
|
+
if (Node.isPropertySignature(declaration)) {
|
|
452
|
+
const sig = declaration;
|
|
453
|
+
propType = sig.getType().getText();
|
|
454
|
+
required = !sig.hasQuestionToken();
|
|
455
|
+
// Get JSDoc description
|
|
456
|
+
const jsDocs = sig.getJsDocs();
|
|
457
|
+
if (jsDocs.length > 0) {
|
|
458
|
+
description = jsDocs[0].getDescription()?.trim() || null;
|
|
459
|
+
}
|
|
460
|
+
// Extract variants from type
|
|
461
|
+
variants = extractVariantsFromType(sig.getType());
|
|
462
|
+
}
|
|
463
|
+
props.push({
|
|
464
|
+
name: propName,
|
|
465
|
+
type: simplifyTypeText(propType),
|
|
466
|
+
required,
|
|
467
|
+
hasDefault: false,
|
|
468
|
+
defaultValue: null,
|
|
469
|
+
description,
|
|
470
|
+
variants,
|
|
471
|
+
});
|
|
472
|
+
}
|
|
473
|
+
return props;
|
|
474
|
+
}
|
|
475
|
+
/**
|
|
476
|
+
* Extract props from a class component
|
|
477
|
+
*/
|
|
478
|
+
function extractPropsFromClass(classDecl) {
|
|
479
|
+
const extendsClause = classDecl.getExtends();
|
|
480
|
+
if (!extendsClause)
|
|
481
|
+
return [];
|
|
482
|
+
// Try to get props from type arguments
|
|
483
|
+
const typeArgs = extendsClause.getTypeArguments();
|
|
484
|
+
if (typeArgs.length === 0)
|
|
485
|
+
return [];
|
|
486
|
+
const propsType = typeArgs[0].getType();
|
|
487
|
+
return extractPropsFromType(propsType);
|
|
488
|
+
}
|
|
489
|
+
/**
|
|
490
|
+
* Extract variant values from a type
|
|
491
|
+
*/
|
|
492
|
+
function extractVariantsFromType(type) {
|
|
493
|
+
// Handle boolean type first (before union check)
|
|
494
|
+
if (type.isBoolean()) {
|
|
495
|
+
return { type: 'boolean', values: ['true', 'false'] };
|
|
496
|
+
}
|
|
497
|
+
// Handle union types
|
|
498
|
+
if (type.isUnion()) {
|
|
499
|
+
const unionTypes = type.getUnionTypes();
|
|
500
|
+
const values = [];
|
|
501
|
+
let hasBooleanLiteral = false;
|
|
502
|
+
for (const t of unionTypes) {
|
|
503
|
+
if (t.isStringLiteral()) {
|
|
504
|
+
const literalValue = t.getLiteralValue();
|
|
505
|
+
if (typeof literalValue === 'string') {
|
|
506
|
+
values.push(literalValue);
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
else if (t.isNumberLiteral()) {
|
|
510
|
+
const literalValue = t.getLiteralValue();
|
|
511
|
+
if (typeof literalValue === 'number') {
|
|
512
|
+
values.push(String(literalValue));
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
else if (t.isBooleanLiteral()) {
|
|
516
|
+
const literalValue = t.getText();
|
|
517
|
+
values.push(literalValue);
|
|
518
|
+
hasBooleanLiteral = true;
|
|
519
|
+
}
|
|
520
|
+
else if (t.isBoolean()) {
|
|
521
|
+
// Handle case where type is `boolean | undefined`
|
|
522
|
+
hasBooleanLiteral = true;
|
|
523
|
+
if (!values.includes('true'))
|
|
524
|
+
values.push('true');
|
|
525
|
+
if (!values.includes('false'))
|
|
526
|
+
values.push('false');
|
|
527
|
+
}
|
|
528
|
+
// Skip undefined/null types (they don't contribute to variant values)
|
|
529
|
+
}
|
|
530
|
+
if (values.length > 0) {
|
|
531
|
+
// If it's only boolean literals (true/false) with optional undefined/null, treat as boolean
|
|
532
|
+
if (hasBooleanLiteral && values.every(v => v === 'true' || v === 'false')) {
|
|
533
|
+
return { type: 'boolean', values };
|
|
534
|
+
}
|
|
535
|
+
return { type: 'union', values };
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
// Handle enum types
|
|
539
|
+
if (type.isEnum()) {
|
|
540
|
+
const symbol = type.getSymbol();
|
|
541
|
+
if (symbol) {
|
|
542
|
+
const declarations = symbol.getDeclarations();
|
|
543
|
+
if (declarations.length > 0) {
|
|
544
|
+
const enumDecl = declarations[0];
|
|
545
|
+
if (Node.isEnumDeclaration(enumDecl)) {
|
|
546
|
+
const members = enumDecl.getMembers();
|
|
547
|
+
const values = members.map(m => m.getName());
|
|
548
|
+
return { type: 'enum', values };
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
return null;
|
|
554
|
+
}
|
|
555
|
+
/**
|
|
556
|
+
* Detect scenarios based on prop names
|
|
557
|
+
*/
|
|
558
|
+
function detectScenarios(props) {
|
|
559
|
+
const scenarios = [];
|
|
560
|
+
const seenScenarios = new Set();
|
|
561
|
+
for (const prop of props) {
|
|
562
|
+
const pattern = SCENARIO_PATTERNS[prop.name];
|
|
563
|
+
if (pattern) {
|
|
564
|
+
const scenarioId = prop.name.replace(/^(is|has)/, '').toLowerCase() + '-state';
|
|
565
|
+
if (!seenScenarios.has(pattern.name)) {
|
|
566
|
+
seenScenarios.add(pattern.name);
|
|
567
|
+
scenarios.push({
|
|
568
|
+
id: scenarioId,
|
|
569
|
+
name: pattern.name,
|
|
570
|
+
detectedBy: 'prop_name',
|
|
571
|
+
controllingProps: [prop.name],
|
|
572
|
+
priority: pattern.priority,
|
|
573
|
+
});
|
|
574
|
+
}
|
|
575
|
+
else {
|
|
576
|
+
// Add to existing scenario's controlling props
|
|
577
|
+
const existing = scenarios.find(s => s.name === pattern.name);
|
|
578
|
+
if (existing && !existing.controllingProps.includes(prop.name)) {
|
|
579
|
+
existing.controllingProps.push(prop.name);
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
return scenarios;
|
|
585
|
+
}
|
|
586
|
+
/**
|
|
587
|
+
* Parse a default value from its text representation
|
|
588
|
+
*/
|
|
589
|
+
function parseDefaultValue(text) {
|
|
590
|
+
try {
|
|
591
|
+
// Remove surrounding quotes for strings
|
|
592
|
+
if ((text.startsWith("'") && text.endsWith("'")) ||
|
|
593
|
+
(text.startsWith('"') && text.endsWith('"'))) {
|
|
594
|
+
return text.slice(1, -1);
|
|
595
|
+
}
|
|
596
|
+
// Boolean
|
|
597
|
+
if (text === 'true')
|
|
598
|
+
return true;
|
|
599
|
+
if (text === 'false')
|
|
600
|
+
return false;
|
|
601
|
+
// Number
|
|
602
|
+
if (!isNaN(Number(text))) {
|
|
603
|
+
return Number(text);
|
|
604
|
+
}
|
|
605
|
+
// Null/undefined
|
|
606
|
+
if (text === 'null')
|
|
607
|
+
return null;
|
|
608
|
+
if (text === 'undefined')
|
|
609
|
+
return undefined;
|
|
610
|
+
// Return as-is for complex expressions
|
|
611
|
+
return text;
|
|
612
|
+
}
|
|
613
|
+
catch {
|
|
614
|
+
return text;
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
/**
|
|
618
|
+
* Simplify type text for readability
|
|
619
|
+
*/
|
|
620
|
+
function simplifyTypeText(typeText) {
|
|
621
|
+
// Remove import paths
|
|
622
|
+
let simplified = typeText.replace(/import\([^)]+\)\./g, '');
|
|
623
|
+
// Trim whitespace
|
|
624
|
+
simplified = simplified.trim();
|
|
625
|
+
// Limit length
|
|
626
|
+
if (simplified.length > 100) {
|
|
627
|
+
simplified = simplified.substring(0, 97) + '...';
|
|
628
|
+
}
|
|
629
|
+
return simplified;
|
|
630
|
+
}
|
|
631
|
+
export { SCENARIO_PATTERNS };
|
|
632
|
+
//# sourceMappingURL=component-detector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-detector.js","sourceRoot":"","sources":["../../src/detectors/component-detector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAc,IAAI,EAA4H,MAAM,UAAU,CAAC;AAC/K,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAS5B,6CAA6C;AAC7C,MAAM,iBAAiB,GAAuF;IAC5G,SAAS,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,EAAE;IACtD,OAAO,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,EAAE;IACpD,YAAY,EAAE,EAAE,IAAI,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,EAAE;IAC5D,OAAO,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,QAAQ,EAAE,QAAQ,EAAE;IACtD,UAAU,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,EAAE;IACxD,OAAO,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,EAAE;IAClD,QAAQ,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,EAAE;IACnD,KAAK,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,EAAE;IAChD,YAAY,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,EAAE;IACvD,SAAS,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,EAAE;IACtD,OAAO,EAAE,EAAE,IAAI,EAAE,aAAa,EA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E,CAAC,GAAG,KAAK,CAAC;IACnD,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* scry-sbcov - Storybook Story Coverage Analyzer
|
|
3
|
+
*
|
|
4
|
+
* A CLI tool that analyzes React component libraries to identify gaps
|
|
5
|
+
* in Storybook story coverage.
|
|
6
|
+
*/
|
|
7
|
+
export { analyze, analyzeQuick, analyzeFiles } from './core/analyzer.js';
|
|
8
|
+
export { detectComponents } from './detectors/component-detector.js';
|
|
9
|
+
export { parseStoryFiles, matchStoryToComponent, getExpectedStoryPath } from './parsers/story-parser.js';
|
|
10
|
+
export { analyzeGitChanges, isFileNew, isFileModified, getFileChangeStatus } from './analyzers/git-analyzer.js';
|
|
11
|
+
export { calculateCoverage, calculateAggregateCoverage, calculateNewCodeCoverage } from './core/coverage-calculator.js';
|
|
12
|
+
export { executeStories, isPlaywrightAvailable } from './core/story-executor.js';
|
|
13
|
+
export { generateReport } from './core/report-generator.js';
|
|
14
|
+
export { loadConfig, DEFAULT_CONFIG } from './cli/config.js';
|
|
15
|
+
export type { StoryCoverageReport, GitContext, AnalysisConfig, CoverageSummary, CoverageMetrics, HealthSummary, NewCodeAnalysis, ExecutionResults, StoryExecutionResult, StoryFailure, StoryFailureType, RegressionAnalysis, ComponentCoverage, PropCoverage, VariantCoverage, VariantValue, ScenarioCoverage, MissingScenario, MissingScenarioReason, UncoveredComponent, QualityGateResult, QualityCheck, ScryConfig, ThresholdConfig, CliOptions, DetectedComponent, DetectedProp, DetectedScenario, PropVariant, ComponentType, ParsedStoryFile, ParsedStory, GitAnalysis, ChangedFile, CoverageResult, ChangeStatus, ExecutionConfig, } from './types/index.js';
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|