Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve CLI process #1268

Open
7 tasks
jinmayamashita opened this issue Jun 14, 2024 Discussed in #1207 · 0 comments
Open
7 tasks

Improve CLI process #1268

jinmayamashita opened this issue Jun 14, 2024 Discussed in #1207 · 0 comments

Comments

@jinmayamashita
Copy link
Collaborator

jinmayamashita commented Jun 14, 2024

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.

function copyFolder(fromPath: string, toPath: string) {
 // Do stuff
}

function createFolder(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.

function createFolder(destination: string) {
  fs.mkdirSync(`${destination}/src/components/api/`); 
}

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 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.

Issues:

@jinmayamashita jinmayamashita added this to the 2024-Q2 milestone Jun 14, 2024
@jinmayamashita jinmayamashita removed this from the 2024-Q2 milestone Jun 14, 2024
@jinmayamashita jinmayamashita moved this to In Progress in ml-frontend Jun 14, 2024
@ptrkdan ptrkdan added this to the 2024-Q3 milestone Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

No branches or pull requests

2 participants