fix: resolve package subpath exports in import graph#1374
Closed
pkudinov wants to merge 1 commit into
Closed
Conversation
Contributor
Author
|
Closing this as a duplicate. I pushed the same rebased fix to the original PR: #1333. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes Graphify import resolution for package subpath exports that point at source files in monorepos using
package.jsonexportswith subpath keys.What this changes
graphify/extract.py, resolves subpath export target strings through_package_export_target_values."./foo.ts"and["./foo.ts", "./foo.dev.ts"]forms are handled recursively.tests/test_js_import_resolution.pywith a regression test covering pnpm workspace imports of package subpath exports.Why this matters for tokenbooks
packages/accountinguses package subpath exports (for browser/server split) and Graphify currently recorded the target asbrowserinstead of resolving throughpackage.jsonto a source file path.That prevented accurate Jest test impact and could over-run package-level test selection.
Verification
uv run pytest -q2098 passed, 28 skipped.Notes
This also resolves the rebase conflict from prior comment context by preserving both npm/yarn and pnpm import scenarios in existing test coverage.