Skip to content

Commit

Permalink
Fixes #580 Renaming pattern causes patternlab to break and #581 Setti…
Browse files Browse the repository at this point in the history
…ng cleanPublic = true after incremental build does not recompile all patterns.
  • Loading branch information
Tobias Brennecke committed Dec 23, 2016
1 parent ecb3c46 commit a1d11c9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions core/lib/patternlab.js
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ var patternlab_engine = function (config) {
* @param {boolean} deletePatternDir When {@code true}, an empty graph is returned
* @return {PatternGraph}
*/
function loadPatternGraph(patternlab, deletePatternDir) {
function loadPatternGraph(deletePatternDir) {
// Sanity check to prevent problems when code is refactored
if (deletePatternDir) {
return PatternGraph.empty();
Expand All @@ -460,7 +460,7 @@ var patternlab_engine = function (config) {

patternlab.events.emit('patternlab-build-pattern-start', patternlab);

let graph = patternlab.graph = loadPatternGraph(patternlab, deletePatternDir);
let graph = patternlab.graph = loadPatternGraph(deletePatternDir);

let graphNeedsUpgrade = !PatternGraph.checkVersion(graph);

Expand All @@ -476,7 +476,7 @@ var patternlab_engine = function (config) {
let incrementalBuildsEnabled = !(deletePatternDir || graphNeedsUpgrade);

if (incrementalBuildsEnabled) {
plutils.log.info("Incremental builds enabled.")
plutils.log.info("Incremental builds enabled.");
} else {
// needs to be done BEFORE processing patterns
fs.removeSync(paths.public.patterns);
Expand Down Expand Up @@ -559,7 +559,7 @@ var patternlab_engine = function (config) {
// When the graph was loaded from file, some patterns might have been moved/deleted between runs
// so the graph data become out of sync
patternlab.graph.sync().forEach(n => {
plutils.log.info("[Deleted/Moved] " + n)
plutils.log.info("[Deleted/Moved] " + n);
});

// TODO Find created or deleted files
Expand Down Expand Up @@ -599,8 +599,6 @@ var patternlab_engine = function (config) {
return getVersion();
},
build: function (callback, deletePatternDir) {
console.log("console log");
plutils.log.info("plutils log")
if (patternlab && patternlab.isBusy) {
console.log('Pattern Lab is busy building a previous run - returning early.');
return;
Expand Down
2 changes: 1 addition & 1 deletion core/lib/ui_builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ var ui_builder = function () {
output += 'var ishControls = {"ishControlsHide":' + JSON.stringify(patternlab.config.ishControlsHide) + '};' + eol;

//navItems
output += 'var navItems = {"patternTypes": ' + JSON.stringify(patternlab.patternTypes) + ', "ishControlsHide": ' + JSON.stringify(patternlab.config.ishControlsHide) +'};' + eol;
output += 'var navItems = {"patternTypes": ' + JSON.stringify(patternlab.patternTypes) + ', "ishControlsHide": ' + JSON.stringify(patternlab.config.ishControlsHide) + '};' + eol;

//patternPaths
output += 'var patternPaths = ' + JSON.stringify(patternlab.patternPaths) + ';' + eol;
Expand Down

0 comments on commit a1d11c9

Please sign in to comment.