Skip to content

Export analyze function and Job class #559

@magne4000

Description

@magne4000

Problem

Currently, only nodeFileTrace is exported, which always performs full recursive dependency tracing. There's no way to analyze a single file without tracing all its dependencies.

Use Case

Single file analysis in build tools

// Vite/Rollup plugin that needs per-file analysis
async transform(code, id) {
  const job = new Job(...);
  const result = await analyze(id, code, job);
  // ...
}

Proposed Solution

Export analyze and Job from src/index.ts.

Question: Would this be sufficient for the use cases above, or are there limitations in the current implementation that would need to be addressed first?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions