Skip to content

Commit

Permalink
Fixes marko-js#127 - Make sure all possible input files are accounted…
Browse files Browse the repository at this point in the history
… for
  • Loading branch information
patrick-steele-idem committed Aug 18, 2015
1 parent 8616a97 commit 1066d92
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
11 changes: 11 additions & 0 deletions compiler/taglibs/taglib-loader/loader-tag.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ function TagHandlers(tag, dirname, path, taglib) {
this.dirname = dirname;
this.path = path;
this.taglib = taglib;

if (!taglib) {
throw new Error('taglib expected');
}
}

TagHandlers.prototype = {
Expand All @@ -99,6 +103,8 @@ TagHandlers.prototype = {
var dirname = this.dirname;
var path = resolve(value, dirname);

this.taglib.addInputFile(path);

tag.renderer = path;
},

Expand All @@ -116,6 +122,8 @@ TagHandlers.prototype = {
throw new Error('Template at path "' + path + '" does not exist.');
}

this.taglib.addInputFile(path);

tag.template = path;
},

Expand Down Expand Up @@ -150,6 +158,7 @@ TagHandlers.prototype = {

var path = resolve(value, dirname);
tag.nodeClass = path;
this.taglib.addInputFile(path);
},
/**
* If the "preserve-whitespace" property is set to true then
Expand All @@ -171,6 +180,7 @@ TagHandlers.prototype = {
var tag = this.tag;
var dirname = this.dirname;
var path = this.path;
var taglib = this.taglib;

var transformer = new Taglib.Transformer();

Expand All @@ -192,6 +202,7 @@ TagHandlers.prototype = {
path: function(value) {
var path = resolve(value, dirname);
transformer.path = path;
taglib.addInputFile(path);
},

priority: function(value) {
Expand Down
2 changes: 2 additions & 0 deletions compiler/taglibs/taglib-loader/loader-taglib.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ TaglibHandlers.prototype = {

ok(transformer.path, '"path" is required for transformer');

taglib.addInputFile(transformer.path);

taglib.addTextTransformer(transformer);
},

Expand Down
1 change: 1 addition & 0 deletions compiler/taglibs/taglib-loader/scanTagsDir.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ module.exports = function scanTagsDir(tagsConfigPath, tagsConfigDirname, dir, ta
// Record dependencies so that we can check if a template is up-to-date
taglib.addInputFile(tagFile);
taglib.addInputFile(rendererFile);
taglib.addInputFile(templateFile);

if (fs.existsSync(tagFile)) {
// marko-tag.json exists in the directory, use that as the tag definition
Expand Down

0 comments on commit 1066d92

Please sign in to comment.