Skip to content

Commit eed159c

Browse files
Merge pull request #686 from pattern-lab/dev
Pattern Lab Node Core 2.11.1
2 parents fb1e031 + 83f4fd9 commit eed159c

File tree

5 files changed

+44
-6
lines changed

5 files changed

+44
-6
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@ This repository contains the core functionality for Pattern Lab Node. Pattern La
1010

1111
## Support for Pattern Lab Node
1212

13-
Pattern Lab Node wouldn't be what it is today without the support of the community. It will always be free and open source. Continued development is made possible in part from the support of [these wonderful project supporters](https://github.com/pattern-lab/patternlab-node/wiki/Thanks). If you want to learn more about supporting the project, visit the [Pattern Lab Node Patreon page](https://www.patreon.com/patternlab).
13+
Pattern Lab Node wouldn't be what it is today without the support of the community. It will always be free and open source. Continued development is made possible in part from the support of [these wonderful project supporters](https://github.com/pattern-lab/patternlab-node/wiki/Thanks). If you want to learn more about supporting the project, visit the [Pattern Lab Node Patreon page](https://www.patreon.com/patternlab).
1414

15-
**:100: Thanks for support from the following:**
15+
**:100: Thanks for support from the following:**
1616

1717
* **[Brad Frost](http://bradfrost.com/)**
1818
* [Marcos Peebles](https://twitter.com/marcospeebles)
1919
* [Susan Simkins](https://twitter.com/susanmsimkins)
20+
* [Wilfred Nas](https://twitter.com/wnas)
2021

2122
## Installation
2223

core/lib/patternlab.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* patternlab-node - v2.11.0 - 2017
2+
* patternlab-node - v2.11.1 - 2017
33
*
44
* Brian Muenzenmeyer, Geoff Pursell, Raphael Okon, tburny and the web community.
55
* Licensed under the MIT license.
@@ -504,7 +504,7 @@ var patternlab_engine = function (config) {
504504
patternlab.data = {};
505505
}
506506
try {
507-
patternlab.listitems = dataLoader.loadDataFromFile(path.resolve(paths.source.data, 'listitems.{json,yml,yaml}'));
507+
patternlab.listitems = dataLoader.loadDataFromFile(path.resolve(paths.source.data, 'listitems'), fs);
508508
} catch (ex) {
509509
plutils.warning('WARNING: missing or malformed ' + paths.source.data + 'listitems file. Pattern Lab may not work without this file.');
510510
patternlab.listitems = {};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "patternlab-node",
33
"description": "Pattern Lab is a collection of tools to help you create atomic design systems. This is the node command line interface (CLI).",
4-
"version": "2.11.0",
4+
"version": "2.11.1",
55
"main": "./core/lib/patternlab.js",
66
"dependencies": {
77
"chalk": "^1.1.3",
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{{#listItems.three}}
2+
{{title}}
3+
{{/listItems.three}}

test/pattern_assembler_tests.js

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,40 @@ tap.test('processPatternRecursive - ensure deep-nesting works', function(test) {
456456
test.end();
457457
});
458458

459+
tap.test('processPatternRecursive - 685 ensure listitems data is used', function(test) {
460+
//arrange
461+
var pattern_assembler = new pa();
462+
var util = require('./util/test_utils.js');
463+
var testPatternsPath = path.resolve(__dirname, 'files', '_patterns');
464+
var pl = util.fakePatternLab(testPatternsPath);
465+
pl.data.title = "0";
466+
pl.listitems = {
467+
"1": {
468+
"title": "1"
469+
},
470+
"2": {
471+
"title": "2"
472+
},
473+
"3": {
474+
"title": "3"
475+
}
476+
};
477+
478+
pattern_assembler.combine_listItems(pl);
479+
480+
var listPatternPath = path.join('00-test', '685-list.mustache');
481+
var listPattern = pattern_assembler.process_pattern_iterative(listPatternPath, pl);
482+
483+
//act
484+
pattern_assembler.process_pattern_recursive(listPatternPath, pl);
485+
486+
//assert
487+
test.true(listPattern.extendedTemplate.indexOf(1) > -1);
488+
test.true(listPattern.extendedTemplate.indexOf(2) > -1);
489+
test.true(listPattern.extendedTemplate.indexOf(3) > -1);
490+
test.end();
491+
});
492+
459493
tap.test('setState - applies any patternState matching the pattern', function(test) {
460494
//arrange
461495
var pa = require('../core/lib/pattern_assembler');
@@ -803,4 +837,4 @@ tap.test('parses pattern extra frontmatter correctly when frontmatter present',
803837
//assert
804838
test.equals(testPattern.allMarkdown.joke, 'bad','extra key not added');
805839
test.end();
806-
});
840+
});

0 commit comments

Comments
 (0)