@arx-hq/collectors-core 0.4.0 → 0.4.2
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 +11 -3
- package/dist/index.js +429 -110
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { CollectorPlugin, MetricFinding, PackageManager } from '@arx-hq/contracts';
|
|
2
|
+
export { toPosixPath } from '@arx-hq/contracts';
|
|
2
3
|
|
|
3
4
|
declare function detectCyclesInGraph(graph: ReadonlyMap<string, readonly string[]>): string[][];
|
|
4
5
|
declare function createArchCircularCollector(): CollectorPlugin;
|
|
5
6
|
|
|
7
|
+
declare function findStaleStatusVersionClaim(statusContent: string, packageVersion: string): {
|
|
8
|
+
readonly declared: string;
|
|
9
|
+
readonly line: number;
|
|
10
|
+
} | null;
|
|
6
11
|
declare function extractRelativeDocLinks(markdown: string): {
|
|
7
12
|
readonly target: string;
|
|
8
13
|
readonly line: number;
|
|
@@ -11,6 +16,7 @@ declare function createArchDocLintCollector(): CollectorPlugin;
|
|
|
11
16
|
|
|
12
17
|
declare function extractRelativeSpecifiers(filePath: string, content: string): string[];
|
|
13
18
|
declare function resolveLocalImport(fromRelFile: string, specifier: string, allFilesSet: ReadonlySet<string>): string | null;
|
|
19
|
+
declare function extractPackageJsonReferencedFiles(pkgRelFile: string, rawJson: string, allFilesSet: ReadonlySet<string>): string[];
|
|
14
20
|
declare function createCodeDeadCollector(): CollectorPlugin;
|
|
15
21
|
|
|
16
22
|
declare function parseEslintJsonOutput(stdout: string, rootDir: string): MetricFinding[];
|
|
@@ -30,6 +36,7 @@ interface EnvReference {
|
|
|
30
36
|
readonly file: string;
|
|
31
37
|
readonly line: number;
|
|
32
38
|
}
|
|
39
|
+
declare function isTestOnlyPath(relFile: string): boolean;
|
|
33
40
|
declare function extractProcessEnvKeys(relFile: string, content: string): EnvReference[];
|
|
34
41
|
declare function parseEnvExampleKeys(content: string): Set<string>;
|
|
35
42
|
declare function createOpsEnvExampleCollector(): CollectorPlugin;
|
|
@@ -48,6 +55,7 @@ declare function isSensitiveTrackedFile(relPosixPath: string): boolean;
|
|
|
48
55
|
declare function gitignoreCoversEnv(gitignoreContent: string): boolean;
|
|
49
56
|
declare function createSecEnvGitCollector(): CollectorPlugin;
|
|
50
57
|
|
|
58
|
+
declare function isExplicitPlaceholderToken(matchedToken: string, prefixRegex: RegExp): boolean;
|
|
51
59
|
declare function calculateShannonEntropy(value: string): number;
|
|
52
60
|
declare function scanContentForSecrets(relFile: string, content: string): MetricFinding[];
|
|
53
61
|
declare function createSecSecretsCollector(): CollectorPlugin;
|
|
@@ -77,8 +85,7 @@ declare function getPackageManagerRunArgs(pm: PackageManager, scriptName: string
|
|
|
77
85
|
args: string[];
|
|
78
86
|
};
|
|
79
87
|
|
|
80
|
-
declare function
|
|
81
|
-
declare function createIgnoreMatcher(ignorePaths: readonly string[]): (relPosixPath: string) => boolean;
|
|
88
|
+
declare function createIgnoreMatcher(ignorePaths: readonly string[], gitignoreContent?: string): (relPosixPath: string, isDir?: boolean) => boolean;
|
|
82
89
|
interface WalkOptions {
|
|
83
90
|
readonly rootDir: string;
|
|
84
91
|
readonly ignorePaths: readonly string[];
|
|
@@ -90,6 +97,7 @@ declare function pathExists(absPath: string): Promise<boolean>;
|
|
|
90
97
|
declare function readTextIfExists(absPath: string): Promise<string | null>;
|
|
91
98
|
interface PackageJsonShape {
|
|
92
99
|
readonly name?: string;
|
|
100
|
+
readonly version?: string;
|
|
93
101
|
readonly main?: string;
|
|
94
102
|
readonly bin?: string | Record<string, string>;
|
|
95
103
|
readonly scripts?: Record<string, string>;
|
|
@@ -103,4 +111,4 @@ declare const COLLECTORS_CORE_SCHEMA_VERSION: "1.0.0";
|
|
|
103
111
|
|
|
104
112
|
declare function createCoreCollectors(): CollectorPlugin[];
|
|
105
113
|
|
|
106
|
-
export { COLLECTORS_CORE_SCHEMA_VERSION, type CommandResult, type EnvReference, type PackageJsonShape, type RunCommandOptions, TS_JS_EXTENSIONS, type WalkOptions, buildAuditFindings, calculateShannonEntropy, createArchCircularCollector, createArchDocLintCollector, createCodeDeadCollector, createCodeLintCollector, createCodeSlopCollector, createCodeTypecheckCollector, createCoreCollectors, createIgnoreMatcher, createOpsBuildCollector, createOpsEnvExampleCollector, createSecAuditCollector, createSecEnvGitCollector, createSecSecretsCollector, createSecUnsafeAstCollector, createTestRunnerCollector, detectCyclesInGraph, extractProcessEnvKeys, extractRelativeDocLinks, extractRelativeSpecifiers, getPackageManagerRunArgs, gitignoreCoversEnv, isSensitiveTrackedFile, isSuppressedAtLine, parseAuditJsonCounts, parseBiomeTextOutput, parseEnvExampleKeys, parseEslintJsonOutput, parseTestFailures, parseTscDiagnostics, pathExists, readPackageJson, readTextIfExists, resolveLocalImport, resolveToolCommand, runExternalCommand, scanContentForSecrets, scanSourceForAiSlop, scanUnsafeAstPatterns,
|
|
114
|
+
export { COLLECTORS_CORE_SCHEMA_VERSION, type CommandResult, type EnvReference, type PackageJsonShape, type RunCommandOptions, TS_JS_EXTENSIONS, type WalkOptions, buildAuditFindings, calculateShannonEntropy, createArchCircularCollector, createArchDocLintCollector, createCodeDeadCollector, createCodeLintCollector, createCodeSlopCollector, createCodeTypecheckCollector, createCoreCollectors, createIgnoreMatcher, createOpsBuildCollector, createOpsEnvExampleCollector, createSecAuditCollector, createSecEnvGitCollector, createSecSecretsCollector, createSecUnsafeAstCollector, createTestRunnerCollector, detectCyclesInGraph, extractPackageJsonReferencedFiles, extractProcessEnvKeys, extractRelativeDocLinks, extractRelativeSpecifiers, findStaleStatusVersionClaim, getPackageManagerRunArgs, gitignoreCoversEnv, isExplicitPlaceholderToken, isSensitiveTrackedFile, isSuppressedAtLine, isTestOnlyPath, parseAuditJsonCounts, parseBiomeTextOutput, parseEnvExampleKeys, parseEslintJsonOutput, parseTestFailures, parseTscDiagnostics, pathExists, readPackageJson, readTextIfExists, resolveLocalImport, resolveToolCommand, runExternalCommand, scanContentForSecrets, scanSourceForAiSlop, scanUnsafeAstPatterns, walkFiles };
|