Skip to content

Commit ca3d69a

Browse files
storybook support (#5)
* Add storybook prompt --------- Co-authored-by: yordan.ramchev <[email protected]>
1 parent ba8f0af commit ca3d69a

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

index.ts

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ async function init() {
108108
argv.nightwatch ??
109109
argv.playwright ??
110110
argv.eslint ??
111+
argv.storybook ??
111112
argv.vueUse
112113
) === 'boolean'
113114

@@ -129,6 +130,7 @@ async function init() {
129130
needsEslint?: boolean
130131
needsPrettier?: boolean
131132
needsVueUse?: boolean
133+
needsStorybook?: boolean
132134
} = {}
133135

134136
try {
@@ -145,6 +147,8 @@ async function init() {
145147
// - Add Playwright for end-to-end testing?
146148
// - Add ESLint for code quality?
147149
// - Add Prettier for code formatting?
150+
// - Add VueUse - Collection of essential Composition Utilities?
151+
// - Add Storybook?
148152
result = await prompts(
149153
[
150154
{
@@ -275,6 +279,14 @@ async function init() {
275279
initial: false,
276280
active: 'Yes',
277281
inactive: 'No'
282+
},
283+
{
284+
name: 'needsStorybook',
285+
type: () => (isFeatureFlagsUsed ? null : 'toggle'),
286+
message: 'Add Storybook?',
287+
initial: false,
288+
active: 'Yes',
289+
inactive: 'No'
278290
}
279291
],
280292
{
@@ -301,7 +313,8 @@ async function init() {
301313
needsVitest = argv.vitest || argv.tests,
302314
needsEslint = argv.eslint || argv['eslint-with-prettier'],
303315
needsPrettier = argv['eslint-with-prettier'],
304-
needsVueUse = argv.vueUse
316+
needsVueUse = argv.vueUse,
317+
needsStorybook = argv.storybook
305318
} = result
306319

307320
const { needsE2eTesting } = result
@@ -507,7 +520,8 @@ async function init() {
507520
needsPlaywright,
508521
needsNightwatchCT,
509522
needsCypressCT,
510-
needsEslint
523+
needsEslint,
524+
needsStorybook
511525
})
512526
)
513527

@@ -522,6 +536,9 @@ async function init() {
522536
if (needsPrettier) {
523537
console.log(` ${bold(green(getCommand(packageManager, 'format')))}`)
524538
}
539+
if (needsStorybook) {
540+
console.log(` ${bold(green('npx storybook@latest init --builder vite'))}`)
541+
}
525542
console.log(` ${bold(green(getCommand(packageManager, 'dev')))}`)
526543
console.log()
527544
}

0 commit comments

Comments
 (0)