Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Maximilian Franzke committed Jun 28, 2020
2 parents 7f4ba39 + 831c8b0 commit 37f9749
Show file tree
Hide file tree
Showing 68 changed files with 794 additions and 245 deletions.
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

If you'd like to contribute to Pattern Lab Node, please do so! There is always a lot of ground to cover and something for your wheelhouse.

No pull request is too small. Check out any [help wanted 🆘](https://github.com/pattern-lab/patternlab-node/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted+%3Asos%3A%22) or [good first issues 🎓](https://github.com/pattern-lab/patternlab-node/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue+%3Amortar_board%3A%22)as a good way to get your feet wet, or add some more unit tests.
No pull request is too small. Check out any [help wanted 🆘](https://github.com/pattern-lab/patternlab-node/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted+%3Asos%3A%22) or [good first issues 🎓](https://github.com/pattern-lab/patternlab-node/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue+%3Amortar_board%3A%22) as a good way to get your feet wet, or add some more unit tests.

## Prerequisites

Expand Down
43 changes: 43 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,49 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [5.11.1](https://github.com/pattern-lab/patternlab-node/compare/v5.10.2...v5.11.1) (2020-06-28)


### Bug Fixes

* update Viewport Size toggle to better handle async-loaded ishControl data + prevent rendering errors ([b937706](https://github.com/pattern-lab/patternlab-node/commit/b93770669c6f723128ba68e522c9398cc1d2d70c))
* update Webpack config to point to the patched version of preact-dom ([d3660b7](https://github.com/pattern-lab/patternlab-node/commit/d3660b78bc0a74c52ed85b69b023c612b789c318))
* update yarn.lock ([dca1948](https://github.com/pattern-lab/patternlab-node/commit/dca19489b85f715de3ade2294fa49df89b8bb59f))
* visually hide NavToggle icon text; fix for visual regression after merging down https://github.com/pattern-lab/patternlab-node/pull/1227 ([3a2ad9f](https://github.com/pattern-lab/patternlab-node/commit/3a2ad9f12d83b6d21dcca62e89d944a6a46342f6))
* **docs:** corrected a URL ([26ede14](https://github.com/pattern-lab/patternlab-node/commit/26ede14a6eafe8649cbc6b0076d84f1d323c3e20))
* **docs:** fixed css code for custom patternstates color ([8995241](https://github.com/pattern-lab/patternlab-node/commit/89952416162c01d1e3e05221ce58a7755544131c)), closes [#1216](https://github.com/pattern-lab/patternlab-node/issues/1216)
* **docs:** headlines styling breaks in edge cases [#1158](https://github.com/pattern-lab/patternlab-node/issues/1158) ([d8244a2](https://github.com/pattern-lab/patternlab-node/commit/d8244a2d307b0a81d0846491f8c5a12e0ae167a5))
* **patternflyouts:** preventing horizontal scrollbar in pattern flyouts in Edge 18 [#1124](https://github.com/pattern-lab/patternlab-node/issues/1124) ([63300bc](https://github.com/pattern-lab/patternlab-node/commit/63300bc00ee797e38bfdb73fdc7694c188a423dc))
* **patternstate:** added css color for pattern state "inprogress" [#1216](https://github.com/pattern-lab/patternlab-node/issues/1216) ([856bcda](https://github.com/pattern-lab/patternlab-node/commit/856bcda150239928bb5e8719246b97e9fa366468))
* **resetcss:** selector in uikit-workshop [#1109](https://github.com/pattern-lab/patternlab-node/issues/1109) ([6893b7c](https://github.com/pattern-lab/patternlab-node/commit/6893b7cb5478309d4fdab0121edba3921718bd69))
* enable partial build via option ([8aaa533](https://github.com/pattern-lab/patternlab-node/commit/8aaa53398563ade14123c481bf509f9ee0c768f5))
* enable partial build via option ([4b9dbf9](https://github.com/pattern-lab/patternlab-node/commit/4b9dbf9095bfb8bfd2360b310dd7395dbfe3cf98))





# [5.11.0](https://github.com/pattern-lab/patternlab-node/compare/v5.10.2...v5.11.0) (2020-06-28)


### Bug Fixes

* update Viewport Size toggle to better handle async-loaded ishControl data + prevent rendering errors ([b937706](https://github.com/pattern-lab/patternlab-node/commit/b93770669c6f723128ba68e522c9398cc1d2d70c))
* update Webpack config to point to the patched version of preact-dom ([d3660b7](https://github.com/pattern-lab/patternlab-node/commit/d3660b78bc0a74c52ed85b69b023c612b789c318))
* visually hide NavToggle icon text; fix for visual regression after merging down https://github.com/pattern-lab/patternlab-node/pull/1227 ([3a2ad9f](https://github.com/pattern-lab/patternlab-node/commit/3a2ad9f12d83b6d21dcca62e89d944a6a46342f6))
* **docs:** corrected a URL ([26ede14](https://github.com/pattern-lab/patternlab-node/commit/26ede14a6eafe8649cbc6b0076d84f1d323c3e20))
* **docs:** fixed css code for custom patternstates color ([8995241](https://github.com/pattern-lab/patternlab-node/commit/89952416162c01d1e3e05221ce58a7755544131c)), closes [#1216](https://github.com/pattern-lab/patternlab-node/issues/1216)
* **docs:** headlines styling breaks in edge cases [#1158](https://github.com/pattern-lab/patternlab-node/issues/1158) ([d8244a2](https://github.com/pattern-lab/patternlab-node/commit/d8244a2d307b0a81d0846491f8c5a12e0ae167a5))
* **patternflyouts:** preventing horizontal scrollbar in pattern flyouts in Edge 18 [#1124](https://github.com/pattern-lab/patternlab-node/issues/1124) ([63300bc](https://github.com/pattern-lab/patternlab-node/commit/63300bc00ee797e38bfdb73fdc7694c188a423dc))
* **patternstate:** added css color for pattern state "inprogress" [#1216](https://github.com/pattern-lab/patternlab-node/issues/1216) ([856bcda](https://github.com/pattern-lab/patternlab-node/commit/856bcda150239928bb5e8719246b97e9fa366468))
* **resetcss:** selector in uikit-workshop [#1109](https://github.com/pattern-lab/patternlab-node/issues/1109) ([6893b7c](https://github.com/pattern-lab/patternlab-node/commit/6893b7cb5478309d4fdab0121edba3921718bd69))
* enable partial build via option ([8aaa533](https://github.com/pattern-lab/patternlab-node/commit/8aaa53398563ade14123c481bf509f9ee0c768f5))
* enable partial build via option ([4b9dbf9](https://github.com/pattern-lab/patternlab-node/commit/4b9dbf9095bfb8bfd2360b310dd7395dbfe3cf98))





## [5.10.2](https://github.com/pattern-lab/patternlab-node/compare/v5.10.1...v5.10.2) (2020-05-24)


Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lerna": "3.11.0",
"version": "5.10.2",
"version": "5.11.1",
"packages": [
"packages/*"
],
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"prettier": "^1.14.3",
"lerna": "3.17.0",
"pretty-quick": "^1.11.1",
"auto": "^9.31.1",
"@auto-it/released": "^9.31.1"
"auto": "^9.40.5",
"@auto-it/released": "^9.40.5"
},
"repository": {
"type": "git",
Expand Down
16 changes: 16 additions & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,22 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [5.11.1](https://github.com/pattern-lab/patternlab-node/tree/master/packages/cli/compare/v5.10.2...v5.11.1) (2020-06-28)

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





# [5.11.0](https://github.com/pattern-lab/patternlab-node/tree/master/packages/cli/compare/v5.10.2...v5.11.0) (2020-06-28)

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





## [5.10.1](https://github.com/pattern-lab/patternlab-node/tree/master/packages/cli/compare/v5.10.0...v5.10.1) (2020-05-09)

**Note:** Version bump only for package @pattern-lab/cli
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "@pattern-lab/cli",
"description": "Command-line interface (CLI) for the @pattern-lab/core.",
"version": "5.10.1",
"version": "5.11.1",
"bin": {
"patternlab": "bin/patternlab.js"
},
"author": {
"name": "Raphael Okon"
},
"dependencies": {
"@pattern-lab/core": "^5.10.1",
"@pattern-lab/core": "^5.11.1",
"@pattern-lab/live-server": "^5.10.1",
"@pattern-lab/starterkit-mustache-base": "3.0.3",
"archiver": "2.1.1",
Expand Down
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
2 changes: 2 additions & 0 deletions packages/core/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test
.nyc_output
22 changes: 22 additions & 0 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,28 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [5.11.1](https://github.com/pattern-lab/patternlab-node/tree/master/packages/core/compare/v5.10.2...v5.11.1) (2020-06-28)


### Bug Fixes

* enable partial build via option ([8aaa533](https://github.com/pattern-lab/patternlab-node/tree/master/packages/core/commit/8aaa53398563ade14123c481bf509f9ee0c768f5))





# [5.11.0](https://github.com/pattern-lab/patternlab-node/tree/master/packages/core/compare/v5.10.2...v5.11.0) (2020-06-28)


### Bug Fixes

* enable partial build via option ([8aaa533](https://github.com/pattern-lab/patternlab-node/tree/master/packages/core/commit/8aaa53398563ade14123c481bf509f9ee0c768f5))





## [5.10.1](https://github.com/pattern-lab/patternlab-node/tree/master/packages/core/compare/v5.10.0...v5.10.1) (2020-05-09)

**Note:** Version bump only for package @pattern-lab/core
Expand Down
6 changes: 3 additions & 3 deletions packages/core/docs/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Emitted after global `data.json` and `listitems.json` are read, and the supporti
Emitted before all data is merged prior to a Pattern's render. Global `data.json` is merged with any pattern `.json`. Global `listitems.json` is merged with any pattern `.listitems.json`.

**Kind**: inner property of [<code>EVENTS</code>](#exp_module_Events--EVENTS)
**See**: [Pattern](https://github.com/pattern-lab/patternlab-node/blob/master/src/lib/object_factory.js#L16)
**See**: [Pattern](https://github.com/pattern-lab/patternlab-node/blob/master/packages/core/src/lib/object_factory.js#L16)
**Properties**

| Name | Type | Description |
Expand All @@ -92,7 +92,7 @@ Emitted before all data is merged prior to a Pattern's render. Global `data.json
Emitted before a pattern's template, HTML, and encoded HTML files are written to their output location

**Kind**: inner property of [<code>EVENTS</code>](#exp_module_Events--EVENTS)
**See**: [Pattern](https://github.com/pattern-lab/patternlab-node/blob/master/src/lib/object_factory.js#L16)
**See**: [Pattern](https://github.com/pattern-lab/patternlab-node/blob/master/packages/core/src/lib/object_factory.js#L16)
**Properties**

| Name | Type | Description |
Expand All @@ -107,7 +107,7 @@ Emitted before a pattern's template, HTML, and encoded HTML files are written to
Emitted after a pattern's template, HTML, and encoded HTML files are written to their output location

**Kind**: inner property of [<code>EVENTS</code>](#exp_module_Events--EVENTS)
**See**: [Pattern](https://github.com/pattern-lab/patternlab-node/blob/master/src/lib/object_factory.js#L16)
**See**: [Pattern](https://github.com/pattern-lab/patternlab-node/blob/master/packages/core/src/lib/object_factory.js#L16)
**Properties**

| Name | Type | Description |
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@pattern-lab/core",
"description": "Create atomic design systems with Pattern Lab. This is the core API and orchestrator of the ecosystem.",
"version": "5.10.1",
"version": "5.11.1",
"main": "./src/index.js",
"dependencies": {
"@pattern-lab/engine-mustache": "^5.10.1",
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
4 changes: 3 additions & 1 deletion packages/core/src/lib/buildPatterns.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ module.exports = async (deletePatternDir, patternlab, additionalData) => {

// Flags
patternlab.incrementalBuildsEnabled = !(
patternlab.config.cleanPublic || graphNeedsUpgrade
patternlab.config.cleanPublic ||
graphNeedsUpgrade ||
deletePatternDir
);

//
Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/lib/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,23 @@ const EVENTS = Object.freeze({
* @desc Emitted before all data is merged prior to a Pattern's render. Global `data.json` is merged with any pattern `.json`. Global `listitems.json` is merged with any pattern `.listitems.json`.
* @property {object} patternlab - global data store
* @property {Pattern} pattern - current pattern
* @see {@link https://github.com/pattern-lab/patternlab-node/blob/master/src/lib/object_factory.js#L16|Pattern}
* @see {@link https://github.com/pattern-lab/patternlab-node/blob/master/packages/core/src/lib/object_factory.js#L16|Pattern}
*/
PATTERNLAB_PATTERN_BEFORE_DATA_MERGE: 'patternlab-pattern-before-data-merge',

/**
* @desc Emitted before a pattern's template, HTML, and encoded HTML files are written to their output location
* @property {object} patternlab - global data store
* @property {Pattern} pattern - current pattern
* @see {@link https://github.com/pattern-lab/patternlab-node/blob/master/src/lib/object_factory.js#L16|Pattern}
* @see {@link https://github.com/pattern-lab/patternlab-node/blob/master/packages/core/src/lib/object_factory.js#L16|Pattern}
*/
PATTERNLAB_PATTERN_WRITE_BEGIN: 'patternlab-pattern-write-begin',

/**
* @desc Emitted after a pattern's template, HTML, and encoded HTML files are written to their output location
* @property {object} patternlab - global data store
* @property {Pattern} pattern - current pattern
* @see {@link https://github.com/pattern-lab/patternlab-node/blob/master/src/lib/object_factory.js#L16|Pattern}
* @see {@link https://github.com/pattern-lab/patternlab-node/blob/master/packages/core/src/lib/object_factory.js#L16|Pattern}
*/
PATTERNLAB_PATTERN_WRITE_END: 'patternlab-pattern-write-end',

Expand Down
18 changes: 16 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,24 @@ 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) &&
// If the parameter is not available after updating pattern lab but
// not the patternlab-config it should not override arrays.
patternlab.config.hasOwnProperty('patternMergeVariantArrays') &&
!patternlab.config.patternMergeVariantArrays
) {
return 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"a": 1,
"b": [2, 3],
"c": {
"d": [4, 5],
"e": 8,
"f": {"a": ["a"], "b": ["b"], "c": ["c"]}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{a}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"a": 2,
"b": [8],
"c": {
"d": [6, 7],
"f": {"b": ["x"]}
}
}
65 changes: 65 additions & 0 deletions packages/core/test/pseudopattern_hunter_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,68 @@ tap.test(
});
}
);

tap.test('pseudo pattern variant data should merge arrays', function(test) {
const pl = stubPatternlab();
pl.config.patternMergeVariantArrays = true;

const pattern = loadPattern('00-test/475-variant-test.mustache', pl);

addPattern(pattern, pl);

return pph.find_pseudopatterns(pattern, pl).then(() => {
test.equals(pl.patterns[1].patternPartial, 'test-variant-test-merge');
test.equals(
JSON.stringify(pl.patterns[1].jsonFileData),
JSON.stringify({
a: 2,
b: [8, 3],
c: { d: [6, 7], e: 8, f: { a: ['a'], b: ['x'], c: ['c'] } },
})
);
});
});

tap.test(
'pseudo pattern variant data should merge arrays if config "patternMergeVariantArrays" is not available as default behavior',
function(test) {
const pl = stubPatternlab();

const pattern = loadPattern('00-test/475-variant-test.mustache', pl);

addPattern(pattern, pl);

return pph.find_pseudopatterns(pattern, pl).then(() => {
test.equals(pl.patterns[1].patternPartial, 'test-variant-test-merge');
test.equals(
JSON.stringify(pl.patterns[1].jsonFileData),
JSON.stringify({
a: 2,
b: [8, 3],
c: { d: [6, 7], e: 8, f: { a: ['a'], b: ['x'], c: ['c'] } },
})
);
});
}
);

tap.test('pseudo pattern variant data should override arrays', function(test) {
const pl = stubPatternlab();
pl.config.patternMergeVariantArrays = false;

const pattern = loadPattern('00-test/475-variant-test.mustache', pl);

addPattern(pattern, pl);

return pph.find_pseudopatterns(pattern, pl).then(() => {
test.equals(pl.patterns[1].patternPartial, 'test-variant-test-merge');
test.equals(
JSON.stringify(pl.patterns[1].jsonFileData),
JSON.stringify({
a: 2,
b: [8],
c: { d: [6, 7], e: 8, f: { a: ['a'], b: ['x'], c: ['c'] } },
})
);
});
});
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
16 changes: 16 additions & 0 deletions packages/create/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,22 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [5.11.1](https://github.com/pattern-lab/patternlab-node/compare/v5.10.2...v5.11.1) (2020-06-28)

**Note:** Version bump only for package create-pattern-lab





# [5.11.0](https://github.com/pattern-lab/patternlab-node/compare/v5.10.2...v5.11.0) (2020-06-28)

**Note:** Version bump only for package create-pattern-lab





## [5.10.1](https://github.com/pattern-lab/patternlab-node/compare/v5.10.0...v5.10.1) (2020-05-09)

**Note:** Version bump only for package create-pattern-lab
Expand Down
Loading

0 comments on commit 37f9749

Please sign in to comment.