diff --git a/code/lib/cli/src/repro-next.ts b/code/lib/cli/src/repro-next.ts index 5733bf7085c..d556261fad2 100644 --- a/code/lib/cli/src/repro-next.ts +++ b/code/lib/cli/src/repro-next.ts @@ -26,12 +26,13 @@ export const reproNext = async ({ branch, init, }: ReproOptions) => { + const filterRegex = new RegExp(`^${filterValue || ''}`, 'i'); + const keys = Object.keys(TEMPLATES) as Choice[]; // get value from template and reduce through TEMPLATES to filter out the correct template const choices = keys.reduce((acc, group) => { const current = TEMPLATES[group]; - const filterRegex = new RegExp(filterValue, 'i'); if (!filterValue) { acc.push(group); return acc; @@ -56,7 +57,7 @@ export const reproNext = async ({ boxen( dedent` 🔎 You filtered out all templates. 🔍 - + After filtering all the templates with "${chalk.yellow( filterValue )}", we found no results. Please try again with a different filter. @@ -78,13 +79,13 @@ export const reproNext = async ({ logger.info( boxen( dedent` - 🤗 Welcome to ${chalk.yellow('sb repro NEXT')}! 🤗 - + 🤗 Welcome to ${chalk.yellow('sb repro NEXT')}! 🤗 + Create a ${chalk.green('new project')} to minimally reproduce Storybook issues. - + 1. select an environment that most closely matches your project setup. 2. select a location for the reproduction, outside of your project. - + After the reproduction is ready, we'll guide you through the next steps. `.trim(), { borderStyle: 'round', padding: 1, borderColor: '#F1618C' } as any @@ -162,7 +163,7 @@ export const reproNext = async ({ ${initMessage} Once you've recreated the problem you're experiencing, please: - + 1. Document any additional steps in ${chalk.cyan('README.md')} 2. Publish the repository to github 3. Link to the repro repository in your issue