@omfalos/mokosh 0.4.4 → 0.5.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 +2 -0
- package/dist/cli.js +57 -38
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +57 -38
- package/dist/cli.mjs.map +1 -1
- package/dist/duplication-worker.d.mts +2 -2
- package/dist/duplication-worker.d.ts +2 -2
- package/dist/duplication-worker.js +4 -4
- package/dist/duplication-worker.js.map +1 -1
- package/dist/duplication-worker.mjs +4 -4
- package/dist/duplication-worker.mjs.map +1 -1
- package/dist/index.d.mts +235 -44
- package/dist/index.d.ts +235 -44
- package/dist/index.js +39 -27
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +39 -27
- package/dist/index.mjs.map +1 -1
- package/dist/mcp.js +42 -30
- package/dist/mcp.js.map +1 -1
- package/dist/mcp.mjs +42 -30
- package/dist/mcp.mjs.map +1 -1
- package/dist/parse-worker.d.mts +2 -2
- package/dist/parse-worker.d.ts +2 -2
- package/dist/parse-worker.js +6 -2
- package/dist/parse-worker.js.map +1 -1
- package/dist/parse-worker.mjs +6 -2
- package/dist/parse-worker.mjs.map +1 -1
- package/dist/{parse-CAKctgb6.d.mts → parse-yamNoaoL.d.mts} +1 -1
- package/dist/{parse-CAKctgb6.d.ts → parse-yamNoaoL.d.ts} +1 -1
- package/dist/{tokenizer-BaF1eUBQ.d.mts → tokenizer-DIbb0GLe.d.mts} +2 -2
- package/dist/{tokenizer-BaF1eUBQ.d.ts → tokenizer-DIbb0GLe.d.ts} +2 -2
- package/dist/{types-BtSqoqbZ.d.mts → types-C153Tz5u.d.mts} +1 -1
- package/dist/{types-BlN-U5AM.d.ts → types-y90pqeDR.d.ts} +1 -1
- package/package.json +3 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { F as FileNode, C as CallEdge, I as ImportEdge, P as ParseResult, S as StructuredTag } from './types-
|
|
2
|
-
export { E as ExportedSymbol } from './types-
|
|
3
|
-
import { N as NormalizedToken } from './tokenizer-
|
|
4
|
-
import { F as FileType, N as NodeCategory } from './parse-
|
|
5
|
-
export { I as ImportType, T as TagKind } from './parse-
|
|
1
|
+
import { F as FileNode, C as CallEdge, I as ImportEdge, P as ParseResult, S as StructuredTag } from './types-y90pqeDR.js';
|
|
2
|
+
export { E as ExportedSymbol } from './types-y90pqeDR.js';
|
|
3
|
+
import { N as NormalizedToken } from './tokenizer-DIbb0GLe.js';
|
|
4
|
+
import { F as FileType, N as NodeCategory } from './parse-yamNoaoL.js';
|
|
5
|
+
export { I as ImportType, T as TagKind } from './parse-yamNoaoL.js';
|
|
6
6
|
|
|
7
7
|
interface SerializedGraph {
|
|
8
8
|
nodes: FileNode[];
|
|
@@ -222,8 +222,8 @@ declare function loadMokoshConfig(rootDirOrPath: string, { allowJs, isExplicitPa
|
|
|
222
222
|
declare function applyConfig(config: MokoshConfig): void;
|
|
223
223
|
/**
|
|
224
224
|
* @description Extracts the subset of `MokoshConfig` fields that affect graph
|
|
225
|
-
* construction (`gitStats`, `parallelParsing`, `pathAliases`) into a plain
|
|
226
|
-
* object, ready to spread into `createImportMap`/`createWorkspaceGraph` calls. Single
|
|
225
|
+
* construction (`gitStats`, `parallelParsing`, `pathAliases`, `ignoreDirs`) into a plain
|
|
226
|
+
* options object, ready to spread into `createImportMap`/`createWorkspaceGraph` calls. Single
|
|
227
227
|
* source of truth for this mapping so every graph-building call site — CLI, MCP,
|
|
228
228
|
* and secondary command-level rebuilds — stays in sync as new config fields are added.
|
|
229
229
|
* @param config - The loaded config, or `undefined` when none has been loaded yet.
|
|
@@ -233,6 +233,7 @@ declare function configToGraphOptions(config: MokoshConfig | undefined): {
|
|
|
233
233
|
gitStats: boolean;
|
|
234
234
|
parallelParsing: ParallelParsingOption | undefined;
|
|
235
235
|
pathAliases: Record<string, string[]> | undefined;
|
|
236
|
+
additionalIgnoreDirs: string[] | undefined;
|
|
236
237
|
};
|
|
237
238
|
|
|
238
239
|
/** Shared by the CLI's disk graph cache (`src/cli/graph-loader.ts`) and the MCP server's
|
|
@@ -246,6 +247,10 @@ declare const DEFAULT_DUPLICATION_TOKEN_CACHE_FILE = "duplication-tokens.json";
|
|
|
246
247
|
* (`src/cli/graph-loader.ts`) after every build; read by the MCP server (`src/mcp/cache.ts`) to
|
|
247
248
|
* seed a session's first `analyze` call so it reuses unchanged nodes instead of parsing cold. */
|
|
248
249
|
declare const DEFAULT_GRAPH_CACHE_FILE = "graph.json";
|
|
250
|
+
/** Subdirectory of `DEFAULT_CACHE_DIR` holding one JSON file per commit sha — graphs built for
|
|
251
|
+
* the "other" ref in a `compareBranches` call (`src/graph/branch-graph-cache.ts`). Keyed by sha
|
|
252
|
+
* rather than branch name so entries are immutable and never need invalidation. */
|
|
253
|
+
declare const DEFAULT_BRANCH_GRAPH_CACHE_DIR = "branch-graphs";
|
|
249
254
|
declare const DEFAULT_IGNORE_DIRS: readonly string[];
|
|
250
255
|
declare const DEFAULT_EXTENSIONS: readonly string[];
|
|
251
256
|
interface ScanOptions {
|
|
@@ -961,6 +966,17 @@ declare class WorkspaceGraph {
|
|
|
961
966
|
* @param {Graph} graph - The fully-built dependency graph for this package.
|
|
962
967
|
*/
|
|
963
968
|
addPackage(pkg: WorkspacePackage, graph: Graph): void;
|
|
969
|
+
/**
|
|
970
|
+
* @description Marks every local import edge that crosses a package boundary as a workspace
|
|
971
|
+
* edge (`isWorkspace: true`, `workspacePackage` set to the target package name). JS
|
|
972
|
+
* resolvers tag these at resolution time from the `workspaceMap`, but JVM (and any other
|
|
973
|
+
* `LangResolver` that resolves cross-module by a project-wide index) returns concrete file
|
|
974
|
+
* paths with no package awareness — so cross-module Gradle/sbt edges would otherwise be
|
|
975
|
+
* invisible to `getPackageDependencies` and the cross-package step of
|
|
976
|
+
* `getAffectedAcrossPackages`. Idempotent: edges already tagged are left untouched.
|
|
977
|
+
* Call once after all packages are registered.
|
|
978
|
+
*/
|
|
979
|
+
annotateCrossPackageEdges(): void;
|
|
964
980
|
/**
|
|
965
981
|
* @description Returns the workspace package whose `relativeRoot` is a path prefix of `relPath`.
|
|
966
982
|
* @param {string} relPath - A monorepo-root-relative file path to look up.
|
|
@@ -1027,32 +1043,6 @@ declare const MermaidExporter: GraphExporter;
|
|
|
1027
1043
|
*/
|
|
1028
1044
|
declare function toMermaid(graph: Graph): string;
|
|
1029
1045
|
|
|
1030
|
-
/** Single source of truth for which languages' parsers track which precision-relevant data. */
|
|
1031
|
-
|
|
1032
|
-
/** File types whose parser ever populates `FileNode.exports`. */
|
|
1033
|
-
declare const EXPORT_TRACKING_TYPES: ReadonlySet<FileType>;
|
|
1034
|
-
/** File types whose parser records which named symbols each import edge pulls in (`ImportEdge.symbols`). */
|
|
1035
|
-
declare const IMPORT_SYMBOL_TYPES: ReadonlySet<FileType>;
|
|
1036
|
-
/** File types whose parser records function-level call edges (`FileNode.callEdges`). */
|
|
1037
|
-
declare const CALL_EDGE_TYPES: ReadonlySet<FileType>;
|
|
1038
|
-
interface LanguageCoverage {
|
|
1039
|
-
type: FileType;
|
|
1040
|
-
fileCount: number;
|
|
1041
|
-
exportsTracked: boolean;
|
|
1042
|
-
importSymbolsTracked: boolean;
|
|
1043
|
-
callEdgesTracked: boolean;
|
|
1044
|
-
}
|
|
1045
|
-
/**
|
|
1046
|
-
* @description Reports which precision-relevant data mokosh actually tracks for each language
|
|
1047
|
-
* present in `graph` — so a caller can tell upfront whether tools like `find_symbol` or
|
|
1048
|
-
* `get_call_graph` will give call-level precision, degrade to import-level, or find nothing
|
|
1049
|
-
* at all for a given file, before running a query and being surprised by the result.
|
|
1050
|
-
* @param graph - The graph to summarize.
|
|
1051
|
-
* @returns One entry per `FileType` actually present in `graph`, sorted by file count
|
|
1052
|
-
* descending. Languages with zero files in this graph are omitted.
|
|
1053
|
-
*/
|
|
1054
|
-
declare function getLanguageCoverage(graph: Graph): LanguageCoverage[];
|
|
1055
|
-
|
|
1056
1046
|
/** Pure graph query/shaping functions shared by the MCP handlers and the CLI, so both surfaces return identical JSON shapes. */
|
|
1057
1047
|
|
|
1058
1048
|
interface PathWithSymbols {
|
|
@@ -1231,6 +1221,215 @@ interface RiskHotspotsResult {
|
|
|
1231
1221
|
*/
|
|
1232
1222
|
declare function findRiskHotspots(graph: Graph, options?: FindRiskHotspotsOptions): RiskHotspotsResult;
|
|
1233
1223
|
|
|
1224
|
+
interface BuildGraphAtRefOptions {
|
|
1225
|
+
silent?: boolean | undefined;
|
|
1226
|
+
gitStats?: boolean | undefined;
|
|
1227
|
+
parallelParsing?: ParallelParsingOption | undefined;
|
|
1228
|
+
pathAliases?: Record<string, string[]> | undefined;
|
|
1229
|
+
/** Extra directory names to skip during test/doc discovery, on top of the built-in list. Sourced from `MokoshConfig.ignoreDirs`. */
|
|
1230
|
+
additionalIgnoreDirs?: string[] | undefined;
|
|
1231
|
+
}
|
|
1232
|
+
/**
|
|
1233
|
+
* @description Builds the dependency graph as it existed at `ref`, rather than the current
|
|
1234
|
+
* working tree. Resolves `ref` to a commit sha and checks the sha-keyed disk cache
|
|
1235
|
+
* (`branch-graph-cache.ts`) before paying for a `git worktree` checkout + full parse — a given
|
|
1236
|
+
* commit's graph never changes, so the cache never needs invalidation.
|
|
1237
|
+
* @param rootDir - Absolute path to the repository root.
|
|
1238
|
+
* @param ref - Any git ref (branch, tag, sha, `HEAD~1`, …).
|
|
1239
|
+
* @param entryPoints - Entry point files, relative to `rootDir`, to seed the build.
|
|
1240
|
+
* @param options - Graph-build options, forwarded to `GraphBuilder` — same shape as `createImportMap`'s.
|
|
1241
|
+
* @returns The resolved commit sha and the `Graph` built at that commit.
|
|
1242
|
+
*/
|
|
1243
|
+
declare function buildGraphAtRef(rootDir: string, ref: string, entryPoints: string[], options?: BuildGraphAtRefOptions): Promise<{
|
|
1244
|
+
sha: string;
|
|
1245
|
+
graph: Graph;
|
|
1246
|
+
}>;
|
|
1247
|
+
interface FileDiff {
|
|
1248
|
+
added: string[];
|
|
1249
|
+
removed: string[];
|
|
1250
|
+
changed: string[];
|
|
1251
|
+
}
|
|
1252
|
+
interface StaleReference {
|
|
1253
|
+
file: string;
|
|
1254
|
+
symbol: string;
|
|
1255
|
+
stillReferencedBy: string[];
|
|
1256
|
+
}
|
|
1257
|
+
interface DuplicationDelta {
|
|
1258
|
+
base: {
|
|
1259
|
+
groups: number;
|
|
1260
|
+
};
|
|
1261
|
+
head: {
|
|
1262
|
+
groups: number;
|
|
1263
|
+
};
|
|
1264
|
+
newGroups: DuplicateGroup[];
|
|
1265
|
+
resolvedGroups: DuplicateGroup[];
|
|
1266
|
+
}
|
|
1267
|
+
interface ComplexityDelta {
|
|
1268
|
+
base: {
|
|
1269
|
+
avgCognitiveComplexity: number;
|
|
1270
|
+
};
|
|
1271
|
+
head: {
|
|
1272
|
+
avgCognitiveComplexity: number;
|
|
1273
|
+
};
|
|
1274
|
+
newHotspots: ComplexFunctionEntry[];
|
|
1275
|
+
resolvedHotspots: ComplexFunctionEntry[];
|
|
1276
|
+
}
|
|
1277
|
+
interface DocDriftDelta {
|
|
1278
|
+
base: {
|
|
1279
|
+
staleCount: number;
|
|
1280
|
+
};
|
|
1281
|
+
head: {
|
|
1282
|
+
staleCount: number;
|
|
1283
|
+
};
|
|
1284
|
+
newlyStale: string[];
|
|
1285
|
+
resolved: string[];
|
|
1286
|
+
}
|
|
1287
|
+
interface CoverageDelta {
|
|
1288
|
+
base: {
|
|
1289
|
+
avgCoveragePct: number;
|
|
1290
|
+
};
|
|
1291
|
+
head: {
|
|
1292
|
+
avgCoveragePct: number;
|
|
1293
|
+
};
|
|
1294
|
+
newHotspots: RiskHotspotEntry[];
|
|
1295
|
+
resolvedHotspots: RiskHotspotEntry[];
|
|
1296
|
+
}
|
|
1297
|
+
interface BranchComparison {
|
|
1298
|
+
base: {
|
|
1299
|
+
ref: string;
|
|
1300
|
+
sha: string;
|
|
1301
|
+
};
|
|
1302
|
+
head: {
|
|
1303
|
+
ref: string;
|
|
1304
|
+
sha: string;
|
|
1305
|
+
};
|
|
1306
|
+
files: FileDiff;
|
|
1307
|
+
staleReferences: StaleReference[];
|
|
1308
|
+
duplication: DuplicationDelta;
|
|
1309
|
+
complexity: ComplexityDelta;
|
|
1310
|
+
docDrift: DocDriftDelta;
|
|
1311
|
+
coverage: CoverageDelta | null;
|
|
1312
|
+
}
|
|
1313
|
+
/**
|
|
1314
|
+
* @description Token-frugal projection of a {@link BranchComparison} for AI/PR-review consumers.
|
|
1315
|
+
* Each delta section carries the worst N items as compact `file:line name (score)` strings plus
|
|
1316
|
+
* a true total count, and "things that got better" collapse to a bare count. Sections with no
|
|
1317
|
+
* delta are omitted entirely; `staleReferences` (the one likely-a-real-bug signal) is never
|
|
1318
|
+
* truncated. `headline` + `verdict` are usually all a reviewer needs to read.
|
|
1319
|
+
*/
|
|
1320
|
+
interface BranchComparisonSummary {
|
|
1321
|
+
/** `"<ref>@<short-sha>"` for the base side. */
|
|
1322
|
+
base: string;
|
|
1323
|
+
/** `"<ref>@<short-sha>"` for the head side. */
|
|
1324
|
+
head: string;
|
|
1325
|
+
verdict: "clean" | "review-worthy" | "attention";
|
|
1326
|
+
headline: string[];
|
|
1327
|
+
files: {
|
|
1328
|
+
added: number;
|
|
1329
|
+
changed: number;
|
|
1330
|
+
removed: number;
|
|
1331
|
+
/** Full path lists — omitted when the diff touches more than `maxPathList` files. */
|
|
1332
|
+
paths?: {
|
|
1333
|
+
added: string[];
|
|
1334
|
+
changed: string[];
|
|
1335
|
+
removed: string[];
|
|
1336
|
+
};
|
|
1337
|
+
};
|
|
1338
|
+
/** Present (and complete) only when at least one stale reference was found. */
|
|
1339
|
+
staleReferences?: StaleReference[];
|
|
1340
|
+
complexity?: {
|
|
1341
|
+
avgDelta: number;
|
|
1342
|
+
/** Worst `maxItems`, `"file:line name (score)"`. */
|
|
1343
|
+
newHotspots: string[];
|
|
1344
|
+
/** True count of new hotspots (may exceed `newHotspots.length`). */
|
|
1345
|
+
newHotspotCount: number;
|
|
1346
|
+
resolvedCount: number;
|
|
1347
|
+
};
|
|
1348
|
+
duplication?: {
|
|
1349
|
+
/** Worst `maxItems`, `"<lines>L x<occurrences>: file:a-b, file:c-d"`. */
|
|
1350
|
+
newGroups: string[];
|
|
1351
|
+
newGroupCount: number;
|
|
1352
|
+
resolvedCount: number;
|
|
1353
|
+
totalGroups: number;
|
|
1354
|
+
};
|
|
1355
|
+
docDrift?: {
|
|
1356
|
+
/** Up to `maxItems`, `"doc → referencedFile"`. */
|
|
1357
|
+
newlyStale: string[];
|
|
1358
|
+
newlyStaleCount: number;
|
|
1359
|
+
resolvedCount: number;
|
|
1360
|
+
};
|
|
1361
|
+
coverage?: {
|
|
1362
|
+
avgDelta: number;
|
|
1363
|
+
/** Worst `maxItems`, `"file:line name (score, cov N%)"`. */
|
|
1364
|
+
newHotspots: string[];
|
|
1365
|
+
newHotspotCount: number;
|
|
1366
|
+
resolvedCount: number;
|
|
1367
|
+
};
|
|
1368
|
+
}
|
|
1369
|
+
interface SummarizeOptions {
|
|
1370
|
+
/** Which per-function score the complexity/coverage deltas were computed on — picks the number shown per entry. */
|
|
1371
|
+
metric?: "cognitiveComplexity" | "complexity" | undefined;
|
|
1372
|
+
/** Max items kept in each delta list (default 8). */
|
|
1373
|
+
maxItems?: number | undefined;
|
|
1374
|
+
/** Above this many changed+added+removed files, `files.paths` is dropped and only counts remain (default 100). */
|
|
1375
|
+
maxPathList?: number | undefined;
|
|
1376
|
+
}
|
|
1377
|
+
/**
|
|
1378
|
+
* @description Collapses a full {@link BranchComparison} into a {@link BranchComparisonSummary} —
|
|
1379
|
+
* see that interface for the shape. Pure function; does no I/O.
|
|
1380
|
+
* @param comparison - The full comparison from {@link compareBranches}.
|
|
1381
|
+
* @param options - `metric` must match the one `compareBranches` used; `maxItems`/`maxPathList` tune truncation.
|
|
1382
|
+
* @returns The compact summary.
|
|
1383
|
+
*/
|
|
1384
|
+
declare function summarizeBranchComparison(comparison: BranchComparison, options?: SummarizeOptions): BranchComparisonSummary;
|
|
1385
|
+
interface CompareBranchesOptions extends BuildGraphAtRefOptions {
|
|
1386
|
+
entryPoints?: string[] | undefined;
|
|
1387
|
+
headRef?: string | undefined;
|
|
1388
|
+
minDuplicateLines?: number | undefined;
|
|
1389
|
+
complexityMetric?: "cognitiveComplexity" | "complexity" | undefined;
|
|
1390
|
+
complexityThreshold?: number | undefined;
|
|
1391
|
+
maxCoveragePct?: number | undefined;
|
|
1392
|
+
}
|
|
1393
|
+
/**
|
|
1394
|
+
* @description Compares a base ref against an already-built head graph (typically the current
|
|
1395
|
+
* working tree / HEAD), reporting a file-level diff, likely-missed rename/removal call sites,
|
|
1396
|
+
* and deltas across every quality tool mokosh already runs on a single graph: duplication
|
|
1397
|
+
* (`find_duplicates`), complexity (`find_complex_functions`), doc drift (`check_doc_drift`),
|
|
1398
|
+
* and — when coverage data is loaded on both sides — risk hotspots (`find_risk_hotspots`).
|
|
1399
|
+
* @param rootDir - Absolute path to the repository root.
|
|
1400
|
+
* @param baseRef - The ref to compare against (e.g. `"main"`, `"origin/main"`, a commit sha).
|
|
1401
|
+
* @param headGraph - The already-built graph for the head side of the comparison.
|
|
1402
|
+
* @param options - `headRef` labels the head side in the result (defaults to `"HEAD"`); the rest tune the underlying tool calls and the base-graph build.
|
|
1403
|
+
* @returns The full `BranchComparison`.
|
|
1404
|
+
*/
|
|
1405
|
+
declare function compareBranches(rootDir: string, baseRef: string, headGraph: Graph, options?: CompareBranchesOptions): Promise<BranchComparison>;
|
|
1406
|
+
|
|
1407
|
+
/** Single source of truth for which languages' parsers track which precision-relevant data. */
|
|
1408
|
+
|
|
1409
|
+
/** File types whose parser ever populates `FileNode.exports`. */
|
|
1410
|
+
declare const EXPORT_TRACKING_TYPES: ReadonlySet<FileType>;
|
|
1411
|
+
/** File types whose parser records which named symbols each import edge pulls in (`ImportEdge.symbols`). */
|
|
1412
|
+
declare const IMPORT_SYMBOL_TYPES: ReadonlySet<FileType>;
|
|
1413
|
+
/** File types whose parser records function-level call edges (`FileNode.callEdges`). */
|
|
1414
|
+
declare const CALL_EDGE_TYPES: ReadonlySet<FileType>;
|
|
1415
|
+
interface LanguageCoverage {
|
|
1416
|
+
type: FileType;
|
|
1417
|
+
fileCount: number;
|
|
1418
|
+
exportsTracked: boolean;
|
|
1419
|
+
importSymbolsTracked: boolean;
|
|
1420
|
+
callEdgesTracked: boolean;
|
|
1421
|
+
}
|
|
1422
|
+
/**
|
|
1423
|
+
* @description Reports which precision-relevant data mokosh actually tracks for each language
|
|
1424
|
+
* present in `graph` — so a caller can tell upfront whether tools like `find_symbol` or
|
|
1425
|
+
* `get_call_graph` will give call-level precision, degrade to import-level, or find nothing
|
|
1426
|
+
* at all for a given file, before running a query and being surprised by the result.
|
|
1427
|
+
* @param graph - The graph to summarize.
|
|
1428
|
+
* @returns One entry per `FileType` actually present in `graph`, sorted by file count
|
|
1429
|
+
* descending. Languages with zero files in this graph are omitted.
|
|
1430
|
+
*/
|
|
1431
|
+
declare function getLanguageCoverage(graph: Graph): LanguageCoverage[];
|
|
1432
|
+
|
|
1234
1433
|
/** Symbol-name lookup across the whole graph — generalizes queryCallGraph beyond TS/JS functions. */
|
|
1235
1434
|
|
|
1236
1435
|
type SymbolPrecision = "call" | "file-level";
|
|
@@ -1394,15 +1593,6 @@ declare function filterGraph(graph: SerializedGraph, query: NodeQuery): Serializ
|
|
|
1394
1593
|
|
|
1395
1594
|
/** Parses a key:value query string into a structured NodeQuery for use with filterGraph. */
|
|
1396
1595
|
|
|
1397
|
-
/**
|
|
1398
|
-
* @description Parses a `"key:value,key:value"` query string into a structured `NodeQuery`.
|
|
1399
|
-
* String values support `"!"` prefix for negation. The `tag`/`tags` key may appear multiple
|
|
1400
|
-
* times; values are OR-matched (negated entries act as exclusions). `tag:a+b` maps to `allTags`.
|
|
1401
|
-
* A token of the form `any(key:val|key:val)` is parsed as an OR-group of single-key clauses
|
|
1402
|
-
* and accumulates into `query.any`, ANDed with every other top-level key in the string.
|
|
1403
|
-
* @param {string} queryString - Comma-separated `key:value` pairs, e.g. `"category:logic,tag:auth"`.
|
|
1404
|
-
* @returns {NodeQuery} The structured query object ready for use with `filterGraph` or `matchNode`.
|
|
1405
|
-
*/
|
|
1406
1596
|
declare function parseQuery(queryString: string): NodeQuery;
|
|
1407
1597
|
|
|
1408
1598
|
/**
|
|
@@ -1505,7 +1695,7 @@ declare function proposeAffectedTests(graph: Graph, changedFiles: string[], opti
|
|
|
1505
1695
|
* @param rootDir - Absolute or relative path to the project root; resolved internally.
|
|
1506
1696
|
* @param entryPoints - File paths (relative to `rootDir`) that seed the graph walk.
|
|
1507
1697
|
* @param previousGraph - An earlier graph to diff against for incremental builds; pass `null` for a full build.
|
|
1508
|
-
* @param options - `silent` suppresses progress output; `gitStats` attaches git churn data; `coverageMap` maps file paths to line-coverage percentages; `parallelParsing` controls worker-pool offloading of file parsing (see {@link ParallelParsingOption}); `pathAliases` overrides/extends tsconfig path-alias resolution (see `MokoshConfig.pathAliases`).
|
|
1698
|
+
* @param options - `silent` suppresses progress output; `gitStats` attaches git churn data; `coverageMap` maps file paths to line-coverage percentages; `parallelParsing` controls worker-pool offloading of file parsing (see {@link ParallelParsingOption}); `pathAliases` overrides/extends tsconfig path-alias resolution (see `MokoshConfig.pathAliases`); `additionalIgnoreDirs` skips extra directory names during test/doc discovery (see `MokoshConfig.ignoreDirs`).
|
|
1509
1699
|
* @returns The fully-built Graph with all reachable nodes and import edges populated.
|
|
1510
1700
|
*/
|
|
1511
1701
|
declare function createImportMap(rootDir: string, entryPoints: string[], previousGraph?: Graph | null, options?: {
|
|
@@ -1514,6 +1704,7 @@ declare function createImportMap(rootDir: string, entryPoints: string[], previou
|
|
|
1514
1704
|
coverageMap?: Map<string, number>;
|
|
1515
1705
|
parallelParsing?: ParallelParsingOption | undefined;
|
|
1516
1706
|
pathAliases?: Record<string, string[]> | undefined;
|
|
1707
|
+
additionalIgnoreDirs?: string[] | undefined;
|
|
1517
1708
|
}): Promise<Graph>;
|
|
1518
1709
|
/**
|
|
1519
1710
|
* @description Auto-detects the monorepo layout under `rootDir` and builds a per-package
|
|
@@ -1538,4 +1729,4 @@ declare function createWorkspaceGraph(rootDir: string, options?: {
|
|
|
1538
1729
|
*/
|
|
1539
1730
|
declare function getAllProjectFiles(rootDir: string, options?: ScanOptions): string[];
|
|
1540
1731
|
|
|
1541
|
-
export { type ApiSurface, type ApplyTagsFileResult, type ApplyTagsResult, CALL_EDGE_TYPES, type CachedFileTokens, CallEdge, type CalleeEntry, type CallerEntry$1 as CallerEntry, type ChangeImpactCache, type ComplexFunctionEntry, DEFAULT_CACHE_DIR, DEFAULT_DUPLICATION_TOKEN_CACHE_FILE, DEFAULT_EXTENSIONS, DEFAULT_GRAPH_CACHE_FILE, DEFAULT_IGNORE_DIRS, type DependencyGraph, type DuplicateFamily, type DuplicateGroup, type DuplicateOccurrence, type DuplicationTokenCache, EXPORT_TRACKING_TYPES, type ExportKind, type FeatureDetectionOptions, type FeatureDomain, type FeatureGraph, type FeatureGraphOptions, type FeatureInfo, FileNode, FileType, type FindComplexFunctionsOptions, type FindDuplicatesOptions, type FindDuplicatesResult, type FindRiskHotspotsOptions, type FunctionCallInfo, type GetAffectedOptions, type GetCallersOptions, Graph, type CallerEntry as GraphCallerEntry, type GraphExporter, IMPORT_SYMBOL_TYPES, ImportEdge, type LanguageCoverage, MermaidExporter, type ModuleResponsibility, type ModuleRole, type MokoshConfig, type MonorepoDetector, type MonorepoLayout, NodeCategory, type NodeMeta, type NodeQuery, type ParallelParsingOption, type PathWithSymbols, type ProposeTagsOptions, type PublicExport, type ResponsibilityGraph, type RiskHotspotEntry, type RiskHotspotsResult, type ScanOptions, type SerializedGraph, type SerializedWorkspaceGraph, type SlimNode, type SlimSerializedGraph, StructuredTag, type SymbolCaller, type SymbolImporter, type SymbolMatch, type SymbolPrecision, SymbolTraversalContext, type TestNodeIdentifier, type TraversalOptions, type TraversalVisitor, type TypeEdge, type TypeGraph, type TypeKind, type TypeNode, type TypeQueryResult, WorkspaceGraph, type WorkspacePackage, type WorkspacePackageSummary, type WorkspacePackagesSummary, applyConfig, applyTags, buildApiSurface, buildChangeImpactCache, buildFeatureGraph, buildResponsibilityGraph, buildTypeGraph, computeGraphHash, configToGraphOptions, createImportMap, createWorkspaceGraph, detectAllEntryPoints, detectEntryPoint, detectFeatures, detectMonorepo, filterGraph, findComplexFunctions, findDuplicates, findRiskHotspots, findSymbol, getAffected, getAllProjectFiles, getCallers, getDependencies, getDependents, getLanguageCoverage, getNodeMeta, hasChurnData, hasCoverageData, isChangeImpactCacheValid, loadChangeImpactCache, loadCoverageMap, loadMokoshConfig, loadTokenCacheFromDisk, parseQuery, proposeAffectedTests, proposeTags, queryCallGraph, queryChangeImpact, queryTypeGraph, registerConfigMatcher, registerMonorepoDetector, registerParser, registerTestLibrary, registerTestPattern, resetClassifyRegistries, saveChangeImpactCache, saveTokenCacheToDisk, slimSerialize, summarizeWorkspacePackages, toMermaid };
|
|
1732
|
+
export { type ApiSurface, type ApplyTagsFileResult, type ApplyTagsResult, type BranchComparison, type BranchComparisonSummary, type BuildGraphAtRefOptions, CALL_EDGE_TYPES, type CachedFileTokens, CallEdge, type CalleeEntry, type CallerEntry$1 as CallerEntry, type ChangeImpactCache, type CompareBranchesOptions, type ComplexFunctionEntry, type ComplexityDelta, type CoverageDelta, DEFAULT_BRANCH_GRAPH_CACHE_DIR, DEFAULT_CACHE_DIR, DEFAULT_DUPLICATION_TOKEN_CACHE_FILE, DEFAULT_EXTENSIONS, DEFAULT_GRAPH_CACHE_FILE, DEFAULT_IGNORE_DIRS, type DependencyGraph, type DocDriftDelta, type DuplicateFamily, type DuplicateGroup, type DuplicateOccurrence, type DuplicationDelta, type DuplicationTokenCache, EXPORT_TRACKING_TYPES, type ExportKind, type FeatureDetectionOptions, type FeatureDomain, type FeatureGraph, type FeatureGraphOptions, type FeatureInfo, type FileDiff, FileNode, FileType, type FindComplexFunctionsOptions, type FindDuplicatesOptions, type FindDuplicatesResult, type FindRiskHotspotsOptions, type FunctionCallInfo, type GetAffectedOptions, type GetCallersOptions, Graph, type CallerEntry as GraphCallerEntry, type GraphExporter, IMPORT_SYMBOL_TYPES, ImportEdge, type LanguageCoverage, MermaidExporter, type ModuleResponsibility, type ModuleRole, type MokoshConfig, type MonorepoDetector, type MonorepoLayout, NodeCategory, type NodeMeta, type NodeQuery, type ParallelParsingOption, type PathWithSymbols, type ProposeTagsOptions, type PublicExport, type ResponsibilityGraph, type RiskHotspotEntry, type RiskHotspotsResult, type ScanOptions, type SerializedGraph, type SerializedWorkspaceGraph, type SlimNode, type SlimSerializedGraph, type StaleReference, StructuredTag, type SummarizeOptions, type SymbolCaller, type SymbolImporter, type SymbolMatch, type SymbolPrecision, SymbolTraversalContext, type TestNodeIdentifier, type TraversalOptions, type TraversalVisitor, type TypeEdge, type TypeGraph, type TypeKind, type TypeNode, type TypeQueryResult, WorkspaceGraph, type WorkspacePackage, type WorkspacePackageSummary, type WorkspacePackagesSummary, applyConfig, applyTags, buildApiSurface, buildChangeImpactCache, buildFeatureGraph, buildGraphAtRef, buildResponsibilityGraph, buildTypeGraph, compareBranches, computeGraphHash, configToGraphOptions, createImportMap, createWorkspaceGraph, detectAllEntryPoints, detectEntryPoint, detectFeatures, detectMonorepo, filterGraph, findComplexFunctions, findDuplicates, findRiskHotspots, findSymbol, getAffected, getAllProjectFiles, getCallers, getDependencies, getDependents, getLanguageCoverage, getNodeMeta, hasChurnData, hasCoverageData, isChangeImpactCacheValid, loadChangeImpactCache, loadCoverageMap, loadMokoshConfig, loadTokenCacheFromDisk, parseQuery, proposeAffectedTests, proposeTags, queryCallGraph, queryChangeImpact, queryTypeGraph, registerConfigMatcher, registerMonorepoDetector, registerParser, registerTestLibrary, registerTestPattern, resetClassifyRegistries, saveChangeImpactCache, saveTokenCacheToDisk, slimSerialize, summarizeBranchComparison, summarizeWorkspacePackages, toMermaid };
|