Skip to content

fix: resolve tsconfig path aliases in import relationships - #355

Open
Cpu1998 wants to merge 1 commit into
joesobo:mainfrom
Cpu1998:fix/tsconfig-path-alias-relationships
Open

fix: resolve tsconfig path aliases in import relationships#355
Cpu1998 wants to merge 1 commit into
joesobo:mainfrom
Cpu1998:fix/tsconfig-path-alias-relationships

Conversation

@Cpu1998

@Cpu1998 Cpu1998 commented Aug 14, 2026

Copy link
Copy Markdown

Summary

  • resolve JavaScript and TypeScript imports through compilerOptions.paths from the nearest tsconfig.json or jsconfig.json
  • pass the workspace root through static imports, dynamic imports, reexports, and imported-call analysis
  • resolve path aliases used inside Vue SFC script blocks
  • normalize resolved Windows paths so they match indexed File Nodes
  • preserve existing relative-import behavior and keep external packages unresolved as workspace files

Closes #354

Problem

Vue SFC imports using aliases such as:

import { useMeasureStore } from '@/stores/useMeasureStore';

were recorded without a resolved workspace path. As a result, CodeGraphy did not create an import Relationship between the Vue File Node and the referenced TypeScript File Node.

Relative imports such as ./MapIO continued to work.

Implementation

Core import resolution now:

  • reads path mappings from the nearest workspace tsconfig.json or jsconfig.json
  • supports wildcard and exact path mappings
  • respects baseUrl
  • tries multiple mapping targets in order
  • limits resolution to the active workspace

The Vue plugin now uses the TypeScript module resolver for configured path mappings and normalizes the returned path for the host platform.

Testing

  • Core path resolution and JavaScript import tests: 20 passed
  • Vue plugin tests: 8 passed
  • Core TypeScript typecheck: passed
  • Vue plugin TypeScript typecheck: passed
  • Windows VSIX packaging: passed
  • verified against a Vue 3 + TypeScript + Vite workspace using "@/*": ["./src/*"]

Issue

[Issue #354](#354)

@vercel

vercel Bot commented Aug 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
codegraphy Skipped Skipped Aug 14, 2026 8:57am

@changeset-bot

changeset-bot Bot commented Aug 14, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 41201cb

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

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.

Vue imports using tsconfig path aliases do not create Relationships

1 participant