nimblehq / infrastructure-templates

For IaaS and PaaS as codes
MIT License
10 stars 0 forks source link

[#153] Add a standard way to add add-ons manually #169

Closed hoangmirs closed 1 year ago

hoangmirs commented 1 year ago

What happened 👀

Insight 📝

Proof Of Work 📹

Add-on that doesn't require any dependencies infrastructure-templates_—_mirs_Mirss-MacBook-Pro_—___ure-templates_—_zsh__figterm__▸_zsh_—_179×81
Add-on that requires another infrastructure-templates_—_mirs_Mirss-MacBook-Pro_—___ure-templates_—_zsh__figterm__▸_zsh_—_179×81
Terraform init successfully base_—_mirs_Mirss-MacBook-Pro_—___ble-test_base_—_zsh__figterm__▸_zsh_—_179×81
Nihisil commented 1 year ago

@hoangmirs

Although we're using synchronized functions, I added the async/await to almost functions to make them support other async libs as well. So we don't need to care if a function is async or sync and force the application to use await instead.

When would we need to use an async library for generating project files? I can't think of any case yet, and adding async/await to all methods now looks not really readable to me

malparty commented 1 year ago

While I understand we want a separate PR for adding the documentation, I think we should not wait for the Wiki. Can we draft documentation in the README.md? This can be done in another PR, but this documentation would be very helpful for me.

While it's comfortable to be able to "auto-import an addon", I'm trying to answer the below question:

Which one is more painful?

  • to manually copy the needed files each time we want to install a specific add-on to an existing project?
  • complexify adding a new add-on or provider to our template***

***I don't know how much this PR complexify it 🙇

hoangmirs commented 1 year ago

Which one is more painful?

  • to manually copy the needed files each time we want to install a specific add-on to an existing project?
  • complexify adding a new add-on or provider to our template***

TBH, I feel they are the same, as to support the CLI adding a new module, we will do the same step as manually copying the folders/files, but we make it with coding. Therefore, to adding a new module, we just need to understand the step and describe it in the code: what is the needed files/folders, what is the steps, how to we add to the current project,... This code will look like a guideline, you can reference it to process the copy: image

And if the generated project is using our template to generate, then it will use our folder structure, and the CLI can easily add the support modules to 😄

malparty commented 1 year ago

Since my last comment, I think I also better understand the structure of this template, so I am less concerned by the template complexity as it is less complex than I imagined 🙈 So that part is all good now 👍

hoangmirs commented 1 year ago

@olivierobert @longnd @malparty Could you help me recheck this PR? 🙏