Socket
Socket
Sign inDemoInstall

ember-cli-htmlbars

Package Overview
Dependencies
Maintainers
2
Versions
112
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-cli-htmlbars - npm Package Compare versions

Comparing version 0.7.8 to 0.7.9

test/utils_test.js

2

ember-addon-main.js

@@ -77,3 +77,3 @@ 'use strict';

isHTMLBars: true,
FEATURES: EmberENV.FEATURES,
EmberENV: EmberENV,
templateCompiler: require(templateCompilerPath),

@@ -80,0 +80,0 @@

@@ -41,6 +41,13 @@ 'use strict';

TemplateCompiler.prototype.initializeFeatures = function initializeFeatures() {
var EmberENV = this.options.EmberENV;
var FEATURES = this.options.FEATURES;
var templateCompiler = this.options.templateCompiler;
utils.initializeFeatures(templateCompiler, FEATURES);
if (FEATURES) {
console.warn('Using `options.FEATURES` with ember-cli-htmlbars is deprecated. Please provide the full EmberENV as options.EmberENV instead.');
EmberENV = EmberENV || {};
EmberENV.FEATURES = FEATURES;
}
utils.initializeEmberENV(templateCompiler, EmberENV);
};

@@ -47,0 +54,0 @@

{
"name": "ember-cli-htmlbars",
"version": "0.7.8",
"version": "0.7.9",
"description": "A library for adding htmlbars to ember CLI",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -29,6 +29,2 @@ 'use strict';

afterEach(function() {
});
it('precompiles templates into htmlbars', function(){

@@ -47,3 +43,3 @@ var tree = templateCompilerFilter(sourcePath, htmlbarsOptions);

it('passes FEATURES to compiler', function(){
it('passes FEATURES to compiler when provided as `FEATURES` [DEPRECATED]', function(){
htmlbarsOptions.FEATURES = {

@@ -64,2 +60,22 @@ 'ember-htmlbars-component-generation': true

});
it('passes FEATURES to compiler when provided as `EmberENV.FEATURES`', function(){
htmlbarsOptions.EmberENV = {
FEATURES: {
'ember-htmlbars-component-generation': true
}
};
var tree = templateCompilerFilter(sourcePath, htmlbarsOptions);
builder = new broccoli.Builder(tree);
return builder.build().then(function(results) {
var actual = fs.readFileSync(results.directory + '/web-component-template.js', { encoding: 'utf8'});
var source = fs.readFileSync(sourcePath + '/web-component-template.hbs', { encoding: 'utf8' });
var expected = 'export default Ember.HTMLBars.template(' + htmlbarsPrecompile(source, { moduleName: 'web-component-template.hbs' }) + ');';
assert.equal(actual,expected,'They dont match!');
});
});
});
'use strict';
module.exports = {
initializeFeatures: function(templateCompiler, FEATURES) {
if (FEATURES && templateCompiler) {
for (var feature in FEATURES) {
templateCompiler._Ember.FEATURES[feature] = FEATURES[feature];
}
initializeEmberENV: function(templateCompiler, EmberENV) {
if (!templateCompiler || !EmberENV) { return; }
var props;
if (EmberENV.FEATURES) {
props = Object.keys(EmberENV.FEATURES);
props.forEach(function(prop) {
templateCompiler._Ember.FEATURES[prop] = EmberENV.FEATURES[prop];
});
}
if (EmberENV) {
props = Object.keys(EmberENV);
props.forEach(function(prop) {
if (prop === 'FEATURES') { return; }
templateCompiler._Ember.ENV[prop] = EmberENV[prop];
});
}
},

@@ -11,0 +27,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc