Skip to content

Classify missing subpaths from the importer, not the workspace root #52

Description

@fi3ework

Follow-up to #51 (raised by Codex review there).

The not-installed classifier (shared/missingDependency.ts, used by Rstest since #29 and by Rslint/fmt since #51) proves that a bare specifier's package is absent by walking up the physical node_modules from a fixed root: the project root (Rstest), the config directory (Rslint) or the workspace root (fmt).

That proof is wrong for one shape: a config imports plugin p, p has a private dependency dep installed only under p's own node_modules (isolated pnpm layout), and p requests a nonexistent subpath dep/missing. The walk-up from the root cannot see dep/package.json, so a real missing-subpath error is classified as "not installed": the stack goes disabled and polls instead of surfacing the actionable error.

Fix direction: resolve dep from the importer the loader message identifies (ESM: imported from <file>; CJS: the first Require stack entry) before declaring it absent, falling back to the current root walk when no importer is present in the message.

Pre-existing for Rstest; #51 extended the same limitation to Rslint and fmt rather than introducing it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions