UNPKG

wix-style-react

Version:
33 lines (28 loc) 617 B
const fs = require('fs'); const path = require('path'); const NON_COMPONENT_FOLDER_NAMES = [ 'utils', 'providers', 'new-icons', 'dnd-styles', 'assets', 'clients', 'mixins', 'common', 'FieldLabelAttributes', 'Backoffice', 'BaseComponents', 'Typography', 'TPA', 'Animations', 'NumberInput', ]; const matches = haystack => needle => haystack.some(h => needle === h); const componentNameInvalidators = [ path.extname, matches(NON_COMPONENT_FOLDER_NAMES), ]; module.exports = ({ cwd }) => fs .readdirSync(cwd) .filter(file => !componentNameInvalidators.some(v => v(file)));