diff --git a/README.md b/README.md
index 8bb404298..942921085 100644
--- a/README.md
+++ b/README.md
@@ -8,6 +8,15 @@ This repository contains the core functionality for Pattern Lab Node. Pattern La
[Online Demo of Pattern Lab Output](http://demo.patternlab.io/)
+## 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).
+
+**:100: Thanks for support from the following:**
+
+* **[Brad Frost](http://bradfrost.com/)**
+* Marcos Peebles
+
## Installation
Pattern Lab Node Core is designed to be consumed, and by default is included as a dependency within two example [Node Editions](https://github.com/pattern-lab?utf8=%E2%9C%93&query=edition-node).
@@ -84,15 +93,6 @@ There is also a dedicated Pattern Lab channel on the [design system slack](desig
Ask or answer Pattern Lab questions on Stack Overflow: http://stackoverflow.com/questions/tagged/patternlab.io
-## Support Pattern Lab Node
-
-Pattern Lab Node is on [Patreon account](https://www.patreon.com/patternlab) to allow users and organizations to directly support continued work on the Pattern Lab Node project.
-
-I (Brian talking) need help and support to make Pattern Lab Node a sustained success. I devote a lot of free time and would-be sleep to make the project what it is, but nothing compares to hearing back from users. It means the world to me when people find value in Pattern Lab Node. I am ridiculously humbled to hear and see what you all build with it.
-
-If you find yourself here and balk and the idea of supporting open source software monetarily - I understand. Carry on, but please do share what you build - we all learn more together.
-- [Pattern Lab on Patreon](https://www.patreon.com/patternlab)
-
## License
[MIT](https://github.com/pattern-lab/patternlab-node/blob/master/LICENSE)
diff --git a/core/lib/parameter_hunter.js b/core/lib/parameter_hunter.js
index 44f33adeb..b9c64f06f 100644
--- a/core/lib/parameter_hunter.js
+++ b/core/lib/parameter_hunter.js
@@ -271,6 +271,9 @@ var parameter_hunter = function () {
var allData = plutils.mergeData(globalData, localData);
allData = plutils.mergeData(allData, paramData);
+ //if the partial has pattern parameters itself, we need to handle those
+ findparameters(partialPattern, patternlab);
+
//if partial has style modifier data, replace the styleModifier value
if (pattern.stylePartials && pattern.stylePartials.length > 0) {
style_modifier_hunter.consume_style_modifier(partialPattern, pMatch, patternlab);
diff --git a/core/lib/patternlab.js b/core/lib/patternlab.js
index 6ee8d5d44..49641b820 100644
--- a/core/lib/patternlab.js
+++ b/core/lib/patternlab.js
@@ -1,5 +1,5 @@
/*
- * patternlab-node - v2.9.2 - 2017
+ * patternlab-node - v2.9.3 - 2017
*
* Brian Muenzenmeyer, Geoff Pursell, Raphael Okon, tburny and the web community.
* Licensed under the MIT license.
diff --git a/package.json b/package.json
index 8c856442d..9d4357750 100644
--- a/package.json
+++ b/package.json
@@ -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.9.2",
+ "version": "2.9.3",
"main": "./core/lib/patternlab.js",
"dependencies": {
"chalk": "^1.1.3",
diff --git a/test/files/_patterns/00-test/539-a.mustache b/test/files/_patterns/00-test/539-a.mustache
new file mode 100644
index 000000000..ba154f442
--- /dev/null
+++ b/test/files/_patterns/00-test/539-a.mustache
@@ -0,0 +1,4 @@
+a
+{{ #a }}
+a!
+{{ /a }}
diff --git a/test/files/_patterns/00-test/539-b.mustache b/test/files/_patterns/00-test/539-b.mustache
new file mode 100644
index 000000000..70997abb3
--- /dev/null
+++ b/test/files/_patterns/00-test/539-b.mustache
@@ -0,0 +1,5 @@
+b
+{{ #b }}
+b!
+{{ /b }}
+{{> test-a(a: true) }}
diff --git a/test/files/_patterns/00-test/539-c.mustache b/test/files/_patterns/00-test/539-c.mustache
new file mode 100644
index 000000000..6098102c8
--- /dev/null
+++ b/test/files/_patterns/00-test/539-c.mustache
@@ -0,0 +1,2 @@
+c
+{{> test-b(b: true) }}
diff --git a/test/parameter_hunter_tests.js b/test/parameter_hunter_tests.js
index 092f44428..a94e42e75 100644
--- a/test/parameter_hunter_tests.js
+++ b/test/parameter_hunter_tests.js
@@ -1,9 +1,16 @@
"use strict";
var tap = require('tap');
+var pa = require('../core/lib/pattern_assembler');
+var Pattern = require('../core/lib/object_factory').Pattern;
+var CompileState = require('../core/lib/object_factory').CompileState;
+var PatternGraph = require('../core/lib/pattern_graph').PatternGraph;
+
+var fs = require('fs-extra');
var ph = require('../core/lib/parameter_hunter');
+
//setup current pattern from what we would have during execution
function currentPatternClosure() {
return {
@@ -48,9 +55,11 @@ function patternlabClosure() {
debug: false
},
data: {
- description: 'Not a quote from a smart man'
+ description: 'Not a quote from a smart man',
+ link: {}
},
- partials: {}
+ partials: {},
+ graph: PatternGraph.empty()
}
};
@@ -65,6 +74,57 @@ tap.test('parameter hunter finds and extends templates', function(test) {
test.end();
});
+tap.test('parameter hunter finds partials with their own parameters and renders them too', function(test) {
+ //arrange
+
+ var pattern_assembler = new pa();
+ var patterns_dir = './test/files/_patterns/';
+
+ var pl = patternlabClosure();
+
+
+ var aPattern = new Pattern('00-test/539-a.mustache');
+ aPattern.template = fs.readFileSync(patterns_dir + '00-test/539-a.mustache', 'utf8');
+ aPattern.extendedTemplate = aPattern.template;
+ aPattern.stylePartials = pattern_assembler.find_pattern_partials_with_style_modifiers(aPattern);
+ aPattern.parameteredPartials = pattern_assembler.find_pattern_partials_with_parameters(aPattern);
+
+ var bPattern = new Pattern('00-test/539-b.mustache');
+ bPattern.template = fs.readFileSync(patterns_dir + '00-test/539-b.mustache', 'utf8');
+ bPattern.extendedTemplate = bPattern.template;
+ bPattern.stylePartials = pattern_assembler.find_pattern_partials_with_style_modifiers(bPattern);
+ bPattern.parameteredPartials = pattern_assembler.find_pattern_partials_with_parameters(bPattern);
+
+ var cPattern = new Pattern('00-test/539-c.mustache');
+ cPattern.template = fs.readFileSync(patterns_dir + '00-test/539-c.mustache', 'utf8');
+ cPattern.extendedTemplate = cPattern.template;
+ cPattern.stylePartials = pattern_assembler.find_pattern_partials_with_style_modifiers(cPattern);
+ cPattern.parameteredPartials = pattern_assembler.find_pattern_partials_with_parameters(cPattern);
+
+ pattern_assembler.addPattern(aPattern, pl);
+ pattern_assembler.addPattern(bPattern, pl);
+ pattern_assembler.addPattern(cPattern, pl);
+
+ var currentPattern = cPattern;
+ var parameter_hunter = new ph();
+
+ //act
+ parameter_hunter.find_parameters(currentPattern, pl);
+
+ //assert
+ test.equals(currentPattern.extendedTemplate,
+ `c
+b
+b!
+a
+a!
+
+
+`);
+
+ test.end();
+});
+
tap.test('parameter hunter finds and extends templates with mixed parameter and global data', function(test) {
var currentPattern = currentPatternClosure();
var patternlab = patternlabClosure();