@callidescope/graph 0.0.58 → 0.0.59

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/CHANGELOG.md CHANGED
@@ -1,3 +1,14 @@
1
+ ## 0.0.59 (2026-11-03)
2
+
3
+ ### 🔥 Performance
4
+
5
+ - **callidescope:** ⚡️ cache file-system probes across a run's programs ([#2098](https://github.com/organizzolini/codebase/pull/2098))
6
+
7
+ ### 🧱 Updated Dependencies
8
+
9
+ - Updated callidescope-configuration to 0.0.60
10
+ - Updated callidescope-core to 0.0.59
11
+
1
12
  ## 0.0.58 (2026-11-03)
2
13
 
3
14
  ### 🧱 Updated Dependencies
package/README.md CHANGED
@@ -44,13 +44,13 @@ Call stacks traced through `projects/ic-suite/callidescope/callidescope-graph`,
44
44
 
45
45
  | Measure | Value |
46
46
  | --- | --- |
47
- | Callables | 207 |
47
+ | Callables | 209 |
48
48
  | Files | 63 |
49
- | Calls traced | 197 |
49
+ | Calls traced | 201 |
50
50
  | Call stacks | 4 |
51
51
  | Deepest stack | 5 |
52
52
  | Stacks through recursion | 0 |
53
- | Unfollowable calls | 5 |
53
+ | Unfollowable calls | 6 |
54
54
 
55
55
  ### Limits
56
56
 
@@ -69,11 +69,11 @@ What this project is judged against, as declared in its own `callidescope.config
69
69
  🚀 ProgramService.resolveProjectFiles(project: WorkspaceProject): readonly string[] [projects/ic-suite/callidescope/callidescope-graph/src/modules/program/program.service.ts:262]
70
70
  └─> ProgramService.buildProgram(args: { project: WorkspaceProject; workspaceRoot: string; }): ProjectProgram [projects/ic-suite/callidescope/callidescope-graph/src/modules/program/program.service.ts:115]
71
71
  ↳ Builds one project's program, checker, and owned-file set.
72
- └─> CompilerHostService.createHost(args: { options: ts.CompilerOptions; workspaceRoot: string; }): ts.CompilerHost [projects/ic-suite/callidescope/callidescope-graph/src/modules/program/compiler-host.service.ts:76]
72
+ └─> CompilerHostService.createHost(args: { options: ts.CompilerOptions; workspaceRoot: string; }): ts.CompilerHost [projects/ic-suite/callidescope/callidescope-graph/src/modules/program/compiler-host.service.ts:119]
73
73
  ↳ Creates a compiler host that reuses already-parsed source files. `setParentNodes` is on because the rest of the package…
74
- └─> CompilerHostService.resolveModuleCache(options: ts.CompilerOptions, workspaceRoot: string): ts.ModuleResolutionCache [projects/ic-suite/callidescope/callidescope-graph/src/modules/program/compiler-host.service.ts:40]
74
+ └─> CompilerHostService.resolveModuleCache(options: ts.CompilerOptions, workspaceRoot: string): ts.ModuleResolutionCache [projects/ic-suite/callidescope/callidescope-graph/src/modules/program/compiler-host.service.ts:79]
75
75
  ↳ Returns the module resolution cache for one working directory.
76
- └─> CompilerHostService.createModuleResolutionCache(…)(fileName: string): string [projects/ic-suite/callidescope/callidescope-graph/src/modules/program/compiler-host.service.ts:52]
76
+ └─> CompilerHostService.createModuleResolutionCache(…)(fileName: string): string [projects/ic-suite/callidescope/callidescope-graph/src/modules/program/compiler-host.service.ts:91]
77
77
  ```
78
78
 
79
79
  **2. `CallablesService.visit`** — depth 5 · orphan-root
@@ -150,6 +150,7 @@ What this project is judged against, as declared in its own `callidescope.config
150
150
  | `WorkspaceService.findProjectDirectories` | 2 | `WorkspaceService.toWorkspaceRelative`, `WorkspaceService.isExcludedFromScan` | `projects/ic-suite/callidescope/callidescope-graph/src/modules/workspace/workspace.service.ts:66` |
151
151
  | `WorkspaceService.walkImportedProjectClosure` | 2 | `WorkspaceService.resolveOwningProject`, `WorkspaceService.isClosureDestination` | `projects/ic-suite/callidescope/callidescope-graph/src/modules/workspace/workspace.service.ts:342` |
152
152
  | `FileFilterService.isExcludedByOwningProject` | 2 | `WorkspaceService.resolveOwningProject`, `FileFilterService.some(…)` | `projects/ic-suite/callidescope/callidescope-graph/src/modules/workspace/file-filter.service.ts:60` |
153
+ | `CompilerHostService.createHost` | 2 | `CompilerHostService.resolveModuleCache`, `CompilerHostService.memoize` | `projects/ic-suite/callidescope/callidescope-graph/src/modules/program/compiler-host.service.ts:119` |
153
154
  | `ProgramService.readPulledInPaths` | 2 | `ProgramService.toRealPath`, `WorkspaceService.toWorkspaceRelative` | `projects/ic-suite/callidescope/callidescope-graph/src/modules/program/program.service.ts:195` |
154
155
  | `ProgramService.resolveProjectFiles` | 2 | `ProgramService.buildProgram`, `ProgramService.readPulledInPaths` | `projects/ic-suite/callidescope/callidescope-graph/src/modules/program/program.service.ts:262` |
155
156
  | `CallablesService.visit` | 2 | `CallablesService.isCallableDeclaration`, `CallablesService.describe` | `projects/ic-suite/callidescope/callidescope-graph/src/modules/callables/callables.service.ts:49` |
@@ -187,8 +188,7 @@ What this project is judged against, as declared in its own `callidescope.config
187
188
  | `FileFilterService.buildFileFilter` | 1 | `FileFilterService.listIgnoredFiles` | `projects/ic-suite/callidescope/callidescope-graph/src/modules/workspace/file-filter.service.ts:137` |
188
189
  | `FileFilterService.isExcluded` | 1 | `FileFilterService.some(…)` | `projects/ic-suite/callidescope/callidescope-graph/src/modules/workspace/file-filter.service.ts:161` |
189
190
  | `FileFilterService.isExcluded` | 1 | `FileFilterService.isExcludedByOwningProject` | `projects/ic-suite/callidescope/callidescope-graph/src/modules/workspace/file-filter.service.ts:206` |
190
- | `CompilerHostService.resolveModuleCache` | 1 | `CompilerHostService.createModuleResolutionCache(…)` | `projects/ic-suite/callidescope/callidescope-graph/src/modules/program/compiler-host.service.ts:40` |
191
- | `CompilerHostService.createHost` | 1 | `CompilerHostService.resolveModuleCache` | `projects/ic-suite/callidescope/callidescope-graph/src/modules/program/compiler-host.service.ts:76` |
191
+ | `CompilerHostService.resolveModuleCache` | 1 | `CompilerHostService.createModuleResolutionCache(…)` | `projects/ic-suite/callidescope/callidescope-graph/src/modules/program/compiler-host.service.ts:79` |
192
192
  | `ProgramService.map(…)` | 1 | `ProgramService.toRealPath` | `projects/ic-suite/callidescope/callidescope-graph/src/modules/program/program.service.ts:133` |
193
193
  | `CallablesService.collect` | 1 | `CallablesService.collectFromProgram` | `projects/ic-suite/callidescope/callidescope-graph/src/modules/callables/callables.service.ts:191` |
194
194
  | `ExternalService.isExternal` | 1 | `ExternalService.computeVerdict` | `projects/ic-suite/callidescope/callidescope-graph/src/modules/classes/external.service.ts:64` |
@@ -635,14 +635,14 @@ graph LR
635
635
 
636
636
  ### Project
637
637
 
638
- ![Lines of Code](https://img.shields.io/badge/Lines_of_Code-12164-22c55e?style=flat-square)
639
- ![Repository Size](https://img.shields.io/badge/Repository_Size-400.20_kB-6b7280?style=flat-square)
638
+ ![Lines of Code](https://img.shields.io/badge/Lines_of_Code-12280-22c55e?style=flat-square)
639
+ ![Repository Size](https://img.shields.io/badge/Repository_Size-404.31_kB-6b7280?style=flat-square)
640
640
  ![Folders](https://img.shields.io/badge/Folders-12-4a4a4a?style=flat-square)
641
641
  ![Source Files](https://img.shields.io/badge/Source_Files-89-3178c6?style=flat-square)
642
642
 
643
643
  ### Measured Targets
644
644
 
645
- ![Compiled JavaScript Size](https://img.shields.io/badge/Compiled_JavaScript_Size-14.34_kB_gzip-6b7280?style=flat-square)
645
+ ![Compiled JavaScript Size](https://img.shields.io/badge/Compiled_JavaScript_Size-14.51_kB_gzip-6b7280?style=flat-square)
646
646
 
647
647
  ### TypeScript
648
648
 
@@ -651,7 +651,7 @@ graph LR
651
651
  ![Generic Declarations](https://img.shields.io/badge/Generic_Declarations-1-0369a1?style=flat-square)
652
652
  ![Enums](https://img.shields.io/badge/Enums-0-f97316?style=flat-square)
653
653
  ![Decorators](https://img.shields.io/badge/Decorators-31-db2777?style=flat-square)
654
- ![Doc Comments](https://img.shields.io/badge/Doc_Comments-305-6366f1?style=flat-square)
654
+ ![Doc Comments](https://img.shields.io/badge/Doc_Comments-307-6366f1?style=flat-square)
655
655
  ![Static Methods](https://img.shields.io/badge/Static_Methods-0-166534?style=flat-square)
656
656
 
657
657
  ### JavaScript
@@ -660,15 +660,15 @@ graph LR
660
660
  ![Test Files](https://img.shields.io/badge/Test_Files-22-10b981?style=flat-square)
661
661
  ![External Packages](https://img.shields.io/badge/External_Packages-14-8b5cf6?style=flat-square)
662
662
  ![Classes](https://img.shields.io/badge/Classes-32-7c3aed?style=flat-square)
663
- ![Functions](https://img.shields.io/badge/Functions-531-16a34a?style=flat-square)
664
- ![Methods](https://img.shields.io/badge/Methods-184-15803d?style=flat-square)
665
- ![Sync Functions](https://img.shields.io/badge/Sync_Functions-651-4ade80?style=flat-square)
666
- ![Async Functions](https://img.shields.io/badge/Async_Functions-64-059669?style=flat-square)
667
- ![Constants](https://img.shields.io/badge/Constants-742-dc2626?style=flat-square)
663
+ ![Functions](https://img.shields.io/badge/Functions-534-16a34a?style=flat-square)
664
+ ![Methods](https://img.shields.io/badge/Methods-186-15803d?style=flat-square)
665
+ ![Sync Functions](https://img.shields.io/badge/Sync_Functions-653-4ade80?style=flat-square)
666
+ ![Async Functions](https://img.shields.io/badge/Async_Functions-67-059669?style=flat-square)
667
+ ![Constants](https://img.shields.io/badge/Constants-759-dc2626?style=flat-square)
668
668
  ![Imports](https://img.shields.io/badge/Imports-444-0284c7?style=flat-square)
669
669
  ![Exported Symbols](https://img.shields.io/badge/Exported_Symbols-124-ea580c?style=flat-square)
670
- ![Comments](https://img.shields.io/badge/Comments-583-64748b?style=flat-square)
671
- ![Comment Lines](https://img.shields.io/badge/Comment_Lines-1270-475569?style=flat-square)
670
+ ![Comments](https://img.shields.io/badge/Comments-587-64748b?style=flat-square)
671
+ ![Comment Lines](https://img.shields.io/badge/Comment_Lines-1281-475569?style=flat-square)
672
672
  ![TODO Comments](https://img.shields.io/badge/TODO_Comments-0-ca8a04?style=flat-square)
673
673
 
674
674
  ### Python
@@ -824,20 +824,20 @@ graph LR
824
824
  ### Markdown
825
825
 
826
826
  ![Markdown Files](https://img.shields.io/badge/Markdown_Files-2-083fa1?style=flat-square)
827
- ![Markdown Lines](https://img.shields.io/badge/Markdown_Lines-623-1f6feb?style=flat-square)
827
+ ![Markdown Lines](https://img.shields.io/badge/Markdown_Lines-634-1f6feb?style=flat-square)
828
828
  ![H1](https://img.shields.io/badge/H1-1-7c3aed?style=flat-square)
829
- ![H2](https://img.shields.io/badge/H2-61-8b5cf6?style=flat-square)
830
- ![H3](https://img.shields.io/badge/H3-72-a78bfa?style=flat-square)
829
+ ![H2](https://img.shields.io/badge/H2-62-8b5cf6?style=flat-square)
830
+ ![H3](https://img.shields.io/badge/H3-74-a78bfa?style=flat-square)
831
831
  ![H4](https://img.shields.io/badge/H4-0-c4b5fd?style=flat-square)
832
832
  ![H5](https://img.shields.io/badge/H5-0-ddd6fe?style=flat-square)
833
833
  ![H6](https://img.shields.io/badge/H6-0-ede9fe?style=flat-square)
834
- ![Paragraphs](https://img.shields.io/badge/Paragraphs-159-64748b?style=flat-square)
835
- ![Lists](https://img.shields.io/badge/Lists-66-16a34a?style=flat-square)
836
- ![List Items](https://img.shields.io/badge/List_Items-139-22c55e?style=flat-square)
834
+ ![Paragraphs](https://img.shields.io/badge/Paragraphs-162-64748b?style=flat-square)
835
+ ![Lists](https://img.shields.io/badge/Lists-68-16a34a?style=flat-square)
836
+ ![List Items](https://img.shields.io/badge/List_Items-142-22c55e?style=flat-square)
837
837
  ![Task List Items](https://img.shields.io/badge/Task_List_Items-0-4ade80?style=flat-square)
838
838
  ![Tables](https://img.shields.io/badge/Tables-2-0284c7?style=flat-square)
839
839
  ![Table Rows](https://img.shields.io/badge/Table_Rows-10-0ea5e9?style=flat-square)
840
- ![Links](https://img.shields.io/badge/Links-16-059669?style=flat-square)
840
+ ![Links](https://img.shields.io/badge/Links-17-059669?style=flat-square)
841
841
  ![Images](https://img.shields.io/badge/Images-0-10b981?style=flat-square)
842
842
  ![Code Blocks](https://img.shields.io/badge/Code_Blocks-11-dc2626?style=flat-square)
843
843
  ![Inline Code](https://img.shields.io/badge/Inline_Code-72-ef4444?style=flat-square)
@@ -561,7 +561,20 @@ export declare const COMMAND_RUNNER_METHOD_NAME = "run";
561
561
  */
562
562
  export declare class CompilerHostService {
563
563
  constructor();
564
+ /**
565
+ * Answers to the file-system questions module resolution asks, shared by
566
+ * every program of a run.
567
+ *
568
+ * One run probes the same `node_modules` paths once per program — about
569
+ * 370,000 `stat` calls over 21,000 distinct paths for `configuration` — and
570
+ * those probes, not parsing, were most of its time. The tree does not change
571
+ * during a run, so an answer stays right until `clear`.
572
+ */
573
+ private readonly directoryExistsCache;
574
+ private readonly fileExistsCache;
575
+ private readonly fileTextCache;
564
576
  private readonly moduleResolutionCaches;
577
+ private readonly realPathCache;
565
578
  /**
566
579
  * Keyed on file name and script target together.
567
580
  *
@@ -570,6 +583,8 @@ export declare class CompilerHostService {
570
583
  * a program that asked for another target is silently wrong.
571
584
  */
572
585
  private readonly sourceFileCache;
586
+ /** Wraps a one-argument host method so each distinct argument asks once. */
587
+ private memoize;
573
588
  /** Returns the module resolution cache for one working directory. */
574
589
  private resolveModuleCache;
575
590
  /** Drops every cached source file, for a host that outlives one run. */
package/dist/src/index.js CHANGED
@@ -509,8 +509,20 @@ b = __decorate([i({
509
509
  // src/modules/program/compiler-host.service.ts
510
510
  var x = class CompilerHostService {
511
511
  constructor() {}
512
+ directoryExistsCache = /* @__PURE__ */ new Map();
513
+ fileExistsCache = /* @__PURE__ */ new Map();
514
+ fileTextCache = /* @__PURE__ */ new Map();
512
515
  moduleResolutionCaches = /* @__PURE__ */ new Map();
516
+ realPathCache = /* @__PURE__ */ new Map();
513
517
  sourceFileCache = /* @__PURE__ */ new Map();
518
+ memoize(e, t) {
519
+ return (n) => {
520
+ let r = e.get(n);
521
+ if (r !== void 0) return r.answer;
522
+ let i = t(n);
523
+ return e.set(n, { answer: i }), i;
524
+ };
525
+ }
514
526
  resolveModuleCache(e, t) {
515
527
  let n = this.moduleResolutionCaches.get(t);
516
528
  if (n !== void 0) return n;
@@ -518,7 +530,7 @@ var x = class CompilerHostService {
518
530
  return this.moduleResolutionCaches.set(t, r), r;
519
531
  }
520
532
  clear() {
521
- this.sourceFileCache.clear(), this.moduleResolutionCaches.clear();
533
+ this.sourceFileCache.clear(), this.directoryExistsCache.clear(), this.fileExistsCache.clear(), this.fileTextCache.clear(), this.realPathCache.clear(), this.moduleResolutionCaches.clear();
522
534
  }
523
535
  createHost(e) {
524
536
  let t = o.createCompilerHost(e.options, !0), n = t.getSourceFile.bind(t);
@@ -529,7 +541,9 @@ var x = class CompilerHostService {
529
541
  let o = n(e, t);
530
542
  return o !== void 0 && this.sourceFileCache.set(i, o), o;
531
543
  };
532
- return t.getSourceFile = readCached, t;
544
+ t.getSourceFile = readCached, t.fileExists = this.memoize(this.fileExistsCache, t.fileExists.bind(t)), t.readFile = this.memoize(this.fileTextCache, t.readFile.bind(t));
545
+ let r = t.directoryExists?.bind(t), i = t.realpath?.bind(t);
546
+ return r !== void 0 && (t.directoryExists = this.memoize(this.directoryExistsCache, r)), i !== void 0 && (t.realpath = this.memoize(this.realPathCache, i)), t;
533
547
  }
534
548
  };
535
549
  x = __decorate([r(), __decorateMetadata("design:paramtypes", [])], x);
package/package.json CHANGED
@@ -4,8 +4,8 @@
4
4
  "url": "https://github.com/organizzolini/codebase/issues"
5
5
  },
6
6
  "dependencies": {
7
- "@callidescope/configuration": "0.0.59",
8
- "@callidescope/core": "0.0.58",
7
+ "@callidescope/configuration": "0.0.60",
8
+ "@callidescope/core": "0.0.59",
9
9
  "@nestjs/common": "^11.1.21 || ^12.0.1",
10
10
  "pino": "^10.3.1",
11
11
  "pino-pretty": "^13.1.3",
@@ -66,5 +66,5 @@
66
66
  "strict": true
67
67
  },
68
68
  "types": "./dist/src/index.d.ts",
69
- "version": "0.0.58"
69
+ "version": "0.0.59"
70
70
  }