mirror of
https://github.com/safishamsi/graphify.git
synced 2026-10-14 16:09:26 +00:00
A CommonJS require() of a relative module with no file behind it resolved
to the attempted absolute path, and the target id plus every destructured
symbol under it were minted from that path. The checkout location and the
OS username ended up in node ids, so the same repo gave a different
graph.json in every clone.
#2457 fixed this for static imports only; require() goes through
_require_imports_js. Apply the same rule there: a resolved path that is
not a file is unresolved and gets the stable ref id.
The two destructured/member require tests asserted symbol edges into
cjs_require.js's missing ./foundation and ./helpers, i.e. those
absolute-path ids. They now run the fixture next to real modules, so
they still check one imports edge per binder.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B8gwEpjajiWHVW3c9smuKf
(cherry picked from commit 5759ab1331)