Skip to content

Derive resources from a workspace: dependency #108

Open

Description

@TomChv

Follow-up from #106, which derives a module's sources from what its code imports.

A workspace: dependency is skipped today:

{ "dependencies": { "@acme/shared": "workspace:*" } }

file: and link: both name a path, so they resolve lexically. workspace: names a member — the package manager finds it by matching the name against workspaces in the root package.json, or pnpm-workspace.yaml. There is no path in the specifier to resolve, so localDependencyPath returns nothing and the dependency contributes no resource.

A module importing such a package therefore fails in its container: the symlink the package manager made points outside the module directory, and nothing put that directory in the module context.

Closing it means reading the workspace root's member globs and matching the dependency name against each candidate's package.json name. Doable, and a pnpm monorepo is where it bites first.

Until then the import has to be written relatively, or the package has to be declared with file:.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions