Skip to content

feat(build): migrate @/* path alias to native package.json subpath imports (#/*) #219

Description

@cyanheads

The build is two-step — tsc, then tsc-alias rewrites @/* specifiers in dist/ — because tsconfig paths aliases do not exist at runtime. Node's subpath imports (package.json "imports", #-prefixed) are the native mechanism: tsc under NodeNext resolves them end-to-end, emitted JS needs no rewriting, and declaration files carry working specifiers.

Proposal

Migrate @/* to #/* via a package.json "imports" map; drop tsc-alias from the framework build and from the scaffold (templates carry the same two-step build). ~575 import sites in src/ — mechanical codemod, then the full gate run.

Scope

  • package.json "imports" map; remove paths from tsconfig.base.json
  • Codemod across src/ + tests/; simplify scripts/build.ts
  • templates/: same change for scaffolded servers
  • Skills/docs that show the @/ import convention

Out of scope

  • Public @cyanheads/mcp-ts-core/* export subpaths (unaffected)

Alternatives considered

  • Keep tsc-alias: works today, but it is a build-only rewrite step plus a devDependency in the framework and every scaffolded consumer for something the platform does natively.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestsurplus-token-ideaWorth exploring when token budget allows

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions