Hello,
How do you organize your pulumi code with Typescript ? I have 1 index.ts with hundreds of lines of code... Any best pratices on that ?
f
fast-sandwich-30809
06/28/2024, 4:05 PM
Do you have any preferences on CommonJS vs ESM modules? I have a whole spiel about monorepos and NX and the automation API; but for your case just splitting into multiple files would be a great starting point
fast-sandwich-30809
06/28/2024, 4:06 PM
Do you have a
package.json
file? Does it have a line that says
"type": "module"
?
l
little-cartoon-10569
06/30/2024, 12:19 AM
Also read up on ComponentResources. One resource type per module is very easy to manage.
little-cartoon-10569
06/30/2024, 12:21 AM
And you can group modules into packages, if you need to. If you have only one project, then you don't need to. Multiple projects using the same resource types is the use case for packages.
No matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.