Skip to content

Commit b33ae78

Browse files
Merge pull request #414 from e2tha-e/processing-but-hiding-underscore-prefixed-dirs
processing-but-hiding-underscore-prefixed-dirs
2 parents c7ec81e + f9a8747 commit b33ae78

File tree

2 files changed

+10
-22
lines changed

2 files changed

+10
-22
lines changed

core/lib/patternlab.js

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,6 @@ function buildPatternData(dataFilesPath, fs) {
3232
function processAllPatternsIterative(pattern_assembler, patterns_dir, patternlab) {
3333
diveSync(
3434
patterns_dir,
35-
{
36-
filter: function (thisPath, dir) {
37-
if (dir) {
38-
var remainingPath = thisPath.replace(patterns_dir, '');
39-
var isValidPath = remainingPath.indexOf('/_') === -1;
40-
return isValidPath;
41-
}
42-
return true;
43-
}
44-
},
4535
function (err, file) {
4636
//log any errors
4737
if (err) {
@@ -56,16 +46,6 @@ function processAllPatternsIterative(pattern_assembler, patterns_dir, patternlab
5646
function processAllPatternsRecursive(pattern_assembler, patterns_dir, patternlab) {
5747
diveSync(
5848
patterns_dir,
59-
{
60-
filter: function (thisPath, dir) {
61-
if (dir) {
62-
var remainingPath = thisPath.replace(patterns_dir, '');
63-
var isValidPath = remainingPath.indexOf('/_') === -1;
64-
return isValidPath;
65-
}
66-
return true;
67-
}
68-
},
6949
function (err, file) {
7050
//log any errors
7151
if (err) {

core/lib/ui_builder.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,16 @@ function addToPatternPaths(patternlab, pattern) {
2020

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

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

0 commit comments

Comments
 (0)