1
1
/*
2
- * patternlab-node - v2.9.1 - 2017
2
+ * patternlab-node - v2.9.2 - 2017
3
3
*
4
4
* Brian Muenzenmeyer, Geoff Pursell, Raphael Okon, tburny and the web community.
5
5
* Licensed under the MIT license.
@@ -22,6 +22,10 @@ var diveSync = require('diveSync'),
22
22
packageInfo = require ( '../../package.json' ) ,
23
23
plutils = require ( './utilities' ) ,
24
24
jsonCopy = require ( './json_copy' ) ,
25
+ ui = require ( './ui_builder' ) ,
26
+ ui_builder = new ui ( ) ,
27
+ pe = require ( './pattern_exporter' ) ,
28
+ pattern_exporter = new pe ( ) ,
25
29
PatternGraph = require ( './pattern_graph' ) . PatternGraph ;
26
30
27
31
//register our log events
@@ -148,9 +152,7 @@ var patternlab_engine = function (config) {
148
152
'use strict' ;
149
153
150
154
var pa = require ( './pattern_assembler' ) ,
151
- pe = require ( './pattern_exporter' ) ,
152
155
lh = require ( './lineage_hunter' ) ,
153
- ui = require ( './ui_builder' ) ,
154
156
sm = require ( './starterkit_manager' ) ,
155
157
Pattern = require ( './object_factory' ) . Pattern ,
156
158
CompileState = require ( './object_factory' ) . CompileState ,
@@ -159,7 +161,6 @@ var patternlab_engine = function (config) {
159
161
patternlab . engines = patternEngines ;
160
162
161
163
var pattern_assembler = new pa ( ) ,
162
- pattern_exporter = new pe ( ) ,
163
164
lineage_hunter = new lh ( ) ;
164
165
165
166
patternlab . package = fs . readJSONSync ( path . resolve ( __dirname , '../../package.json' ) ) ;
@@ -528,6 +529,10 @@ var patternlab_engine = function (config) {
528
529
529
530
patternlab . events . emit ( 'patternlab-pattern-iteration-end' , patternlab ) ;
530
531
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
+
531
536
//diveSync again to recursively include partials, filling out the
532
537
//extendedTemplate property of the patternlab.patterns elements
533
538
// TODO we can reduce the time needed by only processing changed patterns and their partials
@@ -537,10 +542,6 @@ var patternlab_engine = function (config) {
537
542
processHeadPattern ( ) ;
538
543
processFootPattern ( ) ;
539
544
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
-
544
545
//cascade any patternStates
545
546
lineage_hunter . cascade_pattern_states ( patternlab ) ;
546
547
@@ -580,7 +581,6 @@ var patternlab_engine = function (config) {
580
581
}
581
582
}
582
583
583
-
584
584
//render all patterns last, so lineageR works
585
585
patternsToBuild . forEach ( pattern => renderSinglePattern ( pattern , head ) ) ;
586
586
@@ -606,7 +606,7 @@ var patternlab_engine = function (config) {
606
606
}
607
607
patternlab . isBusy = true ;
608
608
buildPatterns ( deletePatternDir ) ;
609
- new ui ( ) . buildFrontend ( patternlab ) ;
609
+ ui_builder . buildFrontend ( patternlab ) ;
610
610
printDebug ( ) ;
611
611
patternlab . isBusy = false ;
612
612
callback ( ) ;
0 commit comments