Skip to content

fix(ttscgraph): preserve project-relative dump paths across filesystem aliases #1050

Description

@mineclover

Summary

On macOS, the same temporary project can be spelled as both /var/... and /private/var/.... ttscgraph currently compares those lexical spellings when mapping source files into dump coordinates.

Reproduction

  1. Run the graph feature suite from a checkout under the macOS temporary directory.
  2. Let the project root and a compiler-reported source resolve through different /var aliases.
  3. Observe project files emitted outside the project-relative coordinate space.

On current master (047b464), this fails:

  • test_ttscgraph_dump_keeps_node_modules_as_external_leaves
  • test_ttscgraph_dump_resolves_pnpm_workspace_edges

Expected

Filesystem aliases for the same existing path produce one project-relative graph coordinate.

Actual

A source under the project is treated as a sibling outside it, so graph lookup cannot find the expected package or workspace nodes.

Proposed fix

Resolve existing absolute filesystem paths through filepath.EvalSymlinks before applying the portable TypeScript path grammar, with lexical fallback for non-existent paths and synthetic Windows or UNC fixtures. Add a real symlink regression test.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions