UNPKG

react-cosmos

Version:

CLI for running React Cosmos inside webpack-powered apps

32 lines (26 loc) 942 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getDecoratorPatterns = getDecoratorPatterns; exports.getFixturePatterns = getFixturePatterns; exports.getIgnorePatterns = getIgnorePatterns; var _utils = require("../shared/utils"); // NODE: These can be made configurable if a proper need arises var FIXTURE_PATTERNS = ['**/<fixturesDir>/**/*.{js,jsx,ts,tsx}', '**/*.<fixtureFileSuffix>.{js,jsx,ts,tsx}']; var DECORATOR_PATTERNS = ['**/cosmos.decorator.{js,jsx,ts,tsx}']; var IGNORE_PATTERNS = ['**/node_modules/**']; function getFixturePatterns(fixturesDir, fixtureFileSuffix) { return FIXTURE_PATTERNS.map(function (pattern) { return (0, _utils.replaceKeys)(pattern, { '<fixturesDir>': fixturesDir, '<fixtureFileSuffix>': fixtureFileSuffix }); }); } function getDecoratorPatterns() { return DECORATOR_PATTERNS; } function getIgnorePatterns() { return IGNORE_PATTERNS; }