ember-cli-htmlbars
Advanced tools
Comparing version 1.0.11 to 1.1.0
@@ -6,2 +6,3 @@ 'use strict'; | ||
var utils = require('./utils'); | ||
var hashForDep = require('hash-for-dep'); | ||
@@ -94,2 +95,4 @@ module.exports = { | ||
global.EmberENV = EmberENV; // Needed for eval time feature flag checks | ||
var pluginInfo = this.astPlugins(); | ||
var htmlbarsOptions = { | ||
@@ -102,4 +105,6 @@ isHTMLBars: true, | ||
plugins: { | ||
ast: this.astPlugins() | ||
} | ||
ast: pluginInfo.plugins | ||
}, | ||
pluginCacheKey: pluginInfo.cacheKeys | ||
}; | ||
@@ -116,8 +121,27 @@ | ||
var pluginWrappers = this.parentRegistry.load('htmlbars-ast-plugin'); | ||
var plugins = pluginWrappers.map(function(wrapper) { | ||
return wrapper.plugin; | ||
}); | ||
var plugins = []; | ||
var cacheKeys = []; | ||
return plugins; | ||
for (var i = 0; i < pluginWrappers.length; i++) { | ||
var wrapper = pluginWrappers[i]; | ||
plugins.push(wrapper.plugin); | ||
if (typeof wrapper.baseDir === 'function') { | ||
var pluginHashForDep = hashForDep(wrapper.baseDir()); | ||
cacheKeys.push(pluginHashForDep); | ||
} else { | ||
// support for ember-cli < 2.2.0 | ||
var log = this.ui.writeDeprecateLine || this.ui.writeLine; | ||
log.call(this.ui, 'ember-cli-htmlbars is opting out of caching due to an AST plugin that does not provide a caching strategy: `' + wrapper.name + '`.'); | ||
cacheKeys.push((new Date()).getTime() + '|' + Math.random()); | ||
} | ||
} | ||
return { | ||
plugins: plugins, | ||
cacheKeys: cacheKeys | ||
}; | ||
} | ||
}; |
{ | ||
"name": "ember-cli-htmlbars", | ||
"version": "1.0.11", | ||
"version": "1.1.0", | ||
"description": "A library for adding htmlbars to ember CLI", | ||
@@ -36,4 +36,4 @@ "main": "index.js", | ||
"broccoli": "^0.16.7", | ||
"broccoli-concat": "0.0.11", | ||
"mocha": "^1.21.4", | ||
"broccoli-concat": "2.3.4", | ||
"mocha": "^3.0.2", | ||
"mocha-jshint": "^0.0.9" | ||
@@ -44,2 +44,3 @@ }, | ||
"ember-cli-version-checker": "^1.0.2", | ||
"hash-for-dep": "^1.0.2", | ||
"json-stable-stringify": "^1.0.0", | ||
@@ -46,0 +47,0 @@ "strip-bom": "^2.0.0" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
221
10429
5
5
1
0
+ Addedhash-for-dep@^1.0.2