Skip to content

KSXGitHub/pnpm-issue-0

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PNPM should prioritize linking local (private) packages in repo instead of installing external packages

Steps to reproduce

  1. Clone this repo.
  2. Run pnpm recursive install.
  3. Run node index.js.

Expected behavior

After step 2, pnpm should link /tools/foo to /tools/bar/node_modules.

After step 3, /index.js should calls /tools/bar/index.js which in turn calls /tools/foo/index.js which prints 'foo'.

Actual behavior

After step 2, pnpm installs an actual foo package from npm registry which is not what I needed.

Other details

Repo Overview
  • This is a multi-packages repo.

  • Directory [/tools] contains packages that are used as tools in dev environment (e.g. to assist testing, or to validate packages before publishing, etc.) and therefore have "private": true in their package.json.

  • Package /tools/bar depends on foo (/tools/foo).

Folder structure:

  .
  ├── index.js
  ├── pnpm-workspace.yaml
  ├── README.md
  └── tools
      ├── bar
      │   ├── index.js
      │   └── package.json
      └── foo
          ├── index.js
          └── package.json

Why do I want this?
  • It is nicer to call package by their names instead of write out full paths to their files.
  • It allows me to isolate their dependencies from production packages' dependencies.
  • It makes it easier for me to know whether a dependency is still neccessary.
Why don't I just rename to package or increase version to really high?
  • It doesn't work in a long term.

Releases

No releases published

Packages

No packages published