This message was deleted.
# getting-started
s
This message was deleted.
f
nevermind, it sounds like I am just hitting generic typescript/ecmascript issues with module loading. I must not understand the behavior when importing modules with no exports. I was using
export * from './subtree'
and I swapped those to
import './subtree'
and now it is working consistently
still any resources on factoring / organizing pulumi state would be helpful!
s
I assume you are asking about how to organize stacks? Some approaches are mentioned here: https://www.pulumi.com/docs/guides/organizing-projects-stacks/
f
I’m more interested in how to organize files within a single stack, really. Do most people just do one TS file per stack?
all of the examples on that page seem to show a single
.ts
file per stack
but I am imagining people would use shared TS utilities, and separate infrastructure into multiple files in a given stack. And that is the part I’m curious about
s
You have the freedom to organize the code the way you prefer and bring your code style over - lots of examples in Pulumi/examples repo use multiple files. For simple things single file is sufficient but for more complex environments I have seen lots of namespaces etc.