@aiready/core 0.24.1 → 0.24.3
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.mts +9 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +41 -6
- package/dist/index.mjs +40 -6
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1960,6 +1960,14 @@ declare function isTestFile(filePath: string, extraPatterns?: string[]): boolean
|
|
|
1960
1960
|
* @returns True if a testing framework is detected.
|
|
1961
1961
|
*/
|
|
1962
1962
|
declare function detectTestFramework(rootDir: string): boolean;
|
|
1963
|
+
/**
|
|
1964
|
+
* Check if a file is a type definition, constant file, or other "ignorable"
|
|
1965
|
+
* source file that shouldn't necessarily require its own tests.
|
|
1966
|
+
*
|
|
1967
|
+
* @param filePath - The path to check.
|
|
1968
|
+
* @returns True if the file is ignorable for test ratio purposes.
|
|
1969
|
+
*/
|
|
1970
|
+
declare function isIgnorableSourceFile(filePath: string): boolean;
|
|
1963
1971
|
/**
|
|
1964
1972
|
* Check if a file path belongs to a build artifact or dependency folder.
|
|
1965
1973
|
*
|
|
@@ -1968,4 +1976,4 @@ declare function detectTestFramework(rootDir: string): boolean;
|
|
|
1968
1976
|
*/
|
|
1969
1977
|
declare function isBuildArtifact(filePath: string): boolean;
|
|
1970
1978
|
|
|
1971
|
-
export { AIReadyConfig, AcceptancePrediction, type AgentGroundingScore, type AiSignalClarity, type AiSignalClaritySignal, AnalysisResult, type CLIOptions, CSharpParser, type ChangeAmplificationScore, type CodeBlock, type CognitiveLoad, ComprehensionDifficulty, type ConceptCohesion, CostConfig, DEFAULT_COST_CONFIG, DEFAULT_EXCLUDE, type DependencyHealthScore, type DocDriftRisk, ExportInfo, ExportWithImports, FileImport, type FileTestability, type FileWithDomain, GoParser, type HtmlReportSection, Issue, type JSONOutputParams, JavaParser, type KnowledgeConcentrationRisk, Language, LanguageParser, type LoadFactor, MODEL_PRICING_PRESETS, Metrics, ModelContextTier, type ModelPricingPreset, NamingConvention, ParseResult, ParserFactory, type PatternEntropy, ProductivityImpact, type ProviderFactoryConfig, PythonParser, type ReportOptions, SEVERITY_TIME_ESTIMATES, ScanOptions, type ScoreHistoryEntry, type ScoreTrend, type SemanticDistance, Severity, Severity as SeverityType, SpokeOutput, type StandardReportData, type StandardScoringParams, type StatCard, TEST_PATTERNS, type TechnicalDebtInterest, TechnicalValueChain, TechnicalValueChainSummary, type TestabilityIndex, TokenBudget, ToolName, ToolOptions, type ToolProvider, ToolRegistry, ToolScoringOutput, TypeScriptParser, VAGUE_FILE_NAMES, buildFactorsFromDimensions, buildSimpleProviderScore, buildSpokeOutput, buildStandardToolScore, calculateAgentGrounding, calculateAiSignalClarity, calculateBusinessROI, calculateChangeAmplification, calculateCognitiveLoad, calculateComprehensionDifficulty, calculateConceptCohesion, calculateDebtInterest, calculateDependencyHealth, calculateDetailedTokenROI, calculateDocDrift, calculateExtendedFutureProofScore, calculateFutureProofScore, calculateHeuristicConfidence, calculateImportSimilarity, calculateKnowledgeConcentration, calculateMonthlyCost, calculatePatternEntropy, calculateProductivityImpact, calculateSemanticDistance, calculateStringSimilarity, calculateTechnicalValueChain, calculateTestabilityIndex, calculateTokenBudget, clearHistory, createProvider, createStandardProgressCallback, detectTestFramework, displayStandardConsoleReport, emitAnnotation, emitIssuesAsAnnotations, emitProgress, ensureDir, estimateCostFromBudget, estimateTokens, executeSpokeCli, exportHistory, extractCodeBlocks, filterBySeverity, findLatestReport, findLatestScanReport, formatAcceptanceRate, formatCost, formatHours, formatStandardCliResult, formatStandardReport, generateCompleteReport, generateIssueSummary, generateReportFooter, generateReportHead, generateReportHero, generateStandardHtmlReport, generateStatCards, generateTable, generateValueChain, getElapsedTime, getFileCommitTimestamps, getFileExtension, getFilesByPattern, getHistorySummary, getLineRangeLastModifiedCached, getModelPreset, getParser, getRepoMetadata, getReportTimestamp, getSafetyIcon, getScoreBar, getScoreColor, getSeverityBadge, getSeverityColor, getSeverityEnum, getSeverityLabel, getSeverityLevel, getSeverityValue, getSupportedLanguages, getTerminalDivider, getWasmPath, groupIssuesByFile, handleCLIError, handleJSONOutput, handleStandardJSONOutput, inferPatternType, initTreeSitter, initializeParsers, isBuildArtifact, isFileSupported, isSourceFile, isTestFile, loadConfig, loadMergedConfig, loadScoreHistory, mergeConfigWithDefaults, normalizeAnalysisResult, normalizeIssue, normalizeMetrics, normalizeSeverity, normalizeSpokeOutput, parseFileExports, predictAcceptanceRate, prepareActionConfig, printTerminalHeader, readFileContent, resolveOutputFormat, resolveOutputPath, runBatchAnalysis, runStandardCliAction, saveScoreEntry, scanEntries, scanFiles, setupParser, severityToAnnotationLevel, validateSpokeOutput, validateWithSchema, wrapInCard };
|
|
1979
|
+
export { AIReadyConfig, AcceptancePrediction, type AgentGroundingScore, type AiSignalClarity, type AiSignalClaritySignal, AnalysisResult, type CLIOptions, CSharpParser, type ChangeAmplificationScore, type CodeBlock, type CognitiveLoad, ComprehensionDifficulty, type ConceptCohesion, CostConfig, DEFAULT_COST_CONFIG, DEFAULT_EXCLUDE, type DependencyHealthScore, type DocDriftRisk, ExportInfo, ExportWithImports, FileImport, type FileTestability, type FileWithDomain, GoParser, type HtmlReportSection, Issue, type JSONOutputParams, JavaParser, type KnowledgeConcentrationRisk, Language, LanguageParser, type LoadFactor, MODEL_PRICING_PRESETS, Metrics, ModelContextTier, type ModelPricingPreset, NamingConvention, ParseResult, ParserFactory, type PatternEntropy, ProductivityImpact, type ProviderFactoryConfig, PythonParser, type ReportOptions, SEVERITY_TIME_ESTIMATES, ScanOptions, type ScoreHistoryEntry, type ScoreTrend, type SemanticDistance, Severity, Severity as SeverityType, SpokeOutput, type StandardReportData, type StandardScoringParams, type StatCard, TEST_PATTERNS, type TechnicalDebtInterest, TechnicalValueChain, TechnicalValueChainSummary, type TestabilityIndex, TokenBudget, ToolName, ToolOptions, type ToolProvider, ToolRegistry, ToolScoringOutput, TypeScriptParser, VAGUE_FILE_NAMES, buildFactorsFromDimensions, buildSimpleProviderScore, buildSpokeOutput, buildStandardToolScore, calculateAgentGrounding, calculateAiSignalClarity, calculateBusinessROI, calculateChangeAmplification, calculateCognitiveLoad, calculateComprehensionDifficulty, calculateConceptCohesion, calculateDebtInterest, calculateDependencyHealth, calculateDetailedTokenROI, calculateDocDrift, calculateExtendedFutureProofScore, calculateFutureProofScore, calculateHeuristicConfidence, calculateImportSimilarity, calculateKnowledgeConcentration, calculateMonthlyCost, calculatePatternEntropy, calculateProductivityImpact, calculateSemanticDistance, calculateStringSimilarity, calculateTechnicalValueChain, calculateTestabilityIndex, calculateTokenBudget, clearHistory, createProvider, createStandardProgressCallback, detectTestFramework, displayStandardConsoleReport, emitAnnotation, emitIssuesAsAnnotations, emitProgress, ensureDir, estimateCostFromBudget, estimateTokens, executeSpokeCli, exportHistory, extractCodeBlocks, filterBySeverity, findLatestReport, findLatestScanReport, formatAcceptanceRate, formatCost, formatHours, formatStandardCliResult, formatStandardReport, generateCompleteReport, generateIssueSummary, generateReportFooter, generateReportHead, generateReportHero, generateStandardHtmlReport, generateStatCards, generateTable, generateValueChain, getElapsedTime, getFileCommitTimestamps, getFileExtension, getFilesByPattern, getHistorySummary, getLineRangeLastModifiedCached, getModelPreset, getParser, getRepoMetadata, getReportTimestamp, getSafetyIcon, getScoreBar, getScoreColor, getSeverityBadge, getSeverityColor, getSeverityEnum, getSeverityLabel, getSeverityLevel, getSeverityValue, getSupportedLanguages, getTerminalDivider, getWasmPath, groupIssuesByFile, handleCLIError, handleJSONOutput, handleStandardJSONOutput, inferPatternType, initTreeSitter, initializeParsers, isBuildArtifact, isFileSupported, isIgnorableSourceFile, isSourceFile, isTestFile, loadConfig, loadMergedConfig, loadScoreHistory, mergeConfigWithDefaults, normalizeAnalysisResult, normalizeIssue, normalizeMetrics, normalizeSeverity, normalizeSpokeOutput, parseFileExports, predictAcceptanceRate, prepareActionConfig, printTerminalHeader, readFileContent, resolveOutputFormat, resolveOutputPath, runBatchAnalysis, runStandardCliAction, saveScoreEntry, scanEntries, scanFiles, setupParser, severityToAnnotationLevel, validateSpokeOutput, validateWithSchema, wrapInCard };
|
package/dist/index.d.ts
CHANGED
|
@@ -1960,6 +1960,14 @@ declare function isTestFile(filePath: string, extraPatterns?: string[]): boolean
|
|
|
1960
1960
|
* @returns True if a testing framework is detected.
|
|
1961
1961
|
*/
|
|
1962
1962
|
declare function detectTestFramework(rootDir: string): boolean;
|
|
1963
|
+
/**
|
|
1964
|
+
* Check if a file is a type definition, constant file, or other "ignorable"
|
|
1965
|
+
* source file that shouldn't necessarily require its own tests.
|
|
1966
|
+
*
|
|
1967
|
+
* @param filePath - The path to check.
|
|
1968
|
+
* @returns True if the file is ignorable for test ratio purposes.
|
|
1969
|
+
*/
|
|
1970
|
+
declare function isIgnorableSourceFile(filePath: string): boolean;
|
|
1963
1971
|
/**
|
|
1964
1972
|
* Check if a file path belongs to a build artifact or dependency folder.
|
|
1965
1973
|
*
|
|
@@ -1968,4 +1976,4 @@ declare function detectTestFramework(rootDir: string): boolean;
|
|
|
1968
1976
|
*/
|
|
1969
1977
|
declare function isBuildArtifact(filePath: string): boolean;
|
|
1970
1978
|
|
|
1971
|
-
export { AIReadyConfig, AcceptancePrediction, type AgentGroundingScore, type AiSignalClarity, type AiSignalClaritySignal, AnalysisResult, type CLIOptions, CSharpParser, type ChangeAmplificationScore, type CodeBlock, type CognitiveLoad, ComprehensionDifficulty, type ConceptCohesion, CostConfig, DEFAULT_COST_CONFIG, DEFAULT_EXCLUDE, type DependencyHealthScore, type DocDriftRisk, ExportInfo, ExportWithImports, FileImport, type FileTestability, type FileWithDomain, GoParser, type HtmlReportSection, Issue, type JSONOutputParams, JavaParser, type KnowledgeConcentrationRisk, Language, LanguageParser, type LoadFactor, MODEL_PRICING_PRESETS, Metrics, ModelContextTier, type ModelPricingPreset, NamingConvention, ParseResult, ParserFactory, type PatternEntropy, ProductivityImpact, type ProviderFactoryConfig, PythonParser, type ReportOptions, SEVERITY_TIME_ESTIMATES, ScanOptions, type ScoreHistoryEntry, type ScoreTrend, type SemanticDistance, Severity, Severity as SeverityType, SpokeOutput, type StandardReportData, type StandardScoringParams, type StatCard, TEST_PATTERNS, type TechnicalDebtInterest, TechnicalValueChain, TechnicalValueChainSummary, type TestabilityIndex, TokenBudget, ToolName, ToolOptions, type ToolProvider, ToolRegistry, ToolScoringOutput, TypeScriptParser, VAGUE_FILE_NAMES, buildFactorsFromDimensions, buildSimpleProviderScore, buildSpokeOutput, buildStandardToolScore, calculateAgentGrounding, calculateAiSignalClarity, calculateBusinessROI, calculateChangeAmplification, calculateCognitiveLoad, calculateComprehensionDifficulty, calculateConceptCohesion, calculateDebtInterest, calculateDependencyHealth, calculateDetailedTokenROI, calculateDocDrift, calculateExtendedFutureProofScore, calculateFutureProofScore, calculateHeuristicConfidence, calculateImportSimilarity, calculateKnowledgeConcentration, calculateMonthlyCost, calculatePatternEntropy, calculateProductivityImpact, calculateSemanticDistance, calculateStringSimilarity, calculateTechnicalValueChain, calculateTestabilityIndex, calculateTokenBudget, clearHistory, createProvider, createStandardProgressCallback, detectTestFramework, displayStandardConsoleReport, emitAnnotation, emitIssuesAsAnnotations, emitProgress, ensureDir, estimateCostFromBudget, estimateTokens, executeSpokeCli, exportHistory, extractCodeBlocks, filterBySeverity, findLatestReport, findLatestScanReport, formatAcceptanceRate, formatCost, formatHours, formatStandardCliResult, formatStandardReport, generateCompleteReport, generateIssueSummary, generateReportFooter, generateReportHead, generateReportHero, generateStandardHtmlReport, generateStatCards, generateTable, generateValueChain, getElapsedTime, getFileCommitTimestamps, getFileExtension, getFilesByPattern, getHistorySummary, getLineRangeLastModifiedCached, getModelPreset, getParser, getRepoMetadata, getReportTimestamp, getSafetyIcon, getScoreBar, getScoreColor, getSeverityBadge, getSeverityColor, getSeverityEnum, getSeverityLabel, getSeverityLevel, getSeverityValue, getSupportedLanguages, getTerminalDivider, getWasmPath, groupIssuesByFile, handleCLIError, handleJSONOutput, handleStandardJSONOutput, inferPatternType, initTreeSitter, initializeParsers, isBuildArtifact, isFileSupported, isSourceFile, isTestFile, loadConfig, loadMergedConfig, loadScoreHistory, mergeConfigWithDefaults, normalizeAnalysisResult, normalizeIssue, normalizeMetrics, normalizeSeverity, normalizeSpokeOutput, parseFileExports, predictAcceptanceRate, prepareActionConfig, printTerminalHeader, readFileContent, resolveOutputFormat, resolveOutputPath, runBatchAnalysis, runStandardCliAction, saveScoreEntry, scanEntries, scanFiles, setupParser, severityToAnnotationLevel, validateSpokeOutput, validateWithSchema, wrapInCard };
|
|
1979
|
+
export { AIReadyConfig, AcceptancePrediction, type AgentGroundingScore, type AiSignalClarity, type AiSignalClaritySignal, AnalysisResult, type CLIOptions, CSharpParser, type ChangeAmplificationScore, type CodeBlock, type CognitiveLoad, ComprehensionDifficulty, type ConceptCohesion, CostConfig, DEFAULT_COST_CONFIG, DEFAULT_EXCLUDE, type DependencyHealthScore, type DocDriftRisk, ExportInfo, ExportWithImports, FileImport, type FileTestability, type FileWithDomain, GoParser, type HtmlReportSection, Issue, type JSONOutputParams, JavaParser, type KnowledgeConcentrationRisk, Language, LanguageParser, type LoadFactor, MODEL_PRICING_PRESETS, Metrics, ModelContextTier, type ModelPricingPreset, NamingConvention, ParseResult, ParserFactory, type PatternEntropy, ProductivityImpact, type ProviderFactoryConfig, PythonParser, type ReportOptions, SEVERITY_TIME_ESTIMATES, ScanOptions, type ScoreHistoryEntry, type ScoreTrend, type SemanticDistance, Severity, Severity as SeverityType, SpokeOutput, type StandardReportData, type StandardScoringParams, type StatCard, TEST_PATTERNS, type TechnicalDebtInterest, TechnicalValueChain, TechnicalValueChainSummary, type TestabilityIndex, TokenBudget, ToolName, ToolOptions, type ToolProvider, ToolRegistry, ToolScoringOutput, TypeScriptParser, VAGUE_FILE_NAMES, buildFactorsFromDimensions, buildSimpleProviderScore, buildSpokeOutput, buildStandardToolScore, calculateAgentGrounding, calculateAiSignalClarity, calculateBusinessROI, calculateChangeAmplification, calculateCognitiveLoad, calculateComprehensionDifficulty, calculateConceptCohesion, calculateDebtInterest, calculateDependencyHealth, calculateDetailedTokenROI, calculateDocDrift, calculateExtendedFutureProofScore, calculateFutureProofScore, calculateHeuristicConfidence, calculateImportSimilarity, calculateKnowledgeConcentration, calculateMonthlyCost, calculatePatternEntropy, calculateProductivityImpact, calculateSemanticDistance, calculateStringSimilarity, calculateTechnicalValueChain, calculateTestabilityIndex, calculateTokenBudget, clearHistory, createProvider, createStandardProgressCallback, detectTestFramework, displayStandardConsoleReport, emitAnnotation, emitIssuesAsAnnotations, emitProgress, ensureDir, estimateCostFromBudget, estimateTokens, executeSpokeCli, exportHistory, extractCodeBlocks, filterBySeverity, findLatestReport, findLatestScanReport, formatAcceptanceRate, formatCost, formatHours, formatStandardCliResult, formatStandardReport, generateCompleteReport, generateIssueSummary, generateReportFooter, generateReportHead, generateReportHero, generateStandardHtmlReport, generateStatCards, generateTable, generateValueChain, getElapsedTime, getFileCommitTimestamps, getFileExtension, getFilesByPattern, getHistorySummary, getLineRangeLastModifiedCached, getModelPreset, getParser, getRepoMetadata, getReportTimestamp, getSafetyIcon, getScoreBar, getScoreColor, getSeverityBadge, getSeverityColor, getSeverityEnum, getSeverityLabel, getSeverityLevel, getSeverityValue, getSupportedLanguages, getTerminalDivider, getWasmPath, groupIssuesByFile, handleCLIError, handleJSONOutput, handleStandardJSONOutput, inferPatternType, initTreeSitter, initializeParsers, isBuildArtifact, isFileSupported, isIgnorableSourceFile, isSourceFile, isTestFile, loadConfig, loadMergedConfig, loadScoreHistory, mergeConfigWithDefaults, normalizeAnalysisResult, normalizeIssue, normalizeMetrics, normalizeSeverity, normalizeSpokeOutput, parseFileExports, predictAcceptanceRate, prepareActionConfig, printTerminalHeader, readFileContent, resolveOutputFormat, resolveOutputPath, runBatchAnalysis, runStandardCliAction, saveScoreEntry, scanEntries, scanFiles, setupParser, severityToAnnotationLevel, validateSpokeOutput, validateWithSchema, wrapInCard };
|
package/dist/index.js
CHANGED
|
@@ -2108,6 +2108,7 @@ __export(index_exports, {
|
|
|
2108
2108
|
initializeParsers: () => initializeParsers,
|
|
2109
2109
|
isBuildArtifact: () => isBuildArtifact,
|
|
2110
2110
|
isFileSupported: () => isFileSupported,
|
|
2111
|
+
isIgnorableSourceFile: () => isIgnorableSourceFile,
|
|
2111
2112
|
isSourceFile: () => isSourceFile,
|
|
2112
2113
|
isTestFile: () => isTestFile,
|
|
2113
2114
|
loadConfig: () => loadConfig,
|
|
@@ -6336,8 +6337,12 @@ async function runBatchAnalysis(items, label, toolId, onProgress, processFn, onR
|
|
|
6336
6337
|
for (const item of items) {
|
|
6337
6338
|
processed++;
|
|
6338
6339
|
emitProgress(processed, items.length, toolId, label, onProgress);
|
|
6339
|
-
|
|
6340
|
-
|
|
6340
|
+
try {
|
|
6341
|
+
const result = await processFn(item);
|
|
6342
|
+
onResult(result);
|
|
6343
|
+
} catch (error) {
|
|
6344
|
+
console.error(`[${toolId}] Error processing ${item}:`, error);
|
|
6345
|
+
}
|
|
6341
6346
|
}
|
|
6342
6347
|
}
|
|
6343
6348
|
|
|
@@ -6372,16 +6377,40 @@ Found ${report.issues.length} issues.`));
|
|
|
6372
6377
|
var import_fs5 = require("fs");
|
|
6373
6378
|
var import_path6 = require("path");
|
|
6374
6379
|
var TEST_PATTERNS = [
|
|
6380
|
+
// TypeScript/JavaScript test files
|
|
6375
6381
|
/\.(test|spec)\.(ts|tsx|js|jsx)$/,
|
|
6382
|
+
// Go test files
|
|
6376
6383
|
/_test\.go$/,
|
|
6384
|
+
// Python test files
|
|
6377
6385
|
/test_.*\.py$/,
|
|
6378
6386
|
/.*_test\.py$/,
|
|
6387
|
+
// Java test files
|
|
6379
6388
|
/.*Test\.java$/,
|
|
6389
|
+
// C# test files
|
|
6380
6390
|
/.*Tests\.cs$/,
|
|
6381
|
-
|
|
6382
|
-
|
|
6383
|
-
|
|
6384
|
-
|
|
6391
|
+
// __tests__ directories (any file inside)
|
|
6392
|
+
/__tests__[/\\]/,
|
|
6393
|
+
// tests or test directories
|
|
6394
|
+
/[/\\]tests?[/\\]/,
|
|
6395
|
+
// e2e directories
|
|
6396
|
+
/[/\\]e2e[/\\]/,
|
|
6397
|
+
// fixtures directories
|
|
6398
|
+
/[/\\]fixtures?[/\\]/,
|
|
6399
|
+
// __mocks__ directories
|
|
6400
|
+
/[/\\]__mocks__[/\\]/,
|
|
6401
|
+
// Cypress test files
|
|
6402
|
+
/[/\\]cypress[/\\]/,
|
|
6403
|
+
// Playwright test files
|
|
6404
|
+
/[/\\]playwright[/\\]/,
|
|
6405
|
+
// Vitest workspace files
|
|
6406
|
+
/\.vitest\.(ts|js)$/,
|
|
6407
|
+
// Jest config files that indicate test setup
|
|
6408
|
+
/jest\.config\.(ts|js|json)$/,
|
|
6409
|
+
// Vitest config files
|
|
6410
|
+
/vitest\.config\.(ts|js)$/,
|
|
6411
|
+
// Test setup files
|
|
6412
|
+
/setup\.(ts|js)$/,
|
|
6413
|
+
/test-setup\.(ts|js)$/
|
|
6385
6414
|
];
|
|
6386
6415
|
function isTestFile(filePath, extraPatterns) {
|
|
6387
6416
|
if (TEST_PATTERNS.some((p) => p.test(filePath))) return true;
|
|
@@ -6423,6 +6452,11 @@ function detectTestFramework(rootDir) {
|
|
|
6423
6452
|
}
|
|
6424
6453
|
return false;
|
|
6425
6454
|
}
|
|
6455
|
+
function isIgnorableSourceFile(filePath) {
|
|
6456
|
+
const lower = filePath.toLowerCase();
|
|
6457
|
+
return lower.endsWith(".d.ts") || lower.endsWith("types.ts") || lower.endsWith("interface.ts") || lower.endsWith("constants.ts") || lower.includes("/types/") || lower.includes("/interfaces/") || lower.includes("/constants/") || lower.includes("/models/") || // Often just data structures
|
|
6458
|
+
lower.includes("/schemas/");
|
|
6459
|
+
}
|
|
6426
6460
|
function isBuildArtifact(filePath) {
|
|
6427
6461
|
const lower = filePath.toLowerCase();
|
|
6428
6462
|
return lower.includes("/node_modules/") || lower.includes("/dist/") || lower.includes("/build/") || lower.includes("/out/") || lower.includes("/.next/") || lower.includes("/target/") || lower.includes("/bin/");
|
|
@@ -6586,6 +6620,7 @@ function isBuildArtifact(filePath) {
|
|
|
6586
6620
|
initializeParsers,
|
|
6587
6621
|
isBuildArtifact,
|
|
6588
6622
|
isFileSupported,
|
|
6623
|
+
isIgnorableSourceFile,
|
|
6589
6624
|
isSourceFile,
|
|
6590
6625
|
isTestFile,
|
|
6591
6626
|
loadConfig,
|
package/dist/index.mjs
CHANGED
|
@@ -3461,8 +3461,12 @@ async function runBatchAnalysis(items, label, toolId, onProgress, processFn, onR
|
|
|
3461
3461
|
for (const item of items) {
|
|
3462
3462
|
processed++;
|
|
3463
3463
|
emitProgress(processed, items.length, toolId, label, onProgress);
|
|
3464
|
-
|
|
3465
|
-
|
|
3464
|
+
try {
|
|
3465
|
+
const result = await processFn(item);
|
|
3466
|
+
onResult(result);
|
|
3467
|
+
} catch (error) {
|
|
3468
|
+
console.error(`[${toolId}] Error processing ${item}:`, error);
|
|
3469
|
+
}
|
|
3466
3470
|
}
|
|
3467
3471
|
}
|
|
3468
3472
|
|
|
@@ -3497,16 +3501,40 @@ Found ${report.issues.length} issues.`));
|
|
|
3497
3501
|
import { readFileSync as readFileSync3, existsSync as existsSync5 } from "fs";
|
|
3498
3502
|
import { join as join5 } from "path";
|
|
3499
3503
|
var TEST_PATTERNS = [
|
|
3504
|
+
// TypeScript/JavaScript test files
|
|
3500
3505
|
/\.(test|spec)\.(ts|tsx|js|jsx)$/,
|
|
3506
|
+
// Go test files
|
|
3501
3507
|
/_test\.go$/,
|
|
3508
|
+
// Python test files
|
|
3502
3509
|
/test_.*\.py$/,
|
|
3503
3510
|
/.*_test\.py$/,
|
|
3511
|
+
// Java test files
|
|
3504
3512
|
/.*Test\.java$/,
|
|
3513
|
+
// C# test files
|
|
3505
3514
|
/.*Tests\.cs$/,
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3515
|
+
// __tests__ directories (any file inside)
|
|
3516
|
+
/__tests__[/\\]/,
|
|
3517
|
+
// tests or test directories
|
|
3518
|
+
/[/\\]tests?[/\\]/,
|
|
3519
|
+
// e2e directories
|
|
3520
|
+
/[/\\]e2e[/\\]/,
|
|
3521
|
+
// fixtures directories
|
|
3522
|
+
/[/\\]fixtures?[/\\]/,
|
|
3523
|
+
// __mocks__ directories
|
|
3524
|
+
/[/\\]__mocks__[/\\]/,
|
|
3525
|
+
// Cypress test files
|
|
3526
|
+
/[/\\]cypress[/\\]/,
|
|
3527
|
+
// Playwright test files
|
|
3528
|
+
/[/\\]playwright[/\\]/,
|
|
3529
|
+
// Vitest workspace files
|
|
3530
|
+
/\.vitest\.(ts|js)$/,
|
|
3531
|
+
// Jest config files that indicate test setup
|
|
3532
|
+
/jest\.config\.(ts|js|json)$/,
|
|
3533
|
+
// Vitest config files
|
|
3534
|
+
/vitest\.config\.(ts|js)$/,
|
|
3535
|
+
// Test setup files
|
|
3536
|
+
/setup\.(ts|js)$/,
|
|
3537
|
+
/test-setup\.(ts|js)$/
|
|
3510
3538
|
];
|
|
3511
3539
|
function isTestFile(filePath, extraPatterns) {
|
|
3512
3540
|
if (TEST_PATTERNS.some((p) => p.test(filePath))) return true;
|
|
@@ -3548,6 +3576,11 @@ function detectTestFramework(rootDir) {
|
|
|
3548
3576
|
}
|
|
3549
3577
|
return false;
|
|
3550
3578
|
}
|
|
3579
|
+
function isIgnorableSourceFile(filePath) {
|
|
3580
|
+
const lower = filePath.toLowerCase();
|
|
3581
|
+
return lower.endsWith(".d.ts") || lower.endsWith("types.ts") || lower.endsWith("interface.ts") || lower.endsWith("constants.ts") || lower.includes("/types/") || lower.includes("/interfaces/") || lower.includes("/constants/") || lower.includes("/models/") || // Often just data structures
|
|
3582
|
+
lower.includes("/schemas/");
|
|
3583
|
+
}
|
|
3551
3584
|
function isBuildArtifact(filePath) {
|
|
3552
3585
|
const lower = filePath.toLowerCase();
|
|
3553
3586
|
return lower.includes("/node_modules/") || lower.includes("/dist/") || lower.includes("/build/") || lower.includes("/out/") || lower.includes("/.next/") || lower.includes("/target/") || lower.includes("/bin/");
|
|
@@ -3710,6 +3743,7 @@ export {
|
|
|
3710
3743
|
initializeParsers,
|
|
3711
3744
|
isBuildArtifact,
|
|
3712
3745
|
isFileSupported,
|
|
3746
|
+
isIgnorableSourceFile,
|
|
3713
3747
|
isSourceFile,
|
|
3714
3748
|
isTestFile,
|
|
3715
3749
|
loadConfig,
|