Improve CLI structure #1207
Replies: 1 comment
-
@mvn-tiennguyen-hn First of all, regarding Windows support, I'm not entirely sure of Jinma-san's plan, but I am assuming that we will eventually implement the copying process similar to the current script. It uses an extended Additionally, as you have also suggested, it will be refactored to more manageable chunks, such as the helper functions in the current package. (Though, we could definitely clean it up a bit more)
Thanks for this feedback! Once we have a more solid plan on how we'll implement it, we will share it with everyone. |
Beta Was this translation helpful? Give feedback.
-
I've looked at the code that Jin san wrote here and it looks great, but I'd like to leave a few comments
Shell command service
We should create a service for shell command for better reuse and encapsulating logic.
Windows support
How about supporting on Windows machine? I think
rsync
andmkdir
shell command cannot work in PowerShell or Command Prompt as well because WSL (Windows subsystem linux) have not been popular yet. We can use methods fromfs
package (fs.cpSync
,fs.mkdir
) to get native supported method on user's machine.Breakdown CLI into small functions
I see all steps from copying core files, copy functions, copy API,... are being done in the same flow. What if users want to add functions or API later, after deciding what they need? I think we should divide CLI into smaller functions, for example:
/src/packages/cli/init.ts
: Initialize project with basic directory structure/src/packages/cli/add.ts
: Add necessary modules, such as authentication or authorization./src/packages/cli/remove.ts
: Remove an unnecessary moduleFrom there users can run function they want at any time.
By the way, I think authorization functionality should be implemented in 2024. This is also a feature that many people are interested in.
I look forward to receiving comments from everyone. Thank you.
Beta Was this translation helpful? Give feedback.
All reactions