You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by mvn-tiennguyen-hn March 7, 2024
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.
functioncopyFolder(fromPath: string,toPath: string){// Do stuff}functioncreateFolder(destination: string){// Do stuff}
Windows support
How about supporting on Windows machine? I think rsync and mkdir 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 from fs package (fs.cpSync, fs.mkdir) to get native supported method on user's machine.
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 module
From 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.
Discussed in #1207
Originally posted by mvn-tiennguyen-hn March 7, 2024
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.
Issues:
The text was updated successfully, but these errors were encountered: