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

RFC: better swizzle cli #2984

Closed
slorber opened this issue Jun 23, 2020 · 8 comments
Closed

RFC: better swizzle cli #2984

slorber opened this issue Jun 23, 2020 · 8 comments
Labels
mlh Major League Hacking Fellowship proposal This issue is a proposal, usually non-trivial change

Comments

@slorber
Copy link
Collaborator

slorber commented Jun 23, 2020

🚀 Feature

The swizzle cli experience works, but is a but rough and could be improved

Pitch

Here I'm using yarn workspace docusaurus-2-website swizzle ... in the screeshots (as I'm using D2 website for testing), but replace in your mind with yarn swizzle ...

Here are some suggestions


Display all the installed theme names with yarn swizzle, instead of:

image


On theme name typo, better error with theme name suggestions:

image


Do not swizzle the whole theme files with yarn swizzle @docusaurus/theme-classic, insead display available names to swizzle. (breaking change)

image


Typo on swizzle component name: same as theme, suggest valid names instead o:

image


Allow swizzling the whole theme files with an --all option: yarn swizzle @docusaurus/theme-classic --all

@slorber slorber added proposal This issue is a proposal, usually non-trivial change v2 mlh Major League Hacking Fellowship labels Jun 23, 2020
@fanny
Copy link
Contributor

fanny commented Jun 23, 2020

To facilitate the use of the users, when a user pass a command that don't exist in the CLI, we could output a help, showing the current options. Loved the idea.

@anshulrgoyal
Copy link
Contributor

@slorber I will be interested if the issue is available.

@slorber
Copy link
Collaborator Author

slorber commented Jun 24, 2020

thanks

You can probably start a poc, but there's ongoing work by @SamChou19815 that we should probably merge first here: #2671

@anshulrgoyal
Copy link
Contributor

anshulrgoyal commented Jul 1, 2020

@slorber I am working on this issue

@anshulrgoyal
Copy link
Contributor

@slorber I was trying to get package name for themes but due to the use of require.resolve I am getting the path of the module instead. Do you know any method get package names?

@slorber
Copy link
Collaborator Author

slorber commented Jul 3, 2020

hey @anshulrgoyal , maybe from the module path you could read the package.json in it, to get the name attribute?

@anshulrgoyal
Copy link
Contributor

hey @anshulrgoyal , maybe from the module path you could read the package.json in it, to get the name attribute?

Did same in my pr.

@anshulrgoyal
Copy link
Contributor

@slorber we should close this

@slorber slorber closed this as completed Aug 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mlh Major League Hacking Fellowship proposal This issue is a proposal, usually non-trivial change
Projects
None yet
Development

No branches or pull requests

3 participants