mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
rename features to addons
This commit is contained in:
38
apps/cli/src/prompts/addons.ts
Normal file
38
apps/cli/src/prompts/addons.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import { cancel, isCancel, multiselect } from "@clack/prompts";
|
||||
import pc from "picocolors";
|
||||
import type { ProjectAddons } from "../types";
|
||||
|
||||
export async function getAddonsChoice(
|
||||
Addons?: ProjectAddons[],
|
||||
): Promise<ProjectAddons[]> {
|
||||
if (Addons !== undefined) return Addons;
|
||||
|
||||
const response = await multiselect<ProjectAddons>({
|
||||
message: "Which Addons would you like to add?",
|
||||
options: [
|
||||
{
|
||||
value: "docker",
|
||||
label: "Docker setup",
|
||||
hint: "Containerize your application",
|
||||
},
|
||||
{
|
||||
value: "github-actions",
|
||||
label: "GitHub Actions",
|
||||
hint: "CI/CD workflows",
|
||||
},
|
||||
{
|
||||
value: "SEO",
|
||||
label: "Basic SEO setup",
|
||||
hint: "Search engine optimization configuration",
|
||||
},
|
||||
],
|
||||
required: false,
|
||||
});
|
||||
|
||||
if (isCancel(response)) {
|
||||
cancel(pc.red("Operation cancelled"));
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
Reference in New Issue
Block a user