@omfalos/mokosh 0.5.0 → 0.5.1
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/cli.js +55 -50
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +57 -52
- package/dist/cli.mjs.map +1 -1
- package/dist/duplication-worker.d.mts +1 -1
- package/dist/duplication-worker.d.ts +1 -1
- package/dist/duplication-worker.js +6 -4
- package/dist/duplication-worker.js.map +1 -1
- package/dist/duplication-worker.mjs +6 -4
- package/dist/duplication-worker.mjs.map +1 -1
- package/dist/index.d.mts +186 -18
- package/dist/index.d.ts +186 -18
- package/dist/index.js +37 -34
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +37 -34
- package/dist/index.mjs.map +1 -1
- package/dist/mcp.js +38 -34
- package/dist/mcp.js.map +1 -1
- package/dist/mcp.mjs +40 -36
- package/dist/mcp.mjs.map +1 -1
- package/dist/parse-worker.d.mts +1 -1
- package/dist/parse-worker.d.ts +1 -1
- package/dist/parse-worker.js +6 -6
- package/dist/parse-worker.js.map +1 -1
- package/dist/parse-worker.mjs +6 -6
- package/dist/parse-worker.mjs.map +1 -1
- package/dist/{tokenizer-DIbb0GLe.d.mts → tokenizer-D9P-y7lH.d.mts} +1 -1
- package/dist/{tokenizer-DIbb0GLe.d.ts → tokenizer-D9P-y7lH.d.ts} +1 -1
- package/dist/{types-C153Tz5u.d.mts → types-Ba-BjVQG.d.mts} +4 -0
- package/dist/{types-y90pqeDR.d.ts → types-DWARi8gF.d.ts} +4 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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-
|
|
1
|
+
import { F as FileNode, C as CallEdge, I as ImportEdge, P as ParseResult, S as StructuredTag } from './types-DWARi8gF.js';
|
|
2
|
+
export { E as ExportedSymbol } from './types-DWARi8gF.js';
|
|
3
|
+
import { N as NormalizedToken } from './tokenizer-D9P-y7lH.js';
|
|
4
4
|
import { F as FileType, N as NodeCategory } from './parse-yamNoaoL.js';
|
|
5
5
|
export { I as ImportType, T as TagKind } from './parse-yamNoaoL.js';
|
|
6
6
|
|
|
@@ -17,6 +17,61 @@ interface TraversalOptions {
|
|
|
17
17
|
direction?: "outgoing" | "incoming";
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
/** Analyzes a dependency graph node map for unused files, export-usage hotspots, and circular import chains. */
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Edge kinds that {@link GraphAnalyzer.findCycles} treats as *not* real import cycles and skips
|
|
24
|
+
* by default: `"samePackage"` for the synthetic JVM same-package sibling clique, `"docReference"`
|
|
25
|
+
* for Markdown link / code-span file references (ADR-009). Pass one via `includeKinds` to walk it
|
|
26
|
+
* anyway (e.g. a caller that genuinely wants to see doc cross-link loops).
|
|
27
|
+
*/
|
|
28
|
+
type CycleEdgeKind = "docReference" | "samePackage";
|
|
29
|
+
/** Options for {@link GraphAnalyzer.findCycles}. */
|
|
30
|
+
interface FindCyclesOptions {
|
|
31
|
+
/** Edge kinds to include in the walk that are otherwise skipped (see {@link CycleEdgeKind}). */
|
|
32
|
+
includeKinds?: CycleEdgeKind[] | undefined;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* @description Utility for analyzing the dependency graph for cycles and unused files.
|
|
36
|
+
* Operates on the raw node map rather than a `Graph` instance so it can be used
|
|
37
|
+
* without the full traversal infrastructure.
|
|
38
|
+
*/
|
|
39
|
+
declare class GraphAnalyzer {
|
|
40
|
+
private nodes;
|
|
41
|
+
/**
|
|
42
|
+
* @param {Map<string, FileNode>} nodes - The full node map of the graph to analyze, keyed by project-relative file path.
|
|
43
|
+
*/
|
|
44
|
+
constructor(nodes: Map<string, FileNode>);
|
|
45
|
+
/**
|
|
46
|
+
* @description Returns files from `allFiles` that are absent from the graph — meaning nothing
|
|
47
|
+
* imports them directly or transitively from any entry point, making them deletion candidates.
|
|
48
|
+
* @param {string[]} allFiles - Complete list of project-relative file paths to test against the graph.
|
|
49
|
+
* @returns {string[]} Subset of `allFiles` whose paths do not appear as graph nodes.
|
|
50
|
+
*/
|
|
51
|
+
findUnusedFiles(allFiles: string[]): string[];
|
|
52
|
+
/**
|
|
53
|
+
* @description Returns files whose highest single-edge export usage ratio meets or exceeds
|
|
54
|
+
* `threshold`, sorted descending by `maxExportUsage`. Useful for identifying files
|
|
55
|
+
* that consume a large fraction of one dependency's API surface.
|
|
56
|
+
* @param {number} threshold - Minimum `maxExportUsage` value (0–1) for a file to be included.
|
|
57
|
+
* @returns {Array<{ path: string; maxExportUsage: number; tightestDep: string }>} Entries sorted descending by `maxExportUsage`.
|
|
58
|
+
*/
|
|
59
|
+
findHighExportUsage(threshold: number): Array<{
|
|
60
|
+
path: string;
|
|
61
|
+
maxExportUsage: number;
|
|
62
|
+
tightestDep: string;
|
|
63
|
+
}>;
|
|
64
|
+
/**
|
|
65
|
+
* @description Detects all circular import chains using DFS with a recursion-stack back-edge check.
|
|
66
|
+
* Each returned array is one cycle as an ordered list of file paths ending at the entry that closes the loop.
|
|
67
|
+
* Non-import edge kinds — the synthetic JVM same-package clique and Markdown doc references
|
|
68
|
+
* (ADR-009) — are skipped by default; pass `includeKinds` to walk them anyway.
|
|
69
|
+
* @param {FindCyclesOptions} [opts] - `includeKinds` opts specific edge kinds back into the walk.
|
|
70
|
+
* @returns {string[][]} Array of cycles; each cycle is an ordered list of file paths forming a loop.
|
|
71
|
+
*/
|
|
72
|
+
findCycles(opts?: FindCyclesOptions): string[][];
|
|
73
|
+
}
|
|
74
|
+
|
|
20
75
|
/** Graph class wrapping the raw node map with DFS traversal, cycle detection, serialization, and reverse-edge helpers. */
|
|
21
76
|
|
|
22
77
|
/**
|
|
@@ -112,9 +167,12 @@ declare class Graph {
|
|
|
112
167
|
/**
|
|
113
168
|
* @description Detects all circular import chains in the graph using DFS
|
|
114
169
|
* with a back-edge check. Each returned array is one cycle as an ordered path.
|
|
170
|
+
* Synthetic JVM same-package edges and Markdown doc references are skipped by default —
|
|
171
|
+
* pass `opts.includeKinds` to walk them.
|
|
172
|
+
* @param {FindCyclesOptions} [opts] - Forwarded to {@link GraphAnalyzer.findCycles}.
|
|
115
173
|
* @returns Array of cycles; each cycle is a list of file paths forming a loop.
|
|
116
174
|
*/
|
|
117
|
-
findCycles(): string[][];
|
|
175
|
+
findCycles(opts?: FindCyclesOptions): string[][];
|
|
118
176
|
}
|
|
119
177
|
|
|
120
178
|
/** Configures whether/how `parseFile` calls are offloaded to a `piscina` worker pool. `false` always parses in-process. */
|
|
@@ -197,6 +255,19 @@ interface MokoshConfig {
|
|
|
197
255
|
* in-process, or pass `{ minFiles, maxThreads }` to raise the threshold instead.
|
|
198
256
|
*/
|
|
199
257
|
parallelParsing?: ParallelParsingOption;
|
|
258
|
+
/** Duplicate-detection (`find_duplicates` / `--find-duplicates`) tuning. */
|
|
259
|
+
duplication?: {
|
|
260
|
+
/**
|
|
261
|
+
* Extra generated / vendored file patterns to exclude from duplicate scanning, merged with
|
|
262
|
+
* the built-in list (protobuf output, `*.generated.*`, `generated/` dirs, `@generated`
|
|
263
|
+
* markers). Two shapes only — `** /name/**` (any path segment equals `name`) and `*.suffix`
|
|
264
|
+
* (basename ends with `.suffix`) — not full glob syntax.
|
|
265
|
+
*/
|
|
266
|
+
ignoreGlobs?: string[];
|
|
267
|
+
/** When true, scan generated / vendored files too (default false). Matches involving one are
|
|
268
|
+
* tagged `signals: ["generated"]`. */
|
|
269
|
+
includeGenerated?: boolean;
|
|
270
|
+
};
|
|
200
271
|
}
|
|
201
272
|
/**
|
|
202
273
|
* @description Loads a mokosh config file, probing standard filenames in `rootDirOrPath` or reading an explicit path when `isExplicitPath` is true.
|
|
@@ -247,6 +318,11 @@ declare const DEFAULT_DUPLICATION_TOKEN_CACHE_FILE = "duplication-tokens.json";
|
|
|
247
318
|
* (`src/cli/graph-loader.ts`) after every build; read by the MCP server (`src/mcp/cache.ts`) to
|
|
248
319
|
* seed a session's first `analyze` call so it reuses unchanged nodes instead of parsing cold. */
|
|
249
320
|
declare const DEFAULT_GRAPH_CACHE_FILE = "graph.json";
|
|
321
|
+
/** Filename for the disk-persisted *workspace* (monorepo) graph cache within `DEFAULT_CACHE_DIR`.
|
|
322
|
+
* Written by the MCP server (`src/mcp/cache.ts`) after a `createWorkspaceGraph` build and hydrated
|
|
323
|
+
* on the next session's first workspace query when the source-file digest still matches — so
|
|
324
|
+
* repeat sessions against an unchanged monorepo skip the full per-package rebuild. */
|
|
325
|
+
declare const DEFAULT_WORKSPACE_GRAPH_CACHE_FILE = "workspace-graph.json";
|
|
250
326
|
/** Subdirectory of `DEFAULT_CACHE_DIR` holding one JSON file per commit sha — graphs built for
|
|
251
327
|
* the "other" ref in a `compareBranches` call (`src/graph/branch-graph-cache.ts`). Keyed by sha
|
|
252
328
|
* rather than branch name so entries are immutable and never need invalidation. */
|
|
@@ -497,6 +573,13 @@ interface DuplicateOccurrence {
|
|
|
497
573
|
startLine: number;
|
|
498
574
|
endLine: number;
|
|
499
575
|
}
|
|
576
|
+
/**
|
|
577
|
+
* Advisory tags on a {@link DuplicateGroup} that help a caller (and issue 6's query layer) judge
|
|
578
|
+
* whether a match is worth acting on: `"same-file"` — every occurrence is in one file (an
|
|
579
|
+
* internally repeated block); `"generated"` — at least one occurrence is in a file only scanned
|
|
580
|
+
* because `includeGenerated: true` was passed. Designed to grow (issue 7 adds more).
|
|
581
|
+
*/
|
|
582
|
+
type DuplicateSignal = "same-file" | "generated";
|
|
500
583
|
interface DuplicateGroup {
|
|
501
584
|
/** Every location sharing this duplicated block (two or more) — locations that pairwise
|
|
502
585
|
* chain-match are clustered into one group instead of being reported once per pair, so a
|
|
@@ -512,6 +595,9 @@ interface DuplicateGroup {
|
|
|
512
595
|
* matches across families — see docs/adr-013-duplicate-detection-noise-reduction.md).
|
|
513
596
|
* Absent when called directly with a token stream that isn't family-scoped, e.g. in tests. */
|
|
514
597
|
family?: DuplicateFamily | undefined;
|
|
598
|
+
/** Advisory tags for filtering — see {@link DuplicateSignal}. Absent (not `[]`) when no
|
|
599
|
+
* signal applies. */
|
|
600
|
+
signals?: DuplicateSignal[] | undefined;
|
|
515
601
|
}
|
|
516
602
|
|
|
517
603
|
/** One file's cached tokenize result, fingerprinted by `mtime`/`size`/`ignoreLiterals` — any
|
|
@@ -522,6 +608,10 @@ interface CachedFileTokens {
|
|
|
522
608
|
mtime: number;
|
|
523
609
|
size: number;
|
|
524
610
|
ignoreLiterals: boolean;
|
|
611
|
+
/** Whether this file is generated / vendored (path heuristic or first-bytes marker) — cached
|
|
612
|
+
* so a `includeGenerated: false` scan that gets a cache hit can still exclude it, and a
|
|
613
|
+
* `includeGenerated: true` scan can still tag matches, without re-reading the file. */
|
|
614
|
+
generated: boolean;
|
|
525
615
|
tokens: NormalizedToken[];
|
|
526
616
|
}
|
|
527
617
|
/** Caller-owned cache, keyed by project-relative path, reused across repeated `findDuplicates`
|
|
@@ -550,6 +640,24 @@ declare function loadTokenCacheFromDisk(cachePath: string): DuplicationTokenCach
|
|
|
550
640
|
*/
|
|
551
641
|
declare function saveTokenCacheToDisk(cache: DuplicationTokenCache, cachePath: string): void;
|
|
552
642
|
|
|
643
|
+
/**
|
|
644
|
+
* @description Whether a file's path alone marks it as generated — a known codegen basename
|
|
645
|
+
* suffix, a generated-output directory segment, or a caller-supplied `ignoreGlobs` match.
|
|
646
|
+
* Cheap and synchronous, so it runs before the file is read.
|
|
647
|
+
* @param relPath - Project-relative file path.
|
|
648
|
+
* @param ignoreGlobs - Extra patterns from `MokoshConfig.duplication.ignoreGlobs`.
|
|
649
|
+
* @returns Whether `relPath` should be treated as generated.
|
|
650
|
+
*/
|
|
651
|
+
declare function isGeneratedPath(relPath: string, ignoreGlobs?: readonly string[]): boolean;
|
|
652
|
+
/**
|
|
653
|
+
* @description Whether the start of a file's source carries a generated-by marker
|
|
654
|
+
* (`@generated`, `DO NOT EDIT`, `Code generated by …`, etc.). Only the first
|
|
655
|
+
* {@link MARKER_SCAN_BYTES} characters are checked — codegen tools put the banner at the top.
|
|
656
|
+
* @param source - Full file source.
|
|
657
|
+
* @returns Whether a generated marker is present near the top of `source`.
|
|
658
|
+
*/
|
|
659
|
+
declare function hasGeneratedMarker(source: string): boolean;
|
|
660
|
+
|
|
553
661
|
/** Configures whether/how tokenizing is offloaded to a `piscina` worker pool. `false` always
|
|
554
662
|
* tokenizes in-process. */
|
|
555
663
|
type ParallelTokenizingOption = boolean | {
|
|
@@ -577,6 +685,16 @@ interface FindDuplicatesOptions {
|
|
|
577
685
|
/** Directory names to exclude, matched against any path segment (default `DEFAULT_IGNORE_DIRS`
|
|
578
686
|
* — `node_modules`, `dist`, `.git`, `mokosh-cache`, `coverage`, etc.). Pass `[]` to disable. */
|
|
579
687
|
ignoreDirs?: readonly string[] | undefined;
|
|
688
|
+
/** When false (default), skip generated / vendored files — protobuf output, `*.generated.*`,
|
|
689
|
+
* codegen basenames, files under a `generated/` segment, and files whose first ~500 bytes
|
|
690
|
+
* carry a `@generated` / `DO NOT EDIT` / `Code generated by` marker. Their repetition is not
|
|
691
|
+
* actionable copy-paste. Set true to scan them anyway; matches involving one are tagged
|
|
692
|
+
* `signals: ["generated"]`. See docs/adr-013-duplicate-detection-noise-reduction.md. */
|
|
693
|
+
includeGenerated?: boolean | undefined;
|
|
694
|
+
/** Extra generated-file patterns merged with the built-in list (from
|
|
695
|
+
* `MokoshConfig.duplication.ignoreGlobs`). Two shapes only — `**/name/**` (path segment) and
|
|
696
|
+
* `*.suffix` (basename) — not full glob syntax. */
|
|
697
|
+
ignoreGlobs?: readonly string[] | undefined;
|
|
580
698
|
/** Controls worker-pool offloading of per-file tokenizing (default `true`): offloads once the
|
|
581
699
|
* candidate file count reaches `minFiles` (default 20, matching `GraphBuilder`'s parse pool);
|
|
582
700
|
* `false` always tokenizes in-process; an object overrides `minFiles`/`maxThreads`. See
|
|
@@ -920,17 +1038,6 @@ interface MonorepoDetector {
|
|
|
920
1038
|
*/
|
|
921
1039
|
declare function registerMonorepoDetector(detector: MonorepoDetector): void;
|
|
922
1040
|
|
|
923
|
-
/**
|
|
924
|
-
* @description Runs all registered monorepo detectors against `rootDir` and merges
|
|
925
|
-
* their results into a single `MonorepoLayout`. All matching detectors contribute
|
|
926
|
-
* their `type` string and packages — so a Turborepo + pnpm repo will have
|
|
927
|
-
* `types: ["turborepo", "pnpm"]` and packages from the pnpm detector.
|
|
928
|
-
*
|
|
929
|
-
* Packages are deduplicated by name: the first detector to emit a package name wins.
|
|
930
|
-
* Returns `type: "none"` when no detector fires.
|
|
931
|
-
*/
|
|
932
|
-
declare function detectMonorepo(rootDir: string, detectors?: readonly MonorepoDetector[]): MonorepoLayout;
|
|
933
|
-
|
|
934
1041
|
/** WorkspaceGraph holds one per-package Graph for a monorepo and exposes cross-package blast-radius queries. */
|
|
935
1042
|
|
|
936
1043
|
/** @description JSON-safe snapshot of a `WorkspaceGraph`, suitable for writing to disk and restoring via `WorkspaceGraph.deserialize`. */
|
|
@@ -1016,6 +1123,47 @@ declare class WorkspaceGraph {
|
|
|
1016
1123
|
static deserialize(data: SerializedWorkspaceGraph): WorkspaceGraph;
|
|
1017
1124
|
}
|
|
1018
1125
|
|
|
1126
|
+
interface WorkspaceLayoutPackageSummary {
|
|
1127
|
+
name: string;
|
|
1128
|
+
relativeRoot: string;
|
|
1129
|
+
/** Sibling workspace packages this one depends on. Exact when `dependsOnResolved`, best-effort otherwise. */
|
|
1130
|
+
dependsOn: string[];
|
|
1131
|
+
/** Present only when a built workspace graph was available. */
|
|
1132
|
+
nodeCount?: number;
|
|
1133
|
+
}
|
|
1134
|
+
interface WorkspaceLayoutSummary {
|
|
1135
|
+
monorepoType: string;
|
|
1136
|
+
monorepoTypes: string[];
|
|
1137
|
+
packageCount: number;
|
|
1138
|
+
packages: WorkspaceLayoutPackageSummary[];
|
|
1139
|
+
/** `true` when `dependsOn` came from a built graph or every package exposed a manifest. */
|
|
1140
|
+
dependsOnResolved: boolean;
|
|
1141
|
+
/** `true` when per-package `nodeCount` is populated (a built graph was available). */
|
|
1142
|
+
nodeCountsResolved: boolean;
|
|
1143
|
+
note?: string;
|
|
1144
|
+
}
|
|
1145
|
+
/**
|
|
1146
|
+
* @description Summarizes a monorepo from its detected layout alone — package names, relative
|
|
1147
|
+
* roots, and best-effort `dependsOn` from `package.json` manifests — without building any
|
|
1148
|
+
* dependency graph. When a built `WorkspaceGraph` is supplied, its exact per-package node
|
|
1149
|
+
* counts and cross-package edges are used instead.
|
|
1150
|
+
* @param layout - The result of `detectMonorepo`. Must not be `type: "none"`.
|
|
1151
|
+
* @param builtGraph - An already-built workspace graph for `layout.root`, if one is cached.
|
|
1152
|
+
* @returns A layout summary suitable for the `get_workspace_packages` response.
|
|
1153
|
+
*/
|
|
1154
|
+
declare function summarizeWorkspaceLayout(layout: MonorepoLayout, builtGraph?: WorkspaceGraph): WorkspaceLayoutSummary;
|
|
1155
|
+
|
|
1156
|
+
/**
|
|
1157
|
+
* @description Runs all registered monorepo detectors against `rootDir` and merges
|
|
1158
|
+
* their results into a single `MonorepoLayout`. All matching detectors contribute
|
|
1159
|
+
* their `type` string and packages — so a Turborepo + pnpm repo will have
|
|
1160
|
+
* `types: ["turborepo", "pnpm"]` and packages from the pnpm detector.
|
|
1161
|
+
*
|
|
1162
|
+
* Packages are deduplicated by name: the first detector to emit a package name wins.
|
|
1163
|
+
* Returns `type: "none"` when no detector fires.
|
|
1164
|
+
*/
|
|
1165
|
+
declare function detectMonorepo(rootDir: string, detectors?: readonly MonorepoDetector[]): MonorepoLayout;
|
|
1166
|
+
|
|
1019
1167
|
/**
|
|
1020
1168
|
* @description Contract for graph serializers. Implement this to add a new export format
|
|
1021
1169
|
* (e.g. Graphviz DOT, JSON, SVG) without touching the core graph model.
|
|
@@ -1705,20 +1853,40 @@ declare function createImportMap(rootDir: string, entryPoints: string[], previou
|
|
|
1705
1853
|
parallelParsing?: ParallelParsingOption | undefined;
|
|
1706
1854
|
pathAliases?: Record<string, string[]> | undefined;
|
|
1707
1855
|
additionalIgnoreDirs?: string[] | undefined;
|
|
1856
|
+
docFiles?: string[] | null | undefined;
|
|
1708
1857
|
}): Promise<Graph>;
|
|
1858
|
+
/**
|
|
1859
|
+
* @description Computes a digest of every source file under `rootDir` (path + mtime + size),
|
|
1860
|
+
* used to decide whether a disk-persisted workspace graph is still valid. Changing, adding, or
|
|
1861
|
+
* removing any file changes the digest.
|
|
1862
|
+
* @param rootDir - Absolute monorepo root.
|
|
1863
|
+
* @returns A hex sha-256 digest, and the relative file list it was computed from (reused by the
|
|
1864
|
+
* caller so the directory tree is walked only once).
|
|
1865
|
+
*/
|
|
1866
|
+
declare function computeWorkspaceSourceDigest(rootDir: string): {
|
|
1867
|
+
digest: string;
|
|
1868
|
+
files: string[];
|
|
1869
|
+
};
|
|
1709
1870
|
/**
|
|
1710
1871
|
* @description Auto-detects the monorepo layout under `rootDir` and builds a per-package
|
|
1711
1872
|
* dependency graph, stitching them together into a single WorkspaceGraph.
|
|
1712
1873
|
* @param rootDir - Absolute path to the monorepo root.
|
|
1713
|
-
* @param options - `packages` filters to a named subset of packages; `silent` suppresses progress; `gitStats` attaches git churn data per file; `parallelParsing` controls worker-pool offloading of file parsing per package (see {@link ParallelParsingOption}); `pathAliases` overrides/extends tsconfig path-alias resolution for every package (see `MokoshConfig.pathAliases`).
|
|
1874
|
+
* @param options - `packages` filters to a named subset of packages; `silent` suppresses progress; `gitStats` attaches git churn data per file; `parallelParsing` controls worker-pool offloading of file parsing per package (see {@link ParallelParsingOption}); `pathAliases` overrides/extends tsconfig path-alias resolution for every package (see `MokoshConfig.pathAliases`); `layout` supplies a pre-computed `detectMonorepo` result so detection is not repeated by callers that already ran it.
|
|
1714
1875
|
* @returns A WorkspaceGraph where each package has its own Graph and cross-package edges are resolved.
|
|
1715
1876
|
*/
|
|
1716
1877
|
declare function createWorkspaceGraph(rootDir: string, options?: {
|
|
1717
|
-
packages?: string[];
|
|
1878
|
+
packages?: string[] | undefined;
|
|
1718
1879
|
silent?: boolean;
|
|
1719
1880
|
gitStats?: boolean;
|
|
1720
1881
|
parallelParsing?: ParallelParsingOption | undefined;
|
|
1721
1882
|
pathAliases?: Record<string, string[]> | undefined;
|
|
1883
|
+
additionalIgnoreDirs?: string[] | undefined;
|
|
1884
|
+
layout?: MonorepoLayout | undefined;
|
|
1885
|
+
/** Pre-computed `getAllProjectFiles(rootDir)` result, so the caller's digest walk isn't repeated. */
|
|
1886
|
+
projectFiles?: string[] | undefined;
|
|
1887
|
+
/** A previously built workspace graph; each package reuses its prior graph as an incremental
|
|
1888
|
+
* base so unchanged files are not re-parsed (mtime+size match). */
|
|
1889
|
+
previousWorkspace?: WorkspaceGraph | undefined;
|
|
1722
1890
|
}): Promise<WorkspaceGraph>;
|
|
1723
1891
|
/**
|
|
1724
1892
|
* @description Recursively walks `rootDir` and returns paths of every file whose extension
|
|
@@ -1729,4 +1897,4 @@ declare function createWorkspaceGraph(rootDir: string, options?: {
|
|
|
1729
1897
|
*/
|
|
1730
1898
|
declare function getAllProjectFiles(rootDir: string, options?: ScanOptions): string[];
|
|
1731
1899
|
|
|
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 };
|
|
1900
|
+
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, type CycleEdgeKind, DEFAULT_BRANCH_GRAPH_CACHE_DIR, DEFAULT_CACHE_DIR, DEFAULT_DUPLICATION_TOKEN_CACHE_FILE, DEFAULT_EXTENSIONS, DEFAULT_GRAPH_CACHE_FILE, DEFAULT_IGNORE_DIRS, DEFAULT_WORKSPACE_GRAPH_CACHE_FILE, type DependencyGraph, type DocDriftDelta, type DuplicateFamily, type DuplicateGroup, type DuplicateOccurrence, type DuplicateSignal, 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 FindCyclesOptions, type FindDuplicatesOptions, type FindDuplicatesResult, type FindRiskHotspotsOptions, type FunctionCallInfo, type GetAffectedOptions, type GetCallersOptions, Graph, GraphAnalyzer, 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 WorkspaceLayoutPackageSummary, type WorkspaceLayoutSummary, type WorkspacePackage, type WorkspacePackageSummary, type WorkspacePackagesSummary, applyConfig, applyTags, buildApiSurface, buildChangeImpactCache, buildFeatureGraph, buildGraphAtRef, buildResponsibilityGraph, buildTypeGraph, compareBranches, computeGraphHash, computeWorkspaceSourceDigest, configToGraphOptions, createImportMap, createWorkspaceGraph, detectAllEntryPoints, detectEntryPoint, detectFeatures, detectMonorepo, filterGraph, findComplexFunctions, findDuplicates, findRiskHotspots, findSymbol, getAffected, getAllProjectFiles, getCallers, getDependencies, getDependents, getLanguageCoverage, getNodeMeta, hasChurnData, hasCoverageData, hasGeneratedMarker, isChangeImpactCacheValid, isGeneratedPath, loadChangeImpactCache, loadCoverageMap, loadMokoshConfig, loadTokenCacheFromDisk, parseQuery, proposeAffectedTests, proposeTags, queryCallGraph, queryChangeImpact, queryTypeGraph, registerConfigMatcher, registerMonorepoDetector, registerParser, registerTestLibrary, registerTestPattern, resetClassifyRegistries, saveChangeImpactCache, saveTokenCacheToDisk, slimSerialize, summarizeBranchComparison, summarizeWorkspaceLayout, summarizeWorkspacePackages, toMermaid };
|