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 ( ) ;
0 commit comments