Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: added inquirer as an alternative to --template cli#3933

Merged
erickzhao merged 21 commits intoelectron:mainfrom
sethcg:improve-cli
Aug 27, 2025
Merged

feat: added inquirer as an alternative to --template cli#3933
erickzhao merged 21 commits intoelectron:mainfrom
sethcg:improve-cli

Conversation

@sethcg
Copy link
Contributor

@sethcg sethcg commented May 7, 2025

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project follows, as appropriate.
  • The changes are appropriately documented (if applicable).
  • The changes have sufficient test coverage (if applicable).
  • The testsuite passes successfully on my local machine (if applicable).

Summarize your changes:

These are my proposed changes to the cli tool.

I added @inquirer/prompts to allow users to run the command, instead of specifying --template the user would be asked a series of questions so they could see the available options.

npx create-electron-app@latest my-app

Here's what it looks like in the console:

cli-improve-1 5

Example of results after completion:

cli-improve-2


Notes:

  • This does not break existing "--template" option of running the command.
  • I included a commented out section regarding frontend frameworks this is so in the future there could be vite-react-typescript, vite-vue-typescript, etc. templates. (referencing feat: added vite-react-typescript template #3932)

@sethcg sethcg requested a review from a team as a code owner May 7, 2025 21:58
Copy link
Member

@erickzhao erickzhao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @sethcg, thanks for this contribution! Have you tried using the Listr2 adapter for inquirer for this purpose?

https://www.npmjs.com/package/@listr2/prompt-adapter-inquirer

@sethcg
Copy link
Contributor Author

sethcg commented May 13, 2025

@erickzhao
Implemented the mentioned @listr2/prompt-adapter-inquirer in the latest commit. Thank you for the suggestion!

@sethcg sethcg requested a review from erickzhao May 17, 2025 18:32
@sethcg
Copy link
Contributor Author

sethcg commented Jul 17, 2025

@erickzhao
Do you know who would have the permission to approve this pull request?

@erickzhao
Copy link
Member

Hi @sethcg, let me take a look!

@sethcg sethcg requested a review from georgexu99 July 31, 2025 02:23
@sethcg
Copy link
Contributor Author

sethcg commented Aug 20, 2025

@erickzhao
Thank you for the review, In my last two commits I addressed your comments.

  • Renamed "build tools" to be "bundler"
  • Renamed "Base" to be "None"
  • Fixed webpack naming conventions
  • Fixed the way default parameters are determined for "skipGit", "force", and "copyCIFiles" options

Commit #1
Commit #2

@erickzhao
Copy link
Member

Thanks for these changes @sethcg. I have a few UX tweaks that I would suggest. I think it might be easier if I just push these commits up to your branch. Sorry for the delay!

@sethcg
Copy link
Contributor Author

sethcg commented Aug 20, 2025

Thanks for these changes @sethcg. I have a few UX tweaks that I would suggest. I think it might be easier if I just push these commits up to your branch. Sorry for the delay!

That would be great!

@erickzhao
Copy link
Member

Just added commit 20823ab.

  • prompt only appears if no flags are passed
  • changed the prompt to include other initialization options (skipGit and force)

With this change, we lose the default values passed through commander.js in the --help text, but it's not too confusing because all flags are false by default.

@erickzhao erickzhao requested a review from a team August 20, 2025 22:43
@erickzhao erickzhao added this pull request to the merge queue Aug 27, 2025
Merged via the queue into electron:main with commit d678153 Aug 27, 2025
9 checks passed
@sethcg sethcg deleted the improve-cli branch August 28, 2025 01:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Comments