linkstrap v0.0.3
Linkstrap
A small utility for automatically installing dependencies and cross-linking them. I wrote this for one specific use case, but it can be used fairly easily in other places as long as the target project architecture is similar.
Specifically, linkstrapping is useful when setting up a development environment that consists of multiple modules which depend on each other to execute. I.e:
A depends on D
B depends on D, E
C depends on A, B
This requires the following commands to resolve:
npm link
in Dnpm link
in Enpm link D
in Anpm link
in Anpm link D
in Bnpm link E
in Bnpm link
in Bnpm link A
in Cnpm link B
in Cnpm link
in C
With linkstrap, this can be solved by adding the following to package.json
:
"linkstrap": {
"path": "SUBFOLDER",
"targets": [
"A",
"B",
"C",
"D",
"E"
]
}
As long as the target modules have their dependencies properly listed in their
own package.json
manifests, running linkstrap
will result in a new folder
named SUBFOLDER
being created within the parent module's root dir with the
target modules cloned from git, cross-linked, and linked into the parent
project.
Hence, a requirement of this is that A
, B
, C
, D
, and E
need to be
included in the outer/parent module's dependency list, resolved to git URLs.
For now, branches/tags are ignored, although this can easily be fixed in the future.
Linkstrap. For when bootstrapping just won't cut it