analyzeProject

tcmts.core.analyze.analyzeProject · #4wbvwh72 · term · runs on the server

uses tcmts.core.analyze.analyzeWith, which uses tcmts.core.program.compilerOptions, which uses tcmts.core.program.tcmNodeTypes, which uses node:path

Analyze files together, as one dependency graph: references between them (including through re-export barrels and workspace packages) become hash references, and import cycles become hash cycles.

import { analyzeWith, observed } from "#codebase/tcmts/core/analyze";
import type { AnalyzeHost, ProjectAnalysis } from "#codebase/tcmts/core/analyze";
import type { ExtractMode } from "#codebase/tcmts/core/extract";

export function analyzeProject(
  files: string[],
  host: AnalyzeHost,
  mode: ExtractMode = "import",
): ProjectAnalysis {
  observed = new Map();
  try {
    return { ...analyzeWith(files, host, mode), packages: Object.fromEntries(observed) };
  } finally {
    observed = undefined;
  }
}

uses

used by