You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 797a11a
Browse filesBrowse the repository at this point in the historyBrowse files
fix(registry): keep workspace-sibling imports out of the external-import guard
A per-language blast-radius census on twelve public repositories found one
regression class in the DeusData#1355 guard, and it is not per-language: it is
per-topology. In a workspace monorepo a BARE specifier can still name code
inside the indexed tree. `import { eq } from "drizzle-orm"` written inside
the drizzle-orm repository is a sibling package, not a dependency.
Measured on drizzle-team/drizzle-orm at b7862528, full index, both
resolvers: the guard removed 2609 CALLS edges. Resolving each removed
edge's specifier against the repository's own package manifests puts 1377
of them (52.8%) on the file the specifier actually names. 690 of those are
strict: the specifier names a subpath, that subpath maps to one directory,
and the target file is inside it. The other 687 come from the bare package
root, where the check can only confirm the target is somewhere in the
package, so read 690 as the defensible floor. Only 373 removed edges
pointed at a third-party package, which is the defect DeusData#1355 reports.
The same census on eleven other repositories (flask, scrapy, express,
zustand, got, cobra, gin, chi, ripgrep, gson, jq) removed 12 CALLS edges in
total: nine fabricated, one lost (a documentation example importing the
repository's own published name), two weak links between a shell command
and a manifest key. The regression is specific to trees that ship the
package they import.
Consult the pipeline package map before calling a specifier external. It is
keyed by the `name` of every manifest found in the tree, so a workspace
registers each of its own packages there, and a subpath specifier is walked
back one slash at a time ("drizzle-orm/pg-core" -> "drizzle-orm"). A
specifier the tree itself claims is now treated exactly like a relative
one -- kept.
The check is deliberately a NAME test rather than a resolution test. A
workspace package usually points `main` at a build artifact ("./index.cjs")
that is not checked in, so asking whether the entry file exists in the
graph answers "no" for exactly the monorepos this has to protect. Whether
the tree claims the name is decidable from the manifest alone. Passing NULL
restores the previous specifier-shape-only contract, which is what the unit
tests exercise.
After the change the same census removes 391 edges on drizzle-orm, 375 of
them CALLS, and every one resolves to a third-party package; of the other
eleven repositories only got changes, recovering its self-referencing edge.
Signed-off-by: Yyunozor <yyunozor@icloud.com>
0 commit comments