Closed hoangmirs closed 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
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 🙇
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:
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 😄
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 👍
@olivierobert @longnd @malparty Could you help me recheck this PR? 🙏
What happened 👀
blank
infrastructure type which generates a blank project with some core files.Install
command to install custom add-ons, for now, it just supports AWS modulestsconfig-paths
Insight 📝
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.tsconfig.json
because OCLIF doesn't support it. I follow this issue and found a way to do that by customizing a bit on the execute files and modifyingjest.config
to support reading the paths in tests./bin/dev generate nimble-test
to create a new project, you should choose blank template to be able to install more addons./bin/dev install vpc --project nimble-test
to installvpc
add-on tonimble-test
project folder or you can change current directory tocd nimble-test
and run../bin/dev install vpc
instead, it will install to the current folderProof Of Work 📹