Skip to content

Commit 6431987

Browse files
author
Maximilian
committed
Merge remote-tracking branch 'upstream/dev' into dev
2 parents 6b4a6fb + baf5bdf commit 6431987

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+350
-286
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
## [5.14.1](https://github.com/pattern-lab/patternlab-node/compare/v5.14.0...v5.14.1) (2021-02-19)
7+
8+
9+
### Bug Fixes
10+
11+
* **demopage:** switched to HTTPS URLs for image placeholders ([#1289](https://github.com/pattern-lab/patternlab-node/issues/1289)) ([e09bf6a](https://github.com/pattern-lab/patternlab-node/commit/e09bf6aae9bad99365b5a01381e0df6de9ddeafe))
12+
13+
14+
15+
16+
617
# [5.14.0](https://github.com/pattern-lab/patternlab-node/compare/v5.13.3...v5.14.0) (2021-01-12)
718

819
**Note:** Version bump only for package patternlab-node

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ If you'd like to see what a front-end project built with Pattern Lab looks like,
1515
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
1616
[![node (scoped)](https://img.shields.io/node/v/@pattern-lab/core.svg)]()
1717
[![Join the chat at Gitter](https://badges.gitter.im/pattern-lab/node.svg)](https://gitter.im/pattern-lab/node)
18+
[![Join the chat at Discord](https://img.shields.io/badge/Chat-Discord-informational.svg)](https://discord.gg/WPPFAaETQC)
1819

1920
Docs @ [![Netlify Status](https://api.netlify.com/api/v1/badges/d454dbde-02c5-4bd4-8393-4ab75e862b03/deploy-status)](https://app.netlify.com/sites/patternlab-docs-preview/deploys)
2021

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"lerna": "3.11.0",
3-
"version": "5.14.0",
3+
"version": "5.14.1",
44
"packages": [
55
"packages/*"
66
],

packages/cli/CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
## [5.14.1](https://github.com/pattern-lab/patternlab-node/tree/master/packages/cli/compare/v5.14.0...v5.14.1) (2021-02-19)
7+
8+
**Note:** Version bump only for package @pattern-lab/cli
9+
10+
11+
12+
13+
14+
615
# [5.14.0](https://github.com/pattern-lab/patternlab-node/tree/master/packages/cli/compare/v5.13.3...v5.14.0) (2021-01-12)
716

817
**Note:** Version bump only for package @pattern-lab/cli

packages/cli/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
22
"name": "@pattern-lab/cli",
33
"description": "Command-line interface (CLI) for the @pattern-lab/core.",
4-
"version": "5.14.0",
4+
"version": "5.14.1",
55
"bin": {
66
"patternlab": "bin/patternlab.js"
77
},
88
"author": {
99
"name": "Patternlab contributors"
1010
},
1111
"dependencies": {
12-
"@pattern-lab/core": "^5.14.0",
12+
"@pattern-lab/core": "^5.14.1",
1313
"@pattern-lab/live-server": "^5.13.0",
1414
"@pattern-lab/starterkit-mustache-base": "3.0.3",
1515
"archiver": "2.1.1",

packages/core/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
## [5.14.1](https://github.com/pattern-lab/patternlab-node/tree/master/packages/core/compare/v5.14.0...v5.14.1) (2021-02-19)
7+
8+
**Note:** Version bump only for package @pattern-lab/core
9+
10+
11+
12+
13+
614
# [5.14.0](https://github.com/pattern-lab/patternlab-node/tree/master/packages/core/compare/v5.13.3...v5.14.0) (2021-01-12)
715

816
**Note:** Version bump only for package @pattern-lab/core

packages/core/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@pattern-lab/core",
33
"description": "Create atomic design systems with Pattern Lab. This is the core API and orchestrator of the ecosystem.",
4-
"version": "5.14.0",
4+
"version": "5.14.1",
55
"main": "./src/index.js",
66
"dependencies": {
77
"@pattern-lab/engine-mustache": "^5.14.0",
@@ -16,7 +16,7 @@
1616
"js-yaml": "3.13.1",
1717
"lodash": "4.17.20",
1818
"markdown-it": "6.0.1",
19-
"node-fetch": "1.6.0",
19+
"node-fetch": "2.6.1",
2020
"recursive-copy": "2.0.8",
2121
"update-notifier": "2.2.0"
2222
},

packages/core/src/lib/compose.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const parseLink = require('./parseLink');
99
const render = require('./render');
1010
const uikitExcludePattern = require('./uikitExcludePattern');
1111
const pm = require('./plugin_manager');
12+
const dataMerger = require('./dataMerger');
1213
const pluginManager = new pm();
1314

1415
const Pattern = require('./object_factory').Pattern;
@@ -56,8 +57,14 @@ module.exports = async function(pattern, patternlab) {
5657
'listitems.json + any pattern listitems.json'
5758
);
5859

59-
allData = _.merge({}, patternlab.data, pattern.jsonFileData);
60-
allData = _.merge({}, allData, allListItems);
60+
allData = dataMerger(
61+
patternlab.data,
62+
pattern.jsonFileData,
63+
patternlab.config
64+
);
65+
// _.merge({}, patternlab.data, pattern.jsonFileData);
66+
allData = dataMerger(allData, allListItems, patternlab.config);
67+
// _.merge({}, allData, allListItems);
6168
allData.cacheBuster = patternlab.cacheBuster;
6269
allData.patternPartial = pattern.patternPartial;
6370

packages/core/src/lib/dataMerger.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
const _ = require('lodash');
2+
3+
/**
4+
* Merges two objects depending on the configuration and will either merge
5+
* arrays and only replaces items on the index or replace the entire
6+
* collection of the different parameters
7+
*
8+
* @param {*} dataObject the object that contains the main data
9+
* @param {*} dataToMergeWithObject the object that should be merged with the original data
10+
* @param {*} patternlabConfig the patternlab configuration object
11+
*/
12+
module.exports = function(dataObject, dataToMergeWithObject, patternlabConfig) {
13+
return _.mergeWith(
14+
{},
15+
dataObject,
16+
dataToMergeWithObject,
17+
(objValue, srcValue) => {
18+
if (
19+
_.isArray(objValue) &&
20+
// If the parameter is not available after updating pattern lab but
21+
// not the patternlab-config it should not override arrays.
22+
patternlabConfig.hasOwnProperty('patternMergeVariantArrays') &&
23+
!patternlabConfig.patternMergeVariantArrays
24+
) {
25+
return srcValue;
26+
}
27+
// Lodash will only check for "undefined" and eslint needs a consistent
28+
// return so do not remove
29+
return undefined;
30+
}
31+
);
32+
};

packages/core/src/lib/object_factory.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,19 @@ const Pattern = function(
173173
this.patternGroupData.order = info.patternSubgroupOrder;
174174
}
175175

176+
// TODO: Remove the following when ordering by file prefix gets obsolete
177+
if (prefixMatcherDeprecationCheckOrder.test(this.fileName)) {
178+
if (this.fileName.indexOf('~') === -1) {
179+
this.order = this.setPatternOrderDataForInfo(this.fileName);
180+
} else {
181+
this.variantOrder = this.setPatternOrderDataForInfo(this.fileName);
182+
}
183+
}
184+
176185
/**
177186
* Determines if this pattern needs to be recompiled.
178187
*
179-
* @ee {@link CompileState}*/
188+
* @see {@link CompileState}*/
180189
this.compileState = null;
181190

182191
/**
@@ -371,12 +380,14 @@ Pattern.prototype = {
371380
.split(/\/|\\/, 2)
372381
.map((o, i) => {
373382
if (i === 0) {
383+
// TODO: Remove when prefix gets deprecated
374384
info.patternGroupOrder = Pattern.prototype.setPatternOrderDataForInfo(
375385
o
376386
);
377387
}
378388

379389
if (i === 1) {
390+
// TODO: Remove when prefix gets deprecated
380391
info.patternSubgroupOrder = Pattern.prototype.setPatternOrderDataForInfo(
381392
o
382393
);

0 commit comments

Comments
 (0)