This message was deleted.
# general
s
This message was deleted.
l
I'm doing that second option. Not using yarn though, just
cd
.
It's working great for me. Haven't had to think about it since I got it working 6+ months ago...
The only gotcha I have is that one of my projects has to have a symbolic link to the top-level packges.json. I can't remember why, it's there now and it works. I can figure it out in a few minutes, if it's of interest.
Figured it out. It's because that project compiles lambdas. I suppose I don't need to link to the top-level package.json, I could have a separate, smaller package.json in the Pulumi project directory.
Ah no, I couldn't, that would confuse npm. The current solution is good.
j
So does each project have its own tsconfig.json + package.json + node_modules in your setup?
(Thanks for the insight by the way)
l
No, there's a single top-level package.json and tsconfig.json. I also have a single top-level tsconfig.test.json, because I use mocha and it doesn't handle the same TS module type.
I need a link from Pulumi project dirs to the top-level package.json if the Pulumi project builds functions for use by lambda or equivalent.
j
Got it. Thanks this is extremely helpful!
👍 1
q
FWIW we're using nx.dev which perscribes a single top-level
package.json
but we cheated and added
pulumi
as a folder with its own
package.json
(haven't tried keeping it in the top-level
package.json
)
j
Thanks for the info @quiet-gold-81036. I'm a big fan of NX but haven't tried using it with Pulumi. Do you have multiple Pulumi projects inside your
pulumi
folder or is it just the one
q
multiple pulumi projects
j
And they all share the same tsconfig and package.json similar to the setup that tenwit has?
q
nope, separate tsconfigs. works like a charm
l
Yea there's no particular reason to use one over the other. All the runtimes (mocha, node, Pulumi) search up the directory hierarchy until they find the files they need. They don't have to be in the same directory, and it seems to work in all combinations, with that one gotcha of compiling lambda code.