fix(drift): resolve scoped packages by bare specifier - #217
Open
dyk1454683243-sudo wants to merge 2 commits into
Open
dyk1454683243-sudo wants to merge 2 commits into
dyk1454683243-sudo wants to merge 2 commits into
Conversation
Addresses mex-memory#202 (bullet 5 only). pathExists probed `${pkgName}/package.json`, which modern packages with a strict exports map do not expose, so installed importable packages were reported as MISSING_PATH. Resolve the bare specifier and keep the workspace-name fallback. Co-authored-by: David <dyk1454683243-sudo@users.noreply.github.com>
The fixture assertion now accepts Node's 'not defined by "exports"' wording (and ERR_PACKAGE_PATH_NOT_EXPORTED) so the mex-memory#202 bullet 5 regression stays honest about the old resolve path failing. Co-authored-by: David <dyk1454683243-sudo@users.noreply.github.com>
This was referenced Sep 19, 2026
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.
What
Change scoped-package existence checks in
pathExiststo resolve the bare specifier (@scope/pkg) instead of${pkgName}/package.json.Modern packages with a strict
exportsmap often do not export./package.json. Node then throwsERR_PACKAGE_PATH_NOT_EXPORTEDeven when the package is installed, listed in dependencies, and importable via the bare name. The workspace-name fallback is unchanged.Why
Addresses #202 (bullet 5 only).
Do not treat this as
Fixes #202orCloses #202— that would auto-close the whole mega-issue.Remaining #202 bullets stay open for follow-ups:
src/auth/login.validateToken).d.ts) — owned by fix(drift): treat compound extensions like .d.ts as not-paths #216./x,x.ts,x/index.ts)tests/grounding\\|traversal\\|…)Type of change
How to test
npx vitest run src/drift./package.jsonexport is notMISSING_PATH.MISSING_PATH.test/checkers.test.tsworkspace cases).npm run typecheckChecklist
npx vitest run src/drift— 12 passed, 1 skipped#201version-shaped case left untouched)npx vitest run test/checkers.test.ts— includes the blocked-package.jsonexport case and a still-missing scoped name)npm run typecheck)npm test) — full suite is not the gate for this one-line resolve changeCode-graph changes
mainLanguageExtractororFrameworkResolverinterfacecore / discuss-firstissue is linked aboveThis is a drift path-existence check only. It does not change graph identity, extractors, or the other #202 bullets.