@drskillissue/ganko 0.1.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/LICENSE +21 -0
- package/README.md +430 -0
- package/dist/chunk-JBBGDG7M.js +1943 -0
- package/dist/chunk-JBBGDG7M.js.map +1 -0
- package/dist/chunk-RB7SZIJX.js +37396 -0
- package/dist/chunk-RB7SZIJX.js.map +1 -0
- package/dist/eslint-plugin.cjs +37216 -0
- package/dist/eslint-plugin.cjs.map +1 -0
- package/dist/eslint-plugin.d.cts +40 -0
- package/dist/eslint-plugin.d.ts +40 -0
- package/dist/eslint-plugin.js +301 -0
- package/dist/eslint-plugin.js.map +1 -0
- package/dist/index.cjs +39583 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +3133 -0
- package/dist/index.d.ts +3133 -0
- package/dist/index.js +358 -0
- package/dist/index.js.map +1 -0
- package/dist/rules-manifest.cjs +1972 -0
- package/dist/rules-manifest.cjs.map +1 -0
- package/dist/rules-manifest.d.cts +33 -0
- package/dist/rules-manifest.d.ts +33 -0
- package/dist/rules-manifest.js +13 -0
- package/dist/rules-manifest.js.map +1 -0
- package/package.json +92 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
import {
|
|
2
|
+
RULES,
|
|
3
|
+
RULES_BY_CATEGORY,
|
|
4
|
+
getRule
|
|
5
|
+
} from "./chunk-JBBGDG7M.js";
|
|
6
|
+
import {
|
|
7
|
+
CSSPlugin,
|
|
8
|
+
SolidPlugin,
|
|
9
|
+
analyzeInput,
|
|
10
|
+
buildCSSGraph,
|
|
11
|
+
buildLayoutGraph,
|
|
12
|
+
buildSolidGraph,
|
|
13
|
+
parseContent,
|
|
14
|
+
parseContentWithProgram,
|
|
15
|
+
parseFile,
|
|
16
|
+
resolveTailwindValidator,
|
|
17
|
+
runCrossFileRules,
|
|
18
|
+
runSolidRules,
|
|
19
|
+
scanDependencyCustomProperties,
|
|
20
|
+
setActivePolicy
|
|
21
|
+
} from "./chunk-RB7SZIJX.js";
|
|
22
|
+
|
|
23
|
+
// src/runner.ts
|
|
24
|
+
function createOverrideEmit(target, overrides) {
|
|
25
|
+
return (d) => {
|
|
26
|
+
const override = overrides[d.rule];
|
|
27
|
+
if (override === void 0) {
|
|
28
|
+
target(d);
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
if (override === "off") return;
|
|
32
|
+
if (override !== d.severity) {
|
|
33
|
+
target({ ...d, severity: override });
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
target(d);
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function createRunner(config) {
|
|
40
|
+
let overrides = config.rules ?? {};
|
|
41
|
+
return {
|
|
42
|
+
run(files) {
|
|
43
|
+
const diagnostics = [];
|
|
44
|
+
const raw = (d) => diagnostics.push(d);
|
|
45
|
+
const hasOverrides = Object.keys(overrides).length > 0;
|
|
46
|
+
const emit = hasOverrides ? createOverrideEmit(raw, overrides) : raw;
|
|
47
|
+
for (const plugin of config.plugins) {
|
|
48
|
+
plugin.analyze(files, emit);
|
|
49
|
+
}
|
|
50
|
+
return diagnostics;
|
|
51
|
+
},
|
|
52
|
+
setRuleOverrides(next) {
|
|
53
|
+
overrides = next;
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// src/cache.ts
|
|
59
|
+
import { canonicalPath, classifyFile, noopLogger } from "@drskillissue/ganko-shared";
|
|
60
|
+
var GraphCache = class {
|
|
61
|
+
log;
|
|
62
|
+
solids = /* @__PURE__ */ new Map();
|
|
63
|
+
crossFileDiagnostics = /* @__PURE__ */ new Map();
|
|
64
|
+
crossFileResults = null;
|
|
65
|
+
css = null;
|
|
66
|
+
solidGeneration = 0;
|
|
67
|
+
cssGeneration = 0;
|
|
68
|
+
layout = null;
|
|
69
|
+
constructor(log) {
|
|
70
|
+
this.log = log ?? noopLogger;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Check if a SolidGraph is cached and current for a file path.
|
|
74
|
+
*
|
|
75
|
+
* Allows callers to skip builder allocation when the cache is warm.
|
|
76
|
+
*
|
|
77
|
+
* @param path Absolute file path
|
|
78
|
+
* @param version Script version string from the TS project service
|
|
79
|
+
*/
|
|
80
|
+
hasSolidGraph(path, version) {
|
|
81
|
+
const key = canonicalPath(path);
|
|
82
|
+
const cached = this.solids.get(key);
|
|
83
|
+
const hit = cached !== void 0 && cached.version === version;
|
|
84
|
+
if (this.log.enabled) this.log.debug(`hasSolidGraph: ${key} v=${version} cached=${cached?.version ?? "none"} hit=${hit} (${this.solids.size} total)`);
|
|
85
|
+
return hit;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Store a pre-built SolidGraph in the cache.
|
|
89
|
+
*
|
|
90
|
+
* Used by the CLI lint command which builds graphs during single-file
|
|
91
|
+
* analysis and pre-populates the cache for cross-file reuse.
|
|
92
|
+
*
|
|
93
|
+
* @param path Absolute file path
|
|
94
|
+
* @param version Script version string from the TS project service
|
|
95
|
+
* @param graph Pre-built SolidGraph
|
|
96
|
+
*/
|
|
97
|
+
setSolidGraph(path, version, graph) {
|
|
98
|
+
const key = canonicalPath(path);
|
|
99
|
+
this.solids.set(key, { version, graph });
|
|
100
|
+
this.solidGeneration++;
|
|
101
|
+
if (this.log.enabled) this.log.debug(`setSolidGraph: ${key} v=${version} (${this.solids.size} total) solidGen=${this.solidGeneration}`);
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Get or build a SolidGraph for a file path.
|
|
105
|
+
*
|
|
106
|
+
* Returns the cached graph if the version matches.
|
|
107
|
+
* Otherwise invokes the builder, caches the result, and returns it.
|
|
108
|
+
*
|
|
109
|
+
* @param path Absolute file path
|
|
110
|
+
* @param version Script version string from the TS project service
|
|
111
|
+
* @param build Builder function invoked on cache miss
|
|
112
|
+
*/
|
|
113
|
+
getSolidGraph(path, version, build) {
|
|
114
|
+
const key = canonicalPath(path);
|
|
115
|
+
const cached = this.solids.get(key);
|
|
116
|
+
if (cached !== void 0 && cached.version === version) {
|
|
117
|
+
if (this.log.enabled) this.log.debug(`getSolidGraph HIT: ${key} v=${version}`);
|
|
118
|
+
return cached.graph;
|
|
119
|
+
}
|
|
120
|
+
if (this.log.enabled) this.log.debug(`getSolidGraph MISS: ${key} v=${version} (was ${cached?.version ?? "uncached"})`);
|
|
121
|
+
const t0 = performance.now();
|
|
122
|
+
const graph = build();
|
|
123
|
+
this.solids.set(key, { version, graph });
|
|
124
|
+
this.solidGeneration++;
|
|
125
|
+
if (this.log.enabled) this.log.debug(`getSolidGraph BUILT: ${key} v=${version} in ${performance.now() - t0}ms (${this.solids.size} total) solidGen=${this.solidGeneration}`);
|
|
126
|
+
return graph;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Get the cached CSSGraph, or rebuild it.
|
|
130
|
+
*
|
|
131
|
+
* Returns the cached graph if the generation matches the current
|
|
132
|
+
* CSS generation counter. Otherwise invokes the builder, caches
|
|
133
|
+
* the result at the current generation, and returns it.
|
|
134
|
+
*
|
|
135
|
+
* @param build Builder function invoked on cache miss
|
|
136
|
+
*/
|
|
137
|
+
getCSSGraph(build) {
|
|
138
|
+
if (this.css !== null && this.css.generation === this.cssGeneration) {
|
|
139
|
+
if (this.log.enabled) this.log.debug(`getCSSGraph HIT: gen=${this.cssGeneration}`);
|
|
140
|
+
return this.css.graph;
|
|
141
|
+
}
|
|
142
|
+
if (this.log.enabled) this.log.debug(`getCSSGraph MISS: currentGen=${this.cssGeneration} cachedGen=${this.css?.generation ?? "none"}`);
|
|
143
|
+
const t0 = performance.now();
|
|
144
|
+
const graph = build();
|
|
145
|
+
this.css = { generation: this.cssGeneration, graph };
|
|
146
|
+
if (this.log.enabled) this.log.debug(`getCSSGraph BUILT: gen=${this.cssGeneration} in ${performance.now() - t0}ms`);
|
|
147
|
+
return graph;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Get or build a LayoutGraph for current Solid/CSS cache state.
|
|
151
|
+
*
|
|
152
|
+
* Returns cached LayoutGraph when both Solid signature (path+version)
|
|
153
|
+
* and CSS generation match. Otherwise invokes the builder.
|
|
154
|
+
*
|
|
155
|
+
* @param build Builder function invoked on cache miss
|
|
156
|
+
*/
|
|
157
|
+
getLayoutGraph(build) {
|
|
158
|
+
const solidGen = this.solidGeneration;
|
|
159
|
+
const cssGen = this.cssGeneration;
|
|
160
|
+
if (this.layout !== null && this.layout.solidGeneration === solidGen && this.layout.cssGeneration === cssGen) {
|
|
161
|
+
if (this.log.enabled) this.log.debug(`getLayoutGraph HIT: solidGen=${solidGen} cssGen=${cssGen}`);
|
|
162
|
+
return this.layout.graph;
|
|
163
|
+
}
|
|
164
|
+
if (this.log.enabled) this.log.debug(
|
|
165
|
+
`getLayoutGraph MISS: solidGen=${solidGen} cssGen=${cssGen} cached=${this.layout !== null}`
|
|
166
|
+
);
|
|
167
|
+
const t0 = performance.now();
|
|
168
|
+
const graph = build();
|
|
169
|
+
this.layout = {
|
|
170
|
+
solidGeneration: solidGen,
|
|
171
|
+
cssGeneration: cssGen,
|
|
172
|
+
graph
|
|
173
|
+
};
|
|
174
|
+
if (this.log.enabled) this.log.debug(`getLayoutGraph BUILT: in ${performance.now() - t0}ms`);
|
|
175
|
+
return graph;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Invalidate cached graphs affected by a file change.
|
|
179
|
+
*
|
|
180
|
+
* Classifies the path and invalidates the appropriate cache:
|
|
181
|
+
* solid files evict their per-file SolidGraph, CSS files bump
|
|
182
|
+
* the CSSGraph generation counter.
|
|
183
|
+
*
|
|
184
|
+
* @param path Absolute file path that changed
|
|
185
|
+
*/
|
|
186
|
+
invalidate(path) {
|
|
187
|
+
const key = canonicalPath(path);
|
|
188
|
+
const kind = classifyFile(key);
|
|
189
|
+
if (this.log.enabled) this.log.debug(`invalidate: ${key} kind=${kind} solids=${this.solids.size} hasCrossFileResults=${this.crossFileResults !== null} hasLayout=${this.layout !== null}`);
|
|
190
|
+
if (kind === "solid") {
|
|
191
|
+
const had = this.solids.has(key);
|
|
192
|
+
this.solids.delete(key);
|
|
193
|
+
this.crossFileDiagnostics.delete(key);
|
|
194
|
+
this.crossFileResults = null;
|
|
195
|
+
this.solidGeneration++;
|
|
196
|
+
this.layout = null;
|
|
197
|
+
if (this.log.enabled) this.log.debug(`invalidate SOLID: ${key} wasInCache=${had} solids=${this.solids.size} solidGen=${this.solidGeneration}`);
|
|
198
|
+
}
|
|
199
|
+
if (kind === "css") {
|
|
200
|
+
this.crossFileDiagnostics.delete(key);
|
|
201
|
+
this.crossFileResults = null;
|
|
202
|
+
this.cssGeneration++;
|
|
203
|
+
this.css = null;
|
|
204
|
+
this.layout = null;
|
|
205
|
+
if (this.log.enabled) this.log.debug(`invalidate CSS: ${key} newCssGen=${this.cssGeneration}`);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Invalidate all cached graphs.
|
|
210
|
+
*
|
|
211
|
+
* Called on workspace-level events like config changes.
|
|
212
|
+
*/
|
|
213
|
+
invalidateAll() {
|
|
214
|
+
if (this.log.enabled) this.log.debug(`invalidateAll: solids=${this.solids.size} solidGen=${this.solidGeneration} cssGen=${this.cssGeneration}`);
|
|
215
|
+
this.solids.clear();
|
|
216
|
+
this.crossFileDiagnostics.clear();
|
|
217
|
+
this.crossFileResults = null;
|
|
218
|
+
this.solidGeneration++;
|
|
219
|
+
this.cssGeneration++;
|
|
220
|
+
this.css = null;
|
|
221
|
+
this.layout = null;
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Get all cached SolidGraphs.
|
|
225
|
+
*
|
|
226
|
+
* Returns a snapshot array of all currently-cached graphs.
|
|
227
|
+
* Used by cross-file analysis which needs all SolidGraphs.
|
|
228
|
+
*/
|
|
229
|
+
getAllSolidGraphs() {
|
|
230
|
+
if (this.log.enabled) this.log.debug(`getAllSolidGraphs: ${this.solids.size} graphs`);
|
|
231
|
+
const out = new Array(this.solids.size);
|
|
232
|
+
let i = 0;
|
|
233
|
+
for (const entry of this.solids.values()) {
|
|
234
|
+
out[i++] = entry.graph;
|
|
235
|
+
}
|
|
236
|
+
return out;
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Get the cached CSSGraph, or null if not cached.
|
|
240
|
+
*/
|
|
241
|
+
getCachedCSSGraph() {
|
|
242
|
+
return this.css?.graph ?? null;
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Get the cached LayoutGraph, or null if not cached.
|
|
246
|
+
*/
|
|
247
|
+
getCachedLayoutGraph() {
|
|
248
|
+
return this.layout?.graph ?? null;
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Get cached cross-file diagnostics for a file path.
|
|
252
|
+
*
|
|
253
|
+
* Returns the previous cross-file results so single-file-only
|
|
254
|
+
* re-analysis (during typing) can merge them without re-running
|
|
255
|
+
* cross-file rules.
|
|
256
|
+
*
|
|
257
|
+
* @param path Absolute file path
|
|
258
|
+
*/
|
|
259
|
+
getCachedCrossFileDiagnostics(path) {
|
|
260
|
+
return this.crossFileDiagnostics.get(canonicalPath(path)) ?? [];
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Store cross-file diagnostics for a file path.
|
|
264
|
+
*
|
|
265
|
+
* @param path Absolute file path
|
|
266
|
+
* @param diagnostics Cross-file diagnostics for this path
|
|
267
|
+
*/
|
|
268
|
+
setCachedCrossFileDiagnostics(path, diagnostics) {
|
|
269
|
+
this.crossFileDiagnostics.set(canonicalPath(path), diagnostics);
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Get workspace-level cross-file results if the underlying graphs haven't changed.
|
|
273
|
+
*
|
|
274
|
+
* Returns the full per-file map when the solid signature and CSS generation
|
|
275
|
+
* match, meaning no graphs were rebuilt since the last run. Returns null
|
|
276
|
+
* when results are stale and `runCrossFileRules` must re-execute.
|
|
277
|
+
*/
|
|
278
|
+
getCachedCrossFileResults() {
|
|
279
|
+
if (this.crossFileResults === null) {
|
|
280
|
+
this.log.debug("getCachedCrossFileResults: null (no cached results)");
|
|
281
|
+
return null;
|
|
282
|
+
}
|
|
283
|
+
const solidMatch = this.crossFileResults.solidGeneration === this.solidGeneration;
|
|
284
|
+
const cssMatch = this.crossFileResults.cssGeneration === this.cssGeneration;
|
|
285
|
+
if (solidMatch && cssMatch) {
|
|
286
|
+
if (this.log.enabled) this.log.debug(`getCachedCrossFileResults HIT: ${this.crossFileResults?.byFile.size} files`);
|
|
287
|
+
return this.crossFileResults.byFile;
|
|
288
|
+
}
|
|
289
|
+
if (this.log.enabled) this.log.debug(
|
|
290
|
+
`getCachedCrossFileResults MISS: solidMatch=${solidMatch} cssMatch=${cssMatch} cachedSolidGen=${this.crossFileResults?.solidGeneration} currentSolidGen=${this.solidGeneration} cachedCssGen=${this.crossFileResults?.cssGeneration} currentCssGen=${this.cssGeneration}`
|
|
291
|
+
);
|
|
292
|
+
return null;
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Store workspace-level cross-file results bucketed by file.
|
|
296
|
+
*
|
|
297
|
+
* Called after `runCrossFileRules` completes. Captures the current
|
|
298
|
+
* solid signature and CSS generation so subsequent lookups are O(1)
|
|
299
|
+
* until a graph changes.
|
|
300
|
+
*
|
|
301
|
+
* @param allDiagnostics All cross-file diagnostics from the workspace run
|
|
302
|
+
*/
|
|
303
|
+
setCachedCrossFileResults(allDiagnostics) {
|
|
304
|
+
const byFile = /* @__PURE__ */ new Map();
|
|
305
|
+
for (let i = 0, len = allDiagnostics.length; i < len; i++) {
|
|
306
|
+
const d = allDiagnostics[i];
|
|
307
|
+
if (!d) continue;
|
|
308
|
+
let arr = byFile.get(d.file);
|
|
309
|
+
if (!arr) {
|
|
310
|
+
arr = [];
|
|
311
|
+
byFile.set(d.file, arr);
|
|
312
|
+
}
|
|
313
|
+
arr.push(d);
|
|
314
|
+
}
|
|
315
|
+
this.crossFileResults = {
|
|
316
|
+
solidGeneration: this.solidGeneration,
|
|
317
|
+
cssGeneration: this.cssGeneration,
|
|
318
|
+
byFile
|
|
319
|
+
};
|
|
320
|
+
if (this.log.enabled) this.log.debug(
|
|
321
|
+
`setCachedCrossFileResults: ${allDiagnostics.length} diags across ${byFile.size} files solidGen=${this.solidGeneration} cssGen=${this.cssGeneration}`
|
|
322
|
+
);
|
|
323
|
+
for (const [file, diagnostics] of byFile) {
|
|
324
|
+
this.crossFileDiagnostics.set(file, diagnostics);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
/** Number of cached SolidGraphs. */
|
|
328
|
+
get solidCount() {
|
|
329
|
+
return this.solids.size;
|
|
330
|
+
}
|
|
331
|
+
/** The logger instance used by this cache. */
|
|
332
|
+
get logger() {
|
|
333
|
+
return this.log;
|
|
334
|
+
}
|
|
335
|
+
};
|
|
336
|
+
export {
|
|
337
|
+
CSSPlugin,
|
|
338
|
+
GraphCache,
|
|
339
|
+
RULES,
|
|
340
|
+
RULES_BY_CATEGORY,
|
|
341
|
+
SolidPlugin,
|
|
342
|
+
analyzeInput,
|
|
343
|
+
buildCSSGraph,
|
|
344
|
+
buildLayoutGraph,
|
|
345
|
+
buildSolidGraph,
|
|
346
|
+
createOverrideEmit,
|
|
347
|
+
createRunner,
|
|
348
|
+
getRule,
|
|
349
|
+
parseContent,
|
|
350
|
+
parseContentWithProgram,
|
|
351
|
+
parseFile,
|
|
352
|
+
resolveTailwindValidator,
|
|
353
|
+
runCrossFileRules,
|
|
354
|
+
runSolidRules,
|
|
355
|
+
scanDependencyCustomProperties,
|
|
356
|
+
setActivePolicy
|
|
357
|
+
};
|
|
358
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/runner.ts","../src/cache.ts"],"sourcesContent":["/**\n * Runner - Plugin-agnostic runner for ganko\n *\n * The runner takes a configuration with plugins and runs them against files.\n * It never stores typed graphs - plugins handle their own graph building\n * and rule execution internally via the analyze() method.\n *\n * Rule overrides allow callers (LSP, CLI) to disable rules or remap their\n * severity without modifying rule definitions. The runner intercepts the\n * Emit callback to enforce overrides before diagnostics reach the caller.\n */\nimport type { Diagnostic } from \"./diagnostic\"\nimport type { Plugin, Emit } from \"./graph\"\nimport type { RuleOverrides } from \"@drskillissue/ganko-shared\"\n\n/** Runner configuration */\nexport interface RunnerConfig {\n readonly plugins: readonly Plugin<string>[]\n readonly rules?: RuleOverrides\n}\n\n/** Runner interface */\nexport interface Runner {\n run(files: readonly string[]): readonly Diagnostic[]\n /** Replace rule overrides. Takes effect on the next run() call. */\n setRuleOverrides(overrides: RuleOverrides): void\n}\n\n/**\n * Build an Emit wrapper that enforces rule overrides.\n *\n * @param target - The underlying emit that collects diagnostics\n * @param overrides - Current rule override map\n * @returns Wrapped emit that suppresses/remaps per overrides\n */\nexport function createOverrideEmit(target: Emit, overrides: RuleOverrides): Emit {\n return (d) => {\n const override = overrides[d.rule]\n if (override === undefined) { target(d); return }\n if (override === \"off\") return\n if (override !== d.severity) {\n target({ ...d, severity: override })\n return\n }\n target(d)\n }\n}\n\n/**\n * Create a runner from configuration.\n *\n * @example\n * ```ts\n * const runner = createRunner({\n * plugins: [SolidPlugin, CSSPlugin, CrossFilePlugin],\n * rules: { \"missing-jsdoc-comments\": \"off\", \"signal-call\": \"warn\" },\n * })\n * const diagnostics = runner.run(projectFiles)\n * ```\n */\nexport function createRunner(config: RunnerConfig): Runner {\n let overrides: RuleOverrides = config.rules ?? {}\n\n return {\n run(files) {\n const diagnostics: Diagnostic[] = []\n const raw: Emit = (d) => diagnostics.push(d)\n const hasOverrides = Object.keys(overrides).length > 0\n const emit = hasOverrides ? createOverrideEmit(raw, overrides) : raw\n for (const plugin of config.plugins) {\n plugin.analyze(files, emit)\n }\n return diagnostics\n },\n\n setRuleOverrides(next) {\n overrides = next\n },\n }\n}\n","/**\n * GraphCache — Versioned cache for SolidGraph, CSSGraph, and LayoutGraph instances.\n *\n * Eliminates redundant graph construction in the LSP server by caching\n * per-file SolidGraphs (keyed by path + script version), a single\n * CSSGraph invalidated via a monotonic generation counter, and a\n * LayoutGraph invalidated by Solid/CSS signatures.\n *\n * The cache does not perform I/O or parsing — callers supply builder\n * functions that are invoked only on cache miss.\n */\nimport { canonicalPath, classifyFile, noopLogger } from \"@drskillissue/ganko-shared\"\nimport type { Logger } from \"@drskillissue/ganko-shared\"\nimport type { Diagnostic } from \"./diagnostic\"\nimport type { SolidGraph } from \"./solid/impl\"\nimport type { CSSGraph } from \"./css/impl\"\nimport type { LayoutGraph } from \"./cross-file/layout/graph\"\n\ninterface CachedSolid {\n readonly version: string\n readonly graph: SolidGraph\n}\n\ninterface CachedCSS {\n readonly generation: number\n readonly graph: CSSGraph\n}\n\ninterface CachedLayout {\n readonly solidGeneration: number\n readonly cssGeneration: number\n readonly graph: LayoutGraph\n}\n\ninterface CachedCrossFileResults {\n readonly solidGeneration: number\n readonly cssGeneration: number\n readonly byFile: ReadonlyMap<string, readonly Diagnostic[]>\n}\n\n/**\n * Versioned cache for SolidGraph, CSSGraph, and LayoutGraph instances.\n *\n * SolidGraphs are cached per file path with a version string.\n * The CSSGraph is a single instance covering all CSS files,\n * invalidated via a monotonic generation counter bumped by\n * `invalidate()` or `invalidateAll()`.\n */\nexport class GraphCache {\n private readonly log: Logger\n private readonly solids = new Map<string, CachedSolid>()\n private readonly crossFileDiagnostics = new Map<string, readonly Diagnostic[]>()\n private crossFileResults: CachedCrossFileResults | null = null\n private css: CachedCSS | null = null\n private solidGeneration = 0\n private cssGeneration = 0\n private layout: CachedLayout | null = null\n\n constructor(log?: Logger) {\n this.log = log ?? noopLogger\n }\n\n /**\n * Check if a SolidGraph is cached and current for a file path.\n *\n * Allows callers to skip builder allocation when the cache is warm.\n *\n * @param path Absolute file path\n * @param version Script version string from the TS project service\n */\n hasSolidGraph(path: string, version: string): boolean {\n const key = canonicalPath(path)\n const cached = this.solids.get(key)\n const hit = cached !== undefined && cached.version === version\n if (this.log.enabled) this.log.debug(`hasSolidGraph: ${key} v=${version} cached=${cached?.version ?? \"none\"} hit=${hit} (${this.solids.size} total)`)\n return hit\n }\n\n /**\n * Store a pre-built SolidGraph in the cache.\n *\n * Used by the CLI lint command which builds graphs during single-file\n * analysis and pre-populates the cache for cross-file reuse.\n *\n * @param path Absolute file path\n * @param version Script version string from the TS project service\n * @param graph Pre-built SolidGraph\n */\n setSolidGraph(path: string, version: string, graph: SolidGraph): void {\n const key = canonicalPath(path)\n this.solids.set(key, { version, graph })\n this.solidGeneration++\n if (this.log.enabled) this.log.debug(`setSolidGraph: ${key} v=${version} (${this.solids.size} total) solidGen=${this.solidGeneration}`)\n }\n\n /**\n * Get or build a SolidGraph for a file path.\n *\n * Returns the cached graph if the version matches.\n * Otherwise invokes the builder, caches the result, and returns it.\n *\n * @param path Absolute file path\n * @param version Script version string from the TS project service\n * @param build Builder function invoked on cache miss\n */\n getSolidGraph(path: string, version: string, build: () => SolidGraph): SolidGraph {\n const key = canonicalPath(path)\n const cached = this.solids.get(key)\n if (cached !== undefined && cached.version === version) {\n if (this.log.enabled) this.log.debug(`getSolidGraph HIT: ${key} v=${version}`)\n return cached.graph\n }\n\n if (this.log.enabled) this.log.debug(`getSolidGraph MISS: ${key} v=${version} (was ${cached?.version ?? \"uncached\"})`)\n const t0 = performance.now()\n const graph = build()\n this.solids.set(key, { version, graph })\n this.solidGeneration++\n if (this.log.enabled) this.log.debug(`getSolidGraph BUILT: ${key} v=${version} in ${performance.now() - t0}ms (${this.solids.size} total) solidGen=${this.solidGeneration}`)\n return graph\n }\n\n /**\n * Get the cached CSSGraph, or rebuild it.\n *\n * Returns the cached graph if the generation matches the current\n * CSS generation counter. Otherwise invokes the builder, caches\n * the result at the current generation, and returns it.\n *\n * @param build Builder function invoked on cache miss\n */\n getCSSGraph(build: () => CSSGraph): CSSGraph {\n if (this.css !== null && this.css.generation === this.cssGeneration) {\n if (this.log.enabled) this.log.debug(`getCSSGraph HIT: gen=${this.cssGeneration}`)\n return this.css.graph\n }\n\n if (this.log.enabled) this.log.debug(`getCSSGraph MISS: currentGen=${this.cssGeneration} cachedGen=${this.css?.generation ?? \"none\"}`)\n const t0 = performance.now()\n const graph = build()\n this.css = { generation: this.cssGeneration, graph }\n if (this.log.enabled) this.log.debug(`getCSSGraph BUILT: gen=${this.cssGeneration} in ${performance.now() - t0}ms`)\n return graph\n }\n\n /**\n * Get or build a LayoutGraph for current Solid/CSS cache state.\n *\n * Returns cached LayoutGraph when both Solid signature (path+version)\n * and CSS generation match. Otherwise invokes the builder.\n *\n * @param build Builder function invoked on cache miss\n */\n getLayoutGraph(build: () => LayoutGraph): LayoutGraph {\n const solidGen = this.solidGeneration\n const cssGen = this.cssGeneration\n\n if (\n this.layout !== null\n && this.layout.solidGeneration === solidGen\n && this.layout.cssGeneration === cssGen\n ) {\n if (this.log.enabled) this.log.debug(`getLayoutGraph HIT: solidGen=${solidGen} cssGen=${cssGen}`)\n return this.layout.graph\n }\n\n if (this.log.enabled) this.log.debug(\n `getLayoutGraph MISS: solidGen=${solidGen} cssGen=${cssGen} `\n + `cached=${this.layout !== null}`,\n )\n\n const t0 = performance.now()\n const graph = build()\n this.layout = {\n solidGeneration: solidGen,\n cssGeneration: cssGen,\n graph,\n }\n if (this.log.enabled) this.log.debug(`getLayoutGraph BUILT: in ${performance.now() - t0}ms`)\n return graph\n }\n\n /**\n * Invalidate cached graphs affected by a file change.\n *\n * Classifies the path and invalidates the appropriate cache:\n * solid files evict their per-file SolidGraph, CSS files bump\n * the CSSGraph generation counter.\n *\n * @param path Absolute file path that changed\n */\n invalidate(path: string): void {\n const key = canonicalPath(path)\n const kind = classifyFile(key)\n if (this.log.enabled) this.log.debug(`invalidate: ${key} kind=${kind} solids=${this.solids.size} hasCrossFileResults=${this.crossFileResults !== null} hasLayout=${this.layout !== null}`)\n if (kind === \"solid\") {\n const had = this.solids.has(key)\n this.solids.delete(key)\n this.crossFileDiagnostics.delete(key)\n this.crossFileResults = null\n this.solidGeneration++\n this.layout = null\n if (this.log.enabled) this.log.debug(`invalidate SOLID: ${key} wasInCache=${had} solids=${this.solids.size} solidGen=${this.solidGeneration}`)\n }\n if (kind === \"css\") {\n this.crossFileDiagnostics.delete(key)\n this.crossFileResults = null\n this.cssGeneration++\n this.css = null\n this.layout = null\n if (this.log.enabled) this.log.debug(`invalidate CSS: ${key} newCssGen=${this.cssGeneration}`)\n }\n }\n\n /**\n * Invalidate all cached graphs.\n *\n * Called on workspace-level events like config changes.\n */\n invalidateAll(): void {\n if (this.log.enabled) this.log.debug(`invalidateAll: solids=${this.solids.size} solidGen=${this.solidGeneration} cssGen=${this.cssGeneration}`)\n this.solids.clear()\n this.crossFileDiagnostics.clear()\n this.crossFileResults = null\n this.solidGeneration++\n this.cssGeneration++\n this.css = null\n this.layout = null\n }\n\n /**\n * Get all cached SolidGraphs.\n *\n * Returns a snapshot array of all currently-cached graphs.\n * Used by cross-file analysis which needs all SolidGraphs.\n */\n getAllSolidGraphs(): readonly SolidGraph[] {\n if (this.log.enabled) this.log.debug(`getAllSolidGraphs: ${this.solids.size} graphs`)\n const out: SolidGraph[] = new Array(this.solids.size)\n let i = 0\n for (const entry of this.solids.values()) {\n out[i++] = entry.graph\n }\n return out\n }\n\n /**\n * Get the cached CSSGraph, or null if not cached.\n */\n getCachedCSSGraph(): CSSGraph | null {\n return this.css?.graph ?? null\n }\n\n /**\n * Get the cached LayoutGraph, or null if not cached.\n */\n getCachedLayoutGraph(): LayoutGraph | null {\n return this.layout?.graph ?? null\n }\n\n /**\n * Get cached cross-file diagnostics for a file path.\n *\n * Returns the previous cross-file results so single-file-only\n * re-analysis (during typing) can merge them without re-running\n * cross-file rules.\n *\n * @param path Absolute file path\n */\n getCachedCrossFileDiagnostics(path: string): readonly Diagnostic[] {\n return this.crossFileDiagnostics.get(canonicalPath(path)) ?? []\n }\n\n /**\n * Store cross-file diagnostics for a file path.\n *\n * @param path Absolute file path\n * @param diagnostics Cross-file diagnostics for this path\n */\n setCachedCrossFileDiagnostics(path: string, diagnostics: readonly Diagnostic[]): void {\n this.crossFileDiagnostics.set(canonicalPath(path), diagnostics)\n }\n\n /**\n * Get workspace-level cross-file results if the underlying graphs haven't changed.\n *\n * Returns the full per-file map when the solid signature and CSS generation\n * match, meaning no graphs were rebuilt since the last run. Returns null\n * when results are stale and `runCrossFileRules` must re-execute.\n */\n getCachedCrossFileResults(): ReadonlyMap<string, readonly Diagnostic[]> | null {\n if (this.crossFileResults === null) {\n this.log.debug(\"getCachedCrossFileResults: null (no cached results)\")\n return null\n }\n const solidMatch = this.crossFileResults.solidGeneration === this.solidGeneration\n const cssMatch = this.crossFileResults.cssGeneration === this.cssGeneration\n if (solidMatch && cssMatch) {\n if (this.log.enabled) this.log.debug(`getCachedCrossFileResults HIT: ${this.crossFileResults?.byFile.size} files`)\n return this.crossFileResults.byFile\n }\n if (this.log.enabled) this.log.debug(\n `getCachedCrossFileResults MISS: solidMatch=${solidMatch} cssMatch=${cssMatch} `\n + `cachedSolidGen=${this.crossFileResults?.solidGeneration} currentSolidGen=${this.solidGeneration} `\n + `cachedCssGen=${this.crossFileResults?.cssGeneration} currentCssGen=${this.cssGeneration}`,\n )\n return null\n }\n\n /**\n * Store workspace-level cross-file results bucketed by file.\n *\n * Called after `runCrossFileRules` completes. Captures the current\n * solid signature and CSS generation so subsequent lookups are O(1)\n * until a graph changes.\n *\n * @param allDiagnostics All cross-file diagnostics from the workspace run\n */\n setCachedCrossFileResults(allDiagnostics: readonly Diagnostic[]): void {\n const byFile = new Map<string, Diagnostic[]>()\n for (let i = 0, len = allDiagnostics.length; i < len; i++) {\n const d = allDiagnostics[i]\n if (!d) continue\n let arr = byFile.get(d.file)\n if (!arr) {\n arr = []\n byFile.set(d.file, arr)\n }\n arr.push(d)\n }\n this.crossFileResults = {\n solidGeneration: this.solidGeneration,\n cssGeneration: this.cssGeneration,\n byFile,\n }\n if (this.log.enabled) this.log.debug(\n `setCachedCrossFileResults: ${allDiagnostics.length} diags across ${byFile.size} files `\n + `solidGen=${this.solidGeneration} cssGen=${this.cssGeneration}`,\n )\n /* Also update the per-file cache used during typing (when cross-file\n analysis is skipped and previous results are reused). */\n for (const [file, diagnostics] of byFile) {\n this.crossFileDiagnostics.set(file, diagnostics)\n }\n }\n\n /** Number of cached SolidGraphs. */\n get solidCount(): number {\n return this.solids.size\n }\n\n /** The logger instance used by this cache. */\n get logger(): Logger {\n return this.log\n }\n\n\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAmCO,SAAS,mBAAmB,QAAc,WAAgC;AAC/E,SAAO,CAAC,MAAM;AACZ,UAAM,WAAW,UAAU,EAAE,IAAI;AACjC,QAAI,aAAa,QAAW;AAAE,aAAO,CAAC;AAAG;AAAA,IAAO;AAChD,QAAI,aAAa,MAAO;AACxB,QAAI,aAAa,EAAE,UAAU;AAC3B,aAAO,EAAE,GAAG,GAAG,UAAU,SAAS,CAAC;AACnC;AAAA,IACF;AACA,WAAO,CAAC;AAAA,EACV;AACF;AAcO,SAAS,aAAa,QAA8B;AACzD,MAAI,YAA2B,OAAO,SAAS,CAAC;AAEhD,SAAO;AAAA,IACL,IAAI,OAAO;AACT,YAAM,cAA4B,CAAC;AACnC,YAAM,MAAY,CAAC,MAAM,YAAY,KAAK,CAAC;AAC3C,YAAM,eAAe,OAAO,KAAK,SAAS,EAAE,SAAS;AACrD,YAAM,OAAO,eAAe,mBAAmB,KAAK,SAAS,IAAI;AACjE,iBAAW,UAAU,OAAO,SAAS;AACnC,eAAO,QAAQ,OAAO,IAAI;AAAA,MAC5B;AACA,aAAO;AAAA,IACT;AAAA,IAEA,iBAAiB,MAAM;AACrB,kBAAY;AAAA,IACd;AAAA,EACF;AACF;;;ACpEA,SAAS,eAAe,cAAc,kBAAkB;AAqCjD,IAAM,aAAN,MAAiB;AAAA,EACL;AAAA,EACA,SAAS,oBAAI,IAAyB;AAAA,EACtC,uBAAuB,oBAAI,IAAmC;AAAA,EACvE,mBAAkD;AAAA,EAClD,MAAwB;AAAA,EACxB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