Skip to content
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

CLI: Update copy for "features" question and options #30569

Merged
merged 1 commit into from
Feb 18, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions code/lib/create-storybook/src/initiate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,16 +294,17 @@ export async function doInitiate(options: CommandOptions): Promise<

const isInteractive = process.stdout.isTTY && !process.env.CI;

const selectableFeatures: Record<GeneratorFeature, string> = {
docs: 'Documentation',
test: 'Testing',
const selectableFeatures: Record<GeneratorFeature, { name: string; description: string }> = {
docs: { name: 'Documentation', description: 'MDX, auto-generated component docs' },
test: { name: 'Testing', description: 'Fast browser-based component tests, watch mode' },
};

let selectedFeatures = new Set<GeneratorFeature>();
selectedFeatures.toString = () =>
selectedFeatures.size === 0
? 'none'
: Array.from(selectedFeatures)
.map((f) => selectableFeatures[f])
.map((f) => selectableFeatures[f].name)
.join(', ');

if (options.features?.length > 0) {
Expand All @@ -326,9 +327,9 @@ export async function doInitiate(options: CommandOptions): Promise<
const out = await prompts({
type: 'multiselect',
name: 'features',
message: `What are you using Storybook for?`,
choices: Object.entries(selectableFeatures).map(([value, title]) => ({
title,
message: `What do you want to use Storybook for?`,
choices: Object.entries(selectableFeatures).map(([value, { name, description }]) => ({
title: `${name}: ${description}`,
value,
selected: true,
})),
Expand Down
Loading