Skip to content

fix(graph): link the implementation next to a resolved declaration file - #270

Merged
adityankale190895 merged 1 commit into
DiffCI:mainfrom
FredApps:fix/dts-sibling-implementation
Nov 18, 2026
Merged

adityankale190895 merged 1 commit into
DiffCI:mainfrom
FredApps:fix/dts-sibling-implementation

Conversation

@FredApps

Copy link
Copy Markdown
Contributor

Fixes #269

When an import resolves to a .d.ts, .d.mts or .d.cts file, the graph also adds an edge to the sibling implementation (.js/.jsx, .mjs or .cjs) when it exists in the repository and is not excluded or under node_modules. The implementation's own imports are followed as before.

Validation:

  • tests/repo/dts-sibling-implementation.test.ts: ./foo.js, ./foo and .d.mts/.mjs cases fail on main and pass here.
  • npm run typecheck, npm test (1170 pass), npm run build, npm run audit:boundary.

…e it

TypeScript resolves ./foo and ./foo.js to foo.d.ts when a hand-written declaration sits next to foo.js, so the graph's only edge went to the declaration. The test runner loads foo.js, and a change to it reached no importer: no tests were selected and nothing fell back. An import that resolves to a repository declaration now also gets an edge to its implementation (foo.js or foo.jsx, foo.mjs for .d.mts, foo.cjs for .d.cts) when that file exists and is not excluded.

Signed-off-by: FredApps <[email protected]>

@FredApps FredApps left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cross-review of 5eefb33.

Checked:

  • The fix matches #269. An import that TypeScript resolves to a repository foo.d.ts / .d.mts / .d.cts also gets an edge to the sibling foo.js/.jsx, .mjs or .cjs. That file goes through followImplementation, so the parse budget and its blocker still apply. Excluded directories and node_modules are skipped.
  • The new tests (./foo.js, ./foo, and .d.mts paired with .mjs) fail with src/ reverted (0 of 3 pass) and pass with the fix. tests/repo/dts-sibling-implementation.test.ts is listed in release-files.json. The commit is DCO-signed. The branch is level with main. CI is green.

Fixed: nothing.

Still open: none.

FredApps added a commit to FredApps/core that referenced this pull request Nov 18, 2026
…ffCI#270

The manifest is an unordered set, and the PRs listed above add their entries at the same line. Moving this entry one line away lets them merge in either order without a conflict.

Signed-off-by: FredApps <[email protected]>
@FredApps
FredApps marked this pull request as ready for review November 18, 2026 00:55
@adityankale190895
adityankale190895 merged commit 8ac073e into DiffCI:main Nov 18, 2026
13 checks passed
adityankale190895 pushed a commit that referenced this pull request Nov 18, 2026
… Maven tests (#272)

* fix(impact): let declared inputs and alwaysRunTests select pytest and Maven tests

knownTestPaths only checked graph nodes while iterating profile.tests, the JavaScript test locations. pytest and Maven repositories have none, so the known-test list was empty. Every declared input then failed with "Declared input ... selects no tests; full validation required", and alwaysRunTests globs silently selected nothing. Every graph node the test-file matcher accepts is now a known test, whether or not the profile lists JavaScript test locations. A declaration that matches no test still falls back.

Signed-off-by: FredApps <[email protected]>

* chore: move the release-files.json entry so it merges cleanly with #270

The manifest is an unordered set, and the PRs listed above add their entries at the same line. Moving this entry one line away lets them merge in either order without a conflict.

Signed-off-by: FredApps <[email protected]>

---------

Signed-off-by: FredApps <[email protected]>
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.

Graph: an import resolved to a hand-written .d.ts never links the sibling .js, so changes to it select nothing

2 participants