how do you guys work with component repos like pul...
# general
b
how do you guys work with component repos like pulumi-awsx / pulumi-cloud during development. Currently I'm looking to develop a similar library of reusable components. If I were writing python I would just pip install --editable in order to work in two different projects at the same time with going through some kind of install phase. I'd like to develop the components directly in the component repo as I'm building out the new program testing in a development stack.
b
for node? you can use npm link (allegedly, i've had issues myself) or npm install pointing directly at a file path
b
ya I've played with both. I'm not really a node dev so I was looking for some opinions on fully working setups that don't have reinstall loops.
b
I use yarn link @pulumi/aws etc for local development
So I run npm install and then yarn link over the top and it works
b
Most of the
Makefiles
in the pulumi projects run
yarn link
for you.
b
so the setup on a new machine would be?
Copy code
git clone component_repo
cd component_repo
yarn link
cd ..
git clone project1_repo
cd project1_repo
yarn install
b
Copy code
git clone component_repo
cd component_repo
make
cd ..
git clone project1_repo
cd project1_repo
yarn install
b
so make in component_repo does a
yarn link @component
and the component_repo dependency in project1_repo specified is specified as
{ "peerDependencies": { "@compnent": "latest" }}
which makes the whole thing just work?
b
the project repo shouldn't need anything else besides a
yarn install
, the package manager symlinks the linked package in globally anywhere its used in your system