Skip to content

Commit

Permalink
Structuring all the same data that went into patternlab-data.js and…
Browse files Browse the repository at this point in the history
… putting it into `patternlab-data.json` too (#161)
  • Loading branch information
EvanLovely committed Feb 27, 2018
1 parent 46ae845 commit 009399c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/PatternLab/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,16 @@ protected function generateIndex() {

// write out the data
file_put_contents($dataDir."/patternlab-data.js",$output);
// Structuring all the same data that went into `patternlab-data.js` and putting it into `patternlab-data.json` too
$allPlData = array(
'config' => $config,
'ishControls' => $ishControls,
'navItems' => $navItems,
'patternPaths' => $patternPaths,
'viewAllPaths' => $viewAllPaths,
'plugins' => $packagesInfo,
);
file_put_contents($dataDir."/patternlab-data.json", json_encode($allPlData));

// note the end of the operation
$dispatcherInstance->dispatch("builder.generateIndexEnd");
Expand Down

0 comments on commit 009399c

Please sign in to comment.