Skip to content

Commit

Permalink
Merge fa75d46 into 02abed1
Browse files Browse the repository at this point in the history
  • Loading branch information
JosefBredereck committed May 4, 2020
2 parents 02abed1 + fa75d46 commit a8a3fa4
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 11 deletions.
1 change: 1 addition & 0 deletions packages/cli/test/fixtures/patternlab-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"patternStateCascade": ["inprogress", "inreview", "complete"],
"patternExportDirectory": "./pattern_exports/",
"patternExportPatternPartials": [],
"patternMergeVariantArrays": true,
"serverOptions": {
"wait": 1000
},
Expand Down
1 change: 1 addition & 0 deletions packages/core/patternlab-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
"patternExportPatternPartials": [],
"patternExportPreserveDirectoryStructure": true,
"patternExportRaw": false,
"patternMergeVariantArrays": true,
"serverOptions": {
"wait": 1000
},
Expand Down
15 changes: 13 additions & 2 deletions packages/core/src/lib/pseudopattern_hunter.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,21 @@ pseudopattern_hunter.prototype.find_pseudopatterns = function(
}

//extend any existing data with variant data
variantFileData = _.merge(
variantFileData = _.mergeWith(
{},
currentPattern.jsonFileData,
variantFileData
variantFileData,
(objValue, srcValue) => {
if (
_.isArray(objValue) &&
patternlab.config.patternMergeVariantArrays
) {
return objValue.concat(srcValue);
}
// Lodash will only check for "undefined" and eslint needs a consistent
// return so do not remove
return undefined;
}
);

const variantName = pseudoPatterns[i]
Expand Down
1 change: 1 addition & 0 deletions packages/core/test/util/patternlab-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"patternExportPatternPartials": [],
"patternExportDirectory": "./pattern_exports/",
"patternExtension": "mustache",
"patternMergeVariantArrays": true,
"cacheBust": true,
"outputFileSuffixes": {
"rendered": ".rendered",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"patternExportPatternPartials": [],
"patternExportPreserveDirectoryStructure": true,
"patternExportRaw": false,
"patternMergeVariantArrays": true,
"serverOptions": {
"wait": 1000
},
Expand Down
13 changes: 4 additions & 9 deletions packages/development-edition-engine-react/patternlab-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,7 @@
"m": [500, 800],
"l": [800, 2600]
},
<<<<<<< HEAD:packages/development-edition-engine-react/patternlab-config.json
"logLevel": "info",
=======
"patternExportAll": false,
"patternExportPreserveDirectoryStructure": false,
"patternExportRaw": false,
"patternExportPatternPartials": [],
"patternExportDirectory": "./pattern_exports/",
"cacheBust": true,
>>>>>>> 436dd99e50d808cd14691593b927209f1ecb663e:patternlab-config.json
"outputFileSuffixes": {
"rendered": ".rendered",
"rawTemplate": "",
Expand Down Expand Up @@ -79,8 +70,12 @@
},
"patternExtension": "mustache",
"patternStateCascade": ["inprogress", "inreview", "complete"],
"patternExportAll": false,
"patternExportPreserveDirectoryStructure": false,
"patternExportRaw": false,
"patternExportDirectory": "./pattern_exports/",
"patternExportPatternPartials": [],
"patternMergeVariantArrays": true,
"serverOptions": {
"wait": 1000
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
],
"patternExportDirectory": "pattern_exports",
"patternExportPatternPartials": [],
"patternMergeVariantArrays": true,
"serverOptions": {
"wait": 1000
},
Expand Down
1 change: 1 addition & 0 deletions packages/edition-node-gulp/patternlab-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
"patternExportPatternPartials": [],
"patternExportPreserveDirectoryStructure": true,
"patternExportRaw": false,
"patternMergeVariantArrays": true,
"serverOptions": {
"wait": 1000
},
Expand Down
1 change: 1 addition & 0 deletions packages/edition-node/patternlab-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
"patternExportPatternPartials": [],
"patternExportPreserveDirectoryStructure": true,
"patternExportRaw": false,
"patternMergeVariantArrays": true,
"serverOptions": {
"wait": 1000
},
Expand Down
1 change: 1 addition & 0 deletions packages/edition-twig/patternlab-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
"patternExportPatternPartials": [],
"patternExportPreserveDirectoryStructure": true,
"patternExportRaw": false,
"patternMergeVariantArrays": true,
"serverOptions": {
"wait": 1000
},
Expand Down

0 comments on commit a8a3fa4

Please sign in to comment.