connect-deps
This is a CLI tool that intends to be a better yarn/npm link
When you do a yarn/npm link in the current repo, it creates a symlink to the dependency in your machine and this gives you the wrong dependency tree, because node_modules inside the linked dependency will be the one already in the there not the one that you would get from a clean yarn/npm install in the current repo.
This can became problematic in some cases, to solve this problem this package "links" (we call it connect) a dependency by running yarn pack
in the connected dependency and yarn add file:/path/to/pack.tgz
in the current repo.
For a real world example where npm link
failed, see the blog post When npm link fails.
Support for unpublished packages or packages not listed in package.json is also included.
Usage
connect-deps link ../package-linked
connect-deps connect
connect-deps connect -w
connect-deps reset
connect-deps link ../package-linked ../package-linked2 --connect --watch
CLI
$ npm install --global connect-deps
$ connect-deps --help
Usage
$ connect-deps [cmd]
Commands
link /relative/path Relative path from cwd to dependency to connect.
connect Connect a linked dependency.
reset Reset everything and clean up.
Options
--help Show help.
--watch, -w Watch for changes.
--connect, -c Can be used with link command to also connect.
--manager Package manager to use npm or yarn.
Examples
$ connect-deps link ../dep-folder
$ connect-deps link ../dep-folder1 ../dep-folder2 -c -w
$ connect-deps connect -w
License
MIT © Hugo Dias