# connect-deps

> This is a CLI tool that intends to be a better yarn/npm link

Latest version **0.4.0** (published 2020-08-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install connect-deps
pnpm add connect-deps
yarn add connect-deps
bun add connect-deps
```

Provides the command `connect-deps`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.0 |
| Published | 2020-08-18 |
| First published | 2019-07-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=10 |
| Dependencies | 11 |
| Unpacked size | 22.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 22 |
| Author | Hugo Dias |
| Maintainers | hugomrdias |
| Keywords | cli, link, npm, yarn, dependencies, connect |

## Links

- npm: https://www.npmjs.com/package/connect-deps
- Repository: https://github.com/hugomrdias/connect-deps
- npm.io page: https://npm.io/package/connect-deps

## Dependencies (11)

- [del](https://npm.io/package/del.md) ^5.1.0
- [ora](https://npm.io/package/ora.md) ^5.0.0
- [conf](https://npm.io/package/conf.md) ^7.1.2
- [meow](https://npm.io/package/meow.md) ^7.1.0
- [execa](https://npm.io/package/execa.md) ^4.0.0
- [p-queue](https://npm.io/package/p-queue.md) ^6.3.0
- [chokidar](https://npm.io/package/chokidar.md) ^3.3.1
- [has-yarn](https://npm.io/package/has-yarn.md) ^2.1.0
- [read-pkg](https://npm.io/package/read-pkg.md) ^5.2.0
- [p-debounce](https://npm.io/package/p-debounce.md) ^2.1.0
- [update-notifier](https://npm.io/package/update-notifier.md) ^4.1.1

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 0.4.0 (latest) — 2020-08-18
- 0.3.0 — 2020-04-24
- 0.2.2 — 2020-01-30
- 0.2.1 — 2020-01-30
- 0.2.0 — 2020-01-20
- 0.1.1 — 2019-12-13
- 0.1.0 — 2019-12-13
- 0.0.7 — 2019-07-31
- 0.0.6 — 2019-07-31
- 0.0.5 — 2019-07-31
- 0.0.4 — 2019-07-30
- 0.0.3 — 2019-07-30
- 0.0.2 — 2019-07-11
- 0.0.1 — 2019-07-11

## README

# connect-deps [![NPM Version](https://img.shields.io/npm/v/connect-deps.svg)](https://www.npmjs.com/package/connect-deps) [![NPM Downloads](https://img.shields.io/npm/dt/connect-deps.svg)](https://www.npmjs.com/package/connect-deps) [![NPM License](https://img.shields.io/npm/l/connect-deps.svg)](https://www.npmjs.com/package/connect-deps) [![Build Status](https://travis-ci.org/hugomrdias/connect-deps.svg?branch=master)](https://travis-ci.org/hugomrdias/connect-deps) [![codecov](https://codecov.io/gh/hugomrdias/connect-deps/badge.svg?branch=master)](https://codecov.io/gh/hugomrdias/connect-deps?branch=master)

> 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](https://vmx.cx/cgi-bin/blog/index.cgi/when-npm-link-fails%3A2019-08-01%3Aen%2CJavaScript%2Cnpm).

Support for unpublished packages or packages not listed in package.json is also included.



## Usage

```bash
# first link the dependency from your current repo
connect-deps link ../package-linked
# after, you can `connect` to stay in sync
connect-deps connect
# or use watch mode to listen to changes and update the current repo
connect-deps connect -w
# after you done with coding run `reset` to cleanup and go back to previous versions
connect-deps reset
# Reset may not leave your package.json exactly like before `connect` (https://github.com/hugomrdias/connect-deps/issues/3#issuecomment-517668975) but the change should not be harmful and you can always ignore the change before commiting.

# tips
# link multiple, connect and watch in one command
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](http://hugodias.me)

---
_Source: https://npm.io/package/connect-deps · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
