Skip to content

Commit

Permalink
Merge pull request #686 from pattern-lab/dev
Browse files Browse the repository at this point in the history
Pattern Lab Node Core 2.11.1
  • Loading branch information
bmuenzenmeyer authored Sep 19, 2017
2 parents fb1e031 + 83f4fd9 commit eed159c
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 6 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ This repository contains the core functionality for Pattern Lab Node. Pattern La

## Support for Pattern Lab Node

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).
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).

**:100: Thanks for support from the following:**
**:100: Thanks for support from the following:**

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

## Installation

Expand Down
4 changes: 2 additions & 2 deletions core/lib/patternlab.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* patternlab-node - v2.11.0 - 2017
* patternlab-node - v2.11.1 - 2017
*
* Brian Muenzenmeyer, Geoff Pursell, Raphael Okon, tburny and the web community.
* Licensed under the MIT license.
Expand Down Expand Up @@ -504,7 +504,7 @@ var patternlab_engine = function (config) {
patternlab.data = {};
}
try {
patternlab.listitems = dataLoader.loadDataFromFile(path.resolve(paths.source.data, 'listitems.{json,yml,yaml}'));
patternlab.listitems = dataLoader.loadDataFromFile(path.resolve(paths.source.data, 'listitems'), fs);
} catch (ex) {
plutils.warning('WARNING: missing or malformed ' + paths.source.data + 'listitems file. Pattern Lab may not work without this file.');
patternlab.listitems = {};
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "patternlab-node",
"description": "Pattern Lab is a collection of tools to help you create atomic design systems. This is the node command line interface (CLI).",
"version": "2.11.0",
"version": "2.11.1",
"main": "./core/lib/patternlab.js",
"dependencies": {
"chalk": "^1.1.3",
Expand Down
3 changes: 3 additions & 0 deletions test/files/_patterns/00-test/685-list.mustache
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{{#listItems.three}}
{{title}}
{{/listItems.three}}
36 changes: 35 additions & 1 deletion test/pattern_assembler_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,40 @@ tap.test('processPatternRecursive - ensure deep-nesting works', function(test) {
test.end();
});

tap.test('processPatternRecursive - 685 ensure listitems data is used', function(test) {
//arrange
var pattern_assembler = new pa();
var util = require('./util/test_utils.js');
var testPatternsPath = path.resolve(__dirname, 'files', '_patterns');
var pl = util.fakePatternLab(testPatternsPath);
pl.data.title = "0";
pl.listitems = {
"1": {
"title": "1"
},
"2": {
"title": "2"
},
"3": {
"title": "3"
}
};

pattern_assembler.combine_listItems(pl);

var listPatternPath = path.join('00-test', '685-list.mustache');
var listPattern = pattern_assembler.process_pattern_iterative(listPatternPath, pl);

//act
pattern_assembler.process_pattern_recursive(listPatternPath, pl);

//assert
test.true(listPattern.extendedTemplate.indexOf(1) > -1);
test.true(listPattern.extendedTemplate.indexOf(2) > -1);
test.true(listPattern.extendedTemplate.indexOf(3) > -1);
test.end();
});

tap.test('setState - applies any patternState matching the pattern', function(test) {
//arrange
var pa = require('../core/lib/pattern_assembler');
Expand Down Expand Up @@ -803,4 +837,4 @@ tap.test('parses pattern extra frontmatter correctly when frontmatter present',
//assert
test.equals(testPattern.allMarkdown.joke, 'bad','extra key not added');
test.end();
});
});

0 comments on commit eed159c

Please sign in to comment.