diff --git a/src/prompts.js b/src/prompts.js index 37e744b..7c9a36f 100644 --- a/src/prompts.js +++ b/src/prompts.js @@ -6,9 +6,10 @@ export const component = (files: InquirerFile[]): {} => ({ type: 'autocomplete', name: 'component', message: 'Which component do you want to replicate?', - source: (_, input) => Promise.resolve( - files.filter(file => !input || file.value.toLowerCase().indexOf(input.toLowerCase()) >= 0) - ), + source: (_, input) => + Promise.resolve( + files.filter(file => !input || file.value.toLowerCase().indexOf(input.toLowerCase()) >= 0) + ), }) export const name = (originalName: string): {} => ({ diff --git a/src/utils.js b/src/utils.js index f0f8a1b..b43cdf8 100644 --- a/src/utils.js +++ b/src/utils.js @@ -38,7 +38,7 @@ export const isSingleFile = (path: string): boolean => { } export const getFiles = (cwd: string, componentName?: string): string[] => { - const extensions = '{js,ts,jsx,tsx,css,less,scss,sass,sss,json}' + const extensions = '{js,ts,jsx,tsx,css,less,scss,sass,sss,json,md}' const pattern = componentName ? `**/${componentName}{.,.*.}${extensions}` : `**/*.${extensions}` return glob.sync(pattern, { cwd, absolute: true, nodir: true }) }