rename features to addons

This commit is contained in:
Aman Varshney
2025-03-06 14:35:01 +05:30
parent 3dbe289758
commit 5b13b04a20
17 changed files with 75 additions and 81 deletions

View File

@@ -1,14 +1,14 @@
import { cancel, isCancel, multiselect } from "@clack/prompts";
import pc from "picocolors";
import type { ProjectFeature } from "../types";
import type { ProjectAddons } from "../types";
export async function getFeaturesChoice(
features?: ProjectFeature[],
): Promise<ProjectFeature[]> {
if (features !== undefined) return features;
export async function getAddonsChoice(
Addons?: ProjectAddons[],
): Promise<ProjectAddons[]> {
if (Addons !== undefined) return Addons;
const response = await multiselect<ProjectFeature>({
message: "Which features would you like to add?",
const response = await multiselect<ProjectAddons>({
message: "Which Addons would you like to add?",
options: [
{
value: "docker",

View File

@@ -2,14 +2,14 @@ import { cancel, group } from "@clack/prompts";
import pc from "picocolors";
import type {
PackageManager,
ProjectAddons,
ProjectConfig,
ProjectDatabase,
ProjectFeature,
ProjectOrm,
} from "../types";
import { getAddonsChoice } from "./addons";
import { getAuthChoice } from "./auth";
import { getDatabaseChoice } from "./database";
import { getFeaturesChoice } from "./features";
import { getGitChoice } from "./git";
import { getNoInstallChoice } from "./install";
import { getORMChoice } from "./orm";
@@ -22,7 +22,7 @@ interface PromptGroupResults {
database: ProjectDatabase;
orm: ProjectOrm;
auth: boolean;
features: ProjectFeature[];
addons: ProjectAddons[];
git: boolean;
packageManager: PackageManager;
noInstall: boolean;
@@ -46,7 +46,7 @@ export async function gatherConfig(
results.database === "sqlite"
? getTursoSetupChoice(flags.turso)
: Promise.resolve(false),
features: () => getFeaturesChoice(flags.features),
addons: () => getAddonsChoice(flags.addons),
git: () => getGitChoice(flags.git),
packageManager: () => getPackageManagerChoice(flags.packageManager),
noInstall: () => getNoInstallChoice(flags.noInstall),
@@ -64,7 +64,7 @@ export async function gatherConfig(
database: result.database,
orm: result.orm,
auth: result.auth,
features: result.features,
addons: result.addons,
git: result.git,
packageManager: result.packageManager,
noInstall: result.noInstall,

View File

@@ -8,7 +8,7 @@ export async function getNoInstallChoice(
if (noInstall !== undefined) return noInstall;
const response = await confirm({
message: "Install dependencies after creating project?",
message: "Install dependencies?",
initialValue: !DEFAULT_CONFIG.noInstall,
});