ember-cli-htmlbars
Advanced tools
Comparing version 0.3.2 to 0.3.3
@@ -8,14 +8,8 @@ 'use strict'; | ||
included: function (app) { | ||
var projectConfig = app.project.config(app.env); | ||
var htmlbarsEnabled = projectConfig.EmberENV.FEATURES['ember-htmlbars']; | ||
var htmlbarsComponentGeneration = projectConfig.EmberENV.FEATURES['ember-htmlbars-component-generation']; | ||
var self = this; | ||
if (htmlbarsEnabled) { | ||
var htmlbarsOptions = { | ||
disableComponentGeneration: htmlbarsComponentGeneration !== true | ||
}; | ||
} | ||
this._super.included.apply(this, arguments); | ||
this.registerTransforms(app.registry); | ||
// ensure that broccoli-ember-hbs-template-compiler is not processing hbs files | ||
@@ -28,6 +22,50 @@ app.registry.remove('template', 'broccoli-ember-hbs-template-compiler'); | ||
toTree: function(tree) { | ||
return htmlbarsCompile(tree, { htmlbarsOptions: htmlbarsOptions }); | ||
return htmlbarsCompile(tree, { htmlbarsOptions: self.htmlbarsOptions() }); | ||
} | ||
}) | ||
}, | ||
htmlbarsOptions: function() { | ||
var projectConfig = this.app.project.config(this.app.env); | ||
var htmlbarsEnabled = projectConfig.EmberENV.FEATURES['ember-htmlbars']; | ||
var htmlbarsComponentGeneration = projectConfig.EmberENV.FEATURES['ember-htmlbars-component-generation']; | ||
var htmlbarsOptions; | ||
if (htmlbarsEnabled) { | ||
htmlbarsOptions = { | ||
disableComponentGeneration: htmlbarsComponentGeneration !== true, | ||
plugins: { | ||
ast: this.astPlugins() | ||
} | ||
}; | ||
} | ||
return htmlbarsOptions; | ||
}, | ||
registerTransforms: function(registry) { | ||
var eachTransform = require('./ext/plugins/transform-each-in-to-hash'); | ||
var withTransform = require('./ext/plugins/transform-with-as-to-hash'); | ||
registry.add('htmlbars-ast-plugin', { | ||
name: 'transform-each-in-to-hash', | ||
plugin: eachTransform | ||
}); | ||
registry.add('htmlbars-ast-plugin', { | ||
name: 'transform-with-as-to-hash', | ||
plugin: withTransform | ||
}); | ||
}, | ||
astPlugins: function() { | ||
var plugins = this.app.registry.load('htmlbars-ast-plugin'); | ||
var pluginFunctions = plugins.map(function(plugin) { | ||
return plugin.plugin; | ||
}); | ||
return pluginFunctions; | ||
} | ||
} |
{ | ||
"name": "ember-cli-htmlbars", | ||
"version": "0.3.2", | ||
"version": "0.3.3", | ||
"description": "A library for adding htmlbars to ember CLI", | ||
@@ -34,4 +34,4 @@ "main": "index.js", | ||
"ember-template-compiler": "^1.9.0-alpha", | ||
"htmlbars": "^0.1.11" | ||
"htmlbars": "^0.1.12" | ||
} | ||
} |
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
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
8817
11
204
Updatedhtmlbars@^0.1.12