Skip to content

fix(extract): resolve TypeScript wildcard path aliases#1544

Closed
oleksii-tumanov wants to merge 2 commits into
Graphify-Labs:v8from
oleksii-tumanov:fix/tsconfig-wildcard-aliases
Closed

fix(extract): resolve TypeScript wildcard path aliases#1544
oleksii-tumanov wants to merge 2 commits into
Graphify-Labs:v8from
oleksii-tumanov:fix/tsconfig-wildcard-aliases

Conversation

@oleksii-tumanov

@oleksii-tumanov oleksii-tumanov commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • preserve and substitute single-wildcard compilerOptions.paths patterns
  • prefer the longest matching wildcard prefix while retaining ordered target fallbacks
  • add the requested regression coverage; barrel re-export changes remain out of scope

Scoped v8 follow-up to #927, which contains the original investigation and implementation. Related to #147.

Result

Relevant wildcard resolutions (path-normalized):

@communicate/documentv2  -> features/communicate/documentv2/src/index.ts
@communicate/interfaces  -> features/communicate/src/interfaces.ts
@/common/integration/foo -> preferred/foo.ts
@/feature/nested         -> generated/feature/shared/index.ts
app                       -> src/config/index.ts

The longest-prefix case emits no edge to fallback/common/integration/foo.ts.

Testing

  • uv run --frozen --no-sync pytest tests/test_js_import_resolution.py -q (46 passed)
  • uv run --frozen --no-sync pytest tests/ -q --tb=short (2517 passed, 28 skipped)
  • uv run --frozen --no-sync ruff check graphify/extract.py tests/test_js_import_resolution.py (passed)

safishamsi pushed a commit that referenced this pull request Jun 30, 2026
Extends the tsconfig path-alias resolver (#1531) with single-`*` wildcard
capture and substitution: a pattern like `@app/*` or `@*/interfaces`
captures the matched segment and substitutes it into each target in
declared order, honoring baseUrl and tsc's longest-prefix / exact-wins
specificity rules, and preserving #1531's first-existing-target-wins
fallback (no false edge when nothing resolves). Builds on the
_resolve_tsconfig_alias helper rather than reintroducing inline loops;
multi-star patterns remain out of scope.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@safishamsi

Copy link
Copy Markdown
Collaborator

Merged into v8 (5746964) with your authorship. Thanks — clean extension of the #1531 _resolve_tsconfig_alias helper with proper single-* capture/substitution, longest-prefix/exact-wins specificity, baseUrl handling, and the ordered-fallback preserved. Verified the wildcard resolves end-to-end (incl. longest-prefix selection) with no false edges. Ships next release.

@safishamsi safishamsi closed this Jun 30, 2026
safishamsi added a commit that referenced this pull request Jun 30, 2026
README: document that `reflect --graph` writes the .graphify_learning.json
overlay and that explain/query surface a Lesson hint (with the
code-changed staleness flag).

CHANGELOG: add an Unreleased section for the post-0.9.2 work — the
work-memory overlay (#1441/#1542), this.field.method() injected-field
resolution (#1316), TS wildcard path aliases (#1544), JS namespace
re-exports (#1552), and the ObjC dot-syntax/@selector edges (#1475/#1543).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
safishamsi added a commit that referenced this pull request Jun 30, 2026
Cross-file member-call resolution for C++/ObjC (#1547/#1556) and
namespace-aware C# type resolution (#1562), the work-memory overlay
(#1441), test-mock call-graph fix (#1553), hyperedge member-key aliases
(#1561), plus the TS/JS/ObjC resolution fixes (#1316/#1544/#1552/#1475).
See CHANGELOG.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants