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
- [Create new project](https://github.com/amoskyalo/material-UI-CLI?tab=readme-ov-file#1--create-new-project)
18
-
- [Generate theme file to an existing project](https://github.com/amoskyalo/material-UI-CLI?tab=readme-ov-file#2-%EF%B8%8F-generate-theme-file-to-an-existing-project)
19
-
- [Validate theme file in existing project](https://github.com/amoskyalo/material-UI-CLI?tab=readme-ov-file#3--validate-theme-file-in-existing-project)
-[Create new project](https://github.com/amoskyalo/material-UI-CLI?tab=readme-ov-file#1--create-new-project)
21
+
-[Generate theme file to an existing project](https://github.com/amoskyalo/material-UI-CLI?tab=readme-ov-file#2-%EF%B8%8F-generate-theme-file-to-an-existing-project)
22
+
-[Validate theme file in existing project](https://github.com/amoskyalo/material-UI-CLI?tab=readme-ov-file#3--validate-theme-file-in-existing-project)
-[Supported MUI components](https://github.com/amoskyalo/material-UI-CLI?tab=readme-ov-file#-popular-mui-components)
22
25
23
26
# Material-UI CLI: Streamlining Your Development Workflow
24
27
25
28
The Material-UI CLI is a powerful command-line interface tool designed to significantly streamline and enhance the development process with Material-UI, a renowned React UI framework. This CLI tool simplifies the initialization of new projects, the generation and validation of theme files, and the scaffolding of popular Material-UI components, thereby allowing developers to focus on creating exceptional user interfaces without getting bogged down by the setup and configuration process.
26
29
27
-
28
30
## ✨ Comprehensive Feature Set
29
-
-**Project Initialization**: Kickstart your development with a new React project, pre-configured with Material-UI dependencies, allowing for a smooth and rapid setup.
31
+
32
+
-**Project Initialization**: Kickstart your development with a new `React`, `Vite` or `Next.js` project, pre-configured with Material-UI dependencies, allowing for a smooth and rapid setup.
30
33
-**Theme Generation**: Easily generate a theme file for your project, customizable with primary, secondary, error, warning, info, and success color options, laying the foundation for a consistent design system.
31
34
-**Theme Validation**: Ensure your theme file adheres to Material-UI's theming guidelines, with options to validate palette, typography, spacing, breakpoints, and transitions, thus guaranteeing a polished and error-free UI.
32
35
-**Component Scaffolding**: Choose from a wide array of popular Material-UI components to scaffold into your project, organized neatly within your project structure, saving you the hassle of manual setup and configuration.
33
36
34
37
## 📦 Installation
35
-
38
+
36
39
```sh
37
40
npm i -g material-cli
38
41
```
@@ -44,31 +47,28 @@ npm i -g material-cli
44
47
To initialize a new project, first, navigate to the desired folder, then:
45
48
46
49
```sh
47
-
material-cli project-init [options]
50
+
material-cli project-init
48
51
```
49
52
50
-
The available options for the initialization command are:
51
-
52
-
| Option | Description |
53
-
| --- | --- |
54
-
| name `(required)`| Your project name |
55
-
| --all `(optional)`| Install all components flag |
56
-
57
-
This command will create a new React app using your default package manager, which it automatically detects, thus removing the need for manual configuration.
53
+
You will be then prompted with questions to select:
58
54
59
-
Including the `--all` flag will scaffold all [supported Material UI components](https://github.com/amoskyalo/material-UI-CLI?tab=readme-ov-file#-popular-mui-components) into your project. Otherwise, you will be prompted to select the components you wish to include.
55
+
- Project name
56
+
- Your preferred tool: `React`, `Vite` or `Next.js`
57
+
- Your preferred architecture: `Monorepo` or `Polyrepo`
58
+
-[Popular MUI components](https://github.com/amoskyalo/material-UI-CLI?tab=readme-ov-file#-popular-mui-components) you want to scaffold to your project.
60
59
61
-
If everything proceeded smoothly, you'll receive a confirmation message indicating that your project setup is complete. Navigate to the project directory and execute the start script command. If you followed the procedure correctly, your project will initiate at `localhost:3000`, and the default landing page shown below will be displayed:
60
+
If everything proceeded smoothly, you'll receive a confirmation message indicating that your project setup is complete. Navigate to the project directory and execute the reccomended script command.
| -p, --primary `(optional)`| Primary color option |
92
+
| -s, --secondary `(optional)`| Secondary color option |
93
+
| -e, --error `(optional)`| Error color option |
94
+
| -w, --warning `(optional)`| Warning color option |
95
+
| -i, --info `(optional)`| Info color option |
96
+
| -x, --success `(optional)`| Success color option |
97
97
98
98
The `theme.js` file will be generated under `src > Theme` folder in your project. Note that only palette options can be passed as option.
99
99
100
-
101
100
### 3. 🔍 Validate theme file in existing project.
102
101
103
102
You can easily inspect your theme file to identify any potential errors or warnings that might have been overlooked. To inspect your theme file, simply execute the following command:
| -p, --palette `(optional)`| Validate palette in your theme file |
113
+
| -t, --typography `(optional)`| Validate typography in your theme file |
114
+
| -s, --spacing `(optional)`| Validate spacing in your theme file |
115
+
| -b, --breakpoints `(optional)`| Validate breakpoints in your theme file |
116
+
| -tr, --transitions `(optional)`| Validate transitions in your theme file |
117
+
| --path `(optional)`| Path to your theme file |
118
+
| --ignore-warn `(optional)`| dont show warning |
120
119
121
120
If the `path` option is not provided, you will be prompted with a question to specify the path to your `theme file`.
122
121
@@ -126,36 +125,50 @@ Upon inspecting your theme file, any potential errors will be displayed in your
126
125
127
126
> [!NOTE]<br>
128
127
> The contents of the theme file should be a function that returns the theme object. If the theme file is not a function, an error will occur. This is one of the limitations we are working to resolve.
129
-
>
128
+
>
130
129
> The theme file can have the following format:
130
+
>
131
131
> ```JavaScript
132
132
>constthemeConfig= () => ({
133
133
>// Theme contents
134
134
> });
135
135
>```
136
136
137
+
### 4. ✂️ Component Scaffolding
138
+
139
+
Simplify your development workflow with automated component creation. The MUI CLI allows you to quickly scaffold reusable components into your project, accelerating development and ensuring consistency throughout your application.
140
+
141
+
These components adhere to MUI guidelines and are highly customizable. Explore all supported components [here](https://github.com/amoskyalo/material-UI-CLI?tab=readme-ov-file#-popular-mui-components)
142
+
143
+
To scaffold a specific component into your project, execute the following command:
144
+
145
+
```sh
146
+
material-cli install <componentName>
147
+
```
148
+
149
+
Upon running this command, you'll be prompted to specify the path where you want your component to be scaffolded. The default path is `scr/components/<componentsName>`
150
+
137
151
### 🧩 Supported MUI components
138
152
139
153
Below is a list of supported components, categorized for ease of understanding and integration.
0 commit comments