Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions core/lib/patternlab.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,6 @@ function buildPatternData(dataFilesPath, fs) {
function processAllPatternsIterative(pattern_assembler, patterns_dir, patternlab) {
diveSync(
patterns_dir,
{
filter: function (thisPath, dir) {
if (dir) {
var remainingPath = thisPath.replace(patterns_dir, '');
var isValidPath = remainingPath.indexOf('/_') === -1;
return isValidPath;
}
return true;
}
},
function (err, file) {
//log any errors
if (err) {
Expand All @@ -56,16 +46,6 @@ function processAllPatternsIterative(pattern_assembler, patterns_dir, patternlab
function processAllPatternsRecursive(pattern_assembler, patterns_dir, patternlab) {
diveSync(
patterns_dir,
{
filter: function (thisPath, dir) {
if (dir) {
var remainingPath = thisPath.replace(patterns_dir, '');
var isValidPath = remainingPath.indexOf('/_') === -1;
return isValidPath;
}
return true;
}
},
function (err, file) {
//log any errors
if (err) {
Expand Down
12 changes: 10 additions & 2 deletions core/lib/ui_builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,16 @@ function addToPatternPaths(patternlab, pattern) {

//todo: refactor this as a method on the pattern object itself once we merge dev with pattern-engines branch
function isPatternExcluded(pattern) {
// returns whether or not the first character of the pattern filename is an underscore, or excluded
return pattern.isPattern && pattern.fileName.charAt(0) === '_';
// returns whether or not the first character of the pattern type, subtype, further nested dirs, or filename is an underscore
if (pattern.isPattern) {
if (
pattern.relPath.charAt(0) === '_' ||
pattern.relPath.indexOf('/_') > -1
) {
return true;
}
}
return false;
}

// Returns the array of patterns to be rendered in the styleguide view and
Expand Down