Skip to content

Commit 3fe7942

Browse files
committed
Chore:Fixed missing MUI Switch if not selected for installation during project init
1 parent 1ec48ee commit 3fe7942

File tree

4 files changed

+644
-968
lines changed

4 files changed

+644
-968
lines changed

index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ program.command('project-init')
6464
default: 'vite'
6565
});
6666

67-
const components = await checkbox({
68-
message: "Which components would you like to scafold to your project? You can also install them later via the CLI.",
67+
const install_components = await checkbox({
68+
message: "Which components would you like to add?",
6969
choices: componentChoices,
7070
pageSize: 10
7171
});
@@ -78,6 +78,10 @@ program.command('project-init')
7878
]
7979
});
8080

81+
const MUISwitch = install_components.find(c => c.name === "MaterialUISwitch");
82+
83+
const components = MUISwitch ? install_components : [...install_components, { name: "MaterialUISwitch", category: "Switch" }]
84+
8185
if (architecture === "mono-repo") {
8286
logger.info(boxen(`Since you've chosen a monorepo setup, we'll use Lerna to manage our packages. Lerna is ideal for monorepo management, simplifying tasks like versioning and publishing. Check out the docs: https://lerna.js.org/docs/getting-started`, { padding: 1 }))
8387

0 commit comments

Comments
 (0)