Skip to content

Commit 3a1a92a

Browse files
Merge pull request #655 from pattern-lab/dev
Pattern Lab Node Core 2.9.2
2 parents 1fc695a + 579cc98 commit 3a1a92a

15 files changed

+156
-17
lines changed

core/lib/patternlab.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* patternlab-node - v2.9.1 - 2017
2+
* patternlab-node - v2.9.2 - 2017
33
*
44
* Brian Muenzenmeyer, Geoff Pursell, Raphael Okon, tburny and the web community.
55
* Licensed under the MIT license.
@@ -22,6 +22,10 @@ var diveSync = require('diveSync'),
2222
packageInfo = require('../../package.json'),
2323
plutils = require('./utilities'),
2424
jsonCopy = require('./json_copy'),
25+
ui = require('./ui_builder'),
26+
ui_builder = new ui(),
27+
pe = require('./pattern_exporter'),
28+
pattern_exporter = new pe(),
2529
PatternGraph = require('./pattern_graph').PatternGraph;
2630

2731
//register our log events
@@ -148,9 +152,7 @@ var patternlab_engine = function (config) {
148152
'use strict';
149153

150154
var pa = require('./pattern_assembler'),
151-
pe = require('./pattern_exporter'),
152155
lh = require('./lineage_hunter'),
153-
ui = require('./ui_builder'),
154156
sm = require('./starterkit_manager'),
155157
Pattern = require('./object_factory').Pattern,
156158
CompileState = require('./object_factory').CompileState,
@@ -159,7 +161,6 @@ var patternlab_engine = function (config) {
159161
patternlab.engines = patternEngines;
160162

161163
var pattern_assembler = new pa(),
162-
pattern_exporter = new pe(),
163164
lineage_hunter = new lh();
164165

165166
patternlab.package = fs.readJSONSync(path.resolve(__dirname, '../../package.json'));
@@ -528,6 +529,10 @@ var patternlab_engine = function (config) {
528529

529530
patternlab.events.emit('patternlab-pattern-iteration-end', patternlab);
530531

532+
//now that all the main patterns are known, look for any links that might be within data and expand them
533+
//we need to do this before expanding patterns & partials into extendedTemplates, otherwise we could lose the data -> partial reference
534+
pattern_assembler.parse_data_links(patternlab);
535+
531536
//diveSync again to recursively include partials, filling out the
532537
//extendedTemplate property of the patternlab.patterns elements
533538
// TODO we can reduce the time needed by only processing changed patterns and their partials
@@ -537,10 +542,6 @@ var patternlab_engine = function (config) {
537542
processHeadPattern();
538543
processFootPattern();
539544

540-
//now that all the main patterns are known, look for any links that might be within data and expand them
541-
//we need to do this before expanding patterns & partials into extendedTemplates, otherwise we could lose the data -> partial reference
542-
pattern_assembler.parse_data_links(patternlab);
543-
544545
//cascade any patternStates
545546
lineage_hunter.cascade_pattern_states(patternlab);
546547

@@ -580,7 +581,6 @@ var patternlab_engine = function (config) {
580581
}
581582
}
582583

583-
584584
//render all patterns last, so lineageR works
585585
patternsToBuild.forEach(pattern => renderSinglePattern(pattern, head));
586586

@@ -606,7 +606,7 @@ var patternlab_engine = function (config) {
606606
}
607607
patternlab.isBusy = true;
608608
buildPatterns(deletePatternDir);
609-
new ui().buildFrontend(patternlab);
609+
ui_builder.buildFrontend(patternlab);
610610
printDebug();
611611
patternlab.isBusy = false;
612612
callback();

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.9.1",
4+
"version": "2.9.2",
55
"main": "./core/lib/patternlab.js",
66
"dependencies": {
77
"chalk": "^1.1.3",

test/files/_data/listitems.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
{
2-
"test_list_item" : "izzn thizzle"
2+
"1": {
3+
"title": "Nullizzle shizznit velizzle, hizzle, suscipit own yo', gravida vizzle, arcu."
4+
},
5+
"2": {
6+
"title": "Veggies sunt bona vobis, proinde vos postulo"
7+
},
8+
"3": {
9+
"title": "Bacon ipsum dolor sit amet turducken strip steak beef ribs shank"
10+
}
311
}
4-

test/files/_meta/_00-head.mustache

Whitespace-only changes.

test/files/_meta/_01-foot.mustache

Whitespace-only changes.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<div class="{{styleModifier}}">
2+
{{> test-link }}
3+
</div>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"url" : "link.test-foo"
3+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{{> test-paramMiddle(styleModifier: "foo") }}

test/files/partials/general-footer.mustache

Whitespace-only changes.

test/files/partials/general-header.mustache

Whitespace-only changes.

0 commit comments

Comments
 (0)