keep-network / local-setup

Allow to easily set up tBTC and Keep locally for development and test purposes.
MIT License
8 stars 16 forks source link

Transition to consistent package linking #24

Open nkuba opened 4 years ago

nkuba commented 4 years ago

Currently, we've got multiple ways of linking packages between local repos:

  1. npm link https://github.com/keep-network/local-setup/blob/d29abdf4e95b97815d09a107c7b0e2e9ed2c6cd6/install-keep-dashboard.sh#L37-L51

  2. Replacing node_modules content https://github.com/keep-network/local-setup/blob/d29abdf4e95b97815d09a107c7b0e2e9ed2c6cd6/install-keep-ecdsa.sh#L52-L53

  3. Replacing the dependency path in package.json https://github.com/keep-network/local-setup/blob/d29abdf4e95b97815d09a107c7b0e2e9ed2c6cd6/install-tbtc-dapp.sh#L32

We should be consistent across install scripts (preferably use the first way).

Shadowfiend commented 4 years ago

Notably, npm link creates a global link. That is, if someone wants a local setup working on two versions, they'd have to run the linking step when switching. Using file paths is more brittle to where the repos are with respect to each other, but it is a local link, so if you're maintaining two repo clones with distinct artifact states, as long as they're on the same chain, you can switch between them without modifying anything.

Just food for thought here---I have a mild bias for using a directory reference vs npm link for this reason, but it may not ultimately apply in the context of everything else we do.