Skip to content

Commit

Permalink
addresses issue #73, which would cause dependency
Browse files Browse the repository at this point in the history
resolution to fail if callbacks are declared with
their ".js" file extensiions
  • Loading branch information
jeffschwartz committed Jul 3, 2019
1 parent f9bc362 commit 8e5c153
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -17,6 +17,7 @@ module.exports = (callbackStat, pathsToAllIncludes, pathsToAllTemplates, pathsTo
// check if include references callback
const m = getCachedMatter(path);
return getTagCallbackDependencies(cheerio.load(mdToHtml(path, m.content)))
.map(path => parse(path).name)
.includes(parse(callbackStat.path).name);
});
callbackStat.templateDeps = pathsToAllTemplates
@@ -31,6 +32,7 @@ module.exports = (callbackStat, pathsToAllIncludes, pathsToAllTemplates, pathsTo
const condition2 = () =>
// check if template references callback
getTagCallbackDependencies($content)
.map(path => parse(path).name)
.includes(parse(callbackStat.path).name);
// return condition1() || condition2()
return condition1() || condition2();
@@ -53,6 +55,7 @@ module.exports = (callbackStat, pathsToAllIncludes, pathsToAllTemplates, pathsTo
const condition3 = () =>
// check if fragment references callback
getTagCallbackDependencies(cheerio.load(mdToHtml(path, m.content)))
.map(path => parse(path).name)
.includes(parse(callbackStat.path).name);
// return condition1() || condition2() || condition3() || condition4();
return condition1() || condition2() || condition3();
8 changes: 6 additions & 2 deletions lib/generator/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// ToDo: provide option to create minimum application when creating a new project.
// ToDo: provide options to create assets: template, fragment, include, callback.
// Items to be addressed:
// ToDo: provide option to create scaffolding application when creating a new project.
// ToDo: provide options to create assets: template, fragment, include, callback?

// Items that may or may not be addressed:
// ToDo: make missing assets terminate process an option - currently warning?
// Bug: rename config.public (i.e. public is a reserved word) to config.publicFolder?
// ToDo: is assigning modified date to each asset still required as the modified date from .cache/stats.json is being used and not the individual files?
@@ -9,6 +11,8 @@
// ToDo: add sortedTagCatalogFlattened to metadata?
// ToDo: require-uncached has been deprecated in favor of import-fresh - upgrade when convenient???

// Items Addressed:
// Bug: see issue #73 regarding callbacks declared with .js file extensions causing dependency resolution to fail!
// Bug: file names without extensions are ignored when copying files from etc folder!
// ToDo: for release builds, delete the release folder if it exists first!
// ToDo: document the new predefined front matter alwaysBuild property!

0 comments on commit 8e5c153

Please sign in to comment.