Skip to content

[core] Create a CLI for create-mui-app #39865

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

Closed
wants to merge 5 commits into from

Conversation

DerTimonius
Copy link
Contributor

@DerTimonius DerTimonius commented Nov 12, 2023

Description

This PR will add the possibility to run npx create-mui-app, where the user can select from different options to get a boilerplate app with the chosen packages:

create-mui-test2
(I cancelled the dependency installation, it runs successfully)

Currently done

This PR is currently work in progress, but there has been a lot of progress:

  • Running the command shows an interactive TUI
  • The selections are used to copy the correct template and configs
  • The correct dependencies are installed
  • The package.json file is updated correctly

Todo

Tthere are a few things missing:

  • add message on what to do next after running the command
  • render a title of some sort (would need some input on this)
  • improve templates
    • my idea would be to create a Card component (or something similar) for both Joy UI and Material UI in js and tsx and adding this to the templates
    • create component
      • joy js
      • joy ts
      • material js
      • material ts
    • implement component correctly
  • Tests would be nice
  • READMEs should be updated (in templates, currently missing in the create-mui-app directory)
  • other docs?
  • add rollup.config.mjs (missed that apparently)

closes #39588

@danilo-leal danilo-leal changed the title [feat][create-mui-app] create CLI for create-mui-app [core] Create a CLI for create-mui-app Nov 21, 2023
@danilo-leal danilo-leal added new feature New feature or request core Infrastructure work going on behind the scenes labels Nov 21, 2023
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Nov 26, 2023
@DerTimonius
Copy link
Contributor Author

I would need some help with the following:

  • the existing build scripts are not working with the project. it's probably the best to write a new one?
  • I'm kind of stuck with the templates. I'm not too deep into all the possible packages that material-ui provides and my idea to mix and match each package with each possible framework is much more complicated than I anticipated

@mbrookes
Copy link
Member

mbrookes commented Dec 8, 2023

@DerTimonius I'm probably not the best person to comment as I'm pretty hands-off with code these days, but if it were me I'd aim to have a single base template per UI library (Material UI, Joy UI) that contains the bulk of the code, and pull in additional files as needed by each framework (config, framework specific routing etc.), and populate variable content in the templates using something like mustache. But that's probably a bit old-school, aand I'm underestimating the complexity, so there's likely a cleaner way.

Hopefully somebody from @mui/core will chime in.

@siriwatknp
Copy link
Member

Not sure how I missed this. Really appreciate the effort.

I'd say it would be nice if you could open source this CLI and publish it in your own name because this kind of feature requires a lot of discussions and we are at full capacity for v6. I'd love to try it and share your work!

@siriwatknp siriwatknp closed this Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Infrastructure work going on behind the scenes new feature New feature or request PR: out-of-date The pull request has merge conflicts and can't be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create CLI npx create-mui-app
4 participants