Skip to content

parser: a bare import of a package the repository declares binds to its source - #1816

Merged
swapnilpaliwal-sd merged 1 commit into
apps/integration-0.1.9from
apps/typescript/workspace-package-import-to-source
Sep 30, 2026
Merged

swapnilpaliwal-sd merged 1 commit into
apps/integration-0.1.9from
apps/typescript/workspace-package-import-to-source

Conversation

@swapnilpaliwal-sd

Copy link
Copy Markdown
Contributor
  • A monorepo imports a sibling package by name while its main/types/exports point at build output that is not in the tree, so tsc resolved nothing (or an unwalked dist file) and everything across the boundary was [by name].
  • Import resolution (TypeScript and JavaScript) now maps such a specifier to the walked source it is built from, by the same dist→src convention as the package-entry rows (subpaths and * patterns included). Packages tsc finds in node_modules are left alone.
  • impact on an interface method now lists the implementations the engine dispatches to under "must change with it"; there was no row for them without an override table. The hook's SQL summary matches, and drops shape-only pairs as the rules already did.
  • Tests: new TS case 85-workspace-package-import (fails before: 1 of 8 compiler edges, passes after: 8 of 8, third-party control unchanged). The three JS alias cases are folded into 70-bare-specifier-to-project-source with a workspace row (old edges identical). The dispatch-base CLI case also checks the base side.
  • Checked: TS suite 99/99, JS suite 87/87, parser tests green, fastpath parity 4/4 languages, CLI cases same failures as base. Product: known_edge 2272→2871, ambiguous 6200→5567, index 17.7s→18.2–18.6s, probes 31→37 of 74.

…ts source

A monorepo imports a sibling package by its name, and that package's main /
types / exports name build output that is not in the source tree. tsc then
resolved nothing, or a dist file no program walks, so every call, type and
const across the package boundary was matched by name only. The package-entry
rows already map a dist target back to the source it is built from; import
resolution now uses the same mapping (subpaths and patterns included) for any
bare specifier whose package.json lives under the walked tree, in the
TypeScript and JavaScript front ends. A package tsc resolves inside
node_modules is left alone.

impact: asked of an interface method, the implementations the engine
dispatches to are listed under "must change with it". Without an override
table they had no row at all, and one only surfaced through a wrong by-name
edge that the resolved import removed. The hook's SQL summary gets the same
leg and now drops shape-only pairs as the rules do.

Tests: new TypeScript case 85-workspace-package-import (scoped package with
exports, subpath, pattern, unscoped deep import, a field-typed receiver, and a
third-party control); the three JavaScript alias cases fold into
70-bare-specifier-to-project-source with a workspace-package table row; the
dispatch-base CLI case checks the base side.

Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com>
@swapnilpaliwal-sd
swapnilpaliwal-sd merged commit bfb2d76 into apps/integration-0.1.9 Sep 30, 2026
12 checks passed
@swapnilpaliwal-sd
swapnilpaliwal-sd deleted the apps/typescript/workspace-package-import-to-source branch September 30, 2026 09:34
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.

1 participant